text stringlengths 2 1.04M | meta dict |
|---|---|
require 'spec_helper'
describe "countries/show.html.erb" do
before(:each) do
assign(:country, @country = stub_model(Country,
:name => "MyString",
:abreviation => "MyString"
))
end
it "renders attributes in <p>" do
render
response.should contain("MyString")
response.should contain("MyString")
end
end
| {
"content_hash": "10f7b27854d3eb828deee9877c608018",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 51,
"avg_line_length": 21.4375,
"alnum_prop": 0.6501457725947521,
"repo_name": "bonsaiERP/bonsaiERP",
"id": "316e199d2d714da481a7e028d0f1ac61e5cfd426",
"size": "343",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "spec/views/countries/show.html.erb_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "45532"
},
{
"name": "CoffeeScript",
"bytes": "111746"
},
{
"name": "HTML",
"bytes": "415929"
},
{
"name": "JavaScript",
"bytes": "1672"
},
{
"name": "PLpgSQL",
"bytes": "211937"
},
{
"name": "Ruby",
"bytes": "879964"
},
{
"name": "Shell",
"bytes": "949"
}
],
"symlink_target": ""
} |
class "Challenge" {
name = "Generic"; -- name of the challenge. used to warn the player
delay = 0; -- delay time for challenge event after challenge start
duration = 0; -- how long the actual challenge lasts.
difficulty = 1; -- the difficulty of the challenge
elapsed = 0; -- the time the challenge is active
state = CHALLENGE_STATE_INACTIVE; -- needs to be set to true when challenge is finished
-- init a new challenge with a given difficulty
__init__ = function(self, difficulty)
self.difficulty = difficulty
end,
-- update the challenge. only used when challenge is active
update = function(self, dt)
if self.state == CHALLENGE_STATE_INACTIVE then
self.state = CHALLENGE_STATE_ACTIVE
end
self.elapsed = self.elapsed + dt
if self.elapsed > self.delay and self:isFinished() ~= true then
self:trigger()
end
if self.elapsed > self.duration + self.delay then
self.state = CHALLENGE_STATE_FINISHED
end
end,
-- triggers the challenge event
trigger = function(self)
end,
-- returns overall time needed
getDuration = function(self)
return self.delay + self.duration
end,
-- returns true when everything relevant to this challenge
-- was triggered
-- only used internally
isFinished = function(self)
return self.state == CHALLENGE_STATE_FINISHED
end
}
--list of all challenge types
challenge = {}
-- asteroids come in swarms and "attack" the ship from
-- one or more directions.
-- spawns a set of asteroids and hurls them in the
-- general direction of the ship. Is finished when
-- all waves of asteroids are launched
class "challenge.Asteroids" (Challenge) {
name = "Asteroids";
waves = nil; -- list of inidividual waves
current = 1; -- index of next wave to be triggered
-- init a new asteroid challenge
__init__ = function(self, difficulty)
self.difficulty = difficulty
self.delay = CHALLENGE_ASTEROID_DELAY
self.duration = CHALLENGE_ASTEROID_DURATION
-- define asteroid waves
self.waves = {}
for i=1,difficulty do
-- now add a number of asteroids to the wave
self.waves[i] = 3 + difficulty * 5
end
end,
-- launch a wave of asteroids
trigger = function(self, dt)
local side = math.random(0, 3) -- the side the asteroids are coming from
if side == 0 then side = 2 end -- front is more likely this way
for i=1,self.waves[self.current] do
-- define an asteroid that arrives from the front
local asteroid = objects.Asteroid(math.random(-1500, 1500),
-2000,
0,
math.random(-2, 2),
math.random(-3, 3),
math.random(300, 900),
math.random(1, self.difficulty))
-- now add the asteroid to the entities list
entities[asteroid.id] = asteroid
end
self.current = self.current + 1
end,
-- if all waves are launched, this challenge is finished
isFinished = function(self)
return self.waves[self.current] == nil
end
}
-- a "Nothing" is used as a buffer between challenges where nothing happens
class "Nothing" {
elapsed = 0;
duration = 0;
__init__ = function(self, value)
self.duration = value
self.elapsed = 0
end,
update = function(self, dt)
self.elapsed = self.elapsed + dt
end,
getDuration = function(self)
return self.duration
end
}
| {
"content_hash": "73d7e79c3a1e6ce8c21e1289e5bfe52b",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 91,
"avg_line_length": 28.978571428571428,
"alnum_prop": 0.5526250924328321,
"repo_name": "zorfmorf/loveprojects",
"id": "af50086a4ba0b2e83dda0caa1feae453c175f095",
"size": "4186",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "traderun/Client/model/challenge.lua",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "11780"
},
{
"name": "Lua",
"bytes": "605895"
},
{
"name": "Shell",
"bytes": "4715"
}
],
"symlink_target": ""
} |
<html lang="en"><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="A front-end template that helps you build fast, modern mobile web apps.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>bPlanner</title>
<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes">
<!--
<link rel="icon" sizes="192x192" href="images/android-desktop.png">
<meta name="apple-mobile-web-app-title" content="Material Design Lite">
<link rel="apple-touch-icon-precomposed" href="images/ios-desktop.png">
<meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
<link rel="shortcut icon" href="images/favicon.png">
-->
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Tile icon for Win8 (144x144 + tile color) -->
<meta name="msapplication-TileColor" content="#3372DF">
<link rel="stylesheet" href="assets/material.min.css">
<link rel="stylesheet" href="assets/style.css">
</head>
<body>
<div class="demo-layout mdl-layout mdl-js-layout mdl-layout--fixed-header mdl-color--grey-100" style="width:auto;height:auto;">
<header class="demo-header mdl-layout__header mdl-color--grey-100 mdl-color-text--grey-800">
<div class="mdl-layout__header-row">
<span class="mdl-layout-title">bPlanner</span>
<div class="mdl-layout-spacer"></div>
</div>
</header>
<div class="demo-ribbon"></div>
<main class="demo-main mdl-layout__content">
<div class="demo-container mdl-grid">
<div class="mdl-cell mdl-cell--2-col mdl-cell--hide-tablet mdl-cell--hide-phone"></div>
<div class="mdl-cell mdl-cell--8-col">
<?php if(!empty($pagemsg)){ ?>
<div class="mdl-card-style-alert mdl-card mdl-shadow--2dp<?php if(!empty($pagemsg_type)) echo ' ',$pagemsg_type; ?>">
<div class="mdl-card__supporting-text"><?php echo $pagemsg; ?></div>
</div>
<?php } ?> | {
"content_hash": "ffdd3b7b4d1269bc40c245aff9a4061a",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 128,
"avg_line_length": 43.458333333333336,
"alnum_prop": 0.6864813039309684,
"repo_name": "phy25/bPlanner",
"id": "94a6c3219d7641a1b1c52cdbc0061ea2b1ccae3b",
"size": "2086",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "header.inc.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "355768"
},
{
"name": "JavaScript",
"bytes": "144898"
},
{
"name": "PHP",
"bytes": "55088"
}
],
"symlink_target": ""
} |
class AddHumanReviewToArticle < ActiveRecord::Migration
def change
add_column :articles, :human_review, :boolean, default: true, null: false
end
end
| {
"content_hash": "0b3552a76256fa2f0e6d159ac4077368",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 77,
"avg_line_length": 31.4,
"alnum_prop": 0.7579617834394905,
"repo_name": "visoft/shuttle",
"id": "4d05d48611f1bc5941bf6a9ef2dcc51a308092a0",
"size": "157",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "db/migrate/20170508202319_add_human_review_to_article.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "97825"
},
{
"name": "CoffeeScript",
"bytes": "109599"
},
{
"name": "Dockerfile",
"bytes": "419"
},
{
"name": "HTML",
"bytes": "250744"
},
{
"name": "JavaScript",
"bytes": "3652"
},
{
"name": "Ruby",
"bytes": "1959316"
},
{
"name": "Shell",
"bytes": "525"
},
{
"name": "TSQL",
"bytes": "61227"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "10b916df25f54f76ce6fd5f4a9760933",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "cbd8db07ff4ba6eb2cd645360ae57b67c76b7eac",
"size": "184",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Imperata/Imperata cheesemanii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using SistemaAguaPotable.Core.Abstract.Data;
using SistemaAguaPotable.Core.Abstract.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SistemaAguaPotable.Services
{
public class UsuariosService:IUsuariosService //Hereda de los servicios alojados en el core
{
private IUsuariosRepository _UsuariosRepository;
private IRolesRepository _RolesRepository;
public UsuariosService(IUsuariosRepository UsuariosRepository, IRolesRepository RolesRepository)
{
_RolesRepository = RolesRepository;
_UsuariosRepository = UsuariosRepository;
}
public Core.Model.usuario GetUsuario(int codigo)
{
return _UsuariosRepository.GetUsuario(codigo);
}
public List<Core.Model.usuario> GetUsuarios()
{
/* List<Expression<Func<empleados, object>>> includes = new List<Expression<Func<empleados, object>>>();
includes.Add(x => x.tipoEmpleado);*/
return _UsuariosRepository.GetUsuarios();
}
public bool EliminarUsuario(int codigo)
{
return _UsuariosRepository.EliminarUsuario(codigo);
}
public Core.Model.usuario Guardar(Core.Model.usuario usuario)
{
string username = null;
if (usuario.codigo == 0) {
username = GenerarUserName(usuario.nombre, usuario.apellido);
usuario.activo = true;
usuario.usuario1 = username;
}
return _UsuariosRepository.Guardar(usuario);
}
public List<Core.Model.role> GetRoles()
{
return _RolesRepository.GetRoles();
}
#region metodosPrivado
private string GenerarUserName(string nombre, string apellido) {
int correlativo = _UsuariosRepository.conteoUsuarios();
correlativo = correlativo + 1;
string anio = DateTime.Now.ToString("yyyy").Substring(2,2);
string mes = DateTime.Now.ToString("MM");
string username = nombre.Substring(0, 1).ToUpper() + apellido.Substring(0,1).ToUpper() + mes+ anio + correlativo;
return username;
}
#endregion
}
}
| {
"content_hash": "3e00c93735714802eb79fc0404f26e31",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 125,
"avg_line_length": 29.375,
"alnum_prop": 0.6204255319148936,
"repo_name": "01Giovani/admProyectoAgua",
"id": "de764c17dc6f189d04b0ec23d6caab9a142c405b",
"size": "2352",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SistemaAguaPotable.Services/UsuariosService.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "113"
},
{
"name": "ActionScript",
"bytes": "32064"
},
{
"name": "C#",
"bytes": "204368"
},
{
"name": "CSS",
"bytes": "481873"
},
{
"name": "HTML",
"bytes": "33458"
},
{
"name": "JavaScript",
"bytes": "1910582"
},
{
"name": "PHP",
"bytes": "100282"
},
{
"name": "Shell",
"bytes": "3308"
}
],
"symlink_target": ""
} |
import flask, sqlite3
class Database:
def __init__(self, path):
self.path = path
self._connection = None
def connect(self):
if not self._connection:
self._connection = sqlite3.connect(self.path)
self._connection.row_factory = sqlite3.Row
return self._connection
def close(self):
if self._connection:
self._connection.close()
def query(self, query, args=(), one=False):
cur = self.connect().execute(query, args)
rv = cur.fetchall()
cur.close()
return (rv[0] if rv else None) if one else rv
def querymany(self, query, args):
cur = self.connect().executemany(query, args)
def commit(self):
self.connect().commit()
| {
"content_hash": "b910f0ca5c5c40bda00e234d059f041b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 48,
"avg_line_length": 22.586206896551722,
"alnum_prop": 0.6824427480916031,
"repo_name": "scizzorz/flaskplate",
"id": "27898d1e8d7104e99d1c96a03b8f35b404f0d9a8",
"size": "655",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "flaskplate/db.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "176"
},
{
"name": "JavaScript",
"bytes": "0"
},
{
"name": "Python",
"bytes": "1773"
}
],
"symlink_target": ""
} |
extern "C"
{
#endif
#define JAVA_LOADER_NAME "java"
#define INSTALL_NAME "azure_iot_gateway_sdk"
//=============================================================================
//Set Platform Specific Env Vars
//=============================================================================
#ifdef _WIN64
#define GET_PREFIX getenv("PROGRAMFILES")
#else
#ifdef WIN32
#define GET_PREFIX getenv("PROGRAMFILES(X86)")
#else
#define GET_PREFIX "/usr/local/lib"
#endif
#endif
#if WIN32
#define JAVA_BINDING_MODULE_NAME "java_module_host.dll"
#define MODULES_INSTALL_LOCATION "\\lib\\modules"
#define BINDINGS_INSTALL_LOCATION "\\lib\\bindings\\java\\classes"
#define SEPARATOR ";"
#define SLASH "\\"
#define PREFIXES
#ifdef UNDER_TEST
#define ENV_VARS
#else
#define ENV_VARS ,\
"PROGRAMFILES", \
"PROGRAMFILES(X86)"
#endif
#else
#define JAVA_BINDING_MODULE_NAME "libjava_module_host.so"
#define MODULES_INSTALL_LOCATION "/modules"
#define BINDINGS_INSTALL_LOCATION "/bindings/java/classes"
#define SEPARATOR ":"
#define SLASH "/"
#define PREFIXES , "/usr/local/lib"
#define ENV_VARS
#endif
#define ENTRYPOINT_CLASSNAME "class.name"
#define ENTRYPOINT_CLASSPATH "class.path"
#define JVM_OPTIONS_KEY "jvm.options"
typedef struct JAVA_LOADER_CONFIGURATION_TAG
{
MODULE_LOADER_BASE_CONFIGURATION base;
JVM_OPTIONS* options;
} JAVA_LOADER_CONFIGURATION;
typedef struct JAVA_LOADER_ENTRYPOINT_TAG
{
STRING_HANDLE className;
STRING_HANDLE classPath;
} JAVA_LOADER_ENTRYPOINT;
MOCKABLE_FUNCTION(, GATEWAY_EXPORT const MODULE_LOADER*, JavaLoader_Get);
#ifdef __cplusplus
}
#endif
#endif // JAVA_LOADER_H
| {
"content_hash": "3dd20f84ddd22d4c1eb1dc32f3eba01a",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 27.41176470588235,
"alnum_prop": 0.5842274678111588,
"repo_name": "tkopacz/2017IotHubGatewaySDK",
"id": "fcc11e91d0aab0c33ee62a5784340f70a0ad0187",
"size": "2309",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "INC/IotSdkGateway/module_loaders/java_loader.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "15736"
},
{
"name": "Batchfile",
"bytes": "471586"
},
{
"name": "BitBake",
"bytes": "1123"
},
{
"name": "C",
"bytes": "65875553"
},
{
"name": "C#",
"bytes": "1224952"
},
{
"name": "C++",
"bytes": "11003168"
},
{
"name": "CMake",
"bytes": "1368890"
},
{
"name": "CSS",
"bytes": "36685"
},
{
"name": "HTML",
"bytes": "371358"
},
{
"name": "Java",
"bytes": "32769"
},
{
"name": "JavaScript",
"bytes": "14357"
},
{
"name": "Makefile",
"bytes": "54863"
},
{
"name": "NSIS",
"bytes": "29628"
},
{
"name": "Objective-C",
"bytes": "10416"
},
{
"name": "Perl",
"bytes": "375756"
},
{
"name": "PowerShell",
"bytes": "21613"
},
{
"name": "Shell",
"bytes": "193113"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Ubisoldiers</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
| {
"content_hash": "4efa8005070082bbce5b1bc1091f0f21",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 69,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.6941580756013745,
"repo_name": "gobbisanches/ubisoldiers",
"id": "936e38aef6dc4e4e8307b0618e87ece72bdb83b5",
"size": "291",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/values/strings.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Groovy",
"bytes": "980"
},
{
"name": "Java",
"bytes": "99457"
}
],
"symlink_target": ""
} |
set -e # Exit with nonzero exit code if anything fails
START_TIME=$SECONDS
echo -n "NPM Version: " && npm --version
echo -n "Node Version: " && node --version
npm install
echo "Directory content after build:"
ls -al
ELAPSED_TIME=$(($SECONDS - $START_TIME))
echo "educama-supplier-simulator-backend Build & test duration: $ELAPSED_TIME seconds"
| {
"content_hash": "9596a2ca3f55c143aa1e893d4e3e0cb1",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 86,
"avg_line_length": 24.928571428571427,
"alnum_prop": 0.7191977077363897,
"repo_name": "eberhardheber/Showcase",
"id": "b2e082d87234c9b09748b0ddd38e7873f34f66c3",
"size": "369",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "services/educama-supplier-simulator-backend/build.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "15018"
},
{
"name": "CSS",
"bytes": "1765"
},
{
"name": "HTML",
"bytes": "29781"
},
{
"name": "Java",
"bytes": "154762"
},
{
"name": "JavaScript",
"bytes": "32962"
},
{
"name": "Shell",
"bytes": "24620"
},
{
"name": "TypeScript",
"bytes": "74107"
}
],
"symlink_target": ""
} |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MailBoxMigrator.Desktop.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
| {
"content_hash": "0f3b7e4c9bb0fe1c1b2959f2a302a764",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 151,
"avg_line_length": 35.8,
"alnum_prop": 0.5837988826815642,
"repo_name": "maxkimambo/MailBoxMigrator",
"id": "8612397a80c22fccb7c8397b3ab239ecc285fdd9",
"size": "1076",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MailBoxMigrator.Desktop/Properties/Settings.Designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "23409"
}
],
"symlink_target": ""
} |
use strict;
use warnings;
use Data::Dumper;
use Getopt::Long;
use File::Basename qw/fileparse dirname basename/;
use File::Copy qw/cp/;
use Bio::Perl;
use FindBin;
use lib "$FindBin::RealBin/../lib";
use LyveSET qw/@fastqExt logmsg/;
$0=fileparse $0;
exit(main());
sub main{
my $settings={};
GetOptions($settings,qw(help reference=s fastq=s bam=s bwaxopts=s tempdir=s numcpus=i pairedend=i minPercentIdentity=i)) or die $!;
$$settings{numcpus}||=1;
$$settings{tempdir}||="tmp";
$$settings{pairedend}||=0;
$$settings{minPercentIdentity}||=95;
$$settings{minPercentIdentity}=sprintf("%0.2f",$$settings{minPercentIdentity}/100);
# bwa extra options
$$settings{bwaxopts}||="";
$$settings{bwaxopts} .="-t $$settings{numcpus}";
for(qw(reference fastq bam)){
die "ERROR: need option $_\n".usage($settings) if(!$$settings{$_});
}
die usage($settings) if($$settings{help});
mkdir $$settings{tempdir} if(!-d $$settings{tempdir});
my $fastq=$$settings{fastq};
my $bam=$$settings{bam};
my $reference=$$settings{reference};
$$settings{refdir}||=dirname($reference);
# Check if the reference genome was indexed.
# I think it has to die and not index the genome just in case other
# instances of this script are trying to do the same thing.
for my $indexFile("$reference.bwt","$reference.amb","$reference.ann", "$reference.pac"){
die "ERROR: Could not find $indexFile, which makes me think that the reference genome has not been indexed with `bwa index`." if(!-e $indexFile);
}
mapReads($fastq,$bam,$reference,$settings);
return 0;
}
sub mapReads{
my($query,$bam,$ref,$settings)=@_;
if(-s "$bam"){
logmsg "Found $bam\n I will not re-map.";
return 1;
}
my ($b,$infilePath,$infileExt)=fileparse($query,@fastqExt);
my $prefix="$$settings{tempdir}/$b";
my $RANDOM=rand(999999);
my $tmpOut="$bam.$RANDOM.tmp";
my $tmpSamOut="$prefix.tmp.sam";
logmsg "$bam not found. I'm really doing the mapping now!\n Outfile: $tmpOut";
# Find out if there is a set of coordinates to use
my $regions="$$settings{refdir}/unmaskedRegions.bed";
if(-e $regions && -s $regions > 0){
logmsg "Found bed file of regions to accept and so I am using it! $regions";
$$settings{samtoolsxopts}.="-L $regions ";
}
#$$settings{samtoolsxopts}.="-F 4 "; # only keep mapped reads to save on space
# PE reads or not? Mapping differently for different types.
if(is_fastqPE($query,$settings)){
# deshuffle the reads
logmsg "Deshuffling to $prefix.1.fastq and $prefix.2.fastq";
system("run_assembly_shuffleReads.pl -d '$query' 1>'$prefix.1.fastq' 2>'$prefix.2.fastq'");
die "Problem with deshuffling reads! I am assuming paired end reads." if $?;
# Mapping
system("bwa mem $$settings{bwaxopts} $ref '$prefix.1.fastq' '$prefix.2.fastq' > $tmpSamOut");
die if $?;
system("rm -v '$prefix.1.fastq' '$prefix.2.fastq'"); die if $?;
} else {
# Need to think about gzip vs un-gzipped files
if($infileExt=~/\.gz$/){
system("gunzip -c '$query' > $prefix.SE.fastq");
die "Problem gunzipping $query to $prefix.SE.fastq" if $?;
} else {
cp($query,"$prefix.SE.fastq")
or die "ERROR: could not copy to $prefix.SE.fastq";
}
# Mapping
system("bwa mem $$settings{bwaxopts} $ref '$prefix.SE.fastq' > $tmpSamOut");
die if $?;
system("rm -v '$prefix.SE.fastq'"); die if $?;
}
# Convert to bam
system("samtools view $$settings{samtoolsxopts} -bS -T $ref $tmpSamOut > $tmpOut");
die "ERROR with samtools view $$settings{samtoolsxopts}" if $?;
logmsg "Transforming the output file with samtools";
my $sPrefix="$tmpOut.sorted";
my $sorted="$sPrefix.bam"; # samtools adds the bam later, so I want to keep track of it
logmsg "Sorting the temporary bam file into $sorted";
my $sortCommand="samtools sort -o $sorted $tmpOut";
system("$sortCommand 2>&1"); die "ERROR with '$sortCommand'" if $?;
system("samtools index $sorted 2>&1"); die "ERROR with 'samtools index $sorted'" if $?;
system("set_samtools_depth.pl $sorted 2>&1");
die if $?;
# cleanup
system("mv -v $sorted $bam"); die if $?;
system("mv -v $sorted.bai $bam.bai"); die if $?;
unlink("$sorted.depth.gz");
system("rm -v $tmpOut $tmpSamOut"); die if $?;
return 1;
}
# Use CGP to determine if a file is PE or not
# settings: checkFirst is an integer to check the first X deflines
sub is_fastqPE($;$){
my($fastq,$settings)=@_;
# If PE was specified, return true for the value 2 (PE)
# and 0 for the value 1 (SE)
if($$settings{pairedend}){
return ($$settings{pairedend}-1);
}
# if checkFirst is undef or 0, this will cause it to check at least the first 50 entries.
# 50 reads is probably enough to make sure that it's shuffled (1/2^25 chance I'm wrong)
$$settings{checkFirst}||=50;
$$settings{checkFirst}=50 if($$settings{checkFirst}<2);
my $is_PE=`run_assembly_isFastqPE.pl '$fastq' --checkfirst $$settings{checkFirst}`;
chomp($is_PE);
return $is_PE;
}
sub usage{
my($settings)=@_;
"Maps a read set against a reference genome using bwa. Output file will be file.bam and file.bam.depth
Usage: $0 -f file.fastq -b file.bam -t tmp/ -r reference.fasta
-t tmp to set the temporary directory as 'tmp'
--numcpus 1 number of cpus to use
-s '' Extra bwa map options (not validated). Default: $$settings{bwaxopts}
--pairedend <0|1|2> For 'auto', single-end, or paired-end respectively. Default: auto (0).
--minPercentIdentity 95 The percent identity between a read and its match before it can be mapped
"
}
| {
"content_hash": "7709e2561a1be8898dda472ebb341cbf",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 149,
"avg_line_length": 34.9375,
"alnum_prop": 0.6618962432915921,
"repo_name": "lskatz/lyve-SET",
"id": "e97f104e86b26d873527b89b574541aa5255eef8",
"size": "5611",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "scripts/launch_bwa.pl",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "9733"
},
{
"name": "Perl",
"bytes": "606242"
},
{
"name": "Python",
"bytes": "2241"
},
{
"name": "Shell",
"bytes": "16202"
}
],
"symlink_target": ""
} |
package org.lwjgl.vulkan.video;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* <h3>Layout</h3>
*
* <pre><code>
* struct StdVideoH265SequenceParameterSetVui {
* {@link StdVideoH265SpsVuiFlags StdVideoH265SpsVuiFlags} flags;
* StdVideoH265AspectRatioIdc aspect_ratio_idc;
* uint16_t sar_width;
* uint16_t sar_height;
* uint8_t video_format;
* uint8_t colour_primaries;
* uint8_t transfer_characteristics;
* uint8_t matrix_coeffs;
* uint8_t chroma_sample_loc_type_top_field;
* uint8_t chroma_sample_loc_type_bottom_field;
* uint8_t reserved1;
* uint8_t reserved2;
* uint16_t def_disp_win_left_offset;
* uint16_t def_disp_win_right_offset;
* uint16_t def_disp_win_top_offset;
* uint16_t def_disp_win_bottom_offset;
* uint32_t vui_num_units_in_tick;
* uint32_t vui_time_scale;
* uint32_t vui_num_ticks_poc_diff_one_minus1;
* uint16_t min_spatial_segmentation_idc;
* uint16_t reserved3;
* uint8_t max_bytes_per_pic_denom;
* uint8_t max_bits_per_min_cu_denom;
* uint8_t log2_max_mv_length_horizontal;
* uint8_t log2_max_mv_length_vertical;
* {@link StdVideoH265HrdParameters StdVideoH265HrdParameters} const * pHrdParameters;
* }</code></pre>
*/
public class StdVideoH265SequenceParameterSetVui extends Struct implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
FLAGS,
ASPECT_RATIO_IDC,
SAR_WIDTH,
SAR_HEIGHT,
VIDEO_FORMAT,
COLOUR_PRIMARIES,
TRANSFER_CHARACTERISTICS,
MATRIX_COEFFS,
CHROMA_SAMPLE_LOC_TYPE_TOP_FIELD,
CHROMA_SAMPLE_LOC_TYPE_BOTTOM_FIELD,
RESERVED1,
RESERVED2,
DEF_DISP_WIN_LEFT_OFFSET,
DEF_DISP_WIN_RIGHT_OFFSET,
DEF_DISP_WIN_TOP_OFFSET,
DEF_DISP_WIN_BOTTOM_OFFSET,
VUI_NUM_UNITS_IN_TICK,
VUI_TIME_SCALE,
VUI_NUM_TICKS_POC_DIFF_ONE_MINUS1,
MIN_SPATIAL_SEGMENTATION_IDC,
RESERVED3,
MAX_BYTES_PER_PIC_DENOM,
MAX_BITS_PER_MIN_CU_DENOM,
LOG2_MAX_MV_LENGTH_HORIZONTAL,
LOG2_MAX_MV_LENGTH_VERTICAL,
PHRDPARAMETERS;
static {
Layout layout = __struct(
__member(StdVideoH265SpsVuiFlags.SIZEOF, StdVideoH265SpsVuiFlags.ALIGNOF),
__member(4),
__member(2),
__member(2),
__member(1),
__member(1),
__member(1),
__member(1),
__member(1),
__member(1),
__member(1),
__member(1),
__member(2),
__member(2),
__member(2),
__member(2),
__member(4),
__member(4),
__member(4),
__member(2),
__member(2),
__member(1),
__member(1),
__member(1),
__member(1),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
FLAGS = layout.offsetof(0);
ASPECT_RATIO_IDC = layout.offsetof(1);
SAR_WIDTH = layout.offsetof(2);
SAR_HEIGHT = layout.offsetof(3);
VIDEO_FORMAT = layout.offsetof(4);
COLOUR_PRIMARIES = layout.offsetof(5);
TRANSFER_CHARACTERISTICS = layout.offsetof(6);
MATRIX_COEFFS = layout.offsetof(7);
CHROMA_SAMPLE_LOC_TYPE_TOP_FIELD = layout.offsetof(8);
CHROMA_SAMPLE_LOC_TYPE_BOTTOM_FIELD = layout.offsetof(9);
RESERVED1 = layout.offsetof(10);
RESERVED2 = layout.offsetof(11);
DEF_DISP_WIN_LEFT_OFFSET = layout.offsetof(12);
DEF_DISP_WIN_RIGHT_OFFSET = layout.offsetof(13);
DEF_DISP_WIN_TOP_OFFSET = layout.offsetof(14);
DEF_DISP_WIN_BOTTOM_OFFSET = layout.offsetof(15);
VUI_NUM_UNITS_IN_TICK = layout.offsetof(16);
VUI_TIME_SCALE = layout.offsetof(17);
VUI_NUM_TICKS_POC_DIFF_ONE_MINUS1 = layout.offsetof(18);
MIN_SPATIAL_SEGMENTATION_IDC = layout.offsetof(19);
RESERVED3 = layout.offsetof(20);
MAX_BYTES_PER_PIC_DENOM = layout.offsetof(21);
MAX_BITS_PER_MIN_CU_DENOM = layout.offsetof(22);
LOG2_MAX_MV_LENGTH_HORIZONTAL = layout.offsetof(23);
LOG2_MAX_MV_LENGTH_VERTICAL = layout.offsetof(24);
PHRDPARAMETERS = layout.offsetof(25);
}
/**
* Creates a {@code StdVideoH265SequenceParameterSetVui} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public StdVideoH265SequenceParameterSetVui(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link StdVideoH265SpsVuiFlags} view of the {@code flags} field. */
public StdVideoH265SpsVuiFlags flags() { return nflags(address()); }
/** @return the value of the {@code aspect_ratio_idc} field. */
@NativeType("StdVideoH265AspectRatioIdc")
public int aspect_ratio_idc() { return naspect_ratio_idc(address()); }
/** @return the value of the {@code sar_width} field. */
@NativeType("uint16_t")
public short sar_width() { return nsar_width(address()); }
/** @return the value of the {@code sar_height} field. */
@NativeType("uint16_t")
public short sar_height() { return nsar_height(address()); }
/** @return the value of the {@code video_format} field. */
@NativeType("uint8_t")
public byte video_format() { return nvideo_format(address()); }
/** @return the value of the {@code colour_primaries} field. */
@NativeType("uint8_t")
public byte colour_primaries() { return ncolour_primaries(address()); }
/** @return the value of the {@code transfer_characteristics} field. */
@NativeType("uint8_t")
public byte transfer_characteristics() { return ntransfer_characteristics(address()); }
/** @return the value of the {@code matrix_coeffs} field. */
@NativeType("uint8_t")
public byte matrix_coeffs() { return nmatrix_coeffs(address()); }
/** @return the value of the {@code chroma_sample_loc_type_top_field} field. */
@NativeType("uint8_t")
public byte chroma_sample_loc_type_top_field() { return nchroma_sample_loc_type_top_field(address()); }
/** @return the value of the {@code chroma_sample_loc_type_bottom_field} field. */
@NativeType("uint8_t")
public byte chroma_sample_loc_type_bottom_field() { return nchroma_sample_loc_type_bottom_field(address()); }
/** @return the value of the {@code def_disp_win_left_offset} field. */
@NativeType("uint16_t")
public short def_disp_win_left_offset() { return ndef_disp_win_left_offset(address()); }
/** @return the value of the {@code def_disp_win_right_offset} field. */
@NativeType("uint16_t")
public short def_disp_win_right_offset() { return ndef_disp_win_right_offset(address()); }
/** @return the value of the {@code def_disp_win_top_offset} field. */
@NativeType("uint16_t")
public short def_disp_win_top_offset() { return ndef_disp_win_top_offset(address()); }
/** @return the value of the {@code def_disp_win_bottom_offset} field. */
@NativeType("uint16_t")
public short def_disp_win_bottom_offset() { return ndef_disp_win_bottom_offset(address()); }
/** @return the value of the {@code vui_num_units_in_tick} field. */
@NativeType("uint32_t")
public int vui_num_units_in_tick() { return nvui_num_units_in_tick(address()); }
/** @return the value of the {@code vui_time_scale} field. */
@NativeType("uint32_t")
public int vui_time_scale() { return nvui_time_scale(address()); }
/** @return the value of the {@code vui_num_ticks_poc_diff_one_minus1} field. */
@NativeType("uint32_t")
public int vui_num_ticks_poc_diff_one_minus1() { return nvui_num_ticks_poc_diff_one_minus1(address()); }
/** @return the value of the {@code min_spatial_segmentation_idc} field. */
@NativeType("uint16_t")
public short min_spatial_segmentation_idc() { return nmin_spatial_segmentation_idc(address()); }
/** @return the value of the {@code max_bytes_per_pic_denom} field. */
@NativeType("uint8_t")
public byte max_bytes_per_pic_denom() { return nmax_bytes_per_pic_denom(address()); }
/** @return the value of the {@code max_bits_per_min_cu_denom} field. */
@NativeType("uint8_t")
public byte max_bits_per_min_cu_denom() { return nmax_bits_per_min_cu_denom(address()); }
/** @return the value of the {@code log2_max_mv_length_horizontal} field. */
@NativeType("uint8_t")
public byte log2_max_mv_length_horizontal() { return nlog2_max_mv_length_horizontal(address()); }
/** @return the value of the {@code log2_max_mv_length_vertical} field. */
@NativeType("uint8_t")
public byte log2_max_mv_length_vertical() { return nlog2_max_mv_length_vertical(address()); }
/** @return a {@link StdVideoH265HrdParameters} view of the struct pointed to by the {@code pHrdParameters} field. */
@NativeType("StdVideoH265HrdParameters const *")
public StdVideoH265HrdParameters pHrdParameters() { return npHrdParameters(address()); }
/** Copies the specified {@link StdVideoH265SpsVuiFlags} to the {@code flags} field. */
public StdVideoH265SequenceParameterSetVui flags(StdVideoH265SpsVuiFlags value) { nflags(address(), value); return this; }
/** Passes the {@code flags} field to the specified {@link java.util.function.Consumer Consumer}. */
public StdVideoH265SequenceParameterSetVui flags(java.util.function.Consumer<StdVideoH265SpsVuiFlags> consumer) { consumer.accept(flags()); return this; }
/** Sets the specified value to the {@code aspect_ratio_idc} field. */
public StdVideoH265SequenceParameterSetVui aspect_ratio_idc(@NativeType("StdVideoH265AspectRatioIdc") int value) { naspect_ratio_idc(address(), value); return this; }
/** Sets the specified value to the {@code sar_width} field. */
public StdVideoH265SequenceParameterSetVui sar_width(@NativeType("uint16_t") short value) { nsar_width(address(), value); return this; }
/** Sets the specified value to the {@code sar_height} field. */
public StdVideoH265SequenceParameterSetVui sar_height(@NativeType("uint16_t") short value) { nsar_height(address(), value); return this; }
/** Sets the specified value to the {@code video_format} field. */
public StdVideoH265SequenceParameterSetVui video_format(@NativeType("uint8_t") byte value) { nvideo_format(address(), value); return this; }
/** Sets the specified value to the {@code colour_primaries} field. */
public StdVideoH265SequenceParameterSetVui colour_primaries(@NativeType("uint8_t") byte value) { ncolour_primaries(address(), value); return this; }
/** Sets the specified value to the {@code transfer_characteristics} field. */
public StdVideoH265SequenceParameterSetVui transfer_characteristics(@NativeType("uint8_t") byte value) { ntransfer_characteristics(address(), value); return this; }
/** Sets the specified value to the {@code matrix_coeffs} field. */
public StdVideoH265SequenceParameterSetVui matrix_coeffs(@NativeType("uint8_t") byte value) { nmatrix_coeffs(address(), value); return this; }
/** Sets the specified value to the {@code chroma_sample_loc_type_top_field} field. */
public StdVideoH265SequenceParameterSetVui chroma_sample_loc_type_top_field(@NativeType("uint8_t") byte value) { nchroma_sample_loc_type_top_field(address(), value); return this; }
/** Sets the specified value to the {@code chroma_sample_loc_type_bottom_field} field. */
public StdVideoH265SequenceParameterSetVui chroma_sample_loc_type_bottom_field(@NativeType("uint8_t") byte value) { nchroma_sample_loc_type_bottom_field(address(), value); return this; }
/** Sets the specified value to the {@code def_disp_win_left_offset} field. */
public StdVideoH265SequenceParameterSetVui def_disp_win_left_offset(@NativeType("uint16_t") short value) { ndef_disp_win_left_offset(address(), value); return this; }
/** Sets the specified value to the {@code def_disp_win_right_offset} field. */
public StdVideoH265SequenceParameterSetVui def_disp_win_right_offset(@NativeType("uint16_t") short value) { ndef_disp_win_right_offset(address(), value); return this; }
/** Sets the specified value to the {@code def_disp_win_top_offset} field. */
public StdVideoH265SequenceParameterSetVui def_disp_win_top_offset(@NativeType("uint16_t") short value) { ndef_disp_win_top_offset(address(), value); return this; }
/** Sets the specified value to the {@code def_disp_win_bottom_offset} field. */
public StdVideoH265SequenceParameterSetVui def_disp_win_bottom_offset(@NativeType("uint16_t") short value) { ndef_disp_win_bottom_offset(address(), value); return this; }
/** Sets the specified value to the {@code vui_num_units_in_tick} field. */
public StdVideoH265SequenceParameterSetVui vui_num_units_in_tick(@NativeType("uint32_t") int value) { nvui_num_units_in_tick(address(), value); return this; }
/** Sets the specified value to the {@code vui_time_scale} field. */
public StdVideoH265SequenceParameterSetVui vui_time_scale(@NativeType("uint32_t") int value) { nvui_time_scale(address(), value); return this; }
/** Sets the specified value to the {@code vui_num_ticks_poc_diff_one_minus1} field. */
public StdVideoH265SequenceParameterSetVui vui_num_ticks_poc_diff_one_minus1(@NativeType("uint32_t") int value) { nvui_num_ticks_poc_diff_one_minus1(address(), value); return this; }
/** Sets the specified value to the {@code min_spatial_segmentation_idc} field. */
public StdVideoH265SequenceParameterSetVui min_spatial_segmentation_idc(@NativeType("uint16_t") short value) { nmin_spatial_segmentation_idc(address(), value); return this; }
/** Sets the specified value to the {@code max_bytes_per_pic_denom} field. */
public StdVideoH265SequenceParameterSetVui max_bytes_per_pic_denom(@NativeType("uint8_t") byte value) { nmax_bytes_per_pic_denom(address(), value); return this; }
/** Sets the specified value to the {@code max_bits_per_min_cu_denom} field. */
public StdVideoH265SequenceParameterSetVui max_bits_per_min_cu_denom(@NativeType("uint8_t") byte value) { nmax_bits_per_min_cu_denom(address(), value); return this; }
/** Sets the specified value to the {@code log2_max_mv_length_horizontal} field. */
public StdVideoH265SequenceParameterSetVui log2_max_mv_length_horizontal(@NativeType("uint8_t") byte value) { nlog2_max_mv_length_horizontal(address(), value); return this; }
/** Sets the specified value to the {@code log2_max_mv_length_vertical} field. */
public StdVideoH265SequenceParameterSetVui log2_max_mv_length_vertical(@NativeType("uint8_t") byte value) { nlog2_max_mv_length_vertical(address(), value); return this; }
/** Sets the address of the specified {@link StdVideoH265HrdParameters} to the {@code pHrdParameters} field. */
public StdVideoH265SequenceParameterSetVui pHrdParameters(@NativeType("StdVideoH265HrdParameters const *") StdVideoH265HrdParameters value) { npHrdParameters(address(), value); return this; }
/** Initializes this struct with the specified values. */
public StdVideoH265SequenceParameterSetVui set(
StdVideoH265SpsVuiFlags flags,
int aspect_ratio_idc,
short sar_width,
short sar_height,
byte video_format,
byte colour_primaries,
byte transfer_characteristics,
byte matrix_coeffs,
byte chroma_sample_loc_type_top_field,
byte chroma_sample_loc_type_bottom_field,
short def_disp_win_left_offset,
short def_disp_win_right_offset,
short def_disp_win_top_offset,
short def_disp_win_bottom_offset,
int vui_num_units_in_tick,
int vui_time_scale,
int vui_num_ticks_poc_diff_one_minus1,
short min_spatial_segmentation_idc,
byte max_bytes_per_pic_denom,
byte max_bits_per_min_cu_denom,
byte log2_max_mv_length_horizontal,
byte log2_max_mv_length_vertical,
StdVideoH265HrdParameters pHrdParameters
) {
flags(flags);
aspect_ratio_idc(aspect_ratio_idc);
sar_width(sar_width);
sar_height(sar_height);
video_format(video_format);
colour_primaries(colour_primaries);
transfer_characteristics(transfer_characteristics);
matrix_coeffs(matrix_coeffs);
chroma_sample_loc_type_top_field(chroma_sample_loc_type_top_field);
chroma_sample_loc_type_bottom_field(chroma_sample_loc_type_bottom_field);
def_disp_win_left_offset(def_disp_win_left_offset);
def_disp_win_right_offset(def_disp_win_right_offset);
def_disp_win_top_offset(def_disp_win_top_offset);
def_disp_win_bottom_offset(def_disp_win_bottom_offset);
vui_num_units_in_tick(vui_num_units_in_tick);
vui_time_scale(vui_time_scale);
vui_num_ticks_poc_diff_one_minus1(vui_num_ticks_poc_diff_one_minus1);
min_spatial_segmentation_idc(min_spatial_segmentation_idc);
max_bytes_per_pic_denom(max_bytes_per_pic_denom);
max_bits_per_min_cu_denom(max_bits_per_min_cu_denom);
log2_max_mv_length_horizontal(log2_max_mv_length_horizontal);
log2_max_mv_length_vertical(log2_max_mv_length_vertical);
pHrdParameters(pHrdParameters);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public StdVideoH265SequenceParameterSetVui set(StdVideoH265SequenceParameterSetVui src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code StdVideoH265SequenceParameterSetVui} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static StdVideoH265SequenceParameterSetVui malloc() {
return wrap(StdVideoH265SequenceParameterSetVui.class, nmemAllocChecked(SIZEOF));
}
/** Returns a new {@code StdVideoH265SequenceParameterSetVui} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static StdVideoH265SequenceParameterSetVui calloc() {
return wrap(StdVideoH265SequenceParameterSetVui.class, nmemCallocChecked(1, SIZEOF));
}
/** Returns a new {@code StdVideoH265SequenceParameterSetVui} instance allocated with {@link BufferUtils}. */
public static StdVideoH265SequenceParameterSetVui create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return wrap(StdVideoH265SequenceParameterSetVui.class, memAddress(container), container);
}
/** Returns a new {@code StdVideoH265SequenceParameterSetVui} instance for the specified memory address. */
public static StdVideoH265SequenceParameterSetVui create(long address) {
return wrap(StdVideoH265SequenceParameterSetVui.class, address);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static StdVideoH265SequenceParameterSetVui createSafe(long address) {
return address == NULL ? null : wrap(StdVideoH265SequenceParameterSetVui.class, address);
}
/**
* Returns a new {@link StdVideoH265SequenceParameterSetVui.Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static StdVideoH265SequenceParameterSetVui.Buffer malloc(int capacity) {
return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link StdVideoH265SequenceParameterSetVui.Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static StdVideoH265SequenceParameterSetVui.Buffer calloc(int capacity) {
return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link StdVideoH265SequenceParameterSetVui.Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static StdVideoH265SequenceParameterSetVui.Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return wrap(Buffer.class, memAddress(container), capacity, container);
}
/**
* Create a {@link StdVideoH265SequenceParameterSetVui.Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static StdVideoH265SequenceParameterSetVui.Buffer create(long address, int capacity) {
return wrap(Buffer.class, address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static StdVideoH265SequenceParameterSetVui.Buffer createSafe(long address, int capacity) {
return address == NULL ? null : wrap(Buffer.class, address, capacity);
}
/**
* Returns a new {@code StdVideoH265SequenceParameterSetVui} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static StdVideoH265SequenceParameterSetVui malloc(MemoryStack stack) {
return wrap(StdVideoH265SequenceParameterSetVui.class, stack.nmalloc(ALIGNOF, SIZEOF));
}
/**
* Returns a new {@code StdVideoH265SequenceParameterSetVui} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static StdVideoH265SequenceParameterSetVui calloc(MemoryStack stack) {
return wrap(StdVideoH265SequenceParameterSetVui.class, stack.ncalloc(ALIGNOF, 1, SIZEOF));
}
/**
* Returns a new {@link StdVideoH265SequenceParameterSetVui.Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static StdVideoH265SequenceParameterSetVui.Buffer malloc(int capacity, MemoryStack stack) {
return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link StdVideoH265SequenceParameterSetVui.Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static StdVideoH265SequenceParameterSetVui.Buffer calloc(int capacity, MemoryStack stack) {
return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #flags}. */
public static StdVideoH265SpsVuiFlags nflags(long struct) { return StdVideoH265SpsVuiFlags.create(struct + StdVideoH265SequenceParameterSetVui.FLAGS); }
/** Unsafe version of {@link #aspect_ratio_idc}. */
public static int naspect_ratio_idc(long struct) { return UNSAFE.getInt(null, struct + StdVideoH265SequenceParameterSetVui.ASPECT_RATIO_IDC); }
/** Unsafe version of {@link #sar_width}. */
public static short nsar_width(long struct) { return UNSAFE.getShort(null, struct + StdVideoH265SequenceParameterSetVui.SAR_WIDTH); }
/** Unsafe version of {@link #sar_height}. */
public static short nsar_height(long struct) { return UNSAFE.getShort(null, struct + StdVideoH265SequenceParameterSetVui.SAR_HEIGHT); }
/** Unsafe version of {@link #video_format}. */
public static byte nvideo_format(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.VIDEO_FORMAT); }
/** Unsafe version of {@link #colour_primaries}. */
public static byte ncolour_primaries(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.COLOUR_PRIMARIES); }
/** Unsafe version of {@link #transfer_characteristics}. */
public static byte ntransfer_characteristics(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.TRANSFER_CHARACTERISTICS); }
/** Unsafe version of {@link #matrix_coeffs}. */
public static byte nmatrix_coeffs(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.MATRIX_COEFFS); }
/** Unsafe version of {@link #chroma_sample_loc_type_top_field}. */
public static byte nchroma_sample_loc_type_top_field(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.CHROMA_SAMPLE_LOC_TYPE_TOP_FIELD); }
/** Unsafe version of {@link #chroma_sample_loc_type_bottom_field}. */
public static byte nchroma_sample_loc_type_bottom_field(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.CHROMA_SAMPLE_LOC_TYPE_BOTTOM_FIELD); }
public static byte nreserved1(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.RESERVED1); }
public static byte nreserved2(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.RESERVED2); }
/** Unsafe version of {@link #def_disp_win_left_offset}. */
public static short ndef_disp_win_left_offset(long struct) { return UNSAFE.getShort(null, struct + StdVideoH265SequenceParameterSetVui.DEF_DISP_WIN_LEFT_OFFSET); }
/** Unsafe version of {@link #def_disp_win_right_offset}. */
public static short ndef_disp_win_right_offset(long struct) { return UNSAFE.getShort(null, struct + StdVideoH265SequenceParameterSetVui.DEF_DISP_WIN_RIGHT_OFFSET); }
/** Unsafe version of {@link #def_disp_win_top_offset}. */
public static short ndef_disp_win_top_offset(long struct) { return UNSAFE.getShort(null, struct + StdVideoH265SequenceParameterSetVui.DEF_DISP_WIN_TOP_OFFSET); }
/** Unsafe version of {@link #def_disp_win_bottom_offset}. */
public static short ndef_disp_win_bottom_offset(long struct) { return UNSAFE.getShort(null, struct + StdVideoH265SequenceParameterSetVui.DEF_DISP_WIN_BOTTOM_OFFSET); }
/** Unsafe version of {@link #vui_num_units_in_tick}. */
public static int nvui_num_units_in_tick(long struct) { return UNSAFE.getInt(null, struct + StdVideoH265SequenceParameterSetVui.VUI_NUM_UNITS_IN_TICK); }
/** Unsafe version of {@link #vui_time_scale}. */
public static int nvui_time_scale(long struct) { return UNSAFE.getInt(null, struct + StdVideoH265SequenceParameterSetVui.VUI_TIME_SCALE); }
/** Unsafe version of {@link #vui_num_ticks_poc_diff_one_minus1}. */
public static int nvui_num_ticks_poc_diff_one_minus1(long struct) { return UNSAFE.getInt(null, struct + StdVideoH265SequenceParameterSetVui.VUI_NUM_TICKS_POC_DIFF_ONE_MINUS1); }
/** Unsafe version of {@link #min_spatial_segmentation_idc}. */
public static short nmin_spatial_segmentation_idc(long struct) { return UNSAFE.getShort(null, struct + StdVideoH265SequenceParameterSetVui.MIN_SPATIAL_SEGMENTATION_IDC); }
public static short nreserved3(long struct) { return UNSAFE.getShort(null, struct + StdVideoH265SequenceParameterSetVui.RESERVED3); }
/** Unsafe version of {@link #max_bytes_per_pic_denom}. */
public static byte nmax_bytes_per_pic_denom(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.MAX_BYTES_PER_PIC_DENOM); }
/** Unsafe version of {@link #max_bits_per_min_cu_denom}. */
public static byte nmax_bits_per_min_cu_denom(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.MAX_BITS_PER_MIN_CU_DENOM); }
/** Unsafe version of {@link #log2_max_mv_length_horizontal}. */
public static byte nlog2_max_mv_length_horizontal(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.LOG2_MAX_MV_LENGTH_HORIZONTAL); }
/** Unsafe version of {@link #log2_max_mv_length_vertical}. */
public static byte nlog2_max_mv_length_vertical(long struct) { return UNSAFE.getByte(null, struct + StdVideoH265SequenceParameterSetVui.LOG2_MAX_MV_LENGTH_VERTICAL); }
/** Unsafe version of {@link #pHrdParameters}. */
public static StdVideoH265HrdParameters npHrdParameters(long struct) { return StdVideoH265HrdParameters.create(memGetAddress(struct + StdVideoH265SequenceParameterSetVui.PHRDPARAMETERS)); }
/** Unsafe version of {@link #flags(StdVideoH265SpsVuiFlags) flags}. */
public static void nflags(long struct, StdVideoH265SpsVuiFlags value) { memCopy(value.address(), struct + StdVideoH265SequenceParameterSetVui.FLAGS, StdVideoH265SpsVuiFlags.SIZEOF); }
/** Unsafe version of {@link #aspect_ratio_idc(int) aspect_ratio_idc}. */
public static void naspect_ratio_idc(long struct, int value) { UNSAFE.putInt(null, struct + StdVideoH265SequenceParameterSetVui.ASPECT_RATIO_IDC, value); }
/** Unsafe version of {@link #sar_width(short) sar_width}. */
public static void nsar_width(long struct, short value) { UNSAFE.putShort(null, struct + StdVideoH265SequenceParameterSetVui.SAR_WIDTH, value); }
/** Unsafe version of {@link #sar_height(short) sar_height}. */
public static void nsar_height(long struct, short value) { UNSAFE.putShort(null, struct + StdVideoH265SequenceParameterSetVui.SAR_HEIGHT, value); }
/** Unsafe version of {@link #video_format(byte) video_format}. */
public static void nvideo_format(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.VIDEO_FORMAT, value); }
/** Unsafe version of {@link #colour_primaries(byte) colour_primaries}. */
public static void ncolour_primaries(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.COLOUR_PRIMARIES, value); }
/** Unsafe version of {@link #transfer_characteristics(byte) transfer_characteristics}. */
public static void ntransfer_characteristics(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.TRANSFER_CHARACTERISTICS, value); }
/** Unsafe version of {@link #matrix_coeffs(byte) matrix_coeffs}. */
public static void nmatrix_coeffs(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.MATRIX_COEFFS, value); }
/** Unsafe version of {@link #chroma_sample_loc_type_top_field(byte) chroma_sample_loc_type_top_field}. */
public static void nchroma_sample_loc_type_top_field(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.CHROMA_SAMPLE_LOC_TYPE_TOP_FIELD, value); }
/** Unsafe version of {@link #chroma_sample_loc_type_bottom_field(byte) chroma_sample_loc_type_bottom_field}. */
public static void nchroma_sample_loc_type_bottom_field(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.CHROMA_SAMPLE_LOC_TYPE_BOTTOM_FIELD, value); }
public static void nreserved1(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.RESERVED1, value); }
public static void nreserved2(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.RESERVED2, value); }
/** Unsafe version of {@link #def_disp_win_left_offset(short) def_disp_win_left_offset}. */
public static void ndef_disp_win_left_offset(long struct, short value) { UNSAFE.putShort(null, struct + StdVideoH265SequenceParameterSetVui.DEF_DISP_WIN_LEFT_OFFSET, value); }
/** Unsafe version of {@link #def_disp_win_right_offset(short) def_disp_win_right_offset}. */
public static void ndef_disp_win_right_offset(long struct, short value) { UNSAFE.putShort(null, struct + StdVideoH265SequenceParameterSetVui.DEF_DISP_WIN_RIGHT_OFFSET, value); }
/** Unsafe version of {@link #def_disp_win_top_offset(short) def_disp_win_top_offset}. */
public static void ndef_disp_win_top_offset(long struct, short value) { UNSAFE.putShort(null, struct + StdVideoH265SequenceParameterSetVui.DEF_DISP_WIN_TOP_OFFSET, value); }
/** Unsafe version of {@link #def_disp_win_bottom_offset(short) def_disp_win_bottom_offset}. */
public static void ndef_disp_win_bottom_offset(long struct, short value) { UNSAFE.putShort(null, struct + StdVideoH265SequenceParameterSetVui.DEF_DISP_WIN_BOTTOM_OFFSET, value); }
/** Unsafe version of {@link #vui_num_units_in_tick(int) vui_num_units_in_tick}. */
public static void nvui_num_units_in_tick(long struct, int value) { UNSAFE.putInt(null, struct + StdVideoH265SequenceParameterSetVui.VUI_NUM_UNITS_IN_TICK, value); }
/** Unsafe version of {@link #vui_time_scale(int) vui_time_scale}. */
public static void nvui_time_scale(long struct, int value) { UNSAFE.putInt(null, struct + StdVideoH265SequenceParameterSetVui.VUI_TIME_SCALE, value); }
/** Unsafe version of {@link #vui_num_ticks_poc_diff_one_minus1(int) vui_num_ticks_poc_diff_one_minus1}. */
public static void nvui_num_ticks_poc_diff_one_minus1(long struct, int value) { UNSAFE.putInt(null, struct + StdVideoH265SequenceParameterSetVui.VUI_NUM_TICKS_POC_DIFF_ONE_MINUS1, value); }
/** Unsafe version of {@link #min_spatial_segmentation_idc(short) min_spatial_segmentation_idc}. */
public static void nmin_spatial_segmentation_idc(long struct, short value) { UNSAFE.putShort(null, struct + StdVideoH265SequenceParameterSetVui.MIN_SPATIAL_SEGMENTATION_IDC, value); }
public static void nreserved3(long struct, short value) { UNSAFE.putShort(null, struct + StdVideoH265SequenceParameterSetVui.RESERVED3, value); }
/** Unsafe version of {@link #max_bytes_per_pic_denom(byte) max_bytes_per_pic_denom}. */
public static void nmax_bytes_per_pic_denom(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.MAX_BYTES_PER_PIC_DENOM, value); }
/** Unsafe version of {@link #max_bits_per_min_cu_denom(byte) max_bits_per_min_cu_denom}. */
public static void nmax_bits_per_min_cu_denom(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.MAX_BITS_PER_MIN_CU_DENOM, value); }
/** Unsafe version of {@link #log2_max_mv_length_horizontal(byte) log2_max_mv_length_horizontal}. */
public static void nlog2_max_mv_length_horizontal(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.LOG2_MAX_MV_LENGTH_HORIZONTAL, value); }
/** Unsafe version of {@link #log2_max_mv_length_vertical(byte) log2_max_mv_length_vertical}. */
public static void nlog2_max_mv_length_vertical(long struct, byte value) { UNSAFE.putByte(null, struct + StdVideoH265SequenceParameterSetVui.LOG2_MAX_MV_LENGTH_VERTICAL, value); }
/** Unsafe version of {@link #pHrdParameters(StdVideoH265HrdParameters) pHrdParameters}. */
public static void npHrdParameters(long struct, StdVideoH265HrdParameters value) { memPutAddress(struct + StdVideoH265SequenceParameterSetVui.PHRDPARAMETERS, value.address()); }
/**
* Validates pointer members that should not be {@code NULL}.
*
* @param struct the struct to validate
*/
public static void validate(long struct) {
long pHrdParameters = memGetAddress(struct + StdVideoH265SequenceParameterSetVui.PHRDPARAMETERS);
check(pHrdParameters);
StdVideoH265HrdParameters.validate(pHrdParameters);
}
// -----------------------------------
/** An array of {@link StdVideoH265SequenceParameterSetVui} structs. */
public static class Buffer extends StructBuffer<StdVideoH265SequenceParameterSetVui, Buffer> implements NativeResource {
private static final StdVideoH265SequenceParameterSetVui ELEMENT_FACTORY = StdVideoH265SequenceParameterSetVui.create(-1L);
/**
* Creates a new {@code StdVideoH265SequenceParameterSetVui.Buffer} instance backed by the specified container.
*
* Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link StdVideoH265SequenceParameterSetVui#SIZEOF}, and its mark will be undefined.
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected StdVideoH265SequenceParameterSetVui getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link StdVideoH265SpsVuiFlags} view of the {@code flags} field. */
public StdVideoH265SpsVuiFlags flags() { return StdVideoH265SequenceParameterSetVui.nflags(address()); }
/** @return the value of the {@code aspect_ratio_idc} field. */
@NativeType("StdVideoH265AspectRatioIdc")
public int aspect_ratio_idc() { return StdVideoH265SequenceParameterSetVui.naspect_ratio_idc(address()); }
/** @return the value of the {@code sar_width} field. */
@NativeType("uint16_t")
public short sar_width() { return StdVideoH265SequenceParameterSetVui.nsar_width(address()); }
/** @return the value of the {@code sar_height} field. */
@NativeType("uint16_t")
public short sar_height() { return StdVideoH265SequenceParameterSetVui.nsar_height(address()); }
/** @return the value of the {@code video_format} field. */
@NativeType("uint8_t")
public byte video_format() { return StdVideoH265SequenceParameterSetVui.nvideo_format(address()); }
/** @return the value of the {@code colour_primaries} field. */
@NativeType("uint8_t")
public byte colour_primaries() { return StdVideoH265SequenceParameterSetVui.ncolour_primaries(address()); }
/** @return the value of the {@code transfer_characteristics} field. */
@NativeType("uint8_t")
public byte transfer_characteristics() { return StdVideoH265SequenceParameterSetVui.ntransfer_characteristics(address()); }
/** @return the value of the {@code matrix_coeffs} field. */
@NativeType("uint8_t")
public byte matrix_coeffs() { return StdVideoH265SequenceParameterSetVui.nmatrix_coeffs(address()); }
/** @return the value of the {@code chroma_sample_loc_type_top_field} field. */
@NativeType("uint8_t")
public byte chroma_sample_loc_type_top_field() { return StdVideoH265SequenceParameterSetVui.nchroma_sample_loc_type_top_field(address()); }
/** @return the value of the {@code chroma_sample_loc_type_bottom_field} field. */
@NativeType("uint8_t")
public byte chroma_sample_loc_type_bottom_field() { return StdVideoH265SequenceParameterSetVui.nchroma_sample_loc_type_bottom_field(address()); }
/** @return the value of the {@code def_disp_win_left_offset} field. */
@NativeType("uint16_t")
public short def_disp_win_left_offset() { return StdVideoH265SequenceParameterSetVui.ndef_disp_win_left_offset(address()); }
/** @return the value of the {@code def_disp_win_right_offset} field. */
@NativeType("uint16_t")
public short def_disp_win_right_offset() { return StdVideoH265SequenceParameterSetVui.ndef_disp_win_right_offset(address()); }
/** @return the value of the {@code def_disp_win_top_offset} field. */
@NativeType("uint16_t")
public short def_disp_win_top_offset() { return StdVideoH265SequenceParameterSetVui.ndef_disp_win_top_offset(address()); }
/** @return the value of the {@code def_disp_win_bottom_offset} field. */
@NativeType("uint16_t")
public short def_disp_win_bottom_offset() { return StdVideoH265SequenceParameterSetVui.ndef_disp_win_bottom_offset(address()); }
/** @return the value of the {@code vui_num_units_in_tick} field. */
@NativeType("uint32_t")
public int vui_num_units_in_tick() { return StdVideoH265SequenceParameterSetVui.nvui_num_units_in_tick(address()); }
/** @return the value of the {@code vui_time_scale} field. */
@NativeType("uint32_t")
public int vui_time_scale() { return StdVideoH265SequenceParameterSetVui.nvui_time_scale(address()); }
/** @return the value of the {@code vui_num_ticks_poc_diff_one_minus1} field. */
@NativeType("uint32_t")
public int vui_num_ticks_poc_diff_one_minus1() { return StdVideoH265SequenceParameterSetVui.nvui_num_ticks_poc_diff_one_minus1(address()); }
/** @return the value of the {@code min_spatial_segmentation_idc} field. */
@NativeType("uint16_t")
public short min_spatial_segmentation_idc() { return StdVideoH265SequenceParameterSetVui.nmin_spatial_segmentation_idc(address()); }
/** @return the value of the {@code max_bytes_per_pic_denom} field. */
@NativeType("uint8_t")
public byte max_bytes_per_pic_denom() { return StdVideoH265SequenceParameterSetVui.nmax_bytes_per_pic_denom(address()); }
/** @return the value of the {@code max_bits_per_min_cu_denom} field. */
@NativeType("uint8_t")
public byte max_bits_per_min_cu_denom() { return StdVideoH265SequenceParameterSetVui.nmax_bits_per_min_cu_denom(address()); }
/** @return the value of the {@code log2_max_mv_length_horizontal} field. */
@NativeType("uint8_t")
public byte log2_max_mv_length_horizontal() { return StdVideoH265SequenceParameterSetVui.nlog2_max_mv_length_horizontal(address()); }
/** @return the value of the {@code log2_max_mv_length_vertical} field. */
@NativeType("uint8_t")
public byte log2_max_mv_length_vertical() { return StdVideoH265SequenceParameterSetVui.nlog2_max_mv_length_vertical(address()); }
/** @return a {@link StdVideoH265HrdParameters} view of the struct pointed to by the {@code pHrdParameters} field. */
@NativeType("StdVideoH265HrdParameters const *")
public StdVideoH265HrdParameters pHrdParameters() { return StdVideoH265SequenceParameterSetVui.npHrdParameters(address()); }
/** Copies the specified {@link StdVideoH265SpsVuiFlags} to the {@code flags} field. */
public StdVideoH265SequenceParameterSetVui.Buffer flags(StdVideoH265SpsVuiFlags value) { StdVideoH265SequenceParameterSetVui.nflags(address(), value); return this; }
/** Passes the {@code flags} field to the specified {@link java.util.function.Consumer Consumer}. */
public StdVideoH265SequenceParameterSetVui.Buffer flags(java.util.function.Consumer<StdVideoH265SpsVuiFlags> consumer) { consumer.accept(flags()); return this; }
/** Sets the specified value to the {@code aspect_ratio_idc} field. */
public StdVideoH265SequenceParameterSetVui.Buffer aspect_ratio_idc(@NativeType("StdVideoH265AspectRatioIdc") int value) { StdVideoH265SequenceParameterSetVui.naspect_ratio_idc(address(), value); return this; }
/** Sets the specified value to the {@code sar_width} field. */
public StdVideoH265SequenceParameterSetVui.Buffer sar_width(@NativeType("uint16_t") short value) { StdVideoH265SequenceParameterSetVui.nsar_width(address(), value); return this; }
/** Sets the specified value to the {@code sar_height} field. */
public StdVideoH265SequenceParameterSetVui.Buffer sar_height(@NativeType("uint16_t") short value) { StdVideoH265SequenceParameterSetVui.nsar_height(address(), value); return this; }
/** Sets the specified value to the {@code video_format} field. */
public StdVideoH265SequenceParameterSetVui.Buffer video_format(@NativeType("uint8_t") byte value) { StdVideoH265SequenceParameterSetVui.nvideo_format(address(), value); return this; }
/** Sets the specified value to the {@code colour_primaries} field. */
public StdVideoH265SequenceParameterSetVui.Buffer colour_primaries(@NativeType("uint8_t") byte value) { StdVideoH265SequenceParameterSetVui.ncolour_primaries(address(), value); return this; }
/** Sets the specified value to the {@code transfer_characteristics} field. */
public StdVideoH265SequenceParameterSetVui.Buffer transfer_characteristics(@NativeType("uint8_t") byte value) { StdVideoH265SequenceParameterSetVui.ntransfer_characteristics(address(), value); return this; }
/** Sets the specified value to the {@code matrix_coeffs} field. */
public StdVideoH265SequenceParameterSetVui.Buffer matrix_coeffs(@NativeType("uint8_t") byte value) { StdVideoH265SequenceParameterSetVui.nmatrix_coeffs(address(), value); return this; }
/** Sets the specified value to the {@code chroma_sample_loc_type_top_field} field. */
public StdVideoH265SequenceParameterSetVui.Buffer chroma_sample_loc_type_top_field(@NativeType("uint8_t") byte value) { StdVideoH265SequenceParameterSetVui.nchroma_sample_loc_type_top_field(address(), value); return this; }
/** Sets the specified value to the {@code chroma_sample_loc_type_bottom_field} field. */
public StdVideoH265SequenceParameterSetVui.Buffer chroma_sample_loc_type_bottom_field(@NativeType("uint8_t") byte value) { StdVideoH265SequenceParameterSetVui.nchroma_sample_loc_type_bottom_field(address(), value); return this; }
/** Sets the specified value to the {@code def_disp_win_left_offset} field. */
public StdVideoH265SequenceParameterSetVui.Buffer def_disp_win_left_offset(@NativeType("uint16_t") short value) { StdVideoH265SequenceParameterSetVui.ndef_disp_win_left_offset(address(), value); return this; }
/** Sets the specified value to the {@code def_disp_win_right_offset} field. */
public StdVideoH265SequenceParameterSetVui.Buffer def_disp_win_right_offset(@NativeType("uint16_t") short value) { StdVideoH265SequenceParameterSetVui.ndef_disp_win_right_offset(address(), value); return this; }
/** Sets the specified value to the {@code def_disp_win_top_offset} field. */
public StdVideoH265SequenceParameterSetVui.Buffer def_disp_win_top_offset(@NativeType("uint16_t") short value) { StdVideoH265SequenceParameterSetVui.ndef_disp_win_top_offset(address(), value); return this; }
/** Sets the specified value to the {@code def_disp_win_bottom_offset} field. */
public StdVideoH265SequenceParameterSetVui.Buffer def_disp_win_bottom_offset(@NativeType("uint16_t") short value) { StdVideoH265SequenceParameterSetVui.ndef_disp_win_bottom_offset(address(), value); return this; }
/** Sets the specified value to the {@code vui_num_units_in_tick} field. */
public StdVideoH265SequenceParameterSetVui.Buffer vui_num_units_in_tick(@NativeType("uint32_t") int value) { StdVideoH265SequenceParameterSetVui.nvui_num_units_in_tick(address(), value); return this; }
/** Sets the specified value to the {@code vui_time_scale} field. */
public StdVideoH265SequenceParameterSetVui.Buffer vui_time_scale(@NativeType("uint32_t") int value) { StdVideoH265SequenceParameterSetVui.nvui_time_scale(address(), value); return this; }
/** Sets the specified value to the {@code vui_num_ticks_poc_diff_one_minus1} field. */
public StdVideoH265SequenceParameterSetVui.Buffer vui_num_ticks_poc_diff_one_minus1(@NativeType("uint32_t") int value) { StdVideoH265SequenceParameterSetVui.nvui_num_ticks_poc_diff_one_minus1(address(), value); return this; }
/** Sets the specified value to the {@code min_spatial_segmentation_idc} field. */
public StdVideoH265SequenceParameterSetVui.Buffer min_spatial_segmentation_idc(@NativeType("uint16_t") short value) { StdVideoH265SequenceParameterSetVui.nmin_spatial_segmentation_idc(address(), value); return this; }
/** Sets the specified value to the {@code max_bytes_per_pic_denom} field. */
public StdVideoH265SequenceParameterSetVui.Buffer max_bytes_per_pic_denom(@NativeType("uint8_t") byte value) { StdVideoH265SequenceParameterSetVui.nmax_bytes_per_pic_denom(address(), value); return this; }
/** Sets the specified value to the {@code max_bits_per_min_cu_denom} field. */
public StdVideoH265SequenceParameterSetVui.Buffer max_bits_per_min_cu_denom(@NativeType("uint8_t") byte value) { StdVideoH265SequenceParameterSetVui.nmax_bits_per_min_cu_denom(address(), value); return this; }
/** Sets the specified value to the {@code log2_max_mv_length_horizontal} field. */
public StdVideoH265SequenceParameterSetVui.Buffer log2_max_mv_length_horizontal(@NativeType("uint8_t") byte value) { StdVideoH265SequenceParameterSetVui.nlog2_max_mv_length_horizontal(address(), value); return this; }
/** Sets the specified value to the {@code log2_max_mv_length_vertical} field. */
public StdVideoH265SequenceParameterSetVui.Buffer log2_max_mv_length_vertical(@NativeType("uint8_t") byte value) { StdVideoH265SequenceParameterSetVui.nlog2_max_mv_length_vertical(address(), value); return this; }
/** Sets the address of the specified {@link StdVideoH265HrdParameters} to the {@code pHrdParameters} field. */
public StdVideoH265SequenceParameterSetVui.Buffer pHrdParameters(@NativeType("StdVideoH265HrdParameters const *") StdVideoH265HrdParameters value) { StdVideoH265SequenceParameterSetVui.npHrdParameters(address(), value); return this; }
}
} | {
"content_hash": "7cbd1e46184341ce47fbd03ca7f40e59",
"timestamp": "",
"source": "github",
"line_count": 724,
"max_line_length": 242,
"avg_line_length": 69.96408839779005,
"alnum_prop": 0.7072491807162317,
"repo_name": "LWJGL/lwjgl3",
"id": "816d19dbc1ce0af14c215c19f27871b166a25864",
"size": "50788",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "modules/lwjgl/vulkan/src/generated/java/org/lwjgl/vulkan/video/StdVideoH265SequenceParameterSetVui.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "14340"
},
{
"name": "C",
"bytes": "12213911"
},
{
"name": "C++",
"bytes": "1982042"
},
{
"name": "GLSL",
"bytes": "1703"
},
{
"name": "Java",
"bytes": "76116697"
},
{
"name": "Kotlin",
"bytes": "19700291"
},
{
"name": "Objective-C",
"bytes": "14684"
},
{
"name": "Objective-C++",
"bytes": "2004"
}
],
"symlink_target": ""
} |
/*
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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.
*/
#ifndef TiContextRef_h
#define TiContextRef_h
#include <JavaScriptCore/TiObjectRef.h>
#include <JavaScriptCore/TiValueRef.h>
#include <JavaScriptCore/WebKitAvailability.h>
#ifndef __cplusplus
#include <stdbool.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*!
@function
@abstract Creates a JavaScript context group.
@discussion A TiContextGroup associates JavaScript contexts with one another.
Contexts in the same group may share and exchange JavaScript objects. Sharing and/or exchanging
JavaScript objects between contexts in different groups will produce undefined behavior.
When objects from the same context group are used in multiple threads, explicit
synchronization is required.
@result The created TiContextGroup.
*/
JS_EXPORT TiContextGroupRef TiContextGroupCreate() CF_AVAILABLE(10_6, 7_0);
/*!
@function
@abstract Retains a JavaScript context group.
@param group The TiContextGroup to retain.
@result A TiContextGroup that is the same as group.
*/
JS_EXPORT TiContextGroupRef TiContextGroupRetain(TiContextGroupRef group) CF_AVAILABLE(10_6, 7_0);
/*!
@function
@abstract Releases a JavaScript context group.
@param group The TiContextGroup to release.
*/
JS_EXPORT void TiContextGroupRelease(TiContextGroupRef group) CF_AVAILABLE(10_6, 7_0);
/*!
@function
@abstract Creates a global JavaScript execution context.
@discussion TiGlobalContextCreate allocates a global object and populates it with all the
built-in JavaScript objects, such as Object, Function, String, and Array.
In WebKit version 4.0 and later, the context is created in a unique context group.
Therefore, scripts may execute in it concurrently with scripts executing in other contexts.
However, you may not use values created in the context in other contexts.
@param globalObjectClass The class to use when creating the global object. Pass
NULL to use the default object class.
@result A TiGlobalContext with a global object of class globalObjectClass.
*/
JS_EXPORT TiGlobalContextRef TiGlobalContextCreate(TiClassRef globalObjectClass) CF_AVAILABLE(10_5, 7_0);
/*!
@function
@abstract Creates a global JavaScript execution context in the context group provided.
@discussion TiGlobalContextCreateInGroup allocates a global object and populates it with
all the built-in JavaScript objects, such as Object, Function, String, and Array.
@param globalObjectClass The class to use when creating the global object. Pass
NULL to use the default object class.
@param group The context group to use. The created global context retains the group.
Pass NULL to create a unique group for the context.
@result A TiGlobalContext with a global object of class globalObjectClass and a context
group equal to group.
*/
JS_EXPORT TiGlobalContextRef TiGlobalContextCreateInGroup(TiContextGroupRef group, TiClassRef globalObjectClass) CF_AVAILABLE(10_6, 7_0);
/*!
@function
@abstract Retains a global JavaScript execution context.
@param ctx The TiGlobalContext to retain.
@result A TiGlobalContext that is the same as ctx.
*/
JS_EXPORT TiGlobalContextRef TiGlobalContextRetain(TiGlobalContextRef ctx);
/*!
@function
@abstract Releases a global JavaScript execution context.
@param ctx The TiGlobalContext to release.
*/
JS_EXPORT void TiGlobalContextRelease(TiGlobalContextRef ctx);
/*!
@function
@abstract Gets the global object of a JavaScript execution context.
@param ctx The TiContext whose global object you want to get.
@result ctx's global object.
*/
JS_EXPORT TiObjectRef TiContextGetGlobalObject(TiContextRef ctx);
/*!
@function
@abstract Gets the context group to which a JavaScript execution context belongs.
@param ctx The TiContext whose group you want to get.
@result ctx's group.
*/
JS_EXPORT TiContextGroupRef TiContextGetGroup(TiContextRef ctx) CF_AVAILABLE(10_6, 7_0);
/*!
@function
@abstract Gets the global context of a JavaScript execution context.
@param ctx The TiContext whose global context you want to get.
@result ctx's global context.
*/
JS_EXPORT TiGlobalContextRef TiContextGetGlobalContext(TiContextRef ctx) CF_AVAILABLE(10_7, 7_0);
/*!
@function
@abstract Gets a copy of the name of a context.
@param ctx The TiGlobalContext whose name you want to get.
@result The name for ctx.
@discussion A TiGlobalContext's name is exposed for remote debugging to make it
easier to identify the context you would like to attach to.
*/
JS_EXPORT TiStringRef TiGlobalContextCopyName(TiGlobalContextRef ctx);
/*!
@function
@abstract Sets the remote debugging name for a context.
@param ctx The TiGlobalContext that you want to name.
@param name The remote debugging name to set on ctx.
*/
JS_EXPORT void TiGlobalContextSetName(TiGlobalContextRef ctx, TiStringRef name);
#ifdef __cplusplus
}
#endif
#endif /* TiContextRef_h */
| {
"content_hash": "694a8d599da2699a18b9817e9dce4290",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 137,
"avg_line_length": 38.14375,
"alnum_prop": 0.7910863509749304,
"repo_name": "hardikamal/xox",
"id": "77dec074fbd0ab92541e05b79201a1b0007aefd8",
"size": "6291",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build/iphone/headers/JavaScriptCore/TiContextRef.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "120122"
},
{
"name": "C++",
"bytes": "13031"
},
{
"name": "CSS",
"bytes": "1276"
},
{
"name": "JavaScript",
"bytes": "2563513"
},
{
"name": "Makefile",
"bytes": "1607996"
},
{
"name": "Objective-C",
"bytes": "3408196"
},
{
"name": "Objective-C++",
"bytes": "8645"
},
{
"name": "Python",
"bytes": "5251"
},
{
"name": "Shell",
"bytes": "1272"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_17) on Sun Nov 03 15:35:46 CET 2013 -->
<title>com.badlogic.gdx.scenes.scene2d.actions Class Hierarchy (libgdx API)</title>
<meta name="date" content="2013-11-03">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="com.badlogic.gdx.scenes.scene2d.actions Class Hierarchy (libgdx API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/package-tree.html">Prev</a></li>
<li><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/ui/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/badlogic/gdx/scenes/scene2d/actions/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 class="title">Hierarchy For Package com.badlogic.gdx.scenes.scene2d.actions</h1>
<span class="strong">Package Hierarchies:</span>
<ul class="horizontal">
<li><a href="../../../../../../overview-tree.html">All Packages</a></li>
</ul>
</div>
<div class="contentContainer">
<h2 title="Class Hierarchy">Class Hierarchy</h2>
<ul>
<li type="circle">java.lang.Object
<ul>
<li type="circle">com.badlogic.gdx.scenes.scene2d.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/Action.html" title="class in com.badlogic.gdx.scenes.scene2d"><span class="strong">Action</span></a> (implements com.badlogic.gdx.utils.<a href="../../../../../../com/badlogic/gdx/utils/Pool.Poolable.html" title="interface in com.badlogic.gdx.utils">Pool.Poolable</a>)
<ul>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/AddAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">AddAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/AddListenerAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">AddListenerAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/DelegateAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">DelegateAction</span></a>
<ul>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/AfterAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">AfterAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/DelayAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">DelayAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/RepeatAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">RepeatAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/TimeScaleAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">TimeScaleAction</span></a></li>
</ul>
</li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/LayoutAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">LayoutAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/ParallelAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">ParallelAction</span></a>
<ul>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/SequenceAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">SequenceAction</span></a></li>
</ul>
</li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/RemoveAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">RemoveAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/RemoveActorAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">RemoveActorAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/RemoveListenerAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">RemoveListenerAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/RunnableAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">RunnableAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/TemporalAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">TemporalAction</span></a>
<ul>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/AlphaAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">AlphaAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/ColorAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">ColorAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/FloatAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">FloatAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/IntAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">IntAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/MoveToAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">MoveToAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/RelativeTemporalAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">RelativeTemporalAction</span></a>
<ul>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/MoveByAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">MoveByAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/RotateByAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">RotateByAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/ScaleByAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">ScaleByAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/SizeByAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">SizeByAction</span></a></li>
</ul>
</li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/RotateToAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">RotateToAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/ScaleToAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">ScaleToAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/SizeToAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">SizeToAction</span></a></li>
</ul>
</li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/TouchableAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">TouchableAction</span></a></li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/VisibleAction.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">VisibleAction</span></a></li>
</ul>
</li>
<li type="circle">com.badlogic.gdx.scenes.scene2d.actions.<a href="../../../../../../com/badlogic/gdx/scenes/scene2d/actions/Actions.html" title="class in com.badlogic.gdx.scenes.scene2d.actions"><span class="strong">Actions</span></a></li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>libgdx API</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/package-tree.html">Prev</a></li>
<li><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/ui/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/badlogic/gdx/scenes/scene2d/actions/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<div style="font-size:9pt"><i>
Copyright © 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</small></p>
</body>
</html>
| {
"content_hash": "241608cd28ad7d9b4698c7e80a6aa7a2",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 377,
"avg_line_length": 70.11734693877551,
"alnum_prop": 0.6775813141235538,
"repo_name": "ilackarms/libgdx",
"id": "8ec025b5c4d3952f688bd453fb80b2715868d8f4",
"size": "13743",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "docs/api/com/badlogic/gdx/scenes/scene2d/actions/package-tree.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "11139"
},
{
"name": "Groovy",
"bytes": "8534"
},
{
"name": "Java",
"bytes": "16296"
}
],
"symlink_target": ""
} |
"""
第 0002 题:将 0001 题生成的 200 个激活码(或者优惠券)保存到 MySQL 关系型数据库中。
"""
import pymysql
__author__ = 'Chris5641'
def code2sql():
f = open('ActivationCode.txt', 'r')
conn = pymysql.connect(user='root', passwd='password')
cursor = conn.cursor()
cursor.execute('create database if not exists accode')
cursor.execute('use accode')
cursor.execute('create table accode(id int auto_increment primary key, code varchar(10))')
for line in f.readlines():
cursor.execute('insert into accode (code) values (%s)', [line.strip()])
conn.commit()
f.close()
cursor.close()
conn.close()
if __name__ == '__main__':
code2sql()
| {
"content_hash": "e27972ca4dc1bd732974e15d2faa80b6",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 94,
"avg_line_length": 27.375,
"alnum_prop": 0.6377473363774734,
"repo_name": "Yrthgze/prueba-sourcetree2",
"id": "4f81226b971b45712a3ea0ba8f60ad144f46c9da",
"size": "741",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "chris5641/0002/code2sql.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3948"
},
{
"name": "C++",
"bytes": "5518"
},
{
"name": "CSS",
"bytes": "3474"
},
{
"name": "HTML",
"bytes": "1101085"
},
{
"name": "Java",
"bytes": "141"
},
{
"name": "JavaScript",
"bytes": "5282"
},
{
"name": "Jupyter Notebook",
"bytes": "324817"
},
{
"name": "Mako",
"bytes": "412"
},
{
"name": "Python",
"bytes": "535355"
}
],
"symlink_target": ""
} |
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_null_allocator;
extern const omp_allocator_handle_t omp_default_mem_alloc;
extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
extern const omp_allocator_handle_t omp_const_mem_alloc;
extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
extern const omp_allocator_handle_t omp_pteam_mem_alloc;
extern const omp_allocator_handle_t omp_thread_mem_alloc;
void foo() {}
struct S {
S(): a(0) {}
S(int v) : a(v) {}
int a;
typedef int type;
};
template <typename T>
class S7 : public T {
protected:
T a;
S7() : a(0) {}
public:
S7(typename T::type v) : a(v) {
#pragma omp target
#pragma omp teams distribute private(a) private(this->a) private(T::a)
for (int k = 0; k < a.a; ++k)
++this->a.a;
}
S7 &operator=(S7 &s) {
#pragma omp target
#pragma omp teams distribute private(a) private(this->a)
for (int k = 0; k < s.a.a; ++k)
++s.a.a;
return *this;
}
void foo() {
int b, argv, d, c, e, f;
#pragma omp target
#pragma omp teams distribute default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
for (int k = 0; k < a.a; ++k)
++a.a;
}
};
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a) private(T::a)
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a)
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a) private(this->S::a)
class S8 : public S7<S> {
S8() {}
public:
S8(int v) : S7<S>(v){
#pragma omp target
#pragma omp teams distribute private(a) private(this->a) private(S7<S>::a)
for (int k = 0; k < a.a; ++k)
++this->a.a;
}
S8 &operator=(S8 &s) {
#pragma omp target
#pragma omp teams distribute private(a) private(this->a)
for (int k = 0; k < s.a.a; ++k)
++s.a.a;
return *this;
}
void bar() {
int b, argv, d, c, e, f;
#pragma omp target
#pragma omp teams distribute allocate(omp_thread_mem_alloc:argv) default(none), private(b) firstprivate(argv) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d) allocate(omp_default_mem_alloc:c) shared(omp_default_mem_alloc, omp_thread_mem_alloc)
for (int k = 0; k < a.a; ++k)
++a.a;
}
};
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a) private(this->S7<S>::a)
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a)
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute allocate(omp_thread_mem_alloc: argv) default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) allocate(omp_default_mem_alloc: c) shared(omp_default_mem_alloc,omp_thread_mem_alloc)
template <class T, int N>
T tmain(T argc) {
T b = argc, c, d, e, f, g;
static T a;
// CHECK: static T a;
#pragma omp target
#pragma omp teams distribute
for (int i=0; i < 2; ++i)
a = 2;
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute{{$}}
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
// CHECK-NEXT: a = 2;
#pragma omp target
#pragma omp teams distribute private(argc, b), firstprivate(c, d), collapse(2)
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
foo();
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute private(argc,b) firstprivate(c,d) collapse(2)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: for (int j = 0; j < 10; ++j)
// CHECK-NEXT: foo();
for (int i = 0; i < 10; ++i)
foo();
// CHECK: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: foo();
#pragma omp target
#pragma omp teams distribute
for (int i = 0; i < 10; ++i)
foo();
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: foo();
#pragma omp target
#pragma omp teams distribute default(none), private(b) firstprivate(argc) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
for (int k = 0; k < 10; ++k)
e += d + argc;
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute default(none) private(b) firstprivate(argc) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
// CHECK-NEXT: for (int k = 0; k < 10; ++k)
// CHECK-NEXT: e += d + argc;
return T();
}
int main (int argc, char **argv) {
int b = argc, c, d, e, f, g;
static int a;
// CHECK: static int a;
#pragma omp target
#pragma omp teams distribute
for (int i=0; i < 2; ++i)
a = 2;
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
// CHECK-NEXT: a = 2;
#pragma omp target
#pragma omp teams distribute private(argc,b),firstprivate(argv, c), collapse(2)
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
foo();
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute private(argc,b) firstprivate(argv,c) collapse(2)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: for (int j = 0; j < 10; ++j)
// CHECK-NEXT: foo();
for (int i = 0; i < 10; ++i)
foo();
// CHECK: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: foo();
#pragma omp target
#pragma omp teams distribute
for (int i = 0; i < 10; ++i)foo();
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: foo();
#pragma omp target
#pragma omp teams distribute default(none), private(b) firstprivate(argc) shared(d) reduction(+:c) reduction(max:e) num_teams(f) thread_limit(d)
for (int k = 0; k < 10; ++k)
e += d + argc;
// CHECK: #pragma omp target
// CHECK-NEXT: #pragma omp teams distribute default(none) private(b) firstprivate(argc) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d)
// CHECK-NEXT: for (int k = 0; k < 10; ++k)
// CHECK-NEXT: e += d + argc;
return (0);
}
#endif
| {
"content_hash": "721c9f001fc68a31d75d88b2399a94e0",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 283,
"avg_line_length": 35.09340659340659,
"alnum_prop": 0.6398935337404102,
"repo_name": "endlessm/chromium-browser",
"id": "417562c45bbf3387745e70622e6587bc3c7eb02c",
"size": "7014",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "third_party/llvm/clang/test/OpenMP/teams_distribute_ast_print.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
@import UIKit;
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
| {
"content_hash": "2fc1a8bdc61d7169fa5c5f6951eec6df",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 90,
"avg_line_length": 22,
"alnum_prop": 0.6717171717171717,
"repo_name": "andrew804/InAppNotifications",
"id": "c5212baaa9699d6b7fe4110b6d6646e73cd6ebe7",
"size": "345",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Example/InAppNotifications/main.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "31740"
},
{
"name": "Ruby",
"bytes": "1612"
},
{
"name": "Shell",
"bytes": "15122"
}
],
"symlink_target": ""
} |
using System;
namespace MonkeyOthello.Engines.V2
{
public class Constants
{
public const int MaxEmpties = 64;
public const int Use_Parity = 4;
public const int Fastest_First = 7;
public const int HighestScore = 100000000;
public const int RowsNum = 8;
public const int MiddleWeight = 24;
}
}
| {
"content_hash": "fd6c0f52b59051d31972bb3dc9bd1642",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 53,
"avg_line_length": 23.8125,
"alnum_prop": 0.5879265091863517,
"repo_name": "coolcode/MonkeyOthello",
"id": "35143c35860e02aac7141f5830d7b9f14874f569",
"size": "557",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MonkeyOthello.Engines.V2/Core/Constants.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "433667"
}
],
"symlink_target": ""
} |
import { initializeApp } from "firebase/app"
import { getFirestore } from "firebase/firestore"
import { getDatabase } from "firebase/database"
import { firebaseConfig } from "secrets"
export const firebase = initializeApp(firebaseConfig)
export const db = getFirestore(firebase)
export const rldb = getDatabase(firebase)
| {
"content_hash": "bf1d05057232621fa49be7795e438f48",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 53,
"avg_line_length": 35.888888888888886,
"alnum_prop": 0.7863777089783281,
"repo_name": "Va5s0/the-birthday-project",
"id": "965a9cb201e4e4d3dcf79f70bd59d6a46eb0b289",
"size": "323",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/firebase/fbConfig.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "804"
},
{
"name": "HTML",
"bytes": "358"
},
{
"name": "JavaScript",
"bytes": "3375"
},
{
"name": "Perl",
"bytes": "4655"
},
{
"name": "Shell",
"bytes": "18787"
},
{
"name": "TypeScript",
"bytes": "75721"
}
],
"symlink_target": ""
} |
package envoy_type_v3
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = ptypes.DynamicAny{}
)
// Validate checks the field values on SemanticVersion with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *SemanticVersion) Validate() error {
if m == nil {
return nil
}
// no validation rules for MajorNumber
// no validation rules for MinorNumber
// no validation rules for Patch
return nil
}
// SemanticVersionValidationError is the validation error returned by
// SemanticVersion.Validate if the designated constraints aren't met.
type SemanticVersionValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SemanticVersionValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SemanticVersionValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SemanticVersionValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SemanticVersionValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SemanticVersionValidationError) ErrorName() string { return "SemanticVersionValidationError" }
// Error satisfies the builtin error interface
func (e SemanticVersionValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sSemanticVersion.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SemanticVersionValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SemanticVersionValidationError{}
| {
"content_hash": "c912979aeb2590179d43961ed49be6a5",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 102,
"avg_line_length": 21.480392156862745,
"alnum_prop": 0.7065267001369238,
"repo_name": "jacksontj/promxy",
"id": "0a93817441631ae1a6eb4914a37f06d29be18577",
"size": "2295",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "vendor/github.com/envoyproxy/go-control-plane/envoy/type/v3/semantic_version.pb.validate.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "840"
},
{
"name": "Go",
"bytes": "278956"
},
{
"name": "Makefile",
"bytes": "1055"
},
{
"name": "Mustache",
"bytes": "2143"
},
{
"name": "Shell",
"bytes": "975"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>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="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="a00240.html">tbb</a></li><li class="navelem"><b>interface6</b></li><li class="navelem"><a class="el" href="a00094.html">memory_pool_allocator< void, P ></a></li><li class="navelem"><a class="el" href="a00123.html">rebind</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">tbb::interface6::memory_pool_allocator< void, P >::rebind< U > Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="a00123.html">tbb::interface6::memory_pool_allocator< void, P >::rebind< U ></a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>other</b> typedef (defined in <a class="el" href="a00123.html">tbb::interface6::memory_pool_allocator< void, P >::rebind< U ></a>)</td><td class="entry"><a class="el" href="a00123.html">tbb::interface6::memory_pool_allocator< void, P >::rebind< U ></a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<hr>
<p></p>
Copyright © 2005-2015 Intel Corporation. All Rights Reserved.
<p></p>
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
<p></p>
* Other names and brands may be claimed as the property of others.
| {
"content_hash": "c31b3e8f48ea408c8571beb9eb438322",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 367,
"avg_line_length": 53.98245614035088,
"alnum_prop": 0.6529086772830679,
"repo_name": "DrPizza/reed-solomon",
"id": "9fb437fd240a78c45f7ac01dd0910e0ee23d7caa",
"size": "3077",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "tbb/doc/html/a00397.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "125597"
},
{
"name": "Batchfile",
"bytes": "14199"
},
{
"name": "C",
"bytes": "522308"
},
{
"name": "C++",
"bytes": "6155224"
},
{
"name": "CSS",
"bytes": "21672"
},
{
"name": "HTML",
"bytes": "4229477"
},
{
"name": "Java",
"bytes": "11966"
},
{
"name": "JavaScript",
"bytes": "14447"
},
{
"name": "Makefile",
"bytes": "81911"
},
{
"name": "Objective-C",
"bytes": "13678"
},
{
"name": "PHP",
"bytes": "6205"
},
{
"name": "Shell",
"bytes": "33928"
},
{
"name": "SourcePawn",
"bytes": "4814"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>XLabs: 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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</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="projectlogo"><img alt="Logo" src="XLabs_logo.psd"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">XLabs
</div>
<div id="projectbrief">Cross-platform reusable C# libraries</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<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>Packages</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>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label.html','');});
</script>
<div id="doc-content">
<!-- 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 class="header">
<div class="headertitle">
<div class="title">XLabs.Forms.Controls.HyperLinkLabel Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label.html">XLabs.Forms.Controls.HyperLinkLabel</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label.html#a5d7b40d09f194b37577409a47cf0cef9">NavigateUri</a></td><td class="entry"><a class="el" href="class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label.html">XLabs.Forms.Controls.HyperLinkLabel</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label.html#a1c99a16db42ea9b2e96a509ea791effa">NavigateUriProperty</a></td><td class="entry"><a class="el" href="class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label.html">XLabs.Forms.Controls.HyperLinkLabel</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label.html#a203e4431ac0605b0944f0209f345e7b1">Subject</a></td><td class="entry"><a class="el" href="class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label.html">XLabs.Forms.Controls.HyperLinkLabel</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label.html#a08129ac2dcc8735a4c4b4c124afc8634">SubjectProperty</a></td><td class="entry"><a class="el" href="class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label.html">XLabs.Forms.Controls.HyperLinkLabel</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "0d85226fa1ea8c6630c549dfd358909b",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 376,
"avg_line_length": 49.90909090909091,
"alnum_prop": 0.6637826350941105,
"repo_name": "XLabs/xlabs.github.io",
"id": "7b466bf16a916e34060d752b9c6fda2a19e4de65",
"size": "6588",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "html/class_x_labs_1_1_forms_1_1_controls_1_1_hyper_link_label-members.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "33201"
},
{
"name": "HTML",
"bytes": "25233456"
},
{
"name": "JavaScript",
"bytes": "1159419"
}
],
"symlink_target": ""
} |
var getGadgetLocation = function (callback) {
var gadgetLocation = "/portal/store/carbon.super/fs/gadget/Android_Realtime_Screen";
var PATH_SEPERATOR = "/";
if (gadgetLocation.search("store") != -1) {
wso2.gadgets.identity.getTenantDomain(function (tenantDomain) {
var gadgetPath = gadgetLocation.split(PATH_SEPERATOR);
var modifiedPath = '';
for (var i = 1; i < gadgetPath.length; i++) {
if (i === 3) {
modifiedPath = modifiedPath.concat(PATH_SEPERATOR, tenantDomain);
} else {
modifiedPath = modifiedPath.concat(PATH_SEPERATOR, gadgetPath[i])
}
}
callback(modifiedPath);
});
} else {
callback(gadgetLocation);
}
} | {
"content_hash": "0e457d0e1c85a3610d763987ef21f597",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 88,
"avg_line_length": 38.333333333333336,
"alnum_prop": 0.5602484472049689,
"repo_name": "susinda/carbon-device-mgt-plugins",
"id": "8c43200bb23b6a10a3a8874724c9b469338eab0a",
"size": "1441",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_realtime_screen_gadget/Android_Realtime_Screen/js/core/gadget-util.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Arduino",
"bytes": "14451"
},
{
"name": "C",
"bytes": "2475"
},
{
"name": "CSS",
"bytes": "1089711"
},
{
"name": "HTML",
"bytes": "713988"
},
{
"name": "Java",
"bytes": "3114048"
},
{
"name": "JavaScript",
"bytes": "19770938"
},
{
"name": "PLSQL",
"bytes": "3228"
},
{
"name": "Python",
"bytes": "34436"
},
{
"name": "Shell",
"bytes": "30284"
}
],
"symlink_target": ""
} |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
//^ using Microsoft.Contracts;
namespace Microsoft.Cci {
/// <summary>
/// An expression that adds the value of the left operand to the value of the right operand.
/// Both operands must be primitive numeric types.
/// </summary>
public interface IAddition : IBinaryOperation {
/// <summary>
/// The addition must be performed with a check for arithmetic overflow and the operands must be integers.
/// </summary>
bool CheckOverflow {
get;
}
/// <summary>
/// If true the operands must be integers and are treated as being unsigned for the purpose of the addition. This only makes a difference if CheckOverflow is true as well.
/// </summary>
bool TreatOperandsAsUnsignedIntegers {
get;
}
}
/// <summary>
/// An expression that denotes a value that has an address in memory, such as a local variable, parameter, field, array element, pointer target, or method.
/// </summary>
[ContractClass(typeof(IAddressableExpressionContract))]
public interface IAddressableExpression : IExpression {
/// <summary>
/// The local variable, parameter, field, array element, pointer target or method that this expression denotes.
/// </summary>
object Definition {
get;
//^ ensures result is ILocalDefinition || result is IParameterDefinition || result is IFieldReference || result is IMethodReference || result is IExpression;
}
/// <summary>
/// The instance to be used if this.Definition is an instance field/method or array indexer.
/// </summary>
IExpression/*?*/ Instance { get; }
}
#region IAdddressableExpression contract binding
[ContractClassFor(typeof(IAddressableExpression))]
abstract class IAddressableExpressionContract : IAddressableExpression {
#region IAddressableExpression Members
public object Definition {
get {
Contract.Ensures(Contract.Result<object>() is ILocalDefinition || Contract.Result<object>() is IParameterDefinition ||
Contract.Result<object>() is IFieldReference || Contract.Result<object>() is IMethodReference || Contract.Result<object>() is IExpression);
throw new NotImplementedException();
}
}
public IExpression Instance {
get { throw new NotImplementedException(); }
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that takes the address of a target expression.
/// </summary>
[ContractClass(typeof(IAddressOfContract))]
public interface IAddressOf : IExpression {
/// <summary>
/// An expression that represents an addressable location in memory.
/// </summary>
IAddressableExpression Expression { get; }
/// <summary>
/// If true, the address can only be used in operations where defining type of the addressed
/// object has control over whether or not the object is mutated. For example, a value type that
/// exposes no public fields or mutator methods cannot be changed using this address.
/// </summary>
bool ObjectControlsMutability { get; }
}
#region IAddressOf contract binding
[ContractClassFor(typeof(IAddressOf))]
abstract class IAddressOfContract : IAddressOf {
#region IAddressOf Members
public IAddressableExpression Expression {
get {
Contract.Ensures(Contract.Result<IAddressableExpression>() != null);
throw new NotImplementedException();
}
}
public bool ObjectControlsMutability {
get { throw new NotImplementedException(); }
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that deferences an address (pointer).
/// </summary>
[ContractClass(typeof(IAddressDereferenceContract))]
public interface IAddressDereference : IExpression {
/// <summary>
/// The address to dereference.
/// </summary>
IExpression Address {
get;
// ^ ensures result.Type is IPointerTypeReference;
}
/// <summary>
/// If the addres to dereference is not aligned with the size of the target type, this property specifies the actual alignment.
/// For example, a value of 1 specifies that the pointer is byte aligned, whereas the target type may be word sized.
/// </summary>
byte Alignment {
get;
//^ requires this.IsUnaligned;
//^ ensures result == 1 || result == 2 || result == 4;
}
/// <summary>
/// True if the address is not aligned to the natural size of the target type. If true, the actual alignment of the
/// address is specified by this.Alignment.
/// </summary>
bool IsUnaligned { get; }
/// <summary>
/// The location at Address is volatile and its contents may not be cached.
/// </summary>
bool IsVolatile { get; }
}
#region IAddressDereference contract binding
[ContractClassFor(typeof(IAddressDereference))]
abstract class IAddressDereferenceContract : IAddressDereference {
#region IAddressDereference Members
public IExpression Address {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
public byte Alignment {
get { throw new NotImplementedException(); }
}
public bool IsUnaligned {
get { throw new NotImplementedException(); }
}
public bool IsVolatile {
get { throw new NotImplementedException(); }
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that evaluates to an instance of a delegate type where the body of the method called by the delegate is specified by the expression.
/// </summary>
public interface IAnonymousDelegate : IExpression, ISignature {
/// <summary>
/// A block of statements providing the implementation of the anonymous method that is called by the delegate that is the result of this expression.
/// </summary>
IBlockStatement Body { get; }
/// <summary>
/// The parameters this anonymous method.
/// </summary>
new IEnumerable<IParameterDefinition> Parameters { get; }
/// <summary>
/// The return type of the delegate.
/// </summary>
ITypeReference ReturnType { get; }
/// <summary>
/// The type of delegate that this expression results in.
/// </summary>
new ITypeReference Type { get; }
}
/// <summary>
/// An expression that represents an array element access.
/// </summary>
[ContractClass(typeof(IArrayIndexerContract))]
public interface IArrayIndexer : IExpression {
/// <summary>
/// An expression that results in value of an array type.
/// </summary>
IExpression IndexedObject { get; }
/// <summary>
/// The array indices.
/// </summary>
IEnumerable<IExpression> Indices { get; }
}
#region IArrayIndexer contract binding
[ContractClassFor(typeof(IArrayIndexer))]
abstract class IArrayIndexerContract : IArrayIndexer {
public IExpression IndexedObject {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
public IEnumerable<IExpression> Indices {
get {
Contract.Ensures(Contract.Result<IEnumerable<IExpression>>() != null);
throw new NotImplementedException();
}
}
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
}
#endregion
/// <summary>
/// An expression that assigns the value of the source (right) operand to the location represented by the target (left) operand.
/// The expression result is the value of the source expression.
/// </summary>
[ContractClass(typeof(IAssignmentContract))]
public interface IAssignment : IExpression {
/// <summary>
/// The expression representing the value to assign.
/// </summary>
IExpression Source { get; }
/// <summary>
/// The expression representing the target to assign to.
/// </summary>
ITargetExpression Target { get; }
}
#region IAssignment contract binding
[ContractClassFor(typeof(IAssignment))]
abstract class IAssignmentContract : IAssignment {
#region IAssignment Members
public IExpression Source {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
public ITargetExpression Target {
get {
Contract.Ensures(Contract.Result<ITargetExpression>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// A binary operation performed on a left and right operand.
/// </summary>
[ContractClass(typeof(IBinaryOperationContract))]
public interface IBinaryOperation : IExpression {
/// <summary>
/// The left operand.
/// </summary>
IExpression LeftOperand { get; }
/// <summary>
/// The right operand.
/// </summary>
IExpression RightOperand { get; }
/// <summary>
/// If true, the left operand must be a target expression and the result of the binary operation is the
/// value of the target expression before it is assigned the value of the operation performed on
/// (right hand) values of the left and right operands.
/// </summary>
bool ResultIsUnmodifiedLeftOperand { get; }
}
[ContractClassFor(typeof(IBinaryOperation))]
abstract class IBinaryOperationContract : IBinaryOperation {
public IExpression LeftOperand {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
public IExpression RightOperand {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
/// <summary>
/// If true, the left operand must be a target expression and the result of the binary operation is the
/// value of the target expression before it is assigned the value of the operation performed on
/// (right hand) values of the left and right operands.
/// </summary>
public bool ResultIsUnmodifiedLeftOperand {
get {
Contract.Ensures(!Contract.Result<bool>() || this.LeftOperand is ITargetExpression);
throw new NotImplementedException();
}
}
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
}
/// <summary>
/// An expression that computes the bitwise and of the left and right operands.
/// </summary>
public interface IBitwiseAnd : IBinaryOperation {
}
/// <summary>
/// An expression that computes the bitwise or of the left and right operands.
/// </summary>
public interface IBitwiseOr : IBinaryOperation {
}
/// <summary>
/// An expression that introduces a new block scope and that references local variables
/// that are defined and initialized by embedded statements when control reaches the expression.
/// </summary>
[ContractClass(typeof(IBlockExpressionContract))]
public interface IBlockExpression : IExpression {
/// <summary>
/// A block of statements that typically introduce local variables to hold sub expressions.
/// The scope of these declarations coincides with the block expression.
/// The statements are executed before evaluation of Expression occurs.
/// </summary>
IBlockStatement BlockStatement { get; }
/// <summary>
/// The expression that computes the result of the entire block expression.
/// This expression can contain references to the local variables that are declared inside BlockStatement.
/// </summary>
IExpression Expression { get; }
}
#region IBlockExpression contract binding
[ContractClassFor(typeof(IBlockExpression))]
abstract class IBlockExpressionContract : IBlockExpression {
#region IBlockExpression Members
public IBlockStatement BlockStatement {
get {
Contract.Ensures(Contract.Result<IBlockStatement>() != null);
throw new NotImplementedException();
}
}
public IExpression Expression {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that binds to a local variable, parameter or field.
/// </summary>
[ContractClass(typeof(IBoundExpressionContract))]
public interface IBoundExpression : IExpression {
/// <summary>
/// If Definition is a field and the field is not aligned with natural size of its type, this property specifies the actual alignment.
/// For example, if the field is byte aligned, then the result of this property is 1. Likewise, 2 for word (16-bit) alignment and 4 for
/// double word (32-bit alignment).
/// </summary>
byte Alignment {
get;
//^ requires IsUnaligned;
//^ ensures result == 1 || result == 2 || result == 4;
}
/// <summary>
/// The local variable, parameter or field that this expression binds to.
/// </summary>
object Definition {
get;
//^ ensures result is ILocalDefinition || result is IParameterDefinition || result is IFieldReference;
}
/// <summary>
/// If the expression binds to an instance field then this property is not null and contains the instance.
/// </summary>
IExpression/*?*/ Instance {
get;
//^ ensures this.Definition is IFieldReference && !((IFieldReference)this.Definition).ResolvedField.IsStatic <==> result != null;
}
/// <summary>
/// True if the definition is a field and the field is not aligned with the natural size of its type.
/// For example if the field type is Int32 and the field is aligned on an Int16 boundary.
/// </summary>
bool IsUnaligned { get; }
/// <summary>
/// The bound Definition is a volatile field and its contents may not be cached.
/// </summary>
bool IsVolatile { get; }
}
#region IBoundExpression contract binding
[ContractClassFor(typeof(IBoundExpression))]
abstract class IBoundExpressionContract : IBoundExpression {
#region IBoundExpression Members
public byte Alignment {
get {
Contract.Requires(this.IsUnaligned);
//Contract.Ensures(Contract.Result<byte>() == 1 || Contract.Result<byte>() == 2 || Contract.Result<byte>() == 4);
throw new NotImplementedException();
}
}
public object Definition {
get {
Contract.Ensures(Contract.Result<object>() != null);
Contract.Ensures(Contract.Result<object>() is ILocalDefinition || Contract.Result<object>() is IParameterDefinition || Contract.Result<object>() is IFieldReference);
throw new NotImplementedException();
}
}
public IExpression Instance {
get {
//Contract.Ensures((Contract.Result<IExpression>() != null) == (this.Definition is IFieldReference && !((IFieldReference)this.Definition).IsStatic));
throw new NotImplementedException();
}
}
public bool IsUnaligned {
get { throw new NotImplementedException(); }
}
public bool IsVolatile {
get { throw new NotImplementedException(); }
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that casts the value to the given type, resulting in a null value if the cast does not succeed.
/// </summary>
[ContractClass(typeof(ICastIfPossibleContract))]
public interface ICastIfPossible : IExpression {
/// <summary>
/// The value to cast if possible.
/// </summary>
IExpression ValueToCast { get; }
/// <summary>
/// The type to which the value must be cast. If the value is not of this type, the expression results in a null value of this type.
/// </summary>
ITypeReference TargetType { get; }
}
#region ICastIfPossible contract binding
[ContractClassFor(typeof(ICastIfPossible))]
abstract class ICastIfPossibleContract : ICastIfPossible {
#region ICastIfPossible Members
public IExpression ValueToCast {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
public ITypeReference TargetType {
get {
Contract.Ensures(Contract.Result<ITypeReference>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that results in true if the given operand is an instance of the given type.
/// </summary>
[ContractClass(typeof(ICheckIfInstanceContract))]
public interface ICheckIfInstance : IExpression {
/// <summary>
/// The value to check.
/// </summary>
IExpression Operand { get; }
/// <summary>
/// The type to which the value must belong for this expression to evaluate as true.
/// </summary>
ITypeReference TypeToCheck { get; }
}
#region ICheckIfInstance contract binding
[ContractClassFor(typeof(ICheckIfInstance))]
abstract class ICheckIfInstanceContract : ICheckIfInstance {
#region ICheckIfInstance Members
public IExpression Operand {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
public ITypeReference TypeToCheck {
get {
Contract.Ensures(Contract.Result<ITypeReference>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// Converts a value to a given type using a primitive type conversion for which an IL instruction exsists.
/// </summary>
/// <remarks>User defined conversions are modeled as method calls.</remarks>
[ContractClass(typeof(IConversionContract))]
public interface IConversion : IExpression {
/// <summary>
/// The value to convert. If the type of this value is an enumeration, the target type must have the same size and may not itself be an enumeration.
/// </summary>
IExpression ValueToConvert { get; }
/// <summary>
/// If true and ValueToConvert is a number and ResultType is a numeric type, check that ValueToConvert falls within the range of ResultType and throw an exception if not.
/// </summary>
bool CheckNumericRange { get; }
/// <summary>
/// The type to which the value is to be converted. If the type of this value is an enumeration, the source type must have the same size and may not itself be an enumeration.
/// </summary>
ITypeReference TypeAfterConversion { get; }
}
#region IConversion contract binding
[ContractClassFor(typeof(IConversion))]
abstract class IConversionContract : IConversion {
public IExpression ValueToConvert {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
public bool CheckNumericRange {
get { throw new NotImplementedException(); }
}
public ITypeReference TypeAfterConversion {
get {
Contract.Ensures(Contract.Result<ITypeReference>() != null);
throw new NotImplementedException();
}
}
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
}
#endregion
/// <summary>
/// An expression that does not change its value at runtime and can be evaluated at compile time.
/// </summary>
public interface ICompileTimeConstant : IExpression {
/// <summary>
/// The compile time value of the expression. Can be null.
/// </summary>
object/*?*/ Value { get; }
}
/// <summary>
/// An expression that results in one of two values, depending on the value of a condition.
/// </summary>
[ContractClass(typeof(IConditionalContract))]
public interface IConditional : IExpression {
/// <summary>
/// The condition that determines which subexpression to evaluate.
/// </summary>
IExpression Condition { get; }
/// <summary>
/// The expression to evaluate as the value of the overall expression if the condition is true.
/// </summary>
IExpression ResultIfTrue { get; }
/// <summary>
/// The expression to evaluate as the value of the overall expression if the condition is false.
/// </summary>
IExpression ResultIfFalse { get; }
}
#region IConditional contract binding
[ContractClassFor(typeof(IConditional))]
abstract class IConditionalContract : IConditional {
#region IConditional Members
public IExpression Condition {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
public IExpression ResultIfTrue {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
public IExpression ResultIfFalse {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that creates an array instance.
/// </summary>
[ContractClass(typeof(ICreateArrayContract))]
public interface ICreateArray : IExpression {
/// <summary>
/// The element type of the array.
/// </summary>
ITypeReference ElementType { get; }
/// <summary>
/// The initial values of the array elements. May be empty.
/// This must be a flat list of the initial values. Its length
/// must be the product of the size of each dimension.
/// </summary>
IEnumerable<IExpression> Initializers {
get;
}
/// <summary>
/// The index value of the first element in each dimension.
/// </summary>
IEnumerable<int> LowerBounds {
get;
// ^ ensures count{int lb in result} == Rank;
}
/// <summary>
/// The number of dimensions of the array.
/// </summary>
uint Rank {
get;
//^ ensures result > 0;
}
/// <summary>
/// The number of elements allowed in each dimension.
/// </summary>
IEnumerable<IExpression> Sizes {
get;
// ^ ensures count{int size in result} == Rank;
}
}
#region ICreateArray contract binding
[ContractClassFor(typeof(ICreateArray))]
abstract class ICreateArrayContract : ICreateArray {
public ITypeReference ElementType {
get {
Contract.Ensures(Contract.Result<ITypeReference>() != null);
throw new NotImplementedException();
}
}
public IEnumerable<IExpression> Initializers {
get {
Contract.Ensures(Contract.Result<IEnumerable<IExpression>>() != null);
throw new NotImplementedException();
}
}
public IEnumerable<int> LowerBounds {
get {
Contract.Ensures(Contract.Result<IEnumerable<int>>() != null);
throw new NotImplementedException();
}
}
public uint Rank {
get {
Contract.Ensures(Contract.Result<uint>() > 0);
throw new NotImplementedException();
}
}
public IEnumerable<IExpression> Sizes {
get {
Contract.Ensures(Contract.Result<IEnumerable<IExpression>>() != null);
throw new NotImplementedException();
}
}
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get {
throw new NotImplementedException();
}
}
public IEnumerable<ILocation> Locations {
get {
throw new NotImplementedException();
}
}
}
#endregion
/// <summary>
/// Creates an instance of the delegate type return by this.Type, using the method specified by this.MethodToCallViaDelegate.
/// If the method is an instance method, then this.Instance specifies the expression that results in the instance on which the
/// method will be called.
/// </summary>
public partial interface ICreateDelegateInstance : IExpression {
/// <summary>
/// An expression that evaluates to the instance (if any) on which this.MethodToCallViaDelegate must be called (via the delegate).
/// </summary>
IExpression/*?*/ Instance { get; }
/// <summary>
/// True if the delegate encapsulates a virtual method.
/// </summary>
bool IsVirtualDelegate { get; }
/// <summary>
/// The method that is to be be called when the delegate instance is invoked.
/// </summary>
IMethodReference MethodToCallViaDelegate { get; }
}
#region ICreateDelegateInstance contract binding
[ContractClass(typeof(ICreateDelegateInstanceContract))]
public partial interface ICreateDelegateInstance {
}
[ContractClassFor(typeof(ICreateDelegateInstance))]
abstract class ICreateDelegateInstanceContract : ICreateDelegateInstance {
#region ICreateDelegateInstance Members
public IExpression Instance {
get { throw new NotImplementedException(); }
}
public bool IsVirtualDelegate {
get { throw new NotImplementedException(); }
}
public IMethodReference MethodToCallViaDelegate {
get {
Contract.Ensures(Contract.Result<IMethodReference>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that invokes an object constructor.
/// </summary>
[ContractClass(typeof(ICreateObjectInstanceContract))]
public interface ICreateObjectInstance : IExpression {
/// <summary>
/// The arguments to pass to the constructor.
/// </summary>
IEnumerable<IExpression> Arguments { get; }
/// <summary>
/// The contructor method to call.
/// </summary>
IMethodReference MethodToCall { get; }
}
#region ICreateObjectInstance contract binding
[ContractClassFor(typeof(ICreateObjectInstance))]
abstract class ICreateObjectInstanceContract : ICreateObjectInstance {
#region ICreateObjectInstance Members
public IEnumerable<IExpression> Arguments {
get {
Contract.Ensures(Contract.Result<IEnumerable<IExpression>>() != null);
throw new NotImplementedException();
}
}
public IMethodReference MethodToCall {
get {
Contract.Ensures(Contract.Result<IMethodReference>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that results in the default value of a given type.
/// </summary>
[ContractClass(typeof(IDefaultValueContract))]
public interface IDefaultValue : IExpression {
/// <summary>
/// The type whose default value is the result of this expression.
/// </summary>
ITypeReference DefaultValueType { get; }
}
#region IDefaultValue contract binding
[ContractClassFor(typeof(IDefaultValue))]
abstract class IDefaultValueContract : IDefaultValue {
#region IDefaultValue Members
public ITypeReference DefaultValueType {
get {
Contract.Ensures(Contract.Result<ITypeReference>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that divides the value of the left operand by the value of the right operand.
/// </summary>
public interface IDivision : IBinaryOperation {
/// <summary>
/// If true the operands must be integers and are treated as being unsigned for the purpose of the division.
/// </summary>
bool TreatOperandsAsUnsignedIntegers {
get;
}
}
/// <summary>
/// An expression that results in the value on top of the implicit operand stack.
/// </summary>
public interface IDupValue : IExpression {
}
/// <summary>
/// An expression that results in true if both operands represent the same value or object.
/// </summary>
public interface IEquality : IBinaryOperation {
}
/// <summary>
/// An expression that computes the bitwise exclusive or of the left and right operands.
/// </summary>
public interface IExclusiveOr : IBinaryOperation {
}
/// <summary>
/// An expression results in a value of some type.
/// </summary>
[ContractClass(typeof(IExpressionContract))]
public interface IExpression : IObjectWithLocations {
/// <summary>
/// Calls the visitor.Visit(T) method where T is the most derived object model node interface type implemented by the concrete type
/// of the object implementing IStatement. The dispatch method does not invoke Dispatch on any child objects. If child traversal
/// is desired, the implementations of the Visit methods should do the subsequent dispatching.
/// </summary>
void Dispatch(ICodeVisitor visitor);
/// <summary>
/// The type of value the expression will evaluate to, as determined at compile time.
/// </summary>
ITypeReference Type { get; }
}
[ContractClassFor(typeof(IExpression))]
abstract class IExpressionContract : IExpression {
public void Dispatch(ICodeVisitor visitor) {
Contract.Requires(visitor != null);
throw new NotImplementedException();
}
public ITypeReference Type {
get {
Contract.Ensures(Contract.Result<ITypeReference>() != null);
throw new NotImplementedException();
}
}
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
}
/// <summary>
/// A source location to proffer from IOperation.Location and indicating the source extent (or extents) of an expression in the source language.
/// Such locations are ignored when producing a PDB file, since PDB files only record the source extents of statements.
/// </summary>
[ContractClass(typeof(IExpressionSourceLocationContract))]
public interface IExpressionSourceLocation : ILocation {
/// <summary>
/// Zero or more locations that correspond to an expression.
/// </summary>
IPrimarySourceLocation PrimarySourceLocation { get; }
}
#region IExpressionSourceLocation contract binding
[ContractClassFor(typeof(IExpressionSourceLocation))]
abstract class IExpressionSourceLocationContract : IExpressionSourceLocation {
public IPrimarySourceLocation PrimarySourceLocation {
get {
Contract.Ensures(Contract.Result<IPrimarySourceLocation>() != null);
throw new NotImplementedException();
}
}
public IDocument Document {
get { throw new NotImplementedException(); }
}
}
#endregion
/// <summary>
/// An expression that results in an instance of System.Type that represents the compile time type that has been paired with a runtime value via a typed reference.
/// This corresponds to the __reftype operator in C#.
/// </summary>
public interface IGetTypeOfTypedReference : IExpression {
/// <summary>
/// An expression that results in a value of type System.TypedReference.
/// </summary>
IExpression TypedReference { get; }
}
/// <summary>
/// An expression that converts the typed reference value resulting from evaluating TypedReference to a value of the type specified by TargetType.
/// This corresponds to the __refvalue operator in C#.
/// </summary>
[ContractClass(typeof(IGetValueOfTypedReferenceContract))]
public interface IGetValueOfTypedReference : IExpression {
/// <summary>
/// An expression that results in a value of type System.TypedReference.
/// </summary>
IExpression TypedReference { get; }
/// <summary>
/// The type to which the value part of the typed reference must be converted.
/// </summary>
ITypeReference TargetType { get; }
}
#region IGetValueOfTypedReference contract binding
[ContractClassFor(typeof(IGetValueOfTypedReference))]
abstract class IGetValueOfTypedReferenceContract : IGetValueOfTypedReference {
#region IGetValueOfTypedReference Members
public IExpression TypedReference {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
public ITypeReference TargetType {
get {
Contract.Ensures(Contract.Result<ITypeReference>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that results in true if the value of the left operand is greater than the value of the right operand.
/// </summary>
public interface IGreaterThan : IBinaryOperation {
/// <summary>
/// If the operands are integers, use unsigned comparison. If the operands are floating point numbers, return true if the operands are unordered.
/// </summary>
bool IsUnsignedOrUnordered { get; }
}
/// <summary>
/// An expression that results in true if the value of the left operand is greater than or equal to the value of the right operand.
/// </summary>
public interface IGreaterThanOrEqual : IBinaryOperation {
/// <summary>
/// If the operands are integers, use unsigned comparison. If the operands are floating point numbers, return true if the operands are unordered.
/// </summary>
bool IsUnsignedOrUnordered { get; }
}
/// <summary>
/// An expression that results in the value of the left operand, shifted left by the number of bits specified by the value of the right operand.
/// </summary>
public interface ILeftShift : IBinaryOperation {
}
/// <summary>
/// An expression that results in true if the value of the left operand is less than the value of the right operand.
/// </summary>
public interface ILessThan : IBinaryOperation {
/// <summary>
/// If the operands are integers, use unsigned comparison. If the operands are floating point numbers, return true if the operands are unordered.
/// </summary>
bool IsUnsignedOrUnordered { get; }
}
/// <summary>
/// An expression that results in true if the value of the left operand is less than or equal to the value of the right operand.
/// </summary>
public interface ILessThanOrEqual : IBinaryOperation {
/// <summary>
/// If the operands are integers, use unsigned comparison. If the operands are floating point numbers, return true if the operands are unordered.
/// </summary>
bool IsUnsignedOrUnordered { get; }
}
/// <summary>
/// An expression that results in the logical negation of the boolean value of the given operand.
/// </summary>
public interface ILogicalNot : IUnaryOperation {
}
/// <summary>
/// An expression that creates a typed reference (a pair consisting of a reference to a runtime value and a compile time type).
/// This is similar to what happens when a value type is boxed, except that the boxed value can be an object and
/// the runtime type of the boxed value can be a subtype of the compile time type that is associated with the boxed valued.
/// </summary>
public interface IMakeTypedReference : IExpression {
/// <summary>
/// The value to box in a typed reference.
/// </summary>
IExpression Operand { get; }
}
/// <summary>
/// An expression that invokes a method.
/// </summary>
[ContractClass(typeof(IMethodCallContract))]
public interface IMethodCall : IExpression {
/// <summary>
/// The arguments to pass to the method, after they have been converted to match the parameters of the resolved method.
/// </summary>
IEnumerable<IExpression> Arguments { get; }
/// <summary>
/// True if this method call terminates the calling method and reuses the arguments of the calling method as the arguments of the called method.
/// </summary>
bool IsJumpCall {
get;
}
/// <summary>
/// True if the method to call is determined at run time, based on the runtime type of ThisArgument.
/// </summary>
bool IsVirtualCall {
get;
//^ ensures result ==> this.MethodToCall.ResolvedMethod.IsVirtual;
}
/// <summary>
/// True if the method to call is static (has no this parameter).
/// </summary>
bool IsStaticCall {
get;
//^ ensures result ==> this.MethodToCall.ResolvedMethod.IsStatic;
}
/// <summary>
/// True if this method call terminates the calling method. It indicates that the calling method's stack frame is not required
/// and can be removed before executing the call.
/// </summary>
bool IsTailCall {
get;
}
/// <summary>
/// The method to call.
/// </summary>
IMethodReference MethodToCall { get; }
/// <summary>
/// The expression that results in the value that must be passed as the value of the this argument of the resolved method.
/// </summary>
IExpression ThisArgument {
get;
//^ requires !this.IsStaticCall;
}
}
#region IMethodCall contract binding
[ContractClassFor(typeof(IMethodCall))]
abstract class IMethodCallContract : IMethodCall {
#region IMethodCall Members
public IEnumerable<IExpression> Arguments {
get {
Contract.Ensures(Contract.Result<IEnumerable<IExpression>>() != null);
throw new NotImplementedException();
}
}
public bool IsJumpCall {
get { throw new NotImplementedException(); }
}
public bool IsVirtualCall {
get { throw new NotImplementedException(); }
}
public bool IsStaticCall {
get { throw new NotImplementedException(); }
}
public bool IsTailCall {
get { throw new NotImplementedException(); }
}
public IMethodReference MethodToCall {
get {
Contract.Ensures(Contract.Result<IMethodReference>() != null);
throw new NotImplementedException();
}
}
public IExpression ThisArgument {
get {
Contract.Requires(!this.IsStaticCall && !this.IsJumpCall);
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that results in the remainder of dividing value the left operand by the value of the right operand.
/// </summary>
public interface IModulus : IBinaryOperation {
/// <summary>
/// If true the operands must be integers and are treated as being unsigned for the purpose of the modulus.
/// </summary>
bool TreatOperandsAsUnsignedIntegers {
get;
}
}
/// <summary>
/// An expression that multiplies the value of the left operand by the value of the right operand.
/// </summary>
public interface IMultiplication : IBinaryOperation {
/// <summary>
/// The multiplication must be performed with a check for arithmetic overflow and the operands must be integers.
/// </summary>
bool CheckOverflow {
get;
}
/// <summary>
/// If true the operands must be integers and are treated as being unsigned for the purpose of the multiplication. This only makes a difference if CheckOverflow is true as well.
/// </summary>
bool TreatOperandsAsUnsignedIntegers {
get;
}
}
/// <summary>
/// An expression that represents a (name, value) pair and that is typically used in method calls, custom attributes and object initializers.
/// </summary>
[ContractClass(typeof(INamedArgumentContract))]
public interface INamedArgument : IExpression {
/// <summary>
/// The name of the parameter or property or field that corresponds to the argument.
/// </summary>
IName ArgumentName { get; }
/// <summary>
/// The value of the argument.
/// </summary>
IExpression ArgumentValue { get; }
/// <summary>
/// Returns either null or the parameter or property or field that corresponds to this argument.
/// </summary>
object/*?*/ ResolvedDefinition {
get;
//^ ensures result == null || result is IParameterDefinition || result is IPropertyDefinition || result is IFieldDefinition;
}
/// <summary>
/// If true, the resolved definition is a property whose getter is virtual.
/// </summary>
bool GetterIsVirtual { get; }
/// <summary>
/// If true, the resolved definition is a property whose setter is virtual.
/// </summary>
bool SetterIsVirtual { get; }
}
#region INamedArgument contract binding
[ContractClassFor(typeof(INamedArgument))]
abstract class INamedArgumentContract : INamedArgument {
#region INamedArgument Members
/// <summary>
/// The name of the parameter or property or field that corresponds to the argument.
/// </summary>
public IName ArgumentName {
get {
Contract.Ensures(Contract.Result<IName>() != null);
throw new NotImplementedException();
}
}
/// <summary>
/// The value of the argument.
/// </summary>
public IExpression ArgumentValue {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
/// <summary>
/// Returns either null or the parameter or property or field that corresponds to this argument.
/// </summary>
public object ResolvedDefinition {
get {
Contract.Ensures(Contract.Result<object>() == null || Contract.Result<object>() is IParameterDefinition ||
Contract.Result<object>() is IPropertyDefinition || Contract.Result<object>() is IFieldDefinition);
throw new NotImplementedException();
}
}
/// <summary>
/// If true, the resolved definition is a property whose getter is virtual.
/// </summary>
public bool GetterIsVirtual {
get { throw new NotImplementedException(); }
}
/// <summary>
/// If true, the resolved definition is a property whose setter is virtual.
/// </summary>
public bool SetterIsVirtual {
get { throw new NotImplementedException(); }
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that results in false if both operands represent the same value or object.
/// </summary>
public interface INotEquality : IBinaryOperation {
}
/// <summary>
/// An expression that represents the value that a target expression had at the start of the method that has a postcondition that includes this expression.
/// This node must be replaced before converting the Code Model to IL.
/// </summary>
[ContractClass(typeof(IOldValueContract))]
public interface IOldValue : IExpression {
/// <summary>
/// The expression whose value at the start of method execution is referred to in the method postcondition.
/// </summary>
IExpression Expression { get; }
}
#region IOldValue contract binding
[ContractClassFor(typeof(IOldValue))]
abstract class IOldValueContract : IOldValue {
#region IOldValue Members
public IExpression Expression {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that results in the bitwise not (1's complement) of the operand.
/// </summary>
public interface IOnesComplement : IUnaryOperation {
}
/// <summary>
/// An expression that must match an out parameter of a method. The method assigns a value to the target Expression.
/// </summary>
public interface IOutArgument : IExpression {
/// <summary>
/// The target that is assigned to as a result of the method call.
/// </summary>
ITargetExpression Expression { get; }
}
/// <summary>
/// An expression that calls a method indirectly via a function pointer.
/// </summary>
[ContractClass(typeof(IPointerCallContract))]
public interface IPointerCall : IExpression {
/// <summary>
/// The arguments to pass to the method, after they have been converted to match the parameters of the method.
/// </summary>
IEnumerable<IExpression> Arguments { get; }
/// <summary>
/// True if this method call terminates the calling method. It indicates that the calling method's stack frame is not required
/// and can be removed before executing the call.
/// </summary>
bool IsTailCall {
get;
}
/// <summary>
/// An expression that results at runtime in a function pointer that points to the actual method to call.
/// </summary>
IExpression Pointer {
get;
}
}
#region IPointerCall contract binding
[ContractClassFor(typeof(IPointerCall))]
abstract class IPointerCallContract : IPointerCall {
public IEnumerable<IExpression> Arguments {
get {
Contract.Ensures(Contract.Result<IEnumerable<IExpression>>() != null);
throw new NotImplementedException();
}
}
public bool IsTailCall {
get { throw new NotImplementedException(); }
}
public IExpression Pointer {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
Contract.Ensures(Contract.Result<IExpression>().Type is IFunctionPointerTypeReference);
throw new NotImplementedException();
}
}
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
}
#endregion
/// <summary>
/// An expression that results in the value on top of the implicit operand stack and that also pops that value from the stack.
/// </summary>
public interface IPopValue : IExpression {
}
/// <summary>
/// An expression that must match a ref parameter of a method.
/// The value, before the call, of the addressable Expression is passed to the method and the method may assign a new value to the
/// addressable Expression during the call.
/// </summary>
[ContractClass(typeof(IRefArgumentContract))]
public interface IRefArgument : IExpression {
/// <summary>
/// The target that is assigned to as a result of the method call, but whose value is also passed to the method at the start of the call.
/// </summary>
IAddressableExpression Expression { get; }
}
#region IRefArgument contract binding
[ContractClassFor(typeof(IRefArgument))]
abstract class IRefArgumentContract : IRefArgument {
#region IRefArgument Members
public IAddressableExpression Expression {
get {
Contract.Ensures(Contract.Result<IAddressableExpression>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that refers to the return value of a method.
/// This node must be replaced before converting the Code Model to IL.
/// </summary>
public interface IReturnValue : IExpression {
}
/// <summary>
/// An expression that results in the value of the left operand, shifted right by the number of bits specified by the value of the right operand, duplicating the sign bit.
/// </summary>
public interface IRightShift : IBinaryOperation {
}
/// <summary>
/// An expression that denotes the runtime argument handle of a method that accepts extra arguments.
/// This expression corresponds to __arglist in C# and results in a value that can be used as the argument to the constructor for System.ArgIterator.
/// </summary>
public interface IRuntimeArgumentHandleExpression : IExpression {
}
/// <summary>
/// An expression that computes the memory size of instances of a given type at runtime.
/// </summary>
public interface ISizeOf : IExpression {
/// <summary>
/// The type to size.
/// </summary>
ITypeReference TypeToSize { get; }
}
/// <summary>
/// An expression that allocates an array on the call stack.
/// </summary>
public interface IStackArrayCreate : IExpression {
/// <summary>
/// The type of the elements of the stack array. This type must be unmanaged (contain no pointers to objects on the heap managed by the garbage collector).
/// </summary>
ITypeReference ElementType { get; }
/// <summary>
/// The size (number of bytes) of the stack array.
/// </summary>
IExpression Size { get; }
}
/// <summary>
/// An expression that subtracts the value of the right operand from the value of the left operand.
/// </summary>
public interface ISubtraction : IBinaryOperation {
/// <summary>
/// The subtraction must be performed with a check for arithmetic overflow and the operands must be integers.
/// </summary>
bool CheckOverflow {
get;
}
/// <summary>
/// If true the operands must be integers and are treated as being unsigned for the purpose of the subtraction. This only makes a difference if CheckOverflow is true as well.
/// </summary>
bool TreatOperandsAsUnsignedIntegers {
get;
}
}
/// <summary>
/// An expression that can be the target of an assignment statement or that can be passed an argument to an out parameter.
/// </summary>
[ContractClass(typeof(ITargetExpressionContract))]
public interface ITargetExpression : IExpression {
/// <summary>
/// If Definition is a field and the field is not aligned with natural size of its type, this property specifies the actual alignment.
/// For example, if the field is byte aligned, then the result of this property is 1. Likewise, 2 for word (16-bit) alignment and 4 for
/// double word (32-bit alignment).
/// </summary>
byte Alignment {
get;
//^ requires IsUnaligned;
//^ ensures result == 1 || result == 2 || result == 4;
}
/// <summary>
/// The local variable, parameter, field, property, array element or pointer target that this expression denotes.
/// </summary>
object Definition {
get;
//^ ensures result is ILocalDefinition || result is IParameterDefinition || result is IFieldReference || result is IArrayIndexer
//^ || result is IAddressDereference || result is IPropertyDefinition || result is IThisReference;
//^ ensures result is IPropertyDefinition ==> ((IPropertyDefinition)result).Setter != null;
}
/// <summary>
/// If true, the resolved definition is a property whose getter is virtual.
/// </summary>
bool GetterIsVirtual { get; }
/// <summary>
/// If true, the resolved definition is a property whose setter is virtual.
/// </summary>
bool SetterIsVirtual { get; }
/// <summary>
/// The instance to be used if this.Definition is an instance field/property or array indexer.
/// </summary>
IExpression/*?*/ Instance { get; }
/// <summary>
/// True if the definition is a field and the field is not aligned with the natural size of its type.
/// For example if the field type is Int32 and the field is aligned on an Int16 boundary.
/// </summary>
bool IsUnaligned { get; }
/// <summary>
/// The bound Definition is a volatile field and its contents may not be cached.
/// </summary>
bool IsVolatile { get; }
}
#region ITargetExpression contract binding
[ContractClassFor(typeof(ITargetExpression))]
abstract class ITargetExpressionContract : ITargetExpression {
#region ITargetExpression Members
public byte Alignment {
get {
Contract.Requires(this.IsUnaligned);
Contract.Ensures(Contract.Result<byte>() == 1 || Contract.Result<byte>() == 2 || Contract.Result<byte>() == 4);
throw new NotImplementedException();
}
}
public object Definition {
get {
Contract.Ensures(Contract.Result<object>() != null);
Contract.Ensures(Contract.Result<object>() is ILocalDefinition || Contract.Result<object>() is IParameterDefinition ||
Contract.Result<object>() is IFieldReference || Contract.Result<object>() is IArrayIndexer ||
Contract.Result<object>() is IAddressDereference || Contract.Result<object>() is IPropertyDefinition || Contract.Result<object>() is IThisReference);
Contract.Ensures(!(Contract.Result<object>() is IPropertyDefinition) || ((IPropertyDefinition)Contract.Result<object>()).Setter != null);
throw new NotImplementedException();
}
}
/// <summary>
/// If true, the resolved definition is a property whose getter is virtual.
/// </summary>
public bool GetterIsVirtual {
get { throw new NotImplementedException(); }
}
/// <summary>
/// If true, the resolved definition is a property whose setter is virtual.
/// </summary>
public bool SetterIsVirtual {
get { throw new NotImplementedException(); }
}
public IExpression Instance {
get { throw new NotImplementedException(); }
}
public bool IsUnaligned {
get { throw new NotImplementedException(); }
}
public bool IsVolatile {
get { throw new NotImplementedException(); }
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// Wraps an expression that represents a storage location that can be assigned to or whose address can be computed and passed as a parameter.
/// Furthermore, this storage location must a string. Also wraps expressions supplying the starting position and length of a substring of the target string.
/// An assignment of a string to a slice results in a new string where the slice has been replaced with given string.
/// </summary>
public interface ITargetSliceExpression : IAddressableExpression {
/// <summary>
/// An expression that represents the index of the first character of a string slice.
/// </summary>
IExpression StartOfSlice { get; }
/// <summary>
/// An expression that represents the length of the slice.
/// </summary>
IExpression LengthOfSlice { get; }
}
/// <summary>
/// An expression that binds to the current object instance.
/// </summary>
public interface IThisReference : IExpression {
}
/// <summary>
/// An expression that results in an instance of RuntimeFieldHandle, RuntimeMethodHandle or RuntimeTypeHandle.
/// </summary>
public interface ITokenOf : IExpression {
/// <summary>
/// An instance of IFieldReference, IMethodReference or ITypeReference.
/// </summary>
object Definition {
get;
//^ ensures result is IFieldReference || result is IMethodReference || result is ITypeReference;
}
}
/// <summary>
/// An expression that results in a System.Type instance.
/// </summary>
public interface ITypeOf : IExpression {
/// <summary>
/// The type that will be represented by the System.Type instance.
/// </summary>
ITypeReference TypeToGet { get; }
}
/// <summary>
/// An expression that results in the arithmetic negation of the given operand.
/// </summary>
public interface IUnaryNegation : IUnaryOperation {
/// <summary>
/// The negation must be performed with a check for arithmetic overflow and the operand must be an integer.
/// </summary>
bool CheckOverflow {
get;
}
}
/// <summary>
/// An operation performed on a single operand.
/// </summary>
[ContractClass(typeof(IUnaryOperationContract))]
public interface IUnaryOperation : IExpression {
/// <summary>
/// The value on which the operation is performed.
/// </summary>
IExpression Operand { get; }
}
#region IUnaryOperation contract binding
[ContractClassFor(typeof(IUnaryOperation))]
abstract class IUnaryOperationContract : IUnaryOperation {
#region IUnaryOperation Members
public IExpression Operand {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
/// <summary>
/// An expression that results in the arithmetic value of the given operand.
/// </summary>
public interface IUnaryPlus : IUnaryOperation {
}
/// <summary>
/// An expression that results in the length of a vector (zero-based one-dimensional array).
/// </summary>
[ContractClass(typeof(IVectorLengthContract))]
public interface IVectorLength : IExpression {
/// <summary>
/// An expression that results in a value of a vector (zero-based one-dimensional array) type.
/// </summary>
IExpression Vector { get; }
}
#region IVectorLength contract binding
[ContractClassFor(typeof(IVectorLength))]
abstract class IVectorLengthContract : IVectorLength {
#region IVectorLength Members
public IExpression Vector {
get {
Contract.Ensures(Contract.Result<IExpression>() != null);
throw new NotImplementedException();
}
}
#endregion
#region IExpression Members
public void Dispatch(ICodeVisitor visitor) {
throw new NotImplementedException();
}
public ITypeReference Type {
get { throw new NotImplementedException(); }
}
#endregion
#region IObjectWithLocations Members
public IEnumerable<ILocation> Locations {
get { throw new NotImplementedException(); }
}
#endregion
}
#endregion
}
| {
"content_hash": "2590e0a0fb6e7ae9fbd01fd4eb38704f",
"timestamp": "",
"source": "github",
"line_count": 2221,
"max_line_length": 181,
"avg_line_length": 29.523187753264295,
"alnum_prop": 0.6720348934742493,
"repo_name": "mike-barnett/cci",
"id": "b52efc3ba3ef97c5740de2940e689f15f148b4be",
"size": "65571",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CoreObjectModel/CodeModel/Expressions.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "11220269"
}
],
"symlink_target": ""
} |
We would love for you to contribute to Angular 2 Material and help make it ever better!
As a contributor, here are the guidelines we would like you to follow:
- [Code of Conduct](#coc)
- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit-pr)
- [Coding Rules](#rules)
- [Commit Message Guidelines](#commit)
- [Signing the CLA](#cla)
## <a name="coc"></a> Code of Conduct
Help us keep Angular open and inclusive. Please read and follow our [Code of Conduct][coc].
## <a name="question"></a> Got a Question or Problem?
If you have questions about how to *use* Angular Material, please direct them to the
[Google Group][material-group] discussion list or [StackOverflow][stackoverflow].
Please note that Angular 2 Material is still in very early development, and the team's capacity
to answer usage questions is limited. Community chat is also available on [Gitter][gitter].
## <a name="issue"></a> Found an Issue?
If you find a bug in the source code or a mistake in the documentation, you can help us by
[submitting an issue](#submit-issue) to our [GitHub Repository][github]. Including an issue
reproduction (via CodePen, JsBin, Plunkr, etc.) is the absolute best way to help the team quickly
diagnose the problem. Screenshots are also helpful.
You can help the team even more and [submit a Pull Request](#submit-pr) with a fix.
## <a name="feature"></a> Want a Feature?
You can *request* a new feature by [submitting an issue](#submit-issue) to our [GitHub
Repository][github]. If you would like to *implement* a new feature, please submit an issue with
a proposal for your work first, to be sure that we can use it. Angular 2 Material is in very early
stages and we are not ready to accept major contributions ahead of the full release.
Please consider what kind of change it is:
* For a **Major Feature**, first open an issue and outline your proposal so that it can be
discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
and help you to craft the change so that it is successfully accepted into the project.
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
### <a name="submit-issue"></a> Submitting an Issue
Before you submit an issue, search the archive, maybe your question was already answered.
If your issue appears to be a bug, and hasn't been reported, open a new issue.
Help us to maximize the effort we can spend fixing issues and adding new
features by not reporting duplicate issues. Providing the following information will increase the
chances of your issue being dealt with quickly:
* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
* **Angular and Material Versions** - which versions of Angular and Material are affected
(e.g. 2.0.0-alpha.53)
* **Motivation for or Use Case** - explain what are you trying to do and why the current behavior
is a bug for you
* **Browsers and Operating System** - is this a problem with all browsers?
* **Reproduce the Error** - provide a live example (using [CodePen][codepen], [JsBin][jsbin],
[Plunker][plunker], etc.) or a unambiguous set of steps
* **Screenshots** - Due to the visual nature of Angular Material, screenshots can help the team
triage issues far more quickly than a text descrption.
* **Related Issues** - has a similar issue been reported before?
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
causing the problem (line of code or commit)
You can file new issues by providing the above information [here](https://github.com/angular/material2/issues/new).
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
Before you submit your Pull Request (PR) consider the following guidelines:
* Search [GitHub](https://github.com/angular/material2/pulls) for an open or closed PR
that relates to your submission. You don't want to duplicate effort.
* Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.
We cannot accept code without this.
* Make your changes in a new git branch:
```shell
git checkout -b my-fix-branch master
```
* Create your patch, **including appropriate test cases**.
* Follow our [Coding Rules](#rules).
* Test your changes with our supported browsers and screen readers.
* Run the full Angular Material test suite, as described in the [developer documentation][dev-doc],
and ensure that all tests pass.
* Commit your changes using a descriptive commit message that follows our
[commit message conventions](#commit). Adherence to these conventions
is necessary because release notes are automatically generated from these messages.
```shell
git commit -a
```
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
* Push your branch to GitHub:
```shell
git push my-fork my-fix-branch
```
* In GitHub, send a pull request to `material2:master`.
* If we suggest changes then:
* Make the required updates.
* Re-run the Angular Material test suites to ensure tests are still passing.
* Rebase your branch and force push to your GitHub repository (this will update your Pull
Request):
```shell
git rebase master -i
git push -f
```
That's it! Thank you for your contribution!
#### After your pull request is merged
After your pull request is merged, you can safely delete your branch and pull the changes
from the main (upstream) repository:
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as
follows:
```shell
git push my-fork --delete my-fix-branch
```
* Check out the master branch:
```shell
git checkout master -f
```
* Delete the local branch:
```shell
git branch -D my-fix-branch
```
* Update your master with the latest upstream version:
```shell
git pull --ff upstream master
```
## <a name="rules"></a> Coding Rules
To ensure consistency throughout the source code, keep these rules in mind as you are working:
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
* All public API methods **must be documented**. (Details TBD).
* We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at
**100 characters**.
## <a name="commit"></a> Commit Message Guidelines
We have very precise rules over how our git commit messages can be formatted. This leads to **more
readable messages** that are easy to follow when looking through the **project history**. But also,
we use the git commit messages to **generate the Angular Material change log**.
### Commit Message Format
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:
```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```
The **header** is mandatory and the **scope** of the header is optional.
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read on GitHub as well as in various git tools.
### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of
the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is
the SHA of the commit being reverted.
### Type
Must be one of the following:
* **feat**: A new feature
* **fix**: A bug fix
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
semi-colons, etc)
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing tests or correcting existing tests
* **build**: Changes that affect the build system, CI configuration or external dependencies
(example scopes: gulp, broccoli, npm)
* **chore**: Other changes that don't modify `src` or `test` files
### Scope
The scope could be anything specifying place of the commit change. For example
`datepicker`, `dialog`, etc.
### Subject
The subject contains succinct description of the change:
* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize first letter
* no dot (.) at the end
### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.
### Footer
The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
The rest of the commit message is then used for this.
A detailed explanation can be found in this [document][commit-message-format].
## <a name="cla"></a> Signing the CLA
Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code
changes to be accepted, the CLA must be signed. It's a quick process, we promise!
* For individuals we have a [simple click-through form][individual-cla].
* For corporations we'll need you to
[print, sign and one of scan+email, fax or mail the form][corporate-cla].
[material-group]: https://groups.google.com/forum/#!forum/angular-material2
[coc]: https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/preview
[corporate-cla]: http://code.google.com/legal/corporate-cla-v1.0.html
[dev-doc]: https://github.com/angular/material2/blob/master/DEV_ENVIRONMENT.md
[github]: https://github.com/angular/material2
[gitter]: https://gitter.im/angular/material2
[individual-cla]: http://code.google.com/legal/individual-cla-v1.0.html
[js-style-guide]: https://google.github.io/styleguide/jsguide.html
[codepen]: http://codepen.io/
[jsbin]: http://jsbin.com/
[jsfiddle]: http://jsfiddle.net/
[plunker]: http://plnkr.co/edit
[runnable]: http://runnable.com/
[stackoverflow]: http://stackoverflow.com/
| {
"content_hash": "a1de2bcf8da0fac977626c10b272b893",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 115,
"avg_line_length": 42.299180327868854,
"alnum_prop": 0.7332622807867455,
"repo_name": "badjilounes/material2",
"id": "333a29371e5d7b5e7d0bcc86e0eba7345c4ae66a",
"size": "10359",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CONTRIBUTING.md",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "144635"
},
{
"name": "HTML",
"bytes": "95075"
},
{
"name": "JavaScript",
"bytes": "16943"
},
{
"name": "Shell",
"bytes": "10734"
},
{
"name": "TypeScript",
"bytes": "1080740"
}
],
"symlink_target": ""
} |
define(
[
'react'
],
function (React) {
var Attachment = React.createClass({
render: function() {
return (
<div className="attachment-block clearfix">
<img className="attachment-img" src={this.props.picture} alt="attachment image" />
<div className="attachment-pushed">
<h4 className="attachment-heading">
<a href={this.props.link}>
{this.props.title}
</a>
</h4>
<div className="attachment-text">
{this.props.content}
<a href={this.props.link}>more</a>
</div>
</div>
</div>
)
}
});
return Attachment;
}
) | {
"content_hash": "cfa24965ade1cd88e67e6331937e5587",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 106,
"avg_line_length": 35.37931034482759,
"alnum_prop": 0.34210526315789475,
"repo_name": "anbarasimanoharan/FocusDashboard",
"id": "d5e5eee47a2746c9963a7687e703e9fb43c27de4",
"size": "1026",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "reactjs-adminlte/public/src/ui-elements/general/js/components/page-ui-elements/post/attachment.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "648576"
},
{
"name": "HTML",
"bytes": "1785324"
},
{
"name": "JavaScript",
"bytes": "6289623"
},
{
"name": "PHP",
"bytes": "1742"
}
],
"symlink_target": ""
} |
package com.yoloswag.alex.seetitel;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntity;
@SuppressWarnings("deprecation")
public class AndroidMultiPartEntity extends MultipartEntity
{
private final ProgressListener listener;
public AndroidMultiPartEntity(final ProgressListener listener) {
super();
this.listener = listener;
}
public AndroidMultiPartEntity(final HttpMultipartMode mode,
final ProgressListener listener) {
super(mode);
this.listener = listener;
}
public AndroidMultiPartEntity(HttpMultipartMode mode, final String boundary,
final Charset charset, final ProgressListener listener) {
super(mode, boundary, charset);
this.listener = listener;
}
@Override
public void writeTo(final OutputStream outstream) throws IOException {
super.writeTo(new CountingOutputStream(outstream, this.listener));
}
public static interface ProgressListener {
void transferred(long num);
}
public static class CountingOutputStream extends FilterOutputStream {
private final ProgressListener listener;
private long transferred;
public CountingOutputStream(final OutputStream out,
final ProgressListener listener) {
super(out);
this.listener = listener;
this.transferred = 0;
}
public void write(byte[] b, int off, int len) throws IOException {
out.write(b, off, len);
this.transferred += len;
this.listener.transferred(this.transferred);
}
public void write(int b) throws IOException {
out.write(b);
this.transferred++;
this.listener.transferred(this.transferred);
}
}
}
| {
"content_hash": "8fe73cfab54fab4ed1ed24fbac650cfa",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 95,
"avg_line_length": 33.32835820895522,
"alnum_prop": 0.5982982534706672,
"repo_name": "SeetiTel/Android",
"id": "9d5824f0e8b3e06d9b4577bc5cb67992a558b33c",
"size": "2233",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/yoloswag/alex/seetitel/AndroidMultiPartEntity.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "58674"
}
],
"symlink_target": ""
} |
#include "utf8fcns.h"
#include <boost/regex.hpp>
#include <boost/regex/icu.hpp>
#include <unicode/unistr.h>
// "private" utf8fcns namespace static variables
namespace utf8fcns
{
static const std::string word_pattern("\\w+");
static const boost::u32regex wordinit_exp = boost::make_u32regex(word_pattern);
static const std::string wordinit_pattern("(\\w)(\\w*)");
static const boost::u32regex wordinit_exp = boost::make_u32regex(wordinit_pattern);
static const std::string space_pattern("\\s");
static const boost::u32regex word_exp = boost::make_u32regex(space_pattern);
static const std::string perl_pattern("[\.\[\{\}\(\)\\\*\+\?\|\^\$]");
static const boost::u32regex perl_exp = boost::make_u32regex(perl_pattern);
std::string form_prefix_pattern(const std::vector<std::string> &prefixes)
{
std::string prefix;
std::string prefix_pattern("^\\s*(");
std::vector<std::string>::const_iterator it=prefixes.begin();
prefix = *it;
boost::u32regex_replace(prefix.begin(),prefix.end(),utf8fcns::perl_exp,"\\$1");
prefix_pattern += prefix;
for (++it; it!=prefixes.end(); ++it)
{
prefix = *it;
boost::u32regex_replace(prefix.begin(),prefix.end(),utf8fcns::perl_exp,"\\$1");
prefix_pattern += '|' + prefix;
}
prefix_pattern += ")\\s+";
return prefix_pattern;
}
/**
* @brief Returns abbreviation of x
* @param string to be abbreviated
* @param (Optional) Only abbreviate if x is longer than len (default=0: abbreviate all)
* @return abbreviated string
*/
std::string utf8fcns::abbr(std::string x, const size_t len)
{
if (len > 0 && len < utf8fcns::len(x))
{
// keep only the first letter of words
boost::u32regex_replace(x.begin(),x.end(),utf8fcns::wordinit_exp,"$1");
// eliminate all spaces
boost::u32regex_replace(x.begin(),x.end(),utf8fcns::space_pattern,"");
}
return x;
}
/**
* @brief Converts first letter of first word to a capital letter and all other letters to lower case
* @param input string
* @return capitalized string
*/
std::string utf8fcns::cap(std::string x)
{
boost::match_results<std::string::const_iterator> what;
// Run a single search to look for the first word. If success, format the first
// letter of the word to be capitalized.
if (u32regex_search(x.start, x.end, what, utf8fcns::wordinit_exp))
{
// format first word of x: first letter, upper-case, rest lower-case
what.format("\u$1\L$2\E");
// search again just in case (to account for multi-byte letters)
if (u32regex_search(x.start, x.end, what, utf8fcns::word_exp))
// force lower-case letters on all subsequent words
boost::u32regex_replace(what[0].last,x.end(),utf8fcns::word_exp,"\L$&\E");
}
return x;
}
/**
* @brief Converts first letter of first word to a capital letter. All other letters are kept the same
* @param input string
* @return capitalized string
*/
std::string utf8fcns::cap2(const std::string &x)
{
boost::match_results<std::string::const_iterator> what;
// Run a single search to look for the first word. If success, format the first
// letter of the word to be capitalized.
if (u32regex_search(x.start, x.end, what, utf8fcns::wordinit_exp))
what.format("\u$1$2");
return x;
}
/**
* @brief Converts first letter of every word to a capital letter and all other letters to lower case
* @param input string
* @return capitalized string
*/
std::string utf8fcns::caps(std::string x)
{
u32regex_replace(x.start, x.end, utf8fcns::wordinit_exp, "\u$1\L$2\E");
return x;
}
/**
* @brief Converts first letter of every word to a capital letter. All other letters are kept the same
* @param input string
* @return capitalized string
*/
std::string utf8fcns::caps2(std::string x)
{
u32regex_replace(x.start, x.end, utf8fcns::word_exp, "\u$&");
return x;
}
/**
* @brief Returns first len characters from the left of the string a.
* @param Input string
* @param Number of characters to return. A negative number produces the entire string.
* @return Truncated string
*/
std::string utf8fcns::cut(const std::string &a, const size_t len)
{
std::string rval;
if (len<0)
{
rval = a;
}
else if (len>0)
{
// perform the function in UnicodeString
icu::UnicodeString ustr = icu::UnicodeString::fromUTF8(a);
ustr.truncate(len);
// convert the result back in UTF-8
ustr.toUTF8String(rval);
}
return rval;
}
/**
* @brief truncate words beyond (len)-th character
* @param input string
* @param len (characters)
* @return truncated string
*/
std::string utf8fcns::cutwords(const std::string &a, const size_t len)
{
boost::u32regex_iterator<std::string::const_iterator> iend;
boost::u32regex_iterator<std::string::const_iterator>
i(boost::make_u32regex_iterator(str, utf8fcns::word_exp));
std::string::const_iterator aend = a.begin();
icu::UnicodeString ustr;
size_t Nch = 0;
while (i != iend && Nch<=len)
{
// convert
ustr = icu::UnicodeString::fromUTF8(icu::StringPiece(aend,(*i)[0].last-aend));
// get length
Nch += ustr.countChar32();
// if within the character limit, update the a iterator
if (Nch<=len) a0ptr = (*i)[0].last;
++i;
}
return std::string(a.begin(),aend);
}
/**
* @brief Inserts b into a after n characters.
* @param Base string
* @param String to be inserted
* @param Insertion point
* @return
*/
std::string utf8fcns::insert(const std::string &a, const std::string &b, const size_t n)
{
// perform the function in UnicodeString
icu::UnicodeString ustr = icu::UnicodeString::fromUTF8(a);
icu::UnicodeString ustrsrc = icu::UnicodeString::fromUTF8(b);
ustr.insert(n,ustrsrc);
// convert the result back in UTF-8
std::string rval;
ustr.toUTF8String(rval);
return rval;
}
/**
* @brief Returns length of string a in characters (equiv to foobar2000 len2)
* @param Input string
* @return Number of characters
*/
size_t utf8fcns::len(const std::string &a)
{
icu::UnicodeString ustr = icu::UnicodeString::fromUTF8(a);
return ustr.countChar32();
}
/**
* @brief Compare which string is longer
* @param First string
* @param Second string
* @return True if the first string is longer than the second
*/
bool utf8fcns::longer(const std::string &a, const std::string &b)
{
size_t Na = utf8fcns::len(a);
return Na>utf8fcns::len(b);
}
/**
* @brief Get the longest string
* @param Vector of input strings
* @return Longest string
*/
std::string utf8fcns::longest(const std::vector<std::string> &strs)
{
std::vectro::const_iterator it, it0;
size_t len = 0;
for (strs.begin(); it!=strs.end(); ++it)
{
size_t l = utf8fcns::len(*it);
if (l>=len)
{
len = l;
it0 = it;
}
}
return *it0;
}
/**
* @brief Converts a to lower case
* @param Input string
* @return Converted string
*/
std::string utf8fcns::lower(const std::string &a)
{
// perform the function in UnicodeString
icu::UnicodeString ustr = icu::UnicodeString::fromUTF8(a);
ustr.toLower();
// convert the result back in UTF-8
std::string rval;
ustr.toUTF8String(rval);
return rval;
}
/**
* @brief Replace all occurrence of string b in string a with string c
* @param Input string
* @param Substring to be replaced
* @param Replacing substring
* @return Replaced string
*/
std::string utf8fcns::replace(std::string a, std::string b, const std::string c)
{
// make sure that b does not contain any regex special characters
// if so, add preceding backslash to look for all specifal characters as themselves
boost::u32regex_replace(b.begin(),b.end(),utf8fcns::perl_exp,"\\$1");
// run regex_replace
boost::u32regex_replace(a.begin(),a.end(),b,c);
return a;
}
/**
* @brief Get the shortest string
* @param Vector of input strings
* @return Longest string
*/
std::string utf8fcns::shortest(const std::vector<std::string> &strs)
{
std::vectro::const_iterator it, it0;
size_t len = 0;
for (strs.begin(); it!=strs.end(); ++it)
{
size_t l = utf8fcns::len(*it);
if (l<=len)
{
len = l;
it0 = it;
}
}
return *it0;
}
/**
* @brief Find first occurence of a character in a string
* @param Input string
* @param Input character
* @return Byte location of the character (0-based)
*/
size_t utf8fcns::strchr(const std::string &a, const char c)
{
return a.find_first_of(c);
}
/**
* @brief Find last occurence of a character in a string
* @param Input string
* @param Input character
* @return Byte location of the character (0-based)
*/
size_t utf8fcns::strrchr(const std::string &a, const char c)
{
return a.find_last_of(c);
}
/**
* @brief Find first occurence of a substring in a string
* @param Input string
* @param Input substring
* @return Byte location of the starting character of the substring (0-based)
*/
size_t utf8fcns::strstr(const std::string &s1, const std::string &s2)
{
return s1.find(s2);
}
/**
* @brief Find last occurence of a substring in a string
* @param Input string
* @param Input substring
* @return Byte location of the starting character of the substring (0-based)
*/
size_t utf8fcns::strrstr(const std::string &s1, const std::string &s2)
{
return s1.rfind(s2);
}
/**
* @brief Case-sensitive comparison of two strings
* @param Input string
* @param Input string
* @return True if they are the same
*/
bool utf8fcns::strcmp(const std::string &a, const std::string &b)
{
return 0 == a.compare(b);
}
/**
* @brief Case-insensitive comparison of two string
* @param Input string
* @param Input string
* @return True if they are the same
*/
bool utf8fcns::stricmp(const std::string &a, const std::string &b)
{
icu::UnicodeString ustr = icu::UnicodeString::fromUTF8(a);
return 0 == ustr.caseCompare(icu::UnicodeString::fromUTF8(b),
U_FOLD_CASE_DEFAULT);
}
/**
* @brief Get a substring
* @param Input string
* @param Substring starting byte index (0-based)
* @param Substring length (number of characters)
* @return Substring
*/
std::string utf8fcns::substr(const std::string &a, const size_t m, const size_t len)
{
icu::UnicodeString ustr = icu::UnicodeString::fromUTF8(a);
icu::UnicodeString utgtstr;
ustr.extract(m,len,utgtstr);
// convert the result back in UTF-8
std::string rval;
utgtstr.toUTF8String(rval);
return rval;
}
/**
* @brief Removes prefixes from string
* @param Input string
* @param prefixes (if not given, defaults to "a" and "the")
* @return String without the matched prefix
*/
std::string utf8fcns::stripprefix(std::string x, const std::vector<std::string> &prefixes)
{
std::string prefix_pattern = utf8fcns::form_prefix_pattern(prefixes);
boost::u32regex prefix_exp = boost::make_u32regex(prefix_pattern);
u32regex_replace(x.start, x.end, prefix_exp, "",
boost::regex::perl|boost::regex::icase|boost::regesx::format_first_only);
return x;
}
/**
* @brief Move prefixes of string to the end
* @param Input string
* @param prefixes (if not given, defaults to "a" and "the")
* @return String with the matched prefix appearing at the end (preceeded by ',')
*/
std::string utf8fcns::swapprefix(std::string x, const std::vector<std::string> &prefixes)
{
std::string prefix_pattern = utf8fcns::form_prefix_pattern(prefixes);
boost::u32regex prefix_exp = boost::make_u32regex(prefix_pattern);
boost::match_results<std::string::const_iterator> what;
if (u32regex_search(x.start, x.end, what, prefix_exp, boost::regex::perl|boost::regex::icase))
{
// format first word of x: first letter, upper-case, rest lower-case
what.format("$', $1");
}
return x;
}
/**
* @brief Remove leading and trailing spaces
* @param Input string
* @return White-space free strings
*/
std::string utf8fcns::trim(const std::string &s)
{
// perform the function in UnicodeString
icu::UnicodeString ustr = icu::UnicodeString::fromUTF8(s);
ustr.trim();
// convert the result back in UTF-8
std::string rval;
ustr.toUTF8String(rval);
return rval;
}
/**
* @brief Convert all characters to upper case
* @param Input string
* @return Converted string
*/
std::string utf8fcns::upper(const std::string &s)
{
// perform the function in UnicodeString
icu::UnicodeString ustr = icu::UnicodeString::fromUTF8(s);
ustr.toUpper();
// convert the result back in UTF-8
std::string rval;
ustr.toUTF8String(rval);
return rval;
}
}
| {
"content_hash": "69360dfeb79da573ca066ae5614d06e9",
"timestamp": "",
"source": "github",
"line_count": 464,
"max_line_length": 102,
"avg_line_length": 27.612068965517242,
"alnum_prop": 0.6532937870746175,
"repo_name": "hokiedsp/autocdripper",
"id": "c0b8e5654b948c34732a9869a7d01a738520d55b",
"size": "12812",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/utf8fcns.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "482465"
},
{
"name": "Makefile",
"bytes": "1769"
}
],
"symlink_target": ""
} |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
module Category.Semigroupal
( Semigroupal(Semigroupal)
, tensor_product
, associator
) where
import Functor.Bifunctor (Bifunctor)
import Isomorphism (Isomorphism)
-- associator . associator = id * associator . associator . associator
data Semigroupal :: (* -> * -> *) -> (* -> * -> *) -> * where
Semigroupal ::
{ tensor_product :: Bifunctor cat cat cat pro
, associator :: (forall a b c. Isomorphism cat (pro (pro a b) c) (pro a (pro b c)))
} -> Semigroupal cat pro
| {
"content_hash": "afe73654668db5e7c65da6207cce27fe",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 89,
"avg_line_length": 32.8421052631579,
"alnum_prop": 0.6362179487179487,
"repo_name": "Hexirp/untypeclass",
"id": "c3426e95370b656993fa5e5491e611029a3b2f95",
"size": "624",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Category/Semigroupal.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Haskell",
"bytes": "16375"
}
],
"symlink_target": ""
} |
void TestRotations();
void TestRLG();
void TestNewtonEuler();
#endif
| {
"content_hash": "71689f1ef423ef6dc81b908077044543",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 23,
"avg_line_length": 14,
"alnum_prop": 0.7428571428571429,
"repo_name": "krishauser/KrisLibrary",
"id": "1618b1c4baaf4476421cf472f61e1d39c288c319",
"size": "208",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "robotics/SelfTest.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "1235250"
},
{
"name": "C++",
"bytes": "6003181"
},
{
"name": "CMake",
"bytes": "89664"
},
{
"name": "HTML",
"bytes": "127997"
},
{
"name": "M4",
"bytes": "2385"
},
{
"name": "Makefile",
"bytes": "6263"
},
{
"name": "TeX",
"bytes": "209869"
}
],
"symlink_target": ""
} |
var CACHE_NAME = 'scrum-poker-cache-v1';
var urlsToCache = [
'/',
'/css/main.css',
'/js/main.js'
];
self.addEventListener('install', function(event) {
// Perform install steps
event.waitUntil(
caches.open(CACHE_NAME)
.then(function(cache) {
console.log('Opened cache');
return cache.addAll(urlsToCache);
})
);
}); | {
"content_hash": "27267398f672c03334fc97bd1df62182",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 50,
"avg_line_length": 19.944444444444443,
"alnum_prop": 0.6100278551532033,
"repo_name": "barry-napier/pwa-scrum-poker",
"id": "dd09673ea85d21d30e38b2b0829b6f6885707efd",
"size": "359",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".history/public/sw_20161202152834.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "7570"
},
{
"name": "JavaScript",
"bytes": "14956"
}
],
"symlink_target": ""
} |
(function () {
var requestAnimationFrame = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
function (fn) { setTimeout(fn, 16); };
function delegate(selector, handler) {
return function(e) {
var target = e.target;
var delegateEl = e.currentTarget;
var matches = delegateEl.querySelectorAll(selector);
for (var el = target; el.parentNode && el !== delegateEl; el = el.parentNode) {
for (var i = 0; i < matches.length; i++) {
if (matches[i] === el) {
handler.call(el, e);
return;
}
}
}
};
}
var skipFrame = function(fn){
requestAnimationFrame(function(){ requestAnimationFrame(fn); });
};
var sides = {
next: ['nextElementSibling', 'firstElementChild'],
previous: ['previousElementSibling', 'lastElementChild']
};
function indexOfCard(deck, card){
return Array.prototype.indexOf.call(deck.children, card);
}
function getCard(deck, item){
if (item && item.nodeName) {
return item;
} else {
if (isNaN(item)) {
return deck.querySelector(item);
} else {
return deck.children[item];
}
}
}
// check if a card is a card in a deck
function checkCard(deck, card){
return card &&
deck === card.parentNode &&
card.nodeName.toLowerCase() === 'brick-card';
}
function shuffle(deck, side, direction){
var getters = sides[side];
var selected = deck.selectedCard && deck.selectedCard[getters[0]];
if (selected) {
deck.showCard(selected, {'direction': direction});
} else if (deck.loop || deck.selectedIndex === -1) {
deck.showCard(deck[getters[1]], {'direction': direction});
}
}
var BrickDeckElementPrototype = Object.create(HTMLElement.prototype);
BrickDeckElementPrototype.createdCallback = function() {
this.ns = {};
};
BrickDeckElementPrototype.attachedCallback = function() {
this.revealHandler = delegate('brick-card', function(e) {
e.currentTarget.showCard(this);
});
this.addEventListener('reveal', this.revealHandler);
};
BrickDeckElementPrototype.detachedCallback = function() {
this.removeEventListener('reveal', this.revealHandler);
};
BrickDeckElementPrototype.attributeChangedCallback = function (attr, oldVal, newVal) {
if (attr in attrs) {
attrs[attr].call(this, oldVal, newVal);
}
};
var attrs = {
'selected-index': function (oldVal, newVal) {
var index = parseInt(newVal);
if (!isNaN(index) && this.cards[index] !== this.selectedCard) {
this.showCard(index);
}
}
};
BrickDeckElementPrototype.nextCard = function(direction){
shuffle(this, 'next', direction);
};
BrickDeckElementPrototype.previousCard = function(direction){
shuffle(this, 'previous', direction);
};
BrickDeckElementPrototype.showCard = function(item, options){
options = options || {};
var direction = options.direction;
var skipTransition = options.skipTransition;
var card = getCard(this, item);
if (!checkCard(this, card) || (card === this.selectedCard)) {
return;
}
var selectedCard = this.ns.selectedCard;
var currentIndex = indexOfCard(this, selectedCard);
var nextIndex = indexOfCard(this, card);
if (!direction) {
direction = nextIndex > currentIndex ? 'forward' : 'reverse';
// if looping is turned on, check if the other way round is shorter
if (this.loop) {
// the distance between two cards
var dist = nextIndex - currentIndex;
// the distance between two cards when skipping over the end of the deck
var distLooped = this.cards.length - Math.max(nextIndex,currentIndex) + Math.min(nextIndex,currentIndex);
// set the direction if the looped way is shorter
if (Math.abs(distLooped) < Math.abs(dist)) {
direction = nextIndex < currentIndex ? 'forward' : 'reverse';
}
}
}
// hide the old card
if (selectedCard) { this.hideCard(selectedCard, direction); }
this.ns.selectedCard = card;
this.ns.selectedIndex = nextIndex;
this.setAttribute("selected-index", nextIndex);
if (!card.selected) { card.selected = true; }
var hasTransition = card.hasAttribute('transition-type') || this.hasAttribute('transition-type');
if (!skipTransition && hasTransition) {
// set attributes, set transitionend listener, skip a frame set transition attribute
card.setAttribute('transition-direction', direction);
var transitionendHandler = function() {
card.dispatchEvent(new CustomEvent('show',{'bubbles': true}));
card.removeEventListener('transitionend', transitionendHandler);
};
card.addEventListener('transitionend', transitionendHandler);
skipFrame(function(){ card.setAttribute('transition', ''); });
} else {
card.dispatchEvent(new CustomEvent('show',{'bubbles': true}));
}
};
BrickDeckElementPrototype.hideCard = function(item, direction){
var card = getCard(this, item);
if (!checkCard(this, card) || (card !== this.selectedCard)) {
return;
}
this.ns.selectedCard = null;
if (card.selected) { card.selected = false; }
var hasTransition = card.hasAttribute('transition-type') || this.hasAttribute('transition-type');
if (hasTransition) {
// set attributes, set transitionend listener, skip a frame set transition attribute
card.setAttribute('hide', '');
card.setAttribute('transition-direction', direction || 'reverse');
var transitionendHandler = function() {
card.removeAttribute('hide');
card.removeAttribute('transition');
card.removeAttribute('transition-direction');
card.dispatchEvent(new CustomEvent('hide',{'bubbles': true}));
card.removeEventListener('transitionend', transitionendHandler);
};
card.addEventListener('transitionend', transitionendHandler);
skipFrame(function(){ card.setAttribute('transition', ''); });
} else {
card.dispatchEvent(new CustomEvent('hide',{'bubbles': true}));
}
};
// Property handlers
Object.defineProperties(BrickDeckElementPrototype, {
'loop': {
get: function() {
return this.hasAttribute('loop');
},
set: function(newVal) {
if (newVal) {
this.setAttribute('loop', newVal);
} else {
this.removeAttribute('loop');
}
}
},
'cards': {
get: function () {
var cardList = this.querySelectorAll("brick-card");
return Array.prototype.slice.call(cardList);
}
},
'selectedCard': {
get: function() {
return this.ns.selectedCard || null;
}
},
'selectedIndex': {
get: function() {
return this.hasAttribute('selected-index') ? Number(this.getAttribute('selected-index')) : -1;
},
set: function(value) {
var index = Number(value);
var card = this.cards[index];
if (card) {
if (card !== this.ns.selectedCard) {
this.showCard(card);
}
} else {
this.removeAttribute('selected-index');
if (this.ns.selectedCard) {
this.hideCard(this.ns.selectedCard);
}
}
}
},
'transitionType': {
get: function() {
return this.getAttribute('transition-type');
},
set: function(newVal) {
this.setAttribute('transition-type', newVal);
}
}
});
// Register the element
window.BrickDeckElement = document.registerElement('brick-deck', {
prototype: BrickDeckElementPrototype
});
})();
| {
"content_hash": "62991e1140e8c011cdf03e4766db9a15",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 113,
"avg_line_length": 32.80590717299578,
"alnum_prop": 0.6200643086816721,
"repo_name": "mozbrick/mozbrick.github.io",
"id": "f39905cadca0add67dd99f8d2f433ca68f34002e",
"size": "7775",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "bower_components/brick/dist/brick-deck/src/deck.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "5995"
},
{
"name": "JavaScript",
"bytes": "3925"
}
],
"symlink_target": ""
} |
using Interactive.HateBin.Data;
using Interactive.HateBin.Models;
using Interactive.HateBin.Services;
using System.Net.Mail;
using System.Threading.Tasks;
using System.Web.Hosting;
using System.Web.Mvc;
namespace Interactive.HateBin.Controllers
{
[Authorize(Roles = "Approved")]
public class LoveController : Controller
{
private LoveRepository repository => new LoveRepository();
private EmailService emailService => new EmailService();
public ActionResult Index()
{
var items = repository.GetAllPending();
return View(items);
}
public ActionResult SendLove(int id)
{
var item = repository.Get(id);
return View(new SendLoveViewModel { Love = item, SelectedItem = string.Empty, Message = string.Empty});
}
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<ActionResult> SendLove(int id, SendLoveViewModel model)
{
if (ModelState.IsValid)
{
if (model.SelectedItem == null)
{
model.Love = repository.Get(id);
model.Message = "Du måste välja ett av meddelandena.";
model.SelectedItem = string.Empty;
return View(model);
}
else
{
var item = repository.Get(id);
item.Sent++;
item = repository.Save(item);
var body = "";
var path = "";
Attachment attachment = null;
switch (model.SelectedItem)
{
case "Catgif":
path = HostingEnvironment.MapPath("~/Content/images/sleepwalker.gif") ?? "";
attachment = new Attachment(path, "image/png");
attachment.ContentDisposition.Inline = true;
body = $"<html><body><img src='cid:{attachment.ContentId}'></body></html>";
await emailService.SendMail(item.Email, body, attachment);
break;
case "Message":
await emailService.SendMail(item.Email, "Kämpa! Du klarar det!");
break;
case "Heart":
path = HostingEnvironment.MapPath("~/Content/images/heart.png") ?? "";
attachment = new Attachment(path, "image/png");
attachment.ContentDisposition.Inline = true;
body = $"<html><body><div><img src='cid:{attachment.ContentId}'/><div></body></html>";
await emailService.SendMail(item.Email, body, attachment);
break;
default:
break;
}
}
return RedirectToAction("Index");
}
return View(model);
}
}
} | {
"content_hash": "ac9c61c025b207feaa4a9cbedcdccf9e",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 115,
"avg_line_length": 37.80722891566265,
"alnum_prop": 0.4837476099426386,
"repo_name": "interactiveinstitute/hatebin",
"id": "9d55ff8d88a3d411c478bdb23d785caf6297fa8b",
"size": "3143",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Web/Controllers/LoveController.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "110"
},
{
"name": "C#",
"bytes": "63138"
},
{
"name": "CSS",
"bytes": "2282"
},
{
"name": "HTML",
"bytes": "2722"
},
{
"name": "JavaScript",
"bytes": "23016"
}
],
"symlink_target": ""
} |
package ctutil
import (
"bytes"
"crypto"
"crypto/sha256"
"encoding/base64"
"errors"
"fmt"
ct "github.com/google/certificate-transparency-go"
"github.com/google/certificate-transparency-go/tls"
"github.com/google/certificate-transparency-go/x509"
)
var emptyHash = [sha256.Size]byte{}
// LeafHashB64 does as LeafHash does, but returns the leaf hash base64-encoded.
// The base64-encoded leaf hash returned by B64LeafHash can be used with the
// get-proof-by-hash API endpoint of Certificate Transparency Logs.
func LeafHashB64(chain []*x509.Certificate, sct *ct.SignedCertificateTimestamp, embedded bool) (string, error) {
hash, err := LeafHash(chain, sct, embedded)
if err != nil {
return "", err
}
return base64.StdEncoding.EncodeToString(hash[:]), nil
}
// LeafHash calculates the leaf hash of the certificate or precertificate at
// chain[0] that sct was issued for.
//
// sct is required because the SCT timestamp is used to calculate the leaf hash.
// Leaf hashes are unique to (pre)certificate-SCT pairs.
//
// This function can be used with three different types of leaf certificate:
// - X.509 Certificate:
// If using this function to calculate the leaf hash for a normal X.509
// certificate then it is enough to just provide the end entity
// certificate in chain. This case assumes that the SCT being provided is
// not embedded within the leaf certificate provided, i.e. the certificate
// is what was submitted to the Certificate Transparency Log in order to
// obtain the SCT. For this case, set embedded to false.
// - Precertificate:
// If using this function to calculate the leaf hash for a precertificate
// then the issuing certificate must also be provided in chain. The
// precertificate should be at chain[0], and its issuer at chain[1]. For
// this case, set embedded to false.
// - X.509 Certificate containing the SCT embedded within it:
// If using this function to calculate the leaf hash for a certificate
// where the SCT provided is embedded within the certificate you
// are providing at chain[0], set embedded to true. LeafHash will
// calculate the leaf hash by building the corresponding precertificate.
// LeafHash will return an error if the provided SCT cannot be found
// embedded within chain[0]. As with the precertificate case, the issuing
// certificate must also be provided in chain. The certificate containing
// the embedded SCT should be at chain[0], and its issuer at chain[1].
//
// Note: LeafHash doesn't check that the provided SCT verifies for the given
// chain. It simply calculates what the leaf hash would be for the given
// (pre)certificate-SCT pair.
func LeafHash(chain []*x509.Certificate, sct *ct.SignedCertificateTimestamp, embedded bool) ([sha256.Size]byte, error) {
leaf, err := createLeaf(chain, sct, embedded)
if err != nil {
return emptyHash, err
}
return ct.LeafHashForLeaf(leaf)
}
// VerifySCT takes the public key of a Certificate Transparency Log, a
// certificate chain, and an SCT and verifies whether the SCT is a valid SCT for
// the certificate at chain[0], signed by the Log that the public key belongs
// to. If the SCT does not verify, an error will be returned.
//
// This function can be used with three different types of leaf certificate:
// - X.509 Certificate:
// If using this function to verify an SCT for a normal X.509 certificate
// then it is enough to just provide the end entity certificate in chain.
// This case assumes that the SCT being provided is not embedded within
// the leaf certificate provided, i.e. the certificate is what was
// submitted to the Certificate Transparency Log in order to obtain the
// SCT. For this case, set embedded to false.
// - Precertificate:
// If using this function to verify an SCT for a precertificate then the
// issuing certificate must also be provided in chain. The precertificate
// should be at chain[0], and its issuer at chain[1]. For this case, set
// embedded to false.
// - X.509 Certificate containing the SCT embedded within it:
// If the SCT you wish to verify is embedded within the certificate you
// are providing at chain[0], set embedded to true. VerifySCT will
// verify the provided SCT by building the corresponding precertificate.
// VerifySCT will return an error if the provided SCT cannot be found
// embedded within chain[0]. As with the precertificate case, the issuing
// certificate must also be provided in chain. The certificate containing
// the embedded SCT should be at chain[0], and its issuer at chain[1].
func VerifySCT(pubKey crypto.PublicKey, chain []*x509.Certificate, sct *ct.SignedCertificateTimestamp, embedded bool) error {
s, err := ct.NewSignatureVerifier(pubKey)
if err != nil {
return fmt.Errorf("error creating signature verifier: %s", err)
}
return VerifySCTWithVerifier(s, chain, sct, embedded)
}
// VerifySCTWithVerifier takes a ct.SignatureVerifier, a certificate chain, and
// an SCT and verifies whether the SCT is a valid SCT for the certificate at
// chain[0], signed by the Log whose public key was used to set up the
// ct.SignatureVerifier. If the SCT does not verify, an error will be returned.
//
// This function can be used with three different types of leaf certificate:
// - X.509 Certificate:
// If using this function to verify an SCT for a normal X.509 certificate
// then it is enough to just provide the end entity certificate in chain.
// This case assumes that the SCT being provided is not embedded within
// the leaf certificate provided, i.e. the certificate is what was
// submitted to the Certificate Transparency Log in order to obtain the
// SCT. For this case, set embedded to false.
// - Precertificate:
// If using this function to verify an SCT for a precertificate then the
// issuing certificate must also be provided in chain. The precertificate
// should be at chain[0], and its issuer at chain[1]. For this case, set
// embedded to false.
// - X.509 Certificate containing the SCT embedded within it:
// If the SCT you wish to verify is embedded within the certificate you
// are providing at chain[0], set embedded to true. VerifySCT will
// verify the provided SCT by building the corresponding precertificate.
// VerifySCT will return an error if the provided SCT cannot be found
// embedded within chain[0]. As with the precertificate case, the issuing
// certificate must also be provided in chain. The certificate containing
// the embedded SCT should be at chain[0], and its issuer at chain[1].
func VerifySCTWithVerifier(sv *ct.SignatureVerifier, chain []*x509.Certificate, sct *ct.SignedCertificateTimestamp, embedded bool) error {
if sv == nil {
return errors.New("ct.SignatureVerifier is nil")
}
leaf, err := createLeaf(chain, sct, embedded)
if err != nil {
return err
}
return sv.VerifySCTSignature(*sct, ct.LogEntry{Leaf: *leaf})
}
func createLeaf(chain []*x509.Certificate, sct *ct.SignedCertificateTimestamp, embedded bool) (*ct.MerkleTreeLeaf, error) {
if len(chain) == 0 {
return nil, errors.New("chain is empty")
}
if sct == nil {
return nil, errors.New("sct is nil")
}
if embedded {
sctPresent, err := ContainsSCT(chain[0], sct)
if err != nil {
return nil, fmt.Errorf("error checking for SCT in leaf certificate: %s", err)
}
if !sctPresent {
return nil, errors.New("SCT provided is not embedded within leaf certificate")
}
}
certType := ct.X509LogEntryType
if chain[0].IsPrecertificate() || embedded {
certType = ct.PrecertLogEntryType
}
var leaf *ct.MerkleTreeLeaf
var err error
if embedded {
leaf, err = ct.MerkleTreeLeafForEmbeddedSCT(chain, sct.Timestamp)
} else {
leaf, err = ct.MerkleTreeLeafFromChain(chain, certType, sct.Timestamp)
}
if err != nil {
return nil, fmt.Errorf("error creating MerkleTreeLeaf: %s", err)
}
return leaf, nil
}
// ContainsSCT checks to see whether the given SCT is embedded within the given
// certificate.
func ContainsSCT(cert *x509.Certificate, sct *ct.SignedCertificateTimestamp) (bool, error) {
if cert == nil || sct == nil {
return false, nil
}
sctBytes, err := tls.Marshal(*sct)
if err != nil {
return false, fmt.Errorf("error tls.Marshalling SCT: %s", err)
}
for _, s := range cert.SCTList.SCTList {
if bytes.Equal(sctBytes, s.Val) {
return true, nil
}
}
return false, nil
}
| {
"content_hash": "20399646fbafcb9988248872324d6911",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 138,
"avg_line_length": 43.494897959183675,
"alnum_prop": 0.7239882697947214,
"repo_name": "google/certificate-transparency-go",
"id": "640fcec9c1f1b0c84fdbdd08df1572075b98aa17",
"size": "9202",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ctutil/ctutil.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "2601"
},
{
"name": "Go",
"bytes": "2208242"
},
{
"name": "HTML",
"bytes": "8052"
},
{
"name": "Shell",
"bytes": "25910"
}
],
"symlink_target": ""
} |
using System;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager.Network.Models;
namespace Azure.ResourceManager.Network
{
/// <summary> Creates or updates the specified FirewallPolicyRuleGroup. </summary>
public partial class FirewallPolicyRuleGroupsCreateOrUpdateOperation : Operation<FirewallPolicyRuleGroup>, IOperationSource<FirewallPolicyRuleGroup>
{
private readonly ArmOperationHelpers<FirewallPolicyRuleGroup> _operation;
internal FirewallPolicyRuleGroupsCreateOrUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
{
_operation = new ArmOperationHelpers<FirewallPolicyRuleGroup>(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.AzureAsyncOperation, "FirewallPolicyRuleGroupsCreateOrUpdateOperation");
}
/// <inheritdoc />
public override string Id => _operation.Id;
/// <inheritdoc />
public override FirewallPolicyRuleGroup Value => _operation.Value;
/// <inheritdoc />
public override bool HasCompleted => _operation.HasCompleted;
/// <inheritdoc />
public override bool HasValue => _operation.HasValue;
/// <inheritdoc />
public override Response GetRawResponse() => _operation.GetRawResponse();
/// <inheritdoc />
public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
/// <inheritdoc />
public override ValueTask<Response> UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
/// <inheritdoc />
public override ValueTask<Response<FirewallPolicyRuleGroup>> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
/// <inheritdoc />
public override ValueTask<Response<FirewallPolicyRuleGroup>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
FirewallPolicyRuleGroup IOperationSource<FirewallPolicyRuleGroup>.CreateResult(Response response, CancellationToken cancellationToken)
{
using var document = JsonDocument.Parse(response.ContentStream);
return FirewallPolicyRuleGroup.DeserializeFirewallPolicyRuleGroup(document.RootElement);
}
async ValueTask<FirewallPolicyRuleGroup> IOperationSource<FirewallPolicyRuleGroup>.CreateResultAsync(Response response, CancellationToken cancellationToken)
{
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
return FirewallPolicyRuleGroup.DeserializeFirewallPolicyRuleGroup(document.RootElement);
}
}
}
| {
"content_hash": "9a0efb299ea8609957b268dae8314021",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 238,
"avg_line_length": 52.08474576271186,
"alnum_prop": 0.7562642369020501,
"repo_name": "yugangw-msft/azure-sdk-for-net",
"id": "b560e6fd295226d42310bcb2f82c67bd1f2fbe29",
"size": "3211",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "sdk/network/Azure.ResourceManager.Network/src/Generated/FirewallPolicyRuleGroupsCreateOrUpdateOperation.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "118"
},
{
"name": "Batchfile",
"bytes": "817"
},
{
"name": "C#",
"bytes": "55680650"
},
{
"name": "CSS",
"bytes": "685"
},
{
"name": "Cucumber",
"bytes": "89597"
},
{
"name": "JavaScript",
"bytes": "1719"
},
{
"name": "PowerShell",
"bytes": "24329"
},
{
"name": "Shell",
"bytes": "45"
}
],
"symlink_target": ""
} |
/**
* Created by invercity on 2/6/14.
*/
var exec = require('child_process').exec;
var async = require('async');
// debug flag
var _DEBUG = false;
// get execution arguments
var arg = process.argv.slice(2)[0];
if (arg === 'test') {
exec('nodejs transport.js create', function() {
console.log('test data created');
async.forever(function(callback) {
exec('nodejs transport.js do', function(err, sout, serr) {
if (_DEBUG) console.log(sout);
setTimeout(callback, 2000);
});
}, function() {
console.log('done...');
});
});
}
else if (arg === 'clean') {
exec('nodejs transport.js clean', function() {
console.log('cleaned');
});
}
else if (arg === 'run') {
async.forever(function(callback) {
exec('nodejs --expose-gc server.js', function(err, sout, serr) {
console.log(sout);
callback();
});
});
}
| {
"content_hash": "9eaf81a08f769268fe6fcc03b4d3ef19",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 72,
"avg_line_length": 24.3,
"alnum_prop": 0.5318930041152263,
"repo_name": "diospark/transport-view",
"id": "dc1e5231635bd9212a9cb5f572fe7fba26dff167",
"size": "972",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "18091"
},
{
"name": "HTML",
"bytes": "20038"
},
{
"name": "JavaScript",
"bytes": "239638"
}
],
"symlink_target": ""
} |
package sl.paket.addressbook.appmanager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
import org.testng.Assert;
import sl.paket.addressbook.model.ContactData;
import sl.paket.addressbook.model.Contacts;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Created by serglit on 02.08.16.
*/
public class ContactHelper extends HelperBase {
public ContactHelper(WebDriver wd) {
super(wd);
}
public void fillUpTextFields(ContactData contactData) {
type(By.name("firstname"), contactData.getFirstName());
type(By.name("lastname"), contactData.getLastName());
type(By.name("address"), contactData.getAddressName());
type(By.name("home"), contactData.getPhoneHome());
type(By.name("email"), contactData.getEmailAddress());
type(By.name("mobile"),contactData.getPhoneMobile());
type(By.name("work"), contactData.getPhoneWork());
// attach(By.name("photo"),contactData.getPhoto());
// if (creation) {
// new Select(wd.findElement(By.name("new_group"))).selectByValue(contactData.getGroup());
// } else {
// Assert.assertFalse(isElementPresent(By.name("new_group")));
// }
}
public void newOpen() {
click(By.linkText("add new"));
}
public void delete() {
click(By.xpath("//div[@id='content']/form[2]/div[2]/input"));
wd.switchTo().alert().accept();
returnToHomePage();
}
public void returnToHomePage() {
click(By.linkText("home"));
}
public void selectContactById(int id) {
wd.findElement(By.cssSelector("input[id = '" + id + "']")).click();
}
public void initModify() {
click(By.xpath("//table[@id='maintable']/tbody/tr[2]/td[8]/a/img"));
}
public void submitForm() {
click(By.cssSelector("input[value='Enter']"));
}
public void updateForm() {
click(By.cssSelector("input[value='Update']"));
}
public void create(ContactData contact) {
newOpen();
fillUpTextFields(contact);
submitForm();
contactCache = null;
returnToHomePage();
}
public void modify(ContactData contact) {
selectContactById(contact.getId());
initModify();
fillUpTextFields(contact);
updateForm();
returnToHomePage();
contactCache = null;
}
public void deleteC(ContactData contact) {
selectContactById(contact.getId());
delete();
contactCache = null;
returnToHomePage();
}
public boolean isThereAnyContact() {
return isElementPresent(By.name("selected[]"));
}
private Contacts contactCache = null;
public Contacts al() {
Contacts contacts = new Contacts();
List<WebElement> rows = wd.findElements(By.name("entry"));
for (WebElement row : rows) {
List<WebElement> cells = row.findElements(By.tagName("td"));
int id = Integer.parseInt(cells.get(0).findElement(By.tagName("input")).getAttribute("value"));
String nameLast = cells.get(1).getText();
String nameFirst = cells.get(2).getText();
String address = cells.get(3).getText();
String email = cells.get(4).getText();
String phone = cells.get(5).getText();
contacts.add(new ContactData()
.withId(id)
.withLastName(nameLast)
.withFirstName(nameFirst)
.withAddressName(address)
.withEmailAddress(email)
.withPhoneHome(phone));
}
return new Contacts(contacts);
}
public Contacts alll() {
Contacts contacts = new Contacts();
List<WebElement> rows = wd.findElements(By.name("entry"));
for (WebElement row : rows) {
List<WebElement> cells = row.findElements(By.tagName("td"));
int id = Integer.parseInt(cells.get(0).findElement(By.tagName("input")).getAttribute("value"));
String nameLast = cells.get(1).getText();
String nameFirst = cells.get(2).getText();
String address = cells.get(3).getText();
String allEmails = cells.get(4).getText();
String allPhones = cells.get(5).getText();
contacts.add(new ContactData()
.withId(id)
.withLastName(nameLast)
.withFirstName(nameFirst)
.withAddressName(address)
.withAllEmailAddress(allEmails)
.withAllPhones(allPhones));
}
return new Contacts(contacts);
}
public Contacts all() {
if (contactCache != null) {
return new Contacts(contactCache);
}
contactCache = new Contacts();
List<WebElement> rows = wd.findElements(By.name("entry"));
for (WebElement row : rows) {
List<WebElement> cells = row.findElements(By.tagName("td"));
int id = Integer.parseInt(cells.get(0).findElement(By.tagName("input")).getAttribute("value"));
String nameLast = cells.get(1).getText();
String nameFirst = cells.get(2).getText();
String address = cells.get(3).getText();
String email = cells.get(4).getText();
String phone = cells.get(5).getText();
// String[] phones = cells.get(5).getText().split("\n");
// String allPhones = cells.get(5).getText();
contactCache.add(new ContactData()
.withId(id)
.withLastName(nameLast)
.withFirstName(nameFirst)
.withAddressName(address)
.withEmailAddress(email)
.withPhoneHome(phone));
// .withPhoneMobile(phones[1])
// .withPhoneWork(phones[2]));
// .withAllPhones(allPhones));
}
return new Contacts(contactCache);
}
public int count () {
return wd.findElements(By.cssSelector("img[title='vCard")).size();
}
public ContactData infoFromEditForm(ContactData contact) {
initContactModificationById(contact.getId());
String firstname = wd.findElement(By.name("firstname")).getAttribute("value");
String lastname = wd.findElement(By.name("lastname")).getAttribute("value");
String address = wd.findElement(By.name("address")).getText();
String email = wd.findElement(By.name("email")).getAttribute("value");
// String email2 = wd.findElement(By.name("email2")).getAttribute("value");
// String email3 = wd.findElement(By.name("email3")).getAttribute("value");
String home = wd.findElement(By.name("home")).getAttribute("value");
String mobile = wd.findElement(By.name("mobile")).getAttribute("value");
String work = wd.findElement(By.name("work")).getAttribute("value");
// wd.navigate().back();
return new ContactData().withId(contact.getId()).withFirstName(firstname).withLastName(lastname)
.withAddressName(address)
.withEmailAddress(email)
.withPhoneHome(home).withPhoneMobile(mobile).withPhoneWork(work);
}
private void initContactModificationById(int id) {
/*- 1ый вариант поиска элемента на странице
WebElement checkbox = wd.findElement(By.cssSelector(String.format("input[value='%s']",id)));
WebElement row = checkbox.findElement(By.xpath("./../.."));
List<WebElement> cells= row.findElements(By.tagName("td"));
cells.get(7).findElement(By.tagName("a")).click(); */
/* - 2ой вариант поиска с использованием XPath
wd.findElement (By.xpath(String.format("//input[@value='%s']/../../td[8]/a",id))).click();
- 3ий вариант поиска с использованием XPath
wd.findElement (By.xpath(String.format("//tr[.//input[@value='%s']]/td[8]/a",id))).click();
*/
//- 4ый вариант
wd.findElement(By.cssSelector(String.format("a[href='edit.php?id=%s']",id))).click();
}
}
| {
"content_hash": "1b4d45db65a5aafc638fe1cba329e7eb",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 107,
"avg_line_length": 36.108695652173914,
"alnum_prop": 0.5894039735099338,
"repo_name": "serglit/MyOnlineJAVA",
"id": "50fc710c2d9514c45670364158bcb574c7bbc941",
"size": "8407",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "addressbook-web-tests/src/test/java/sl/paket/addressbook/appmanager/ContactHelper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "44057"
},
{
"name": "Java",
"bytes": "67966"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace Craps
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
| {
"content_hash": "900b912fdcb0616585a6993f8a6dc05a",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 42,
"avg_line_length": 18.764705882352942,
"alnum_prop": 0.6990595611285266,
"repo_name": "lulzmachine/Craps",
"id": "40fdb66f5fba71bbcae78afbe29ecc99754565b0",
"size": "321",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Craps/App.xaml.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "19194"
}
],
"symlink_target": ""
} |
export * from './Banner';
| {
"content_hash": "7ee977d0092d2f6289018961864a568b",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 25,
"avg_line_length": 26,
"alnum_prop": 0.6153846153846154,
"repo_name": "AJIXuMuK/sp-dev-fx-webparts",
"id": "bc95f09d62a942c4f82b360f91caaab79721c86b",
"size": "26",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "samples/react-news-banner/src/components/index.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "25678"
},
{
"name": "SCSS",
"bytes": "19855"
},
{
"name": "Shell",
"bytes": "2153"
},
{
"name": "TypeScript",
"bytes": "56170"
}
],
"symlink_target": ""
} |
@echo off
set INSTALL_UTIL_HOME=C:\Windows\Microsoft.NET\Framework\v2.0.50727
set PATH=%PATH%;%INSTALL_UTIL_HOME%
cd %SERVICE_HOME%
echo Installing Service...
installutil Perrich.RunAsService.exe
echo Done. | {
"content_hash": "2ed7247315ab3234f6faf9605c7de6e6",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 67,
"avg_line_length": 21.8,
"alnum_prop": 0.7477064220183486,
"repo_name": "perrich/RunAsService",
"id": "cf870c148b9a656a5ab23baa1acb6960b7e1ee96",
"size": "218",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Demo/install.cmd",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "80542"
},
{
"name": "Shell",
"bytes": "441"
}
],
"symlink_target": ""
} |
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto
namespace Google\Cloud\Dlp\V2;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Request message for DeleteInspectTemplate.
*
* Generated from protobuf message <code>google.privacy.dlp.v2.DeleteInspectTemplateRequest</code>
*/
class DeleteInspectTemplateRequest extends \Google\Protobuf\Internal\Message
{
/**
* Required. Resource name of the organization and inspectTemplate to be deleted, for
* example `organizations/433245324/inspectTemplates/432452342` or
* projects/project-id/inspectTemplates/432452342.
*
* Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
*/
private $name = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $name
* Required. Resource name of the organization and inspectTemplate to be deleted, for
* example `organizations/433245324/inspectTemplates/432452342` or
* projects/project-id/inspectTemplates/432452342.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
parent::__construct($data);
}
/**
* Required. Resource name of the organization and inspectTemplate to be deleted, for
* example `organizations/433245324/inspectTemplates/432452342` or
* projects/project-id/inspectTemplates/432452342.
*
* Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Required. Resource name of the organization and inspectTemplate to be deleted, for
* example `organizations/433245324/inspectTemplates/432452342` or
* projects/project-id/inspectTemplates/432452342.
*
* Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
* @param string $var
* @return $this
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
return $this;
}
}
| {
"content_hash": "55fa5fde33b89c7b1162b479aa1b785e",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 144,
"avg_line_length": 33.74666666666667,
"alnum_prop": 0.667325167917819,
"repo_name": "chingor13/google-cloud-php",
"id": "843f99a24f1709f24989aeca458ebe1b876e8d4c",
"size": "2531",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Dlp/src/V2/DeleteInspectTemplateRequest.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "670"
},
{
"name": "PHP",
"bytes": "34466701"
},
{
"name": "Python",
"bytes": "321175"
},
{
"name": "Shell",
"bytes": "8827"
}
],
"symlink_target": ""
} |
package net.ontopia.topicmaps.entry;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
import java.util.Collections;
import net.ontopia.topicmaps.utils.ltm.LTMTopicMapReference;
import net.ontopia.infoset.core.LocatorIF;
import net.ontopia.infoset.impl.basic.URILocator;
import net.ontopia.topicmaps.utils.ImportExportServiceIF;
import net.ontopia.topicmaps.utils.ImportExportUtils;
import net.ontopia.topicmaps.xml.ExternalReferenceHandlerIF;
import net.ontopia.topicmaps.xml.XTMTopicMapReference;
import net.ontopia.utils.OntopiaRuntimeException;
/**
* INTERNAL: TopicMapSourceIF that can reference individual topic map
* documents by their URL address. The properties id, title, url, and
* syntax are the most commonly used. The syntaxes XTM, HyTM, and LTM
* are currently supported.<p>
*
* @since 2.0
*/
public class URLTopicMapSource implements TopicMapSourceIF {
protected String id;
protected String refid;
protected String title;
protected String url;
protected String syntax;
protected boolean hidden;
protected LocatorIF base_address;
protected boolean duplicate_suppression;
protected boolean validate;
protected ExternalReferenceHandlerIF ref_handler;
protected Collection<TopicMapReferenceIF> reflist;
public URLTopicMapSource() {
}
public URLTopicMapSource(String url) {
this.url = url;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
/**
* INTERNAL: Gets the id of the topic map reference for this topic map
* source.
*/
public String getReferenceId() {
return refid;
}
/**
* INTERNAL: Sets the id of the topic map reference for this topic map
* source.
*/
public void setReferenceId(String refid) {
this.refid = refid;
}
@Override
public String getTitle() {
return title;
}
@Override
public void setTitle(String title) {
this.title = title;
}
/**
* INTERNAL: Returns the syntax of the document.
*/
public String getSyntax() {
return syntax;
}
/**
* INTERNAL: Specifies the syntax of the document. This property will
* be used to ensure that the topic map syntax is correctly
* recognized. The supported syntaxes are 'XTM', 'HyTM', and
* 'LTM'. If the syntax is not specified the class will attempt to
* guess it by looking at the address suffix.
*/
public void setSyntax(String syntax) {
this.syntax = syntax;
}
/**
* INTERNAL: Gets the URL of the source topic map.
*/
public String getUrl() {
return url;
}
/**
* INTERNAL: Sets the URL of the source topic map.
*/
public void setUrl(String url) {
this.url = url;
}
/**
* INTERNAL: Gets the base locator of the topic maps retrieved from
* the source.
*/
public LocatorIF getBase() {
return base_address;
}
/**
* INTERNAL: Sets the base locator of the topic maps retrieved from
* the source.
*/
public void setBase(LocatorIF base_address) {
this.base_address = base_address;
}
/**
* INTERNAL: Gets the base address of the topic maps retrieved from
* the source. The notation is assumed to be 'URI'.
*/
public String getBaseAddress() {
return base_address.getAddress();
}
/**
* INTERNAL: Sets the base address of the topic maps retrieved from
* the source. The notation is assumed to be 'URI'.
*/
public void setBaseAddress(String base_address) {
try {
this.base_address = new URILocator(base_address);
} catch (MalformedURLException e) {
throw new OntopiaRuntimeException(e);
}
}
/**
* INTERNAL: Gets the duplicate suppression flag. If the flag is
* true duplicate suppression is to be performed when loading the
* topic maps.
*/
public boolean getDuplicateSuppression() {
return duplicate_suppression;
}
/**
* INTERNAL: Sets the duplicate suppression flag. If the flag is
* true duplicate suppression is to be performed when loading the
* topic maps.
*/
public void setDuplicateSuppression(boolean duplicate_suppression) {
this.duplicate_suppression = duplicate_suppression;
}
/**
* INTERNAL: Turn validation of XTM documents according to DTD on or
* off. The validation checks if the documents read follow the DTD,
* and will abort import if they do not.
* @param validate Will validate if true, will not if false.
*/
public void setValidation(boolean validate) {
this.validate = validate;
}
/**
* INTERNAL: Returns true if validation is on, false otherwise.
*/
public boolean getValidation() {
return validate;
}
/**
* INTERNAL: Sets the external reference handler.
*/
public void setExternalReferenceHandler(ExternalReferenceHandlerIF ref_handler) {
this.ref_handler = ref_handler;
}
/**
* INTERNAL: Gets the external reference handler. The reference
* handler will receive notifications on references to external
* topics and topic maps.
*/
public ExternalReferenceHandlerIF getExternalReferenceHandler() {
return ref_handler;
}
// ----
@Override
public synchronized Collection<TopicMapReferenceIF> getReferences() {
if (reflist == null) {
refresh();
}
return reflist;
}
@Override
public synchronized void refresh() {
if (url == null) {
throw new OntopiaRuntimeException("'url' property has not been set.");
}
if (refid == null) {
refid = id;
}
if (refid == null) {
throw new OntopiaRuntimeException("Neither 'id' nor 'referenceId' properties has been set.");
}
// Look at file suffix and guess file syntax.
if (syntax == null) {
if (url.endsWith(".xtm")) {
syntax = "XTM";
} else if (url.endsWith(".ltm")) {
syntax = "LTM";
} else if (url.endsWith(".rdf")) {
syntax = "RDF";
} else if (url.endsWith(".n3")) {
syntax = "N3";
}
}
// Create proper URL object
URL url2;
try {
url2 = new URL(url);
} catch (MalformedURLException e) {
throw new OntopiaRuntimeException(e);
}
// Use id if title not set.
if (title == null) {
title = id;
}
if (syntax == null) {
throw new OntopiaRuntimeException("Syntax not specified for '" + url + "'. Please set the 'syntax' parameter.");
} else if ("XTM".equalsIgnoreCase(syntax)) {
// Create XTM reference
XTMTopicMapReference ref = new XTMTopicMapReference(url2, refid, title, base_address);
ref.setSource(this);
ref.setDuplicateSuppression(duplicate_suppression);
ref.setValidation(validate);
if (ref_handler!=null) {
ref.setExternalReferenceHandler(ref_handler);
}
reflist = Collections.singleton((TopicMapReferenceIF)ref);
} else if ("LTM".equalsIgnoreCase(syntax)) {
// Create LTM reference
LTMTopicMapReference ref = new LTMTopicMapReference(url2, refid, title, base_address);
ref.setDuplicateSuppression(duplicate_suppression);
ref.setSource(this);
reflist = Collections.singleton((TopicMapReferenceIF)ref);
} else if ("RDF/XML".equalsIgnoreCase(syntax) ||
"RDF".equalsIgnoreCase(syntax) ||
"N3".equalsIgnoreCase(syntax) ||
"N-TRIPLE".equalsIgnoreCase(syntax)) {
// Create RDF reference
AbstractURLTopicMapReference ref = null;
for (ImportExportServiceIF service : ImportExportUtils.getServices()) {
if (service.canRead(url2)) {
ref = service.createReference(url2, refid, title, base_address);
break;
}
}
if (ref != null) {
ref.setDuplicateSuppression(duplicate_suppression);
ref.setSource(this);
reflist = Collections.singleton((TopicMapReferenceIF)ref);
} else {
throw new OntopiaRuntimeException("Topic maps RDF syntax " + syntax + " specified, but no RDF import-export service found on the classpath");
}
} else {
throw new OntopiaRuntimeException("Topic maps syntax '" + syntax +
"' not supported.");
}
}
@Override
public void close() {
// Do nothing
}
@Override
public boolean supportsCreate() {
return false;
}
@Override
public boolean supportsDelete() {
return false;
}
@Override
public TopicMapReferenceIF createTopicMap(String name, String baseAddress) {
throw new UnsupportedOperationException();
}
public boolean getHidden() {
return hidden;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
}
| {
"content_hash": "e1cb90783ee670812c7a1189702bfe42",
"timestamp": "",
"source": "github",
"line_count": 328,
"max_line_length": 149,
"avg_line_length": 26.448170731707318,
"alnum_prop": 0.6643227665706052,
"repo_name": "ontopia/ontopia",
"id": "3fd9fa8d85868621c6ad775fc3bd7a66b8dd9bc4",
"size": "9330",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ontopia-engine/src/main/java/net/ontopia/topicmaps/entry/URLTopicMapSource.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "229"
},
{
"name": "CSS",
"bytes": "102701"
},
{
"name": "GAP",
"bytes": "55644"
},
{
"name": "HTML",
"bytes": "56107"
},
{
"name": "Java",
"bytes": "11884136"
},
{
"name": "JavaScript",
"bytes": "365763"
},
{
"name": "Lex",
"bytes": "19344"
},
{
"name": "Python",
"bytes": "27528"
},
{
"name": "SCSS",
"bytes": "6338"
},
{
"name": "Shell",
"bytes": "202"
}
],
"symlink_target": ""
} |
package com.bytegriffin.datatunnel.core;
public interface Handler {
void channelRead(HandlerContext ctx, Param msg);
} | {
"content_hash": "3b1f38fd246618079afc5d942fe34b4b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 52,
"avg_line_length": 17.857142857142858,
"alnum_prop": 0.776,
"repo_name": "bytegriffin/DataTunnel",
"id": "eb14e67c94332b9938e488d4ae92a64ef70ad32a",
"size": "125",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/com/bytegriffin/datatunnel/core/Handler.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1626"
},
{
"name": "Java",
"bytes": "154502"
},
{
"name": "Shell",
"bytes": "4310"
}
],
"symlink_target": ""
} |
namespace media {
// Represents a queue of bytes.
// Data is added to the end of the queue via an Push() call and removed via
// Pop(). The contents of the queue can be observed via the Peek() method.
// This class manages the underlying storage of the queue and tries to minimize
// the number of buffer copies when data is appended and removed.
class ByteQueue {
public:
ByteQueue();
~ByteQueue();
// Reset the queue to the empty state.
void Reset();
// Appends new bytes onto the end of the queue.
void Push(const uint8* data, int size);
// Get a pointer to the front of the queue and the queue size.
// These values are only valid until the next Push() or
// Pop() call.
void Peek(const uint8** data, int* size) const;
// Remove |count| bytes from the front of the queue.
void Pop(int count);
private:
// Returns a pointer to the front of the queue.
uint8* front() const;
scoped_array<uint8> buffer_;
// Size of |buffer_|.
size_t size_;
// Offset from the start of |buffer_| that marks the front of the queue.
size_t offset_;
// Number of bytes stored in the queue.
int used_;
DISALLOW_COPY_AND_ASSIGN(ByteQueue);
};
} // namespace media
#endif // MEDIA_BASE_BYTE_QUEUE_H_
| {
"content_hash": "a028589b32f06613fa2f9f7ac73af821",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 79,
"avg_line_length": 26.340425531914892,
"alnum_prop": 0.6849757673667205,
"repo_name": "gavinp/chromium",
"id": "d3ef6058f57bd4f07fb05b36fd56ab5b6bbeedd0",
"size": "1541",
"binary": false,
"copies": "11",
"ref": "refs/heads/trunk",
"path": "media/base/byte_queue.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "1178292"
},
{
"name": "C",
"bytes": "72353788"
},
{
"name": "C++",
"bytes": "117593783"
},
{
"name": "F#",
"bytes": "381"
},
{
"name": "Go",
"bytes": "10440"
},
{
"name": "Java",
"bytes": "24087"
},
{
"name": "JavaScript",
"bytes": "8781314"
},
{
"name": "Objective-C",
"bytes": "5340290"
},
{
"name": "PHP",
"bytes": "97796"
},
{
"name": "Perl",
"bytes": "918286"
},
{
"name": "Python",
"bytes": "5942009"
},
{
"name": "R",
"bytes": "524"
},
{
"name": "Shell",
"bytes": "4149832"
},
{
"name": "Tcl",
"bytes": "255109"
}
],
"symlink_target": ""
} |
package com.sample.linebot.mybot.sendmessage;
import com.sample.linebot.api.receivemessage.Result;
import com.sample.linebot.api.sendmessage.SendMessageManager;
public class YokaiBot implements IMyBot {
@Override
public boolean match(Result result) {
String text = result.getContent().getText();
if (text.contains("セットオン") || text.indexOf("セットオン") > 0) {
return true;
}
return false;
}
@Override
public void execute(Result result) {
SendMessageManager manager = new SendMessageManager();
String to = result.getContent().getFrom();
String text = "プリチー 俺っち友達 福は内!";
manager.sendTextContent(to, text);
sleep(1000);
text = "ジバニャン!!!";
manager.sendTextContent(to, text);
sleep(1000);
String originalContentUrl = "http://yw.b-boys.jp/member/images/items/list/medal/1/img_medal93.png";
String previewImageUrl = "http://yw.b-boys.jp/member/images/items/list/medal/1/img_medal93.png";
manager.sendImageContent(to, originalContentUrl, previewImageUrl);
}
private void sleep(long millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
}
}
@Override
public String keyword() {
return "妖怪メダル セットオン!";
}
@Override
public String descryption() {
return "召喚";
}
}
| {
"content_hash": "d7c0ad78ab905ff19b088982911cd53a",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 101,
"avg_line_length": 23.90740740740741,
"alnum_prop": 0.6839659178931061,
"repo_name": "moritalous/LineBot",
"id": "77727e7cdf45624eabf74f5108e6ee4a0b9640cb",
"size": "1379",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/sample/linebot/mybot/sendmessage/YokaiBot.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "157642"
}
],
"symlink_target": ""
} |
package com.mojang.mojam.gui;
import com.mojang.mojam.screen.Art;
import com.mojang.mojam.screen.Screen;
public class CheckBox extends Button {
private boolean isChecked;
public final static int width = 40;
public final static int heigth = 40;
public final String text;
public CheckBox(int id, String text, int x, int y) {
this(id, text, x, y, false);
}
public CheckBox(int id, String text, int x, int y, boolean initial) {
super(id, x - 8, y - 10, width, heigth);
isChecked = initial;
this.text = text;
}
@Override
public void render(Screen screen) {
if (isChecked) {
screen.blit(Art.checked, x, y);
} else {
screen.blit(Art.unchecked, x, y);
}
Font.draw(screen, text, x + width, y + 15);
}
@Override
public void postClick() {
isChecked = !isChecked;
super.postClick();
}
public boolean isChecked() {
return isChecked;
}
}
| {
"content_hash": "e9ef463012d5d11202f6109934df21ac",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 70,
"avg_line_length": 19.954545454545453,
"alnum_prop": 0.6742596810933941,
"repo_name": "rekh127/Catacomb-Snatch-Reloaded",
"id": "dd27ab5f566bd5b22b921a35b377e1d9620ca1d9",
"size": "878",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/mojang/mojam/gui/CheckBox.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1434043"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "c33200468cf5863ae27ce7051839ee9e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "c7235ab3882e3d0ad3eb5e631401f292b93e268c",
"size": "213",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Rubus/Rubus trifidus/ Syn. Rubus corchorifolius hydrastifolius/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>ublas: boost::numeric::ublas::scalar_conj< T > Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div class="navpath"><b>boost</b>::<b>numeric</b>::<b>ublas</b>::<a class="el" href="structboost_1_1numeric_1_1ublas_1_1scalar__conj.html">scalar_conj</a>
</div>
</div>
<div class="contents">
<h1>boost::numeric::ublas::scalar_conj< T > Struct Template Reference</h1><!-- doxytag: class="boost::numeric::ublas::scalar_conj" --><!-- doxytag: inherits="boost::numeric::ublas::scalar_unary_functor" -->
<p>Inherits <a class="el" href="structboost_1_1numeric_1_1ublas_1_1scalar__unary__functor.html">boost::numeric::ublas::scalar_unary_functor< T ></a>.</p>
<p><a href="structboost_1_1numeric_1_1ublas_1_1scalar__conj-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5ea3a75e0c340cbe9804f1a529b34b32"></a><!-- doxytag: member="boost::numeric::ublas::scalar_conj::value_type" ref="a5ea3a75e0c340cbe9804f1a529b34b32" args="" -->
typedef <a class="el" href="structboost_1_1numeric_1_1ublas_1_1scalar__unary__functor.html">scalar_unary_functor</a><br class="typebreak"/>
< T >::value_type </td><td class="memItemRight" valign="bottom"><b>value_type</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a32e1f4171c7f3454c7d596c43e1cdd4e"></a><!-- doxytag: member="boost::numeric::ublas::scalar_conj::argument_type" ref="a32e1f4171c7f3454c7d596c43e1cdd4e" args="" -->
typedef <a class="el" href="structboost_1_1numeric_1_1ublas_1_1scalar__unary__functor.html">scalar_unary_functor</a><br class="typebreak"/>
< T >::argument_type </td><td class="memItemRight" valign="bottom"><b>argument_type</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6e26947bceeeac1bec0cbebcf6aa62f3"></a><!-- doxytag: member="boost::numeric::ublas::scalar_conj::result_type" ref="a6e26947bceeeac1bec0cbebcf6aa62f3" args="" -->
typedef <a class="el" href="structboost_1_1numeric_1_1ublas_1_1scalar__unary__functor.html">scalar_unary_functor</a><br class="typebreak"/>
< T >::result_type </td><td class="memItemRight" valign="bottom"><b>result_type</b></td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7db26dfd9ac5afd4fba5c003884396b2"></a><!-- doxytag: member="boost::numeric::ublas::scalar_conj::apply" ref="a7db26dfd9ac5afd4fba5c003884396b2" args="(argument_type t)" -->
static BOOST_UBLAS_INLINE <br class="typebreak"/>
result_type </td><td class="memItemRight" valign="bottom"><b>apply</b> (argument_type t)</td></tr>
</table>
<h3>template<class T><br/>
struct boost::numeric::ublas::scalar_conj< T ></h3>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Sun Jul 4 20:31:06 2010 for ublas by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>
| {
"content_hash": "487e1aebd29c86e02727c7b31f72efed",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 249,
"avg_line_length": 72.42372881355932,
"alnum_prop": 0.6747016147905452,
"repo_name": "cpascal/af-cpp",
"id": "46de50d0456748a6ef5d020e19208d7f0e977273",
"size": "4273",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "apdos/exts/boost_1_53_0/libs/numeric/ublas/doc/html/structboost_1_1numeric_1_1ublas_1_1scalar__conj.html",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "142321"
},
{
"name": "Batchfile",
"bytes": "45292"
},
{
"name": "C",
"bytes": "2380742"
},
{
"name": "C#",
"bytes": "41850"
},
{
"name": "C++",
"bytes": "141733840"
},
{
"name": "CMake",
"bytes": "1784"
},
{
"name": "CSS",
"bytes": "303526"
},
{
"name": "Cuda",
"bytes": "27558"
},
{
"name": "FORTRAN",
"bytes": "1440"
},
{
"name": "Groff",
"bytes": "8174"
},
{
"name": "HTML",
"bytes": "80494592"
},
{
"name": "IDL",
"bytes": "15"
},
{
"name": "JavaScript",
"bytes": "134468"
},
{
"name": "Lex",
"bytes": "1318"
},
{
"name": "Makefile",
"bytes": "1028949"
},
{
"name": "Max",
"bytes": "36857"
},
{
"name": "Objective-C",
"bytes": "4297"
},
{
"name": "PHP",
"bytes": "60249"
},
{
"name": "Perl",
"bytes": "30505"
},
{
"name": "Perl6",
"bytes": "2130"
},
{
"name": "Python",
"bytes": "1751993"
},
{
"name": "QML",
"bytes": "613"
},
{
"name": "Rebol",
"bytes": "372"
},
{
"name": "Shell",
"bytes": "374946"
},
{
"name": "Tcl",
"bytes": "1205"
},
{
"name": "TeX",
"bytes": "13819"
},
{
"name": "XSLT",
"bytes": "780775"
},
{
"name": "Yacc",
"bytes": "19612"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>zebkit.ui.event.WinEvent - zebkit</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/sunburst.css">
<link rel="stylesheet" href="../assets/css/main.dark.css" id="site_styles">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc" style="padding-top:16px;">
<div class="yui3-g">
<table style="width:auto">
<tr style="background:none">
<td valign="top" align="left" >
<div id="sidebar" class="yui3-u">
<div id="classes" class="sidebox">
<div class="hd">
<h2 class="no-toc">All packages</h2>
</div>
<div class="bd">
<ul>
<li>
<a href="../classes/environment.html">environment</a>
</li>
<li>
<a href="../classes/zebkit.html">zebkit</a>
</li>
<li>
<a href="../classes/zebkit.data.html">zebkit.data</a>
</li>
<li>
<a href="../classes/zebkit.draw.html">zebkit.draw</a>
</li>
<li>
<a href="../classes/zebkit.io.html">zebkit.io</a>
</li>
<li>
<a href="../classes/zebkit.layout.html">zebkit.layout</a>
</li>
<li>
<a href="../classes/zebkit.ui.html">zebkit.ui</a>
</li>
<li>
<a href="../classes/zebkit.ui.date.html">zebkit.ui.date</a>
</li>
<li>
<a href="../classes/zebkit.ui.design.html">zebkit.ui.design</a>
</li>
<li>
<a href="../classes/zebkit.ui.event.html">zebkit.ui.event</a>
</li>
<li>
<a href="../classes/zebkit.ui.grid.html">zebkit.ui.grid</a>
</li>
<li>
<a href="../classes/zebkit.ui.tree.html">zebkit.ui.tree</a>
</li>
<li>
<a href="../classes/zebkit.ui.vk.html">zebkit.ui.vk</a>
</li>
<li>
<a href="../classes/zebkit.ui.web.html">zebkit.ui.web</a>
</li>
<li>
<a href="../classes/zebkit.util.html">zebkit.util</a>
</li>
<li>
<a href="../classes/zebkit.web.html">zebkit.web</a>
</li>
</ul>
</div>
</div>
<div id="classes" class="sidebox">
<div class="hd">
<table border="0" cellpadding="0" cellspecing="0">
<tr>
<td>
<h2 class="no-toc">All classes</h2>
</td>
<td>
<input id="search" style="width:95%;" type=text value=""/>
</td>
</tr>
</table>
</div>
<div class="bd">
<table id="allClasses" style="background:none;" border="0">
<tr class="classNameCell" className="zebkit.Class" name="allClassesItem">
<td>
<a href="../classes/zebkit.Class.html">zebkit.Class</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.Class.zObject" name="allClassesItem">
<td>
<a href="../classes/zebkit.Class.zObject.html">zebkit.Class.zObject</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.data.DataModel" name="allClassesItem">
<td>
<a href="../classes/zebkit.data.DataModel.html">zebkit.data.DataModel</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.data.Item" name="allClassesItem">
<td>
<a href="../classes/zebkit.data.Item.html">zebkit.data.Item</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.data.ListModel" name="allClassesItem">
<td>
<a href="../classes/zebkit.data.ListModel.html">zebkit.data.ListModel</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.data.Matrix" name="allClassesItem">
<td>
<a href="../classes/zebkit.data.Matrix.html">zebkit.data.Matrix</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.data.SingleLineTxt" name="allClassesItem">
<td>
<a href="../classes/zebkit.data.SingleLineTxt.html">zebkit.data.SingleLineTxt</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.data.Text" name="allClassesItem">
<td>
<a href="../classes/zebkit.data.Text.html">zebkit.data.Text</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.data.TextEvent" name="allClassesItem">
<td>
<a href="../classes/zebkit.data.TextEvent.html">zebkit.data.TextEvent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.data.TextModel" name="allClassesItem">
<td>
<a href="../classes/zebkit.data.TextModel.html">zebkit.data.TextModel</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.data.TreeModel" name="allClassesItem">
<td>
<a href="../classes/zebkit.data.TreeModel.html">zebkit.data.TreeModel</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.DoIt" name="allClassesItem">
<td>
<a href="../classes/zebkit.DoIt.html">zebkit.DoIt</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.ArrowView" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.ArrowView.html">zebkit.draw.ArrowView</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.BaseTextRender" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.BaseTextRender.html">zebkit.draw.BaseTextRender</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.BaseViewProvider" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.BaseViewProvider.html">zebkit.draw.BaseViewProvider</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Border" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Border.html">zebkit.draw.Border</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.CheckboxView" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.CheckboxView.html">zebkit.draw.CheckboxView</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.CompositeView" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.CompositeView.html">zebkit.draw.CompositeView</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.CutStringRender" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.CutStringRender.html">zebkit.draw.CutStringRender</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.DecoratedTextRender" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.DecoratedTextRender.html">zebkit.draw.DecoratedTextRender</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Dotted" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Dotted.html">zebkit.draw.Dotted</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Etched" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Etched.html">zebkit.draw.Etched</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.FunctionRender" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.FunctionRender.html">zebkit.draw.FunctionRender</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Gradient" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Gradient.html">zebkit.draw.Gradient</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Line" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Line.html">zebkit.draw.Line</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.PasswordText" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.PasswordText.html">zebkit.draw.PasswordText</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Pattern" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Pattern.html">zebkit.draw.Pattern</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.PentahedronShape" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.PentahedronShape.html">zebkit.draw.PentahedronShape</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Picture" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Picture.html">zebkit.draw.Picture</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Radial" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Radial.html">zebkit.draw.Radial</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.RadioView" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.RadioView.html">zebkit.draw.RadioView</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Raised" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Raised.html">zebkit.draw.Raised</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Render" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Render.html">zebkit.draw.Render</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.rgb" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.rgb.html">zebkit.draw.rgb</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.RoundBorder" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.RoundBorder.html">zebkit.draw.RoundBorder</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Shape" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Shape.html">zebkit.draw.Shape</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.StringRender" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.StringRender.html">zebkit.draw.StringRender</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.Sunken" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.Sunken.html">zebkit.draw.Sunken</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.TextRender" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.TextRender.html">zebkit.draw.TextRender</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.ThumbView" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.ThumbView.html">zebkit.draw.ThumbView</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.TitledBorder" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.TitledBorder.html">zebkit.draw.TitledBorder</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.ToggleView" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.ToggleView.html">zebkit.draw.ToggleView</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.TriangleShape" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.TriangleShape.html">zebkit.draw.TriangleShape</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.View" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.View.html">zebkit.draw.View</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.ViewSet" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.ViewSet.html">zebkit.draw.ViewSet</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.draw.WrappedTextRender" name="allClassesItem">
<td>
<a href="../classes/zebkit.draw.WrappedTextRender.html">zebkit.draw.WrappedTextRender</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.Dummy" name="allClassesItem">
<td>
<a href="../classes/zebkit.Dummy.html">zebkit.Dummy</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.Event" name="allClassesItem">
<td>
<a href="../classes/zebkit.Event.html">zebkit.Event</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.EventProducer" name="allClassesItem">
<td>
<a href="../classes/zebkit.EventProducer.html">zebkit.EventProducer</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.Font" name="allClassesItem">
<td>
<a href="../classes/zebkit.Font.html">zebkit.Font</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.Interface" name="allClassesItem">
<td>
<a href="../classes/zebkit.Interface.html">zebkit.Interface</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.io.HTTP" name="allClassesItem">
<td>
<a href="../classes/zebkit.io.HTTP.html">zebkit.io.HTTP</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.io.JRPC" name="allClassesItem">
<td>
<a href="../classes/zebkit.io.JRPC.html">zebkit.io.JRPC</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.io.Service" name="allClassesItem">
<td>
<a href="../classes/zebkit.io.Service.html">zebkit.io.Service</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.io.XRPC" name="allClassesItem">
<td>
<a href="../classes/zebkit.io.XRPC.html">zebkit.io.XRPC</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.layout.BorderLayout" name="allClassesItem">
<td>
<a href="../classes/zebkit.layout.BorderLayout.html">zebkit.layout.BorderLayout</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.layout.Constraints" name="allClassesItem">
<td>
<a href="../classes/zebkit.layout.Constraints.html">zebkit.layout.Constraints</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.layout.FlowLayout" name="allClassesItem">
<td>
<a href="../classes/zebkit.layout.FlowLayout.html">zebkit.layout.FlowLayout</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.layout.GridLayout" name="allClassesItem">
<td>
<a href="../classes/zebkit.layout.GridLayout.html">zebkit.layout.GridLayout</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.layout.Layout" name="allClassesItem">
<td>
<a href="../classes/zebkit.layout.Layout.html">zebkit.layout.Layout</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.layout.Layoutable" name="allClassesItem">
<td>
<a href="../classes/zebkit.layout.Layoutable.html">zebkit.layout.Layoutable</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.layout.ListLayout" name="allClassesItem">
<td>
<a href="../classes/zebkit.layout.ListLayout.html">zebkit.layout.ListLayout</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.layout.PercentLayout" name="allClassesItem">
<td>
<a href="../classes/zebkit.layout.PercentLayout.html">zebkit.layout.PercentLayout</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.layout.RasterLayout" name="allClassesItem">
<td>
<a href="../classes/zebkit.layout.RasterLayout.html">zebkit.layout.RasterLayout</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.layout.StackLayout" name="allClassesItem">
<td>
<a href="../classes/zebkit.layout.StackLayout.html">zebkit.layout.StackLayout</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.Listeners" name="allClassesItem">
<td>
<a href="../classes/zebkit.Listeners.html">zebkit.Listeners</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.Package" name="allClassesItem">
<td>
<a href="../classes/zebkit.Package.html">zebkit.Package</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.PathSearch" name="allClassesItem">
<td>
<a href="../classes/zebkit.PathSearch.html">zebkit.PathSearch</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.ArrowButton" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.ArrowButton.html">zebkit.ui.ArrowButton</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.BaseList" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.BaseList.html">zebkit.ui.BaseList</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.BoldLabel" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.BoldLabel.html">zebkit.ui.BoldLabel</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.BorderPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.BorderPan.html">zebkit.ui.BorderPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Button" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Button.html">zebkit.ui.Button</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Checkbox" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Checkbox.html">zebkit.ui.Checkbox</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Checkbox.Box" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Checkbox.Box.html">zebkit.ui.Checkbox.Box</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.CollapsiblePan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.CollapsiblePan.html">zebkit.ui.CollapsiblePan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Combo" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Combo.html">zebkit.ui.Combo</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Combo.ComboPadPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Combo.ComboPadPan.html">zebkit.ui.Combo.ComboPadPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Combo.ContentPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Combo.ContentPan.html">zebkit.ui.Combo.ContentPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Combo.EditableContentPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Combo.EditableContentPan.html">zebkit.ui.Combo.EditableContentPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Combo.ReadonlyContentPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Combo.ReadonlyContentPan.html">zebkit.ui.Combo.ReadonlyContentPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.CompList" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.CompList.html">zebkit.ui.CompList</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.CompRender" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.CompRender.html">zebkit.ui.CompRender</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Cursor" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Cursor.html">zebkit.ui.Cursor</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.date.Calendar" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.date.Calendar.html">zebkit.ui.date.Calendar</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.date.Calendar.MonthsCombo" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.date.Calendar.MonthsCombo.html">zebkit.ui.date.Calendar.MonthsCombo</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.date.DateInputField" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.date.DateInputField.html">zebkit.ui.date.DateInputField</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.date.DateRangeInput" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.date.DateRangeInput.html">zebkit.ui.date.DateRangeInput</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.date.DateTextField" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.date.DateTextField.html">zebkit.ui.date.DateTextField</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.date.MonthDaysGrid" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.date.MonthDaysGrid.html">zebkit.ui.date.MonthDaysGrid</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.date.MonthDaysGrid.DayPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.date.MonthDaysGrid.DayPan.html">zebkit.ui.date.MonthDaysGrid.DayPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.date.PopupCalendarMix" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.date.PopupCalendarMix.html">zebkit.ui.date.PopupCalendarMix</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.design.FormTreeModel" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.design.FormTreeModel.html">zebkit.ui.design.FormTreeModel</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.design.ShaperBorder" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.design.ShaperBorder.html">zebkit.ui.design.ShaperBorder</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.design.ShaperPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.design.ShaperPan.html">zebkit.ui.design.ShaperPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.DrawFocusMarker" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.DrawFocusMarker.html">zebkit.ui.DrawFocusMarker</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.Clipboard" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.Clipboard.html">zebkit.ui.event.Clipboard</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.CompEvent" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.CompEvent.html">zebkit.ui.event.CompEvent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.CursorManager" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.CursorManager.html">zebkit.ui.event.CursorManager</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.EventManager" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.EventManager.html">zebkit.ui.event.EventManager</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.FocusEvent" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.FocusEvent.html">zebkit.ui.event.FocusEvent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.FocusManager" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.FocusManager.html">zebkit.ui.event.FocusManager</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.KeyEvent" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.KeyEvent.html">zebkit.ui.event.KeyEvent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.Manager" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.Manager.html">zebkit.ui.event.Manager</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.MenuEvent" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.MenuEvent.html">zebkit.ui.event.MenuEvent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.PointerEvent" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.PointerEvent.html">zebkit.ui.event.PointerEvent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.ShortcutEvent" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.ShortcutEvent.html">zebkit.ui.event.ShortcutEvent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.ShortcutManager" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.ShortcutManager.html">zebkit.ui.event.ShortcutManager</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.TrackInputEventState" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.TrackInputEventState.html">zebkit.ui.event.TrackInputEventState</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.event.WinEvent" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.event.WinEvent.html">zebkit.ui.event.WinEvent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.EvStatePan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.EvStatePan.html">zebkit.ui.EvStatePan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.FireEventRepeatedly" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.FireEventRepeatedly.html">zebkit.ui.FireEventRepeatedly</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.BaseCaption" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.BaseCaption.html">zebkit.ui.grid.BaseCaption</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.CaptionViewProvider" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.CaptionViewProvider.html">zebkit.ui.grid.CaptionViewProvider</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.CellSelectMode" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.CellSelectMode.html">zebkit.ui.grid.CellSelectMode</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.CellsVisibility" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.CellsVisibility.html">zebkit.ui.grid.CellsVisibility</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.ColSelectMode" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.ColSelectMode.html">zebkit.ui.grid.ColSelectMode</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.CompGridCaption" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.CompGridCaption.html">zebkit.ui.grid.CompGridCaption</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.CompGridCaption.TitlePan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.CompGridCaption.TitlePan.html">zebkit.ui.grid.CompGridCaption.TitlePan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.DefEditors" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.DefEditors.html">zebkit.ui.grid.DefEditors</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.DefViews" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.DefViews.html">zebkit.ui.grid.DefViews</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.Grid" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.Grid.html">zebkit.ui.grid.Grid</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.GridCaption" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.GridCaption.html">zebkit.ui.grid.GridCaption</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.GridStretchPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.GridStretchPan.html">zebkit.ui.grid.GridStretchPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.LeftCompGridCaption" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.LeftCompGridCaption.html">zebkit.ui.grid.LeftCompGridCaption</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.LeftGridCaption" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.LeftGridCaption.html">zebkit.ui.grid.LeftGridCaption</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.Metrics" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.Metrics.html">zebkit.ui.grid.Metrics</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.RowSelectMode" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.RowSelectMode.html">zebkit.ui.grid.RowSelectMode</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.grid.StrippedRows" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.grid.StrippedRows.html">zebkit.ui.grid.StrippedRows</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Group" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Group.html">zebkit.ui.Group</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.HostDecorativeViews" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.HostDecorativeViews.html">zebkit.ui.HostDecorativeViews</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.ImageLabel" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.ImageLabel.html">zebkit.ui.ImageLabel</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.ImagePan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.ImagePan.html">zebkit.ui.ImagePan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Label" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Label.html">zebkit.ui.Label</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Line" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Line.html">zebkit.ui.Line</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.LinearRulerPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.LinearRulerPan.html">zebkit.ui.LinearRulerPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Link" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Link.html">zebkit.ui.Link</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.List" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.List.html">zebkit.ui.List</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.List.ViewProvider" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.List.ViewProvider.html">zebkit.ui.List.ViewProvider</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Menu" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Menu.html">zebkit.ui.Menu</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Menubar" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Menubar.html">zebkit.ui.Menubar</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.MenuItem" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.MenuItem.html">zebkit.ui.MenuItem</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.MobileScrollMan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.MobileScrollMan.html">zebkit.ui.MobileScrollMan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Panel" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Panel.html">zebkit.ui.Panel</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.PassTextField" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.PassTextField.html">zebkit.ui.PassTextField</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.PointRulerPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.PointRulerPan.html">zebkit.ui.PointRulerPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.PointRulerPan.DeltaPointsGenerator" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.PointRulerPan.DeltaPointsGenerator.html">zebkit.ui.PointRulerPan.DeltaPointsGenerator</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.PointRulerPan.PointsGenerator" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.PointRulerPan.PointsGenerator.html">zebkit.ui.PointRulerPan.PointsGenerator</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.PopupLayer" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.PopupLayer.html">zebkit.ui.PopupLayer</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.PopupLayerMix" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.PopupLayerMix.html">zebkit.ui.PopupLayerMix</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Progress" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Progress.html">zebkit.ui.Progress</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Radiobox" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Radiobox.html">zebkit.ui.Radiobox</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.RootLayer" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.RootLayer.html">zebkit.ui.RootLayer</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.RootLayerMix" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.RootLayerMix.html">zebkit.ui.RootLayerMix</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.RulerPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.RulerPan.html">zebkit.ui.RulerPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.RulerPan.NumLabels" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.RulerPan.NumLabels.html">zebkit.ui.RulerPan.NumLabels</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.RulerPan.PercentageLabels" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.RulerPan.PercentageLabels.html">zebkit.ui.RulerPan.PercentageLabels</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Scroll" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Scroll.html">zebkit.ui.Scroll</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.ScrollManager" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.ScrollManager.html">zebkit.ui.ScrollManager</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.ScrollPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.ScrollPan.html">zebkit.ui.ScrollPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Slider" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Slider.html">zebkit.ui.Slider</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.SplitPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.SplitPan.html">zebkit.ui.SplitPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.StackPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.StackPan.html">zebkit.ui.StackPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.StatePan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.StatePan.html">zebkit.ui.StatePan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.StatusBarPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.StatusBarPan.html">zebkit.ui.StatusBarPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Tabs" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Tabs.html">zebkit.ui.Tabs</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Tabs.TabView" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Tabs.TabView.html">zebkit.ui.Tabs.TabView</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.TextArea" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.TextArea.html">zebkit.ui.TextArea</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.TextField" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.TextField.html">zebkit.ui.TextField</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.TextField.HintRender" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.TextField.HintRender.html">zebkit.ui.TextField.HintRender</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Toolbar" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Toolbar.html">zebkit.ui.Toolbar</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Tooltip" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Tooltip.html">zebkit.ui.Tooltip</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.TooltipManager" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.TooltipManager.html">zebkit.ui.TooltipManager</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.tree.BaseTree" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.tree.BaseTree.html">zebkit.ui.tree.BaseTree</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.tree.CompTree" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.tree.CompTree.html">zebkit.ui.tree.CompTree</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.tree.DefEditors" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.tree.DefEditors.html">zebkit.ui.tree.DefEditors</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.tree.DefViews" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.tree.DefViews.html">zebkit.ui.tree.DefViews</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.tree.Tree" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.tree.Tree.html">zebkit.ui.tree.Tree</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.ViewPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.ViewPan.html">zebkit.ui.ViewPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.CursorManager" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.CursorManager.html">zebkit.ui.web.CursorManager</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.HtmlCanvas" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.HtmlCanvas.html">zebkit.ui.web.HtmlCanvas</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.HtmlElement" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.HtmlElement.html">zebkit.ui.web.HtmlElement</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.HtmlFocusableElement" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.HtmlFocusableElement.html">zebkit.ui.web.HtmlFocusableElement</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.HtmlLayer" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.HtmlLayer.html">zebkit.ui.web.HtmlLayer</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.HtmlLink" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.HtmlLink.html">zebkit.ui.web.HtmlLink</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.HtmlScrollContent" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.HtmlScrollContent.html">zebkit.ui.web.HtmlScrollContent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.HtmlTextArea" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.HtmlTextArea.html">zebkit.ui.web.HtmlTextArea</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.HtmlTextField" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.HtmlTextField.html">zebkit.ui.web.HtmlTextField</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.HtmlTextInput" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.HtmlTextInput.html">zebkit.ui.web.HtmlTextInput</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.HtmlWindow" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.HtmlWindow.html">zebkit.ui.web.HtmlWindow</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.PopupLayer" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.PopupLayer.html">zebkit.ui.web.PopupLayer</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.RootLayer" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.RootLayer.html">zebkit.ui.web.RootLayer</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.VideoPan" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.VideoPan.html">zebkit.ui.web.VideoPan</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.web.WinLayer" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.web.WinLayer.html">zebkit.ui.web.WinLayer</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.Window" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.Window.html">zebkit.ui.Window</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.WinLayer" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.WinLayer.html">zebkit.ui.WinLayer</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.ui.zCanvas" name="allClassesItem">
<td>
<a href="../classes/zebkit.ui.zCanvas.html">zebkit.ui.zCanvas</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.URI" name="allClassesItem">
<td>
<a href="../classes/zebkit.URI.html">zebkit.URI</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.util.Position" name="allClassesItem">
<td>
<a href="../classes/zebkit.util.Position.html">zebkit.util.Position</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.util.Position.Metric" name="allClassesItem">
<td>
<a href="../classes/zebkit.util.Position.Metric.html">zebkit.util.Position.Metric</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.util.SingleColPosition" name="allClassesItem">
<td>
<a href="../classes/zebkit.util.SingleColPosition.html">zebkit.util.SingleColPosition</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.util.TasksSet" name="allClassesItem">
<td>
<a href="../classes/zebkit.util.TasksSet.html">zebkit.util.TasksSet</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.util.TasksSet.Task" name="allClassesItem">
<td>
<a href="../classes/zebkit.util.TasksSet.Task.html">zebkit.util.TasksSet.Task</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.web.Clipboard" name="allClassesItem">
<td>
<a href="../classes/zebkit.web.Clipboard.html">zebkit.web.Clipboard</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.web.KeyEvent" name="allClassesItem">
<td>
<a href="../classes/zebkit.web.KeyEvent.html">zebkit.web.KeyEvent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.web.KeyEventUninfier" name="allClassesItem">
<td>
<a href="../classes/zebkit.web.KeyEventUninfier.html">zebkit.web.KeyEventUninfier</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.web.MouseWheelSupport" name="allClassesItem">
<td>
<a href="../classes/zebkit.web.MouseWheelSupport.html">zebkit.web.MouseWheelSupport</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.web.PointerEvent" name="allClassesItem">
<td>
<a href="../classes/zebkit.web.PointerEvent.html">zebkit.web.PointerEvent</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.web.PointerEventUnifier" name="allClassesItem">
<td>
<a href="../classes/zebkit.web.PointerEventUnifier.html">zebkit.web.PointerEventUnifier</a>
</td>
</tr>
<tr class="classNameCell" className="zebkit.Zson" name="allClassesItem">
<td>
<a href="../classes/zebkit.Zson.html">zebkit.Zson</a>
</td>
</tr>
</table>
</div>
</div>
<script>
var root = document.getElementById("allClasses");
document.getElementById("search").addEventListener('input', function(e) {
var items = document.getElementsByName("allClassesItem"),
value = this.value.trim().toLowerCase();
for(var i = 0; i < items.length; i++) {
var item = items[i];
if (value.length < 3 || item.getAttribute("className").toLowerCase().indexOf(value) >= 0) {
item.style.display = "block";
} else {
item.style.display = "none";
};
}
});
</script> </div>
</td>
<td valign="top" align="left">
<div id="main" class="yui3-u">
<div class="content">
<div class="hd">
<table width="100%">
<tr>
<td>
<strong>
Class
</strong>
<strong class="name"">
zebkit.ui.event.WinEvent
</strong>
<br/>
<strong>
extends
</strong>
<span class="type"><<a href="../classes/zebkit.Event.html" class="crosslink">zebkit.Event</a>></span>
</td>
<td align="right" valign="top">
<a href="../classes/zebkit.ui.event.html">
<zebkit.ui.event>
</a>
</td>
<tr>
</table>
</div>
<br/>
<div class="intro">
<p>Window component event</p>
</div>
<strong>Constructor:</strong><a name="methods_zebkit.ui.event.WinEvent"></a>
<div class="method item">
<span class="foundat">
</span>
<strong class="name"><code>zebkit.ui.event.WinEvent</code> (<code> </code>)</strong>
<br/>
</div>
<br/>
<br/>
<div id="classdocs">
<ul>
<li>
<a href="#methods">
Methods
</a>
</li>
<li>
<a href="#attrs">
Attributes
</a>
</li>
</ul>
<div>
<div id="methods">
<div class="bd">
<br/>
</div>
<table>
<tr>
<td><a name="methods_$fillWidth"></a>
<div class="method item">
<span class="foundat">
</span>
<strong> public </strong>
<span class="type">chainable</span>
<strong class="name"><code>$fillWidth</code> (<code>src, layer, isActive, isShown</code>)</strong>
<br/>
<p>Fill the event with parameters</p>
<br/>
<strong>Parameters:</strong>
<ul class="params">
<li>
<span class="name"><code>src</code></span>
<strong class="type">
<<a href="../classes/zebkit.ui.Panel.html" class="crosslink">zebkit.ui.Panel</a>>
</strong>
<p>a source window</p>
</li>
<li>
<span class="name"><code>layer</code></span>
<strong class="type">
<<a href="../classes/zebkit.ui.Panel.html" class="crosslink">zebkit.ui.Panel</a>>
</strong>
<p>a layer the window belongs to</p>
</li>
<li>
<span class="name"><code>isActive</code></span>
<strong class="type">
<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a>>
</strong>
<p>boolean flag that indicates the window status</p>
</li>
<li>
<span class="name"><code>isShown</code></span>
<strong class="type">
<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a>>
</strong>
<p>boolean flag that indicates the window visibility</p>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
<div id="attrs">
<br/><br/>
<div class="attrs">
<strong>Inherited attributes:</strong>
<br/>
<div style="padding:6px;">
<small style="white-space: nowrap;">
<strong> public </strong>
<img title="readonly" width="14" height="14" src="../assets/css/lock.png" />
<strong class="type">
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a>
</strong>
<a href="zebkit.Event.html#atttrs_source">
source
</a>
</small>
</div>
<br/><br/>
</div>
<br/>
<table>
<tr>
<td>
<a name="attrs_isActive"></a>
<div class="attrs item">
<strong> public </strong>
<img title="readonly" width="18" height="18" src="../assets/css/lock.png" />
<strong class="type">
<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a>>
</strong>
<strong class="name" style="color:orange;">
<code>isActive</code>
</strong>
<br>
<p>Indicates if the window has been activated</p>
</div>
</td>
</tr>
<tr>
<td>
<a name="attrs_isShown"></a>
<div class="attrs item">
<strong> public </strong>
<img title="readonly" width="18" height="18" src="../assets/css/lock.png" />
<strong class="type">
<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a>>
</strong>
<strong class="name" style="color:orange;">
<code>isShown</code>
</strong>
<br>
<p>Indicates if the window has been shown</p>
</div>
</td>
</tr>
<tr>
<td>
<a name="attrs_layer"></a>
<div class="attrs item">
<strong> public </strong>
<img title="readonly" width="18" height="18" src="../assets/css/lock.png" />
<strong class="type">
<<a href="../classes/zebkit.ui.Panel.html" class="crosslink">zebkit.ui.Panel</a>>
</strong>
<strong class="name" style="color:orange;">
<code>layer</code>
</strong>
<br>
<p>Layer the source window belongs to</p>
</div>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/js/tabs.js"></script>
</body>
</html>
| {
"content_hash": "f189403ced065e5d81c12f822b22bebf",
"timestamp": "",
"source": "github",
"line_count": 1462,
"max_line_length": 199,
"avg_line_length": 66.29480164158687,
"alnum_prop": 0.3349153451709089,
"repo_name": "barmalei/zebra",
"id": "d2c8588243c0b39c4a329a15a3fe8059ee9dcfe7",
"size": "96923",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "apidoc/dark/classes/zebkit.ui.event.WinEvent.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "46407"
},
{
"name": "HTML",
"bytes": "16270029"
},
{
"name": "JavaScript",
"bytes": "1873648"
}
],
"symlink_target": ""
} |
(function($){
var Renderer = function(canvasId){
var canvas = $('#'+canvasId).get(0)
var ctx = canvas.getContext("2d")
var gfx = arbor.Graphics(canvas)
var particleSystem = null
var that = {
init:function(system){
//
// the particle system will call the init function once, right before the
// first frame is to be drawn. it's a good place to set up the canvas and
// to pass the canvas size to the particle system
//
// save a reference to the particle system for use in the .redraw() loop
particleSystem = system
// inform the system of the screen dimensions so it can map coords for us.
// if the canvas is ever resized, screenSize should be called again with
// the new dimensions
that.fitToCanvasSize()
// set up some event handlers to allow for node-dragging
that.initMouseHandling()
$(window).resize(that.fitToCanvasSize)
},
fitToCanvasSize:function() {
particleSystem.screen({size:{width:canvas.width, height:canvas.height}})
that.redraw()
},
redraw:function(){
//
// redraw will be called repeatedly during the run whenever the node positions
// change. the new positions for the nodes can be accessed by looking at the
// .p attribute of a given node. however the p.x & p.y values are in the coordinates
// of the particle system rather than the screen. you can either map them to
// the screen yourself, or use the convenience iterators .eachNode (and .eachEdge)
// which allow you to step through the actual node objects but also pass an
// x,y point in the screen's coordinate system
//
if (!particleSystem) return
gfx.clear() // convenience ƒ: clears the whole canvas rect
// draw the nodes & save their bounds for edge drawing
var nodeBoxes = {}
particleSystem.eachEdge(function(edge, pt1, pt2){
// draw a line from pt1 to pt2
ctx.strokeStyle = "black"
ctx.lineWidth = 1
ctx.beginPath()
ctx.moveTo(pt1.x, pt1.y)
ctx.lineTo(pt2.x, pt2.y)
ctx.stroke()
})
particleSystem.eachNode(function(node, pt){
var label = node.name||""
var w = ctx.measureText(""+label).width + 10
if (!(""+label).match(/^[ \t]*$/)){
pt.x = Math.floor(pt.x)
pt.y = Math.floor(pt.y)
}else{
label = null
}
// draw a rectangle centered at pt
if (node.data.color) {
ctx.fillStyle = node.data.color
} else {
ctx.fillStyle = (node.data.alone) ? "#db8e3c" : "#95cde5"
}
if (node.data.color=='none') {
ctx.fillStyle = "white"
}
gfx.rect(pt.x-w/2, pt.y-10, w,20, 4, {fill:ctx.fillStyle})
nodeBoxes[node.name] = [pt.x-w/2, pt.y-11, w, 22]
// draw the text
if (label){
ctx.font = "12px Helvetica"
ctx.textAlign = "center"
ctx.fillStyle = "white"
if (node.data.color=='none') ctx.fillStyle = '#333333'
ctx.fillText(label||"", pt.x, pt.y+4)
ctx.fillText(label||"", pt.x, pt.y+4)
}
})
},
initMouseHandling:function(){
// no-nonsense drag and drop (thanks springy.js)
var dragged = null;
// set up a handler object that will initially listen for mousedowns then
// for moves and mouseups while dragging
var handler = {
clicked:function(e){
var pos = $(canvas).offset();
_mouseP = arbor.Point(e.pageX-pos.left, e.pageY-pos.top)
dragged = particleSystem.nearest(_mouseP);
if (dragged && dragged.node !== null){
// while we're dragging, don't let physics move the node
dragged.node.fixed = true
}
$(canvas).bind('mousemove', handler.dragged)
$(window).bind('mouseup', handler.dropped)
return false
},
dragged:function(e){
var pos = $(canvas).offset();
var s = arbor.Point(e.pageX-pos.left, e.pageY-pos.top)
if (dragged && dragged.node !== null){
var p = particleSystem.fromScreen(s)
dragged.node.p = p
}
return false
},
dropped:function(e){
if (dragged===null || dragged.node===undefined) return
if (dragged.node !== null) dragged.node.fixed = false
dragged.node.tempMass = 1000
dragged = null
$(canvas).unbind('mousemove', handler.dragged)
$(window).unbind('mouseup', handler.dropped)
_mouseP = null
return false
}
}
// start listening
$(canvas).mousedown(handler.clicked);
},
}
return that
}
renderer = Renderer
})(this.jQuery)
| {
"content_hash": "0d9a57547bc1074c6003757bddffa017",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 92,
"avg_line_length": 33.37012987012987,
"alnum_prop": 0.5423234092235844,
"repo_name": "lukacsd/arborvaadin",
"id": "49e0cc3abfbc321207266cf3b3bf606dd7dbd7b2",
"size": "5204",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/main/webapp/VAADIN/arbor/demo_renderer.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package de.st_ddt.crazychats.commands;
import de.st_ddt.crazychats.CrazyChats;
import de.st_ddt.crazyplugin.commands.CrazyPlayerCommandExecutor;
abstract class PlayerCommandExecutor extends CrazyPlayerCommandExecutor<CrazyChats> implements CommandExecutorInterface
{
PlayerCommandExecutor(final CrazyChats plugin)
{
super(plugin);
}
@Override
public CrazyChats getPlugin()
{
return owner;
}
}
| {
"content_hash": "6bf48264536b99045f14d3f9325d61c1",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 119,
"avg_line_length": 22.473684210526315,
"alnum_prop": 0.775175644028103,
"repo_name": "ST-DDT/CrazyChats",
"id": "905b1ea258a3fb0b49d5c4ebba8addadd82a1bc3",
"size": "427",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/de/st_ddt/crazychats/commands/PlayerCommandExecutor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "167339"
}
],
"symlink_target": ""
} |
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function (mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
CodeMirror.multiplexingMode = function (outer /*, others */) {
// Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects
var others = Array.prototype.slice.call(arguments, 1);
var n_others = others.length;
function indexOf(string, pattern, from) {
if (typeof pattern == "string") return string.indexOf(pattern, from);
var m = pattern.exec(from ? string.slice(from) : string);
return m ? m.index + from : -1;
}
return {
startState: function () {
return {
outer: CodeMirror.startState(outer),
innerActive: null,
inner: null
};
},
copyState: function (state) {
return {
outer: CodeMirror.copyState(outer, state.outer),
innerActive: state.innerActive,
inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner)
};
},
token: function (stream, state) {
if (!state.innerActive) {
var cutOff = Infinity, oldContent = stream.string;
for (var i = 0; i < n_others; ++i) {
var other = others[i];
var found = indexOf(oldContent, other.open, stream.pos);
if (found == stream.pos) {
stream.match(other.open);
state.innerActive = other;
state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0);
return other.delimStyle;
} else if (found != -1 && found < cutOff) {
cutOff = found;
}
}
if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff);
var outerToken = outer.token(stream, state.outer);
if (cutOff != Infinity) stream.string = oldContent;
return outerToken;
} else {
var curInner = state.innerActive, oldContent = stream.string;
if (!curInner.close && stream.sol()) {
state.innerActive = state.inner = null;
return this.token(stream, state);
}
var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos) : -1;
if (found == stream.pos) {
stream.match(curInner.close);
state.innerActive = state.inner = null;
return curInner.delimStyle;
}
if (found > -1) stream.string = oldContent.slice(0, found);
var innerToken = curInner.mode.token(stream, state.inner);
if (found > -1) stream.string = oldContent;
if (curInner.innerStyle) {
if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle;
else innerToken = curInner.innerStyle;
}
return innerToken;
}
},
indent: function (state, textAfter) {
var mode = state.innerActive ? state.innerActive.mode : outer;
if (!mode.indent) return CodeMirror.Pass;
return mode.indent(state.innerActive ? state.inner : state.outer, textAfter);
},
blankLine: function (state) {
var mode = state.innerActive ? state.innerActive.mode : outer;
if (mode.blankLine) {
mode.blankLine(state.innerActive ? state.inner : state.outer);
}
if (!state.innerActive) {
for (var i = 0; i < n_others; ++i) {
var other = others[i];
if (other.open === "\n") {
state.innerActive = other;
state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0);
}
}
} else if (state.innerActive.close === "\n") {
state.innerActive = state.inner = null;
}
},
electricChars: outer.electricChars,
innerMode: function (state) {
return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {
state: state.outer,
mode: outer
};
}
};
};
});
| {
"content_hash": "4fbe40fc631a1c65913c2bc2f4ee2dc4",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 126,
"avg_line_length": 43.93388429752066,
"alnum_prop": 0.4706546275395034,
"repo_name": "zheng-zy/lansidemo",
"id": "9e079fbbde61f728f38d8ec27fe906eab6d5dae6",
"size": "5316",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/webapp/lib/codemirror/addon/mode/multiplex.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "801865"
},
{
"name": "HTML",
"bytes": "64414"
},
{
"name": "Java",
"bytes": "41375"
},
{
"name": "JavaScript",
"bytes": "156295"
}
],
"symlink_target": ""
} |
namespace user_notes {
// A class that represents the manifestation of a note within a specific web
// page.
class UserNoteInstance {
public:
explicit UserNoteInstance(base::WeakPtr<UserNote> model);
~UserNoteInstance();
UserNoteInstance(const UserNoteInstance&) = delete;
UserNoteInstance& operator=(const UserNoteInstance&) = delete;
const UserNote* model() { return model_.get(); }
private:
// A weak pointer to the backing model of this note instance. The model is
// owned by |UserNoteService|. The model is generally expected to outlive
// this class, but due to destruction order on browser shut down, using a
// weak pointer here is safer.
base::WeakPtr<UserNote> model_;
};
} // namespace user_notes
#endif // COMPONENTS_USER_NOTES_BROWSER_USER_NOTE_INSTANCE_H_
| {
"content_hash": "04e43942147d341799f7e90ac657a77f",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 76,
"avg_line_length": 33.333333333333336,
"alnum_prop": 0.7375,
"repo_name": "scheib/chromium",
"id": "3273b4b5bde78aab1614fa0a647f111a81c79e47",
"size": "1173",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "components/user_notes/browser/user_note_instance.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
title: SDMX (Statistical Data and Metadata Exchange)
slug: sdmx-statistical-data-and-metadata-exchange
description: <p>A set of common technical and statistical standards and guidelines
to be used for the efficient exchange and sharing of statistical data and metadata.</p><p>Sponsoring
institutions include BIS, ECB, EUROSTAT, IMF, OECD, UN, and the World Bank. Technical
Specification 2.1 was amended in May 2012.</p>
website: http://sdmx.org
subjects:
- social-and-behavioral-sciences
disciplines:
- statistics
- social-policy
- economics
- demography
- human-and-social-geography
specification_url: http://sdmx.org/?page_id=5008
related_vocabularies:
- name: SDMX Content-Oriented Guidelines
url: http://sdmx.org/?page_id=11
layout: standard
type: standard
---
| {
"content_hash": "ad3571256f10a19804e8dd6520b32dca",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 102,
"avg_line_length": 33.65217391304348,
"alnum_prop": 0.7764857881136951,
"repo_name": "rd-alliance/metadata-directory",
"id": "ad1c60ec8778390683eee912eae65c76622bc487",
"size": "778",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "standards/sdmx-statistical-data-and-metadata-exchange.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "13904"
},
{
"name": "HTML",
"bytes": "18741"
},
{
"name": "JavaScript",
"bytes": "37269"
},
{
"name": "Ruby",
"bytes": "49"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2003 - 2015 The eFaps Team
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ui-command xmlns="http://www.efaps.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd">
<uuid>db3a5501-9487-4ac1-ad11-9d473994798b</uuid>
<file-application>eFapsApp-HumanResource</file-application>
<definition>
<version-expression>(version==latest)</version-expression>
<name>HumanResource_EmployeeSearch</name>
<target>
<form>HumanResource_EmployeeSearchForm</form>
<table>HumanResource_EmployeeSearchTable</table>
<evaluate program="org.efaps.esjp.common.uisearch.Search">
<property name="Type">HumanResource_EmployeeAbstract</property>
<property name="ExpandChildTypes">true</property>
<property name="IgnoreCase4Field01">firstName</property>
<property name="IgnoreCase4Field02">lastName</property>
<property name="IgnoreCase4Field03">secondLastName</property>
</evaluate>
</target>
<property name="TargetMode">search</property>
</definition>
</ui-command>
| {
"content_hash": "278d07bc446ce652caeda47439382806",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 98,
"avg_line_length": 43.36585365853659,
"alnum_prop": 0.6912260967379078,
"repo_name": "eFaps/eFapsApp-HumanResource",
"id": "36b5852153afbb8951eab7b3093e6febb2d34a99",
"size": "1778",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/efaps/UserInterface/employee/HumanResource_EmployeeSearch.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "108043"
}
],
"symlink_target": ""
} |
package skylin;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import oracle.sql.ROWID;
import skylin.util.SqlUtil;
import skylin.util.Util;
public class EditView extends View {
public EditView(AM am)
{
super(am);
setRowTypeLater = EditViewRow.class;
}
private LinkedList<String> outQueue = new LinkedList<String>();
private ArrayList<EditViewRowChange> changes = new ArrayList<EditViewRowChange>();
public ArrayList<ViewRow> modifiedRows = new ArrayList<ViewRow>()
{
public boolean add(ViewRow e)
{
changes.add(new EditViewRowModified(e));
return super.add(e);
}
public boolean addAll(Collection<? extends ViewRow> c)
{
for (ViewRow e:c)
{
changes.add(new EditViewRowModified(e));
}
return super.addAll(c);
}
public void clear()
{
for (int i = 0; i < changes.size();i++)
{
if (changes.get(i) instanceof EditViewRowModified)
{
changes.remove(i);
i--;
}
}
super.clear();
}
public boolean remove(Object e)
{
loop:
for (int i = 0; i < changes.size();i++)
{
if (changes.get(i).getObject() == e)
{
changes.remove(i);
break loop;
}
}
return super.remove(e);
}
public ViewRow remove(int index)
{
ViewRow e = get(index);
loop:
for (int i = 0; i < changes.size();i++)
{
if (changes.get(i).getObject() == e)
{
changes.remove(i);
break loop;
}
}
return super.remove(index);
}
};
public ArrayList<Object> deletedKeys = new ArrayList<Object>()
{
public boolean add(Object e)
{
changes.add(new EditViewRowDeleted(e));
return true;
}
public boolean addAll(Collection<? extends Object> c)
{
for (Object e:c)
{
changes.add(new EditViewRowDeleted(e));
}
return super.addAll(c);
}
public void clear()
{
for (int i = 0; i < changes.size();i++)
{
if (changes.get(i) instanceof EditViewRowDeleted)
{
changes.remove(i);
i--;
}
}
super.clear();
}
public boolean remove(Object e)
{
loop:
for (int i = 0; i < changes.size();i++)
{
if (changes.get(i).getObject() == e)
{
changes.remove(i);
break loop;
}
}
return super.remove(e);
}
public Object remove(int index)
{
Object e = get(index);
loop:
for (int i = 0; i < changes.size();i++)
{
if (changes.get(i).getObject() == e)
{
changes.remove(i);
break loop;
}
}
return super.remove(index);
}
};
public String updateProcName;
public String updateTypeName;
public String[] updateArgs;
public String[] excluded;
public String deleteProcName;
public String[] deleteArgs;
public boolean focusOnAddedRow = true;
public static int VIEW_MODE = 0;
public static int ADD_MODE = 1;
public static int EDIT_MODE = 2;
protected int mode = EDIT_MODE;
private String idName = "id";
//private String deleteIdName = "id";
protected boolean stopSaveOnError = false;
protected boolean lastSaveErrorFree;
int messageCode = -1;
String message = "";
public void setIdName(String idName) {
this.idName = idName;
//this.deleteIdName = idName;
}
/*
public void setDeleteIdName(String idName) {
this.deleteIdName = idName;
}
*/
public String getRowIdCol() {
return idName;
}
public void setRowIdCol(String c)
{
idName = c;
}
public boolean lastSaveErrorFree() {
return lastSaveErrorFree;
}
public void deleteCurrentRow()
{
ViewRow r = getCurrentRow();
if (r != null)
{
delete(r);
}
}
public void delete() {
/*
deletedKeys.add(getCurrentRow().getValue(idName));
modifiedRows.remove(getCurrentRow());
removeCurrentRow();
if (owner != null && owner instanceof EditViewRow)
{
((EditViewRow)owner).markModified();
}
*/
delete(getCurrentRow());
}
public void delete(ViewRow row)
{
if (row.view != this)
{
throw new SkylinException(getAM(),"CANNOT DELETE ROW: the row is not contained by the view");
}
/*
Object id = (Object)row.getValue(idName);
if (id != null)
{
deletedKeys.add(id);
}
*/
ArrayList<Object> key = new ArrayList<Object>();
for (String name:deleteArgs)
{
if (name.equals("#user"))
{
key.add(getAM().getUsername());
}
else
{
key.add(row.getValue(name));
}
}
deletedKeys.add(key);
modifiedRows.remove(row);
remove(row);
if (owner != null && owner instanceof EditViewRow)
{
((EditViewRow)owner).markModified();
}
}
public void remove(ViewRow r)
{
modifiedRows.remove(r);
super.remove(r);
}
public int save()
{
Connection con = am.getNewConnection();
try
{
int r = save(con);
try
{
con.commit();
}
catch (SQLException e)
{
getAM().error(e);
}
return r;
}
finally
{
SqlUtil.safeClose(null,null,con);
}
}
public int save(Connection con) {
lastSaveErrorFree = true;
for (EditViewRowChange change:changes)
{
try
{
change.apply(this,con);
}
catch (SQLException e) {
getAM().error(e);
if (e.getErrorCode() != 20901 && e.getErrorCode() != 20902) {
lastSaveErrorFree = false;
if (stopSaveOnError) {
return -1;
}
}
}
}
if (lastSaveErrorFree) return 0;
return -1;
}
public void executeQuery(Connection con)
{
super.executeQuery(con);
modifiedRows.clear();
deletedKeys.clear();
}
public void viewMode() {
mode = VIEW_MODE;
}
public void addMode() {
mode = ADD_MODE;
}
public void editMode() {
mode = EDIT_MODE;
}
public void setMode(int mode) {
this.mode = mode;
}
public int getMode() {
return mode;
}
public void clearMessage() {
message = "";
messageCode = -1;
}
protected void setMessage(String message, int messageCode) {
this.message = message;
this.messageCode = messageCode;
}
public int getMessageCode() {
return messageCode;
}
public String getMessage() {
return message;
}
public boolean isMode(int m)
{
if (mode == m)
{
return true;
}
return false;
}
public boolean isMode(int a, int b)
{
if (mode == a || mode == b)
{
return true;
}
return false;
}
public void setRowType(Class type)
{
if (!EditViewRow.class.isAssignableFrom(type))
{
new SkylinException(getAM(),"CANNOT SET ROW TYPE: " + getClass().getSimpleName() + " is a sub class of EditView. A sub class of EditView needs a sub class of EditViewRow as its rowtype. "+type.getName() + " is not an subclass of EditViewRow");
}
super.setRowType(type);
}
public void clear()
{
modifiedRows.clear();
deletedKeys.clear();
super.clear();
}
public void updateProc(String name, String... args)
{
updateProcName = name;
updateArgs = args;
}
public void deleteProc(String name,String... key)
{
deleteProcName = name;
if (key != null && key.length > 0)
{
deleteArgs = key;
}
else
{
deleteArgs = new String[]{idName,"#user"};
}
}
public void deleteProc(String name)
{
deleteProcName = name;
deleteArgs = new String[]{idName,"#user"};
}
void addOut(String msg) {
outQueue.push(msg);
}
public void clearOut()
{
outQueue.clear();
}
public String popOut()
{
if (outQueue.size() == 0)return null;
return outQueue.pop();
}
public int outSize()
{
return outQueue.size();
}
public ArrayList<ViewRow> getModifiedRows()
{
return modifiedRows;
}
public ArrayList<Object> getDeletedKeys()
{
return deletedKeys;
}
}
| {
"content_hash": "0e091970207ea08ecc74af1d0466880f",
"timestamp": "",
"source": "github",
"line_count": 437,
"max_line_length": 246,
"avg_line_length": 19.041189931350115,
"alnum_prop": 0.5742098305492128,
"repo_name": "wilhelm-vh/skylin",
"id": "d20b8edb025ca4b13ba9bfaaf9186a4774dd9756",
"size": "8321",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/EditView.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "23713"
},
{
"name": "Java",
"bytes": "389855"
},
{
"name": "JavaScript",
"bytes": "72234"
},
{
"name": "PHP",
"bytes": "181526"
}
],
"symlink_target": ""
} |
package models
import (
"koding/db/mongodb/modelhelper"
"socialapi/request"
"socialapi/workers/common/tests"
"testing"
"time"
"gopkg.in/mgo.v2/bson"
"github.com/koding/bongo"
"github.com/koding/runner"
. "github.com/smartystreets/goconvey/convey"
)
func TestPresenceDailyOperations(t *testing.T) {
tests.WithRunner(t, func(r *runner.Runner) {
groupName1 := RandomGroupName()
groupName2 := RandomGroupName()
Convey("With given presence data", t, func() {
p1 := &PresenceDaily{
AccountId: 1,
GroupName: groupName1,
CreatedAt: time.Now().UTC(),
}
So(p1.Create(), ShouldBeNil)
p2 := &PresenceDaily{
AccountId: 2,
GroupName: groupName1,
CreatedAt: time.Now().UTC(),
}
So(p2.Create(), ShouldBeNil)
p2_1 := &PresenceDaily{
AccountId: 2,
GroupName: groupName1,
CreatedAt: time.Now().UTC(),
}
So(p2_1.Create(), ShouldBeNil)
p3 := &PresenceDaily{
AccountId: 3,
GroupName: groupName2,
CreatedAt: time.Now().UTC(),
}
So(p3.Create(), ShouldBeNil)
Convey("CountDistinctByGroupName should work properly", func() {
c1, err := (&PresenceDaily{}).CountDistinctByGroupName(groupName1)
So(err, ShouldBeNil)
So(c1, ShouldNotBeNil)
c2, err := (&PresenceDaily{}).CountDistinctByGroupName(groupName2)
So(err, ShouldBeNil)
So(c2, ShouldNotBeNil)
// we created 2 accounts in groupName1
So(c1, ShouldEqual, 2)
// we created 1 accounts in groupName1
So(c2, ShouldEqual, 1)
Convey("ProcessByGroupName should work properly", func() {
err = (&PresenceDaily{}).ProcessByGroupName(groupName1)
So(err, ShouldBeNil)
c3, err := (&PresenceDaily{}).CountDistinctByGroupName(groupName1)
So(err, ShouldBeNil)
So(c3, ShouldNotBeNil)
c4, err := (&PresenceDaily{}).CountDistinctByGroupName(groupName2)
So(err, ShouldBeNil)
So(c4, ShouldNotBeNil)
// we deleted all the accounts in groupName1
So(c3, ShouldEqual, 0)
// groupName2's count should stay same
So(c4, ShouldEqual, c2)
Convey("CountDistinctProcessedByGroupName should work properly", func() {
c5, err := (&PresenceDaily{}).CountDistinctProcessedByGroupName(groupName1)
So(err, ShouldBeNil)
So(c5, ShouldNotBeNil)
// we created 2 accounts in groupName1
So(c5, ShouldEqual, 2)
})
})
})
})
})
}
func TestPresenceDailyFetchActiveAccounts(t *testing.T) {
tests.WithRunner(t, func(r *runner.Runner) {
Convey("With given presence data", t, func() {
acc1, _, groupName := CreateRandomGroupDataWithChecks()
gr, err := modelhelper.GetGroup(groupName)
tests.ResultedWithNoErrorCheck(gr, err)
err = modelhelper.MakeAdmin(bson.ObjectIdHex(acc1.OldId), gr.Id)
So(err, ShouldBeNil)
p1 := &PresenceDaily{
AccountId: acc1.Id,
GroupName: groupName,
CreatedAt: time.Now().UTC(),
}
So(p1.Create(), ShouldBeNil)
ses, err := modelhelper.FetchOrCreateSession(acc1.Nick, groupName)
So(err, ShouldBeNil)
So(ses, ShouldNotBeNil)
for i := 0; i < 5; i++ {
// create accounts
acc2 := CreateAccountInBothDbsWithCheck()
// add them to presence
p1 := &PresenceDaily{
AccountId: acc2.Id,
GroupName: groupName,
CreatedAt: time.Now().UTC(),
}
So(p1.Create(), ShouldBeNil)
}
Convey("FetchActiveAccounts should not work properly if query is nil", func() {
query := request.NewQuery()
c1, err := (&PresenceDaily{}).FetchActiveAccounts(query)
So(err, ShouldNotBeNil)
So(c1, ShouldBeNil)
Convey("FetchActiveAccounts should work properly", func() {
query := request.NewQuery().SetDefaults()
query.GroupName = groupName
c1, err := (&PresenceDaily{}).FetchActiveAccounts(query)
So(err, ShouldBeNil)
So(c1, ShouldNotBeNil)
})
Convey("Pagination skip should work properly", func() {
query := request.NewQuery().SetDefaults()
query.GroupName = groupName
query.Skip = 20
c1, err := (&PresenceDaily{}).FetchActiveAccounts(query)
So(err, ShouldNotBeNil)
So(err, ShouldEqual, bongo.RecordNotFound)
So(c1, ShouldBeNil)
Convey("Pagination limit should work properly", func() {
query := request.NewQuery().SetDefaults()
query.GroupName = groupName
query.Limit = 4
c1, err := (&PresenceDaily{}).FetchActiveAccounts(query)
So(err, ShouldBeNil)
So(c1, ShouldNotBeNil)
So(len(c1.Accounts), ShouldEqual, 4)
})
})
})
})
})
}
| {
"content_hash": "9945fcf1ea29e5d02148351ae7b3752f",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 82,
"avg_line_length": 27.65644171779141,
"alnum_prop": 0.6597160603371783,
"repo_name": "andrewjcasal/koding",
"id": "27a4057cbff2e94827e5cb55d292e6e0581bca2e",
"size": "4508",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "go/src/socialapi/models/presence_daily_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "593895"
},
{
"name": "CoffeeScript",
"bytes": "3988625"
},
{
"name": "Go",
"bytes": "6760994"
},
{
"name": "HTML",
"bytes": "107319"
},
{
"name": "JavaScript",
"bytes": "2204965"
},
{
"name": "Makefile",
"bytes": "5994"
},
{
"name": "PHP",
"bytes": "1570"
},
{
"name": "PLSQL",
"bytes": "370"
},
{
"name": "PLpgSQL",
"bytes": "16704"
},
{
"name": "Perl",
"bytes": "1612"
},
{
"name": "Python",
"bytes": "27895"
},
{
"name": "Ruby",
"bytes": "1763"
},
{
"name": "SQLPL",
"bytes": "6868"
},
{
"name": "Shell",
"bytes": "112388"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe "problems/index.atom.builder", :type => :view do
it 'display problem message' do
app = Fabricate :app
allow(view).to receive(:problems).and_return([
Fabricate(:problem, :message => 'foo', :app => app),
Fabricate(:problem, :app => app)
])
render
expect(rendered).to match('foo')
end
end
| {
"content_hash": "7e63b7ea48bce59fc51c4999d9fe887e",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 58,
"avg_line_length": 23.733333333333334,
"alnum_prop": 0.6292134831460674,
"repo_name": "Undev/errbit",
"id": "592ed95643f994b498da40c545d8aa4597307df8",
"size": "356",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "spec/views/problems/index.atom.builder_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2379"
},
{
"name": "HTML",
"bytes": "85824"
},
{
"name": "JavaScript",
"bytes": "77201"
},
{
"name": "Ruby",
"bytes": "372233"
},
{
"name": "Shell",
"bytes": "846"
}
],
"symlink_target": ""
} |
package ru.noties.spg.sample;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| {
"content_hash": "efb8bac5fba9d41f7b146571edc45b7c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 56,
"avg_line_length": 23.384615384615383,
"alnum_prop": 0.7368421052631579,
"repo_name": "noties/SharedPreferencesGenerator",
"id": "30f013684b7110dd08f348919fdd2a962aa40597",
"size": "304",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sample/src/main/java/ru/noties/spg/sample/MainActivity.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "61430"
}
],
"symlink_target": ""
} |
<?php
namespace Oro\Bundle\SegmentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Snapshot of static segment
*
* @ORM\Table(
* name="oro_segment_snapshot",
* uniqueConstraints={
* @ORM\UniqueConstraint(columns={"segment_id", "entity_id"})
* },
* indexes={
* @ORM\Index(name="sgmnt_snpsht_int_entity_idx", columns={"integer_entity_id"}),
* @ORM\Index(name="sgmnt_snpsht_str_entity_idx", columns={"entity_id"})
* }
* )
* @ORM\Entity(repositoryClass="Oro\Bundle\SegmentBundle\Entity\Repository\SegmentSnapshotRepository")
* @ORM\HasLifecycleCallbacks
*/
class SegmentSnapshot
{
const ENTITY_REF_FIELD = 'entityId';
const ENTITY_REF_INTEGER_FIELD = 'integerEntityId';
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer", name="id")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="entity_id", type="string", nullable=true)
*/
protected $entityId;
/**
* @var int
*
* @ORM\Column(name="integer_entity_id", type="integer", nullable=true)
*/
protected $integerEntityId;
/**
* @var Segment
*
* @ORM\ManyToOne(targetEntity="Segment")
* @ORM\JoinColumn(name="segment_id", referencedColumnName="id", onDelete="CASCADE", nullable=false)
*/
protected $segment;
/**
* @var \Datetime $created
*
* @ORM\Column(type="datetime")
*/
protected $createdAt;
/**
* Constructor
*
* @param Segment $segment
*/
public function __construct(Segment $segment)
{
$this->segment = $segment;
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param int $entityId
*/
public function setEntityId($entityId)
{
$this->entityId = $entityId;
}
/**
* @return int
*/
public function getEntityId()
{
return $this->entityId;
}
/**
* @return Segment
*/
public function getSegment()
{
return $this->segment;
}
/**
* @param \Datetime $createdAt
*/
public function setCreatedAt(\Datetime $createdAt)
{
$this->createdAt = $createdAt;
}
/**
* @return \Datetime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Pre persist event listener
*
* @ORM\PrePersist
*/
public function prePersist()
{
$this->createdAt = new \DateTime('now', new \DateTimeZone('UTC'));
}
/**
* @return int
*/
public function getIntegerEntityId()
{
return $this->integerEntityId;
}
/**
* @param int $integerEntityId
*/
public function setIntegerEntityId($integerEntityId)
{
$this->integerEntityId = $integerEntityId;
}
}
| {
"content_hash": "713aadfa7ce5e81f86cc691d02a8e079",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 104,
"avg_line_length": 19.879194630872483,
"alnum_prop": 0.550303848750844,
"repo_name": "morontt/platform",
"id": "662ce11a891a339b87b46d775816c221c8793b42",
"size": "2962",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "src/Oro/Bundle/SegmentBundle/Entity/SegmentSnapshot.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "567119"
},
{
"name": "Cucumber",
"bytes": "660"
},
{
"name": "HTML",
"bytes": "1298781"
},
{
"name": "JavaScript",
"bytes": "4420161"
},
{
"name": "PHP",
"bytes": "18280313"
}
],
"symlink_target": ""
} |
// @filename: file1.ts
declare class Promise { }
declare function Foo(): void;
declare class C {}
declare enum E {X = 1};
export var promise = Promise;
export var foo = Foo;
export var c = C;
export var e = E;
// @filename: file2.ts
export declare function foo();
// @filename: file3.ts
export declare class C {}
// @filename: file4.ts
export declare var v: number;
// @filename: file5.ts
export declare enum E {X = 1}
// @filename: file6.ts
export declare module M { var v: number; }
| {
"content_hash": "5d53857deb2168089fa948fa0cc7d0e6",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 42,
"avg_line_length": 19.923076923076923,
"alnum_prop": 0.6447876447876448,
"repo_name": "ropik/TypeScript",
"id": "05f78592780af8fdd242ec69118e16df3910e100",
"size": "569",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/cases/compiler/systemModuleAmbientDeclarations.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "4843"
},
{
"name": "JavaScript",
"bytes": "85"
},
{
"name": "PowerShell",
"bytes": "2855"
},
{
"name": "Shell",
"bytes": "945"
},
{
"name": "TypeScript",
"bytes": "23128927"
}
],
"symlink_target": ""
} |
package com.github.dexecutor.core;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.junit.Test;
import com.github.dexecutor.core.task.ExecutionResult;
public class ExecutionResultTest {
@Test
public void testExecutionResultIdShouldBeOne() {
ExecutionResult<Integer, Integer> result = ExecutionResult.success(1, 1);
assertThat(result.getId(), equalTo(1));
}
@Test
public void testExecutionResultToBeOne() {
ExecutionResult<Integer, Integer> result = ExecutionResult.success(1, 1);
assertThat(result.getResult(), equalTo(1));
}
@Test
public void testExecutionResultToStringShouldNotBeNull() {
ExecutionResult<Integer, Integer> result = ExecutionResult.success(1, 1);
assertNotNull(result.toString());
}
@Test
public void testExecutionResultShouldBeSuccess() {
ExecutionResult<Integer, Integer> result = ExecutionResult.success(1, 1);
assertThat(result.isSuccess(), equalTo(true));
}
@Test
public void testExecutionResultShouldBeErrored() {
ExecutionResult<Integer, Integer> result = ExecutionResult.success(1, 1);
result.errored();
assertThat(result.isErrored(), equalTo(true));
}
@Test
public void testExecutionResultShouldBeSkipped() {
ExecutionResult<Integer, Integer> result = ExecutionResult.success(1, 1);
result.skipped();
assertThat(result.isSkipped(), equalTo(true));
}
}
| {
"content_hash": "38eb2c245f2f8f662046534ef4b3f6ca",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 75,
"avg_line_length": 27.557692307692307,
"alnum_prop": 0.7313328681088626,
"repo_name": "dexecutor/dexecutor-core",
"id": "5347e1ae4332534d30f894210b12dd87f722cb27",
"size": "2250",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/com/github/dexecutor/core/ExecutionResultTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "202516"
}
],
"symlink_target": ""
} |
from setuptools import setup
setup(
name='vrouter',
version='0.1dev',
packages=['vrouter',
'vrouter.vrouter',
'vrouter.vrouter.cpuinfo',
'vrouter.vrouter.process_info',
'vrouter.sandesh',
'vrouter.sandesh.virtual_machine',
'vrouter.sandesh.virtual_machine.port_bmap',
'vrouter.sandesh.virtual_network',
'vrouter.sandesh.flow'
],
package_data={'':['*.html', '*.css', '*.xml']},
zip_safe=False,
long_description="Vrouter Sandesh",
install_requires=[
'lxml',
'gevent',
'geventhttpclient',
'redis',
'xmltodict',
'prettytable',
'psutil==0.4.1'
]
)
| {
"content_hash": "79d013edeb9373634aad523fbccedea5",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 58,
"avg_line_length": 27.071428571428573,
"alnum_prop": 0.5131926121372031,
"repo_name": "cloudwatt/contrail-controller",
"id": "2e18f69982fdbcc50f5a72115bc52e455201064f",
"size": "828",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "src/vnsw/agent/uve/setup.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "80579"
},
{
"name": "C",
"bytes": "44989"
},
{
"name": "C++",
"bytes": "14908777"
},
{
"name": "CSS",
"bytes": "531"
},
{
"name": "Java",
"bytes": "171966"
},
{
"name": "Lua",
"bytes": "8164"
},
{
"name": "Makefile",
"bytes": "12449"
},
{
"name": "Objective-C",
"bytes": "720"
},
{
"name": "Protocol Buffer",
"bytes": "1120"
},
{
"name": "Python",
"bytes": "3057429"
},
{
"name": "Shell",
"bytes": "54611"
},
{
"name": "Thrift",
"bytes": "40763"
}
],
"symlink_target": ""
} |
<!--
Unsafe sample
input : use fopen to read /tmp/tainted.txt and put the first line in $tainted
Uses a number_int_filter via filter_var function
File : unsafe, use of untrusted data in a quoted property value (CSS)
-->
<!--Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.-->
<!DOCTYPE html>
<html>
<head>
<style>
<?php
$handle = @fopen("/tmp/tainted.txt", "r");
if ($handle) {
if(($tainted = fgets($handle, 4096)) == false) {
$tainted = "";
}
fclose($handle);
} else {
$tainted = "";
}
$sanitized = filter_var($tainted, FILTER_SANITIZE_NUMBER_INT);
if (filter_var($sanitized, FILTER_VALIDATE_INT))
$tainted = $sanitized ;
else
$tainted = "" ;
//flaw
echo "body { color :\'". $tainted ."\' ; }" ;
?>
</style>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html> | {
"content_hash": "831aec9ba9548cd0e14a76e0e3202764",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 77,
"avg_line_length": 22.75,
"alnum_prop": 0.721001221001221,
"repo_name": "stivalet/PHP-Vulnerability-test-suite",
"id": "85536eaf14d114c615eb5612258a1062d78ced69",
"size": "1638",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "XSS/CWE_79/unsafe/CWE_79__fopen__func_FILTER-CLEANING-number_int_filter__Use_untrusted_data_propertyValue_CSS-quoted_Property_Value.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "64184004"
}
],
"symlink_target": ""
} |
#include "hb-ot-shape-normalize-private.hh"
#include "hb-ot-shape-private.hh"
/*
* HIGHLEVEL DESIGN:
*
* This file exports one main function: _hb_ot_shape_normalize().
*
* This function closely reflects the Unicode Normalization Algorithm,
* yet it's different.
*
* Each shaper specifies whether it prefers decomposed (NFD) or composed (NFC).
* The logic however tries to use whatever the font can support.
*
* In general what happens is that: each grapheme is decomposed in a chain
* of 1:2 decompositions, marks reordered, and then recomposed if desired,
* so far it's like Unicode Normalization. However, the decomposition and
* recomposition only happens if the font supports the resulting characters.
*
* The goals are:
*
* - Try to render all canonically equivalent strings similarly. To really
* achieve this we have to always do the full decomposition and then
* selectively recompose from there. It's kinda too expensive though, so
* we skip some cases. For example, if composed is desired, we simply
* don't touch 1-character clusters that are supported by the font, even
* though their NFC may be different.
*
* - When a font has a precomposed character for a sequence but the 'ccmp'
* feature in the font is not adequate, use the precomposed character
* which typically has better mark positioning.
*
* - When a font does not support a combining mark, but supports it precomposed
* with previous base, use that. This needs the itemizer to have this
* knowledge too. We need to provide assistance to the itemizer.
*
* - When a font does not support a character but supports its decomposition,
* well, use the decomposition (preferring the canonical decomposition, but
* falling back to the compatibility decomposition if necessary). The
* compatibility decomposition is really nice to have, for characters like
* ellipsis, or various-sized space characters.
*
* - The complex shapers can customize the compose and decompose functions to
* offload some of their requirements to the normalizer. For example, the
* Indic shaper may want to disallow recomposing of two matras.
*
* - We try compatibility decomposition if decomposing through canonical
* decomposition alone failed to find a sequence that the font supports.
* We don't try compatibility decomposition recursively during the canonical
* decomposition phase. This has minimal impact. There are only a handful
* of Greek letter that have canonical decompositions that include characters
* with compatibility decomposition. Those can be found using this command:
*
* egrep "`echo -n ';('; grep ';<' UnicodeData.txt | cut -d';' -f1 | tr '\n' '|'; echo ') '`" UnicodeData.txt
*/
static hb_bool_t
decompose_func (hb_unicode_funcs_t *unicode,
hb_codepoint_t ab,
hb_codepoint_t *a,
hb_codepoint_t *b)
{
/* XXX FIXME, move these to complex shapers and propagage to normalizer.*/
switch (ab) {
case 0x0AC9 : return false;
case 0x0931 : return false;
case 0x0B94 : return false;
/* These ones have Unicode decompositions, but we do it
* this way to be close to what Uniscribe does. */
case 0x0DDA : *a = 0x0DD9; *b= 0x0DDA; return true;
case 0x0DDC : *a = 0x0DD9; *b= 0x0DDC; return true;
case 0x0DDD : *a = 0x0DD9; *b= 0x0DDD; return true;
case 0x0DDE : *a = 0x0DD9; *b= 0x0DDE; return true;
case 0x0F77 : *a = 0x0FB2; *b= 0x0F81; return true;
case 0x0F79 : *a = 0x0FB3; *b= 0x0F81; return true;
case 0x17BE : *a = 0x17C1; *b= 0x17BE; return true;
case 0x17BF : *a = 0x17C1; *b= 0x17BF; return true;
case 0x17C0 : *a = 0x17C1; *b= 0x17C0; return true;
case 0x17C4 : *a = 0x17C1; *b= 0x17C4; return true;
case 0x17C5 : *a = 0x17C1; *b= 0x17C5; return true;
case 0x1925 : *a = 0x1920; *b= 0x1923; return true;
case 0x1926 : *a = 0x1920; *b= 0x1924; return true;
case 0x1B3C : *a = 0x1B42; *b= 0x1B3C; return true;
case 0x1112E : *a = 0x11127; *b= 0x11131; return true;
case 0x1112F : *a = 0x11127; *b= 0x11132; return true;
#if 0
case 0x0B57 : *a = 0xno decomp, -> RIGHT; return true;
case 0x1C29 : *a = 0xno decomp, -> LEFT; return true;
case 0xA9C0 : *a = 0xno decomp, -> RIGHT; return true;
case 0x111BF : *a = 0xno decomp, -> ABOVE; return true;
#endif
}
return unicode->decompose (ab, a, b);
}
static hb_bool_t
compose_func (hb_unicode_funcs_t *unicode,
hb_codepoint_t a,
hb_codepoint_t b,
hb_codepoint_t *ab)
{
/* XXX, this belongs to indic normalizer. */
if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (unicode->general_category (a)))
return false;
/* XXX, add composition-exclusion exceptions to Indic shaper. */
if (a == 0x09AF && b == 0x09BC) { *ab = 0x09DF; return true; }
/* XXX, these belong to the hebew / default shaper. */
/* Hebrew presentation-form shaping.
* https://bugzilla.mozilla.org/show_bug.cgi?id=728866 */
// Hebrew presentation forms with dagesh, for characters 0x05D0..0x05EA;
// note that some letters do not have a dagesh presForm encoded
static const hb_codepoint_t sDageshForms[0x05EA - 0x05D0 + 1] = {
0xFB30, // ALEF
0xFB31, // BET
0xFB32, // GIMEL
0xFB33, // DALET
0xFB34, // HE
0xFB35, // VAV
0xFB36, // ZAYIN
0, // HET
0xFB38, // TET
0xFB39, // YOD
0xFB3A, // FINAL KAF
0xFB3B, // KAF
0xFB3C, // LAMED
0, // FINAL MEM
0xFB3E, // MEM
0, // FINAL NUN
0xFB40, // NUN
0xFB41, // SAMEKH
0, // AYIN
0xFB43, // FINAL PE
0xFB44, // PE
0, // FINAL TSADI
0xFB46, // TSADI
0xFB47, // QOF
0xFB48, // RESH
0xFB49, // SHIN
0xFB4A // TAV
};
hb_bool_t found = unicode->compose (a, b, ab);
if (!found && (b & ~0x7F) == 0x0580) {
// special-case Hebrew presentation forms that are excluded from
// standard normalization, but wanted for old fonts
switch (b) {
case 0x05B4: // HIRIQ
if (a == 0x05D9) { // YOD
*ab = 0xFB1D;
found = true;
}
break;
case 0x05B7: // patah
if (a == 0x05F2) { // YIDDISH YOD YOD
*ab = 0xFB1F;
found = true;
} else if (a == 0x05D0) { // ALEF
*ab = 0xFB2E;
found = true;
}
break;
case 0x05B8: // QAMATS
if (a == 0x05D0) { // ALEF
*ab = 0xFB2F;
found = true;
}
break;
case 0x05B9: // HOLAM
if (a == 0x05D5) { // VAV
*ab = 0xFB4B;
found = true;
}
break;
case 0x05BC: // DAGESH
if (a >= 0x05D0 && a <= 0x05EA) {
*ab = sDageshForms[a - 0x05D0];
found = (*ab != 0);
} else if (a == 0xFB2A) { // SHIN WITH SHIN DOT
*ab = 0xFB2C;
found = true;
} else if (a == 0xFB2B) { // SHIN WITH SIN DOT
*ab = 0xFB2D;
found = true;
}
break;
case 0x05BF: // RAFE
switch (a) {
case 0x05D1: // BET
*ab = 0xFB4C;
found = true;
break;
case 0x05DB: // KAF
*ab = 0xFB4D;
found = true;
break;
case 0x05E4: // PE
*ab = 0xFB4E;
found = true;
break;
}
break;
case 0x05C1: // SHIN DOT
if (a == 0x05E9) { // SHIN
*ab = 0xFB2A;
found = true;
} else if (a == 0xFB49) { // SHIN WITH DAGESH
*ab = 0xFB2C;
found = true;
}
break;
case 0x05C2: // SIN DOT
if (a == 0x05E9) { // SHIN
*ab = 0xFB2B;
found = true;
} else if (a == 0xFB49) { // SHIN WITH DAGESH
*ab = 0xFB2D;
found = true;
}
break;
}
}
return found;
}
static inline void
set_glyph (hb_glyph_info_t &info, hb_font_t *font)
{
font->get_glyph (info.codepoint, 0, &info.glyph_index());
}
static inline void
output_char (hb_buffer_t *buffer, hb_codepoint_t unichar, hb_codepoint_t glyph)
{
buffer->cur().glyph_index() = glyph;
buffer->output_glyph (unichar);
_hb_glyph_info_set_unicode_props (&buffer->prev(), buffer->unicode);
}
static inline void
next_char (hb_buffer_t *buffer, hb_codepoint_t glyph)
{
buffer->cur().glyph_index() = glyph;
buffer->next_glyph ();
}
static inline void
skip_char (hb_buffer_t *buffer)
{
buffer->skip_glyph ();
}
/* Returns 0 if didn't decompose, number of resulting characters otherwise. */
static inline unsigned int
decompose (hb_font_t *font, hb_buffer_t *buffer, bool shortest, hb_codepoint_t ab)
{
hb_codepoint_t a, b, a_glyph, b_glyph;
if (!decompose_func (buffer->unicode, ab, &a, &b) ||
(b && !font->get_glyph (b, 0, &b_glyph)))
return 0;
bool has_a = font->get_glyph (a, 0, &a_glyph);
if (shortest && has_a) {
/* Output a and b */
output_char (buffer, a, a_glyph);
if (likely (b)) {
output_char (buffer, b, b_glyph);
return 2;
}
return 1;
}
unsigned int ret;
if ((ret = decompose (font, buffer, shortest, a))) {
if (b) {
output_char (buffer, b, b_glyph);
return ret + 1;
}
return ret;
}
if (has_a) {
output_char (buffer, a, a_glyph);
if (likely (b)) {
output_char (buffer, b, b_glyph);
return 2;
}
return 1;
}
return 0;
}
/* Returns 0 if didn't decompose, number of resulting characters otherwise. */
static inline bool
decompose_compatibility (hb_font_t *font, hb_buffer_t *buffer, hb_codepoint_t u)
{
unsigned int len, i;
hb_codepoint_t decomposed[HB_UNICODE_MAX_DECOMPOSITION_LEN];
hb_codepoint_t glyphs[HB_UNICODE_MAX_DECOMPOSITION_LEN];
len = buffer->unicode->decompose_compatibility (u, decomposed);
if (!len)
return 0;
for (i = 0; i < len; i++)
if (!font->get_glyph (decomposed[i], 0, &glyphs[i]))
return 0;
for (i = 0; i < len; i++)
output_char (buffer, decomposed[i], glyphs[i]);
return len;
}
/* Returns true if recomposition may be benefitial. */
static inline bool
decompose_current_character (hb_font_t *font, hb_buffer_t *buffer, bool shortest)
{
hb_codepoint_t glyph;
unsigned int len = 1;
/* Kind of a cute waterfall here... */
if (shortest && font->get_glyph (buffer->cur().codepoint, 0, &glyph))
next_char (buffer, glyph);
else if ((len = decompose (font, buffer, shortest, buffer->cur().codepoint)))
skip_char (buffer);
else if (!shortest && font->get_glyph (buffer->cur().codepoint, 0, &glyph))
next_char (buffer, glyph);
else if ((len = decompose_compatibility (font, buffer, buffer->cur().codepoint)))
skip_char (buffer);
else
next_char (buffer, glyph); /* glyph is initialized in earlier branches. */
/*
* A recomposition would only be useful if we decomposed into at least three
* characters...
*/
return len > 2;
}
static inline void
handle_variation_selector_cluster (hb_font_t *font, hb_buffer_t *buffer, unsigned int end)
{
for (; buffer->idx < end - 1;) {
if (unlikely (buffer->unicode->is_variation_selector (buffer->cur(+1).codepoint))) {
/* The next two lines are some ugly lines... But work. */
font->get_glyph (buffer->cur().codepoint, buffer->cur(+1).codepoint, &buffer->cur().glyph_index());
buffer->replace_glyphs (2, 1, &buffer->cur().codepoint);
} else {
set_glyph (buffer->cur(), font);
buffer->next_glyph ();
}
}
if (likely (buffer->idx < end)) {
set_glyph (buffer->cur(), font);
buffer->next_glyph ();
}
}
/* Returns true if recomposition may be benefitial. */
static inline bool
decompose_multi_char_cluster (hb_font_t *font, hb_buffer_t *buffer, unsigned int end)
{
/* TODO Currently if there's a variation-selector we give-up, it's just too hard. */
for (unsigned int i = buffer->idx; i < end; i++)
if (unlikely (buffer->unicode->is_variation_selector (buffer->info[i].codepoint))) {
handle_variation_selector_cluster (font, buffer, end);
return false;
}
while (buffer->idx < end)
decompose_current_character (font, buffer, false);
/* We can be smarter here and only return true if there are at least two ccc!=0 marks.
* But does not matter. */
return true;
}
static inline bool
decompose_cluster (hb_font_t *font, hb_buffer_t *buffer, bool short_circuit, unsigned int end)
{
if (likely (buffer->idx + 1 == end))
return decompose_current_character (font, buffer, short_circuit);
else
return decompose_multi_char_cluster (font, buffer, end);
}
static int
compare_combining_class (const hb_glyph_info_t *pa, const hb_glyph_info_t *pb)
{
unsigned int a = _hb_glyph_info_get_modified_combining_class (pa);
unsigned int b = _hb_glyph_info_get_modified_combining_class (pb);
return a < b ? -1 : a == b ? 0 : +1;
}
void
_hb_ot_shape_normalize (hb_font_t *font, hb_buffer_t *buffer,
hb_ot_shape_normalization_mode_t mode)
{
bool short_circuit = mode != HB_OT_SHAPE_NORMALIZATION_MODE_DECOMPOSED &&
mode != HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT;
bool can_use_recompose = false;
unsigned int count;
/* We do a fairly straightforward yet custom normalization process in three
* separate rounds: decompose, reorder, recompose (if desired). Currently
* this makes two buffer swaps. We can make it faster by moving the last
* two rounds into the inner loop for the first round, but it's more readable
* this way. */
/* First round, decompose */
buffer->clear_output ();
count = buffer->len;
for (buffer->idx = 0; buffer->idx < count;)
{
unsigned int end;
for (end = buffer->idx + 1; end < count; end++)
if (buffer->cur().cluster != buffer->info[end].cluster)
break;
can_use_recompose = decompose_cluster (font, buffer, short_circuit, end) || can_use_recompose;
}
buffer->swap_buffers ();
if (mode != HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_FULL && !can_use_recompose)
return; /* Done! */
/* Second round, reorder (inplace) */
count = buffer->len;
for (unsigned int i = 0; i < count; i++)
{
if (_hb_glyph_info_get_modified_combining_class (&buffer->info[i]) == 0)
continue;
unsigned int end;
for (end = i + 1; end < count; end++)
if (_hb_glyph_info_get_modified_combining_class (&buffer->info[end]) == 0)
break;
/* We are going to do a bubble-sort. Only do this if the
* sequence is short. Doing it on long sequences can result
* in an O(n^2) DoS. */
if (end - i > 10) {
i = end;
continue;
}
hb_bubble_sort (buffer->info + i, end - i, compare_combining_class);
i = end;
}
if (mode == HB_OT_SHAPE_NORMALIZATION_MODE_DECOMPOSED)
return;
/* Third round, recompose */
/* As noted in the comment earlier, we don't try to combine
* ccc=0 chars with their previous Starter. */
buffer->clear_output ();
count = buffer->len;
unsigned int starter = 0;
buffer->next_glyph ();
while (buffer->idx < count)
{
hb_codepoint_t composed, glyph;
if (/* If mode is NOT COMPOSED_FULL (ie. it's COMPOSED_DIACRITICS), we don't try to
* compose a CCC=0 character with it's preceding starter. */
(mode == HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_FULL ||
_hb_glyph_info_get_modified_combining_class (&buffer->cur()) != 0) &&
/* If there's anything between the starter and this char, they should have CCC
* smaller than this character's. */
(starter == buffer->out_len - 1 ||
_hb_glyph_info_get_modified_combining_class (&buffer->prev()) < _hb_glyph_info_get_modified_combining_class (&buffer->cur())) &&
/* And compose. */
compose_func (buffer->unicode,
buffer->out_info[starter].codepoint,
buffer->cur().codepoint,
&composed) &&
/* And the font has glyph for the composite. */
font->get_glyph (composed, 0, &glyph))
{
/* Composes. */
buffer->next_glyph (); /* Copy to out-buffer. */
if (unlikely (buffer->in_error))
return;
buffer->merge_out_clusters (starter, buffer->out_len);
buffer->out_len--; /* Remove the second composable. */
buffer->out_info[starter].codepoint = composed; /* Modify starter and carry on. */
set_glyph (buffer->out_info[starter], font);
_hb_glyph_info_set_unicode_props (&buffer->out_info[starter], buffer->unicode);
continue;
}
/* Blocked, or doesn't compose. */
buffer->next_glyph ();
if (_hb_glyph_info_get_modified_combining_class (&buffer->prev()) == 0)
starter = buffer->out_len - 1;
}
buffer->swap_buffers ();
}
| {
"content_hash": "35c799b5962c63f1b488ca8193d06e4a",
"timestamp": "",
"source": "github",
"line_count": 524,
"max_line_length": 130,
"avg_line_length": 31.326335877862597,
"alnum_prop": 0.6291806274748706,
"repo_name": "leighpauls/k2cro4",
"id": "18a3f3f441cf87248adbc23c6a647650899bdf92",
"size": "17527",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "third_party/harfbuzz-ng/src/hb-ot-shape-normalize.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "3062"
},
{
"name": "AppleScript",
"bytes": "25392"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "68131038"
},
{
"name": "C",
"bytes": "242794338"
},
{
"name": "C#",
"bytes": "11024"
},
{
"name": "C++",
"bytes": "353525184"
},
{
"name": "Common Lisp",
"bytes": "3721"
},
{
"name": "D",
"bytes": "1931"
},
{
"name": "Emacs Lisp",
"bytes": "1639"
},
{
"name": "F#",
"bytes": "4992"
},
{
"name": "FORTRAN",
"bytes": "10404"
},
{
"name": "Java",
"bytes": "3845159"
},
{
"name": "JavaScript",
"bytes": "39146656"
},
{
"name": "Lua",
"bytes": "13768"
},
{
"name": "Matlab",
"bytes": "22373"
},
{
"name": "Objective-C",
"bytes": "21887598"
},
{
"name": "PHP",
"bytes": "2344144"
},
{
"name": "Perl",
"bytes": "49033099"
},
{
"name": "Prolog",
"bytes": "2926122"
},
{
"name": "Python",
"bytes": "39863959"
},
{
"name": "R",
"bytes": "262"
},
{
"name": "Racket",
"bytes": "359"
},
{
"name": "Ruby",
"bytes": "304063"
},
{
"name": "Scheme",
"bytes": "14853"
},
{
"name": "Shell",
"bytes": "9195117"
},
{
"name": "Tcl",
"bytes": "1919771"
},
{
"name": "Verilog",
"bytes": "3092"
},
{
"name": "Visual Basic",
"bytes": "1430"
},
{
"name": "eC",
"bytes": "5079"
}
],
"symlink_target": ""
} |
from django.contrib import admin
from blog.models import Post
class PostAdmin(admin.ModelAdmin):
# fields display on change list
list_display = ['title', 'description']
# fields to filter the change list with
list_filter = ['published', 'created']
# fields to search in change list
search_fields = ['title', 'description', 'content']
# enable the date drill down on change list
date_hierarchy = 'created'
# enable the save buttons on top on change form
save_on_top = True
# prepopulate the slug from the title - big timesaver!
prepopulated_fields = {"slug": ("title",)}
admin.site.register(Post, PostAdmin)
| {
"content_hash": "1d19724f958a0a1dc47d40a84d4cd11d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 62,
"avg_line_length": 37.526315789473685,
"alnum_prop": 0.6367461430575035,
"repo_name": "DanielleWingler/UnderstandingDjango",
"id": "f642fc4b80489d2eb0b15ef84e85d48ce11000b8",
"size": "774",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "TestSite/blog/admin.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "5746"
}
],
"symlink_target": ""
} |
<!doctype html>
<!-- This file is generated by build.py. -->
<title>Reference for video tall.jpg; overflow:hidden; -o-object-fit:contain; -o-object-position:center 100%</title>
<link rel="stylesheet" href="../../support/reftests.css">
<style>
.helper { overflow:hidden }
.helper > * { left:33.3333333333px; bottom:0; height:200px }
</style>
<div id="ref">
<span class="helper"><img src="../../support/tall.jpg"></span>
</div>
| {
"content_hash": "c670b823aa2333d6c6f9a1baa2db3ea7",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 115,
"avg_line_length": 39,
"alnum_prop": 0.6736596736596736,
"repo_name": "Ms2ger/presto-testo",
"id": "98a0af140c118cabd4495c8c97c5bada44d15482",
"size": "429",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "css/image-fit/reftests/video-poster-jpg-tall/hidden_contain_center_100-ref.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "2312"
},
{
"name": "ActionScript",
"bytes": "23470"
},
{
"name": "AutoHotkey",
"bytes": "8832"
},
{
"name": "Batchfile",
"bytes": "5001"
},
{
"name": "C",
"bytes": "116512"
},
{
"name": "C++",
"bytes": "219233"
},
{
"name": "CSS",
"bytes": "207914"
},
{
"name": "Erlang",
"bytes": "18523"
},
{
"name": "Groff",
"bytes": "674"
},
{
"name": "HTML",
"bytes": "103272540"
},
{
"name": "Haxe",
"bytes": "3874"
},
{
"name": "Java",
"bytes": "125658"
},
{
"name": "JavaScript",
"bytes": "22516936"
},
{
"name": "Makefile",
"bytes": "13409"
},
{
"name": "PHP",
"bytes": "524911"
},
{
"name": "Perl",
"bytes": "321672"
},
{
"name": "Python",
"bytes": "948191"
},
{
"name": "Ruby",
"bytes": "1006850"
},
{
"name": "Shell",
"bytes": "12140"
},
{
"name": "Smarty",
"bytes": "1860"
},
{
"name": "XSLT",
"bytes": "2567445"
}
],
"symlink_target": ""
} |
namespace g{namespace Android{namespace android{namespace view{struct Choreographer;}}}}
namespace g{namespace Fuse{struct App;}}
namespace g{namespace Fuse{struct App__FrameCallback;}}
namespace g{
namespace Fuse{
// private sealed class App.FrameCallback :73
// {
struct App__FrameCallback_type : ::g::Android::java::lang::Object_type
{
::g::Android::android::view::ChoreographerDLRFrameCallback interface2;
};
App__FrameCallback_type* App__FrameCallback_typeof();
void App__FrameCallback__ctor_4_fn(App__FrameCallback* __this, ::g::Fuse::App* app);
void App__FrameCallback__doFrame_fn(App__FrameCallback* __this, int64_t* frameTimeNanos);
void App__FrameCallback__New5_fn(::g::Fuse::App* app, App__FrameCallback** __retval);
struct App__FrameCallback : ::g::Android::java::lang::Object
{
uStrong< ::g::Fuse::App*> _app;
uStrong< ::g::Android::android::view::Choreographer*> _choreographer;
static jclass _javaClass2_;
static jclass& _javaClass2() { return _javaClass2_; }
int64_t _prevTimeNanos;
void ctor_4(::g::Fuse::App* app);
void doFrame(int64_t frameTimeNanos);
static App__FrameCallback* New5(::g::Fuse::App* app);
};
// }
}} // ::g::Fuse
| {
"content_hash": "43ce5597b1ceca3f409244a5aab27211",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 89,
"avg_line_length": 35.029411764705884,
"alnum_prop": 0.7002518891687658,
"repo_name": "blyk/BlackCode-Fuse",
"id": "10f79aa694148ca6acf576bff204a99fb3a36405",
"size": "1557",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "AddfromApp/.build/Simulator/Android/include/Fuse.App.FrameCallback.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "31111"
},
{
"name": "C",
"bytes": "22885804"
},
{
"name": "C++",
"bytes": "197750292"
},
{
"name": "Java",
"bytes": "951083"
},
{
"name": "JavaScript",
"bytes": "578555"
},
{
"name": "Logos",
"bytes": "48297"
},
{
"name": "Makefile",
"bytes": "6592573"
},
{
"name": "Shell",
"bytes": "19985"
}
],
"symlink_target": ""
} |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='PXLBoardModel_1',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('mlb', models.BooleanField()),
('nfl', models.BooleanField()),
('nhl', models.BooleanField()),
('headlines', models.BooleanField()),
('weather', models.BooleanField()),
],
),
migrations.CreateModel(
name='PXLBoardModel_2',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('mlb', models.BooleanField()),
('nfl', models.BooleanField()),
('nhl', models.BooleanField()),
('headlines', models.BooleanField()),
('weather', models.BooleanField()),
],
),
migrations.CreateModel(
name='PXLBoardModel_3',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('mlb', models.BooleanField()),
('nfl', models.BooleanField()),
('nhl', models.BooleanField()),
('headlines', models.BooleanField()),
('weather', models.BooleanField()),
],
),
migrations.CreateModel(
name='UserModel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('pxlboard_1', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='pxl.PXLBoardModel_1')),
('pxlboard_2', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='pxl.PXLBoardModel_2')),
('pxlboard_3', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='pxl.PXLBoardModel_3')),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
],
),
]
| {
"content_hash": "725d82b5d0bd5c1324e29580ac08c2be",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 145,
"avg_line_length": 41.916666666666664,
"alnum_prop": 0.557455268389662,
"repo_name": "PXL-CF2016/pxl-master-server",
"id": "3d4d1b0d1b4a54de2bb1f6bcd1d79693f6d64e79",
"size": "2587",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pxl/migrations/0001_initial.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "193997"
},
{
"name": "Python",
"bytes": "111924"
}
],
"symlink_target": ""
} |
import React from 'react';
import CreateGameForm from './CreateGameForm';
import io from '../io';
const Index = React.createClass({
propTypes: {
io: React.PropTypes.object.isRequired
},
getInitialState() {
return {
link: '',
hasExpired: false,
time: '30',
inc: '0'
};
},
componentDidMount() {
const io = this.props.io;
io.on('created', data => {
const {time, inc} = this.state;
const loc = window.location;
const origin = loc.origin || `${loc.protocol}//${loc.hostname}` +
(loc.port ? ':' + loc.port : '');
this.setState({
link: `${origin}/play/${data.token}/${time}/${inc}`,
hasExpired: false
});
});
io.on('ready', () => {
window.location = this.state.link;
});
io.on('token-expired', () => this.setState({hasExpired: true}));
},
render() {
return (
<div>
<img src="/img/knight.png"
width="122"
height="122"
className="knight" />
<h1>Reti Chess</h1>
<div id="create-game">
<CreateGameForm
link={this.state.link}
time={this.state.time}
inc={this.state.inc}
onChangeForm={this._onChangeForm}
createGame={this._createGame} />
<p id="game-status">
{this.state.hasExpired ?
'Game link has expired, generate a new one'
:this.state.link ?
'Waiting for opponent to connect'
:null}
</p>
</div>
<p>
Click the button to create a game. Send the link to your friend.
Once the link is opened your friend‘s browser, game should begin
shortly. Colors are picked randomly by computer.
</p>
<p>
<a href="/about" className="alpha">Read more about Reti Chess</a>
</p>
</div>
);
},
_onChangeForm(e) {
this.setState({[e.target.name]: e.target.value});
},
_createGame(e) {
e.preventDefault();
const {time, inc} = this.state;
const isInvalid = [time, inc].some(val => {
val = parseInt(val, 10);
return isNaN(val) || val < 0 || val > 50;
});
if (isInvalid) {
// fallback for old browsers
return window.alert('Form is invalid. Enter numbers between 0 and 50.');
} else {
this.props.io.emit('start');
}
}
});
export default Index;
| {
"content_hash": "76b9889a64270782c9df9639045f33b9",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 78,
"avg_line_length": 24.59,
"alnum_prop": 0.5213501423342822,
"repo_name": "romanmatiasko/reti-chess",
"id": "cba5ef6c5be293279fe1ac6c7bb5890998afd663",
"size": "2461",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/js/components/Index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15537"
},
{
"name": "HTML",
"bytes": "2894"
},
{
"name": "JavaScript",
"bytes": "64368"
}
],
"symlink_target": ""
} |
.. _plugin-chat:
****
Chat
****
Description
===========
.. automodule:: spockbot.plugins.helpers.chat
Events
======
.. object:: chat
Chat event was recieved
**Playload** ::
{'position': position, 'raw': json_data, 'text': text, 'type': chat_type, 'message': msg, 'name': name, 'uuid': uuid}
.. object:: position
*int*
Where the text should be displayed
.. object:: raw
*dict*
Raw json data from the chat message
.. object:: text
*string*
The text of the chat message
.. object:: type
*string*
The type of message (achievement, admin, announcement, emote, incoming, outgoing, text)
.. object:: message
*string*
message
.. object:: uuid
*string*
UUID of the player who sent the message
Methods and Attributes
======================
.. autoclass:: ChatCore
:members:
:undoc-members:
| {
"content_hash": "ca9f1911895e7d0883cd16c226380655",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 125,
"avg_line_length": 14.890625,
"alnum_prop": 0.5456453305351522,
"repo_name": "Gjum/SpockBot",
"id": "940f2671af592de499f3812cb7ddd9c5691973c8",
"size": "953",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "docs/plugins/helpers/chat.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "290360"
}
],
"symlink_target": ""
} |
<?php namespace ClosedReach\Services;
use ClosedReach\User;
use Validator;
use Illuminate\Contracts\Auth\Registrar as RegistrarContract;
class Registrar implements RegistrarContract {
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
public function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|confirmed|min:6',
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
public function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
}
| {
"content_hash": "3976d9bf690d138b6ab1dd6eddb29a0a",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 61,
"avg_line_length": 21.794871794871796,
"alnum_prop": 0.6611764705882353,
"repo_name": "alexhinds/ClosedReach",
"id": "9a720534d405fe3d644ef2c87fdc380fcaad1bb3",
"size": "850",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "app/Services/Registrar.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "356"
},
{
"name": "CSS",
"bytes": "131332"
},
{
"name": "JavaScript",
"bytes": "980"
},
{
"name": "PHP",
"bytes": "82975"
}
],
"symlink_target": ""
} |
for file in "$@"
do
chflags hidden "$file"
done
| {
"content_hash": "f4dd6c43f327ec679d3b2104e5baf7dd",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 26,
"avg_line_length": 13,
"alnum_prop": 0.6153846153846154,
"repo_name": "cypher/dotfiles",
"id": "68cba92e3e800bdbf6cbc98b0d3f511ee10be307",
"size": "108",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "LaunchBar/Actions/Hide File or Folder.lbaction/Contents/Scripts/default.sh",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "AppleScript",
"bytes": "1415"
},
{
"name": "HTML",
"bytes": "85"
},
{
"name": "JavaScript",
"bytes": "1050"
},
{
"name": "Perl",
"bytes": "14781"
},
{
"name": "Python",
"bytes": "6300"
},
{
"name": "Ruby",
"bytes": "63386"
},
{
"name": "Shell",
"bytes": "65318"
},
{
"name": "Vim script",
"bytes": "251288"
}
],
"symlink_target": ""
} |
Using Spring from within a Play 2.x application
===============================================
This is a simple application demonstrating how to integrate a Play 2.x application components with <a href="http://www.springsource.org/">Spring framework</a>.
> Note that the same technique can be applied to any other dependency injection framework.
## How does it work?
There is a few places where the Spring _binding_ is done.
### First, add the spring dependency
In the `project/Build.scala` file, add a dependency to `spring-context`:
```scala
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "play-spring"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
"org.springframework" % "spring-context" % "3.0.7.RELEASE"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
)
}
```
### Using controllers instances
We wiil use _dynamic_ controller dispatching instead of the _statically compiled_ dispatching used by default in Play framework. To do that, just prefix your controller class name with the `@` symbol in the `routes` file:
```
GET / @controllers.Application.index()
```
### Managing controllers instances
The controllers instances management will be delegated to the `Global` object of your application. Here is an implementation of the `Global` using Spring framework:
```java
import play.*;
import org.springframework.context.*;
import org.springframework.context.support.*;
public class Global extends GlobalSettings {
private ApplicationContext ctx;
@Override
public void onStart(Application app) {
ctx = new ClassPathXmlApplicationContext("components.xml");
}
@Override
public <A> A getControllerInstance(Class<A> clazz) {
return ctx.getBean(clazz);
}
}
```
And here is the associated `conf/components.xml` file we are using to configure Spring:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="controllers,services,dao"/>
</beans>
```
### Creating Spring components
In this example we are using the annotation driven binding for Spring (so we use the annotations provided in `org.springframework.stereotype` to mark our components as _Spring managed_).
First a simple _"Spring style"_ service:
```java
package services;
@org.springframework.stereotype.Service
public class HelloService {
public String hello() {
return "Hello world!";
}
}
```
And now the controller with the service _autowired_:
```java
package controllers;
import play.*;
import play.mvc.*;
import views.html.*;
import services.*;
import org.springframework.beans.factory.annotation.*;
@org.springframework.stereotype.Controller
public class Application extends Controller {
@Autowired
private HelloService helloService;
public Result index() {
return ok(index.render(helloService.hello()));
}
}
```
## To go further
You can then integrate any Spring componenents to your application. The auto-reload feature will just work magically. If you plan to use a database or an ORM, you could want to manage it directly via Spring instead of using the default Play plugins. | {
"content_hash": "71fbbd44917a566837b0f38f8aa26b39",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 249,
"avg_line_length": 27.226277372262775,
"alnum_prop": 0.7257372654155496,
"repo_name": "fmaturel/PlayTraining",
"id": "e1eaf43279f286e387662eff3b713ad07f8c4375",
"size": "3730",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "play_spring/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "40785"
},
{
"name": "CSS",
"bytes": "129162"
},
{
"name": "HTML",
"bytes": "260623"
},
{
"name": "Java",
"bytes": "368837"
},
{
"name": "JavaScript",
"bytes": "57571"
},
{
"name": "Scala",
"bytes": "15675"
},
{
"name": "Shell",
"bytes": "5621"
}
],
"symlink_target": ""
} |
HTTP Prompt
===========
|PyPI| |Docs| |Build| |Coverage| |Discord|
HTTP Prompt is an interactive command-line HTTP client featuring autocomplete
and syntax highlighting, built on HTTPie_ and prompt_toolkit_.
|Asciinema|
Links
-----
* Home: https://http-prompt.com
* Documentation: https://docs.http-prompt.com
* Code: https://github.com/httpie/http-prompt
* Chat: https://httpie.io/chat
.. |PyPI| image:: https://img.shields.io/pypi/v/http-prompt.svg
:target: https://pypi.python.org/pypi/http-prompt
.. |Docs| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat
:target: http://docs.http-prompt.com/en/latest/?badge=latest
.. |Build| image:: https://github.com/httpie/http-prompt/workflows/Build/badge.svg
:target: https://github.com/httpie/http-prompt/actions
.. |Coverage| image:: https://coveralls.io/repos/github/eliangcs/http-prompt/badge.svg?branch=master
:target: https://coveralls.io/github/eliangcs/http-prompt?branch=master
.. |Discord| image:: https://img.shields.io/badge/chat-on%20Discord-brightgreen?style=flat-square
:target: https://httpie.io/chat
.. |Asciinema| image:: https://asciinema.org/a/96613.png
:target: https://asciinema.org/a/96613?theme=monokai&size=medium&autoplay=1&speed=1.5
.. _HTTPie: https://httpie.io
.. _prompt_toolkit: https://github.com/jonathanslenders/python-prompt-toolkit
| {
"content_hash": "d6950f83ffd8563fdeafd737ec4c497d",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 100,
"avg_line_length": 34.45,
"alnum_prop": 0.7256894049346879,
"repo_name": "eliangcs/http-prompt",
"id": "452c02591a79fd5349ce69ac2dcc40e62b2244e7",
"size": "1378",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "192796"
}
],
"symlink_target": ""
} |
#include <stdio.h>
using namespace System;
template class LinkedList<int>;
void testLinkedList(fallocHeap* heap)
{
fallocInit(heap);
fallocContext* ctx = fallocCreateCtx(heap);
//
LinkedList<int> list; list.xtor(ctx);
list.AddLast(5);
list.AddLast(3);
list.AddLast(1);
list.AddLast(2);
list.AddLast(7);
list.AddLast(10);
//
LinkedList<int>::Enumerator e; list.GetEnumerator(e);
while (e.MoveNext(&list))
printf("%d\n", e.Current);
e.Dispose();
//
fallocDisposeCtx(ctx);
}
int main()
{
cpuFallocHost fallocHost = cpuFallocInit(2048);
// test
testLinkedList(fallocHost.heap);
// free and exit
cpuFallocEnd(fallocHost);
printf("\ndone.\n"); char c; scanf_s("%c", &c);
return 0;
}
| {
"content_hash": "e1a74e6682278d507d3973b3b1622b1a",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 54,
"avg_line_length": 18,
"alnum_prop": 0.6455026455026455,
"repo_name": "Grimace1975/gpustructs",
"id": "69f7a2a52a0c6c8f1f2e7e7a01b8d627eed94bef",
"size": "823",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Core.cpu/TestLinkedList.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "66389"
},
{
"name": "C#",
"bytes": "690966"
},
{
"name": "C++",
"bytes": "261706"
},
{
"name": "Cuda",
"bytes": "131872"
},
{
"name": "Objective-C",
"bytes": "6785"
},
{
"name": "PowerShell",
"bytes": "39183"
},
{
"name": "XSLT",
"bytes": "9157"
}
],
"symlink_target": ""
} |
package scrimp;
import battlecode.common.RobotController;
import scrimp.arrays.IntArray;
import scrimp.arrays.IterableArray;
import scrimp.bytecode.ByteCodeTest;
import scrimp.bytecode.ControlFlow.Functions;
import scrimp.bytecode.ControlFlow.IfElseVsSwitch;
import scrimp.bytecode.ControlFlow.Loops;
import scrimp.bytecode.DataTypes.Numerics;
import scrimp.bytecode.DataTypes.NumericsComparisons;
import java.util.ArrayList;
public class RobotPlayer {
public static void run(RobotController rc) {
boolean test = false;
//ByteCodeTest testing = new NumericsComparisons();
//testing.run();
String a = "asdf";
String b = "asdf";
String c;
Timer.StartTimer();
c = a + b;
Timer.EndTimer();
Timer.StartTimer();
c = a.concat(b).concat(a);
Timer.EndTimer();
int[] array1 = new int[]{1, 2, 3, 4};
int[] array2 = new int[]{ 1, 2, 3, 4};
int[] array1and2 = new int[array1.length + array2.length];
Timer.StartTimer();
System.arraycopy(array1, 0, array1and2, 0, array1.length);
System.arraycopy(array2, 0, array1and2, array1.length, array2.length);
Timer.EndTimer();
System.out.println(array1and2.toString());
/*
long l = 3L;
Timer.StartTimer();
System.out.println(Long.bitCount(l));
Timer.EndTimer();
/*
/*
System.out.println("Making an int");
Timer.StartTimer();
int testA = 1;
Timer.EndTimer();
System.out.println("Making an Integer with Integer");
Timer.StartTimer();
Integer testB = new Integer(1);
Timer.EndTimer();
System.out.println("Making an Integer with int");
Timer.StartTimer();
Integer testC = 1;
Timer.EndTimer();
System.out.println("Making an Object int ");
Timer.StartTimer();
Object testE = 1;
Timer.EndTimer();
System.out.println("Making an Object Integer ");
Timer.StartTimer();
Object testF = new Integer(0);
Timer.EndTimer();
*/
/*
int num = 50;
System.out.println("Good Way Array");
Timer.StartTimer();
int[] intA = new int[num];
for (int i = 0; i < num; i++) {
intA[i] = i;
}
for (int i = 0; i < num; i++) {
System.out.println(intA[i]);
}
Timer.EndTimer();
System.out.println("Iterable Array");
Timer.StartTimer();
IterableArray a = new IterableArray();
for (int i = 0; i < num; i++) {
a.add(i);
}
for (Object i: a) {
System.out.println(i);
}
Timer.EndTimer();
System.out.println("ArrayList");
Timer.StartTimer();
ArrayList<Integer> b = new ArrayList<Integer>();
for (int i = 0; i < num; i++) {
b.add(i);
}
for (int i: b) {
System.out.println(i);
}
Timer.EndTimer();
*/
if (test) {
System.out.println("Running unit tests for IntArray");
Timer.StartTimer();
IntArray testIntArray = new IntArray();
for (int i = 20; --i >= 0;) {
testIntArray.add(i);
}
for (int i = 0; i < 20; i++) {
assert testIntArray.arr[i] == i;
}
Timer.StartTimer();
}
}
}
| {
"content_hash": "5174bf21624f4a1648d1b128b6c5b987",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 78,
"avg_line_length": 26.104477611940297,
"alnum_prop": 0.5348770726129217,
"repo_name": "bovard/scrimp",
"id": "a779cb062175a90478c3fad9693d3f5f49059433",
"size": "3498",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RobotPlayer.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "27690"
}
],
"symlink_target": ""
} |
import os
import unittest
from mock import Mock, create_autospec, patch
from apache.aurora.executor.bin.thermos_executor_main import dump_runner_pex, initialize, proxy_main
from apache.aurora.executor.common.path_detector import MesosPathDetector
from apache.aurora.executor.thermos_task_runner import DefaultThermosTaskRunnerProvider
def test_thermos_executor_valid_import_dependencies():
assert proxy_main is not None
class ThermosExecutorMainTest(unittest.TestCase):
def test_checkpoint_path(self):
mock_runner_provider = create_autospec(spec=DefaultThermosTaskRunnerProvider)
mock_dump_runner_pex = create_autospec(spec=dump_runner_pex)
mock_dump_runner_pex.return_value = Mock()
mock_options = Mock()
mock_options.execute_as_user = False
mock_options.nosetuid = False
mock_options.announcer_ensemble = None
mock_options.stop_timeout_in_secs = 1
with patch(
'apache.aurora.executor.bin.thermos_executor_main.dump_runner_pex',
return_value=mock_dump_runner_pex):
with patch(
'apache.aurora.executor.bin.thermos_executor_main.DefaultThermosTaskRunnerProvider',
return_value=mock_runner_provider) as mock_provider:
expected_path = os.path.join(os.path.abspath('.'), MesosPathDetector.DEFAULT_SANDBOX_PATH)
thermos_executor = initialize(mock_options)
assert thermos_executor is not None
assert len(mock_provider.mock_calls) == 1
args = mock_provider.mock_calls[0][1]
assert len(args) == 2 and expected_path == args[1]
| {
"content_hash": "dfa1dc725f65703f1501106f81a10e2d",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 100,
"avg_line_length": 40.94736842105263,
"alnum_prop": 0.7377892030848329,
"repo_name": "thinker0/aurora",
"id": "5ad2999d2fbb05bb44fc4801df605b95f8351538",
"size": "2104",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "src/test/python/apache/aurora/executor/bin/test_thermos_executor_entry_point.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "24231"
},
{
"name": "Groovy",
"bytes": "7847"
},
{
"name": "HTML",
"bytes": "13576"
},
{
"name": "Java",
"bytes": "3551071"
},
{
"name": "JavaScript",
"bytes": "215643"
},
{
"name": "Python",
"bytes": "1620477"
},
{
"name": "Ruby",
"bytes": "4315"
},
{
"name": "Shell",
"bytes": "91969"
},
{
"name": "Smalltalk",
"bytes": "79"
},
{
"name": "Smarty",
"bytes": "25233"
},
{
"name": "Thrift",
"bytes": "58310"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.xuweiwei.myulib.software.SoftwareActivity">
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/lv_software" />
</RelativeLayout>
| {
"content_hash": "9edc5489cdae972abc06f3f5b1140fd6",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 74,
"avg_line_length": 45.125,
"alnum_prop": 0.7299168975069252,
"repo_name": "firstbytegithub/MyULib",
"id": "c793fd5f7ecf89f9f49d61f9ad4e0582f6f6c1ac",
"size": "722",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/activity_software.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "284161"
}
],
"symlink_target": ""
} |
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Namespace
|--------------------------------------------------------------------------
|
| The current app namespace. This is used to automatically find commands
| and events based on route query.
|
*/
'app_namespace' => 'App',
/*
|--------------------------------------------------------------------------
| Models Namespace
|--------------------------------------------------------------------------
|
| The Eloquent models namespace. This has to be the namespace from the
| root of the project.
| If not specified, then `app_namespace` will be used instead.
|
*/
'models_namespace' => 'App',
/*
|--------------------------------------------------------------------------
| API Mapping
|--------------------------------------------------------------------------
|
| Here we map routes to models. Model must exist under App\Models
| namespace.
|
*/
'mapping' => [
'users' => 'User'
],
/*
|--------------------------------------------------------------------------
| API Prefix
|--------------------------------------------------------------------------
|
| The prefix used by the API. If not present, it will default to `api`.
|
*/
'prefix' => 'api/v1',
/*
|--------------------------------------------------------------------------
| API Middleware
|--------------------------------------------------------------------------
|
| If your API routes need to use a middleware or filter, specify them here.
| However it will apply for all of them.
|
*/
'middleware' => [],
];
| {
"content_hash": "db52be7a94ba1ee337750fa18f5acd53",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 79,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.30432372505543237,
"repo_name": "ZzAntares/laravel-rest",
"id": "bd0b54acf620ea1c5029862d6a6949ee42db427c",
"size": "1804",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/config/api.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "28641"
}
],
"symlink_target": ""
} |
package io.mstream.trader.datafeed.handlers.api.stocks.names;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.mstream.trader.datafeed.stocks.Stock;
import org.junit.Test;
import ratpack.http.client.ReceivedResponse;
import ratpack.test.embed.EmbeddedApp;
import java.util.List;
import static java.lang.String.format;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
public class GetNamesHandlerTest {
private static final TypeReference<List<Stock>> STOCKS_LIST_TYPE =
new TypeReference<List<Stock>>() {
};
private final GetNamesHandler instance;
private final ObjectMapper mapper;
public GetNamesHandlerTest() {
instance = new GetNamesHandler(Stock::new);
mapper = new ObjectMapper();
}
@Test
public void shouldReturnExpectedStockNames() throws Exception {
EmbeddedApp.of(server ->
server.handlers(chain ->
chain.get("", instance)
)
).test(client -> {
ReceivedResponse response = client.get();
assertThat(response.getStatusCode(), is(equalTo(200)));
List<Stock> responseBody = null;
try {
responseBody = mapper.readValue(
response.getBody().getBytes(),
STOCKS_LIST_TYPE
);
} catch (Exception e) {
fail(
format(
"could not parse the response body: '%s'",
response.getBody().getText()
)
);
}
assertThat(
responseBody,
containsInAnyOrder(new Stock("GOOG"), new Stock("MSFT"))
);
});
}
}
| {
"content_hash": "b6ba0d2895b16544be0b26babdd390ab",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 76,
"avg_line_length": 31.852459016393443,
"alnum_prop": 0.5687081832218219,
"repo_name": "mstream-trader/data-feed",
"id": "6eeb20588d319d47dd7dd5e44788cc4a25651730",
"size": "1943",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "integration-tests/src/test/java/io/mstream/trader/datafeed/handlers/api/stocks/names/GetNamesHandlerTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Cucumber",
"bytes": "3088"
},
{
"name": "FreeMarker",
"bytes": "1088"
},
{
"name": "Java",
"bytes": "104632"
},
{
"name": "Scala",
"bytes": "2732"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Dicom.Network {
public class DicomCFindRequest : DicomRequest {
public DicomCFindRequest(DicomDataset command) : base(command) {
}
public DicomCFindRequest(DicomQueryRetrieveLevel level, DicomPriority priority = DicomPriority.Medium) : base(DicomCommandField.CFindRequest, DicomUID.StudyRootQueryRetrieveInformationModelFIND, priority) {
Dataset = new DicomDataset();
Level = level;
}
public DicomQueryRetrieveLevel Level {
get { return Dataset.Get<DicomQueryRetrieveLevel>(DicomTag.QueryRetrieveLevel); }
set {
Dataset.Remove(DicomTag.QueryRetrieveLevel);
if (value != DicomQueryRetrieveLevel.Worklist)
Dataset.Add(DicomTag.QueryRetrieveLevel, value.ToString().ToUpper());
}
}
public delegate void ResponseDelegate(DicomCFindRequest request, DicomCFindResponse response);
public ResponseDelegate OnResponseReceived;
internal override void PostResponse(DicomService service, DicomResponse response) {
try {
if (OnResponseReceived != null)
OnResponseReceived(this, (DicomCFindResponse)response);
} catch {
}
}
public static DicomCFindRequest CreatePatientQuery(string patientId = null, string patientName = null) {
var dimse = new DicomCFindRequest(DicomQueryRetrieveLevel.Patient);
dimse.SOPClassUID = DicomUID.PatientRootQueryRetrieveInformationModelFIND;
dimse.Dataset.Add(DicomTag.PatientID, patientId);
dimse.Dataset.Add(DicomTag.PatientName, patientName);
dimse.Dataset.Add(DicomTag.OtherPatientIDs, String.Empty);
dimse.Dataset.Add(DicomTag.IssuerOfPatientID, String.Empty);
dimse.Dataset.Add(DicomTag.PatientSex, String.Empty);
dimse.Dataset.Add(DicomTag.PatientBirthDate, String.Empty);
return dimse;
}
public static DicomCFindRequest CreateStudyQuery(string patientId = null, string patientName = null,
DicomDateRange studyDateTime = null, string accession = null, string studyId = null,
string modalitiesInStudy = null, string studyInstanceUid = null)
{
var dimse = new DicomCFindRequest(DicomQueryRetrieveLevel.Study);
dimse.SOPClassUID = DicomUID.StudyRootQueryRetrieveInformationModelFIND;
dimse.Dataset.Add(DicomTag.PatientID, patientId);
dimse.Dataset.Add(DicomTag.PatientName, patientName);
dimse.Dataset.Add(DicomTag.OtherPatientIDs, String.Empty);
dimse.Dataset.Add(DicomTag.IssuerOfPatientID, String.Empty);
dimse.Dataset.Add(DicomTag.PatientSex, String.Empty);
dimse.Dataset.Add(DicomTag.PatientBirthDate, String.Empty);
dimse.Dataset.Add(DicomTag.StudyInstanceUID, studyInstanceUid);
dimse.Dataset.Add(DicomTag.ModalitiesInStudy, modalitiesInStudy);
dimse.Dataset.Add(DicomTag.Modality, modalitiesInStudy);
dimse.Dataset.Add(DicomTag.StudyID, studyId);
dimse.Dataset.Add(DicomTag.AccessionNumber, accession);
dimse.Dataset.Add(DicomTag.StudyDate, studyDateTime);
dimse.Dataset.Add(DicomTag.StudyTime, studyDateTime);
dimse.Dataset.Add(DicomTag.StudyDescription, String.Empty);
dimse.Dataset.Add(DicomTag.NumberOfStudyRelatedSeries, String.Empty);
dimse.Dataset.Add(DicomTag.NumberOfStudyRelatedInstances, String.Empty);
return dimse;
}
public static DicomCFindRequest CreateSeriesQuery(string studyInstanceUid, string modality = null) {
var dimse = new DicomCFindRequest(DicomQueryRetrieveLevel.Series);
dimse.SOPClassUID = DicomUID.StudyRootQueryRetrieveInformationModelFIND;
dimse.Dataset.Add(DicomTag.StudyInstanceUID, studyInstanceUid);
dimse.Dataset.Add(DicomTag.SeriesInstanceUID, String.Empty);
dimse.Dataset.Add(DicomTag.SeriesNumber, String.Empty);
dimse.Dataset.Add(DicomTag.SeriesDescription, String.Empty);
dimse.Dataset.Add(DicomTag.Modality, modality);
dimse.Dataset.Add(DicomTag.SeriesDate, String.Empty);
dimse.Dataset.Add(DicomTag.SeriesTime, String.Empty);
dimse.Dataset.Add(DicomTag.NumberOfSeriesRelatedInstances, String.Empty);
return dimse;
}
public static DicomCFindRequest CreateWorklistQuery(string patientId = null, string patientName = null,
string stationAE = null, string stationName = null, string modality = null,
DicomDateRange scheduledDateTime = null)
{
var dimse = new DicomCFindRequest(DicomQueryRetrieveLevel.Worklist);
dimse.SOPClassUID = DicomUID.ModalityWorklistInformationModelFIND;
dimse.Dataset.Add(DicomTag.PatientID, patientId);
dimse.Dataset.Add(DicomTag.PatientName, patientName);
dimse.Dataset.Add(DicomTag.OtherPatientIDs, String.Empty);
dimse.Dataset.Add(DicomTag.IssuerOfPatientID, String.Empty);
dimse.Dataset.Add(DicomTag.PatientSex, String.Empty);
dimse.Dataset.Add(DicomTag.PatientWeight, String.Empty);
dimse.Dataset.Add(DicomTag.PatientBirthDate, String.Empty);
dimse.Dataset.Add(DicomTag.MedicalAlerts, String.Empty);
dimse.Dataset.Add(DicomTag.PregnancyStatus, new ushort[0]);
dimse.Dataset.Add(DicomTag.Allergies, String.Empty);
dimse.Dataset.Add(DicomTag.PatientComments, String.Empty);
dimse.Dataset.Add(DicomTag.SpecialNeeds, String.Empty);
dimse.Dataset.Add(DicomTag.PatientState, String.Empty);
dimse.Dataset.Add(DicomTag.CurrentPatientLocation, String.Empty);
dimse.Dataset.Add(DicomTag.InstitutionName, String.Empty);
dimse.Dataset.Add(DicomTag.AdmissionID, String.Empty);
dimse.Dataset.Add(DicomTag.AccessionNumber, String.Empty);
dimse.Dataset.Add(DicomTag.ReferringPhysicianName, String.Empty);
dimse.Dataset.Add(DicomTag.AdmittingDiagnosesDescription, String.Empty);
dimse.Dataset.Add(DicomTag.RequestingPhysician, String.Empty);
dimse.Dataset.Add(DicomTag.StudyInstanceUID, String.Empty);
dimse.Dataset.Add(DicomTag.StudyDescription, String.Empty);
dimse.Dataset.Add(DicomTag.StudyID, String.Empty);
dimse.Dataset.Add(DicomTag.ReasonForTheRequestedProcedure, String.Empty);
dimse.Dataset.Add(DicomTag.StudyDate, String.Empty);
dimse.Dataset.Add(DicomTag.StudyTime, String.Empty);
dimse.Dataset.Add(DicomTag.RequestedProcedureID, String.Empty);
dimse.Dataset.Add(DicomTag.RequestedProcedureDescription, String.Empty);
dimse.Dataset.Add(DicomTag.RequestedProcedurePriority, String.Empty);
dimse.Dataset.Add(new DicomSequence(DicomTag.RequestedProcedureCodeSequence));
dimse.Dataset.Add(new DicomSequence(DicomTag.ReferencedStudySequence));
dimse.Dataset.Add(new DicomSequence(DicomTag.ProcedureCodeSequence));
var sps = new DicomDataset();
sps.Add(DicomTag.ScheduledStationAETitle, stationAE);
sps.Add(DicomTag.ScheduledStationName, stationName);
sps.Add(DicomTag.ScheduledProcedureStepStartDate, scheduledDateTime);
sps.Add(DicomTag.ScheduledProcedureStepStartTime, scheduledDateTime);
sps.Add(DicomTag.Modality, modality);
sps.Add(DicomTag.ScheduledPerformingPhysicianName, String.Empty);
sps.Add(DicomTag.ScheduledProcedureStepDescription, String.Empty);
sps.Add(new DicomSequence(DicomTag.ScheduledProtocolCodeSequence));
sps.Add(DicomTag.ScheduledProcedureStepLocation, String.Empty);
sps.Add(DicomTag.ScheduledProcedureStepID, String.Empty);
sps.Add(DicomTag.RequestedContrastAgent, String.Empty);
sps.Add(DicomTag.PreMedication, String.Empty);
sps.Add(DicomTag.AnatomicalOrientationType, String.Empty);
dimse.Dataset.Add(new DicomSequence(DicomTag.ScheduledProcedureStepSequence, sps));
return dimse;
}
}
}
| {
"content_hash": "992b23ab183d25ac4bafe7a2979d78e4",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 208,
"avg_line_length": 50.222972972972975,
"alnum_prop": 0.7874344140992869,
"repo_name": "vvboborykin/DicomStorage",
"id": "bb78a959d34f5f82e7560546d12fe1f29d4c5981",
"size": "7435",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DICOM/Network/DicomCFindRequest.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1728079"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "75b6c1516a1340a8c9154a303c654e82",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "75af61a8d2fb6df946b99d20db21f6d787288cd1",
"size": "178",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Cousinia kuekenthalii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
checked="checked" | {
"content_hash": "94c0b95ebdb1327135fdaba43b97707d",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 19,
"avg_line_length": 19,
"alnum_prop": 0.7368421052631579,
"repo_name": "osalabs/osafw-php",
"id": "ee60a2a41c9abe396a3a50b2bb546ef1cc699205",
"size": "19",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "www/template/common/checked.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "27594"
},
{
"name": "HTML",
"bytes": "187386"
},
{
"name": "JavaScript",
"bytes": "45000"
},
{
"name": "PHP",
"bytes": "596360"
},
{
"name": "TSQL",
"bytes": "18595"
}
],
"symlink_target": ""
} |
<?php
namespace Zend\Feed\Writer\Renderer\Feed;
use DOMDocument;
use DOMElement;
use Zend\Feed\Writer;
use Zend\Feed\Writer\Renderer;
/**
*/
class AtomSource extends AbstractAtom implements Renderer\RendererInterface
{
/**
* Constructor
*
* @param Writer\Source $container
*/
public function __construct(Writer\Source $container)
{
parent::__construct($container);
}
/**
* Render Atom Feed Metadata (Source element)
*
* @return \Zend\Feed\Writer\Renderer\Feed\Atom
*/
public function render()
{
if (!$this->container->getEncoding()) {
$this->container->setEncoding('UTF-8');
}
$this->dom = new DOMDocument('1.0', $this->container->getEncoding());
$this->dom->formatOutput = true;
$root = $this->dom->createElement('source');
$this->setRootElement($root);
$this->dom->appendChild($root);
$this->_setLanguage($this->dom, $root);
$this->_setBaseUrl($this->dom, $root);
$this->_setTitle($this->dom, $root);
$this->_setDescription($this->dom, $root);
$this->_setDateCreated($this->dom, $root);
$this->_setDateModified($this->dom, $root);
$this->_setGenerator($this->dom, $root);
$this->_setLink($this->dom, $root);
$this->_setFeedLinks($this->dom, $root);
$this->_setId($this->dom, $root);
$this->_setAuthors($this->dom, $root);
$this->_setCopyright($this->dom, $root);
$this->_setCategories($this->dom, $root);
foreach ($this->extensions as $ext) {
$ext->setType($this->getType());
$ext->setRootElement($this->getRootElement());
$ext->setDOMDocument($this->getDOMDocument(), $root);
$ext->render();
}
return $this;
}
/**
* Set feed generator string
*
* @param DOMDocument $dom
* @param DOMElement $root
* @return void
*/
protected function _setGenerator(DOMDocument $dom, DOMElement $root)
{
if (!$this->getDataContainer()->getGenerator()) {
return;
}
$gdata = $this->getDataContainer()->getGenerator();
$generator = $dom->createElement('generator');
$root->appendChild($generator);
$text = $dom->createTextNode($gdata['name']);
$generator->appendChild($text);
if (array_key_exists('uri', $gdata)) {
$generator->setAttribute('uri', $gdata['uri']);
}
if (array_key_exists('version', $gdata)) {
$generator->setAttribute('version', $gdata['version']);
}
}
}
| {
"content_hash": "498c2c34f999fc361c89eebf099dee26",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 77,
"avg_line_length": 31.181818181818183,
"alnum_prop": 0.5422740524781341,
"repo_name": "wp-plugins/double-click",
"id": "78c8dbb37e818bad01e8e75c3f3d05c044488242",
"size": "3052",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/AtomSource.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "13825"
},
{
"name": "PHP",
"bytes": "19905"
},
{
"name": "Shell",
"bytes": "2037"
}
],
"symlink_target": ""
} |
/*
<div id="test_div_parent" class="test_class">
<div id="test_div_child" class="test_class">
</div>
</div>
*/
new Test.Unit.Runner({
testEngine: function() {
this.assert(Prototype.Selector.engine);
},
testSelect: function() {
var elements = Prototype.Selector.select('.test_class');
this.assert(Object.isArray(elements));
this.assertEqual(2, elements.length);
this.assertEqual('test_div_parent', elements[0].id);
this.assertEqual('test_div_child', elements[1].id);
},
testSelectWithContext: function() {
var elements = Prototype.Selector.select('.test_class', $('test_div_parent'));
this.assert(Object.isArray(elements));
this.assertEqual(1, elements.length);
this.assertEqual('test_div_child', elements[0].id);
},
testSelectWithEmptyResult: function() {
var elements = Prototype.Selector.select('.non_existent');
this.assert(Object.isArray(elements));
this.assertEqual(0, elements.length);
},
testMatch: function() {
var element = $('test_div_parent');
this.assertEqual(true, Prototype.Selector.match(element, '.test_class'));
this.assertEqual(false, Prototype.Selector.match(element, '.non_existent'));
},
testFind: function() {
var elements = document.getElementsByTagName('*'),
expression = '.test_class';
this.assertEqual('test_div_parent', Prototype.Selector.find(elements, expression).id);
this.assertEqual('test_div_child', Prototype.Selector.find(elements, expression, 1).id);
}
});
| {
"content_hash": "8c9cee2fa819ad57dedabd9420b38650",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 92,
"avg_line_length": 30.3,
"alnum_prop": 0.6785478547854785,
"repo_name": "chjj/zest",
"id": "19d29e76ba5fca5d5314c58285b5f6be985e626f",
"size": "1515",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "test/proto/selector_engine_test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "772"
},
{
"name": "JavaScript",
"bytes": "110784"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using Laziness;
class TypeName
{
public StringBuilder X => _x.Value;
private LazyMixin<StringBuilder> _x;
}
class A { }
struct B { }
class C
{
private A _a;
private B _b;
public readonly A[] _c;
public A[,] _d;
protected readonly B[] _e;
protected B[,] _f;
}
| {
"content_hash": "9ca8cea6835c5b4f33359b44b6dbd766",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 40,
"avg_line_length": 17.44,
"alnum_prop": 0.6651376146788991,
"repo_name": "ufcpp/LazyMixin",
"id": "2ce25c12bc87dbffaca51abe26693e21845361af",
"size": "438",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LazyMixin/LazyMixinAnalyzer/LazyMixinAnalyzer.Test/DataSource/AccessViaPropertyUnitTest/NoNamespace/Source.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "10"
},
{
"name": "C#",
"bytes": "65978"
},
{
"name": "PowerShell",
"bytes": "1584"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 Red Hat, Inc. and/or its affiliates
and other contributors as indicated by the @author tags.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<display-name>Hawkular Avail Creator</display-name>
<description>A Bus listener that takes in *.status.code metrics and translates them into availability
records, that are sent to Hawkular-Metrics and -Alerts.</description>
</web-app>
| {
"content_hash": "b104a59353e9c6f228dafa6b6ea7e151",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 115,
"avg_line_length": 40.9,
"alnum_prop": 0.7171964140179299,
"repo_name": "panossot/hawkular",
"id": "3f87f3441a27538bb4b8ac2d0f15379b2d9c0289",
"size": "1227",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "modules/avail-creator/src/main/webapp/WEB-INF/web.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "26522"
},
{
"name": "Groovy",
"bytes": "42219"
},
{
"name": "HTML",
"bytes": "79563"
},
{
"name": "Java",
"bytes": "93194"
},
{
"name": "JavaScript",
"bytes": "8211"
},
{
"name": "TypeScript",
"bytes": "160700"
},
{
"name": "XSLT",
"bytes": "42349"
}
],
"symlink_target": ""
} |
using System.IO;
using System.Linq;
namespace TioTests
{
public static class Utility
{
public static string GetAncestor(string path, int depth)
{
string result = path;
for(int i=0;i<depth;i++)
{
result = Path.GetDirectoryName(result);
}
return result;
}
public static void ClearLine(string testName)
{
Logger.Log($"\r{string.Empty.PadLeft(testName.Length + 40)}\r", true);
}
public static string TrimWhitespaces(string s)
{
return s?.Trim("\n\r\t ".ToCharArray());
}
public static void Dump(string comment, byte[] data, string fileName)
{
using (FileStream fs = File.Open(fileName, FileMode.Append, FileAccess.Write, FileShare.Read))
using (StreamWriter sw = new StreamWriter(fs))
{
sw.WriteLine(comment);
sw.WriteLine(Hex.Dump(data));
sw.WriteLine();
sw.Flush();
}
}
public static int SearchBytes(byte[] haystack, byte[] needle)
{
var len = needle.Length;
var limit = haystack.Length - len;
for (var i = 0; i <= limit; i++)
{
var k = 0;
for (; k < len; k++)
{
if (needle[k] != haystack[i + k]) break;
}
if (k == len) return i;
}
return -1;
}
public static string GetProcess(Config config)
{
if (config.LocalProcess != null)
{
return config.LocalProcess;
}
return Path.Combine(config.LocalRoot, "tio.run/cgi-bin/run");
}
public static string GetArenaHost(Config config)
{
if (config.ArenaHost != null)
{
return config.ArenaHost;
}
return Path.GetFileName(Directory.GetFiles(Path.Combine(config.LocalRoot, "etc/run.d")).OrderBy(x=>x).FirstOrDefault());
}
}
}
| {
"content_hash": "d462468612654998e5336bc545f538e0",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 132,
"avg_line_length": 29.54794520547945,
"alnum_prop": 0.48400556328233657,
"repo_name": "TryItOnline/TioTests",
"id": "f395f2d06689a45058cbc91fefce5f91458df481",
"size": "2159",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Utility.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "40189"
}
],
"symlink_target": ""
} |
<?php
namespace Download\Admin\Settings;
use Gcms\Gcms;
use Gcms\Login;
use Kotchasan\Html;
use Kotchasan\Http\Request;
use Kotchasan\Language;
/**
* module=download-settings
*
* @author Goragod Wiriya <admin@goragod.com>
*
* @since 1.0
*/
class Controller extends \Gcms\Controller
{
/**
* จัดการการตั้งค่า
*
* @param Request $request
*
* @return string
*/
public function render(Request $request)
{
// ข้อความ title bar
$this->title = Language::trans('{LNG_Module settings} {LNG_Download}');
// เลือกเมนู
$this->menu = 'modules';
// อ่านข้อมูลโมดูล และ config
$index = \Index\Adminmodule\Model::getModuleWithConfig('download', $request->request('mid')->toInt());
// admin
$login = Login::adminAccess();
// can_config หรือ สมาชิกตัวอย่าง
if ($index && $login && (Gcms::canConfig($login, $index, 'can_config') || !Login::notDemoMode($login))) {
// แสดงผล
$section = Html::create('section');
// breadcrumbs
$breadcrumbs = $section->add('div', array(
'class' => 'breadcrumbs',
));
$ul = $breadcrumbs->add('ul');
$ul->appendChild('<li><span class="icon-download">{LNG_Module}</span></li>');
$ul->appendChild('<li><span>'.ucfirst($index->module).'</span></li>');
$ul->appendChild('<li><span>{LNG_Settings}</span></li>');
$section->add('header', array(
'innerHTML' => '<h2 class="icon-config">'.$this->title.'</h2>',
));
// แสดงฟอร์ม
$section->appendChild(\Download\Admin\Settings\View::create()->render($request, $index));
return $section->render();
}
// 404.html
return \Index\Error\Controller::page404();
}
}
| {
"content_hash": "e92d62c4325d5d7d023ec5f2df20b36c",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 113,
"avg_line_length": 31.1,
"alnum_prop": 0.5423365487674169,
"repo_name": "goragod/GCMS",
"id": "10a5a69ee7c964c3d28fd1f3cfa568494f349ba7",
"size": "2219",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "modules/download/controllers/admin/settings.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "437289"
},
{
"name": "HTML",
"bytes": "329496"
},
{
"name": "JavaScript",
"bytes": "405822"
},
{
"name": "PHP",
"bytes": "3764287"
}
],
"symlink_target": ""
} |
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef SEMAPHORE_H
#define SEMAPHORE_H
#ifndef INC_FREERTOS_H
#error "#include FreeRTOS.h" must appear in source files before "#include semphr.h"
#endif
#include "queue.h"
typedef xQueueHandle xSemaphoreHandle;
#define semBINARY_SEMAPHORE_QUEUE_LENGTH ( ( unsigned char ) 1U )
#define semSEMAPHORE_QUEUE_ITEM_LENGTH ( ( unsigned char ) 0U )
#define semGIVE_BLOCK_TIME ( ( portTickType ) 0U )
/**
* semphr. h
* <pre>vSemaphoreCreateBinary( xSemaphoreHandle xSemaphore )</pre>
*
* <i>Macro</i> that implements a semaphore by using the existing queue mechanism.
* The queue length is 1 as this is a binary semaphore. The data size is 0
* as we don't want to actually store any data - we just want to know if the
* queue is empty or full.
*
* This type of semaphore can be used for pure synchronisation between tasks or
* between an interrupt and a task. The semaphore need not be given back once
* obtained, so one task/interrupt can continuously 'give' the semaphore while
* another continuously 'takes' the semaphore. For this reason this type of
* semaphore does not use a priority inheritance mechanism. For an alternative
* that does use priority inheritance see xSemaphoreCreateMutex().
*
* @param xSemaphore Handle to the created semaphore. Should be of type xSemaphoreHandle.
*
* Example usage:
<pre>
xSemaphoreHandle xSemaphore;
void vATask( void * pvParameters )
{
// Semaphore cannot be used before a call to vSemaphoreCreateBinary ().
// This is a macro so pass the variable in directly.
vSemaphoreCreateBinary( xSemaphore );
if( xSemaphore != NULL )
{
// The semaphore was created successfully.
// The semaphore can now be used.
}
}
</pre>
* \defgroup vSemaphoreCreateBinary vSemaphoreCreateBinary
* \ingroup Semaphores
*/
#define vSemaphoreCreateBinary( xSemaphore ) { \
( xSemaphore ) = xQueueCreate( ( unsigned portBASE_TYPE ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH ); \
if( ( xSemaphore ) != NULL ) \
{ \
xSemaphoreGive( ( xSemaphore ) ); \
} \
}
/**
* semphr. h
* <pre>xSemaphoreTake(
* xSemaphoreHandle xSemaphore,
* portTickType xBlockTime
* )</pre>
*
* <i>Macro</i> to obtain a semaphore. The semaphore must have previously been
* created with a call to vSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
* xSemaphoreCreateCounting().
*
* @param xSemaphore A handle to the semaphore being taken - obtained when
* the semaphore was created.
*
* @param xBlockTime The time in ticks to wait for the semaphore to become
* available. The macro portTICK_RATE_MS can be used to convert this to a
* real time. A block time of zero can be used to poll the semaphore. A block
* time of portMAX_DELAY can be used to block indefinitely (provided
* INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h).
*
* @return pdTRUE if the semaphore was obtained. pdFALSE
* if xBlockTime expired without the semaphore becoming available.
*
* Example usage:
<pre>
xSemaphoreHandle xSemaphore = NULL;
// A task that creates a semaphore.
void vATask( void * pvParameters )
{
// Create the semaphore to guard a shared resource.
vSemaphoreCreateBinary( xSemaphore );
}
// A task that uses the semaphore.
void vAnotherTask( void * pvParameters )
{
// ... Do other things.
if( xSemaphore != NULL )
{
// See if we can obtain the semaphore. If the semaphore is not available
// wait 10 ticks to see if it becomes free.
if( xSemaphoreTake( xSemaphore, ( portTickType ) 10 ) == pdTRUE )
{
// We were able to obtain the semaphore and can now access the
// shared resource.
// ...
// We have finished accessing the shared resource. Release the
// semaphore.
xSemaphoreGive( xSemaphore );
}
else
{
// We could not obtain the semaphore and can therefore not access
// the shared resource safely.
}
}
}
</pre>
* \defgroup xSemaphoreTake xSemaphoreTake
* \ingroup Semaphores
*/
#define xSemaphoreTake( xSemaphore, xBlockTime ) xQueueGenericReceive( ( xQueueHandle ) ( xSemaphore ), NULL, ( xBlockTime ), pdFALSE )
/**
* semphr. h
* xSemaphoreTakeRecursive(
* xSemaphoreHandle xMutex,
* portTickType xBlockTime
* )
*
* <i>Macro</i> to recursively obtain, or 'take', a mutex type semaphore.
* The mutex must have previously been created using a call to
* xSemaphoreCreateRecursiveMutex();
*
* configUSE_RECURSIVE_MUTEXES must be set to 1 in FreeRTOSConfig.h for this
* macro to be available.
*
* This macro must not be used on mutexes created using xSemaphoreCreateMutex().
*
* A mutex used recursively can be 'taken' repeatedly by the owner. The mutex
* doesn't become available again until the owner has called
* xSemaphoreGiveRecursive() for each successful 'take' request. For example,
* if a task successfully 'takes' the same mutex 5 times then the mutex will
* not be available to any other task until it has also 'given' the mutex back
* exactly five times.
*
* @param xMutex A handle to the mutex being obtained. This is the
* handle returned by xSemaphoreCreateRecursiveMutex();
*
* @param xBlockTime The time in ticks to wait for the semaphore to become
* available. The macro portTICK_RATE_MS can be used to convert this to a
* real time. A block time of zero can be used to poll the semaphore. If
* the task already owns the semaphore then xSemaphoreTakeRecursive() will
* return immediately no matter what the value of xBlockTime.
*
* @return pdTRUE if the semaphore was obtained. pdFALSE if xBlockTime
* expired without the semaphore becoming available.
*
* Example usage:
<pre>
xSemaphoreHandle xMutex = NULL;
// A task that creates a mutex.
void vATask( void * pvParameters )
{
// Create the mutex to guard a shared resource.
xMutex = xSemaphoreCreateRecursiveMutex();
}
// A task that uses the mutex.
void vAnotherTask( void * pvParameters )
{
// ... Do other things.
if( xMutex != NULL )
{
// See if we can obtain the mutex. If the mutex is not available
// wait 10 ticks to see if it becomes free.
if( xSemaphoreTakeRecursive( xSemaphore, ( portTickType ) 10 ) == pdTRUE )
{
// We were able to obtain the mutex and can now access the
// shared resource.
// ...
// For some reason due to the nature of the code further calls to
// xSemaphoreTakeRecursive() are made on the same mutex. In real
// code these would not be just sequential calls as this would make
// no sense. Instead the calls are likely to be buried inside
// a more complex call structure.
xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );
xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );
// The mutex has now been 'taken' three times, so will not be
// available to another task until it has also been given back
// three times. Again it is unlikely that real code would have
// these calls sequentially, but instead buried in a more complex
// call structure. This is just for illustrative purposes.
xSemaphoreGiveRecursive( xMutex );
xSemaphoreGiveRecursive( xMutex );
xSemaphoreGiveRecursive( xMutex );
// Now the mutex can be taken by other tasks.
}
else
{
// We could not obtain the mutex and can therefore not access
// the shared resource safely.
}
}
}
</pre>
* \defgroup xSemaphoreTakeRecursive xSemaphoreTakeRecursive
* \ingroup Semaphores
*/
#define xSemaphoreTakeRecursive( xMutex, xBlockTime ) xQueueTakeMutexRecursive( ( xMutex ), ( xBlockTime ) )
/*
* xSemaphoreAltTake() is an alternative version of xSemaphoreTake().
*
* The source code that implements the alternative (Alt) API is much
* simpler because it executes everything from within a critical section.
* This is the approach taken by many other RTOSes, but FreeRTOS.org has the
* preferred fully featured API too. The fully featured API has more
* complex code that takes longer to execute, but makes much less use of
* critical sections. Therefore the alternative API sacrifices interrupt
* responsiveness to gain execution speed, whereas the fully featured API
* sacrifices execution speed to ensure better interrupt responsiveness.
*/
#define xSemaphoreAltTake( xSemaphore, xBlockTime ) xQueueAltGenericReceive( ( xQueueHandle ) ( xSemaphore ), NULL, ( xBlockTime ), pdFALSE )
/**
* semphr. h
* <pre>xSemaphoreGive( xSemaphoreHandle xSemaphore )</pre>
*
* <i>Macro</i> to release a semaphore. The semaphore must have previously been
* created with a call to vSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
* xSemaphoreCreateCounting(). and obtained using sSemaphoreTake().
*
* This macro must not be used from an ISR. See xSemaphoreGiveFromISR () for
* an alternative which can be used from an ISR.
*
* This macro must also not be used on semaphores created using
* xSemaphoreCreateRecursiveMutex().
*
* @param xSemaphore A handle to the semaphore being released. This is the
* handle returned when the semaphore was created.
*
* @return pdTRUE if the semaphore was released. pdFALSE if an error occurred.
* Semaphores are implemented using queues. An error can occur if there is
* no space on the queue to post a message - indicating that the
* semaphore was not first obtained correctly.
*
* Example usage:
<pre>
xSemaphoreHandle xSemaphore = NULL;
void vATask( void * pvParameters )
{
// Create the semaphore to guard a shared resource.
vSemaphoreCreateBinary( xSemaphore );
if( xSemaphore != NULL )
{
if( xSemaphoreGive( xSemaphore ) != pdTRUE )
{
// We would expect this call to fail because we cannot give
// a semaphore without first "taking" it!
}
// Obtain the semaphore - don't block if the semaphore is not
// immediately available.
if( xSemaphoreTake( xSemaphore, ( portTickType ) 0 ) )
{
// We now have the semaphore and can access the shared resource.
// ...
// We have finished accessing the shared resource so can free the
// semaphore.
if( xSemaphoreGive( xSemaphore ) != pdTRUE )
{
// We would not expect this call to fail because we must have
// obtained the semaphore to get here.
}
}
}
}
</pre>
* \defgroup xSemaphoreGive xSemaphoreGive
* \ingroup Semaphores
*/
#define xSemaphoreGive( xSemaphore ) xQueueGenericSend( ( xQueueHandle ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )
/**
* semphr. h
* <pre>xSemaphoreGiveRecursive( xSemaphoreHandle xMutex )</pre>
*
* <i>Macro</i> to recursively release, or 'give', a mutex type semaphore.
* The mutex must have previously been created using a call to
* xSemaphoreCreateRecursiveMutex();
*
* configUSE_RECURSIVE_MUTEXES must be set to 1 in FreeRTOSConfig.h for this
* macro to be available.
*
* This macro must not be used on mutexes created using xSemaphoreCreateMutex().
*
* A mutex used recursively can be 'taken' repeatedly by the owner. The mutex
* doesn't become available again until the owner has called
* xSemaphoreGiveRecursive() for each successful 'take' request. For example,
* if a task successfully 'takes' the same mutex 5 times then the mutex will
* not be available to any other task until it has also 'given' the mutex back
* exactly five times.
*
* @param xMutex A handle to the mutex being released, or 'given'. This is the
* handle returned by xSemaphoreCreateMutex();
*
* @return pdTRUE if the semaphore was given.
*
* Example usage:
<pre>
xSemaphoreHandle xMutex = NULL;
// A task that creates a mutex.
void vATask( void * pvParameters )
{
// Create the mutex to guard a shared resource.
xMutex = xSemaphoreCreateRecursiveMutex();
}
// A task that uses the mutex.
void vAnotherTask( void * pvParameters )
{
// ... Do other things.
if( xMutex != NULL )
{
// See if we can obtain the mutex. If the mutex is not available
// wait 10 ticks to see if it becomes free.
if( xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 ) == pdTRUE )
{
// We were able to obtain the mutex and can now access the
// shared resource.
// ...
// For some reason due to the nature of the code further calls to
// xSemaphoreTakeRecursive() are made on the same mutex. In real
// code these would not be just sequential calls as this would make
// no sense. Instead the calls are likely to be buried inside
// a more complex call structure.
xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );
xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );
// The mutex has now been 'taken' three times, so will not be
// available to another task until it has also been given back
// three times. Again it is unlikely that real code would have
// these calls sequentially, it would be more likely that the calls
// to xSemaphoreGiveRecursive() would be called as a call stack
// unwound. This is just for demonstrative purposes.
xSemaphoreGiveRecursive( xMutex );
xSemaphoreGiveRecursive( xMutex );
xSemaphoreGiveRecursive( xMutex );
// Now the mutex can be taken by other tasks.
}
else
{
// We could not obtain the mutex and can therefore not access
// the shared resource safely.
}
}
}
</pre>
* \defgroup xSemaphoreGiveRecursive xSemaphoreGiveRecursive
* \ingroup Semaphores
*/
#define xSemaphoreGiveRecursive( xMutex ) xQueueGiveMutexRecursive( ( xMutex ) )
/*
* xSemaphoreAltGive() is an alternative version of xSemaphoreGive().
*
* The source code that implements the alternative (Alt) API is much
* simpler because it executes everything from within a critical section.
* This is the approach taken by many other RTOSes, but FreeRTOS.org has the
* preferred fully featured API too. The fully featured API has more
* complex code that takes longer to execute, but makes much less use of
* critical sections. Therefore the alternative API sacrifices interrupt
* responsiveness to gain execution speed, whereas the fully featured API
* sacrifices execution speed to ensure better interrupt responsiveness.
*/
#define xSemaphoreAltGive( xSemaphore ) xQueueAltGenericSend( ( xQueueHandle ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )
/**
* semphr. h
* <pre>
xSemaphoreGiveFromISR(
xSemaphoreHandle xSemaphore,
signed portBASE_TYPE *pxHigherPriorityTaskWoken
)</pre>
*
* <i>Macro</i> to release a semaphore. The semaphore must have previously been
* created with a call to vSemaphoreCreateBinary() or xSemaphoreCreateCounting().
*
* Mutex type semaphores (those created using a call to xSemaphoreCreateMutex())
* must not be used with this macro.
*
* This macro can be used from an ISR.
*
* @param xSemaphore A handle to the semaphore being released. This is the
* handle returned when the semaphore was created.
*
* @param pxHigherPriorityTaskWoken xSemaphoreGiveFromISR() will set
* *pxHigherPriorityTaskWoken to pdTRUE if giving the semaphore caused a task
* to unblock, and the unblocked task has a priority higher than the currently
* running task. If xSemaphoreGiveFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @return pdTRUE if the semaphore was successfully given, otherwise errQUEUE_FULL.
*
* Example usage:
<pre>
\#define LONG_TIME 0xffff
\#define TICKS_TO_WAIT 10
xSemaphoreHandle xSemaphore = NULL;
// Repetitive task.
void vATask( void * pvParameters )
{
for( ;; )
{
// We want this task to run every 10 ticks of a timer. The semaphore
// was created before this task was started.
// Block waiting for the semaphore to become available.
if( xSemaphoreTake( xSemaphore, LONG_TIME ) == pdTRUE )
{
// It is time to execute.
// ...
// We have finished our task. Return to the top of the loop where
// we will block on the semaphore until it is time to execute
// again. Note when using the semaphore for synchronisation with an
// ISR in this manner there is no need to 'give' the semaphore back.
}
}
}
// Timer ISR
void vTimerISR( void * pvParameters )
{
static unsigned char ucLocalTickCount = 0;
static signed portBASE_TYPE xHigherPriorityTaskWoken;
// A timer tick has occurred.
// ... Do other time functions.
// Is it time for vATask () to run?
xHigherPriorityTaskWoken = pdFALSE;
ucLocalTickCount++;
if( ucLocalTickCount >= TICKS_TO_WAIT )
{
// Unblock the task by releasing the semaphore.
xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken );
// Reset the count so we release the semaphore again in 10 ticks time.
ucLocalTickCount = 0;
}
if( xHigherPriorityTaskWoken != pdFALSE )
{
// We can force a context switch here. Context switching from an
// ISR uses port specific syntax. Check the demo task for your port
// to find the syntax required.
}
}
</pre>
* \defgroup xSemaphoreGiveFromISR xSemaphoreGiveFromISR
* \ingroup Semaphores
*/
#define xSemaphoreGiveFromISR( xSemaphore, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueueHandle ) ( xSemaphore ), NULL, ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
/**
* semphr. h
* <pre>xSemaphoreHandle xSemaphoreCreateMutex( void )</pre>
*
* <i>Macro</i> that implements a mutex semaphore by using the existing queue
* mechanism.
*
* Mutexes created using this macro can be accessed using the xSemaphoreTake()
* and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and
* xSemaphoreGiveRecursive() macros should not be used.
*
* This type of semaphore uses a priority inheritance mechanism so a task
* 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the
* semaphore it is no longer required.
*
* Mutex type semaphores cannot be used from within interrupt service routines.
*
* See vSemaphoreCreateBinary() for an alternative implementation that can be
* used for pure synchronisation (where one task or interrupt always 'gives' the
* semaphore and another always 'takes' the semaphore) and from within interrupt
* service routines.
*
* @return xSemaphore Handle to the created mutex semaphore. Should be of type
* xSemaphoreHandle.
*
* Example usage:
<pre>
xSemaphoreHandle xSemaphore;
void vATask( void * pvParameters )
{
// Semaphore cannot be used before a call to xSemaphoreCreateMutex().
// This is a macro so pass the variable in directly.
xSemaphore = xSemaphoreCreateMutex();
if( xSemaphore != NULL )
{
// The semaphore was created successfully.
// The semaphore can now be used.
}
}
</pre>
* \defgroup vSemaphoreCreateMutex vSemaphoreCreateMutex
* \ingroup Semaphores
*/
#define xSemaphoreCreateMutex() xQueueCreateMutex()
/**
* semphr. h
* <pre>xSemaphoreHandle xSemaphoreCreateRecursiveMutex( void )</pre>
*
* <i>Macro</i> that implements a recursive mutex by using the existing queue
* mechanism.
*
* Mutexes created using this macro can be accessed using the
* xSemaphoreTakeRecursive() and xSemaphoreGiveRecursive() macros. The
* xSemaphoreTake() and xSemaphoreGive() macros should not be used.
*
* A mutex used recursively can be 'taken' repeatedly by the owner. The mutex
* doesn't become available again until the owner has called
* xSemaphoreGiveRecursive() for each successful 'take' request. For example,
* if a task successfully 'takes' the same mutex 5 times then the mutex will
* not be available to any other task until it has also 'given' the mutex back
* exactly five times.
*
* This type of semaphore uses a priority inheritance mechanism so a task
* 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the
* semaphore it is no longer required.
*
* Mutex type semaphores cannot be used from within interrupt service routines.
*
* See vSemaphoreCreateBinary() for an alternative implementation that can be
* used for pure synchronisation (where one task or interrupt always 'gives' the
* semaphore and another always 'takes' the semaphore) and from within interrupt
* service routines.
*
* @return xSemaphore Handle to the created mutex semaphore. Should be of type
* xSemaphoreHandle.
*
* Example usage:
<pre>
xSemaphoreHandle xSemaphore;
void vATask( void * pvParameters )
{
// Semaphore cannot be used before a call to xSemaphoreCreateMutex().
// This is a macro so pass the variable in directly.
xSemaphore = xSemaphoreCreateRecursiveMutex();
if( xSemaphore != NULL )
{
// The semaphore was created successfully.
// The semaphore can now be used.
}
}
</pre>
* \defgroup vSemaphoreCreateMutex vSemaphoreCreateMutex
* \ingroup Semaphores
*/
#define xSemaphoreCreateRecursiveMutex() xQueueCreateMutex()
/**
* semphr. h
* <pre>xSemaphoreHandle xSemaphoreCreateCounting( unsigned portBASE_TYPE uxMaxCount, unsigned portBASE_TYPE uxInitialCount )</pre>
*
* <i>Macro</i> that creates a counting semaphore by using the existing
* queue mechanism.
*
* Counting semaphores are typically used for two things:
*
* 1) Counting events.
*
* In this usage scenario an event handler will 'give' a semaphore each time
* an event occurs (incrementing the semaphore count value), and a handler
* task will 'take' a semaphore each time it processes an event
* (decrementing the semaphore count value). The count value is therefore
* the difference between the number of events that have occurred and the
* number that have been processed. In this case it is desirable for the
* initial count value to be zero.
*
* 2) Resource management.
*
* In this usage scenario the count value indicates the number of resources
* available. To obtain control of a resource a task must first obtain a
* semaphore - decrementing the semaphore count value. When the count value
* reaches zero there are no free resources. When a task finishes with the
* resource it 'gives' the semaphore back - incrementing the semaphore count
* value. In this case it is desirable for the initial count value to be
* equal to the maximum count value, indicating that all resources are free.
*
* @param uxMaxCount The maximum count value that can be reached. When the
* semaphore reaches this value it can no longer be 'given'.
*
* @param uxInitialCount The count value assigned to the semaphore when it is
* created.
*
* @return Handle to the created semaphore. Null if the semaphore could not be
* created.
*
* Example usage:
<pre>
xSemaphoreHandle xSemaphore;
void vATask( void * pvParameters )
{
xSemaphoreHandle xSemaphore = NULL;
// Semaphore cannot be used before a call to xSemaphoreCreateCounting().
// The max value to which the semaphore can count should be 10, and the
// initial value assigned to the count should be 0.
xSemaphore = xSemaphoreCreateCounting( 10, 0 );
if( xSemaphore != NULL )
{
// The semaphore was created successfully.
// The semaphore can now be used.
}
}
</pre>
* \defgroup xSemaphoreCreateCounting xSemaphoreCreateCounting
* \ingroup Semaphores
*/
#define xSemaphoreCreateCounting( uxMaxCount, uxInitialCount ) xQueueCreateCountingSemaphore( ( uxMaxCount ), ( uxInitialCount ) )
#endif /* SEMAPHORE_H */
| {
"content_hash": "0701b540a362a0bf2ba2bf7da33c8139",
"timestamp": "",
"source": "github",
"line_count": 663,
"max_line_length": 188,
"avg_line_length": 36.80392156862745,
"alnum_prop": 0.6908323429367649,
"repo_name": "femtoio/femto-usb-blink-example",
"id": "dd37dd008a6b449b45dc95fbc214bc45c010e440",
"size": "27553",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "blinky/blinky/asf-3.21.0/thirdparty/freertos/freertos-7.0.0/source/include/semphr.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "178794"
},
{
"name": "C",
"bytes": "251878780"
},
{
"name": "C++",
"bytes": "47991929"
},
{
"name": "CSS",
"bytes": "2147"
},
{
"name": "HTML",
"bytes": "107322"
},
{
"name": "JavaScript",
"bytes": "588817"
},
{
"name": "Logos",
"bytes": "570108"
},
{
"name": "Makefile",
"bytes": "64558964"
},
{
"name": "Matlab",
"bytes": "10660"
},
{
"name": "Objective-C",
"bytes": "15780083"
},
{
"name": "Perl",
"bytes": "12845"
},
{
"name": "Python",
"bytes": "67293"
},
{
"name": "Scilab",
"bytes": "88572"
},
{
"name": "Shell",
"bytes": "126729"
}
],
"symlink_target": ""
} |
import { configure } from '@kadira/storybook'
import '../src/styles/font.css';
import '../src/styles/app.css';
import '../src/styles/list.css';
import '../src/styles/item.css';
function loadStories() {
require('../src/components/taskItem/TaskItem.story.js'),
require('../src/components/taskList/TaskList.story.js'),
require('../src/components/TaskListWrapper.story.js'),
require('../src/components/taskListFooter/TaskListFooter.story.js'),
require('../src/components/App.story.js')
// You can require as many stories as you need.
}
configure(loadStories, module)
| {
"content_hash": "bb97ca648fb6c910028be1076a5c98cf",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 70,
"avg_line_length": 36.0625,
"alnum_prop": 0.7175043327556326,
"repo_name": "meglkts/my_todo_react",
"id": "cbc61fa3fb342cb227e6f8fab2b6c1df83cfc263",
"size": "577",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".storybook/config.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6676"
},
{
"name": "HTML",
"bytes": "1223"
},
{
"name": "JavaScript",
"bytes": "58534"
}
],
"symlink_target": ""
} |
(function(angular) {
'use strict';
angular
.module('patterflash')
.directive('pfChatRooms', pfChatRooms);
function pfChatRooms() {
return {
restrict: 'E',
templateUrl: 'views/pf-chat-rooms.html',
};
}
})(angular);
| {
"content_hash": "86f7a0046b50fa0509e01a46275bd6a1",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 46,
"avg_line_length": 16.866666666666667,
"alnum_prop": 0.5968379446640316,
"repo_name": "rdhammond/patterflash",
"id": "aef1db0aa78ec0bcd03fd1f5404169ce4feca576",
"size": "253",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/angular/directives/pf-chat-rooms.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1566"
},
{
"name": "HTML",
"bytes": "4202"
},
{
"name": "JavaScript",
"bytes": "17291"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v0.1.11: v8::String::AsciiValue Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.1.11
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_string.html">String</a></li><li class="navelem"><a class="el" href="classv8_1_1_string_1_1_ascii_value.html">AsciiValue</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classv8_1_1_string_1_1_ascii_value-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::String::AsciiValue Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <<a class="el" href="v8_8h_source.html">v8.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a57cc7956658fe389a7232d4843caf3d0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a57cc7956658fe389a7232d4843caf3d0"></a>
 </td><td class="memItemRight" valign="bottom"><b>AsciiValue</b> (<a class="el" href="classv8_1_1_handle.html">Handle</a>< <a class="el" href="classv8_1_1_value.html">v8::Value</a> > obj)</td></tr>
<tr class="separator:a57cc7956658fe389a7232d4843caf3d0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1e08f3a11aefee28cbbcbc386afd6032"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1e08f3a11aefee28cbbcbc386afd6032"></a>
char * </td><td class="memItemRight" valign="bottom"><b>operator*</b> ()</td></tr>
<tr class="separator:a1e08f3a11aefee28cbbcbc386afd6032"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abb007f038d674706da738f1f1f01f084"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abb007f038d674706da738f1f1f01f084"></a>
const char * </td><td class="memItemRight" valign="bottom"><b>operator*</b> () const </td></tr>
<tr class="separator:abb007f038d674706da738f1f1f01f084"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a97cccf0ed40a3deda1612c235b2f8068"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a97cccf0ed40a3deda1612c235b2f8068"></a>
int </td><td class="memItemRight" valign="bottom"><b>length</b> () const </td></tr>
<tr class="separator:a97cccf0ed40a3deda1612c235b2f8068"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Converts an object to an ascii string. Useful if you want to print the object. If conversion to a string fails (eg. due to an exception in the toString() method of the object) then the length() method returns 0 and the * operator returns NULL. </p>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:44:15 for V8 API Reference Guide for node.js v0.1.11 by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
| {
"content_hash": "f556d3641beeb455a009d5cbf34d503b",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 274,
"avg_line_length": 53.798449612403104,
"alnum_prop": 0.6717579250720461,
"repo_name": "v8-dox/v8-dox.github.io",
"id": "e91ae91375e95ba08031ddbd2a7e162ad1642201",
"size": "6940",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ab530bb/html/classv8_1_1_string_1_1_ascii_value.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package build
import (
"github.com/anywhy/medis/pkg/core/instance"
"github.com/anywhy/medis/pkg/core/state"
)
type Service interface {
BuildApp(app state.AppDefinition) *instance.Instance
}
| {
"content_hash": "fba2f2c34ea63c770162f6af17e6cfba",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 53,
"avg_line_length": 19.5,
"alnum_prop": 0.7692307692307693,
"repo_name": "anywhy/medis",
"id": "271120d29da1a2c8b4359d348efeb7cd5dd1fd8e",
"size": "195",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pkg/core/build/service.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "50145"
}
],
"symlink_target": ""
} |
package com.swfarm.biz.chain.web;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import com.swfarm.biz.chain.srv.CombineApvsStrategy;
import com.swfarm.biz.chain.srv.DefaultCombineApvsMtStrategy;
import com.swfarm.biz.warehouse.dto.SearchAllocationProductVouchersCriteria;
import com.swfarm.pub.framework.Env;
import com.swfarm.pub.utils.SpringUtils;
public class CombineApvsUseStrategyController extends AbstractController {
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest req, HttpServletResponse res) throws Exception {
String generateSsCount = req.getParameter("generateSsCount");
String generateSmCount = req.getParameter("generateSmCount");
String generateMmCount = req.getParameter("generateMmCount");
String[] saleChannels = req.getParameterValues("saleChannels");
String[] shippingForwarderMethodStrs = req.getParameterValues("shippingForwarderMethods");
String warehouseCode = req.getParameter("warehouseCode");
String stockZoneCode = req.getParameter("stockZoneCode");
String isAutoAllocated = req.getParameter("isAutoAllocated");
SearchAllocationProductVouchersCriteria criteria = new SearchAllocationProductVouchersCriteria();
if (StringUtils.isNotEmpty(generateSsCount)) {
criteria.setGenerateSsCount(generateSsCount);
}
if (StringUtils.isNotEmpty(generateSmCount)) {
criteria.setGenerateSmCount(generateSmCount);
}
if (StringUtils.isNotEmpty(generateMmCount)) {
criteria.setGenerateMmCount(generateMmCount);
}
if (!ArrayUtils.isEmpty(saleChannels)) {
criteria.setSaleChannels(saleChannels);
}
if (!ArrayUtils.isEmpty(shippingForwarderMethodStrs)) {
List<String> shippingForwarderMethods = new ArrayList<String>();
CollectionUtils.addAll(shippingForwarderMethods, shippingForwarderMethodStrs);
criteria.setShippingForwarderMethods(shippingForwarderMethods);
}
if (StringUtils.isNotEmpty(warehouseCode)) {
criteria.setWarehouseCode(warehouseCode);
}
if (StringUtils.isNotEmpty(stockZoneCode)) {
criteria.setStockZoneCode(stockZoneCode);
}
if ("yes".equals(isAutoAllocated) || "true".equals(isAutoAllocated)) {
criteria.setIsAutoAllocated(true);
} else if ("no".equals(isAutoAllocated) || "false".equals(isAutoAllocated)) {
criteria.setIsAutoAllocated(false);
} else if ("all".equals(isAutoAllocated)) {
criteria.setIsAutoAllocated(null);
} else {
criteria.setIsAutoAllocated(true);
}
CombineApvsStrategy combineApvsStrategy = (CombineApvsStrategy) SpringUtils
.getBean("defaultCombineApvsStrategy");
if ("bright".equalsIgnoreCase(Env.COMPANY_CODE)) {
combineApvsStrategy = (CombineApvsStrategy) SpringUtils.getBean("brightCombineApvsStrategy");
} else if ("accecity".equalsIgnoreCase(Env.COMPANY_CODE)) {
combineApvsStrategy = new DefaultCombineApvsMtStrategy();
}
if (combineApvsStrategy != null) {
combineApvsStrategy.combineApvs(criteria, Integer.parseInt(generateSsCount),
Integer.parseInt(generateSmCount), Integer.parseInt(generateMmCount));
} else {
combineApvsStrategy = new DefaultCombineApvsMtStrategy();
combineApvsStrategy.combineApvs(criteria, Integer.parseInt(generateSsCount),
Integer.parseInt(generateSmCount), Integer.parseInt(generateMmCount));
}
return new ModelAndView("redirect:/warehouse/search_allocationproductvouchers.shtml");
}
}
| {
"content_hash": "42d68a961af1edd87673bb7454635569",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 113,
"avg_line_length": 45.04761904761905,
"alnum_prop": 0.7814482029598309,
"repo_name": "zhangqiang110/my4j",
"id": "b6b5db55e15a2958885252592e8ed977f09abdf8",
"size": "3784",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pms/src/main/java/com/swfarm/biz/chain/web/CombineApvsUseStrategyController.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "41428"
}
],
"symlink_target": ""
} |
package com.nh.cache.db;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.nh.cache.base.NhCacheConst;
import com.nh.cache.base.NhCacheObject;
import org.springframework.jdbc.core.JdbcTemplate;
/**
*
* @author ninghao
*
*/
public class LoadCacheUtil4Db {
public static JdbcTemplate jdbcTemplate=null;
public static JdbcTemplate getJdbcTemplate() {
return jdbcTemplate;
}
public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
LoadCacheUtil4Db.jdbcTemplate = jdbcTemplate;
}
public static Map<String,CacheSqlHolder> sqlHolderMap=new HashMap<String,CacheSqlHolder>();
public static Map<String,CacheSqlHolder> getSqlHolderMap() {
return sqlHolderMap;
}
public void setSqlHolderMap(Map<String,CacheSqlHolder> sqlHolderMap) {
LoadCacheUtil4Db.sqlHolderMap = sqlHolderMap;
}
public void setSqlHolder4List(List<CacheSqlHolder> sqlHolderList){
for(CacheSqlHolder cacheSqlHolder:sqlHolderList){
String tableName=cacheSqlHolder.getTableName();
sqlHolderMap.put(tableName, cacheSqlHolder);
}
}
public static NhCacheObject queryCacheObject(String tableName,String key,String realKey){
if(realKey==null || "".equals(realKey)){
realKey=key;
}
CacheSqlHolder cacheSqlHolder=sqlHolderMap.get(tableName);
String queryCacheObjectSql=cacheSqlHolder.getQueryCacheObjectSql();
Object[] params=new Object[]{realKey};
Map<String,Object> cacheMap= jdbcTemplate.queryForMap(queryCacheObjectSql,params);
String nhCacheVersion=(String) cacheMap.get(NhCacheConst.CACHE_VERSION);
NhCacheObject nhCacheObject=new NhCacheObject();
nhCacheObject.setCacheVersion(nhCacheVersion);
nhCacheObject.setCacheKey(key);
nhCacheObject.cacheMap=cacheMap;
String nhCacheType=(String) cacheMap.get(NhCacheConst.CACHE_TYPE);
nhCacheObject.setCacheType(nhCacheType);
String nhCacheData=(String) cacheMap.get(NhCacheConst.CACHE_DATA);
nhCacheObject.setCacheData(nhCacheData);
nhCacheObject.setCacheSource("db");
return nhCacheObject;
}
public static Set<String> listCacheKeys(String tableName,String prefix){
if(prefix==null){
prefix="";
}
String findKey=null;
CacheSqlHolder cacheSqlHolder=sqlHolderMap.get(tableName);
String listCacheKeysSql=cacheSqlHolder.getListCacheKeysSql();
Object[] params=null;
if(prefix==null && !"".equals(prefix)){
params=new Object[]{prefix};
}
List<Map<String,Object>> retList= new ArrayList();
if(params!=null){
retList=jdbcTemplate.queryForList(listCacheKeysSql,params);
}else{
retList=jdbcTemplate.queryForList(listCacheKeysSql);
}
Set<String> keys=new HashSet<String>();
for(Map<String,Object> rowMap:retList){
String keyName=(String) rowMap.get("key_name");
keys.add(keyName);
}
return keys;
}
public int checkCacheVersion(String tableName,String key,String version){
if(version==null){
version="";
}
String realKey=key;
NhCacheObject nObj=queryCacheObject(tableName,realKey, realKey);
if(nObj==null){
return -2;
}
String remoteVersion=nObj.getCacheVersion();
if(remoteVersion==null || remoteVersion.equals("")){
return -1;
}
if(version.equals(remoteVersion)){
return 0;
}
return 1;
}
}
| {
"content_hash": "4898e9db52e0b4365a5e769e54c76b67",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 92,
"avg_line_length": 28.58823529411765,
"alnum_prop": 0.7313345091122869,
"repo_name": "jeffreyning/nhcache",
"id": "7838f758352f580e826469438d4eb0b56a7bc92b",
"size": "3402",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "nhcache-db/src/main/java/com/nh/cache/db/LoadCacheUtil4Db.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#pragma once
#include "Defines.h"
#include <stdint.h>
#include <limits>
#include <vector>
#include <map>
// TODO: Reevaluate variable types and names; redesign some to make the code more consistent and reduce problems
using ItemC = uint32_t;
using Support = uint32_t;
using ItemID = uint64_t;
using Transaction = std::vector<ItemC>;
using Transactions = std::vector<Transaction>;
using FrequencyMap = std::map<ItemC, Support>;
const std::size_t IDX_MAX = std::numeric_limits<std::size_t>::max();
const Support SUPP_MAX = std::numeric_limits<Support>::max();
const ItemC ITEM_MAX = std::numeric_limits<ItemC>::max();
const ItemID ITEM_ID_MAX = std::numeric_limits<ItemID>::max();
using ItemOccurence = std::pair<ItemC, Support>;
using ItemOccurences = std::vector<ItemOccurence>;
using PatternType = ItemID;
using PatternVec = std::vector<PatternType>;
using PatternPair = std::pair<PatternVec, Support>;
| {
"content_hash": "3654f121a542fd19519d24b82bc9c33f",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 112,
"avg_line_length": 27.727272727272727,
"alnum_prop": 0.7366120218579235,
"repo_name": "mdenker/elephant",
"id": "0f28920d42a7a657e929059337f70be65d174c70",
"size": "2102",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "elephant/spade_src/include/Types.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "11359"
},
{
"name": "C++",
"bytes": "92294"
},
{
"name": "Cuda",
"bytes": "21912"
},
{
"name": "Python",
"bytes": "1712932"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "5dd45323c227db4eaf484095f3e7a95e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "bb4a7fd73a929d26ce989d4dad0a755cfcf1c657",
"size": "183",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Solanales/Solanaceae/Solanum/Solanum parvifolium/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.