code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
<html>
<head>
<title>Mena Suvari's panel show appearances</title>
<script type="text/javascript" src="../common.js"></script>
<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>
<script type="text/javascript" src="../people.js"></script>
<!--#include virtual="head.txt" -->
</head>
<body>
<!--#include virtual="nav.txt" -->
<div class="page">
<h1>Mena Suvari's panel show appearances</h1>
<p>Mena Suvari (born 1979-02-13<sup><a href="https://en.wikipedia.org/wiki/Mena_Suvari">[ref]</a></sup>) has appeared in <span class="total">1</span> episodes between 2012-2012. <a href="http://www.imdb.com/name/nm0002546">Mena Suvari on IMDB</a>. <a href="https://en.wikipedia.org/wiki/Mena_Suvari">Mena Suvari on Wikipedia</a>.</p>
<div class="performerholder">
<table class="performer">
<tr style="vertical-align:bottom;">
<td><div style="height:100px;" class="performances female" title="1"></div><span class="year">2012</span></td>
</tr>
</table>
</div>
<ol class="episodes">
<li><strong>2012-10-08</strong> / <a href="../shows/never-mind-the-buzzcocks.html">Never Mind The Buzzcocks</a></li>
</ol>
</div>
</body>
</html>
|
slowe/panelshows
|
people/1xaaahp2.html
|
HTML
|
mit
| 1,163
|
import numpy as np
def index2onehot(n_labels, index):
return np.eye(n_labels)[index]
# From https://github.com/lisa-lab/DeepLearningTutorials/blob/master/code/utils.py
def scale_to_unit_interval(ndar, eps=1e-8):
""" Scales all values in the ndarray ndar to be between 0 and 1 """
ndar = ndar.copy()
ndar -= ndar.min()
ndar *= 1.0 / (ndar.max() + eps)
return ndar
# From https://github.com/lisa-lab/DeepLearningTutorials/blob/master/code/utils.py
def tile_raster_images(X, img_shape, tile_shape, tile_spacing=(0, 0),
scale_rows_to_unit_interval=True,
output_pixel_vals=True):
"""
Transform an array with one flattened image per row, into an array in
which images are reshaped and layed out like tiles on a floor.
This function is useful for visualizing datasets whose rows are images,
and also columns of matrices for transforming those rows
(such as the first layer of a neural net).
:type X: a 2-D ndarray or a tuple of 4 channels, elements of which can
be 2-D ndarrays or None;
:param X: a 2-D array in which every row is a flattened image.
:type img_shape: tuple; (height, width)
:param img_shape: the original shape of each image
:type tile_shape: tuple; (rows, cols)
:param tile_shape: the number of images to tile (rows, cols)
:param output_pixel_vals: if output should be pixel values (i.e. int8
values) or floats
:param scale_rows_to_unit_interval: if the values need to be scaled before
being plotted to [0,1] or not
:returns: array suitable for viewing as an image.
(See:`Image.fromarray`.)
:rtype: a 2-d array with same dtype as X.
"""
assert len(img_shape) == 2
assert len(tile_shape) == 2
assert len(tile_spacing) == 2
# The expression below can be re-written in a more C style as
# follows :
#
# out_shape = [0,0]
# out_shape[0] = (img_shape[0]+tile_spacing[0])*tile_shape[0] -
# tile_spacing[0]
# out_shape[1] = (img_shape[1]+tile_spacing[1])*tile_shape[1] -
# tile_spacing[1]
out_shape = [
(ishp + tsp) * tshp - tsp
for ishp, tshp, tsp in zip(img_shape, tile_shape, tile_spacing)
]
if isinstance(X, tuple):
assert len(X) == 4
# Create an output numpy ndarray to store the image
if output_pixel_vals:
out_array = np.zeros((out_shape[0], out_shape[1], 4),
dtype='uint8')
else:
out_array = np.zeros((out_shape[0], out_shape[1], 4),
dtype=X.dtype)
#colors default to 0, alpha defaults to 1 (opaque)
if output_pixel_vals:
channel_defaults = [0, 0, 0, 255]
else:
channel_defaults = [0., 0., 0., 1.]
for i in xrange(4):
if X[i] is None:
# if channel is None, fill it with zeros of the correct
# dtype
dt = out_array.dtype
if output_pixel_vals:
dt = 'uint8'
out_array[:, :, i] = np.zeros(
out_shape,
dtype=dt
) + channel_defaults[i]
else:
# use a recurrent call to compute the channel and store it
# in the output
out_array[:, :, i] = tile_raster_images(
X[i], img_shape, tile_shape, tile_spacing,
scale_rows_to_unit_interval, output_pixel_vals)
return out_array
else:
# if we are dealing with only one channel
H, W = img_shape
Hs, Ws = tile_spacing
# generate a matrix to store the output
dt = X.dtype
if output_pixel_vals:
dt = 'uint8'
out_array = np.zeros(out_shape, dtype=dt)
for tile_row in xrange(tile_shape[0]):
for tile_col in xrange(tile_shape[1]):
if tile_row * tile_shape[1] + tile_col < X.shape[0]:
this_x = X[tile_row * tile_shape[1] + tile_col]
if scale_rows_to_unit_interval:
# if we should scale values to be between 0 and 1
# do this by calling the `scale_to_unit_interval`
# function
this_img = scale_to_unit_interval(
this_x.reshape(img_shape))
else:
this_img = this_x.reshape(img_shape)
# add the slice to the corresponding position in the
# output array
c = 1
if output_pixel_vals:
c = 255
out_array[
tile_row * (H + Hs): tile_row * (H + Hs) + H,
tile_col * (W + Ws): tile_col * (W + Ws) + W
] = this_img * c
return out_array
|
briancheung/Peano
|
peano/utils.py
|
Python
|
mit
| 5,009
|
<?php
declare(strict_types=1);
namespace Skeleton\Application\Todo;
use RuntimeException;
use Skeleton\Domain\Todo;
use Skeleton\Domain\TodoRepository;
class ReplaceTodoHandler
{
private $repository;
private $hydrator;
public function __construct(TodoRepository $repository)
{
$this->repository = $repository;
$this->hydrator = (new TodoHydratorFactory)->create();
}
public function handle(ReplaceTodoCommand $command): void
{
$data = $command->asArray();
$todo = $this->repository->get($command->uid());
$todo = $this->hydrator->hydrate($data, $todo);
$todo->touch();
$this->repository->add($todo);
}
}
|
tuupola/slim-api-skeleton
|
src/Application/Todo/ReplaceTodoHandler.php
|
PHP
|
mit
| 697
|
from yaml import load_all
try:
from yaml import CLoader as Loader
except ImportError:
print("Using pure python YAML loader, it may be slow.")
from yaml import Loader
from iengine import IDocumentFormatter
__author__ = 'reyoung'
class YAMLFormatter(IDocumentFormatter):
def __init__(self, fn=None, content=None):
IDocumentFormatter.__init__(self)
if fn is not None:
with file(fn, "r") as f:
self.__content = load_all(f, Loader=Loader)
else:
self.__content = load_all(content, Loader=Loader)
def get_command_iterator(self, *args, **kwargs):
for item in self.__content:
yield YAMLFormatter.__process_item(item)
@staticmethod
def __process_item(item):
if isinstance(item, dict) and len(item) == 1:
key = item.iterkeys().__iter__().next()
value = item[key]
return key, value
|
reyoung/SlideGen2
|
slidegen2/yaml_formatter.py
|
Python
|
mit
| 933
|
/* CUBE demo toolkit by MasterM/Asenses */
#include <stdafx.h>
#include <core/system.h>
#include <utils/notify.h>
#include <utils/parameter.h>
#include <classes/shader.h>
#include <classes/texture.h>
#include <classes/framebuffer.h>
using namespace CUBE;
std::string Shader::Prefix("shaders\\");
std::string ImageShader::VertexShaderName("image");
Shader::Shader()
: notifyHandler(this), nullUniform(this),
vs(0), fs(0), gs(0), cs(0)
{
program = gltry(glCreateProgram());
}
Shader::Shader(const std::string& path)
: name(path), path(Prefix+path), notifyHandler(this), nullUniform(this),
vs(0), fs(0), gs(0), cs(0)
{
program = gltry(glCreateProgram());
vs = CompileShader(GL_VERTEX_SHADER);
fs = CompileShader(GL_FRAGMENT_SHADER);
gs = CompileShader(GL_GEOMETRY_SHADER);
if(vs) gltry(glAttachShader(program, vs));
if(fs) gltry(glAttachShader(program, fs));
if(gs) gltry(glAttachShader(program, gs));
LinkProgram();
}
Shader::~Shader()
{
DeleteProgram();
}
std::string Shader::GetShaderFilename(GLenum type) const
{
switch(type) {
case GL_VERTEX_SHADER:
return path+"_vs.glsl";
case GL_FRAGMENT_SHADER:
return path+"_fs.glsl";
case GL_GEOMETRY_SHADER:
return path+"_gs.glsl";
default:
assert(0);
}
return std::string();
}
std::string Shader::GetInfoLog(const GLuint id, GLenum type) const
{
GLsizei infoLogSize;
if(type == GL_PROGRAM) {
gltry(glGetProgramiv(id, GL_INFO_LOG_LENGTH, &infoLogSize));
if(infoLogSize > 0) {
std::unique_ptr<GLchar[]> infoLog(new GLchar[infoLogSize]);
gltry(glGetProgramInfoLog(id, infoLogSize, NULL, infoLog.get()));
return std::string(infoLog.get());
}
}
else {
gltry(glGetShaderiv(id, GL_INFO_LOG_LENGTH, &infoLogSize));
if(infoLogSize > 0) {
std::unique_ptr<GLchar[]> infoLog(new GLchar[infoLogSize]);
gltry(glGetShaderInfoLog(id, infoLogSize, NULL, infoLog.get()));
return std::string(infoLog.get());
}
}
return std::string();
}
GLuint Shader::CompileShader(GLenum type)
{
const std::string filename = GetShaderFilename(type);
std::ifstream file(filename.c_str());
if(!file.is_open())
return 0;
GLuint shader = gltry(glCreateShader(type));
{
std::string source((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
const GLchar* inSource[] = { source.c_str() };
const GLint inLength[] = { source.length() };
gltry(glShaderSource(shader, 1, inSource, inLength));
}
CUBE_LOG("Compiling shader: %s\n", filename.c_str());
gltry(glCompileShader(shader));
#ifdef CUBE_DEBUG
{
std::string infoLog(GetInfoLog(shader, type));
if(infoLog.find_first_not_of(" \t\n\r") != std::string::npos)
CUBE_LOG("\n%s\n", infoLog.c_str());
}
#endif
GLint status;
gltry(glGetShaderiv(shader, GL_COMPILE_STATUS, &status));
if(GL_TRUE != status) {
gltry(glDeleteShader(shader));
throw std::runtime_error("Shader compilation failed.");
}
#ifdef CUBE_DEBUG
Core::System::Instance()->NotifyService->RegisterHandler(filename, ¬ifyHandler);
#endif
return shader;
}
bool Shader::ReloadShader(GLenum type, GLuint& id)
{
GLuint newId;
try {
newId = CompileShader(type);
if(!newId)
throw std::runtime_error("Cannot read shader source file.");
}
catch(std::runtime_error& error) {
CUBE_LOG("Reload failed: %s\n", error.what());
return false;
}
gltry(glDetachShader(program, id));
gltry(glDeleteShader(id));
id = newId;
gltry(glAttachShader(program, id));
LinkProgram();
return true;
}
void Shader::DeleteShader(GLenum type, GLuint& id)
{
#ifdef CUBE_DEBUG
Core::System::Instance()->NotifyService->UnregisterHandler(GetShaderFilename(type));
#endif
gltry(glDetachShader(program, id));
gltry(glDeleteShader(id));
id = 0;
}
void Shader::LinkProgram()
{
CUBE_LOG("Linking shader program: %s\n", path.c_str());
gltry(glLinkProgram(program));
GLint status;
gltry(glGetProgramiv(program, GL_LINK_STATUS, &status));
#ifdef CUBE_DEBUG
if(GL_TRUE == status) {
gltry(glValidateProgram(program));
gltry(glGetProgramiv(program, GL_VALIDATE_STATUS, &status));
}
{
std::string infoLog(GetInfoLog(program, GL_PROGRAM));
if(infoLog.find_first_not_of(" \t\n\r") != std::string::npos)
CUBE_LOG("\n%s\n", infoLog.c_str());
}
#endif
if(GL_TRUE != status) {
DeleteProgram();
throw std::runtime_error("Shader program linking failed.");
}
ValidateUniforms();
CreateParameters();
}
void Shader::DeleteProgram()
{
uniformParameters.remove_if([](ShaderParameter* p) { delete p; return true; });
uniformCache.clear();
if(vs) DeleteShader(GL_VERTEX_SHADER, vs);
if(fs) DeleteShader(GL_FRAGMENT_SHADER, fs);
if(gs) DeleteShader(GL_GEOMETRY_SHADER, gs);
if(cs) DeleteShader(GL_COMPUTE_SHADER, cs);
gltry(glDeleteProgram(program));
program=0;
}
void Shader::NotifyHandler::operator()(const std::string& filename)
{
auto Suffix = [](const std::string& a, const std::string& b) {
if(b.size() > a.size()) return false;
return std::equal(a.begin() + a.size() - b.size(), a.end(), b.begin());
};
if(Suffix(filename, "_vs.glsl")) {
if(shader->vs)
shader->ReloadShader(GL_VERTEX_SHADER, shader->vs);
}
else if(Suffix(filename, "_fs.glsl")) {
if(shader->fs)
shader->ReloadShader(GL_FRAGMENT_SHADER, shader->fs);
}
else if(Suffix(filename, "_gs.glsl")) {
if(shader->gs)
shader->ReloadShader(GL_GEOMETRY_SHADER, shader->gs);
}
else if(Suffix(filename, "_cs.glsl")) {
if(shader->cs)
shader->ReloadShader(GL_COMPUTE_SHADER, shader->cs);
}
else {
CUBE_LOG("Warning: Received shader reload event for unknown filename: %s\n", filename.c_str());
}
}
Shader::Uniform* Shader::GetUniform(const std::string& name) const
{
auto it = uniformCache.find(name);
if(it != uniformCache.end())
return &it->second;
GLint location = gltry(glGetUniformLocation(program, name.c_str()));
if(location == -1)
return &nullUniform;
return &uniformCache.insert({name, Shader::Uniform(this, location)}).first->second;
}
Shader::Uniform& Shader::operator[](const std::string& name) const
{
auto it = uniformCache.find(name);
if(it != uniformCache.end())
return it->second;
GLint location = gltry(glGetUniformLocation(program, name.c_str()));
if(location == -1)
return nullUniform;
return uniformCache.insert({name, Shader::Uniform(this, location)}).first->second;
}
void Shader::ValidateUniforms()
{
globalTime = glGetUniformLocation(program, "GlobalTime");
cameraMatrix = glGetUniformLocation(program, "CameraMatrix");
cameraPosition = glGetUniformLocation(program, "CameraPosition");
modelMatrix = glGetUniformLocation(program, "ModelMatrix");
normalMatrix = glGetUniformLocation(program, "NormalMatrix");
for(auto it=uniformCache.begin(); it!=uniformCache.end();) {
GLint location = gltry(glGetUniformLocation(program, it->first.c_str()));
if(location == -1) {
CUBE_LOG("Warning: Removed shader uniform %s::%s\n", name.c_str(), it->first.c_str());
uniformCache.erase(it++);
}
else {
it->second.location = location;
++it;
}
}
}
void Shader::CreateParameters()
{
uniformParameters.remove_if([](ShaderParameter* p) { delete p; return true; });
GLint count;
GLchar namebuf[256];
gltry(glGetProgramiv(program, GL_ACTIVE_UNIFORMS, &count));
for(GLint i=0; i<count; i++) {
GLint size;
GLenum type;
GLsizei namelen;
Parameter::Type ptype;
gltry(glGetActiveUniform(program, i, 256, &namelen, &size, &type, namebuf));
if(size != 1 || namelen < 3 || namebuf[0] != 'p')
continue;
switch(type) {
case GL_INT: ptype = Parameter::Int; break;
case GL_FLOAT: ptype = Parameter::Float; break;
case GL_FLOAT_VEC2: ptype = Parameter::Vec2; break;
case GL_FLOAT_VEC3: ptype = Parameter::Vec3; break;
case GL_FLOAT_VEC4: ptype = Parameter::Vec4; break;
default: continue;
}
if(ptype == Parameter::Vec3 && namebuf[1] == 'c')
ptype = Parameter::Color3;
if(ptype == Parameter::Vec3 && namebuf[1] == 'v')
ptype = Parameter::Dir3;
if(ptype == Parameter::Vec4 && namebuf[1] == 'c')
ptype = Parameter::Color4;
uniformParameters.push_back(new ShaderParameter(this, namebuf, ptype));
}
}
bool Shader::SetGlobalTime(float time) const
{
if(globalTime != -1) {
gltry(glUniform1f(globalTime, time));
return true;
}
return false;
}
bool Shader::SetCameraMatrix(const mat4& matrix) const
{
if(cameraMatrix != -1) {
gltry(glUniformMatrix4fv(cameraMatrix, 1, GL_FALSE, glm::value_ptr(matrix)));
return true;
}
return false;
}
bool Shader::SetCameraMatrix(const mat4& projection, const mat4& view) const
{
if(cameraMatrix != -1) {
mat4 matrix = projection * view;
gltry(glUniformMatrix4fv(cameraMatrix, 1, GL_FALSE, glm::value_ptr(matrix)));
return true;
}
return false;
}
bool Shader::SetModelMatrix(const mat4& matrix) const
{
if(modelMatrix != -1) {
gltry(glUniformMatrix4fv(modelMatrix, 1, GL_FALSE, glm::value_ptr(matrix)));
if(normalMatrix != -1)
gltry(glUniformMatrix4fv(normalMatrix, 1, GL_FALSE, glm::value_ptr(glm::inverseTranspose(matrix))));
return true;
}
return false;
}
bool CUBE::Shader::SetCameraPosition(const vec3& position) const
{
if(cameraPosition != -1) {
gltry(glUniform3f(cameraPosition, position.x, position.y, position.z));
return true;
}
return false;
}
bool Shader::IsActive() const
{
return ActiveShader::Stack.Current() && ActiveShader::Stack.Current()->InstanceOf(this);
}
Shader* Shader::Current()
{
if(ActiveShader::Stack.Current())
return ActiveShader::Stack.Current()->ptr();
return nullptr;
}
ImageShader::ImageShader(const std::string& path) : Shader()
{
this->name = path;
this->path = Prefix+path;
vs = CompileShader(GL_VERTEX_SHADER);
fs = CompileShader(GL_FRAGMENT_SHADER);
if(vs) gltry(glAttachShader(program, vs));
if(fs) gltry(glAttachShader(program, fs));
LinkProgram();
}
ImageShader::~ImageShader()
{
if(vs) DeleteShader(GL_VERTEX_SHADER, vs);
if(fs) DeleteShader(GL_FRAGMENT_SHADER, fs);
}
std::string ImageShader::GetShaderFilename(GLenum type) const
{
switch(type) {
case GL_VERTEX_SHADER:
return Prefix+VertexShaderName+"_vs.glsl";
case GL_FRAGMENT_SHADER:
return path+"_fs.glsl";
default:
assert(0);
}
return std::string();
}
void ImageShader::Draw(const BlendFunc& blendFunc)
{
const GLboolean blendingEnabled = glIsEnabled(GL_BLEND);
if(!blendingEnabled) {
gltry(glEnable(GL_BLEND));
}
gltry(glBlendFunc(blendFunc.SourceFactor, blendFunc.DestFactor));
{
ActiveShader shader(*this);
Core::System::Instance()->DrawScreenQuad();
}
gltry(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
if(!blendingEnabled) {
gltry(glDisable(GL_BLEND));
}
}
void ImageShader::Draw(Texture& input, const BlendFunc& blendFunc)
{
ActiveTexture texture(0, input);
Draw(blendFunc);
}
void ImageShader::Draw(Texture& input, FrameBuffer& output, const BlendFunc& blendFunc)
{
ActiveTexture texture(0, input);
DrawFrameBuffer drawfb(output);
Draw(blendFunc);
}
ComputeShader::ComputeShader(const std::string& path) : Shader()
{
this->name = path;
this->path = Prefix+path;
cs = CompileShader(GL_COMPUTE_SHADER);
if(cs) gltry(glAttachShader(program, cs));
LinkProgram();
}
ComputeShader::~ComputeShader()
{
if(cs) DeleteShader(GL_COMPUTE_SHADER, cs);
}
std::string ComputeShader::GetShaderFilename(GLenum type) const
{
switch(type) {
case GL_COMPUTE_SHADER:
return path+"_cs.glsl";
default:
assert(0);
}
return std::string();
}
void ComputeShader::Dispatch(const Dim& groups) const
{
gltry(glDispatchCompute(groups.GetWidth(), groups.GetHeight(), groups.GetDepth()));
}
void ComputeShader::DispatchSync(const Dim& groups, const GLenum barrier) const
{
gltry(glDispatchCompute(groups.GetWidth(), groups.GetHeight(), groups.GetDepth()));
gltry(glMemoryBarrier(barrier));
}
CUBE_STACK(ActiveShader);
ActiveShader::ActiveShader(Shader& s) : ActiveObject(s)
{
CUBE_PUSH;
gltry(glUseProgram(objectPtr->program));
objectPtr->SetGlobalTime(Core::System::Instance()->GetTime());
}
ActiveShader::~ActiveShader()
{
gltry(glUseProgram(0));
CUBE_POP;
}
|
Nadrin/CUBE
|
src/classes/shader.cpp
|
C++
|
mit
| 12,000
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30311.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DynamicSissOnline {
public partial class EnumerationFilter {
protected global::System.Web.UI.WebControls.DropDownList DropDownList1;
}
}
|
marcobaccaro/general
|
DynamicSissOnline/DynamicSissOnline/DynamicData/Filters/Enumeration.ascx.designer.cs
|
C#
|
mit
| 562
|
#!/usr/bin/env ruby
current_dir = File.dirname(File.expand_path(__FILE__))
lib_path = File.join(current_dir, '..', 'lib')
$LOAD_PATH.unshift lib_path
require 'rubygems'
require 'idclight'
include IDConverter::Light
code = 0
puts "\n"
puts "IDCLight (IDConverter Light) command-line converter utility. (Uses http://idclight.bioinfo.cnio.es for data.)"
org = @@HUMAN
if ARGV.length >= 2 and ARGV.length <= 3
id_type = ARGV[0]
id = ARGV[1]
org = ARGV[2] unless ARGV[2].nil?
r = search(id_type, id, org)
if r.nil?
puts "No result. Bad input, perhaps? :/"
code = 1
else
puts r
end
else
puts "\n\tUsage: #{__FILE__} <id_type> <id> [organism (defaults to human)]"
puts <<EOF
From the website:
idtype refers to the type of ID from which you want to obtain further information.
Current options are: ug (UniGene cluster), entrez (EntrezGene ID),
ensembl (Ensembl Gene), hugo (HUGO Gene Name), acc (GenBank accession),
clone (Clone ID), affy (Affymetrix ID), rsdna (RefSeq_RNA),
rspep (RefSeq_peptide), and swissp (SwissProt name).
id is the ID of the gene or clone for which more information is required.
org is the organism you are working with. Three different organisms are available
Hs (Human - Homo sapiens), Mm (Mouse - Mus musculus), and Rn (Rat - Rattus norvegicus).
EOF
end
puts "\n"
exit(code)
|
tgen/idclight
|
bin/idclight_convert.rb
|
Ruby
|
mit
| 1,338
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="">
<meta name="author" content="">
<!-- Mobile Specific Data -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Knave GmBH | Subscription</title>
<!-- Stylesheets -->
<style><?php readfile(getcwd() . "/../../critical/preset-critical.css"); ?></style>
<link rel="stylesheet" href="../../stylesheets/css/subscribe.css">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.google.com/" crossorigin>
<!-- Cookie of Fonts -->
<script>
(function () {
if (sessionStorage.fonts) {
console.log("Fonts installed over last session.");
document.documentElement.classList.add('wf-active');
} else {
console.log("Required fonts not yet installed/cached.");
}
})();
</script>
<!-- Dummy Stylesheet GPS-->
<noscript id="dummy-stylesheet">
<link rel="stylesheet" href="../../stylesheets/css/dummysheet.css">
</noscript>
<!-- LoadCss -->
<link rel="preload"
href="../../stylesheets/css/styles.css"
as="style" onload="this.rel='stylesheet'">
<noscript>
<link rel="stylesheet"
href="../../stylesheets/css/styles.css">
</noscript>
<!-- LoadCss Script -->
<script>
/*! loadCSS. [c]2017 Filament Group, Inc. MIT License */
!function (a) {
"use strict";
var b = function (b, c, d) {
function e(a) {
return h.body ? a() : void setTimeout(function () {
e(a)
})
}
function f() {
i.addEventListener && i.removeEventListener("load", f), i.media = d || "all"
}
var g, h = a.document, i = h.createElement("link");
if (c) g = c; else {
var j = (h.body || h.getElementsByTagName("head")[0]).childNodes;
g = j[j.length - 1]
}
var k = h.styleSheets;
i.rel = "stylesheet", i.href = b, i.media = "only x", e(function () {
g.parentNode.insertBefore(i, c ? g : g.nextSibling)
});
var l = function (a) {
for (var b = i.href, c = k.length; c--;)if (k[c].href === b)return a();
setTimeout(function () {
l(a)
})
};
return i.addEventListener && i.addEventListener("load", f), i.onloadcssdefined = l, l(f), i
};
"undefined" != typeof exports ? exports.loadCSS = b : a.loadCSS = b
}("undefined" != typeof global ? global : this);
/*! loadCSS rel=preload polyfill. [c]2017 Filament Group, Inc. MIT License */
!function (a) {
if (a.loadCSS) {
var b = loadCSS.relpreload = {};
if (b.support = function () {
try {
return a.document.createElement("link").relList.supports("preload")
} catch (b) {
return !1
}
}, b.poly = function () {
for (var b = a.document.getElementsByTagName("link"), c = 0; c < b.length; c++) {
var d = b[c];
"preload" === d.rel && "style" === d.getAttribute("as") && (a.loadCSS(d.href, d, d.getAttribute("media")), d.rel = null)
}
}, !b.support()) {
b.poly();
var c = a.setInterval(b.poly, 300);
a.addEventListener && a.addEventListener("load", function () {
b.poly(), a.clearInterval(c)
}), a.attachEvent && a.attachEvent("onload", function () {
a.clearInterval(c)
})
}
}
}(this);
/*! fallback for sketchy browsers */
/*! onloadCSS. (onload callback for loadCSS) [c]2017 Filament Group, Inc. MIT License */
function onloadCSS(a, b) {
function c() {
!d && b && (d = !0, b.call(a))
}
var d;
a.addEventListener && a.addEventListener("load", c), a.attachEvent && a.attachEvent("onload", c), "isApplicationInstalled" in navigator && "onloadcssdefined" in a && a.onloadcssdefined(c)
}
var stylesheet = loadCSS("../../stylesheets/css/main.css");
onloadCSS(stylesheet, function () {
console.log("Stylesheet has loaded.");
});
</script>
<script></script>
<!-- HTML5Shiv -->
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"
integrity="sha256-3Jy/GbSLrg0o9y5Z5n1uw0qxZECH7C6OQpVBgNFYa0g=" crossorigin="anonymous"></script>
<![endif]-->
</head>
<body class="page-subscribe">
<header class="l__header--primary" id="top" role="banner">
<div class="grid l__header">
<h1 class="logo">
<a class="" href="../../index.php" title="Knave Incorporated Home">Knave Webmail ®</a>
</h1><!-- end of logo -->
<!-- logo for mobile -->
</div>
</header><!-- end of Header -->
<section class="grid">
<div class="ack--container">
<span class="ack__icn ack__icn--subscrb">
<i class="fa fa-envelope-square"></i>
</span>
<header class="ack--header">Thank you for signing up!</header>
<p>Your new account will make all future transactions easier. Also, you get unlimited access to all features on
our website.</p>
<br>
An e-mail has been sent to your inbox to complete the verification process. Depending on your internet
connection, you may have to allow up to <b>30 minutes</b> for the message to arrive.
<div class="panel--padded">
<a class="ack--redir">
<button class="btn--success">
<i class="fa fa-backward"></i>
Return to our website
</button>
</a>
</div>
</div>
</section>
<footer class="l-footer">
<section class="panel--padded--centered">
<h4 class="ack__icn--origin--heading">Powered by</h4>
<span role="presentation">
<a class="site-logo--mail" href="../../index.php" title="Knave Webmail Logo">
<b class="v-hidden">
Knave — A Greyback Company.
</b>
</a><!-- end of mobile logo -->
</span>
</section>
<div class="footer__sec">
<div class="grid">
<span class="footer__sec--lft">
<small class="footer__sec--1-content">©2017 Knave Inc. GmBH, Accra.</small>
</span>
<span class="footer__sec--rt">
<small class="footer__sec--2-content">A Greyback Company</small>
</span>
</div>
</div>
</footer>
<?php $previous = "javascript:history.go(-1)";
if(isset($_SERVER['HTTP_REFERER'])) {
$previous = $_SERVER['HTTP_REFERER'];
} ?>
<!-- Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<!-- LoDash -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"
integrity="sha256-8E6QUcFg1KTnpEU8TFGhpTGHw5fJqB9vCms3OhAYLqw=" crossorigin="anonymous"></script>
<!-- Default Scripts -->
<script src="../../assets/javascript/scripts.js"></script>
<!-- FontAwesome -->
<script src="https://use.fontawesome.com/3eec833028.js"></script>
<!-- Web Font Loader -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.27/webfontloader.js"
integrity="sha256-FL2n/ULq4lZxp5qZGW6boR09sNrvvpsQhjsFxEmcfm8=" crossorigin="anonymous"></script>
<script>
WebFontConfig = {
google: {
families: ['Assistant:200,300,400,600,700,800', 'Ubuntu']
},
timeout: 2400,
// other options and settings
active: function () {
sessionStorage.fonts = true;
}
};
(function (d) {
var wf = d.createElement('script'), s = d.scripts[0];
wf.src = "https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.27/webfontloader.js";
wf.async = true;
s.parentNode.insertBefore(wf, s);
})(document);
</script>
<!-- GPSp Stove -->
<script>
var loadDeferredStyles = function () {
var addStylesNode = document.getElementById("dummy-stylesheet");
var replacement = document.createElement("span");
replacement.innerHTML = addStylesNode.textContent;
document.body.appendChild(replacement);
addStylesNode.parentElement.removeChild(addStylesNode);
};
var raf = requestAnimationFrame || mozRequestAnimationFrame ||
webkitRequestAnimationFrame || msRequestAnimationFrame;
if (raf) raf(function () {
window.setTimeout(loadDeferredStyles, 0);
});
else window.addEventListener('load', loadDeferredStyles);
</script>
</body>
</html>
|
KwesiJnr/ProjectKnave
|
framework/misc/thank-you/member.html
|
HTML
|
mit
| 9,447
|
package com.company.problem4MordorCrueltyPlan.models.mood;
import com.company.problem4MordorCrueltyPlan.models.Mood;
public class JavaScript extends Mood {
}
|
ivelin1936/Studing-SoftUni-
|
Java Fundamentals/Java OOP Basics (old)/Java OOP Basic - Exercises Inheritance/src/com/company/problem4MordorCrueltyPlan/models/mood/JavaScript.java
|
Java
|
mit
| 162
|
Debian
====================
This directory contains files used to package amsterdamcoind/amsterdamcoin-qt
for Debian-based Linux systems. If you compile amsterdamcoind/amsterdamcoin-qt yourself, there are some useful files here.
## amsterdamcoin: URI support ##
amsterdamcoin-qt.desktop (Gnome / Open Desktop)
To install:
sudo desktop-file-install amsterdamcoin-qt.desktop
sudo update-desktop-database
If you build yourself, you will either need to modify the paths in
the .desktop file or copy or symlink your amsterdamcoinqt binary to `/usr/bin`
and the `../../share/pixmaps/amsterdamcoin128.png` to `/usr/share/pixmaps`
amsterdamcoin-qt.protocol (KDE)
|
CoinProjects/AmsterdamCoin-v4
|
contrib/debian/README.md
|
Markdown
|
mit
| 666
|
**Other language**: [English](https://github.com/app360/app360-ios-sdk/blob/master/README.md)
# Giới thiệu
App360SDK cung cấp cách thức đơn giản nhất để quản lý user và tích hợp thanh toán (bao gồm sms, thẻ điện thoại và e-banking) vào ứng dụng của bạn.
App360 iOS SDK hỗ trợ iOS từ 6.0 trở lên
# Yêu cầu
##Môi trường phát triển
| App360SDK Version | Minimum iOS Target | Notes |
|:-----------------:|:------------------:|:----------------------------:|
|1.4.0|6.0|Xcode 6.1 is required. Support armv7, armv7s and arm64 architectures (+ i386 for the simulator)|
### Tương thích
App360 iOS SDK hỗ trợ tất cả iOS từ 6.0 trở lên. Hỗ trợ armv7, armv7s and arm64 architectures (+ i386 cho simulator).
### Xcode
Chúng tôi sử dụng Xcode 6.3.2 để viết project demo và SDK. Bạn có thể gặp một số lỗi nếu mở trên những phiên bản Xcode cũ hơn. Đó là lý do vì sao chúng tôi khuyên bạn sử dụng phiên bản mới nhất (non-beta) khả dụng.
# Bắt đầu với project Demo
Bạn cần clone hoặc download repository này về máy của bạn.
- `git clone https://github.com/app360/app360-ios-sdk.git`
- Or, download from https://github.com/app360/app360-ios-sdk/releases
Mở file AppDelegate.m trong demo project, tìm dòng initializeWithApplicationId và thay thế placeholder bằng cặp application id và secret key tương ứng với ứng dụng của bạn.
Chạy project. Ứng dụng mô tả cho bạn khả năng cũng như cách tích hợp của App360SDK, bao gồm cả app-scoped ID và payment (thanh toán).
# 6 bước để tích hợp với App360SDK
## 1. Tạo tài khoản
Việc đầu tiên bạn cần làm là [đăng ký một tài khoản miễn phí](https://developers.app360.vn/) trên App360. Sau khi có tài khoản, bạn có thể truy cập vào App360 dashboard để tạo và quản lý các ứng dụng của bạn.
## 2. Tạo ứng dụng
Để tích hợp với App360SDK, bạn cần phải tạo một ứng dụng trên trang developer của App360. Mỗi ứng dụng sẽ có một cặp key (app id và app secret). Cặp key này sẽ được dùng để xác thực với server của SDK
## 3. Tải SDK
Có rất nhiều các để tải App360SDK vào project Xcode. Bạn có thể dùng CocoaPods hoặc tự tay tải và thêm framework cùng các thư viện liên quan vào project
> ### Cocoapod (Coming soon)
> CocoaPods là cách nhanh nhất để tải và chạy App360SDK trên ứng dụng iOS. Chỉ cần thêm dòng dưới đây vào Podfile và gọi lệnh `pod install`
> ```
pod 'App360SDK', '>= 1.4.0'
```
> ### Tải App360SDK
> Bạn có thể tải iOS SDK ngay từ repo này. Giải nén App360SDK, kéo App360SDK và các framework kèm theo vào project của bạn
## 4. Tích hợp SDK
### Frameworks & Dependencies
App360 SDK phụ thuộc vào một số framework khác. Bạn cần thêm chúng vào project của mình. Cụ thể thêm những framework sau:
| Framework |
|-----------|
|SystemConfiguration.framework|
|CoreMobileServices.framework|
|CoreTelephony.framework|
### Classes & Categories
App360 framework sử dụng class và categories Objective-C nên bạn cần phải thêm cờ sau vào mục "Other Linker Flags" trong Build Settings:
```
-ObjC
```
### Không tìm thấy lựa chọn "Other Linker Flags"?
Nếu bạn không tìm thấy mục "Other Linker Flags", bạn cần chắc chắn tab được chọn ở góc trên bên trái của Build Settings là "All" và "Combined" chứ không phải "Basic" và Levels". "Other Linker Flags" được đặt trong chuyên mục con "Linking"
## 5. Thêm file config của App360
Để hỗ trợ mô hình channeling, trong project cần chứa một file plist với tên `app360.plist`. File này chứa hai key là `channel` and `sub_channel`. `channel` là kênh phân phối, ví dụ như mwork, appota còn `sub_channel` là một chuỗi bất kì được định nghĩa bới kênh phân phối.
Bạn có thể lấy file này từ project demo hoặc download [tại đây](#)
## 6. Bắt đầu code
### 6.1. Khởi tạo SDK
SDK được khởi tạo thông qua class App360SDK.
Mở class AppDelegate và import App360SDK như sau:
```Objective-C
#import <App360SDK/App360SDK.h>
```
Trong phương thức `application:didFinishLaunchingWithOptions`, gọi hàm khởi tạo của App360SDK
```Objective-C
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[App360SDK initializeWithApplicationId:@"your-app-id"
clientKey:@"your-app-secret"];
//Your code
}
```
Bạn có thể lấy `appID` và `appSecret` trong code mẫu bên trên từ App360 dashboard. Đăng nhập vào tài khoản của bạn, chọn ứng dụng mà bạn đang tích hợp, bạn sẽ thấy key bạn cần trong tab `Information`

### 6.2. Khởi tạo session
Sau khi khởi tạo SDK, bạn cần phải tạo appscoped session. Tất cả các API của App360SDK đều cần chạy trên một session nào đó.
Để tạo một session, gọi `openActiveSessionWithScopeId:userInfo:block:` trong `MOGSessionManager` class
```Objective-C
[MOGSessionManager openActiveSessionWithScopeId:@"scoped-id" userInfo:nil block:^(MOGSession *session, NSError *error) {
if (session) {
//Create appscoped-id session successfully!
//After session create, you can access info of current user via:
MOGScopedUser *currentUser = [MOGScopedUser getCurrentUser];
NSLog(@"Scoped-id of current user: %@, come from channel: %@, subChannel: %@", currentUser.scopedId, currentUser.channel, currentUser.subChannel);
} else {
//Something went wrong! Check error object for more information
NSLog(@"Create session failed. Error: %@", error.description);
}
}];
```
Giá trị `scoped-id` nên đặt là gì?
- Nếu game/app của bạn có user, `scoped-id` nên được đặt với giá trị bằng với user id trong hệ thống của bạn và nên được gọi ngay sau khi xác thực xong user.
- Nếu game/app của bạn không có user, `scoped-id` nên được đặt theo device id và bạn có thể gọi hàm này sớm nhất có thể. Chúng tôi gợi ý bạn có thể gọi ngay sau khi gọi hàm khởi tạo SDK.
Xin chúc mừng. Bạn đã tích hợp xong cơ bản App360SDK
# Làm gì tiếp theo?
- Xem thêm [tài liệu của chúng tôi](http://docs.app360.vn/) để biết thêm những thông tin chi tiết về các hàm của App360SDK.
- Tích hợp với [Payment API](http://docs.app360.vn/?page_id=271)
- Nếu gặp bất kì vấn đề gì, vui lòng xem qua [trang FAG](http://docs.app360.vn/?page_id=228) hoặc gửi yêu cầu hỗ trợ cho chúng tôi
# Hỗ trợ
Vui lòng liên hệ với [chúng tôi](mailto:support@app360.vn) về những vấn đề chung.
## Về những vấn đề kỹ thuật
Trong trường hợp bạn có những vấn đề về kỹ thuật, vui lòng liên hệ với [đội kỹ thuật của chúng tôi](mailto:support@app360.vn).
Vui lòng cung cấp những thông tin sau khi liên hệ, chúng sẽ giúp chúng tôi hỗ trợ bạn nhanh hơn rất nhiều.
- **Phiên bản của SDK** bạn đang sử dụng. Bạn có thể biết được phiên bản của SDK thông qua việc gọi hàm `[App360SDK getSDKVersion];`.
- **Môi trường** có thể tái hiện lại vấn đề (máy ảo hay thiết bị? thiết bị gì? iOS phiên bản bao nhiêu?)
- **Các bước** để tái hiện vấn đề.
- Nếu có thể, bạn hãy cung cấp **một vài đoạn code**, thậm chí cả project nếu có thể.
> Để biết thêm thông tin chi tiết, vui lòng truy cập https://docs.app360.vn.
|
app360/app360-ios-sdk
|
README-VI.md
|
Markdown
|
mit
| 8,197
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mathcomp-character: 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.11.2 / mathcomp-character - 1.6</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
mathcomp-character
<small>
1.6
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-08-17 11:46:38 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-08-17 11:46:38 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.11.2 Formal proof management system
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.10.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.10.0 Official release 4.10.0
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
name: "coq-mathcomp-character"
version: "1.6"
maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>"
homepage: "http://ssr.msr-inria.inria.fr/"
bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>"
license: "CeCILL-B"
build: [ make "-C" "mathcomp/character" "-j" "%{jobs}%" ]
install: [ make "-C" "mathcomp/character" "install" ]
remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/mathcomp/character'" ]
depends: [
"ocaml"
"coq-mathcomp-field" {= "1.6"}
]
tags: [ "keyword:algebra" "keyword:character" "keyword:small scale reflection" "keyword:mathematical components" "keyword:odd order theorem" ]
authors: [ "Jeremy Avigad <>" "Andrea Asperti <>" "Stephane Le Roux <>" "Yves Bertot <>" "Laurence Rideau <>" "Enrico Tassi <>" "Ioana Pasca <>" "Georges Gonthier <>" "Sidi Ould Biha <>" "Cyril Cohen <>" "Francois Garillot <>" "Alexey Solovyev <>" "Russell O'Connor <>" "Laurent Théry <>" "Assia Mahboubi <>" ]
synopsis: "Mathematical Components Library on character theory"
description: """
This library contains definitions and theorems about group
representations, characters and class functions."""
url {
src: "http://github.com/math-comp/math-comp/archive/mathcomp-1.6.tar.gz"
checksum: "md5=038ba80c0d6b430428726ae4d00affcf"
}
</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-character.1.6 coq.8.11.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.11.2).
The following dependencies couldn't be met:
- coq-mathcomp-character -> coq-mathcomp-field < 1.6.1 -> coq-mathcomp-solvable < 1.6.1 -> coq-mathcomp-algebra < 1.6.1 -> coq-mathcomp-fingroup < 1.6.1 -> coq-mathcomp-ssreflect < 1.6.1 -> 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-mathcomp-character.1.6</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.0-2.0.6/released/8.11.2/mathcomp-character/1.6.html
|
HTML
|
mit
| 7,706
|
using System;
namespace Rothko.UI.Interfaces.Components
{
public interface IMultiDirectionable
{
Directions Directions { get; set; }
}
}
|
t-recx/Rothko
|
Rothko.UI/Interfaces/Components/IMultiDirectionable.cs
|
C#
|
mit
| 144
|
/* Copyright (c) 2010-2015 Vanderbilt University
*
* 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.
*/
#ifndef DATASTORE_CONFIG_MANAGER_H
#define DATASTORE_CONFIG_MANAGER_H
#include "json/reader.h"
#include "json/value.h"
class DataStoreReceiver;
namespace ammo
{
namespace gateway
{
class GatewayConnector;
}
}
class DataStoreConfigManager
{
public:
static
DataStoreConfigManager *getInstance (
DataStoreReceiver *receiver = 0,
ammo::gateway::GatewayConnector *connector = 0);
const std::string &getEventMimeType (void) const;
void setEventMimeType (const std::string &val);
const std::string &getMediaMimeType (void) const;
void setMediaMimeType (const std::string &val);
const std::string &getSMSMimeType (void) const;
void setSMSMimeType (const std::string &val);
const std::string &getReportMimeType (void) const;
void setReportMimeType (const std::string &val);
const std::string &getLocationsMimeType (void) const;
void setLocationsMimeType (const std::string &val);
const std::string &getPrivateContactsMimeType (void) const;
void setPrivateContactsMimeType (const std::string &val);
const std::string &getChatMimeType (void) const;
void setChatMimeType (const std::string &val);
const std::string &getChatMediaMimeType (void) const;
void setChatMediaMimeType (const std::string &val);
private:
DataStoreConfigManager (
DataStoreReceiver *receiver,
ammo::gateway::GatewayConnector *connector);
std::string findConfigFile (void);
static DataStoreConfigManager *sharedInstance;
private:
Json::Value root_;
DataStoreReceiver *receiver_;
ammo::gateway::GatewayConnector *connector_;
std::string event_mime_type_;
std::string media_mime_type_;
std::string sms_mime_type_;
std::string report_mime_type_;
std::string locations_mime_type_;
std::string private_contacts_mime_type_;
std::string chat_mime_type_;
std::string chat_media_mime_type_;
};
#endif // DATASTORE_CONFIG_MANAGER_H
|
isis-ammo/ammo-gateway
|
DataStoreGatewayPlugin/DataStoreConfigManager.h
|
C
|
mit
| 3,020
|
import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import {Router, Route, browserHistory} from 'react-router';
import injectTapEventPlugin from 'react-tap-event-plugin';
import {Main} from './app/main';
import './index.less';
// Needed for onTouchTap
// http://stackoverflow.com/a/34015469/988941
injectTapEventPlugin();
ReactDOM.render(
<Router history={browserHistory}>
<Route path="/" component={Main}/>
</Router>,
document.getElementById('root')
);
|
jchen86/kafka-topic-viewer
|
client/src/index.js
|
JavaScript
|
mit
| 503
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Coq bench</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.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">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<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="../../..">Unstable</a></li>
<li><a href=".">8.4.5 / contrib:lesniewski-mereology dev</a></li>
<li class="active"><a href="">2015-01-06 01:41:47</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="../../../../../about.html">About</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href=".">« Up</a>
<h1>
contrib:lesniewski-mereology
<small>
dev
<span class="label label-info">Not compatible with this Coq</span>
</small>
</h1>
<p><em><script>document.write(moment("2015-01-06 01:41:47 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2015-01-06 01:41:47 UTC)</em><p>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>ruby lint.rb unstable ../unstable/packages/coq:contrib:lesniewski-mereology/coq:contrib:lesniewski-mereology.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
<dt>Output</dt>
<dd><pre>The package is valid.
</pre></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 --dry-run coq:contrib:lesniewski-mereology.dev coq.8.4.5</code></dd>
<dt>Return code</dt>
<dd>768</dd>
<dt>Duration</dt>
<dd>0 s</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:contrib:lesniewski-mereology -> coq >= dev
Your request can't be satisfied:
- Conflicting version constraints for coq
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq, to test if the problem was incompatibility with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --dry-run coq:contrib:lesniewski-mereology.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>3 s</dd>
<dt>Output</dt>
<dd><pre>The following actions will be performed:
- remove coq.8.4.5
=== 1 to remove ===
=-=- Removing Packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Removing coq.8.4.5.
[WARNING] Directory /home/bench/.opam/system/lib/coq is not empty, not removing
[WARNING] Directory /home/bench/.opam/system/share/coq is not empty, not removing
The following actions will be performed:
- install coq.hott [required by coq:contrib:lesniewski-mereology]
- install coq:contrib:lesniewski-mereology.dev
=== 2 to install ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Building coq.hott:
./configure -configdir /home/bench/.opam/system/lib/coq/config -mandir /home/bench/.opam/system/man -docdir /home/bench/.opam/system/doc -prefix /home/bench/.opam/system -usecamlp5 -camlp5dir /home/bench/.opam/system/lib/camlp5 -coqide no
make -j4
make install
Installing coq.hott.
Building coq:contrib:lesniewski-mereology.dev:
coq_makefile -f Make -o Makefile
make -j4
make install
Installing coq:contrib:lesniewski-mereology.dev.
</pre></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>Duration</dt>
<dd>0 s</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-old
|
clean/Linux-x86_64-4.01.0-1.2.0/unstable/8.4.5/contrib:lesniewski-mereology/dev/2015-01-06_01-41-47.html
|
HTML
|
mit
| 7,045
|
local PrimitiveCases = { }
for k,v in pairs(primitive) do
if k ~= "dynamic" then
table.insert(PrimitiveCases, { actual = v , id = "primitive" .. k })
end
end
table.sort(PrimitiveCases, function(a,b) return a.actual.meta.tag < b.actual.meta.tag end)
local SimpleComposedCases =
{
{ actual = standard.array(primitive.varint, 5) , id = "standard_array"},
{ actual = standard.list(primitive.varint), id = "standerd_list" },
{ actual = standard.set(primitive.varint), id = "standard_set"},
{ actual = standard.map(primitive.varint, primitive.varint), id = "standard_map" },
{ actual = standard.optional(primitive.varint), id = "standard_optional" },
{ actual = standard.tuple(primitive.varint, primitive.stream, primitive.boolean), id = "standard_tuple" },
}
local AlignCases =
{
{ actual = custom.align(1, primitive.varint), id = "type_align_1" },
{ actual = custom.align(2, primitive.varint), id = "type_align_2"},
{ actual = custom.align(3, primitive.varint), id = "type_align_3" },
{ actual = custom.align(4, primitive.varint), id = "type_align_4"},
{ actual = custom.align(8, primitive.varint), id = "type_align_8" },
}
local ObjectCases =
{
{ actual = standard.object(primitive.varint) },
}
local SemanticCases =
{
--{ actual = custom.semantic("test", primitive.varint) },
--{ actual = custom.semantic("color", primitive.uint32)}
}
local newtyperef = custom.typeref
local listref = newtyperef()
local linkedlist = standard.tuple
{
{ mapping = primitive.varint },
{ mapping = standard.optional(listref) }
}
listref:setref(linkedlist)
local luaref = newtyperef()
local luaunion = standard.union
{
{ type = "nil", mapping = primitive.null },
{ type = "number", mapping = primitive.double },
{ type = "boolean", mapping = primitive.boolean },
{ type = "string", mapping = primitive.string },
{ type = "table", mapping = standard.object(standard.map(luaref, luaref)) }
}
luaref:setref(luaunion)
local noderef = newtyperef()
local node = standard.optional(standard.tuple(
{
{ mapping = primitive.varint },
{ mapping = noderef },
{ mapping = noderef }
}))
noderef:setref(node)
local treemapping = standard.tuple(
{
{ mapping = primitive.varint },
{ mapping = node}
})
local TyperefCases =
{
{ actual = linkedlist, id = "linked lists" },
{ actual = node , id = "treenode"},
{ actual = treemapping , id = "tree"},
{ actual = luaunion, id = "luaunion" },
}
local meta = require"tier.meta"
local function idmatcher(actual, expected)
local aid = meta.getid(actual.meta)
local eid = meta.getid(expected.meta)
if aid == eid then return true end
return false, "metadata mismatch"
end
runtest { mapping = standard.type, matcher = idmatcher, SemanticCases }
runtest { mapping = standard.type, noregression = true, PrimitiveCases }
runtest { mapping = standard.type, matcher = idmatcher, SimpleComposedCases }
runtest { mapping = standard.type, matcher = idmatcher, AlignCases }
runtest { mapping = standard.type, matcher = idmatcher, ObjectCases }
runtest { mapping = standard.type, matcher = idmatcher, TyperefCases }
|
TheFlyingFiddle/TIER
|
test/type.lua
|
Lua
|
mit
| 3,091
|
---
title: Bow-Child | Blog | Welcome to Jekyll!
date: 2016-11-12 17:36:49 +01:00
categories:
- src
- reserche
menu_name: Welcome to Jekyll!
author: Ada Lovelace
image: person1.jpg
image_alt: image description
---
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
Jekyll also offers powerful support for code snippets:
{% highlight ruby %}
def print_hi(name)
puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
{% endhighlight %}
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
[jekyll-docs]: http://jekyllrb.com/docs/home
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/
|
laklau/bow-child-sample
|
_posts/2016-11-12-welcome-to-jekyll.md
|
Markdown
|
mit
| 1,311
|
(function() {
if (!window.JHVH) window.JHVH = {};
// need to keep for keeping calculating svg path to fit all sizes
var ORIGIN_WIDTH = 559;
var ORIGIN_HEIGHT = 100;
var RATIO_W = ORIGIN_WIDTH / ORIGIN_HEIGHT;
var RATIO_H = ORIGIN_HEIGHT / ORIGIN_WIDTH;
var TEMP_WIDTH = ORIGIN_WIDTH;
var TEMP_HEIGHT = TEMP_WIDTH * RATIO_H;
var SCALEX = ORIGIN_WIDTH / TEMP_WIDTH;
var SCALEY = ORIGIN_HEIGHT / TEMP_HEIGHT;
var ON_COLOR = '#39b54a';
var RED_COLOR = '#830303';
var OFF_COLOR = '#120d09';
var paths = {
topLine: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M23.000,26.000 C23.000,26.000 23.000,28.000 23.000,28.000 C23.000,28.000 248.000,28.000 248.000,28.000 C248.000,28.000 248.000,26.000 248.000,26.000 C248.000,26.000 23.000,26.000 23.000,26.000 Z'
},
bottomLine: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M65.000,31.000 C65.000,31.000 207.000,31.000 207.000,31.000 C207.000,31.000 202.000,38.000 202.000,38.000 C202.000,38.000 71.000,38.000 71.000,38.000 C71.000,38.000 65.000,31.000 65.000,31.000 Z'
},
tempIcon: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M264.557,0.966 C264.557,0.966 264.525,0.000 265.656,0.000 C266.788,0.000 266.756,0.828 266.756,0.828 C266.756,0.828 266.756,2.761 266.756,2.761 C266.756,2.761 271.153,2.761 271.153,2.761 C271.153,2.761 271.153,4.418 271.153,4.418 C271.153,4.418 266.756,4.418 266.756,4.418 C266.756,4.418 266.756,5.799 266.756,5.799 C266.756,5.799 271.153,5.799 271.153,5.799 C271.153,5.799 271.153,7.456 271.153,7.456 C271.153,7.456 266.756,7.456 266.756,7.456 C266.756,7.456 266.756,8.837 266.756,8.837 C266.756,8.837 271.153,8.837 271.153,8.837 C271.153,8.837 271.153,10.493 271.153,10.493 C271.153,10.493 267.443,10.493 267.443,10.493 C267.443,10.493 267.443,13.945 267.443,13.945 C267.443,13.945 266.399,14.619 265.794,14.083 C265.316,13.842 264.557,13.669 264.557,13.669 C264.557,13.669 264.557,0.966 264.557,0.966 Z'
},
tempIconWater: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M258.237,14.866 C258.237,14.866 258.507,14.636 259.093,14.636 C260.108,14.636 260.395,15.357 261.417,15.357 C262.438,15.357 262.960,14.636 263.878,14.636 C264.796,14.636 265.571,15.341 266.309,15.341 C267.048,15.341 267.604,14.774 268.648,14.774 C269.692,14.774 270.485,15.341 271.217,15.341 C272.231,15.341 272.388,14.620 273.281,14.620 C274.175,14.620 274.137,15.004 274.137,15.004 C274.137,15.004 274.137,16.507 274.137,16.507 C274.137,16.507 273.904,16.154 273.281,16.154 C272.565,16.154 272.357,16.998 271.095,16.998 C269.832,16.998 269.629,16.139 268.618,16.139 C267.608,16.139 267.244,16.998 266.309,16.998 C265.219,16.998 264.747,16.154 263.970,16.154 C263.068,16.154 262.499,16.983 261.524,16.983 C260.549,16.983 259.995,16.124 259.215,16.124 C258.435,16.124 258.237,16.507 258.237,16.507 C258.237,16.507 258.237,14.866 258.237,14.866 Z'
},
tempIconWaterSplashLeft: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M257.000,12.012 C257.000,12.012 257.984,11.460 259.198,11.460 C260.758,11.460 261.695,12.288 262.634,12.288 C263.247,12.195 263.595,12.288 263.595,12.288 C263.595,12.288 263.595,13.669 263.595,13.669 C263.595,13.669 263.592,13.796 262.771,13.807 C261.771,13.807 260.317,12.979 259.336,12.979 C258.354,12.979 257.000,13.531 257.000,13.531 C257.000,13.531 257.000,12.012 257.000,12.012 Z'
},
tempIconWaterSplashRight: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M275.000,12.012 C275.000,12.012 274.016,11.460 272.802,11.460 C271.242,11.460 270.305,12.288 269.366,12.288 C268.753,12.195 268.405,12.288 268.405,12.288 C268.405,12.288 268.405,13.669 268.405,13.669 C268.405,13.669 268.408,13.796 269.229,13.807 C270.229,13.807 271.683,12.979 272.664,12.979 C273.646,12.979 275.000,13.531 275.000,13.531 C275.000,13.531 275.000,12.012 275.000,12.012 Z'
},
oneH: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M261.000,26.000 C261.000,26.000 261.000,39.000 261.000,39.000 C261.000,39.000 264.000,39.000 264.000,39.000 C264.000,39.000 264.000,26.000 264.000,26.000 C264.000,26.000 261.000,26.000 261.000,26.000 Z'
},
twoH: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M270.000,26.000 C270.000,26.000 270.000,39.000 270.000,39.000 C270.000,39.000 273.000,39.000 273.000,39.000 C273.000,39.000 273.000,26.000 273.000,26.000 C273.000,26.000 270.000,26.000 270.000,26.000 Z'
},
threeH: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M265.000,32.000 C265.000,32.000 265.000,34.000 265.000,34.000 C265.000,34.000 269.000,34.000 269.000,34.000 C269.000,34.000 269.000,32.000 269.000,32.000 C269.000,32.000 265.000,32.000 265.000,32.000 Z'
},
oneC: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M0.000,26.000 C0.000,26.000 0.000,39.000 0.000,39.000 C0.000,39.000 3.000,39.000 3.000,39.000 C3.000,39.000 3.000,26.000 3.000,26.000 C3.000,26.000 0.000,26.000 0.000,26.000 Z'
},
twoC: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M4.000,26.000 C4.000,26.000 4.000,28.000 4.000,28.000 C4.000,28.000 12.000,28.000 12.000,28.000 C12.000,28.000 12.000,26.000 12.000,26.000 C12.000,26.000 4.000,26.000 4.000,26.000 Z'
},
threeC: {
offsetX: 0,
offsetY: 0,
color: ON_COLOR,
path: 'M4.000,37.000 C4.000,37.000 4.000,39.000 4.000,39.000 C4.000,39.000 12.000,39.000 12.000,39.000 C12.000,39.000 12.000,37.000 12.000,37.000 C12.000,37.000 4.000,37.000 4.000,37.000 Z'
}
};
var parts = [
paths.topLine,
paths.bottomLine,
paths.tempIcon,
paths.tempIconWater,
paths.tempIconWaterSplashLeft,
paths.tempIconWaterSplashRight,
paths.oneH,
paths.twoH,
paths.threeH,
paths.oneC,
paths.twoC,
paths.threeC
];
var TempLine = function (elID) {
// Element setup
this.canvas = document.createElement('canvas');
this.ctx = this.canvas.getContext('2d');
this.canvas.width = TEMP_WIDTH;
this.canvas.height = TEMP_HEIGHT;
document.getElementById(elID).appendChild(this.canvas);
// resize/rescale SVG paths and convert them to cavas shapes
convertPaths.apply(this, [paths]);
// draws the converted paths
draw.call(this);
}
TempLine.prototype.x = function (x) {
//this.canvas.style.marginLeft = x + 'px';
this._x = x;
}
TempLine.prototype.y = function (y) {
//this.canvas.style.marginTop = y + 'px';
this._y = y;
}
// for when multiple frameworks are all being drawn to a single context.
// NOTE: Should end up as default, since managing multiple canvases doesnt make sense.
TempLine.prototype.drawToContext = function (ctx) {
convertPaths.apply(this, [paths]);
for (var i = 0, l = parts.length; i < l; i++) {
ctx.fillStyle = parts[i].color;
ctx.fill(parts[i].p2D);
}
}
function draw () {
var p, newPath;
this.ctx.clearRect(0, 0, TEMP_WIDTH, TEMP_HEIGHT);
// segments to on state
for (var i = 0, l = parts.length; i < l; i++) {
this.ctx.fillStyle = parts[i].color;
// reuse the converted paths
this.ctx.fill(parts[i].p2D);
}
}
// dynamic changes svg paths based on container dimensions
function updateSVGPath (path, offsetX, offsetY) {
var p = path;
var a = p.split(' ');
var b;
var x, y, xy, firstChar;
var newPath = '';
for (var i = 0, l = a.length; i < l; i++) {
// separate points
b = a[i].split(',');
// last index will only be Z
if (b[0] !== 'Z') {
// first character might be a letter, which means an instruction besides line-to
x = b[0];
// hold on to this to be added back after coords get updated
firstChar = x.charAt(0);
// get rid of the letter, so that string can be converted to a number
// NOTE: Will need to add something less specific, since there are more key letters than M and C
if (firstChar === 'M' || firstChar === 'C') {
x = x.substr(1, x.length);
} else {
x = Number(x);
firstChar = null;
}
// Y will never have a letter
y = Number(b[1]);
// apply offset and scale to each coordinate
xy = updateCoords(x, y, offsetX, offsetY);
// reattach first character and conver back to string
if (firstChar) {
xy[0] = firstChar + String(xy[0]);
} else {
xy[0] = String(xy[0]);
}
xy[1] = String(xy[1]);
// set proper format and append to updated path string
newPath += xy[0] + ',' + xy[1] + ' ';
} else {
newPath += 'Z';
}
}
return newPath;
}
// should only convert paths on init and resize
function convertPaths (source) {
var adjustedPath;
for (var i = 0; i < parts.length; i++) {
adjustedPath = updateSVGPath(parts[i].path, this._x, this._y);
parts[i].p2D = new Path2D(adjustedPath);
}
}
// adds offset and scale to original svg path
function updateCoords (x, y, offsetX, offsetY) {
// offset from 0,0 in parent
x = offsetX + (x * SCALEX);
y = offsetY + (y * SCALEY);
return [x,y];
}
function update () {
convertPaths.apply(this, [paths]);
}
TempLine.prototype.resize = function () {
convertPaths.apply(this, [paths]);
}
if (!window.JHVH) window.JHVH = {};
window.JHVH.TempLine = TempLine;
})();
|
JoshuaBolitho/V3
|
00-sites/demos/lebaron/js/old/temp-line.js
|
JavaScript
|
mit
| 9,139
|
# frozen_string_literal: true
require "rails_helper"
RSpec.describe NewsItem, type: :model do
it_behaves_like "an author"
describe ".published" do
# Published
let(:recent_item) { create(:news_item, :published) }
let(:older_item) { create(:news_item, :published, published_at: 1.year.ago) }
# Unpublished
let(:archived_item) { create(:news_item, :archived) }
let(:draft_item) { create(:news_item, :draft) }
it "returns a sorted array of most recently published items first" do
expect(NewsItem.published).to eq [recent_item, older_item]
end
it "does not return archived items" do
expect(NewsItem.published).not_to include archived_item
end
it "does not return draft items" do
expect(NewsItem.published).not_to include draft_item
end
end
describe "validation" do
subject { create(:news_item) }
it { is_expected.to validate_presence_of(:state) }
context "when published" do
subject { create(:news_item, :published) }
it { is_expected.to validate_presence_of(:published_at) }
it { is_expected.to validate_presence_of(:title) }
it do
is_expected.to validate_length_of(:title).
is_at_most(ActiveRecordExtensions::MAX_STRING_COLUMN_LENGTH)
end
it { is_expected.to validate_presence_of(:body) }
it do
is_expected.to validate_length_of(:body).
is_at_most(ActiveRecordExtensions::MAX_TEXT_COLUMN_LENGTH)
end
end
context "when draft" do
subject { create(:news_item, :draft) }
it { is_expected.to_not validate_presence_of(:published_at) }
it { is_expected.to_not validate_presence_of(:title) }
it { is_expected.to_not validate_presence_of(:body) }
end
context "for state" do
NewsItem::STATES.each do |state|
it "passes for value #{state}" do
news_item = build(:news_item, state: state)
expect(news_item).to be_valid
end
end
it "fails for invalid value" do
news_item = build(:news_item, state: "someinvalidvalue")
expect(news_item).to_not be_valid
expect(news_item.errors.messages[:state]).to be_present
end
it "fails for empty value" do
news_item = build(:news_item, state: "")
expect(news_item).to_not be_valid
expect(news_item.errors.messages[:state]).to be_present
end
it "fails for not being present (nil value)" do
news_item = build(:news_item, state: nil)
expect(news_item).to_not be_valid
expect(news_item.errors.messages[:state]).to be_present
end
end
context "for published_at" do
it "passes when published_at is present and the news item state is
published" do
news_item = build :news_item,
state: :published,
published_at: Date.yesterday
expect(news_item).to be_valid
expect(news_item.errors.messages[:published_at]).to_not be_present
end
it "fails when published_at is not present and the news item state is
published" do
news_item = build(:news_item, state: "published", published_at: nil)
expect(news_item).to_not be_valid
expect(news_item.errors.messages[:published_at]).to be_present
end
it "passes when published_at is not present and the news item state is
other than published" do
news_item = build(:news_item, state: "draft", published_at: nil)
expect(news_item).to be_valid
expect(news_item.errors.messages[:published_at]).to_not be_present
end
it "passes when published_at is not present and the news item state is
nil" do
news_item = build(:news_item, state: nil, published_at: nil)
expect(news_item).to_not be_valid # state is nil
expect(news_item.errors.messages[:published_at]).to_not be_present
end
end
end
end
|
montrealrb/Montreal.rb
|
spec/models/news_item_spec.rb
|
Ruby
|
mit
| 3,954
|
/*
* Kendo UI v2014.2.1008 (http://www.telerik.com/kendo-ui)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
(function(f, define){
define([], f);
})(function(){
(function( window, undefined ) {
var kendo = window.kendo || (window.kendo = { cultures: {} });
kendo.cultures["ca-ES"] = {
name: "ca-ES",
numberFormat: {
pattern: ["-n"],
decimals: 2,
",": ".",
".": ",",
groupSize: [3],
percent: {
pattern: ["-n %","n %"],
decimals: 2,
",": ".",
".": ",",
groupSize: [3],
symbol: "%"
},
currency: {
pattern: ["-n $","n $"],
decimals: 2,
",": ".",
".": ",",
groupSize: [3],
symbol: "€"
}
},
calendars: {
standard: {
days: {
names: ["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],
namesAbbr: ["dg.","dl.","dt.","dc.","dj.","dv.","ds."],
namesShort: ["dg","dl","dt","dc","dj","dv","ds"]
},
months: {
names: ["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre",""],
namesAbbr: ["gen","feb","març","abr","maig","juny","jul","ag","set","oct","nov","des",""]
},
AM: [""],
PM: [""],
patterns: {
d: "dd/MM/yyyy",
D: "dddd, d' / 'MMMM' / 'yyyy",
F: "dddd, d' / 'MMMM' / 'yyyy HH:mm:ss",
g: "dd/MM/yyyy HH:mm",
G: "dd/MM/yyyy HH:mm:ss",
m: "dd MMMM",
M: "dd MMMM",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
t: "HH:mm",
T: "HH:mm:ss",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "MMMM' / 'yyyy",
Y: "MMMM' / 'yyyy"
},
"/": "/",
":": ":",
firstDay: 1
}
}
}
})(this);
return window.kendo;
}, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
|
shriramdevanathan/FactoryOfTheFuture
|
vendor/kendoui-2014.2.1008/src/js/cultures/kendo.culture.ca-ES.js
|
JavaScript
|
mit
| 2,671
|
var expect = require("chai").expect
, comment = require("../app/service/comment");
/*
* Mocks
*/
var socket = {
request: {
user: {
logged_in: true,
id: 1
}
}
};
describe("app/service/comment", function () {
describe('#post()', function () {
it('if user is logged out then socket should emit an error', function (done) {
socket.request.user.logged_in = false;
socket.emit = function (key, data) {
expect(key).to.equal('comment/post/error');
done();
};
comment.post(socket, {
thread_id: 1,
replyTo: 0
});
});
});
describe('#like()', function () {
it('if user is logged out then socket should emit an error', function (done) {
socket.request.user.logged_in = false;
socket.emit = function (key, data) {
expect(key).to.equal('comment/like/error');
done();
};
comment.like(socket, {comment_id: 1});
});
it('if comment doesn\'t exist then socket should emit an error', function (done) {
socket.request.user.logged_in = true;
socket.emit = function (key, data) {
expect(key).to.equal('comment/like/error');
done();
};
comment.like(socket, {comment_id: 100000000});
});
});
});
|
http-teapot/comment
|
test/app_service_comment.js
|
JavaScript
|
mit
| 1,276
|
package us.kbase.cdmientityapi;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* <p>Original spec-file type: fields_IsRegulatorForRegulon</p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("com.googlecode.jsonschema2pojo")
@JsonPropertyOrder({
"from_link",
"to_link"
})
public class FieldsIsRegulatorForRegulon {
@JsonProperty("from_link")
private String fromLink;
@JsonProperty("to_link")
private String toLink;
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("from_link")
public String getFromLink() {
return fromLink;
}
@JsonProperty("from_link")
public void setFromLink(String fromLink) {
this.fromLink = fromLink;
}
public FieldsIsRegulatorForRegulon withFromLink(String fromLink) {
this.fromLink = fromLink;
return this;
}
@JsonProperty("to_link")
public String getToLink() {
return toLink;
}
@JsonProperty("to_link")
public void setToLink(String toLink) {
this.toLink = toLink;
}
public FieldsIsRegulatorForRegulon withToLink(String toLink) {
this.toLink = toLink;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperties(String name, Object value) {
this.additionalProperties.put(name, value);
}
@Override
public String toString() {
return ((((((("FieldsIsRegulatorForRegulon"+" [fromLink=")+ fromLink)+", toLink=")+ toLink)+", additionalProperties=")+ additionalProperties)+"]");
}
}
|
kbase/trees
|
src/us/kbase/cdmientityapi/FieldsIsRegulatorForRegulon.java
|
Java
|
mit
| 2,023
|
{include file="./inc/header.html"}
<?php
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/uc_carry_money_log.css";
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/public.css";
?>
<link rel="stylesheet" type="text/css" href="{function name="parse_css" v="$pagecss"}" />
<!--提现日志-->
<ul class="log_list">
{foreach from=$data.item item="item"}
<li>
<dl class="clearfix">
<dd><span class="name">提现金额</span>{function name="format_price" value=$item.money}</dd>
<dd><span class="name">手续费</span>{function name="format_price" value=$item.fee}</dd>
<dd><span class="name">提现银行</span>{$item.bank_name}</dd>
<dd><span class="name">失败原因</span>{$item.msg}</dd><!--不知各种失败原因是何种方式输出-->
<dd class="y"><span class="name">银行资料</span><span class="c_ff4a4a">网点:{$item.bankzone} 卡号:***{function name="msubstr" v=$item.bankcard s="-4" l="4" charset="utf-8" su=false} 账户:{function name="utf_substr" v=$item.real_name}</span></dd>
</dl>
<div class="clearfix results_block">
<p class="f_l"><span class="name">处理结果</span>
{if $item.status eq 0}
<span class="c_3b95d3">
{elseif $item.status eq 1}
<span class="c_aad421">
{elseif $item.status eq 4}
<span class="c_ff8800">
{elseif $item.status eq 2}
<span class="c_878787">
{/if}
{$item.status_format}</span>
</p>
<p class="f_r">
<input id="dltid_{$item.id}" type="hidden" value="{$item.id}" />
{if $item.status eq 0}
<span class="Revocation_but c_3b95d3 bor_3b95d3">
<a href="#" id="submita_{$item.id}" class="c_3b95d3">
撤销申请
</a>
</span>
{elseif $item.status eq 4}
<span class="Revocation_but c_ff8800 bor_ff8800">
<a href="#" id="submitb_{$item.id}" class="c_ff8800">
申请提现
</a>
</span>
{else}
<span class="Revocation_but bor_878787 bor_878787">无操作</span>
{/if}
<script type="text/javascript">
$("#submita_{$item.id}").click(function(){
var ajaxurl = '{wap_url a="index" r="uc_carry_revoke_apply"}';
var dltid = $.trim($("#dltid_{$item.id}").val());
var query = new Object();
query.dltid = $.trim($("#dltid_{$item.id}").val());
query.status = 0;
query.post_type = "json";
$.ajax({
url:ajaxurl,
data:query,
type:"Post",
dataType:"json",
success:function(data){
alert(data.show_err);
window.location.href = '{wap_url a="index" r="uc_carry_money_log"}';
}
});
$(this).parents(".float_block").hide();
});
$("#submitb_{$item.id}").click(function(){
var ajaxurl = '{wap_url a="index" r="uc_carry_revoke_apply"}';
var dltid = $.trim($("#dltid_{$item.id}").val());
var query = new Object();
query.dltid = $.trim($("#dltid_{$item.id}").val());
query.status = 4;
query.post_type = "json";
$.ajax({
url:ajaxurl,
data:query,
type:"Post",
dataType:"json",
success:function(data){
alert(data.show_err);
window.location.href = '{wap_url a="index" r="uc_carry_money_log"}';
}
});
$(this).parents(".float_block").hide();
});
</script>
</p>
</div>
</li>
{/foreach}
</ul>
<div class="new-but-block ">
<div class="but-block">
<button class="but_sure"><a href="{wap_url a="index" r="uc_bank"}">提现</a></button>
</div>
</div>
{include file="./inc/footer.html"}
|
dayphosphor/xiaoniu
|
p2p/wap/tpl/fanwe/uc_carry_money_log.html
|
HTML
|
mit
| 3,635
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>zorns-lemma: Not compatible</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.2 / zorns-lemma - 8.9.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
zorns-lemma
<small>
8.9.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-02-28 21:06:31 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-02-28 21:06:31 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.11 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.7.2 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: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/zorns-lemma"
license: "LGPL"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/ZornsLemma"]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
]
tags: [
"keyword: set theory"
"keyword: cardinals"
"keyword: ordinals"
"keyword: finite"
"keyword: countable"
"keyword: quotients"
"keyword: well orders"
"keyword: Zorn's lemma"
"category: Mathematics/Logic/Set theory"
]
authors: [
"Daniel Schepler <dschepler@gmail.com>"
]
bug-reports: "https://github.com/coq-contribs/zorns-lemma/issues"
dev-repo: "git+https://github.com/coq-contribs/zorns-lemma.git"
synopsis: "Zorn's Lemma"
description: """
This library develops some basic set theory. The main purpose I had in writing it was as support for the Topology library."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/zorns-lemma/archive/v8.9.0.tar.gz"
checksum: "md5=015ca83d87a9f0ec598ce680278e08a5"
}
</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-zorns-lemma.8.9.0 coq.8.7.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.2).
The following dependencies couldn't be met:
- coq-zorns-lemma -> coq >= 8.9
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-zorns-lemma.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<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.7.2/zorns-lemma/8.9.0.html
|
HTML
|
mit
| 7,068
|
eslint-plugin-compat
=====================
[](https://travis-ci.org/amilajack/eslint-plugin-compat)
[](https://ci.appveyor.com/project/amilajack/eslint-plugin-compat/branch/master)
[](http://badge.fury.io/js/eslint-plugin-compat)
[](https://david-dm.org/amilajack/eslint-plugin-compat)
[](https://npm-stat.com/charts.html?package=eslint-plugin-compat)

## Goals
- [x] Allow configuration of target browser/s
- [x] Use [caniuse](http://caniuse.com) and [@kangax's compat table](http://kangax.github.io/compat-table/es6/) for determining coverage
- [x] Enable config using `.eslintrc`
- [x] `browserslist` integration (using `package.json`)
See the [Road Map](https://github.com/amilajack/eslint-plugin-compat/wiki) for more details
## Installation
```bash
npm install --save-dev eslint-plugin-compat
```
Add `"compat"` to `.eslintrc` `"plugins"` section, add `"browser": true` to `"env"`
If you use **typescript**, see [typescript-eslint-parser](https://github.com/eslint/typescript-eslint-parser).
```js
// .eslintrc
{
// ...
"env": {
"browser": true
},
"plugins": ["compat"],
"rules": {
// ...
"compat/compat": 2
}
}
```
## Idea
**Default**
```
22: navigator.serviceWorker
^^^^^^^^^^^^^ `ServiceWorker` is not supported in IE 11, Edge 15
and Safari 8 😢
```
## Targeting Browsers
`eslint-plugin-compat` uses the browserslist configuration in `package.json`
See [ai/browserslist](https://github.com/ai/browserslist) for configuration. Here's some examples:
```js
// Simple configuration (package.json)
{
// ...
"browserslist": ["last 1 versions", "not ie <= 8"],
}
```
```js
// Use development and production configurations (package.json)
{
// ...
"browserslist": {
"development": ["last 2 versions"],
"production": ["last 4 versions"]
}
}
```
:bulb: You can also define browsers in a [separate browserslist file](https://github.com/ai/browserslist#config-file)
## Adding Polyfills
[See wiki polyfills section](https://github.com/amilajack/eslint-plugin-compat/wiki/Adding-polyfills)
## Inspiration
Toolchains for native platforms, like iOS and Android, have had API linting from the start. It's about time that the web had similar tooling.
This project was inspired by a two hour conversation I had with someone on the experience of web development and if it is terrible or not. The premise they argued was that `x` browser doesn't support `y` feature while `z` browser does. Eventually, I agreed with him on this and checked made this plugin to save web developers from having to memorize browser compatibility of specs.
## Demo
For a minimal demo, see [amilajack/eslint-plugin-compat-demo](https://github.com/amilajack/eslint-plugin-compat-demo)
|
rafser01/installer_electron
|
node_modules/eslint-plugin-compat/README.md
|
Markdown
|
mit
| 3,292
|
# -*- coding: utf-8 -*-
import datetime
from flask import jsonify, request
from app import token_auth
from app.models.user_token_model import UserTokenModel
@token_auth.verify_token
def verify_token(hashed):
token = UserTokenModel.query\
.filter(UserTokenModel.hashed == hashed, UserTokenModel.ip_address == request.remote_addr)
if token.count():
token = token.first()
if token.expired_at > datetime.datetime.now():
return True
return False
@token_auth.error_handler
def error_handler():
return jsonify({'code': 401, 'status': 'fail', 'message': 'Token that does not exist or has expired.'})
|
h4wldev/Frest
|
app/modules/auth/token.py
|
Python
|
mit
| 652
|
<!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.11"/>
<title>V8 API Reference Guide for node.js v4.8.1 - v4.8.2: 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 id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v4.8.1 - v4.8.2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<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="inherits.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_1Function.html">Function</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">v8::Function Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classv8_1_1Function.html">v8::Function</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>BooleanValue</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Call</b>(Local< Context > context, Local< Value > recv, int argc, Local< Value > argv[]) (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>CallAsConstructor</b>(Local< Context > context, int argc, Local< Value > argv[]) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>CallAsFunction</b>(Local< Context > context, Local< Value > recv, int argc, Local< Value > argv[]) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Cast</b>(Value *obj) (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Cast</b>(T *value) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a5018c9d085aa71f65530cf1e073a04ad">Clone</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>CreateDataProperty</b>(Local< Context > context, Local< Name > key, Local< Value > value) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>CreateDataProperty</b>(Local< Context > context, uint32_t index, Local< Value > value) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#af6966283a7d7e20779961eed434db04d">CreationContext</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>DefineOwnProperty</b>(Local< Context > context, Local< Name > key, Local< Value > value, PropertyAttribute attributes=None) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Delete</b>(Local< Context > context, Local< Value > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Delete</b>(Local< Context > context, uint32_t index) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>DeleteHiddenValue</b>(Local< String > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Equals</b>(Local< Context > context, Local< Value > that) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#ae2ad9fee9db6e0e5da56973ebb8ea2bc">FindInstanceInPrototypeChain</a>(Local< FunctionTemplate > tmpl)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Get</b>(Local< Context > context, Local< Value > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Get</b>(Local< Context > context, uint32_t index) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a435f68bb7ef0f64dd522c5c910682448">GetAlignedPointerFromInternalField</a>(int index)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a65b5a3dc93c0774594f8b0f2ab5481c8">GetAlignedPointerFromInternalField</a>(const PersistentBase< Object > &object, int index)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Function.html#a937dc089e1ef728eec4a628072250e4d">GetBoundFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a7bbe987794658f20a3ec1b68326305e6">GetConstructorName</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Function.html#a71bbe599304109844270e6e03827b02b">GetDisplayName</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetHiddenValue</b>(Local< String > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#ac1ece41e81a499920ec3a2a3471653bc">GetIdentityHash</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Function.html#a2665736fdec019bc7d12003ef880f78f">GetInferredName</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#aa3324fdf652d8ac3b2f27faa0559231d">GetInternalField</a>(int index)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetName</b>() const (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetOwnPropertyDescriptor</b>(Local< Context > context, Local< String > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetOwnPropertyNames</b>(Local< Context > context) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetPropertyAttributes</b>(Local< Context > context, Local< Value > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetPropertyNames</b>(Local< Context > context) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#ae8d3fed7d6dbd667c29cabb3039fe7af">GetPrototype</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetRealNamedProperty</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetRealNamedPropertyAttributes</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetRealNamedPropertyAttributesInPrototypeChain</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>GetRealNamedPropertyInPrototypeChain</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Function.html#abfe6a9251c5dfc995b83dcf3032fdc86">GetScriptColumnNumber</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Function.html#ae64de1b9dc1ea5dc4f419a88808c12c5">GetScriptLineNumber</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>GetScriptOrigin</b>() const (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Has</b>(Local< Context > context, Local< Value > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Has</b>(Local< Context > context, uint32_t index) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a278913bcd203434870ce5184a538a9af">HasIndexedLookupInterceptor</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a1e96fcb9ee17101c0299ec68f2cf8610">HasNamedLookupInterceptor</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>HasOwnProperty</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>HasRealIndexedProperty</b>(Local< Context > context, uint32_t index) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>HasRealNamedCallbackProperty</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>HasRealNamedProperty</b>(Local< Context > context, Local< Name > key) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Int32Value</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>IntegerValue</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#aaec28576353eebe6fee113bce2718ecc">InternalFieldCount</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a324a71142f621a32bfe5738648718370">InternalFieldCount</a>(const PersistentBase< Object > &object)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#ad06a4b1f7215d852c367df390491ac84">IsArgumentsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#aaee0b144087d20eae02314c9393ff80f">IsArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a65f9dad740f2468b44dc16349611c351">IsArrayBuffer</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#ad54475d15b7e6b6e17fc80fb4570cdf2">IsArrayBufferView</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a0aceb7645e71b096df5cd73d1252b1b0">IsBoolean</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#abe7bc06283e5e66013f2f056a943168b">IsBooleanObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Function.html#a4279e2bfca281cda9afdaf86c87d644d">IsBuiltin</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a23c2c1f23b50fab4a02e2f819641b865">IsCallable</a>()</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#afd20ab51e79658acc405c12dad2260ab">IsDataView</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a8bc11fab0aded4a805722ab6df173cae">IsDate</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a7ac61a325c18af8dcb6d7d5bf47d2503">IsExternal</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a68c0296071d01ca899825d7643cf495a">IsFalse</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a4effc7ca1a221dd8c1e23c0f28145ef0">IsFloat32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#ab071bf567d89c8ce1489b1b7d93abc36">IsFloat32x4</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a293f140b81b0219d1497e937ed948b1e">IsFloat64Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a05532a34cdd215f273163830ed8b77e7">IsFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a1cbbebde8c256d051c4606a7300870c6">IsGeneratorFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a72982768acdadd82d1df02a452251d14">IsGeneratorObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a928c586639dd75ae4efdaa66b1fc4d50">IsInt16Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a01e1db51c65b2feace248b7acbf71a2c">IsInt32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a48eac78a49c8b42d9f8cf05c514b3750">IsInt32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a10a88a2794271dfcd9c3abd565e8f28a">IsInt8Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a71ef50f22d6bb4a093cc931b3d981c08">IsMap</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#af9c52a0668fa3260a0d12a2cdf895b4e">IsMapIterator</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a8829b16b442a6231499c89fd5a6f8049">IsName</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a579fb52e893cdc24f8b77e5acc77d06d">IsNativeError</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#aa2c6ed8ef832223a7e2cd81e6ac61c78">IsNull</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a1bd51e3e55f67c65b9a8f587fbffb7c7">IsNumber</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a5f4aa9504a6d8fc3af9489330179fe14">IsNumberObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a355b7991c5c978c0341f6f961b63c5a2">IsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a93d6a0817b15a1d28050ba16e131e6b4">IsPromise</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#aae41e43486937d6122c297a0d43ac0b8">IsRegExp</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a220bd4056471ee1dda8ab9565517edd7">IsSet</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#addbae0104e07b990ee1af0bd7927824b">IsSetIterator</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#aa4ce26f174a4c1823dec56eb946d3134">IsSharedArrayBuffer</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#ab23a34b7df62806808e01b0908bf5f00">IsString</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a3e0f2727455fd01a39a60b92f77e28e0">IsStringObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#af3e6081c22d09a7bbc0a2aff59ed60a5">IsSymbol</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a867baa94cb8f1069452359e6cef6751e">IsSymbolObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a8f27462322186b295195eecb3e81d6d7">IsTrue</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#ac2f2f6c39f14a39fbb5b43577125dfe4">IsTypedArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a4a45fabf58b241f5de3086a3dd0a09ae">IsUint16Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a783c89631bac4ef3c4b909f40cc2b8d8">IsUint32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#a5e39229dc74d534835cf4ceba10676f4">IsUint32Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#acbe2cd9c9cce96ee498677ba37c8466d">IsUint8Array</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#ad3cb464ab5ef0215bd2cbdd4eb2b7e3d">IsUint8ClampedArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#aea287b745656baa8a12a2ae1d69744b6">IsUndefined</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#aab0297b39ed8e2a71b5dca7950228a36">IsWeakMap</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Value.html#a6f5a238206cbd95f98e2da92cab72e80">IsWeakSet</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>kLineOffsetNotFound</b> (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Function.html#a53f1f98d49eef79339460e47f2b1e29e">New</a>(Local< Context > context, FunctionCallback callback, Local< Value > data=Local< Value >(), int length=0)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>New</b>(Isolate *isolate) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>NewInstance</b>(Local< Context > context, int argc, Local< Value > argv[]) const (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>NewInstance</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>NumberValue</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ObjectProtoToString</b>(Local< Context > context) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SameValue</b>(Local< Value > that) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Function.html#afa208e62e702f6d61ba0a4250ba3f2cf">ScriptId</a>() const </td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Set</b>(Local< Context > context, Local< Value > key, Local< Value > value) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Set</b>(Local< Context > context, uint32_t index, Local< Value > value) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SetAccessor</b>(Local< Context > context, Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=0, MaybeLocal< Value > data=MaybeLocal< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>SetAccessorProperty</b>(Local< Name > name, Local< Function > getter, Local< Function > setter=Local< Function >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a0ccba69581f0b5e4e672bab90f26879b">SetAlignedPointerInInternalField</a>(int index, void *value)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#ac27b823248165acf5284a7086dfed34b">SetHiddenValue</a>(Local< String > key, Local< Value > value)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#aebf949a0592cebc144bb2f96bfb7ec72">SetInternalField</a>(int index, Local< Value > value)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>SetName</b>(Local< String > name) (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>SetPrototype</b>(Local< Context > context, Local< Value > prototype) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>StrictEquals</b>(Local< Value > that) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToArrayIndex</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToBoolean</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToDetailString</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToInt32</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToInteger</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToNumber</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToObject</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToString</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToUint32</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Uint32Value</b>(Local< Context > context) const (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Function > New(Isolate *isolate, FunctionCallback callback, Local< Value > data=Local< Value >(), int length=0)) (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Object > NewInstance(int argc, Local< Value > argv[]) const) (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Object > NewInstance() const) (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Value > Call(Local< Value > recv, int argc, Local< Value > argv[])) (defined in <a class="el" href="classv8_1_1Function.html">v8::Function</a>)</td><td class="entry"><a class="el" href="classv8_1_1Function.html">v8::Function</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool Set(Local< Value > key, Local< Value > value)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool Set(uint32_t index, Local< Value > value)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use CreateDataProperty", bool ForceSet(Local< Value > key, Local< Value > value, PropertyAttribute attribs=None)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use CreateDataProperty", Maybe< bool > ForceSet(Local< Context > context, Local< Value > key, Local< Value > value, PropertyAttribute attribs=None)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Value > Get(Local< Value > key)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Value > Get(uint32_t index)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a45c99c5e2b16425b4e92c88d49463e5f">v8::Object::V8_DEPRECATE_SOON</a>("Use maybe version", PropertyAttribute GetPropertyAttributes(Local< Value > key))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#ac5503b0a8e861ec721c680eccf5aec2d">v8::Object::V8_DEPRECATE_SOON</a>("Use maybe version", Local< Value > GetOwnPropertyDescriptor(Local< String > key))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool Has(Local< Value > key)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool Has(uint32_t index)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool SetAccessor(Local< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=0, Local< Value > data=Local< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool SetAccessor(Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=0, Local< Value > data=Local< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a3f735ad2eab826ddc5eba467ce624acb">v8::Object::V8_DEPRECATE_SOON</a>("Use maybe version", Local< Array > GetPropertyNames())</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a34e1ca49ed4944009d8d289e5530dabd">v8::Object::V8_DEPRECATE_SOON</a>("Use maybe version", bool SetPrototype(Local< Value > prototype))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#abc26147d5f501bf30217f227c9be4922">v8::Object::V8_DEPRECATE_SOON</a>("Use maybe version", Local< String > ObjectProtoToString())</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool HasOwnProperty(Local< String > key)) (defined in <a class="el" href="classv8_1_1Object.html">v8::Object</a>)</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#ac5755869ab0b95f6c1bbd3dd123e5cf4">v8::Object::V8_DEPRECATE_SOON</a>("Use maybe version", Maybe< PropertyAttribute > GetRealNamedPropertyAttributesInPrototypeChain(Local< String > key))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Object.html#a10222e80df73aaa0b381f4dabe6b5dd7">v8::Object::V8_DEPRECATE_SOON</a>("Use maybe version", Local< Value > CallAsConstructor(int argc, Local< Value > argv[]))</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1Object.html#a5e7199a517d980396bb86f876b5bae0a">v8::Object::V8_DEPRECATE_SOON</a>("Keep track of isolate correctly", Isolate *GetIsolate())</td><td class="entry"><a class="el" href="classv8_1_1Object.html">v8::Object</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Boolean > ToBoolean(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Number > ToNumber(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< String > ToString(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< String > ToDetailString(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Object > ToObject(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Integer > ToInteger(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Uint32 > ToUint32(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Int32 > ToInt32(Isolate *isolate) const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Boolean > ToBoolean() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Number > ToNumber() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< String > ToString() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< String > ToDetailString() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Object > ToObject() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Integer > ToInteger() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Uint32 > ToUint32() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", Local< Int32 > ToInt32() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.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_1Value.html#a48ae008760161c7ae7fd54a9db9cffcf">v8::Value::V8_DEPRECATE_SOON</a>("Use maybe version", Local< Uint32 > ToArrayIndex() const)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", bool BooleanValue() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", double NumberValue() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", int64_t IntegerValue() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", uint32_t Uint32Value() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>V8_DEPRECATE_SOON</b>("Use maybe version", int32_t Int32Value() const) (defined in <a class="el" href="classv8_1_1Value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1Value.html#ae3528a485935d1b19a0e007cd5a06799">v8::Value::V8_DEPRECATE_SOON</a>("Use maybe version", bool Equals(Local< Value > that) const)</td><td class="entry"><a class="el" href="classv8_1_1Value.html">v8::Value</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
|
v8-dox/v8-dox.github.io
|
3516f35/html/classv8_1_1Function-members.html
|
HTML
|
mit
| 57,329
|
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
# If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
# resources to, so exit 0 (signalling the script phase was successful).
exit 0
fi
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
case "${TARGETED_DEVICE_FAMILY:-}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
3)
TARGET_DEVICE_ARGS="--target-device tv"
;;
4)
TARGET_DEVICE_ARGS="--target-device watch"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
install_resource()
{
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${PODS_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH" || true
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_resource "${PODS_ROOT}/AlipaySDK-iOS/AlipaySDK.bundle"
install_resource "${PODS_ROOT}/ZFPlayer/ZFPlayer/Classes/ControlView/ZFPlayer.bundle"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_resource "${PODS_ROOT}/AlipaySDK-iOS/AlipaySDK.bundle"
install_resource "${PODS_ROOT}/ZFPlayer/ZFPlayer/Classes/ControlView/ZFPlayer.bundle"
fi
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
then
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "${PODS_ROOT}*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
else
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
fi
fi
|
niunaruto/DeDaoAppSwift
|
testSwift/Pods/Target Support Files/Pods-CommondPods-testSwift/Pods-CommondPods-testSwift-resources.sh
|
Shell
|
mit
| 6,842
|
/*
* Copyright 1997-2022 Optimatika
*
* 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.
*/
package org.ojalgo.type.keyvalue;
interface Paired<K, V> {
K getKey(int index);
EntryPair<K, V> getPair(int index);
V getValue(int index);
}
|
optimatika/ojAlgo
|
src/main/java/org/ojalgo/type/keyvalue/Paired.java
|
Java
|
mit
| 1,274
|
##
# SHA-512 Digester 基于 SHA-512 算法的摘要逻辑关注点。
module Unidom::Common::Concerns::Sha512Digester
extend ActiveSupport::Concern
included do |includer|
##
# 对明文 message 进行 SHA-512 摘要, pepper 是用于增加混乱的内容。如:
# class SomeModel
# include Unidom::Common::Concerns::Sha512Digester
# def some_method(param_1)
# digest param_1
# # 或者
# digest param_1, pepper: 'my_pepper'
# end
# end
def digest(message, pepper: nil)
self.class.digest message, pepper: pepper
end
##
# 对明文 message 进行 SHA-512 摘要,并以16进制的形式返回, pepper 是用于增加混乱的内容。如:
# class SomeModel
# include Unidom::Common::Concerns::Sha512Digester
# def some_method(param_1)
# hex_digest param_1
# # 或者
# hex_digest param_1, pepper: 'my_pepper'
# end
# end
def hex_digest(message, pepper: nil)
self.class.hex_digest message, pepper: pepper
end
end
module ClassMethods
##
# 对明文 message 进行 SHA-512 摘要, pepper 是用于增加混乱的内容。如:
# class SomeModel
# include Unidom::Common::Concerns::Sha512Digester
# def self.some_method(param_1)
# digest param_1
# # 或者
# digest param_1, pepper: 'my_pepper'
# end
# end
def digest(message, pepper: nil)
message.present? ? Digest::SHA512.digest("#{message}_#{Rails.application.secrets[:secret_key_base]}_#{pepper}") : nil
end
##
# 对明文 message 进行 SHA-512 摘要,并以16进制的形式返回, pepper 是用于增加混乱的内容。如:
# class SomeModel
# include Unidom::Common::Concerns::Sha512Digester
# def self.some_method(param_1)
# hex_digest param_1
# # 或者
# hex_digest param_1, pepper: 'my_pepper'
# end
# end
def hex_digest(message, pepper: nil)
message.present? ? Unidom::Common::Numeration.hex(digest(message, pepper: pepper)) : nil
end
end
end
|
topbitdu/unidom-common
|
app/models/unidom/common/concerns/sha512_digester.rb
|
Ruby
|
mit
| 2,130
|
-- --------------------------------------------------------
-- ホスト: 127.0.0.1
-- サーバのバージョン: 5.7.15-log - MySQL Community Server (GPL)
-- サーバー OS: Win64
-- HeidiSQL バージョン: 9.3.0.4984
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for skill
CREATE DATABASE IF NOT EXISTS `skill` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
ALTER DATABASE `skill` COLLATE 'utf8mb4_general_ci';
USE `skill`;
-- Dumping structure for ビュー skill.license_view
DROP VIEW IF EXISTS `license_view`;
-- Creating temporary table to overcome VIEW dependency errors
CREATE TABLE `license_view` (
`skill_id` INT(11) NOT NULL,
`title_name` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_general_ci',
`version_name` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_general_ci'
) ENGINE=MyISAM;
-- Dumping structure for テーブル skill.skill_category_mst
DROP TABLE IF EXISTS `skill_category_mst`;
CREATE TABLE IF NOT EXISTS `skill_category_mst` (
`skill_category_id` int(11) NOT NULL AUTO_INCREMENT,
`category_name` varchar(50) NOT NULL,
PRIMARY KEY (`skill_category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- エクスポートするデータが選択されていません
-- Dumping structure for テーブル skill.skill_title_mst
DROP TABLE IF EXISTS `skill_title_mst`;
CREATE TABLE IF NOT EXISTS `skill_title_mst` (
`skill_title_id` int(11) NOT NULL AUTO_INCREMENT,
`title_name` varchar(50) NOT NULL,
`skill_category` int(11) NOT NULL COMMENT '1:資格 2:OS 3:DB 4:言語',
PRIMARY KEY (`skill_title_id`),
KEY `SKILL_TITLE_MST_SKILL_CATEGORY_FK1` (`skill_category`),
CONSTRAINT `SKILL_TITLE_MST_SKILL_CATEGORY_FK1` FOREIGN KEY (`skill_category`) REFERENCES `skill_category_mst` (`skill_category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- エクスポートするデータが選択されていません
-- Dumping structure for テーブル skill.skill_version_mst
DROP TABLE IF EXISTS `skill_version_mst`;
CREATE TABLE IF NOT EXISTS `skill_version_mst` (
`skill_id` int(11) NOT NULL AUTO_INCREMENT,
`skill_title` int(11) NOT NULL,
`version_name` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`skill_id`),
UNIQUE KEY `name_version` (`skill_title`,`version_name`),
CONSTRAINT `SKILL_VERSION_MST_SKILL_TITLE_FK` FOREIGN KEY (`skill_title`) REFERENCES `skill_title_mst` (`skill_title_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- エクスポートするデータが選択されていません
-- Dumping structure for ビュー skill.stuff_db
DROP VIEW IF EXISTS `stuff_db`;
-- Creating temporary table to overcome VIEW dependency errors
CREATE TABLE `stuff_db` (
`id` INT(11) NOT NULL,
`stuff_id` INT(11) NOT NULL,
`db_name` VARCHAR(101) NOT NULL COLLATE 'utf8mb4_general_ci'
) ENGINE=MyISAM;
-- Dumping structure for ビュー skill.stuff_develop_language
DROP VIEW IF EXISTS `stuff_develop_language`;
-- Creating temporary table to overcome VIEW dependency errors
CREATE TABLE `stuff_develop_language` (
`id` INT(11) NOT NULL,
`stuff_id` INT(11) NOT NULL,
`develop_language_name` VARCHAR(101) NOT NULL COLLATE 'utf8mb4_general_ci'
) ENGINE=MyISAM;
-- Dumping structure for ビュー skill.stuff_license
DROP VIEW IF EXISTS `stuff_license`;
-- Creating temporary table to overcome VIEW dependency errors
CREATE TABLE `stuff_license` (
`id` INT(11) NOT NULL,
`stuff_id` INT(11) NOT NULL,
`license_name` VARCHAR(101) NOT NULL COLLATE 'utf8mb4_general_ci'
) ENGINE=MyISAM;
-- Dumping structure for テーブル skill.stuff_meta
DROP TABLE IF EXISTS `stuff_meta`;
CREATE TABLE IF NOT EXISTS `stuff_meta` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(50) NOT NULL COMMENT '名前',
`age` int(11) NOT NULL COMMENT '年齢',
`sex` tinyint(1) NOT NULL COMMENT '性別 1:男 0:女',
`nationality` varchar(50) NOT NULL COMMENT '国籍',
`experience_year` int(11) NOT NULL COMMENT '経験年数',
`price` int(11) NOT NULL COMMENT '単価',
`is_member` tinyint(1) NOT NULL COMMENT '自社社員 1:自社 0:他社',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- エクスポートするデータが選択されていません
-- Dumping structure for ビュー skill.stuff_os
DROP VIEW IF EXISTS `stuff_os`;
-- Creating temporary table to overcome VIEW dependency errors
CREATE TABLE `stuff_os` (
`id` INT(11) NOT NULL,
`stuff_id` INT(11) NOT NULL,
`os_name` VARCHAR(101) NOT NULL COLLATE 'utf8mb4_general_ci'
) ENGINE=MyISAM;
-- Dumping structure for テーブル skill.stuff_skill
DROP TABLE IF EXISTS `stuff_skill`;
CREATE TABLE IF NOT EXISTS `stuff_skill` (
`stuff_id` int(11) NOT NULL,
`skill_id` int(11) NOT NULL,
PRIMARY KEY (`stuff_id`,`skill_id`),
KEY `STUFF_SKILL_STUFF_ID_FK1` (`stuff_id`),
KEY `STUFF_SKILL_SKILL_ID_FK1` (`skill_id`),
CONSTRAINT `STUFF_SKILL_SKILL_ID_FK1` FOREIGN KEY (`skill_id`) REFERENCES `skill_version_mst` (`skill_id`),
CONSTRAINT `STUFF_SKILL_STUFF_ID_FK1` FOREIGN KEY (`stuff_id`) REFERENCES `stuff_meta` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- エクスポートするデータが選択されていません
-- Dumping structure for ビュー skill.license_view
DROP VIEW IF EXISTS `license_view`;
-- Removing temporary table and create final VIEW structure
DROP TABLE IF EXISTS `license_view`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `license_view` AS select `v`.`skill_id` AS `skill_id`,`t`.`title_name` AS `title_name`,`v`.`version_name` AS `version_name` from (`skill_title_mst` `t` join `skill_version_mst` `v` on((`t`.`skill_title_id` = `v`.`skill_title`)));
-- Dumping structure for ビュー skill.stuff_db
DROP VIEW IF EXISTS `stuff_db`;
-- Removing temporary table and create final VIEW structure
DROP TABLE IF EXISTS `stuff_db`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `stuff_db` AS select `v`.`skill_id` AS `id`,`s`.`stuff_id` AS `stuff_id`,concat(`t`.`title_name`,' ',`v`.`version_name`) AS `db_name` from ((`skill_title_mst` `t` join `skill_version_mst` `v`) join `stuff_skill` `s` on(((`t`.`skill_category` = 3) and (`t`.`skill_title_id` = `v`.`skill_title`) and (`v`.`skill_id` = `s`.`skill_id`))));
-- Dumping structure for ビュー skill.stuff_develop_language
DROP VIEW IF EXISTS `stuff_develop_language`;
-- Removing temporary table and create final VIEW structure
DROP TABLE IF EXISTS `stuff_develop_language`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `stuff_develop_language` AS select `v`.`skill_id` AS `id`,`s`.`stuff_id` AS `stuff_id`,concat(`t`.`title_name`,' ',`v`.`version_name`) AS `develop_language_name` from ((`skill_title_mst` `t` join `skill_version_mst` `v`) join `stuff_skill` `s` on(((`t`.`skill_category` = 4) and (`t`.`skill_title_id` = `v`.`skill_title`) and (`v`.`skill_id` = `s`.`skill_id`))));
-- Dumping structure for ビュー skill.stuff_license
DROP VIEW IF EXISTS `stuff_license`;
-- Removing temporary table and create final VIEW structure
DROP TABLE IF EXISTS `stuff_license`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `stuff_license` AS select `v`.`skill_id` AS `id`,`s`.`stuff_id` AS `stuff_id`,concat(`t`.`title_name`,' ',`v`.`version_name`) AS `license_name` from ((`skill_title_mst` `t` join `skill_version_mst` `v`) join `stuff_skill` `s` on(((`t`.`skill_category` = 1) and (`t`.`skill_title_id` = `v`.`skill_title`) and (`v`.`skill_id` = `s`.`skill_id`))));
-- Dumping structure for ビュー skill.stuff_os
DROP VIEW IF EXISTS `stuff_os`;
-- Removing temporary table and create final VIEW structure
DROP TABLE IF EXISTS `stuff_os`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `stuff_os` AS select `v`.`skill_id` AS `id`,`s`.`stuff_id` AS `stuff_id`,concat(`t`.`title_name`,' ',`v`.`version_name`) AS `os_name` from ((`skill_title_mst` `t` join `skill_version_mst` `v`) join `stuff_skill` `s` on(((`t`.`skill_category` = 2) and (`t`.`skill_title_id` = `v`.`skill_title`) and (`v`.`skill_id` = `s`.`skill_id`))));
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
windybirth/stuff-skill
|
sql/skill_db.sql
|
SQL
|
mit
| 8,662
|
<?php
class adminModel {
private $mysqli;
private $config;
public function __construct($mysqli, $config) {
$this->mysqli = $mysqli;
$this->config = $config;
}
public function hash($string) {
return hash("sha512", $string);
}
public function upload_file($name, $path) {
if(!is_uploaded_file($_FILES[$name]["tmp_name"])) {
throw new Exception("file upload error");
}
$filename = time().uniqid("", true);
$filename = md5($filename);
$arr = explode(".", $_FILES[$name]["name"]);
$extension = $arr[count($arr) - 1];
$filename = $filename.".".$extension;
mkdir($path, 0777, true);
$destination = $path."/".$filename;
rename($_FILES[$name]["tmp_name"], $destination);
$this->fix_image_orientation($destination);
return "/".$destination;
}
public function upload_multiple_files($name, $path) {
$count = count($_FILES[$name]["name"]);
$files = array();
for($i = 0 ; $i < $count ; $i++) {
if(!is_uploaded_file($_FILES[$name]["tmp_name"][$i])) {
throw new Exception("file upload error");
}
$filename = time().uniqid("", true);
$filename = md5($filename);
$arr = explode(".", $_FILES[$name]["name"][$i]);
$extension = $arr[count($arr) - 1];
$filename = $filename.".".$extension;
@mkdir($path, 0777, true);
$destination = $path."/".$filename;
rename($_FILES[$name]["tmp_name"][$i], $destination);
$this->fix_image_orientation($destination);
array_push($files, "/".$destination);
}
return $files;
}
private function fix_image_orientation($path) {
if(!function_exists("exif_read_data")) return;
if(!function_exists("gd_info")) return;
$arr = explode(".", $path);
$extension = strtolower($arr[count($arr) - 1]);
switch($extension) {
case "jpg": case "jpeg":
$image = imagecreatefromjpeg($path);
break;
case "png":
$image = imagecreatefrompng($path);
break;
default:
return;
}
$exif = exif_read_data($path);
if(empty($exif["Orientation"])) return;
switch($exif["Orientation"]) {
case 3:
$image = imagerotate($image, 180, 0);
break;
case 6:
$image = imagerotate($image, -90, 0);
break;
case 8:
$image = imagerotate($image, 90, 0);
break;
}
switch($extension) {
case "jpg": case "jpeg":
imagejpeg($image, $path, 100);
break;
case "png":
imagepng($image, $path);
break;
default:
return;
}
imagedestroy($image);
}
public function after_create($travel, $note) {
if($this->config["twitter"]["enabled"] === true) {
$this->_twitter($travel, $note);
}
}
private function _twitter($travel, $note) {
$twitter = new Twitter(
$this->config["twitter"]["consumer_key"],
$this->config["twitter"]["consumer_secret"]
);
$twitter->set_access_token($this->config["twitter"]["access_token"]);
$twitter->set_access_secret($this->config["twitter"]["access_secret"]);
$tweet = $this->_twitter_message($travel, $note);
$twitter->update_tweet($tweet);
}
private function _twitter_message($travel, $note) {
/*
tweet message format
|
|--- checkin
| |
| |--- photo + content + checkin = "[pic] content (@ venue) http://go.to/aaa/111"
| |--- content + checkin = "content (@ venue) http://go.to/aaa/111"
| |--- photo + checkin = "[pic] (@ venue) http://go.to/aaa/111"
| `--- checkin = "(@ venue) http://go.to/aaa/111"
|
`--- note
|
|--- photo + content = "[pic] content http://go.to/aaa/111"
|--- content = "content http://go.to/aaa/111"
`--- photo = "[pic] http://go.to/aaa/111"
*/
$data = unserialize($note["data"]["data"]);
// photo attached?
$tweet = "";
if($data["image"] !== false) {
$tweet = "[pic] ";
}
// content post prcocess
$content = $data["content"];
$content = Parsedown::instance()->text($content);
$content = strip_tags($content);
$content_len = mb_strlen($content, "UTF-8");
// venue post process & target length
if($note["data"]["type"] === "checkin") {
$location = $data["venue"][2];
$location_len = mb_strlen($location, "UTF-8");
$target_len = 110 - strlen($tweet) - $location_len;
$tweet .= "(@ ".$location.") ";
}
else if($note["data"]["type"] === "note") {
$target_len = 110 - strlen($tweet);
}
// content process
if($content_len >= $target_len) {
$content_cut = mb_substr($content, 0, $target_len, "UTF-8");
$content_cut = trim($content_cut);
$content_cut .= "...";
}
else {
$content_cut = trim($content);
}
$content_cut .= " ";
if($content !== "") {
$tweet .= $content_cut;
}
// venue process
if($note["data"]["type"] === "checkin") {
$tweet .= "(@ ".$location.") ";
}
// link
$link = $this->config["global"]["base_url"]."/".$travel["data"]["link"]."/".$note["data"]["id"];
$tweet .= $link;
return $tweet;
}
}
|
Snack-X/goto
|
model/admin.php
|
PHP
|
mit
| 4,881
|
<?php namespace Hpolthof\Admin;
use Illuminate\Routing\Controller;
class AdminTasksController extends Controller
{
public function index()
{
$items = AdminTask::whereUserId(\Auth::user()->id)->get();
return $items;
}
}
|
hpolthof/admin
|
src/AdminTasksController.php
|
PHP
|
mit
| 259
|
package core
import (
"crypto/sha256"
"errors"
"strings"
"time"
"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/golang/protobuf/ptypes"
google_protobuf "github.com/golang/protobuf/ptypes/timestamp"
util "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util"
ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr"
ps "gx/ipfs/QmXauCuJzmzapetmC6W4TuDJLL1yFFrVzSHoWv8YdbmnxH/go-libp2p-peerstore"
mh "gx/ipfs/QmZyZDi491cCNTLfAhwcaDii2Kg4pwKRkhqQzURGDvY6ua/go-multihash"
cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid"
"github.com/OpenBazaar/openbazaar-go/pb"
)
// EncodeCID - Hash with SHA-256 and encode as a multihash
func EncodeCID(b []byte) (*cid.Cid, error) {
multihash, err := EncodeMultihash(b)
if err != nil {
return nil, err
}
id := cid.NewCidV1(cid.Raw, *multihash)
return id, err
}
// EncodeMultihash - sha256 encode
func EncodeMultihash(b []byte) (*mh.Multihash, error) {
h := sha256.Sum256(b)
encoded, err := mh.Encode(h[:], mh.SHA2_256)
if err != nil {
return nil, err
}
multihash, err := mh.Cast(encoded)
if err != nil {
return nil, err
}
return &multihash, err
}
// ExtractIDFromPointer Certain pointers, such as moderators, contain a peerID. This function
// will extract the ID from the underlying PeerInfo object.
func ExtractIDFromPointer(pi ps.PeerInfo) (string, error) {
if len(pi.Addrs) == 0 {
return "", errors.New("PeerInfo object has no addresses")
}
addr := pi.Addrs[0]
if addr.Protocols()[0].Code != ma.P_IPFS {
return "", errors.New("IPFS protocol not found in address")
}
val, err := addr.ValueForProtocol(ma.P_IPFS)
if err != nil {
return "", err
}
return val, nil
}
// FormatRFC3339PB returns the given `google_protobuf.Timestamp` as a RFC3339
// formatted string
func FormatRFC3339PB(ts google_protobuf.Timestamp) string {
return util.FormatRFC3339(time.Unix(ts.Seconds, int64(ts.Nanos)).UTC())
}
// BuildTransactionRecords - Used by the GET order API to build transaction records suitable to be included in the order response
func (n *OpenBazaarNode) BuildTransactionRecords(contract *pb.RicardianContract, records []*wallet.TransactionRecord, state pb.OrderState) ([]*pb.TransactionRecord, *pb.TransactionRecord, error) {
paymentRecords := []*pb.TransactionRecord{}
payments := make(map[string]*pb.TransactionRecord)
// Consolidate any transactions with multiple outputs into a single record
for _, r := range records {
record, ok := payments[r.Txid]
if ok {
record.Value += r.Value
payments[r.Txid] = record
} else {
tx := new(pb.TransactionRecord)
tx.Txid = r.Txid
tx.Value = r.Value
ts, err := ptypes.TimestampProto(r.Timestamp)
if err != nil {
return paymentRecords, nil, err
}
tx.Timestamp = ts
ch, err := chainhash.NewHashFromStr(tx.Txid)
if err != nil {
return paymentRecords, nil, err
}
confirmations, height, err := n.Wallet.GetConfirmations(*ch)
if err != nil {
return paymentRecords, nil, err
}
tx.Height = height
tx.Confirmations = confirmations
payments[r.Txid] = tx
}
}
for _, rec := range payments {
paymentRecords = append(paymentRecords, rec)
}
var refundRecord *pb.TransactionRecord
if contract != nil && (state == pb.OrderState_REFUNDED || state == pb.OrderState_DECLINED || state == pb.OrderState_CANCELED) && contract.BuyerOrder != nil && contract.BuyerOrder.Payment != nil {
// For multisig we can use the outgoing from the payment address
if contract.BuyerOrder.Payment.Method == pb.Order_Payment_MODERATED || state == pb.OrderState_DECLINED || state == pb.OrderState_CANCELED {
for _, rec := range payments {
if rec.Value < 0 {
refundRecord = new(pb.TransactionRecord)
refundRecord.Txid = rec.Txid
refundRecord.Value = -rec.Value
refundRecord.Confirmations = rec.Confirmations
refundRecord.Height = rec.Height
refundRecord.Timestamp = rec.Timestamp
break
}
}
} else if contract.Refund != nil && contract.Refund.RefundTransaction != nil && contract.Refund.Timestamp != nil {
refundRecord = new(pb.TransactionRecord)
// Direct we need to use the transaction info in the contract's refund object
ch, err := chainhash.NewHashFromStr(contract.Refund.RefundTransaction.Txid)
if err != nil {
return paymentRecords, refundRecord, err
}
confirmations, height, err := n.Wallet.GetConfirmations(*ch)
if err != nil {
return paymentRecords, refundRecord, nil
}
refundRecord.Txid = contract.Refund.RefundTransaction.Txid
refundRecord.Value = int64(contract.Refund.RefundTransaction.Value)
refundRecord.Timestamp = contract.Refund.Timestamp
refundRecord.Confirmations = confirmations
refundRecord.Height = height
}
}
return paymentRecords, refundRecord, nil
}
// NormalizeCurrencyCode standardizes the format for the given currency code
func NormalizeCurrencyCode(currencyCode string) string {
return strings.ToUpper(currencyCode)
}
|
hoffmabc/openbazaar-go
|
core/utils.go
|
GO
|
mit
| 5,029
|
package com.welovecoding.nbeditorconfig.model;
public class EditorConfigConstant {
public static final String ROOT = "root";
public static final String MAX_LINE_LENGTH = "max_line_length";
/**
* Set to latin1, utf-8, utf-8-bom, utf-16be or utf-16le to control the
* character set. Use of utf-8-bom is discouraged.
*/
public static final String CHARSET = "charset";
public static final String CHARSET_LATIN_1 = "latin1"; // ISO-LATIN-1
public static final String CHARSET_UTF_8 = "utf-8"; // UTF-8
public static final String CHARSET_UTF_8_BOM = "utf-8-bom"; // UTF-8 with signature
public static final String CHARSET_UTF_16_BE = "utf-16be"; // UTF-16BE
public static final String CHARSET_UTF_16_LE = "utf-16le"; // UTF-16LE (UCS-2-LE)
/**
* Set to lf, cr, or crlf to control how line breaks are represented.
*/
public static final String END_OF_LINE = "end_of_line";
public static final String END_OF_LINE_LF = "lf"; // Linux, Mac OS X
public static final String END_OF_LINE_CR = "cr"; // Mac OS 9
public static final String END_OF_LINE_CRLF = "crlf";
/**
* A whole number defining the number of columns used for each indentation
* level and the width of soft tabs (when supported). When set to tab, the
* value of tab_width (if specified) will be used.
*/
public static final String INDENT_SIZE = "indent_size";
/**
* Set to tab or space to use hard tabs or soft tabs respectively.
*/
public static final String INDENT_STYLE = "indent_style";
public static final String INDENT_STYLE_SPACE = "space";
public static final String INDENT_STYLE_TAB = "tab";
/**
* Set to true ensure file ends with a newline when saving and false to ensure
* it doesn't.
*/
public static final String INSERT_FINAL_NEWLINE = "insert_final_newline";
/**
* A whole number defining the number of columns used to represent a tab
* character. This defaults to the value of indent_size and doesn't usually
* need to be specified.
*/
public static final String TAB_WIDTH = "tab_width";
/**
* Set to true to remove any whitespace characters preceding newline
* characters and false to ensure it doesn't.
*/
public static final String TRIM_TRAILING_WHITESPACE = "trim_trailing_whitespace";
}
|
welovecoding/editorconfig-netbeans
|
src/main/java/com/welovecoding/nbeditorconfig/model/EditorConfigConstant.java
|
Java
|
mit
| 2,306
|
/*
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* 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.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
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
OWNER 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.
----------------------------------------------------------------------
*/
/** @file LWOAnimation.cpp
* @brief LWOAnimationResolver utility class
*
* It's a very generic implementation of LightWave's system of
* componentwise-animated stuff. The one and only fully free
* implementation of LightWave envelopes of which I know.
*/
#include "AssimpPCH.h"
#if (!defined ASSIMP_BUILD_NO_LWO_IMPORTER) && (!defined ASSIMP_BUILD_NO_LWS_IMPORTER)
// internal headers
#include "LWOFileData.h"
#include <functional>
using namespace Assimp;
using namespace Assimp::LWO;
// ------------------------------------------------------------------------------------------------
// Construct an animation resolver from a given list of envelopes
AnimResolver::AnimResolver(std::list<Envelope>& _envelopes,double tick)
: envelopes (_envelopes)
, sample_rate (0.)
{
trans_x = trans_y = trans_z = NULL;
rotat_x = rotat_y = rotat_z = NULL;
scale_x = scale_y = scale_z = NULL;
first = last = 150392.;
// find transformation envelopes
for (std::list<LWO::Envelope>::iterator it = envelopes.begin(); it != envelopes.end(); ++it) {
(*it).old_first = 0;
(*it).old_last = (*it).keys.size()-1;
if ((*it).keys.empty()) continue;
switch ((*it).type) {
// translation
case LWO::EnvelopeType_Position_X:
trans_x = &*it;break;
case LWO::EnvelopeType_Position_Y:
trans_y = &*it;break;
case LWO::EnvelopeType_Position_Z:
trans_z = &*it;break;
// rotation
case LWO::EnvelopeType_Rotation_Heading:
rotat_x = &*it;break;
case LWO::EnvelopeType_Rotation_Pitch:
rotat_y = &*it;break;
case LWO::EnvelopeType_Rotation_Bank:
rotat_z = &*it;break;
// scaling
case LWO::EnvelopeType_Scaling_X:
scale_x = &*it;break;
case LWO::EnvelopeType_Scaling_Y:
scale_y = &*it;break;
case LWO::EnvelopeType_Scaling_Z:
scale_z = &*it;break;
default:
continue;
};
// convert from seconds to ticks
for (std::vector<LWO::Key>::iterator d = (*it).keys.begin(); d != (*it).keys.end(); ++d)
(*d).time *= tick;
// set default animation range (minimum and maximum time value for which we have a keyframe)
first = std::min(first, (*it).keys.front().time );
last = std::max(last, (*it).keys.back().time );
}
// deferred setup of animation range to increase performance.
// typically the application will want to specify its own.
need_to_setup = true;
}
// ------------------------------------------------------------------------------------------------
// Reset all envelopes to their original contents
void AnimResolver::ClearAnimRangeSetup()
{
for (std::list<LWO::Envelope>::iterator it = envelopes.begin(); it != envelopes.end(); ++it) {
(*it).keys.erase((*it).keys.begin(),(*it).keys.begin()+(*it).old_first);
(*it).keys.erase((*it).keys.begin()+(*it).old_last+1,(*it).keys.end());
}
}
// ------------------------------------------------------------------------------------------------
// Insert additional keys to match LWO's pre& post behaviours.
void AnimResolver::UpdateAnimRangeSetup()
{
// XXX doesn't work yet (hangs if more than one envelope channels needs to be interpolated)
for (std::list<LWO::Envelope>::iterator it = envelopes.begin(); it != envelopes.end(); ++it) {
if ((*it).keys.empty()) continue;
const double my_first = (*it).keys.front().time;
const double my_last = (*it).keys.back().time;
const double delta = my_last-my_first;
const size_t old_size = (*it).keys.size();
const float value_delta = (*it).keys.back().value - (*it).keys.front().value;
// NOTE: We won't handle reset, linear and constant here.
// See DoInterpolation() for their implementation.
// process pre behaviour
switch ((*it).pre) {
case LWO::PrePostBehaviour_OffsetRepeat:
case LWO::PrePostBehaviour_Repeat:
case LWO::PrePostBehaviour_Oscillate:
{
const double start_time = delta - fmod(my_first-first,delta);
std::vector<LWO::Key>::iterator n = std::find_if((*it).keys.begin(),(*it).keys.end(),
std::bind1st(std::greater<double>(),start_time)),m;
size_t ofs = 0;
if (n != (*it).keys.end()) {
// copy from here - don't use iterators, insert() would invalidate them
ofs = (*it).keys.end()-n;
(*it).keys.insert((*it).keys.begin(),ofs,LWO::Key());
std::copy((*it).keys.end()-ofs,(*it).keys.end(),(*it).keys.begin());
}
// do full copies. again, no iterators
const unsigned int num = (unsigned int)((my_first-first) / delta);
(*it).keys.resize((*it).keys.size() + num*old_size);
n = (*it).keys.begin()+ofs;
bool reverse = false;
for (unsigned int i = 0; i < num; ++i) {
m = n+old_size*(i+1);
std::copy(n,n+old_size,m);
if ((*it).pre == LWO::PrePostBehaviour_Oscillate && (reverse = !reverse))
std::reverse(m,m+old_size-1);
}
// update time values
n = (*it).keys.end() - (old_size+1);
double cur_minus = delta;
unsigned int tt = 1;
for (const double tmp = delta*(num+1);cur_minus <= tmp;cur_minus += delta,++tt) {
m = (delta == tmp ? (*it).keys.begin() : n - (old_size+1));
for (;m != n; --n) {
(*n).time -= cur_minus;
// offset repeat? add delta offset to key value
if ((*it).pre == LWO::PrePostBehaviour_OffsetRepeat) {
(*n).value += tt * value_delta;
}
}
}
break;
}
default:
// silence compiler warning
break;
}
// process post behaviour
switch ((*it).post) {
case LWO::PrePostBehaviour_OffsetRepeat:
case LWO::PrePostBehaviour_Repeat:
case LWO::PrePostBehaviour_Oscillate:
break;
default:
// silence compiler warning
break;
}
}
}
// ------------------------------------------------------------------------------------------------
// Extract bind pose matrix
void AnimResolver::ExtractBindPose(aiMatrix4x4& out)
{
// If we have no envelopes, return identity
if (envelopes.empty()) {
out = aiMatrix4x4();
return;
}
aiVector3D angles, scaling(1.f,1.f,1.f), translation;
if (trans_x) translation.x = trans_x->keys[0].value;
if (trans_y) translation.y = trans_y->keys[0].value;
if (trans_z) translation.z = trans_z->keys[0].value;
if (rotat_x) angles.x = rotat_x->keys[0].value;
if (rotat_y) angles.y = rotat_y->keys[0].value;
if (rotat_z) angles.z = rotat_z->keys[0].value;
if (scale_x) scaling.x = scale_x->keys[0].value;
if (scale_y) scaling.y = scale_y->keys[0].value;
if (scale_z) scaling.z = scale_z->keys[0].value;
// build the final matrix
aiMatrix4x4 s,rx,ry,rz,t;
aiMatrix4x4::RotationZ(angles.z, rz);
aiMatrix4x4::RotationX(angles.y, rx);
aiMatrix4x4::RotationY(angles.x, ry);
aiMatrix4x4::Translation(translation,t);
aiMatrix4x4::Scaling(scaling,s);
out = t*ry*rx*rz*s;
}
// ------------------------------------------------------------------------------------------------
// Do a single interpolation on a channel
void AnimResolver::DoInterpolation(std::vector<LWO::Key>::const_iterator cur,
LWO::Envelope* envl,double time, float& fill)
{
if (envl->keys.size() == 1) {
fill = envl->keys[0].value;
return;
}
// check whether we're at the beginning of the animation track
if (cur == envl->keys.begin()) {
// ok ... this depends on pre behaviour now
// we don't need to handle repeat&offset repeat&oszillate here, see UpdateAnimRangeSetup()
switch (envl->pre)
{
case LWO::PrePostBehaviour_Linear:
DoInterpolation2(cur,cur+1,time,fill);
return;
case LWO::PrePostBehaviour_Reset:
fill = 0.f;
return;
default : //case LWO::PrePostBehaviour_Constant:
fill = (*cur).value;
return;
}
}
// check whether we're at the end of the animation track
else if (cur == envl->keys.end()-1 && time > envl->keys.rbegin()->time) {
// ok ... this depends on post behaviour now
switch (envl->post)
{
case LWO::PrePostBehaviour_Linear:
DoInterpolation2(cur,cur-1,time,fill);
return;
case LWO::PrePostBehaviour_Reset:
fill = 0.f;
return;
default : //case LWO::PrePostBehaviour_Constant:
fill = (*cur).value;
return;
}
}
// Otherwise do a simple interpolation
DoInterpolation2(cur-1,cur,time,fill);
}
// ------------------------------------------------------------------------------------------------
// Almost the same, except we won't handle pre/post conditions here
void AnimResolver::DoInterpolation2(std::vector<LWO::Key>::const_iterator beg,
std::vector<LWO::Key>::const_iterator end,double time, float& fill)
{
switch ((*end).inter) {
case LWO::IT_STEP:
// no interpolation at all - take the value of the last key
fill = (*beg).value;
return;
default:
// silence compiler warning
break;
}
// linear interpolation - default
fill = (*beg).value + ((*end).value - (*beg).value)*(float)(((time - (*beg).time) / ((*end).time - (*beg).time)));
}
// ------------------------------------------------------------------------------------------------
// Subsample animation track by given key values
void AnimResolver::SubsampleAnimTrack(std::vector<aiVectorKey>& /*out*/,
double /*time*/ ,double /*sample_delta*/ )
{
//ai_assert(out.empty() && sample_delta);
//const double time_start = out.back().mTime;
// for ()
}
// ------------------------------------------------------------------------------------------------
// Track interpolation
void AnimResolver::InterpolateTrack(std::vector<aiVectorKey>& out,aiVectorKey& fill,double time)
{
// subsample animation track?
if (flags & AI_LWO_ANIM_FLAG_SAMPLE_ANIMS) {
SubsampleAnimTrack(out,time, sample_delta);
}
fill.mTime = time;
// get x
if ((*cur_x).time == time) {
fill.mValue.x = (*cur_x).value;
if (cur_x != envl_x->keys.end()-1) /* increment x */
++cur_x;
else end_x = true;
}
else DoInterpolation(cur_x,envl_x,time,(float&)fill.mValue.x);
// get y
if ((*cur_y).time == time) {
fill.mValue.y = (*cur_y).value;
if (cur_y != envl_y->keys.end()-1) /* increment y */
++cur_y;
else end_y = true;
}
else DoInterpolation(cur_y,envl_y,time,(float&)fill.mValue.y);
// get z
if ((*cur_z).time == time) {
fill.mValue.z = (*cur_z).value;
if (cur_z != envl_z->keys.end()-1) /* increment z */
++cur_z;
else end_x = true;
}
else DoInterpolation(cur_z,envl_z,time,(float&)fill.mValue.z);
}
// ------------------------------------------------------------------------------------------------
// Build linearly subsampled keys from three single envelopes, one for each component (x,y,z)
void AnimResolver::GetKeys(std::vector<aiVectorKey>& out,
LWO::Envelope* _envl_x,
LWO::Envelope* _envl_y,
LWO::Envelope* _envl_z,
unsigned int _flags)
{
envl_x = _envl_x;
envl_y = _envl_y;
envl_z = _envl_z;
flags = _flags;
// generate default channels if none are given
LWO::Envelope def_x, def_y, def_z;
LWO::Key key_dummy;
key_dummy.time = 0.f;
if ((envl_x && envl_x->type == LWO::EnvelopeType_Scaling_X) ||
(envl_y && envl_y->type == LWO::EnvelopeType_Scaling_Y) ||
(envl_z && envl_z->type == LWO::EnvelopeType_Scaling_Z)) {
key_dummy.value = 1.f;
}
else key_dummy.value = 0.f;
if (!envl_x) {
envl_x = &def_x;
envl_x->keys.push_back(key_dummy);
}
if (!envl_y) {
envl_y = &def_y;
envl_y->keys.push_back(key_dummy);
}
if (!envl_z) {
envl_z = &def_z;
envl_z->keys.push_back(key_dummy);
}
// guess how many keys we'll get
size_t reserve;
double sr = 1.;
if (flags & AI_LWO_ANIM_FLAG_SAMPLE_ANIMS) {
if (!sample_rate)
sr = 100.f;
else sr = sample_rate;
sample_delta = 1.f / sr;
reserve = (size_t)(
std::max( envl_x->keys.rbegin()->time,
std::max( envl_y->keys.rbegin()->time, envl_z->keys.rbegin()->time )) * sr);
}
else reserve = std::max(envl_x->keys.size(),std::max(envl_x->keys.size(),envl_z->keys.size()));
out.reserve(reserve+(reserve>>1));
// Iterate through all three arrays at once - it's tricky, but
// rather interesting to implement.
double lasttime = std::min(envl_x->keys[0].time,std::min(envl_y->keys[0].time,envl_z->keys[0].time));
cur_x = envl_x->keys.begin();
cur_y = envl_y->keys.begin();
cur_z = envl_z->keys.begin();
end_x = end_y = end_z = false;
while (1) {
aiVectorKey fill;
if ((*cur_x).time == (*cur_y).time && (*cur_x).time == (*cur_z).time ) {
// we have a keyframe for all of them defined .. great,
// we don't need to fucking interpolate here ...
fill.mTime = (*cur_x).time;
fill.mValue.x = (*cur_x).value;
fill.mValue.y = (*cur_y).value;
fill.mValue.z = (*cur_z).value;
// subsample animation track
if (flags & AI_LWO_ANIM_FLAG_SAMPLE_ANIMS) {
//SubsampleAnimTrack(out,cur_x, cur_y, cur_z, d, sample_delta);
}
}
// Find key with lowest time value
else if ((*cur_x).time <= (*cur_y).time && !end_x) {
if ((*cur_z).time <= (*cur_x).time && !end_z) {
InterpolateTrack(out,fill,(*cur_z).time);
}
else {
InterpolateTrack(out,fill,(*cur_x).time);
}
}
else if ((*cur_z).time <= (*cur_y).time && !end_y) {
InterpolateTrack(out,fill,(*cur_y).time);
}
else if (!end_y) {
// welcome on the server, y
InterpolateTrack(out,fill,(*cur_y).time);
}
else {
// we have reached the end of at least 2 channels,
// only one is remaining. Extrapolate the 2.
if (end_y) {
InterpolateTrack(out,fill,(end_x ? (*cur_z) : (*cur_x)).time);
}
else if (end_x) {
InterpolateTrack(out,fill,(end_z ? (*cur_y) : (*cur_z)).time);
}
else { // if (end_z)
InterpolateTrack(out,fill,(end_y ? (*cur_x) : (*cur_y)).time);
}
}
lasttime = fill.mTime;
out.push_back(fill);
if (lasttime >= (*cur_x).time) {
if (cur_x != envl_x->keys.end()-1)
++cur_x;
else end_x = true;
}
if (lasttime >= (*cur_y).time) {
if (cur_y != envl_y->keys.end()-1)
++cur_y;
else end_y = true;
}
if (lasttime >= (*cur_z).time) {
if (cur_z != envl_z->keys.end()-1)
++cur_z;
else end_z = true;
}
if( end_x && end_y && end_z ) /* finished? */
break;
}
if (flags & AI_LWO_ANIM_FLAG_START_AT_ZERO) {
for (std::vector<aiVectorKey>::iterator it = out.begin(); it != out.end(); ++it)
(*it).mTime -= first;
}
}
// ------------------------------------------------------------------------------------------------
// Extract animation channel
void AnimResolver::ExtractAnimChannel(aiNodeAnim** out, unsigned int flags /*= 0*/)
{
*out = NULL;
//FIXME: crashes if more than one component is animated at different timings, to be resolved.
// If we have no envelopes, return NULL
if (envelopes.empty()) {
return;
}
// We won't spawn an animation channel if we don't have at least one envelope with more than one keyframe defined.
const bool trans = ((trans_x && trans_x->keys.size() > 1) || (trans_y && trans_y->keys.size() > 1) || (trans_z && trans_z->keys.size() > 1));
const bool rotat = ((rotat_x && rotat_x->keys.size() > 1) || (rotat_y && rotat_y->keys.size() > 1) || (rotat_z && rotat_z->keys.size() > 1));
const bool scale = ((scale_x && scale_x->keys.size() > 1) || (scale_y && scale_y->keys.size() > 1) || (scale_z && scale_z->keys.size() > 1));
if (!trans && !rotat && !scale)
return;
// Allocate the output animation
aiNodeAnim* anim = *out = new aiNodeAnim();
// Setup default animation setup if necessary
if (need_to_setup) {
UpdateAnimRangeSetup();
need_to_setup = false;
}
// copy translation keys
if (trans) {
std::vector<aiVectorKey> keys;
GetKeys(keys,trans_x,trans_y,trans_z,flags);
anim->mPositionKeys = new aiVectorKey[ anim->mNumPositionKeys = keys.size() ];
std::copy(keys.begin(),keys.end(),anim->mPositionKeys);
}
// copy rotation keys
if (rotat) {
std::vector<aiVectorKey> keys;
GetKeys(keys,rotat_x,rotat_y,rotat_z,flags);
anim->mRotationKeys = new aiQuatKey[ anim->mNumRotationKeys = keys.size() ];
// convert heading, pitch, bank to quaternion
// mValue.x=Heading=Rot(Y), mValue.y=Pitch=Rot(X), mValue.z=Bank=Rot(Z)
// Lightwave's rotation order is ZXY
aiVector3D X(1.0,0.0,0.0);
aiVector3D Y(0.0,1.0,0.0);
aiVector3D Z(0.0,0.0,1.0);
for (unsigned int i = 0; i < anim->mNumRotationKeys; ++i) {
aiQuatKey& qk = anim->mRotationKeys[i];
qk.mTime = keys[i].mTime;
qk.mValue = aiQuaternion(Y,keys[i].mValue.x)*aiQuaternion(X,keys[i].mValue.y)*aiQuaternion(Z,keys[i].mValue.z);
}
}
// copy scaling keys
if (scale) {
std::vector<aiVectorKey> keys;
GetKeys(keys,scale_x,scale_y,scale_z,flags);
anim->mScalingKeys = new aiVectorKey[ anim->mNumScalingKeys = keys.size() ];
std::copy(keys.begin(),keys.end(),anim->mScalingKeys);
}
}
#endif // no lwo or no lws
|
ptrefall/hybrid-rendering-thesis
|
depends/include/AssImp/src/LWOAnimation.cpp
|
C++
|
mit
| 18,817
|
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using MOBA.Assets;
using MOBA.Characters.Controller;
using MOBA.Characters.Classes;
using MOBA.Characters.Classes.StatusEffects;
using MOBA.Characters.Prototype;
using MOBA.World;
using MOBA.Input;
using MOBA.Math;
namespace MOBA.Characters.Classes.Spells
{
public class Ability
{
public Player pClass;
public static Ability None;
public List<Projectile> projectileList
{ get; protected set; }
public int Cost
{ get; protected set; }
public Image image
{ get; protected set; }
public int Damage
{ get; protected set; }
public Debuff debuff
{ get; protected set; }
public Buff buff
{ get; protected set; }
public float Speed
{ get; protected set; }
public Rectangle Rect
{ get; protected set; }
public Rectangle hitRect
{ get; protected set; }
public float SpellRange
{ get; protected set; }
public LightEmitter Emitter
{ get; protected set; }
public float LightRadius
{ get; protected set; }
public bool Selecting = false;
public bool Alive = false;
public Vector2 Position;
protected Timer cooldown;
public bool onCooldown
{ get; protected set; }
public Ability(Player player)
{
pClass = player;
projectileList = new List<Projectile>();
}
public virtual void Update(GameTime gameTime)
{
if (onCooldown)
cooldown.Run();
if (cooldown.Tick)
onCooldown = false;
}
public virtual void Select()
{
Selecting = !Selecting;
pClass.canAttack = !pClass.canAttack;
}
public void failedCast()
{
onCooldown = false;
}
public void removeProjectile(Projectile p)
{
projectileList.Remove(p);
}
public virtual void Cast(GameTime gameTime)
{
if (!onCooldown)
{
cooldown = new Timer(60, false);
onCooldown = true;
Selecting = false;
pClass.canAttack = true;
}
}
public virtual void Draw(SpriteBatch spriteBatch)
{
//spriteBatch.Draw(image.Texture, new Rectangle((int)Position.X, (int)Position.Y, Rect.Width, Rect.Height), image.sRect, Color.White);
}
}
}
|
Czahyl/MOBA
|
MOBA/MOBA/Characters/Classes/Spells/Ability.cs
|
C#
|
mit
| 2,876
|
/*
* Author: MinusKelvin <minuskelvin.carlson@gmail.com>
*/
#ifndef _COMPILER_BASE_H_
#define _COMPILER_BASE_H_
// base.h
typedef struct Location Location;
typedef struct ASTNode ASTNode;
typedef struct ASTProgram ASTProgram;
typedef struct ASTQualifiedName ASTQualifiedName;
typedef struct ASTType ASTType;
// program.h
typedef struct ASTUse ASTUse;
typedef struct ASTAlias ASTAlias;
typedef struct ASTImport ASTImport;
// externStatement.h
typedef struct ASTExternStatement ASTExternStatement;
typedef struct ASTExternStatementDeclareVariable ASTExternStatementDeclareVariable;
typedef struct ASTExternStatementDeclareExternFunction ASTExternStatementDeclareExternFunction;
typedef struct ASTExternStatementDeclareFunction ASTExternStatementDeclareFunction;
// statement.h
typedef struct ASTCodeBlock ASTCodeBlock;
typedef struct ASTStatement ASTStatement;
typedef struct ASTStatementExpression ASTStatementExpression;
typedef struct ASTStatementBlock ASTStatementBlock;
typedef struct ASTStatementWhile ASTStatementWhile;
typedef struct ASTStatementDoWhile ASTStatementDoWhile;
typedef struct ASTStatementIf ASTStatementIf;
// expression.h
typedef struct ASTExpression ASTExpression;
typedef struct ASTExpressionBinaryOp ASTExpressionBinaryOp;
typedef struct ASTExpressionUnaryOp ASTExpressionUnaryOp;
typedef struct ASTExpressionAssign ASTExpressionAssign;
typedef struct ASTExpressionLiteral ASTExpressionLiteral;
typedef struct ASTExpressionCall ASTExpressionCall;
typedef struct ASTExpressionAddressof ASTExpressionAddressof;
typedef struct ASTExpressionReference ASTExpressionReference;
typedef struct ASTExpressionSizeof ASTExpressionSizeof;
// reference.h
typedef struct ASTReference ASTReference;
typedef struct ASTReferenceIdentifier ASTReferenceIdentifier;
typedef struct ASTReferenceIndex ASTReferenceIndex;
typedef struct ASTReferenceMemberAccess ASTReferenceMemberAccess;
// annotation.h
typedef struct ASTAnnotation ASTAnnotation;
typedef struct ASTKeyValue ASTKeyValue;
typedef enum {
AST_EXTERN_STATEMENT,
AST_ALIAS,
AST_QUALIFIED_NAME,
AST_EXPRESSION,
AST_STATEMENT
} ASTNodeType;
struct Location {
int firstLine;
int firstColumn;
int lastLine;
int lastColumn;
};
struct ASTNode {
ASTNodeType type;
Location loc;
};
struct ASTQualifiedName {
ASTNode super;
int length;
const char **parts;
};
struct ASTType {
ASTNode super;
ASTQualifiedName *name;
ASTType *subtype;
};
#endif /* _COMPILER_BASE_H_ */
|
MinusKelvin/mkc
|
src/ast/base.h
|
C
|
mit
| 2,453
|
# encoding: UTF-8
$LOAD_PATH.unshift(File.dirname(__FILE__))
# TODO: Remove bundler and convert to gemspec
require 'bundler/setup'
Bundler.require(:default)
require 'date'
require 'fileutils'
require 'find'
require 'pathname'
require 'yaml'
require 'logger'
require 'renamer/file_tools'
require 'renamer/video_scanner'
module Renamer
DATA_ROOT = File.expand_path('../renamer/data', __FILE__)
VALID_EXTENSIONS = %w[.3gp .asf .asx .avi .flv .iso .m2t .m2ts .m2v .m4v .mkv
.mov .mp4 .mpeg .mpg .mts .ts .tp .trp .vob .wmv .swf]
NUMERAL_DATE_FORMAT = '[%y.%m.%d]'
def self.logger
@logger ||= begin
logger = Logger.new(STDOUT)
logger.level = Logger::WARN
logger
end
end
end
|
gmanley/renamer
|
lib/renamer.rb
|
Ruby
|
mit
| 737
|
/*
Detect loop in a linked list
List could be empty also
Node is defined as
struct Node
{
int data;
struct Node *next;
}
*/
int HasCycle(Node* head)
{
if (!head)
return 0;
Node *p = head, *q = head->next;
while (p && q)
if (p == q)
return 1;
else {
p = p->next;
q = q->next ? q->next->next : q->next;
}
return 0;
}
|
cassiopagnoncelli/hacker-rank-solutions
|
detect-cycle-linked-list.cpp
|
C++
|
mit
| 434
|
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>Sample post | Type Theme</title>
<meta name="description" content="Consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et ...">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-Frame-Options" content="sameorigin">
<!-- CSS -->
<link rel="stylesheet" href="/css/main.css">
<!--Favicon-->
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<!-- Canonical -->
<link rel="canonical" href="https://toomatoo.github.io/2014/11/30/sample-post.html">
<!-- RSS -->
<link rel="alternate" type="application/atom+xml" title="Type Theme" href="https://toomatoo.github.io/feed.xml" />
<!-- Font Awesome -->
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Google Fonts -->
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,700italic,400italic" rel="stylesheet" type="text/css">
<!-- KaTeX -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.js"></script>
<!-- Google Analytics -->
</head>
<body>
<header class="site-header">
<div class="branding">
<a href="/">
<img class="avatar" src="/img/avatar.png" alt=""/>
</a>
<h1 class="site-title">
<a href="/">Type Theme</a>
</h1>
</div>
<nav class="site-nav">
<ul>
<li>
<a class="page-link" href="/about/">
About
</a>
</li>
<!-- Social icons from Font Awesome, if enabled -->
<li>
<a href="https://github.com/rohanchandra/type-theme" title="Follow on GitHub">
<i class="fa fa-fw fa-github"></i>
</a>
</li>
<li>
<a href="https://twitter.com/twitter" title="Follow on Twitter">
<i class="fa fa-fw fa-twitter"></i>
</a>
</li>
</ul>
</nav>
</header>
<div class="content">
<article >
<header style="background-image: url('/')">
<h1 class="title">Sample post</h1>
<p class="meta">
November 30, 2014
</p>
</header>
<section class="post-content"><p>Consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem.</p>
<ul>
<li>Consectetur adipiscing elit</li>
<li>Donec a diam lectus</li>
<li>Sed sit amet ipsum mauris</li>
</ul>
<p>Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
<p>Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula <em>semper consectetur sagittis</em>, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum.</p>
<p>Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
<blockquote>
<p>Suspendisse lectus leo, consectetur in tempor sit amet, placerat quis neque</p>
</blockquote>
<p>Etiam luctus porttitor lorem, sed suscipit est rutrum non. Curabitur lobortis nisl a enim congue semper. Aenean commodo ultrices imperdiet. Vestibulum ut justo vel sapien venenatis tincidunt.</p>
<p>Phasellus eget dolor sit amet ipsum dapibus condimentum vitae quis lectus. Aliquam ut massa in turpis dapibus convallis. Praesent elit lacus, vestibulum at malesuada et, ornare et est. Ut augue nunc, sodales ut euismod non, adipiscing vitae orci. Mauris ut placerat justo. Mauris in ultricies enim. Quisque nec est eleifend nulla ultrices egestas quis ut quam. Donec sollicitudin lectus a mauris pulvinar id aliquam urna cursus. Cras quis ligula sem, vel elementum mi. Phasellus non ullamcorper urna.</p>
</section>
</article>
<!-- Post navigation -->
<!-- Disqus -->
</div>
<script src="/js/katex_init.js"></script>
<footer class="site-footer">
<p class="text">Powered by <a href="http://jekyllrb.com">Jekyll</a> with <a href="https://rohanchandra.github.io/project/type/">Type Theme</a>
</p>
</footer>
</body>
</html>
|
Toomatoo/Toomatoo.github.io
|
_site/2014/11/30/sample-post.html
|
HTML
|
mit
| 5,514
|
# Vector
A vector is a data container which can contain a sequence of any kind of constructor or generic type.
|
VictorQueiroz/binary-transfer
|
docs/Vector.md
|
Markdown
|
mit
| 112
|
class Umbrella::Application
ActionView::Base.default_form_builder = Forms::Base
end
|
MichaelSp/SocialProjectsHub
|
config/initializers/forms.rb
|
Ruby
|
mit
| 87
|
MIT License
===========
Copyright (C) 2013 Western Michigan University
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.
|
mdlayher/wmutube
|
LICENSE.md
|
Markdown
|
mit
| 1,096
|
package me.shoutto.sdk.internal.location;
import android.location.Location;
public interface LocationUpdateListener {
void onLocationUpdate(Location location);
}
|
ShoutToMe/stm-sdk-android
|
shout-to-me-sdk/src/main/java/me/shoutto/sdk/internal/location/LocationUpdateListener.java
|
Java
|
mit
| 168
|
# cancer
Cancer classification, detection and segmentation
Current result, using LSTM and simplified Google Inception
| Subset | 84000 | 96000 | 108000 | 120000 |
|--------|-------|-------|--------|--------|
| 0 | 0.8214 | 0.8532 | 0.8130 | 0.8208 |
| 1 | 0.7333 | 0.7723 | 0.8015 | 0.8253 |
| 2 | 0.7966 | 0.8880 | 0.8760 | 0.8870 |
| 3 | 0.8275 | 0.8275 | 0.8053 | 0.8304 |
| 4 | 0.8114 | 0.8400 | 0.8960 | 0.8828 |
| 5 | 0.8118 | 0.7980 | 0.8155 | 0.7700 |
| 6 | 0.7903 | 0.8412 | 0.7953 | 0.8130 |
| 7 | 0.7333 | 0.7596 | 0.6930 | 0.7453 |
| 8 | 0.7966 | 0.7280 | 0.7368 | 0.7606 |
| 9 | 0.7823 | 0.7979 | 0.7858 | 0.8105 |
| 7(O) | 0.7075 | 0.7403 | 0.7019 | 0.7735 |
| 8(O) | 0.7796 | 0.7478 | 0.7372 | 0.7797 |
| 9(O) | 0.7835 | 0.7777 | 0.7677 | 0.7575 |
AVG (0.8532 + 0.8243 + 0.8880 + 0.8304 + 0.8960 + 0.8155 + 0.8412 + 0.7596 + 0.7966 + 0.8105) / 10 = 0.8315299999999999
| Subset | 84000 | 96000 | 108000 | 120000 |
|--------|-------|-------|--------|--------|
| 0 | 0.7232 | 0.7143 | 0.7321 | 0.7500 |
| 1 | 0.6484 | 0.7031 | 0.7344 | 0.7265 |
| 2 | 0.6953 | 0.7968 | 0.7187 | 0.7187 |
| 3 | 0.7311 | 0.7143 | 0.7563 | 0.7311 |
| 4 | 0.7656 | 0.7813 | 0.7578 | 0.7423 |
| 5 | 0.6296 | 0.6203 | 0.6296 | 0.6574 |
| 6 | 0.6667 | 0.6511 | 0.6744 | 0.5969 |
| 7 | 0.6396 | 0.6849 | 0.7118 | 0.6937 |
| 8 | 0.6610 | 0.6401 | 0.6356 | 0.6864 |
| 9 | 0.6667 | 0.7048 | 0.6381 | 0.6190 |
| Subset | 84000 | 96000 | 108000 | 120000 |
|--------|-------|-------|--------|--------|
| 0 | 0.7053 | 0.7410 | 0.7857 | 0.7678 |
| 1 | 0.8281 | 0.8516 | 0.8359 | 0.9140 |
| 2 | 0.7656 | 0.7656 | 0.6875 | 0.7813 |
| 3 | 0.6554 | 0.5126 | 0.7479 | 0.7563 |
| 4 | 0.8672 | 0.7578 | 0.8359 | 0.8437 |
| 5 | 0.7407 | 0.6852 | 0.7314 | 0.6944 |
| 6 | 0.6821 | 0.7054 | 0.8527 | 0.8837 |
| 7 | 0.8378 | 0.8288 | 0.8559 | 0.8739 |
| 8 | 0.7458 | 0.6525 | 0.7712 | 0.7797 |
| 9 | 0.7047 | 0.6952 | 0.6381 | 0.7143 |
AVG = (0.7857 + 0.9140 + 0.7813 + 0.7563 + 0.8672 + 0.7407 + 0.8837 + 0.8739 + 0.7797 + 0.7143) / 10 = 0.80968
|
yancz1989/cancer
|
README.md
|
Markdown
|
mit
| 2,022
|
/*global describe:false,expect:false,rIt:false*/
describe("utils", function() {
"use strict";
describe("format", function() {
rIt("should format single param", ["utils"], function(utils) {
expect(utils.format("The Winner is %", "John Doe"))
.toEqual("The Winner is John Doe");
});
rIt("should format multiple params", ["utils"], function(utils) {
expect(utils.format("% should %", "You", "hack!"))
.toEqual("You should hack!");
});
rIt("allows escaping of params", ["utils"], function(utils) {
expect(utils.format("% get %\\% on the %!", "You", "5", "price"))
.toEqual("You get 5% on the price!");
});
});
describe("assert", function() {
rIt("should not throw errors when successful",
["config", "utils"],
function(config, utils) {
config.enableAssertions = true;
utils.assert(true, "Some message");
});
rIt("should throw errors", ["config", "utils"], function(config, utils) {
config.enableAssertions = true;
try {
utils.assert(false, "The error is: %", "Unknown");
throw new Error("This should fail!");
} catch (e) {
expect(e.message).toEqual("Assertion error: The error is: Unknown");
}
});
rIt("should not throw errors when deactivated",
["config", "utils"],
function(config, utils) {
config.enableAssertions = false;
try {
utils.assert(false, "Some message");
} finally {
config.enableAssertions = true;
}
});
});
describe("assertFunction", function() {
rIt("should identify functions", ["config", "utils"],
function(config, utils) {
config.enableAssertions = true;
utils.assertFunction(describe, "This is a valid function");
});
rIt("should fail for != function", ["config", "utils"],
function(config, utils) {
config.enableAssertions = true;
try {
utils.assert(false, "I need a %", "callback");
throw new Error("This should fail!");
} catch (e) {
expect(e.message).toEqual("Assertion error: I need a callback");
}
});
});
describe("onlyAllowInUnitTest", function() {
var functionCalled = false;
var testFn = function() {
functionCalled = true;
};
rIt("should fail for mode != unit test",
["config", "utils"],
function(config, utils) {
functionCalled = false;
config.unitTestMode = false;
var wrappedFn = utils.onlyAllowInUnitTest(testFn);
try {
wrappedFn();
} catch (e) {
// the assertion error is the right one in this case
expect(e.message.indexOf("Assertion error")).not.toEqual(-1);
}
expect(functionCalled).toBe(false);
});
rIt("should work in unit test mode",
["config", "utils"],
function(config, utils) {
functionCalled = false;
config.unitTestMode = true;
var wrappedFn = utils.onlyAllowInUnitTest(testFn);
wrappedFn();
expect(functionCalled).toBe(true);
});
});
});
|
bripkens/movie-database-spa
|
test/unit/utils.spec.js
|
JavaScript
|
mit
| 3,094
|
Ansible Role: s3 vars
=========
As an alternative to using the ansible vault, this role delegates to localhost to retrieve a config file - expected to be in either YAML or JSON format - from an s3 bucket and converts the file to playbook vars.
Requirements
------------
* boto
* caller needs credentials with read access on bucket and config file being requested. Credentials are retrieved from a specified AWS profile, or we fall back to environment variables as detailed in the s3 ansible module (http://docs.ansible.com/ansible/s3_module.html).
Role Variables
--------------
* s3_vars_file_dest: where s3 file is stored locally, defaults to /tmp
* s3_vars_bucket: the s3 bucket where yaml/json file is located
* s3_vars_object: path/to/YAML/OR/JSON/file in bucket
* s3_vars_aws_profile: the AWS profile used by play caller as credentials to read from the target bucket, omitted by default
* s3_vars_config_local_file_name: destination file name of config file on local machine. Defaults to dash-delimited combination of bucket and object, where object folder references are converted to dashes.
* s3_vars_config_cleanup: whether to remove the config file after including it, defaults to true
Dependencies
------------
N/A
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: ansible-role-s3-vars, s3_vars_bucket: app-secrets, s3_vars_object: path/to/config.yml }
License
-------
MIT
|
HUIT-AcademicTechnology-Ops/ansible-role-s3-vars
|
README.md
|
Markdown
|
mit
| 1,563
|
# Time To Curl
***Time To Curl*** is a node web server that manages timers for curling matches, as well as a client interface to display and manage those timers. Using Web Sockets, we sync clients with all updates in real-time.
## Goals of this project
- Facilitate easy timekeeping for different kinds of curling matches
- Support "thinking time" and simple (unmanaged) timers
- Allow easy display of one or more time clocks
- Low latency
- Remote control
## Features (including planned features)
- Client-server timer model - allows multiple clients to view a timer
- Instantaneous updates
- Fully configurable, but still works out of the box
- Easy error correction
- Fault-tolerant - can recover even after a network outage
- Auto-scaling UI fits the given screen size
- Supports multiple concurrent timers
- Choose between basic timing (simple countdown) and WCF official timing (active timekeeper required)
- Keyboard shortcuts (configurable tbd)
## Screenshots
### Simple timers

Show a countdown to the start of the game so players are actively aware of when they need to be on the ice to begin their game. Timer automatically starts the game clock when the countdown hits 0:00.

Progress through each end is shown so curlers know when they are falling behind. The current end is calculated based on the total time, the total number of ends played, and the number of ends allowed _after_ the clock turns red.

The yellow background serves as a warning that their time is almost up. Completely configurable.

When the clock turns red, the pressure is off. Some clubs prefer no more ends to be played, some allow one additional. Completely configurable.

Configure timers.
### Standard (thinking time) timers

Classic theme is familiar to experienced timekeepers.
### Between ends UI.

Includes controls for adjusting time during breaks such as timeouts, between ends, and mid-game.
### Timer settings

Configure all the variables!
### Synchronized timers

Timers are always perfectly synchronized between browsers, even on multiple machines.
## Installing and running Time to Curl
There are plans to run this application on a public server with a domain name. Until then, you must host it yourself. To do that, follow these instructions (Windows):
1. Download and install NodeJS from https://nodejs.org. Make sure you leave all the defaults checked during installation.
2. Either [download](https://github.com/trianglecurling/timetocurl/archive/master.zip) and extract the Time to Curl zip, or clone the repository using Git.
3. Open a command prompt and navigate to the Time to Curl directory (i.e. the directory containing this README.md file).
4. Type `npm install` and press Enter.
5. Type `npm run build` and press Enter.
6. **Type `npm run start` and press Enter.
At this point the program is running. You can open a web browser and navigate to http://localhost:3001 to use it. **From now on, to run Time to Curl, you only need to do step 6 above from within the application directory in a command prompt.
## Curl with Curl...
You can update timers with basic HTTP requests (i.e. using curl). Eventually I will have all the commands documented. Here's an example for now.
**Add time to a basic timer**
`curl -XPOST -H "Content-type: application/json" -d '{"action": {"request":"QUERY_TIMER","options":{"command":"ADD_TIME","data":"{\"value\":nn}","timerId":"xxxxx"}}}' 'server-uri'`
Replace `nn` with the number of seconds to add to the timer.
Replace `xxxxx` with the timer ID (look in the URL).
Replace `server-uri` with the URI to the server.
**Example**
`curl -XPOST -H "Content-type: application/json" -d '{"action": {"request":"QUERY_TIMER","options":{"command":"ADD_TIME","data":"{\"value\":60}","timerId":"13586"}}}' 'http://localhost:3001/'`
**Start a basic timer**
`curl -XPOST -H "Content-type: application/json" -d '{"action": {"request":"QUERY_TIMER","options":{"command":"START_TIMER","timerId":"xxxxx"}}}' 'server-uri'`
**Pause a basic timer**
`curl -XPOST -H "Content-type: application/json" -d '{"action": {"request":"QUERY_TIMER","options":{"command":"PAUSE_TIMER","timerId":"xxxxx"}}}' 'server-uri'`
*Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.*
|
trianglecurling/timetocurl
|
README.md
|
Markdown
|
mit
| 4,722
|
package com.smvit.glugmvit;
/**
* Created by susmit on 16/8/17.
*/
public class DbObject {
String name;
String description;
public DbObject(){
name="testName";
description="testDesc";
}
public DbObject(String n,String s){
name=n;
description=s;
}
}
|
GlugMVIT/GLUG_MVIT_APP
|
app/src/main/java/com/smvit/glugmvit/DbObject.java
|
Java
|
mit
| 309
|
import unittest
import instruction_set
class TestInstructionSet(unittest.TestCase):
def test_generate(self):
self.assertIsInstance(instruction_set.generate(), list)
self.assertEqual(len(instruction_set.generate()), 64)
self.assertEqual(len(instruction_set.generate(32)), 32)
inset = instruction_set.generate()
for instruction in inset:
self.assertGreaterEqual(instruction, 0)
self.assertLess(instruction, 256)
def test_crossover(self):
parent1 = instruction_set.generate()
parent2 = instruction_set.generate()
children = instruction_set.crossover(parent1, parent2)
random_children = instruction_set.crossover(parent1, parent2, take_random=True)
self.assertIsInstance(children, tuple)
self.assertIsInstance(children[0], list)
self.assertIsInstance(children[1], list)
self.assertEqual(len(children[0]), len(parent1))
self.assertEqual(len(children[1]), len(parent1))
for i, _ in enumerate(parent1):
self.assertTrue(
(children[0][i] in parent1 and children[1][i] in parent2) or
(children[0][i] in parent2 and children[1][i] in parent1)
)
self.assertTrue(
(random_children[0][i] in parent1 and random_children[1][i] in parent2) or
(random_children[0][i] in parent2 and random_children[1][i] in parent1)
)
def test_mutate_bits(self):
inset = instruction_set.generate()
self.assertEqual(len(inset), len(instruction_set.mutate_bits(inset)))
self.assertEqual(inset, instruction_set.mutate_bits(inset, mutation_chance=0))
self.assertNotEqual(inset, instruction_set.mutate_bits(inset, mutation_chance=100))
for instruction in instruction_set.mutate_bits(inset):
self.assertGreaterEqual(instruction, 0)
self.assertLess(instruction, 256)
def test_mutate_bytes(self):
inset = instruction_set.generate()
self.assertEqual(len(inset), len(instruction_set.mutate_bytes(inset)))
self.assertEqual(inset, instruction_set.mutate_bytes(inset, mutation_chance=0))
self.assertNotEqual(inset, instruction_set.mutate_bytes(inset, mutation_chance=100))
for instruction in instruction_set.mutate_bytes(inset):
self.assertGreaterEqual(instruction, 0)
self.assertLess(instruction, 256)
def test_mutate_combined(self):
inset = instruction_set.generate()
self.assertEqual(len(inset), len(instruction_set.mutate_combined(inset)))
for instruction in instruction_set.mutate_combined(inset):
self.assertGreaterEqual(instruction, 0)
self.assertLess(instruction, 256)
if __name__ == '__main__':
unittest.main()
|
chuckeles/genetic-treasures
|
test_instruction_set.py
|
Python
|
mit
| 2,849
|
package nz.co.thebteam.AutomationLibrary;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.ios.IOSElement;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import java.util.HashMap;
import static org.junit.Assert.assertFalse;
public class Element {
public By locator = null;
public static WebElement webElement = null;
//when instantiating the element we DON'T fetch it. This is so we can set them up without them being visible yet.
public Element(By locator) {
this.locator = locator;
}
public Element(WebElement element) {
webElement = element;
}
//Waits x seconds for the element to exist - note does not check visibility
public void waitForElementToExist(int seconds) {
int i = 0;
while (i < seconds) {
if (exists()) {
return;
} else {
HelperMethods.sleep(1);
i++;
}
}
try {
throw new Exception("Element does not exist after " + seconds + " seconds.");
} catch (Exception e) {
e.printStackTrace();
assertFalse(false);
}
}
//Waits x seconds for the element to be displayed
public void waitForElementToBeDisplayed(int seconds) {
int i = 0;
while (i < seconds) {
if (isElementDisplayed(this.locator)) {
return;
} else {
HelperMethods.sleep(1);
i++;
}
}
try {
throw new AssertionError("Element is not displayed after " + seconds + " seconds.");
} catch (Exception e) {
e.printStackTrace();
assert (false);
}
}
//Waits x seconds for the element's attribute to be the specified value
public void waitForElementAttribute(int seconds, String attribute, String value) {
int i = 0;
while (i < seconds) {
if (isElementDisplayed(this.locator)) {
if (findElement().getAttribute(attribute).toLowerCase().equals(value.toLowerCase()))
return;
} else {
HelperMethods.sleep(1);
i++;
}
}
try {
throw new AssertionError("Element's attribute " + attribute + " was not " + value + " after " + seconds + " seconds.");
} catch (Exception e) {
e.printStackTrace();
assert (false);
}
}
//Checks for existence
public boolean exists() {
if (Automator.driver.findElements(this.locator).size() > 0) {
return true;
} else {
return false;
}
}
//Checks for visibility
public boolean isElementDisplayed(By locator) {
if (Automator.driver.findElements(locator).size() > 0) {
if (Automator.driver.findElement(locator).isDisplayed()) {
return true;
}
}
return false;
}
//retrieves the webelement if it exists, otherwise return null
public WebElement findElement() {
if (locator == null) {
return webElement;
} else {
if (Automator.driver.findElements(locator).size() > 0) {
return Automator.driver.findElement(locator);
} else {
try {
throw new Exception("Element does not exist.");
} catch (Exception e) {
e.printStackTrace();
assert (false);
}
return null;
}
}
}
//wrapper everything here.
//Using find element each time means we always get a fresh copy, it stops the nasty webelement stale reference errors.
//This is the major guts of a webdriver library, handling the element and passing commands through
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Basic commands //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void click() {
findElement().click();
}
public String getText() {
return findElement().getText();
}
public void sendKeys(String keys) {
findElement().sendKeys(keys);
}
public void sendKeys(CharSequence character) {
findElement().sendKeys(character);
}
public Boolean isDisplayed() {
try {
return findElement().isDisplayed();
} catch (Exception e) {
return false;
}
}
public Boolean isEnabled() {
try {
return findElement().isEnabled();
} catch (Exception e) {
return false;
}
}
public Boolean isSelected() {
try {
return findElement().isSelected();
} catch (Exception e) {
return false;
}
}
//used for IOS as it pastes in the value rather than tapping each key
public void setValue(String string) {
if ((Automator.driver.getClass().toString().toLowerCase().contains("iosdriver"))) {
IOSElement element = (IOSElement) findElement();
element.setValue(string);
} else {
findElement().sendKeys(string);
}
}
public void clear() {
findElement().clear();
}
public String getAttribute(String attributeName) {
return findElement().getAttribute(attributeName);
}
public Point getLocation() {
return findElement().getLocation();
}
public ElementList findSubElements(By by) {
return new ElementList(findElement().findElements(by));
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Swipes/Scrolls/Touches //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void dismissKeyboard() {
Automator.driver.navigate().back();
}
public void pressAndroidKeyCode(int keyCode) {
AndroidDriver driver = (AndroidDriver) Automator.driver;
driver.pressKeyCode(keyCode);
}
public void scrollToElement() {
Point hoverItem = findElement().getLocation();
((JavascriptExecutor) Automator.driver).executeScript("window.scrollBy(0," + (hoverItem.getY() - 200) + ");");
}
public void scrollToElement(int offset) {
Point hoverItem = findElement().getLocation();
((JavascriptExecutor) Automator.driver).executeScript("window.scrollBy(0," + (hoverItem.getY() - offset) + ");");
}
public void flickDown() {
JavascriptExecutor js = (JavascriptExecutor) Automator.driver;
HashMap<String, Double> flickObject = new HashMap<>();
flickObject.put("endX", 0.0);
flickObject.put("endY", 100.0);
flickObject.put("touchCount", 1.0);
js.executeScript("mobile: flick", flickObject);
}
public void hoverOver() {
WebElement element = findElement();
String mouseOverScript = "if(document.createEvent){var evObj = document.createEvent('MouseEvents');evObj.initEvent('mouseover',true, false); arguments[0].dispatchEvent(evObj);} else if(document.createEventObject) { arguments[0].fireEvent('onmouseover');}";
((JavascriptExecutor) Automator.driver).executeScript(mouseOverScript, element);
}
public void hoverOut() {
if (Automator.driver.getClass().toString().toLowerCase().contains("safari")) {
WebElement element = Automator.driver.findElement(By.xpath("//title"));
String mouseOverScript = "if(document.createEvent){var evObj = document.createEvent('MouseEvents');evObj.initEvent('mouseover',true, false); arguments[0].dispatchEvent(evObj);} else if(document.createEventObject) { arguments[0].fireEvent('onmouseover');}";
((JavascriptExecutor) Automator.driver).executeScript(mouseOverScript, element);
} else {
WebElement element = Automator.driver.findElement(By.xpath("//title"));
Actions actions = new Actions(Automator.driver);
Actions moveto = actions.moveToElement(element);
moveto.perform();
}
}
}
|
sphanges/automation-library
|
src/main/java/nz/co/thebteam/AutomationLibrary/Element.java
|
Java
|
mit
| 8,707
|
<div>
I'm heavy subwidget.
<!-- ko widget: "testReq" --><!-- /ko -->
</div>
|
Kasheftin/ko-widget
|
examples/src/widgets/heavy/main.html
|
HTML
|
mit
| 78
|
#ifndef PlayerEntity_h__
#define PlayerEntity_h__
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <list>
#include "Entity.hpp"
#include "../Physics/BodyController.hpp"
#include "../Helper/ScreenTranslator.hpp"
#include "../Task/Task.hpp"
class ZoneEntity;
class PlayerEntity : public sb::Entity
{
DEFINE_ENTITY(PlayerEntity,sb::Entity,'BALL')
public:
enum PlayerState
{
kPlayer_Moving,
kPlayer_Thrown,
kPlayer_Teleport
};
b2Body* getBallBody() const { return m_ballBody.getBody(); }
void kill(void);
void fall(void);
void control(void);
void bounce(void);
void shoot(const sf::Vector2f& velocity);
void resetBodyPosition()
{
m_ballBody.resetTransform();
m_ballBody.updateTransform();
}
sb::Task* getTeleportTask() const { return m_teleportTask; }
void setTeleportTask(sb::Task* val) { m_teleportTask = val; }
PlayerEntity::PlayerState getPlayerState() const { return m_playerState; }
private:
virtual void initializeEntity( const TiXmlElement *propertyElement );
virtual bool handleEvent(const sb::EventData& theevent);
virtual void update(sf::Time deltaTime);
//Updates player state
void updatePlayerState(void);
//Ball control related functions
void limitGravitationalVelocity(void);
void limitHorizontalVelocity(void);
void limitVerticalVelocity(void);
//Hooks
void processContact(const b2Contact* contact, const b2Fixture* contactFixture );
void processPreSolve(b2Contact* contact,const b2Fixture* target);
PlayerState m_playerState;
bool m_shouldBounce;
bool m_moonDead;
sb::BodyController m_ballBody;
sb::ScreenTranslator m_ballTranslator;
sf::Sprite m_ballSprite;
sf::Sound m_bounceSound;
sf::Sound m_throwSound;
sf::Sound m_sharpSound;
typedef std::list<ZoneEntity*> ZoneEntityList;
ZoneEntityList m_zoneEntityList;
sb::Task* m_teleportTask;
};
#endif // PlayerEntity_h__
|
agiantwhale/moon.chase.star
|
trunk/GameSrc/Entity/PlayerEntity.hpp
|
C++
|
mit
| 1,879
|
require "bizarre_cms/engine"
require "bizarre_cms/contentable"
module BizarreCms
mattr_accessor :custom_pages
@@custom_pages ||= []
# Setup BizarreCms. Run rails generate bizarre_cms_install.
def self.setup
yield self
end
def self.page_types
[:page] + @@custom_pages
end
end
|
corlinus/bizarre_cms
|
lib/bizarre_cms.rb
|
Ruby
|
mit
| 300
|
---
content_title: EOSIO Overview
---
EOSIO is the next-generation blockchain platform for creating and deploying smart contracts and distributed applications. EOSIO comes with a number of programs. The primary ones included in EOSIO are the following:
* [Nodeos](01_nodeos/index.md) (node + eos = nodeos) - Core service daemon that runs a node for block production, API endpoints, or local development.
* [Cleos](02_cleos/index.md) (cli + eos = cleos) - Command line interface to interact with the blockchain (via `nodeos`) and manage wallets (via `keosd`).
* [Keosd](03_keosd/index.md) (key + eos = keosd) - Component that manages EOSIO keys in wallets and provides a secure enclave for digital signing.
The basic relationship between these components is illustrated in the diagram below.

Additional EOSIO Resources:
* [EOSIO Utilities](10_utilities/index.md) - Utilities that complement the EOSIO software.
* [Upgrade Guides](20_upgrade-guides/index.md) - EOSIO version/protocol upgrade guides.
[[info | What's Next?]]
| [Install the EOSIO Software](00_install/index.md) before exploring the sections above.
|
EOSIO/eos
|
docs/index.md
|
Markdown
|
mit
| 1,160
|
<?php
/*
This file will automatically be included before EACH run.
Use it to configure atoum or anything that needs to be done before EACH run.
More information on documentation:
[en] http://docs.atoum.org/en/latest/chapter3.html#configuration-files
[fr] http://docs.atoum.org/fr/latest/lancement_des_tests.html#fichier-de-configuration
*/
use mageekguy\atoum\reports;
use mageekguy\atoum\reports\coverage;
use mageekguy\atoum\writers\std;
use \mageekguy\atoum;
$report = $script->addDefaultReport();
/*
LOGO
// This will add the atoum logo before each run.
$report->addField(new atoum\report\fields\runner\atoum\logo());
// This will add a green or red logo after each run depending on its status.
$report->addField(new atoum\report\fields\runner\result\logo());
*/
/*
CODE COVERAGE SETUP
// Please replace in next line "Project Name" by your project name and "/path/to/destination/directory" by your destination directory path for html files.
$coverageField = new atoum\report\fields\runner\coverage\html('Project Name', '/path/to/destination/directory');
// Please replace in next line http://url/of/web/site by the root url of your code coverage web site.
$coverageField->setRootUrl('http://url/of/web/site');
$report->addField($coverageField);
*/
/*
TEST EXECUTION SETUP
// Please replace in next line "/path/to/your/tests/units/classes/directory" by your unit test's directory.
$runner->addTestsFromDirectory('path/to/your/tests/units/classes/directory');
*/
/*
TEST GENERATOR SETUP
$testGenerator = new atoum\test\generator();
// Please replace in next line "/path/to/your/tests/units/classes/directory" by your unit test's directory.
$testGenerator->setTestClassesDirectory('path/to/your/tests/units/classes/directory');
// Please replace in next line "your\project\namespace\tests\units" by your unit test's namespace.
$testGenerator->setTestClassNamespace('your\project\namespace\tests\units');
// Please replace in next line "/path/to/your/classes/directory" by your classes directory.
$testGenerator->setTestedClassesDirectory('path/to/your/classes/directory');
// Please replace in next line "your\project\namespace" by your project namespace.
$testGenerator->setTestedClassNamespace('your\project\namespace');
// Please replace in next line "path/to/your/tests/units/runner.php" by path to your unit test's runner.
$testGenerator->setRunnerPath('path/to/your/tests/units/runner.php');
$script->getRunner()->setTestGenerator($testGenerator);
*/
if (!is_dir(__DIR__.'/build/tests') && !mkdir(__DIR__.'/build/tests/', 0777, true) && !is_dir(__DIR__.'/build/tests')) {
throw new \Exception("Unable to make directory ".__DIR__.'/build/tests/', 1);
}
if (!is_dir(__DIR__.'/build/coverage') && !mkdir(__DIR__.'/build/coverage/', 0777, true) && !is_dir(__DIR__.'/build/coverage')) {
throw new \Exception("Unable to make directory ".__DIR__.'/build/coverage/', 1);
}
$xunit = new atoum\reports\asynchronous\xunit();
$runner->addReport($xunit);
$writer = new atoum\writers\file(__DIR__.'/build/tests/atoum.xunit.xml');
$xunit->addWriter($writer);
$clover = new atoum\reports\asynchronous\clover();
$runner->addReport($clover);
$writerClover = new atoum\writers\file(__DIR__.'/build/tests/atoum.clover.xml');
$clover->addWriter($writerClover);
$coverage = new coverage\html();
$coverage->addWriter(new std\out());
$coverage->setOutPutDirectory(__DIR__ . '/build/coverage');
$runner->addReport($coverage);
$script->addTestsFromDirectory(__DIR__.'/tests/Units');
|
Mactronique/cua
|
.atoum.php
|
PHP
|
mit
| 3,496
|
namespace AlgorithmSandbox.Chapter5
{
public class Question4
{
public static (int smallest, int largest) NextNumber(int x)
{
var smallest = x;
var temp = x;
while (temp > 0)
{
temp = temp - 1;
if (Popcnt((uint) x) == Popcnt((uint) temp))
{
smallest = temp;
break;
}
}
var largest = x;
temp = x;
while (temp < int.MaxValue)
{
temp = temp + 1;
if (Popcnt((uint) x) == Popcnt((uint) temp))
{
largest = temp;
break;
}
}
return (smallest, largest);
}
private static int Popcnt(uint x)
{
var count = 0;
while (x != 0)
{
if ((x & 1) != 0) count++;
x = x >> 1;
}
return count;
}
public static (int smallest, int largest) NextNumberV2(int x)
{
var i = sizeof(int) * 8;
while ((x & (1 << i)) == 0)
{
i--;
}
var j = i - 1;
while ((x & (1 << j)) == 1)
{
j--;
}
var smallest = (x & ~(1 << i)) | (1 << j);
i = 0;
while ((x & (1 << i)) == 0)
{
i++;
}
j = i + 1;
while ((x & (1 << j)) == 1)
{
j++;
}
var largest = (x & ~(1 << i)) | (1 << j);
return (smallest, largest);
}
}
}
|
alexandrnikitin/algorithm-sandbox
|
csharp/src/AlgorithmSandbox/Chapter5/Question4.cs
|
C#
|
mit
| 1,783
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using CarRental.Infrastructure;
namespace CarRentalModel
{
public partial class Province
{
#region Primitive Properties
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public virtual int Id
{
get;
set;
}
public virtual string ThaiName
{
get;
set;
}
public virtual string EnglishName
{
get;
set;
}
public virtual Country Country
{
get;
set;
}
#endregion
}
}
|
Sakchai/CarRental
|
CarRental.Domain/Province.cs
|
C#
|
mit
| 1,228
|
import { RNGeth as Geth, Hooks } from './packages/geth';
export default Geth;
export const useKeyStore = Hooks.useKeyStore;
export const useEthereumClient = Hooks.useEthereumClient;
|
YsnKsy/react-native-geth
|
src/index.ts
|
TypeScript
|
mit
| 183
|
package week.of.awesome;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.XmlReader;
public class LevelLoader {
public static Level getLevel(int levelNum) {
return loadLevelFile(getLevelFile("level" + levelNum), levelNum);
}
public static Level getScreen(String screenName) {
return loadLevelFile(getLevelFile(screenName), -1);
}
public static Level loadLevelFile(FileHandle file, int levelNum) {
if (!file.exists()) { throw new RuntimeException("No such level file: " + file.name()); }
XmlReader.Element xml = null;
try {
xml = new XmlReader().parse(file);
} catch (IOException e) {
throw new RuntimeException(e);
}
String name = xml.get("name");
int numRescuedNeeded = xml.getInt("rescue");
String tileData = xml.getChildByName("map").getText();
List<List<Tile>> tileGrid = parseTileGrid(tileData);
Level level = new Level(levelNum, name, tileGrid, numRescuedNeeded);
// configure the spawn points
int spawnerIdx = 0;
Array<XmlReader.Element> startTilesSpawnConfigs = xml.getChildByName("spawnerConfigs").getChildrenByName("spawn");
for (XmlReader.Element spawnConfig : startTilesSpawnConfigs) {
Spawner spawner = level.getSpawners().get(spawnerIdx);
float timeToFirstSpawn = spawnConfig.getFloat("firstSpawnDelay", spawner.getTimeToFirstSpawn());
int spawnNum = spawnConfig.getInt("amount", spawner.getSpawnAllocation());
float spawnFreq = spawnConfig.getFloat("freq", spawner.getSpawnFreq());
spawner.configure(timeToFirstSpawn, spawnNum, spawnFreq);
++spawnerIdx;
}
// load the inventory
XmlReader.Element inventoryXml = xml.getChildByName("inventory");
if (inventoryXml != null) {
level.getInventory().addItems( Tile.Type.BLOCKER, parseInventoryItem(inventoryXml, "blockers") );
level.getInventory().addItems( Tile.Type.JUMP_SINGLE, parseInventoryItem(inventoryXml, "jumpSingle") );
level.getInventory().addItems( Tile.Type.JUMP_DOUBLE, parseInventoryItem(inventoryXml, "jumpDouble") );
level.getInventory().addItems( Tile.Type.JUMP_LEFT, parseInventoryItem(inventoryXml, "jumpLeft") );
level.getInventory().addItems( Tile.Type.JUMP_RIGHT, parseInventoryItem(inventoryXml, "jumpRight") );
}
// sanity check
if (level.getSpawnRemaining() < level.getNumRescuedNeeded()) {
throw new RuntimeException("Level is impossible to solve!");
}
return level;
}
public static boolean hasLevel(int levelNum) {
return getLevelFile("level" + levelNum).exists();
}
private static List<List<Tile>> parseTileGrid(String tileData) {
List<List<Tile>> tileGrid = new ArrayList<List<Tile>>();
List<Tile> currentRow = new ArrayList<Tile>();
// parse tokens into tiles
int tokenIdx = 0;
while (tokenIdx < tileData.length()) {
char tileToken = tileData.charAt(tokenIdx);
++tokenIdx; // consumed a token
if (tileToken == ' ' || tileToken == '\t') { continue; } // spaces/tabs are of no consequence
else if (tileToken == '\n' || tileToken == '\r') { // newlines indicate a new row
tileGrid.add(currentRow);
currentRow = new ArrayList<Tile>();
// next char is likely a newline char too e.g. \n\r
char nextToken = tileData.charAt(tokenIdx);
if (nextToken == '\n' || nextToken == '\r') {
// eat it
++tokenIdx;
}
}
else if (tileToken == '.') { // dots are empty tiles
currentRow.add(null);
}
else if (tileToken == '#') { // hashes are solid tiles
currentRow.add(new Tile(Tile.Type.GROUND));
}
else if (tileToken == 'X') { // crosses are killer tiles
currentRow.add(new Tile(Tile.Type.KILLER));
}
else if (tileToken == 'S') { // start cell
currentRow.add(new Tile(Tile.Type.START));
}
else if (tileToken == 'F') { // goal cell
currentRow.add(new Tile(Tile.Type.GOAL));
}
else if (tileToken == 'J') { // jump cell
// the next token tells us what kind of jump it is
char jumpTypeToken = tileData.charAt(tokenIdx);
++tokenIdx; // consumed a token
if (jumpTypeToken == '1') {
currentRow.add(new Tile(Tile.Type.JUMP_SINGLE));
}
else if (jumpTypeToken == '2') {
currentRow.add(new Tile(Tile.Type.JUMP_DOUBLE));
}
else if (jumpTypeToken == 'L') {
currentRow.add(new Tile(Tile.Type.JUMP_LEFT));
}
else if (jumpTypeToken == 'R') {
currentRow.add(new Tile(Tile.Type.JUMP_RIGHT));
}
else {
throw new RuntimeException("Illegal jump type token: " + jumpTypeToken);
}
}
else if (tileToken == 'K') {
currentRow.add(new Tile(Tile.Type.KEY));
}
else if (tileToken == 'L') {
currentRow.add(new Tile(Tile.Type.LOCK));
}
else {
throw new RuntimeException("Illegal tile token: " + tileToken);
}
}
// in case there isn't a trailing newline to append the final row, we do it here
if (!currentRow.isEmpty()) {
tileGrid.add(currentRow);
}
return tileGrid;
}
private static int parseInventoryItem(XmlReader.Element inventoryXml, String childElementName) {
XmlReader.Element itemXml = inventoryXml.getChildByName(childElementName);
if (itemXml == null) { return 0; }
return itemXml.getInt("available", 0);
}
private static FileHandle getLevelFile(String levelFileName) {
return Gdx.files.internal("levels/" + levelFileName + ".txt");
}
}
|
daveagill/WoA2
|
core/src/week/of/awesome/LevelLoader.java
|
Java
|
mit
| 5,485
|
<?php
namespace bootui\datetimepicker;
/**
* DateTimepicker widgets
*
*
* ~~~
* [php]
* <?php
*
*
* echo DateTimepicker::widget([
* 'name' => 'datetime',
* 'options' => ['class' => 'form-control'],
* 'addon' => ['prepend' => 'Date and Time'],
* 'format' => 'YYYY-MM-DD HH:mm',
* ]);
*
* echo $form->field($model, 'attribute')->widget(Timepicker::className(), [
* 'options' => ['class' => 'form-control'],
* 'addon' => ['prepend' => 'Date and Time'],
* 'format' => 'YYYY-MM-DD HH:mm',
* ]);
* ~~~
*
*
* @author Moh Khoirul Anam <moh.khoirul.anaam@gmail.com>
* @copyright moonlandsoft 2015
* @since 1
*
*/
class DateTimepicker extends BasePicker
{
public function init()
{
parent::init();
if (!isset($this->clientOptions['format']))
$this->clientOptions['format'] = "YYYY-MM-DD HH:mm";
}
}
|
moonlandsoft/bootui-datetimepicker
|
DateTimepicker.php
|
PHP
|
mit
| 843
|
---
layout: post
title: Failed to find provider info for Calendar, Unknown URL content://calendar/events Android
date: 2011-1-24
tags:
comments: true
permalink:
share: true
---
Failed to find provider info for Calendar,
Unknown URL content://calendar/events
Android
Hi, if you are reading this, probably you are getting an error on Android 2.0 and above OS when adding calendar event.
And probably that peace of code that was working fine for Android 1.6, not is throwing error for android 2.0 and above versions.
You should know, that, on new Android versions the URI for Calendar content provider has changed,now you should use content://com.android.calendar/
Yes it´s a crap :(
So, if you was using content://calendar/ , to get successful, you should use content://com.android.calendar/
If you want to maintain a compatibility across all Android versions of your apps,
you will need to handle the Old URI along with the New URI, you can do something like this:
Uri calendarUri;
Uri eventUri;
if (android.os.Build.VERSION.SDK_INT
|
yeradis/yeradis.github.io
|
_posts/2011-01-24-failed-to-find-provider-info-for.md
|
Markdown
|
mit
| 1,067
|
# Code Intelligence Operations log
* This is a running log of operations and infrastructure management
related to Kubeflow code intelligence.
* Enteries should be time stamped and in reverse chronological order (more recent at the top)
## 2020-05-15 - Create an ASM cluster for the Kubeflow chatbot.
* A cluster with ISTIO 1.4 is needed in order to work with Dialogflow.
* jlewi@ tried an ISTIO 1.1. cluster but was hitting problems with JWT validation.
* The configs for the new cluster are in ./kubeflow_clusters/code-intelligence
|
kubeflow/code-intelligence
|
ops-log.md
|
Markdown
|
mit
| 547
|
using System.Speech.Synthesis;
namespace PolyglotMy
{
public class Voice
{
public string Name { get; set; }
public InstalledVoice InstalledVoice { get; set; }
}
}
|
Vedin/Polyglot
|
PolyglotMy/Classes/Voice.cs
|
C#
|
mit
| 195
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x804 上介绍了“空白页”项模板
namespace KinubachekallHinuquba
{
/// <summary>
/// 可用于自身或导航至 Frame 内部的空白页。
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
}
}
|
lindexi/lindexi_gd
|
KinubachekallHinuquba/KinubachekallHinuquba/MainPage.xaml.cs
|
C#
|
mit
| 806
|
<?php
/**
* This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/
namespace Propel\Runtime\ActiveQuery\Criterion;
use Propel\Runtime\ActiveQuery\Criteria;
/**
* Specialized Criterion used for custom expressions with no binding, e.g. 'NOW() = 1'
*/
class CustomCriterion extends AbstractCriterion
{
/**
* Create a new instance.
*
* @param Criteria $outer The outer class (this is an "inner" class).
* @param string $value The condition to be added to the query string
*/
public function __construct(Criteria $outer, $value)
{
$this->value = $value;
$this->init($outer);
}
/**
* Appends a Prepared Statement representation of the Criterion onto the buffer
*
* @param string &$sb The string that will receive the Prepared Statement
* @param array $params A list to which Prepared Statement parameters will be appended
*/
protected function appendPsForUniqueClauseTo(&$sb, array &$params)
{
if ('' !== $this->value) {
$sb .= (string) $this->value;
}
}
}
|
propelorm/Propel3
|
src/Runtime/ActiveQuery/Criterion/CustomCriterion.php
|
PHP
|
mit
| 1,235
|
#include <iostream>
#include <fstream>
using namespace std;
int main(){
ifstream f("problema_vectori_pr1.in");
ofstream g("problema_vectori_pr1.out");
int n;
f >> n;
int arr[n];
for(int i=0;i<n;i++){
f >> arr[i];
}
int x=3,max=0,premii=0;
while(x){
max=0;
for(int i=0;i<n;i++){
if(arr[i]>max)
max=arr[i];
}
for(int i=0;i<n;i++){
if(arr[i]==max){
premii++;
arr[i]=-11;
}
}
x--;
}
g << premii;
}
|
rlodina99/Learn_cpp
|
Probleme - d-na Kalmar/problema_vectori_pr1.cpp
|
C++
|
mit
| 444
|
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Homework 2</title>
<link href="js-console.css" rel="stylesheet" />
</head>
<body>
<div id="js-console"></div>
<label for="input">Input number</label>
<input type="text" id="input"/>
<button id="check">Calculate</button>
<script src="js-console.js"></script>
<script src="script4.js"></script>
</body>
</html>
|
MarinMarinov/JavaScript-Fundamentals
|
2.Operators and Expressions/Problem 4. Third digit/task4.html
|
HTML
|
mit
| 410
|
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("HW4")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HW4")]
[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("b7673b27-1869-4090-98bf-e1a3b30e0010")]
// 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")]
|
elendil326/UWAppliedAlgorithms
|
HW4/HW4/Properties/AssemblyInfo.cs
|
C#
|
mit
| 1,382
|
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTagsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tags', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->index();
$table->integer('user_id')->unsigned()->index();
$table->text('description')->nullable();
$table->unique(['name', 'user_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tags');
}
}
|
iTBH/kompetenzcheck
|
database/migrations/2017_04_05_124204_create_tags_table.php
|
PHP
|
mit
| 757
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using AwareGroup.IoTDroneDisplay.DroneControls.Model;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
namespace AwareGroup.IoTDroneDisplay.DroneControls.Controls
{
public sealed partial class DroneOverlayControl : UserControl
{
public event EventHandler PowerButtonClicked;
public DroneOverlayControl()
{
InitializeComponent();
InitializeDefaults();
DroneTitlePanel.ButtonClicked += DroneTitlePanelOnPowerButtonClicked;
}
private void DroneTitlePanelOnPowerButtonClicked(object sender, EventArgs eventArgs)
{
//Raise Event to the Parent Host.
if (PowerButtonClicked != null)
PowerButtonClicked.Invoke(this, null);
}
public void InitializeDefaults()
{
try
{
Roll = 0.0;
Heading = 0.0;
X = 0.0;
Y = 0.0;
Title = "PROJECT ARYA";
Status = "";
Objective = "Find the Red Ball";
BatteryLevel = 50.0;
ShowGimbal = true;
}
catch
{
}
}
public static readonly DependencyProperty RollProperty = DependencyProperty.Register(
"Roll", typeof(double), typeof(DroneOverlayControl), new PropertyMetadata(0, RollPropertyChangedCallback));
public double Roll
{
get { return (double)GetValue(RollProperty); }
set { SetValue(RollProperty, value); }
}
private static void RollPropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl)dependencyObject;
double val = (double)dependencyPropertyChangedEventArgs.NewValue;
ctl.DroneGimbalControl.Roll = val;
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
public static readonly DependencyProperty HeadingProperty = DependencyProperty.Register(
"Heading", typeof(double), typeof(DroneOverlayControl), new PropertyMetadata(0, HeadingPropertyChangedCallback));
public double Heading
{
get { return (double)GetValue(HeadingProperty); }
set { SetValue(HeadingProperty, value); }
}
private static void HeadingPropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl)dependencyObject;
double val = (double)dependencyPropertyChangedEventArgs.NewValue;
ctl.DroneRoomMap.Heading = val;
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
public static readonly DependencyProperty AltitudeProperty = DependencyProperty.Register(
"Altitude", typeof(double), typeof(DroneOverlayControl), new PropertyMetadata(0, AltitudePropertyChangedCallback));
public double Altitude
{
get { return (double)GetValue(AltitudeProperty); }
set { SetValue(AltitudeProperty, value); }
}
private static void AltitudePropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl)dependencyObject;
double val = (double)dependencyPropertyChangedEventArgs.NewValue;
//ctl.XX = val;
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
public static readonly DependencyProperty PitchProperty = DependencyProperty.Register(
"Pitch", typeof(double), typeof(DroneOverlayControl), new PropertyMetadata(0, PitchPropertyChangedCallback));
public double Pitch
{
get { return (double)GetValue(PitchProperty); }
set { SetValue(PitchProperty, value); }
}
private static void PitchPropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl)dependencyObject;
double val = (double)dependencyPropertyChangedEventArgs.NewValue;
//ctl.XX = val;
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
public static readonly DependencyProperty XProperty = DependencyProperty.Register(
"X", typeof(double), typeof(DroneOverlayControl), new PropertyMetadata(0, FeetXPropertyChangedCallback));
public double X
{
get { return (double)GetValue(XProperty); }
set { SetValue(XProperty, value); }
}
private static void FeetXPropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl)dependencyObject;
double val = (double)dependencyPropertyChangedEventArgs.NewValue;
ctl.DroneRoomMap.X = val;
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
public static readonly DependencyProperty YProperty = DependencyProperty.Register(
"Y", typeof(double), typeof(DroneOverlayControl), new PropertyMetadata(0, FeetYPropertyChangedCallback));
public double Y
{
get { return (double)GetValue(YProperty); }
set { SetValue(YProperty, value); }
}
private static void FeetYPropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl)dependencyObject;
double val = (double)dependencyPropertyChangedEventArgs.NewValue;
ctl.DroneRoomMap.Y = val;
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(
"Title", typeof(string), typeof(DroneOverlayControl), new PropertyMetadata("DRONE TITLE", TitlePropertyChangedCallback));
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
private static void TitlePropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl)dependencyObject;
string val = (string)dependencyPropertyChangedEventArgs.NewValue;
ctl.DroneTitlePanel.Title = val ?? "";
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
public static readonly DependencyProperty ObjectiveProperty = DependencyProperty.Register(
"Objective", typeof(string), typeof(DroneOverlayControl), new PropertyMetadata("Mission Objective", ObjectivePropertyChangedCallback));
public string Objective
{
get { return (string)GetValue(ObjectiveProperty); }
set { SetValue(ObjectiveProperty, value); }
}
private static void ObjectivePropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl)dependencyObject;
string val = (string)dependencyPropertyChangedEventArgs.NewValue;
ctl.DroneMissionObjective.Text = val ?? "";
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
public static readonly DependencyProperty StatusProperty = DependencyProperty.Register(
"Status", typeof(string), typeof(DroneOverlayControl), new PropertyMetadata("", StatusPropertyChangedCallback));
public string Status
{
get { return (string)GetValue(StatusProperty); }
set { SetValue(StatusProperty, value); }
}
private static void StatusPropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl)dependencyObject;
string val = (string)dependencyPropertyChangedEventArgs.NewValue;
ctl.DroneMissionStatus.Text = val ?? "";
ctl.DroneMissionStatus.Visibility = ((val ?? "") == "") ? Visibility.Collapsed : Visibility.Visible;
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
public static readonly DependencyProperty BatteryLevelProperty = DependencyProperty.Register(
"BatteryLevel", typeof(double), typeof(DroneOverlayControl), new PropertyMetadata(50, BatteryLevelPropertyChangedCallback));
public double BatteryLevel
{
get { return (double)GetValue(BatteryLevelProperty); }
set { SetValue(BatteryLevelProperty, value); }
}
private static void BatteryLevelPropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl)dependencyObject;
double val = (double)dependencyPropertyChangedEventArgs.NewValue;
ctl.DroneTitlePanel.BatteryLevel = val;
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
public static readonly DependencyProperty ShowGimbalProperty = DependencyProperty.Register(
"ShowGimbal", typeof(bool), typeof(DroneOverlayControl), new PropertyMetadata(true, ShowGimbalPropertyChangedCallback));
public bool ShowGimbal
{
get { return (bool) GetValue(ShowGimbalProperty); }
set { SetValue(ShowGimbalProperty, value); }
}
private static void ShowGimbalPropertyChangedCallback(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
try
{
var ctl = (DroneOverlayControl) dependencyObject;
bool val = (bool) dependencyPropertyChangedEventArgs.NewValue;
ctl.DroneGimbalControl.Visibility = val ? Visibility.Visible : Visibility.Collapsed;
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
}
}
|
ooeygui/UwpDrone
|
UwpDrone/AwareGroup.IoTDroneDisplay.DroneControls/Controls/DroneOverlayControl.xaml.cs
|
C#
|
mit
| 12,085
|
using dbqf.Configuration;
using dbqf.Criterion;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace dbqf.Processing
{
public class PlaceholderParser
{
/// <summary>
/// Parse text containing placeholders for fields delimited by bracket.
/// The first stop delimits the subject.field, subsequent stops traverse relationships.
/// For example:
/// [Products.Name] is the "Products" subject, field "Name"
/// [Products.ProductCategoryID.Name] is the "Products" subject, field "ProductCategoryID" which is a RelationField to subject "Product Category" with a field "Name".
/// </summary>
/// <param name="subject"></param>
/// <param name="texts"></param>
/// <returns></returns>
public virtual Dictionary<string, IFieldPath> Parse(IConfiguration config, params string[] texts)
{
var fields = new Dictionary<string, IFieldPath>();
foreach (var t in texts)
{
var matches = Regex.Matches(t, @"\[((?<subject>[^\]\.]+)(\.([^\]\.]+))+)\]");
foreach (Match m in matches)
{
// represent the entire path as the key to the dictionary
if (!fields.ContainsKey(m.Groups[1].Value))
{
// now create the FieldPath based on the Regex
var path = new FieldPath();
var subject = config[m.Groups["subject"].Value];
if (subject != null)
{
foreach (Capture capture in m.Groups[3].Captures)
{
var field = subject[capture.Value];
if (field == null)
{
path.Clear();
break;
}
path.Add(field);
if (field is IRelationField)
subject = ((IRelationField)field).RelatedSubject;
}
if (path.Count > 0)
fields.Add(m.Groups[0].Value, path);
}
}
}
}
return fields;
}
/// <summary>
/// Given a resulting dictionary of placeholders and associated values, replace the placeholders in each of the texts with the associated value.
/// </summary>
/// <param name="paths"></param>
/// <param name="texts"></param>
/// <returns></returns>
public virtual string[] Replace(Dictionary<string, string> values, params string[] texts)
{
string[] result = new string[texts.Length];
for (int i = 0; i < texts.Length; i++)
{
result[i] = Regex.Replace(texts[i], @"\[[^\]]+\]", e =>
{
if (values.ContainsKey(e.Value))
return values[e.Value];
return null;
});
}
return result;
}
}
}
|
stuarta0/dbqf
|
lib/dbqf.core/Processing/PlaceholderParser.cs
|
C#
|
mit
| 3,369
|
---
layout: post
date: 2016-03-27
title: "Luna novias 8S116 LARISSA 2015"
category: Luna novias
tags: [Luna novias,2015]
---
### Luna novias 8S116 LARISSA
Just **$379.99**
### 2015
<table><tr><td>BRANDS</td><td>Luna novias</td></tr><tr><td>Years</td><td>2015</td></tr></table>
<a href="https://www.readybrides.com/en/luna-novias/46122-luna-novias-8s116-larissa.html"><img src="//img.readybrides.com/101471/luna-novias-8s116-larissa.jpg" alt="Luna novias 8S116 LARISSA" style="width:100%;" /></a>
<!-- break --><a href="https://www.readybrides.com/en/luna-novias/46122-luna-novias-8s116-larissa.html"><img src="//img.readybrides.com/101470/luna-novias-8s116-larissa.jpg" alt="Luna novias 8S116 LARISSA" style="width:100%;" /></a>
Buy it: [https://www.readybrides.com/en/luna-novias/46122-luna-novias-8s116-larissa.html](https://www.readybrides.com/en/luna-novias/46122-luna-novias-8s116-larissa.html)
|
nicedaymore/nicedaymore.github.io
|
_posts/2016-03-27-Luna-novias-8S116-LARISSA-2015.md
|
Markdown
|
mit
| 906
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _linglog = require('linglog');
var _linglog2 = _interopRequireDefault(_linglog);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (0, _linglog2.default)('gulp-insert-md', {
timeFormat: 'HH:mm:ss'
});
module.exports = exports['default'];
|
LingyuCoder/gulp-insert-md
|
lib/logger.js
|
JavaScript
|
mit
| 391
|
package org.disges.thrift.plugin.testdata.pojo.package1;
public class TestMapStructPojo implements java.io.Serializable {
public enum Fields{
RefMap, RefValueMap, RefKeyMap, SimpleMap, RefOtherPackage
};
private java.util.Map<org.disges.thrift.plugin.testdata.pojo.package1.MapKeyPojo, org.disges.thrift.plugin.testdata.pojo.package1.MapValuePojo> refMap;
private java.util.Map<java.lang.Integer, org.disges.thrift.plugin.testdata.pojo.package1.MapValuePojo> refValueMap;
private java.util.Map<org.disges.thrift.plugin.testdata.pojo.package1.MapKeyPojo, java.lang.Integer> refKeyMap;
private java.util.Map<java.lang.String, java.lang.Integer> simpleMap;
private java.util.Map<org.disges.thrift.plugin.testdata.pojo.package2.SimpleStructPackage2Pojo, java.lang.Integer> refOtherPackage;
public TestMapStructPojo() {
super();
}
public TestMapStructPojo(java.util.Map<org.disges.thrift.plugin.testdata.pojo.package1.MapKeyPojo, org.disges.thrift.plugin.testdata.pojo.package1.MapValuePojo> refMap,java.util.Map<java.lang.Integer, org.disges.thrift.plugin.testdata.pojo.package1.MapValuePojo> refValueMap,java.util.Map<org.disges.thrift.plugin.testdata.pojo.package1.MapKeyPojo, java.lang.Integer> refKeyMap,java.util.Map<java.lang.String, java.lang.Integer> simpleMap,java.util.Map<org.disges.thrift.plugin.testdata.pojo.package2.SimpleStructPackage2Pojo, java.lang.Integer> refOtherPackage) {
super();
this.refMap = refMap;
this.refValueMap = refValueMap;
this.refKeyMap = refKeyMap;
this.simpleMap = simpleMap;
this.refOtherPackage = refOtherPackage;
}
// Getters and Setters
public java.util.Map<org.disges.thrift.plugin.testdata.pojo.package1.MapKeyPojo, org.disges.thrift.plugin.testdata.pojo.package1.MapValuePojo> getRefMap() {
return refMap;
}
public void setRefMap(java.util.Map<org.disges.thrift.plugin.testdata.pojo.package1.MapKeyPojo, org.disges.thrift.plugin.testdata.pojo.package1.MapValuePojo> refMap) {
this.refMap = refMap;
}
public java.util.Map<java.lang.Integer, org.disges.thrift.plugin.testdata.pojo.package1.MapValuePojo> getRefValueMap() {
return refValueMap;
}
public void setRefValueMap(java.util.Map<java.lang.Integer, org.disges.thrift.plugin.testdata.pojo.package1.MapValuePojo> refValueMap) {
this.refValueMap = refValueMap;
}
public java.util.Map<org.disges.thrift.plugin.testdata.pojo.package1.MapKeyPojo, java.lang.Integer> getRefKeyMap() {
return refKeyMap;
}
public void setRefKeyMap(java.util.Map<org.disges.thrift.plugin.testdata.pojo.package1.MapKeyPojo, java.lang.Integer> refKeyMap) {
this.refKeyMap = refKeyMap;
}
public java.util.Map<java.lang.String, java.lang.Integer> getSimpleMap() {
return simpleMap;
}
public void setSimpleMap(java.util.Map<java.lang.String, java.lang.Integer> simpleMap) {
this.simpleMap = simpleMap;
}
public java.util.Map<org.disges.thrift.plugin.testdata.pojo.package2.SimpleStructPackage2Pojo, java.lang.Integer> getRefOtherPackage() {
return refOtherPackage;
}
public void setRefOtherPackage(java.util.Map<org.disges.thrift.plugin.testdata.pojo.package2.SimpleStructPackage2Pojo, java.lang.Integer> refOtherPackage) {
this.refOtherPackage = refOtherPackage;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TestMapStructPojo that = (TestMapStructPojo) o;
if (refMap != null ? !refMap.equals(that.refMap) : that.refMap != null) return false;
if (refValueMap != null ? !refValueMap.equals(that.refValueMap) : that.refValueMap != null) return false;
if (refKeyMap != null ? !refKeyMap.equals(that.refKeyMap) : that.refKeyMap != null) return false;
if (simpleMap != null ? !simpleMap.equals(that.simpleMap) : that.simpleMap != null) return false;
if (refOtherPackage != null ? !refOtherPackage.equals(that.refOtherPackage) : that.refOtherPackage != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (refMap != null ? (refMap.hashCode() * 31) : 0);
result = 31 * result + (refValueMap != null ? refValueMap.hashCode() : 0);
result = 31 * result + (refKeyMap != null ? refKeyMap.hashCode() : 0);
result = 31 * result + (simpleMap != null ? simpleMap.hashCode() : 0);
result = 31 * result + (refOtherPackage != null ? refOtherPackage.hashCode() : 0);
return result;
}
}
|
sergypv/thrift-pojo-generator-maven-plugin
|
src/test/java/org/disges/thrift/plugin/testdata/pojo/package1/TestMapStructPojo.java
|
Java
|
mit
| 4,533
|
import {createCustomOsc} from './oscillator'
export function createChorus(ctx: Object) {
const merger = ctx.createChannelMerger(2)
const input = ctx.createGain()
const output = ctx.createGain()
const feedbackL = ctx.createGain()
const feedbackR = ctx.createGain()
const delayL = ctx.createDelay()
const delayR = ctx.createDelay()
const lfoLGain = ctx.createGain()
const lfoRGain = ctx.createGain()
const lfoL = createCustomOsc(ctx)
const lfoR = createCustomOsc(ctx)
input.connect(output)
input.connect(delayL)
input.connect(delayR)
lfoL.connect(lfoLGain)
lfoL.start(0)
lfoR.connect(lfoRGain)
lfoR.start(0)
lfoRGain.connect(delayR.delayTime)
lfoLGain.connect(delayL.delayTime)
lfoLGain.connect(lfoR.frequency)
delayL.connect(feedbackL)
delayR.connect(feedbackR)
feedbackL.connect(delayL)
feedbackR.connect(delayR)
feedbackL.connect(merger, 0, 0)
feedbackR.connect(merger, 0, 1)
merger.connect(output)
const setters = {
frequency(value) {
lfoL.frequency.value = value
lfoR.frequency.value = value
},
feedback(value) {
feedbackL.gain.value = value
feedbackR.gain.value = value
}
}
return {
__setters: setters,
input,
connect(node) { output.connect(node) },
init(patch) {
lfoL.init({
frequency: patch.frequency,
type: patch.type,
phase: 180
})
lfoR.init({
frequency: patch.frequency,
type: patch.type,
phase: 0
})
// TODO: Add public access to chorus depth here
input.gain.value = 0.6934
lfoLGain.gain.value = 0.002
lfoRGain.gain.value = 0.002
feedbackL.gain.value = patch.feedback
feedbackR.gain.value = patch.feedback
},
set(key, val) {
setters[key](val)
}
}
}
|
ziagrosvenor/sound-machine
|
src/synth/chorus.js
|
JavaScript
|
mit
| 1,820
|
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var Class = require('../utils/Class');
var CONST = require('./const');
var GetValue = require('../utils/object/GetValue');
var NOOP = require('../utils/NOOP');
var Scene = require('./Scene');
var Systems = require('./Systems');
/**
* @classdesc
* The Scene Manager.
*
* The Scene Manager is a Game level system, responsible for creating, processing and updating all of the
* Scenes in a Game instance.
*
*
* @class SceneManager
* @memberOf Phaser.Scenes
* @constructor
* @since 3.0.0
*
* @param {Phaser.Game} game - The Phaser.Game instance this Scene Manager belongs to.
* @param {object} sceneConfig - Scene specific configuration settings.
*/
var SceneManager = new Class({
initialize:
function SceneManager (game, sceneConfig)
{
/**
* The Game that this SceneManager belongs to.
*
* @name Phaser.Scenes.SceneManager#game
* @type {Phaser.Game}
* @since 3.0.0
*/
this.game = game;
/**
* An object that maps the keys to the scene so we can quickly get a scene from a key without iteration.
*
* @name Phaser.Scenes.SceneManager#keys
* @type {object}
* @since 3.0.0
*/
this.keys = {};
/**
* The array in which all of the scenes are kept.
*
* @name Phaser.Scenes.SceneManager#scenes
* @type {array}
* @since 3.0.0
*/
this.scenes = [];
/**
* Scenes pending to be added are stored in here until the manager has time to add it.
*
* @name Phaser.Scenes.SceneManager#_pending
* @type {array}
* @private
* @since 3.0.0
*/
this._pending = [];
/**
* An array of scenes waiting to be started once the game has booted.
*
* @name Phaser.Scenes.SceneManager#_start
* @type {array}
* @private
* @since 3.0.0
*/
this._start = [];
/**
* An operations queue, because we don't manipulate the scenes array during processing.
*
* @name Phaser.Scenes.SceneManager#_queue
* @type {array}
* @private
* @since 3.0.0
*/
this._queue = [];
/**
* Boot time data to merge.
*
* @name Phaser.Scenes.SceneManager#_data
* @type {object}
* @private
* @since 3.4.0
*/
this._data = {};
/**
* Is the Scene Manager actively processing the Scenes list?
*
* @name Phaser.Scenes.SceneManager#isProcessing
* @type {boolean}
* @default false
* @readOnly
* @since 3.0.0
*/
this.isProcessing = false;
/**
* Has the Scene Manager properly started?
*
* @name Phaser.Scenes.SceneManager#isBooted
* @type {boolean}
* @default false
* @readOnly
* @since 3.4.0
*/
this.isBooted = false;
/**
* Do any of the Cameras in any of the Scenes require a custom viewport?
* If not we can skip scissor tests.
*
* @name Phaser.Scenes.SceneManager#customViewports
* @type {number}
* @default 0
* @since 3.12.0
*/
this.customViewports = 0;
if (sceneConfig)
{
if (!Array.isArray(sceneConfig))
{
sceneConfig = [ sceneConfig ];
}
for (var i = 0; i < sceneConfig.length; i++)
{
// The i === 0 part just autostarts the first Scene given (unless it says otherwise in its config)
this._pending.push({
key: 'default',
scene: sceneConfig[i],
autoStart: (i === 0),
data: {}
});
}
}
game.events.once('ready', this.bootQueue, this);
},
/**
* Internal first-time Scene boot handler.
*
* @method Phaser.Scenes.SceneManager#bootQueue
* @private
* @since 3.2.0
*/
bootQueue: function ()
{
if (this.isBooted)
{
return;
}
var i;
var entry;
var key;
var sceneConfig;
for (i = 0; i < this._pending.length; i++)
{
entry = this._pending[i];
key = entry.key;
sceneConfig = entry.scene;
var newScene;
if (sceneConfig instanceof Scene)
{
newScene = this.createSceneFromInstance(key, sceneConfig);
}
else if (typeof sceneConfig === 'object')
{
newScene = this.createSceneFromObject(key, sceneConfig);
}
else if (typeof sceneConfig === 'function')
{
newScene = this.createSceneFromFunction(key, sceneConfig);
}
// Replace key in case the scene changed it
key = newScene.sys.settings.key;
this.keys[key] = newScene;
this.scenes.push(newScene);
// Any data to inject?
if (this._data[key])
{
newScene.sys.settings.data = this._data[key].data;
if (this._data[key].autoStart)
{
entry.autoStart = true;
}
}
if (entry.autoStart || newScene.sys.settings.active)
{
this._start.push(key);
}
}
// Clear the pending lists
this._pending.length = 0;
this._data = {};
this.isBooted = true;
// _start might have been populated by the above
for (i = 0; i < this._start.length; i++)
{
entry = this._start[i];
this.start(entry);
}
this._start.length = 0;
},
/**
* Process the Scene operations queue.
*
* @method Phaser.Scenes.SceneManager#processQueue
* @since 3.0.0
*/
processQueue: function ()
{
var pendingLength = this._pending.length;
var queueLength = this._queue.length;
if (pendingLength === 0 && queueLength === 0)
{
return;
}
var i;
var entry;
if (pendingLength)
{
for (i = 0; i < pendingLength; i++)
{
entry = this._pending[i];
this.add(entry.key, entry.scene, entry.autoStart, entry.data);
}
// _start might have been populated by this.add
for (i = 0; i < this._start.length; i++)
{
entry = this._start[i];
this.start(entry);
}
// Clear the pending lists
this._start.length = 0;
this._pending.length = 0;
return;
}
for (i = 0; i < this._queue.length; i++)
{
entry = this._queue[i];
this[entry.op](entry.keyA, entry.keyB);
}
this._queue.length = 0;
},
/**
* Adds a new Scene into the SceneManager.
* You must give each Scene a unique key by which you'll identify it.
*
* The `sceneConfig` can be:
*
* * A `Phaser.Scene` object, or an object that extends it.
* * A plain JavaScript object
* * A JavaScript ES6 Class that extends `Phaser.Scene`
* * A JavaScript ES5 prototype based Class
* * A JavaScript function
*
* If a function is given then a new Scene will be created by calling it.
*
* @method Phaser.Scenes.SceneManager#add
* @since 3.0.0
*
* @param {string} key - A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`.
* @param {(Phaser.Scene|Phaser.Scenes.Settings.Config|function)} sceneConfig - The config for the Scene
* @param {boolean} [autoStart=false] - If `true` the Scene will be started immediately after being added.
* @param {object} [data] - Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`.
*
* @return {?Phaser.Scene} The added Scene, if it was added immediately, otherwise `null`.
*/
add: function (key, sceneConfig, autoStart, data)
{
if (autoStart === undefined) { autoStart = false; }
if (data === undefined) { data = {}; }
// If processing or not booted then put scene into a holding pattern
if (this.isProcessing || !this.isBooted)
{
this._pending.push({
key: key,
scene: sceneConfig,
autoStart: autoStart,
data: data
});
if (!this.isBooted)
{
this._data[key] = { data: data };
}
return null;
}
key = this.getKey(key, sceneConfig);
var newScene;
if (sceneConfig instanceof Scene)
{
newScene = this.createSceneFromInstance(key, sceneConfig);
}
else if (typeof sceneConfig === 'object')
{
sceneConfig.key = key;
newScene = this.createSceneFromObject(key, sceneConfig);
}
else if (typeof sceneConfig === 'function')
{
newScene = this.createSceneFromFunction(key, sceneConfig);
}
// Any data to inject?
newScene.sys.settings.data = data;
// Replace key in case the scene changed it
key = newScene.sys.settings.key;
this.keys[key] = newScene;
this.scenes.push(newScene);
if (autoStart || newScene.sys.settings.active)
{
if (this._pending.length)
{
this._start.push(key);
}
else
{
this.start(key);
}
}
return newScene;
},
/**
* Removes a Scene from the SceneManager.
*
* The Scene is removed from the local scenes array, it's key is cleared from the keys
* cache and Scene.Systems.destroy is then called on it.
*
* If the SceneManager is processing the Scenes when this method is called it will
* queue the operation for the next update sequence.
*
* @method Phaser.Scenes.SceneManager#remove
* @since 3.2.0
*
* @param {(string|Phaser.Scene)} scene - The Scene to be removed.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
remove: function (key)
{
if (this.isProcessing)
{
this._queue.push({ op: 'remove', keyA: key, keyB: null });
}
else
{
var sceneToRemove = this.getScene(key);
if (!sceneToRemove || sceneToRemove.sys.isTransitioning())
{
return this;
}
var index = this.scenes.indexOf(sceneToRemove);
var sceneKey = sceneToRemove.sys.settings.key;
if (index > -1)
{
delete this.keys[sceneKey];
this.scenes.splice(index, 1);
if (this._start.indexOf(sceneKey) > -1)
{
index = this._start.indexOf(sceneKey);
this._start.splice(index, 1);
}
sceneToRemove.sys.destroy();
}
}
return this;
},
/**
* Boot the given Scene.
*
* @method Phaser.Scenes.SceneManager#bootScene
* @private
* @since 3.0.0
*
* @param {Phaser.Scene} scene - The Scene to boot.
*/
bootScene: function (scene)
{
var sys = scene.sys;
var settings = sys.settings;
if (scene.init)
{
scene.init.call(scene, settings.data);
settings.status = CONST.INIT;
if (settings.isTransition)
{
sys.events.emit('transitioninit', settings.transitionFrom, settings.transitionDuration);
}
}
var loader;
if (sys.load)
{
loader = sys.load;
loader.reset();
}
if (loader && scene.preload)
{
scene.preload.call(scene);
// Is the loader empty?
if (loader.list.size === 0)
{
this.create(scene);
}
else
{
settings.status = CONST.LOADING;
// Start the loader going as we have something in the queue
loader.once('complete', this.loadComplete, this);
loader.start();
}
}
else
{
// No preload? Then there was nothing to load either
this.create(scene);
}
},
/**
* Handles load completion for a Scene's Loader.
*
* Starts the Scene that the Loader belongs to.
*
* @method Phaser.Scenes.SceneManager#loadComplete
* @private
* @since 3.0.0
*
* @param {Phaser.Loader.LoaderPlugin} loader - The loader that has completed loading.
*/
loadComplete: function (loader)
{
var scene = loader.scene;
// Try to unlock HTML5 sounds every time any loader completes
if (this.game.sound.onBlurPausedSounds)
{
this.game.sound.unlock();
}
this.create(scene);
},
/**
* Handle payload completion for a Scene.
*
* @method Phaser.Scenes.SceneManager#payloadComplete
* @private
* @since 3.0.0
*
* @param {Phaser.Loader.LoaderPlugin} loader - The loader that has completed loading its Scene's payload.
*/
payloadComplete: function (loader)
{
this.bootScene(loader.scene);
},
/**
* Updates the Scenes.
*
* @method Phaser.Scenes.SceneManager#update
* @since 3.0.0
*
* @param {number} time - Time elapsed.
* @param {number} delta - Delta time from the last update.
*/
update: function (time, delta)
{
this.processQueue();
this.isProcessing = true;
// Loop through the active scenes in reverse order
for (var i = this.scenes.length - 1; i >= 0; i--)
{
var sys = this.scenes[i].sys;
if (sys.settings.status > CONST.START && sys.settings.status <= CONST.RUNNING)
{
sys.step(time, delta);
}
}
},
/**
* Informs the Scenes of the Game being resized.
*
* @method Phaser.Scenes.SceneManager#resize
* @since 3.2.0
*
* @param {number} width - The new width of the game.
* @param {number} height - The new height of the game.
*/
resize: function (width, height)
{
// Loop through the scenes in forward order
for (var i = 0; i < this.scenes.length; i++)
{
var sys = this.scenes[i].sys;
sys.resize(width, height);
}
},
/**
* Renders the Scenes.
*
* @method Phaser.Scenes.SceneManager#render
* @since 3.0.0
*
* @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer to use.
*/
render: function (renderer)
{
// Loop through the scenes in forward order
for (var i = 0; i < this.scenes.length; i++)
{
var sys = this.scenes[i].sys;
if (sys.settings.visible && sys.settings.status >= CONST.LOADING && sys.settings.status < CONST.SLEEPING)
{
sys.render(renderer);
}
}
this.isProcessing = false;
},
/**
* Calls the given Scene's {@link Phaser.Scene#create} method and updates its status.
*
* @method Phaser.Scenes.SceneManager#create
* @private
* @since 3.0.0
*
* @param {Phaser.Scene} scene - The Scene to create.
*/
create: function (scene)
{
var sys = scene.sys;
var settings = sys.settings;
if (scene.create)
{
settings.status = CONST.CREATING;
scene.create.call(scene, settings.data);
if (settings.isTransition)
{
sys.events.emit('transitionstart', settings.transitionFrom, settings.transitionDuration);
}
}
// If the Scene has an update function we'll set it now, otherwise it'll remain as NOOP
if (scene.update)
{
sys.sceneUpdate = scene.update;
}
settings.status = CONST.RUNNING;
},
/**
* Creates and initializes a Scene from a function.
*
* @method Phaser.Scenes.SceneManager#createSceneFromFunction
* @private
* @since 3.0.0
*
* @param {string} key - The key of the Scene.
* @param {function} scene - The function to create the Scene from.
*
* @return {Phaser.Scene} The created Scene.
*/
createSceneFromFunction: function (key, scene)
{
var newScene = new scene();
if (newScene instanceof Scene)
{
var configKey = newScene.sys.settings.key;
if (configKey !== '')
{
key = configKey;
}
if (this.keys.hasOwnProperty(key))
{
throw new Error('Cannot add a Scene with duplicate key: ' + key);
}
return this.createSceneFromInstance(key, newScene);
}
else
{
newScene.sys = new Systems(newScene);
newScene.sys.settings.key = key;
newScene.sys.init(this.game);
return newScene;
}
},
/**
* Creates and initializes a Scene instance.
*
* @method Phaser.Scenes.SceneManager#createSceneFromInstance
* @private
* @since 3.0.0
*
* @param {string} key - The key of the Scene.
* @param {Phaser.Scene} newScene - The Scene instance.
*
* @return {Phaser.Scene} The created Scene.
*/
createSceneFromInstance: function (key, newScene)
{
var configKey = newScene.sys.settings.key;
if (configKey !== '')
{
key = configKey;
}
else
{
newScene.sys.settings.key = key;
}
newScene.sys.init(this.game);
return newScene;
},
/**
* Creates and initializes a Scene from an Object definition.
*
* @method Phaser.Scenes.SceneManager#createSceneFromObject
* @private
* @since 3.0.0
*
* @param {string} key - The key of the Scene.
* @param {(string|Phaser.Scenes.Settings.Config)} sceneConfig - The Scene config.
*
* @return {Phaser.Scene} The created Scene.
*/
createSceneFromObject: function (key, sceneConfig)
{
var newScene = new Scene(sceneConfig);
var configKey = newScene.sys.settings.key;
if (configKey !== '')
{
key = configKey;
}
else
{
newScene.sys.settings.key = key;
}
newScene.sys.init(this.game);
// Extract callbacks
var defaults = [ 'init', 'preload', 'create', 'update', 'render' ];
for (var i = 0; i < defaults.length; i++)
{
var sceneCallback = GetValue(sceneConfig, defaults[i], null);
if (sceneCallback)
{
newScene[defaults[i]] = sceneCallback;
}
}
// Now let's move across any other functions or properties that may exist in the extend object:
/*
scene: {
preload: preload,
create: create,
extend: {
hello: 1,
test: 'atari',
addImage: addImage
}
}
*/
if (sceneConfig.hasOwnProperty('extend'))
{
for (var propertyKey in sceneConfig.extend)
{
var value = sceneConfig.extend[propertyKey];
if (propertyKey === 'data' && newScene.hasOwnProperty('data') && typeof value === 'object')
{
// Populate the DataManager
newScene.data.merge(value);
}
else if (propertyKey !== 'sys')
{
newScene[propertyKey] = value;
}
}
}
return newScene;
},
/**
* Retrieves the key of a Scene from a Scene config.
*
* @method Phaser.Scenes.SceneManager#getKey
* @private
* @since 3.0.0
*
* @param {string} key - The key to check in the Scene config.
* @param {(Phaser.Scene|Phaser.Scenes.Settings.Config|function)} sceneConfig - The Scene config.
*
* @return {string} The Scene key.
*/
getKey: function (key, sceneConfig)
{
if (!key) { key = 'default'; }
if (typeof sceneConfig === 'function')
{
return key;
}
else if (sceneConfig instanceof Scene)
{
key = sceneConfig.sys.settings.key;
}
else if (typeof sceneConfig === 'object' && sceneConfig.hasOwnProperty('key'))
{
key = sceneConfig.key;
}
// By this point it's either 'default' or extracted from the Scene
if (this.keys.hasOwnProperty(key))
{
throw new Error('Cannot add a Scene with duplicate key: ' + key);
}
else
{
return key;
}
},
/**
* Retrieves a Scene.
*
* @method Phaser.Scenes.SceneManager#getScene
* @since 3.0.0
*
* @param {string|Phaser.Scene} key - The Scene to retrieve.
*
* @return {?Phaser.Scene} The Scene.
*/
getScene: function (key)
{
if (typeof key === 'string')
{
if (this.keys[key])
{
return this.keys[key];
}
}
else
{
for (var i = 0; i < this.scenes.length; i++)
{
if (key === this.scenes[i])
{
return key;
}
}
}
return null;
},
/**
* Determines whether a Scene is active.
*
* @method Phaser.Scenes.SceneManager#isActive
* @since 3.0.0
*
* @param {string} key - The Scene to check.
*
* @return {boolean} Whether the Scene is active.
*/
isActive: function (key)
{
var scene = this.getScene(key);
if (scene)
{
return scene.sys.isActive();
}
return null;
},
/**
* Determines whether a Scene is visible.
*
* @method Phaser.Scenes.SceneManager#isVisible
* @since 3.0.0
*
* @param {string} key - The Scene to check.
*
* @return {boolean} Whether the Scene is visible.
*/
isVisible: function (key)
{
var scene = this.getScene(key);
if (scene)
{
return scene.sys.isVisible();
}
return null;
},
/**
* Determines whether a Scene is sleeping.
*
* @method Phaser.Scenes.SceneManager#isSleeping
* @since 3.0.0
*
* @param {string} key - The Scene to check.
*
* @return {boolean} Whether the Scene is sleeping.
*/
isSleeping: function (key)
{
var scene = this.getScene(key);
if (scene)
{
return scene.sys.isSleeping();
}
return null;
},
/**
* Pauses the given Scene.
*
* @method Phaser.Scenes.SceneManager#pause
* @since 3.0.0
*
* @param {string} key - The Scene to pause.
* @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its pause event.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
pause: function (key, data)
{
var scene = this.getScene(key);
if (scene)
{
scene.sys.pause(data);
}
return this;
},
/**
* Resumes the given Scene.
*
* @method Phaser.Scenes.SceneManager#resume
* @since 3.0.0
*
* @param {string} key - The Scene to resume.
* @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its resume event.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
resume: function (key, data)
{
var scene = this.getScene(key);
if (scene)
{
scene.sys.resume(data);
}
return this;
},
/**
* Puts the given Scene to sleep.
*
* @method Phaser.Scenes.SceneManager#sleep
* @since 3.0.0
*
* @param {string} key - The Scene to put to sleep.
* @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its sleep event.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
sleep: function (key, data)
{
var scene = this.getScene(key);
if (scene && !scene.sys.isTransitioning())
{
scene.sys.sleep(data);
}
return this;
},
/**
* Awakens the given Scene.
*
* @method Phaser.Scenes.SceneManager#wake
* @since 3.0.0
*
* @param {string} key - The Scene to wake up.
* @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its wake event.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
wake: function (key, data)
{
var scene = this.getScene(key);
if (scene)
{
scene.sys.wake(data);
}
return this;
},
/**
* Runs the given Scene, but does not change the state of this Scene.
*
* If the given Scene is paused, it will resume it. If sleeping, it will wake it.
* If not running at all, it will be started.
*
* Use this if you wish to open a modal Scene by calling `pause` on the current
* Scene, then `run` on the modal Scene.
*
* @method Phaser.Scenes.SceneManager#run
* @since 3.10.0
*
* @param {string} key - The Scene to run.
* @param {object} [data] - A data object that will be passed to the Scene on start, wake, or resume.
*
* @return {Phaser.Scenes.SceneManager} This Scene Manager.
*/
run: function (key, data)
{
var scene = this.getScene(key);
if (!scene)
{
for (var i = 0; i < this._pending.length; i++)
{
if (this._pending[i].key === key)
{
this.queueOp('start', key, data);
break;
}
}
return this;
}
if (scene.sys.isSleeping())
{
// Sleeping?
scene.sys.wake(data);
}
else if (scene.sys.isBooted && !scene.sys.isActive())
{
// Paused?
scene.sys.resume(data);
}
else
{
// Not actually running?
this.start(key, data);
}
},
/**
* Starts the given Scene.
*
* @method Phaser.Scenes.SceneManager#start
* @since 3.0.0
*
* @param {string} key - The Scene to start.
* @param {object} [data] - Optional data object to pass to Scene.Settings and Scene.init.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
start: function (key, data)
{
// If the Scene Manager is not running, then put the Scene into a holding pattern
if (!this.isBooted)
{
this._data[key] = {
autoStart: true,
data: data
};
return this;
}
var scene = this.getScene(key);
if (scene)
{
scene.sys.start(data);
var loader;
if (scene.sys.load)
{
loader = scene.sys.load;
}
// Files payload?
if (loader && scene.sys.settings.hasOwnProperty('pack'))
{
loader.reset();
if (loader.addPack({ payload: scene.sys.settings.pack }))
{
scene.sys.settings.status = CONST.LOADING;
loader.once('complete', this.payloadComplete, this);
loader.start();
return this;
}
}
this.bootScene(scene);
}
return this;
},
/**
* Stops the given Scene.
*
* @method Phaser.Scenes.SceneManager#stop
* @since 3.0.0
*
* @param {string} key - The Scene to stop.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
stop: function (key)
{
var scene = this.getScene(key);
if (scene && !scene.sys.isTransitioning())
{
scene.sys.shutdown();
}
return this;
},
/**
* Sleeps one one Scene and starts the other.
*
* @method Phaser.Scenes.SceneManager#switch
* @since 3.0.0
*
* @param {string} from - The Scene to sleep.
* @param {string} to - The Scene to start.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
switch: function (from, to)
{
var sceneA = this.getScene(from);
var sceneB = this.getScene(to);
if (sceneA && sceneB && sceneA !== sceneB)
{
this.sleep(from);
if (this.isSleeping(to))
{
this.wake(to);
}
else
{
this.start(to);
}
}
return this;
},
/**
* Retrieves a Scene by numeric index.
*
* @method Phaser.Scenes.SceneManager#getAt
* @since 3.0.0
*
* @param {integer} index - The index of the Scene to retrieve.
*
* @return {(Phaser.Scene|undefined)} The Scene.
*/
getAt: function (index)
{
return this.scenes[index];
},
/**
* Retrieves the numeric index of a Scene.
*
* @method Phaser.Scenes.SceneManager#getIndex
* @since 3.0.0
*
* @param {(string|Phaser.Scene)} key - The key of the Scene.
*
* @return {integer} The index of the Scene.
*/
getIndex: function (key)
{
var scene = this.getScene(key);
return this.scenes.indexOf(scene);
},
/**
* Brings a Scene to the top of the Scenes list.
*
* This means it will render above all other Scenes.
*
* @method Phaser.Scenes.SceneManager#bringToTop
* @since 3.0.0
*
* @param {(string|Phaser.Scene)} key - The Scene to move.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
bringToTop: function (key)
{
if (this.isProcessing)
{
this._queue.push({ op: 'bringToTop', keyA: key, keyB: null });
}
else
{
var index = this.getIndex(key);
if (index !== -1 && index < this.scenes.length)
{
var scene = this.getScene(key);
this.scenes.splice(index, 1);
this.scenes.push(scene);
}
}
return this;
},
/**
* Sends a Scene to the back of the Scenes list.
*
* This means it will render below all other Scenes.
*
* @method Phaser.Scenes.SceneManager#sendToBack
* @since 3.0.0
*
* @param {(string|Phaser.Scene)} key - The Scene to move.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
sendToBack: function (key)
{
if (this.isProcessing)
{
this._queue.push({ op: 'sendToBack', keyA: key, keyB: null });
}
else
{
var index = this.getIndex(key);
if (index !== -1 && index > 0)
{
var scene = this.getScene(key);
this.scenes.splice(index, 1);
this.scenes.unshift(scene);
}
}
return this;
},
/**
* Moves a Scene down one position in the Scenes list.
*
* @method Phaser.Scenes.SceneManager#moveDown
* @since 3.0.0
*
* @param {(string|Phaser.Scene)} key - The Scene to move.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
moveDown: function (key)
{
if (this.isProcessing)
{
this._queue.push({ op: 'moveDown', keyA: key, keyB: null });
}
else
{
var indexA = this.getIndex(key);
if (indexA > 0)
{
var indexB = indexA - 1;
var sceneA = this.getScene(key);
var sceneB = this.getAt(indexB);
this.scenes[indexA] = sceneB;
this.scenes[indexB] = sceneA;
}
}
return this;
},
/**
* Moves a Scene up one position in the Scenes list.
*
* @method Phaser.Scenes.SceneManager#moveUp
* @since 3.0.0
*
* @param {(string|Phaser.Scene)} key - The Scene to move.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
moveUp: function (key)
{
if (this.isProcessing)
{
this._queue.push({ op: 'moveUp', keyA: key, keyB: null });
}
else
{
var indexA = this.getIndex(key);
if (indexA < this.scenes.length - 1)
{
var indexB = indexA + 1;
var sceneA = this.getScene(key);
var sceneB = this.getAt(indexB);
this.scenes[indexA] = sceneB;
this.scenes[indexB] = sceneA;
}
}
return this;
},
/**
* Moves a Scene so it is immediately above another Scene in the Scenes list.
*
* This means it will render over the top of the other Scene.
*
* @method Phaser.Scenes.SceneManager#moveAbove
* @since 3.2.0
*
* @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above.
* @param {(string|Phaser.Scene)} keyB - The Scene to be moved.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
moveAbove: function (keyA, keyB)
{
if (keyA === keyB)
{
return this;
}
if (this.isProcessing)
{
this._queue.push({ op: 'moveAbove', keyA: keyA, keyB: keyB });
}
else
{
var indexA = this.getIndex(keyA);
var indexB = this.getIndex(keyB);
if (indexA !== -1 && indexB !== -1)
{
var tempScene = this.getAt(indexB);
// Remove
this.scenes.splice(indexB, 1);
// Add in new location
this.scenes.splice(indexA + 1, 0, tempScene);
}
}
return this;
},
/**
* Moves a Scene so it is immediately below another Scene in the Scenes list.
*
* This means it will render behind the other Scene.
*
* @method Phaser.Scenes.SceneManager#moveBelow
* @since 3.2.0
*
* @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above.
* @param {(string|Phaser.Scene)} keyB - The Scene to be moved.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
moveBelow: function (keyA, keyB)
{
if (keyA === keyB)
{
return this;
}
if (this.isProcessing)
{
this._queue.push({ op: 'moveBelow', keyA: keyA, keyB: keyB });
}
else
{
var indexA = this.getIndex(keyA);
var indexB = this.getIndex(keyB);
if (indexA !== -1 && indexB !== -1)
{
var tempScene = this.getAt(indexB);
// Remove
this.scenes.splice(indexB, 1);
if (indexA === 0)
{
this.scenes.unshift(tempScene);
}
else
{
// Add in new location
this.scenes.splice(indexA, 0, tempScene);
}
}
}
return this;
},
/**
* Queue a Scene operation for the next update.
*
* @method Phaser.Scenes.SceneManager#queueOp
* @private
* @since 3.0.0
*
* @param {string} op - The operation to perform.
* @param {(string|Phaser.Scene)} keyA - Scene A.
* @param {(string|Phaser.Scene)} [keyB] - Scene B.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
queueOp: function (op, keyA, keyB)
{
this._queue.push({ op: op, keyA: keyA, keyB: keyB });
return this;
},
/**
* Swaps the positions of two Scenes in the Scenes list.
*
* @method Phaser.Scenes.SceneManager#swapPosition
* @since 3.0.0
*
* @param {(string|Phaser.Scene)} keyA - The first Scene to swap.
* @param {(string|Phaser.Scene)} keyB - The second Scene to swap.
*
* @return {Phaser.Scenes.SceneManager} This SceneManager.
*/
swapPosition: function (keyA, keyB)
{
if (keyA === keyB)
{
return this;
}
if (this.isProcessing)
{
this._queue.push({ op: 'swapPosition', keyA: keyA, keyB: keyB });
}
else
{
var indexA = this.getIndex(keyA);
var indexB = this.getIndex(keyB);
if (indexA !== indexB && indexA !== -1 && indexB !== -1)
{
var tempScene = this.getAt(indexA);
this.scenes[indexA] = this.scenes[indexB];
this.scenes[indexB] = tempScene;
}
}
return this;
},
/**
* Dumps debug information about each Scene to the developer console.
*
* @method Phaser.Scenes.SceneManager#dump
* @since 3.2.0
*/
dump: function ()
{
var out = [];
var map = [ 'pending', 'init', 'start', 'loading', 'creating', 'running', 'paused', 'sleeping', 'shutdown', 'destroyed' ];
for (var i = 0; i < this.scenes.length; i++)
{
var sys = this.scenes[i].sys;
var key = (sys.settings.visible && (sys.settings.status === CONST.RUNNING || sys.settings.status === CONST.PAUSED)) ? '[*] ' : '[-] ';
key += sys.settings.key + ' (' + map[sys.settings.status] + ')';
out.push(key);
}
console.log(out.join('\n'));
},
/**
* Destroy the SceneManager and all of its Scene's systems.
*
* @method Phaser.Scenes.SceneManager#destroy
* @since 3.0.0
*/
destroy: function ()
{
for (var i = 0; i < this.scenes.length; i++)
{
var sys = this.scenes[i].sys;
sys.destroy();
}
this.update = NOOP;
this.scenes = [];
this._pending = [];
this._start = [];
this._queue = [];
this.game = null;
}
});
module.exports = SceneManager;
|
pixelpicosean/phaser
|
src/scene/SceneManager.js
|
JavaScript
|
mit
| 39,877
|
/**********************************************************\
| |
| hprose |
| |
| Official WebSite: http://www.hprose.com/ |
| http://www.hprose.org/ |
| |
\**********************************************************/
/**********************************************************\
* *
* ClassManager.js *
* *
* hprose ClassManager for HTML5. *
* *
* LastModified: Nov 18, 2016 *
* Author: Ma Bingyao <andot@hprose.com> *
* *
\**********************************************************/
(function (hprose, global) {
'use strict';
var WeakMap = global.WeakMap;
var classCache = Object.create(null);
var aliasCache = new WeakMap();
function register(cls, alias) {
aliasCache.set(cls, alias);
classCache[alias] = cls;
}
function getClassAlias(cls) {
return aliasCache.get(cls);
}
function getClass(alias) {
return classCache[alias];
}
hprose.ClassManager = Object.create(null, {
register: { value: register },
getClassAlias: { value: getClassAlias },
getClass: { value: getClass }
});
hprose.register = register;
register(Object, 'Object');
})(hprose, hprose.global);
|
hprose/hprose-html5
|
src/ClassManager.js
|
JavaScript
|
mit
| 1,791
|
package com.brew.city.rental.repo.search;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import com.brew.city.rental.domain.Review;
public interface ReviewSearchRepository extends ElasticsearchRepository<Review, Long> {
}
|
jkupcho/brew-city-rental
|
src/main/java/com/brew/city/rental/repo/search/ReviewSearchRepository.java
|
Java
|
mit
| 270
|
/*
* The MIT License (MIT)
* Copyright (c) 2016 SK PLANET. All Rights Reserved. *
* 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. */
/*!
* \RecentWordPluginLocalStorageAddOn.js
* \Addon source for RecentWordPlugin.js
* \copyright Copyright (c) 2016, SK PLANET. All Rights Reserved.
* \license This project is released under the MIT License.
* \contributor Jisu Youn (jisu.youn@gmail.com)
* \warning dont'use this source in other library source.
*/
class RecentWordPluginLocalStorageAddOn {
constructor(sKey, nMaxList) {
this.sKey = sKey;
this.nMaxList = nMaxList;
}
saveKeyword(sKeyword) {
if (this.validStorage()) return;
let aLegacy = this.getKeywords();
//to Array
if (aLegacy === null) aLegacy = [];
else aLegacy = JSON.parse(aLegacy);
//save data
let nIndex = aLegacy.indexOf(sKeyword);
if ( nIndex > -1) {
if(nIndex === (aLegacy.length-1)) return;
aLegacy.splice(nIndex, 1);
}
aLegacy.unshift(sKeyword);
if (aLegacy.length >= this.nMaxList) aLegacy.length = this.nMaxList;
localStorage.setItem(this.sKey, JSON.stringify(aLegacy));
}
getKeywords(){
if (this.validStorage()) return;
let sResult = localStorage.getItem(this.sKey);
return sResult;
}
removeKeywords() {
if (this.validStorage()) return;
return localStorage.removeItem(this.sKey);
}
validStorage() {
if ( typeof(Storage) === "undefined") return;
}
}
|
skplanet/sweetsearch
|
src/RecentWordPluginLocalStorageAddOn.js
|
JavaScript
|
mit
| 2,454
|
"use strict";
module.exports = {
entry: {
playground: "./playground/index.js"
},
output: {
filename: "[name].js",
path: __dirname + "/static/"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
options: {
presets: ["env", "react"]
}
}
]
},
externals: {
clipboard: "ClipboardJS",
codemirror: "CodeMirror",
react: "React",
"react-dom": "ReactDOM"
}
};
|
existentialism/prettier
|
website/webpack.config.js
|
JavaScript
|
mit
| 502
|
import paho.mqtt.client as mqtt
import json, time
import RPi.GPIO as GPIO
from time import sleep
# The script as below using BCM GPIO 00..nn numbers
GPIO.setmode(GPIO.BCM)
# Set relay pins as output
GPIO.setup(24, GPIO.OUT)
# ----- CHANGE THESE FOR YOUR SETUP -----
MQTT_HOST = "190.97.168.236"
MQTT_PORT = 1883
USERNAME = ''
PASSWORD = ""
# ---------------------------------------
def on_connect(client, userdata, rc):
print("\nConnected with result code " + str(rc) + "\n")
#Subscribing in on_connect() means that if we lose the connection and
# reconnect then subscriptions will be renewed.
client.subscribe("/iot/control/")
print("Subscribed to iotcontrol")
def on_message_iotrl(client, userdata, msg):
print("\n\t* Raspberry UPDATED ("+msg.topic+"): " + str(msg.payload))
if msg.payload == "gpio24on":
GPIO.output(24, GPIO.HIGH)
client.publish("/iot/status", "Relay gpio18on", 2)
if msg.payload == "gpio24off":
GPIO.output(24, GPIO.LOW)
client.publish("/iot/status", "Relay gpio18off", 2)
def command_error():
print("Error: Unknown command")
client = mqtt.Client(client_id="rasp-g1")
# Callback declarations (functions run based on certain messages)
client.on_connect = on_connect
client.message_callback_add("/iot/control/", on_message_iotrl)
# This is where the MQTT service connects and starts listening for messages
client.username_pw_set(USERNAME, PASSWORD)
client.connect(MQTT_HOST, MQTT_PORT, 60)
client.loop_start() # Background thread to call loop() automatically
# Main program loop
while True:
time.sleep(10)
|
pumanzor/security
|
raspberrypi/relaycontrol.py
|
Python
|
mit
| 1,611
|
<?php
/*
* This file is part of the Speedwork package.
*
* (c) Sankar <sankar.suda@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code
*/
namespace Turbo\Speedwork\Widget\Charts;
use Speedwork\Core\Widget;
/**
* chartWidget class file.
*
* This is the base class for all Chart widget classes.
*/
class Charts extends Widget
{
/**
* [$options description].
*
* @var array
*/
public $options = [];
public $publicCharts = [
'type' => 'high',
'x-title' => '',
'y-title' => '',
'legend' => true,
'export' => false,
];
public function beforeRun()
{
}
public function run()
{
$charts = config('charts');
if (!is_array($charts)) {
$charts = [];
}
$charts = array_merge($this->publicCharts, $charts);
$this->options['globalOptions'] = $charts;
$charts = ($charts['type']) ? $charts['type'] : 'high';
if (strstr($this->options['options']['type'], '.')) {
$type = explode('.', $this->options['options']['type']);
$this->options['options']['type'] = $type[0];
$charts = $type[1];
}
if ($charts == 'high') {
$this->get('resolver')->widget('charts.high', $this->options);
} elseif ($charts == 'flot') {
$this->get('resolver')->widget('flot.'.$this->options['options']['type'], $this->options);
} elseif ($charts == 'fusion') {
$this->get('resolver')->widget('fusion', $this->options);
}
}
}
|
turbophp/speedwork
|
src/Widget/Charts/Charts.php
|
PHP
|
mit
| 1,725
|
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
<title>Examples • Sweeper</title>
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="https://rawgit.com/feiss/aframe-environment-component/master/dist/aframe-environment-component.min.js"></script>
<script src="https://cdn.rawgit.com/donmccurdy/aframe-extras/v4.2.0/dist/components/sphere-collider.js"></script>
<script src="../dist/aframe-physics-system.js"></script>
<script src="components/grab.js"></script>
<script src="components/rain-of-entities.js"></script>
<script src="components/force-pushable.js"></script>
</head>
<body>
<a-scene environment
rain-of-entities="spread: 3"
physics="driver: worker; workerFps: 60; workerInterpolate: true; workerInterpBufferSize: 2;">
<!-- Player -->
<a-entity camera="userHeight: 0.6" look-controls position="0 0.1 0">
<a-entity cursor
position="0 0 -0.5"
geometry="primitive: circle; radius: 0.01; segments: 4;"
material="color: #FF4444; shader: flat"></a-entity>
</a-entity>
<a-entity static-body="shape: sphere; sphereRadius: 0.02;" hand-controls="hand: left" sphere-collider="objects: [dynamic-body];" grab></a-entity>
<a-entity static-body="shape: sphere; sphereRadius: 0.02;" hand-controls="hand: right" sphere-collider="objects: [dynamic-body];" grab></a-entity>
<!-- Terrain -->
<a-box width="75" height="0.1" depth="75" static-body visible="false"></a-box>
<!-- Sweeper -->
<a-box width="20" height="1" depth="1" position="0 0.5 25" material="color: red; opacity: 0.5" velocity="0 0 -2" static-body></a-box>
</a-scene>
</body>
</html>
|
donmccurdy/aframe-physics-system
|
examples/sweeper.html
|
HTML
|
mit
| 1,982
|
package org.anodyneos.xpImpl.registry;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.anodyneos.commons.xml.sax.CDATAProcessor;
import org.anodyneos.commons.xml.sax.ElementProcessor;
import org.anodyneos.xpImpl.XpTranslationException;
import org.xml.sax.SAXException;
class ProcessorTaglib extends RegistryProcessor {
private CDATAProcessor uriProcessor;
private CDATAProcessor locationProcessor;
public static final String E_TAGLIB_URI = "taglib-uri";
public static final String E_TAGLIB_LOCATION = "taglib-location";
public ProcessorTaglib(RegistryContext ctx) {
super(ctx);
uriProcessor = new CDATAProcessor(ctx);
locationProcessor = new CDATAProcessor(ctx);
}
public ElementProcessor getProcessorFor(String uri, String localName, String qName)
throws SAXException {
if (E_TAGLIB_URI.equals(localName)) {
return uriProcessor;
} else if (E_TAGLIB_LOCATION.equals(localName)) {
return locationProcessor;
} else {
return super.getProcessorFor(uri, localName, qName);
}
}
public void endElement(String uri, String localName, String qName) throws SAXException {
URI locationURI;
try {
locationURI = getContext().uriFromRelative(locationProcessor.getCDATA().trim());
} catch (URISyntaxException e) {
throw new SAXException("Malformed URI for taglib: " + locationProcessor.getCDATA(), e);
}
try {
getRegistryContext().getRegistry().addTaglib(uriProcessor.getCDATA().trim(),
locationURI.toString());
} catch (IOException e) {
// @TODO: check to see if this error handling is good enough. Do
// parse errors get through ok?
//throw new SAXException("Cannot process taglib: " + locationProcessor.getCDATA(), e);
throw new XpTranslationException("Cannot process taglib: " + locationProcessor.getCDATA(), getLocator(), e);
}
}
}
|
jvasileff/aos-xp
|
src.java/org/anodyneos/xpImpl/registry/ProcessorTaglib.java
|
Java
|
mit
| 2,085
|
serious-playlists
=================
SiriusXM scraper + playlist generator which powers [Serious Playlists](http://music.adamlaycock.ca/)
It's a web service that scrapes the Sirius XM 'now playing' data, finds it on youtube, and plays as it is scraped. It's a makeshift free internet satellite radio service, with just the music.
Usage
-----
Hopefully it should be pretty self-explanitory, load the page, select a station, and every 30 seconds it will search for a new track. If there is one, it will add it to the song queue. Songs are search for, and played through, YouTube. When a song ends, the next one will come on.
Installation
------------
1. Clone this repo
2. Install Node.js, NPM, & Foreman (`gem install foreman`)
3. Install MongoDB and ensure you can connect to it. I use docker, so I would use this command: `docker run -p 27017:27017 --name sirius_mongo -d mongo`
4. Setup your environment file in `.env`. See below for the environment variables you should include.
5. `foreman start` to start the web server on `localhost:3000`
Environment Variables
------
```
MONGO_DB=mongodb://0.0.0.0:27017
YT_API_KEY=XXXXXXXXXXXXXXXXXXXX
```
Additionally, I deploy to Openshift, so in my prod environment I could ensure I have the variables `OPENSHIFT_NODEJS_PORT` and `OPENSHIFT_NODEJS_IP`.
To Do
-----
* Make it pretty
* Improve the song queue, make it one big long queue, instead of a upcoming and completed one.
* Make priority list for stations (using a sortable list)
* Improve the logic for selecting tracks, eg, grab 5 at startup to build the queue, select random previous song from that day if queue is empty, etc.
|
alaycock/sirius-playlists
|
README.md
|
Markdown
|
mit
| 1,648
|
# dripl
An interactive terminal for Druid. It allows fetching metadata and constructing and sending queries to a Druid cluster.
## Installation
```
gem install dripl
```
## Usage
```
dripl --zookeeper localhost:2181
>> sources
[
[0] "events"
]
>> use 0
Using events data source
>> metrics
[
[0] "actions"
[1] "words"
]
>> dimensions
[
[0] "type"
]
>> long_sum(:actions)
+---------+
| actions |
+---------+
| 98575 |
+---------+
>> long_sum(:actions, :words).last(3.days).granularity(:day)
+---------------+---------------+
| actions | words |
+---------------+---------------+
| 2013-12-11T00:00:00.000+01:00 |
+---------------+---------------+
| 537345 | 68974 |
+---------------+---------------+
| 2013-12-12T00:00:00.000+01:00 |
+---------------+---------------+
| 675431 | 49253 |
+---------------+---------------+
| 2013-12-13T00:00:00.000+01:00 |
+---------------+---------------+
| 749034 | 87542 |
+---------------+---------------+
>> long_sum(:actions, :words).last(3.days).granularity(:day).as_json
{
:dataSource => "events",
:granularity => {
:type => "period",
:period => "P1D",
:timeZone => "Europe/Berlin"
},
:intervals => [
[0] "2013-12-11T00:00:00+01:00/2013-12-13T09:41:10+01:00"
],
:queryType => :groupBy,
:aggregations => [
[0] {
:type => "longSum",
:name => :actions,
:fieldName => :actions
},
[1] {
:type => "longSum",
:name => :words,
:fieldName => :words
}
]
}
```
|
ruby-druid/dripl
|
README.md
|
Markdown
|
mit
| 1,679
|
// Font structures for newer Adafruit_GFX (1.1 and later).
// Example fonts are included in 'Fonts' directory.
// To use a font in your Arduino sketch, #include the corresponding .h
// file and pass address of GFXfont struct to setFont(). Pass NULL to
// revert to 'classic' fixed-space bitmap font.
#include "cox.h"
#ifndef _GFXFONT_H_
#define _GFXFONT_H_
typedef struct { // Data stored PER GLYPH
uint16_t bitmapOffset; // Pointer into GFXfont->bitmap
uint8_t width, height; // Bitmap dimensions in pixels
uint8_t xAdvance; // Distance to advance cursor (x axis)
int8_t xOffset, yOffset; // Dist from cursor pos to UL corner
} GFXglyph;
typedef struct { // Data stored for FONT AS A WHOLE:
uint8_t *bitmap; // Glyph bitmaps, concatenated
GFXglyph *glyph; // Glyph array
uint8_t first, last; // ASCII extents
uint8_t yAdvance; // Newline distance (y axis)
} GFXfont;
#endif // _GFXFONT_H_
|
CoXlabInc/Nol.A-device-driver
|
inc/gfxfont.hpp
|
C++
|
mit
| 941
|
---
title: RDO Liberty Test Day
---
# Liberty Test Day 1
We will be holding a RDO test day on September 23rd and 24th, 2015.
This will be coordinated through the **#rdo channel on Freenode**, and
through this website and the rdo-list mailing list.
We'll be testing the second Liberty milestone release. If you can do
any testing on your own ahead of time, that will help ensure that
everyone isn't encountering the same problems.
Update this page by submitting pull requests to [this
repo](https://github.com/redhat-openstack/website).
## Prerequisites
We plan to have have packages for the following platforms:
* Fedora 22
* RHEL 7
* CentOS 7
You'll want a fresh install with latest updates installed.
(Fresh so that there's no hard-to-reproduce interactions with other things.)
## How To Test
cd /etc/yum.repos.d/
sudo wget http://trunk.rdoproject.org/centos7-liberty/delorean-deps.repo
sudo wget http://trunk.rdoproject.org/centos7-liberty/current-passed-ci/delorean.repo
* Check for any [workarounds](/testday/workarounds-liberty-01) required for your platform before the main installation
* For Packstack based deployment start at step 2 of the [packstack Quickstart](http://openstack.redhat.com/Quickstart#Step_2:_Install_Packstack_Installer)
* For RDO-Manager based installs, *doc goes here* **TODO**
### Test cases and results
The things that should be tested are listed on the [Tested Setups](/testday/testedsetups-liberty-01) page.
* Pick an item from the list
* Go through the scenario as though you were a beginner, just following the instructions. (Check the [workarounds](/testday/workarounds-liberty-01) page for problems that others may have encountered and resolved.)
* KEEP GOOD NOTES. You can use [the test day etherpad](https://etherpad.openstack.org/p/rdo_test_day_sep_2015) for these notes. Reviewing other peoples' notes may help you avoid problems that they've already encountered.
* Compare your results to the [rdoproject f22 CI report](http://trunk.rdoproject.org/f22/report.html)
* Execute the openstack test suite tempest @ [Testing Liberty using Tempest](/uncategorized/testing-liberty-using-tempest/)
If you have problems with any of the tests, report a bug to [Bugzilla](https://bugzilla.redhat.com) usually for one of the
[openstack-packstack](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO&component=openstack-packstack),
[openstack-nova](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO&component=openstack-nova), [openstack-glance](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO&component=openstack-glance), [openstack-keystone](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO&component=openstack-keystone), [openstack-cinder](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO&component=openstack-cinder),
[openstack-neutron](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO&component=openstack-neutron), [openstack-swift](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO&component=openstack-swift), [python-django-horizon](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO&component=python-django-horizon), [openstack-heat](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO&component=openstack-heat) or [openstack-ceilometer](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO&component=openstack-ceilometer) components. If you are unsure about exactly how to file the report or what other information to include, just ask on IRC (#rdo, freenode.net) and we will help you.
Once you have completed the tests, add your results to the table on the [TestedSetups](/testday/testedsetups-liberty-01) page, following the examples already there. Be sure to check the [Workarounds](/testday/workarounds-2015-01) page for things that may have already have fixes or workarounds.
|
dtantsur/website
|
source/testday/rdo-test-day-liberty-01.html.md
|
Markdown
|
mit
| 3,791
|
class AlterPlayTypeIndexOnGames < ActiveRecord::Migration
def change
remove_index :games, :play_type
add_index :games, [:user_id, :play_type]
end
end
|
steve-mcclellan/j-scorer
|
db/migrate/20160703132507_alter_play_type_index_on_games.rb
|
Ruby
|
mit
| 162
|
require "spec_helper"
RSpec.describe Weather do
it "has a version number" do
expect(Weather::VERSION).not_to be nil
end
end
|
thalessr/weather
|
spec/weather_spec.rb
|
Ruby
|
mit
| 133
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>speedtest-openshift</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="https://cdn.socket.io/socket.io-1.2.0.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/modules/solid-gauge.js"></script>
<script src="test.js"></script>
<script src="view.js"></script>
</head>
<body>
<div id="container-latency" style="width: 600px; height: 200px;"></div>
<div id="container-download" style="width: 300px; height: 200px; float:left;"></div>
<div id="container-upload" style="width: 300px; height: 200px;"></div>
</body>
</html>
|
jvanhalen/wsperformance
|
index.html
|
HTML
|
mit
| 788
|
require 'twilio-ruby'
require 'sinatra'
get '/token' do
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
capability = Twilio::Util::Capability.new account_sid, auth_token
# Create an application sid at
# twilio.com/console/phone-numbers/dev-tools/twiml-apps and use it here
capability.allow_client_outgoing 'APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
capability.allow_client_incoming 'jenny'
token = capability.generate
content_type 'application/jwt'
token
end
# TODO: post '/voice' do
|
teoreteetik/api-snippets
|
client/capability-token/capability-token.4.x.rb
|
Ruby
|
mit
| 535
|
package link
import (
"testing"
"github.com/cilium/ebpf"
"github.com/cilium/ebpf/internal/testutils"
)
func TestProgramAlter(t *testing.T) {
testutils.SkipOnOldKernel(t, "4.13", "SkSKB type")
prog := mustLoadProgram(t, ebpf.SkSKB, 0, "")
var sockMap *ebpf.Map
sockMap, err := ebpf.NewMap(&ebpf.MapSpec{
Type: ebpf.MapType(15), // BPF_MAP_TYPE_SOCKMAP
KeySize: 4,
ValueSize: 4,
MaxEntries: 2,
})
if err != nil {
t.Fatal(err)
}
defer sockMap.Close()
err = RawAttachProgram(RawAttachProgramOptions{
Target: sockMap.FD(),
Program: prog,
Attach: ebpf.AttachSkSKBStreamParser,
})
if err != nil {
t.Fatal(err)
}
err = RawDetachProgram(RawDetachProgramOptions{
Target: sockMap.FD(),
Program: prog,
Attach: ebpf.AttachSkSKBStreamParser,
})
if err != nil {
t.Fatal(err)
}
}
|
cilium/ebpf
|
link/program_test.go
|
GO
|
mit
| 830
|
import { Directive, ElementRef, Renderer } from '@angular/core';
/*
* Directive
* XLarge is a simple directive to show how one is made
*/
@Directive({
selector: '[x-large]' // using [ ] means selecting attributes
})
export class XLargeDirective {
constructor(
public element: ElementRef,
public renderer: Renderer
) {
// simple DOM manipulation to set font size to x-large
// `nativeElement` is the direct reference to the DOM element
// element.nativeElement.style.fontSize = 'x-large';
// for server/webworker support use the renderer
renderer.setElementStyle(element.nativeElement, 'fontSize', 'x-large');
}
}
|
navgurukul/lennon
|
src/app/component/+home/x-large/x-large.directive.ts
|
TypeScript
|
mit
| 654
|
from django.test import TestCase
from django.contrib.auth.models import User
from django.urls import reverse
from .models import UserProfile
from imagersite.tests import AuthenticatedTestCase
# Create your tests here.
class ProfileTestCase(TestCase):
"""TestCase for Profile"""
def setUp(self):
"""Set up User Profile"""
self.user = User(username='Cris', first_name='Cris')
self.user.save()
def test_user_has_profile(self):
"""Test User has a profile."""
self.assertTrue(hasattr(self.user, 'profile'))
def test_profile_username(self):
"""Test Profile has username"""
self.assertEqual(self.user.profile.user.username, 'Cris')
# Learn to paramertize
def test_profile_has_cameratype(self):
"""Test profile has cameria type attr."""
self.assertTrue(hasattr(self.user.profile, 'camera_type'))
def test_profile_repr(self):
"""Test repr function."""
self.assertIn('Cris', repr(self.user.profile))
def test_profile_active(self):
"""Test profile manager."""
self.assertTrue(len(UserProfile.active.all()) > 0)
class UserProfilePageTestCase(AuthenticatedTestCase):
"""Test case for viewing the profile."""
def test_profile_page(self):
self.log_in()
self.assertEqual(self.client.get('/profile/').status_code, 200)
def test_profile_page_has_username(self):
self.log_in()
self.assertIn(
self.username.encode('utf-8'),
self.client.get('/profile/').content
)
def test_profile_page_has_photo_count(self):
self.log_in()
self.assertIn(
b'Photos uploaded:',
self.client.get('/profile/').content
)
def test_profile_page_has_album_count(self):
self.log_in()
self.assertIn(b'Albums created:', self.client.get('/profile/').content)
class EditProfileTestCase(TestCase):
"""Edit profile test case."""
def setUp(self):
"""GET the route named edit_profile."""
self.user = User(username='test')
self.user.save()
self.client.force_login(self.user)
self.response = self.client.get(reverse('edit_profile'))
def test_status_code(self):
"""Test the status code for GETing edit_profile is 200."""
self.assertEqual(self.response.status_code, 200)
def test_edit_profile(self):
"""Test editing a album stores the updated value."""
new_camera_type = 'camera'
data = {
'camera_type': new_camera_type,
}
response = self.client.post(reverse('edit_profile'), data)
self.assertEqual(response.status_code, 302)
profile = UserProfile.objects.filter(user=self.user).first()
self.assertEqual(profile.camera_type, new_camera_type)
|
welliam/imagersite
|
user_profile/tests.py
|
Python
|
mit
| 2,830
|
<?php
global $artist;
global $nTrack;
$artist = $_REQUEST['artist'];
$nTrack = $_REQUEST['nTracks'];
if($artist=="") $artist= "Marillion";
if($nTrack=="") $nTrack = "10";
include('DAL.php');
$dal = new DAL();
$artistDOM = new DOMDocument('1.0', 'ISO-8859-1');
$url = "http://ws.audioscrobbler.com/2.0/?method=artist.gettoptags&artist=$artist&api_key=376b1cbc2794596f36e176f36784577f";
$dal->insertArtistRequest($url);
$artistDOM->load($url); //get ficheiro XML do artista
$artistDOM->save("xml/artTopTags.xml"); //guardar ficheiro
$artTags='xml/artTopTags.xml'; //carregar ficheiro XML
$artInfo=file_get_contents($artTags); //buscar conteudo do XML
$artObj=new simplexmlelement($artInfo); //cria um objecto a partir do XML
$artista= $artObj->toptags->attributes(); //get artista de acordo com a localizacao no ficheiro XML
?>
<!--processamento da table HTML-->
<table border="1" class="resultsTable">
<tr>
<?php
$nTrackAux = $nTrack;
foreach($artObj->toptags->tag as $tags){ //percorrer todas as tags
$tagName= $tags->name;//sem parenteses pq nao e atributo
$tagCount= $tags->count;//sem parenteses pq nao e atributo
if($tagCount == 0)
break;
$tagUrl= $tags->url;
?>
<td class="white" title="<?php
echo $tagCount;
if($tagCount == 1){echo " music";} else {echo " musics";}
// se a quantidade de musicas disponiveis pelos resultados da
// tag for menor que o numero que o utilizador introduziu de
// limite, este e substituido por esse novo limite.
if($tagCount < $nTrackAux)
$nTrackAux = $tagCount;
?>" onclick="MakeXMLHTTPCallTracks('<?php echo $tagName; ?>','<?php echo $nTrack; ?>');"><span><a href="#"><?php echo $tagName;?></a></span> </td>
</tr>
<?php
}?>
</table>
|
Thaenor/ARQSI_TP2
|
MusicStore/widget/ArtistTopTags.php
|
PHP
|
mit
| 2,250
|
<?php
return array(
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => 'mysql',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => '127.0.0.1',
'database' => 'doanvien',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'forge',
'username' => 'forge',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
),
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => array(
'cluster' => false,
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
),
);
|
TrinhThiThuyDung/member-group
|
app/config/database.php
|
PHP
|
mit
| 3,321
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.