answer stringlengths 15 1.25M |
|---|
<div class="reviews__body">
@if(!empty($review->json-><API key>) || !empty($review->json-><API key>))
<div class="reviews__body__one">
@if(!empty($review->json-><API key>))
<p><em>Чи правильно замовник визначив код товару/товарів, що закуповуються?</em></p>
@endif
@if(!empty($review->json-><API key>))
<span class="{{ $review->json-><API key> }}">
{{ $review->json-><API key>=='yes'?'ТАК':'НІ' }}
</span>
@endif
@if(!empty($review->json-><API key>))
<p>{!! nl2br(trim(strip_tags($review->json-><API key>))) !!}</p>
@endif
</div>
@endif
</div> |
# imports-first
By popular demand, this rule reports any imports that come after non-import
statments.
## Rule Details
js
import foo from './foo'
// some module-level initializer
initWith(foo)
import bar from './bar' // <- reported
Providing `absolute-first` as an option will report any absolute imports (i.e.
packages) that come after any relative imports:
js
import foo from 'foo'
import bar from './bar'
import * as _ from 'lodash' // <- reported
TODO: add explanation of imported name hoisting
## When Not To Use It
If you don't mind imports being sprinkled throughout, you may not want to
enable this rule. |
<?php
error_reporting(0);
?>
<div id="sidebar"> <a href="#" class="visible-phone"><i class="icon icon-home"></i> Dashboard</a>
<ul>
<li class="submenu"> <a href=""><i class="icon icon-truck"></i> <span>Infrastructure Delivery</span> <span class="label label-important">2</span></a>
<ul>
<li><a href="<?= base_url('index.php/Revenue/migrasi')?>">Form Migration</a></li>
<li><a href="<?= base_url('index.php/Revenue/data_migrasi')?>">Data Migration</a></li>
</ul>
</li>
<li class="submenu"> <a href=""><i class="icon icon-wrench"></i> <span>Assurance</span> <span class="label label-important">2</span></a>
<ul>
<li class="active"><a href="<?= base_url('index.php/Revenue/form_ass')?>">Form Assurance</a></li>
<li><a href="<?= base_url('index.php/Revenue/data_ass')?>">Data Assurance</a></li>
</ul>
</li>
<li class="submenu"> <a href=""><i class="icon icon-bandcamp"></i> <span>Provisioning Indihome</span> <span class="label label-important">2</span></a>
<ul>
<li><a href="<?= base_url('index.php/Revenue/form_psb')?>">Form Provisioning</a></li>
<li><a href="<?= base_url('index.php/Revenue/data_psb')?>">Data Provisioning</a></li>
</ul>
</li>
<li class="submenu"> <a href=""><i class="icon icon-cog"></i> <span>Maintenance Infra Sup</span> <span class="label label-important">2</span></a>
<ul>
<li><a href="<?= base_url('index.php/Revenue/mainis')?>">Form</a></li>
<li><a href="<?= base_url('index.php/Revenue/data_mainis')?>">Data</a></li>
</ul>
</li>
<li class="submenu"> <a href=""><i class="icon icon-bandcamp"></i> <span>Infrastructure Service</span> <span class="label label-important">4</span></a>
<ul>
<li><a href="<?= base_url('index.php/Revenue/form_main_access')?>">Form Maintenance Access</a></li>
<li><a href="<?= base_url('index.php/Revenue/data_main_access')?>">Data Maintenance Access</a></li>
<li><a href="<?= base_url('index.php/Revenue/form_gamas')?>">Form Gamas & QE</a></li>
<li><a href="<?= base_url('index.php/Revenue/data_gamas')?>">Data Gamas & QE</a></li>
</ul>
</li>
<li class="submenu"> <a href="<?= base_url('index.php/Revenue/service')?>"><i class="icon icon-briefcase"></i> <span>Service Delivery</span> <span class="label label-important">5</span></a>
<ul>
<li><a href="<?= base_url('index.php/Revenue/pt3')?>"> Prog Optimization PT3</a></li>
<li><a href="<?= base_url('index.php/Revenue/nodeb')?>"> NODE B</a></li>
<li><a href="<?= base_url('index.php/Revenue/hem')?>"> HEM</a></li>
<li><a href="<?= base_url('index.php/Revenue/pt2')?>"> Prog Optimization PT2</a></li>
<li><a href="<?= base_url('index.php/Revenue/data_sd')?>"> Data Service Delivery</a></li>
</ul>
</li>
<li class=""><a title="" href="<?= base_url('index.php/searchba')?>"><i class="icon icon-search"></i> <span class="text">Cari Berita Acara</span></a></li>
<li class=""><a title="" href="<?= base_url('index.php/searchba/cari_data')?>"><i class="icon icon-search"></i> <span class="text">Cari Berdasarkan Tanggal</span></a></li>
</ul>
</div>
<div id="content">
<div id="content-header">
<div id="breadcrumb"></div>
<h1>Form Update Target Revenue Maintenance Access</h1>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<h4>Target Revenue Maintenance Access IDR <b><?= $rev;?></b> M</h4>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<form action="<?php echo base_url()."index.php/revtarget/tambah_target_dma";?>" method="post">
<div class="widget-box">
<div class="widget-title">
<h5>Input Data Revenue</h5>
</div>
<div class="widget-content">
<div class="control-group">
<label class="control-label">Target Revenue :</label>
<div class="controls">
<input type="text" class="span11" placeholder="Ketikkan jumlah target revenue assurance dalam satuan juta" name="target" required/>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-success">Update</button>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="row-fluid">
<div class="span12">
</div>
</div>
</div>
</div></div>
</body>
</html> |
<API key>(VERSION 2.8)
# .deb packaging
set(ARCH "i686")
if(${CMAKE_SIZEOF_VOID_P} MATCHES 8)
set(ARCH "x86_64")
endif ()
set(<API key> 20)
# The format of the description field is a short summary line followed by a
# longer paragraph indented by a single space on each line
set(<API key> "Tool for extracting splitter or
discordant reads from a BAM or CRAM file.")
set(CPACK_PACKAGE_NAME "extract-sv-reads${EXE_VERSION_SUFFIX}")
set(<API key> "wugc")
set(<API key> ${FULL_VERSION})
set(<API key> "Dave Larson <delarson@wustl.edu>")
set(CPACK_SYSTEM_NAME "Linux-${ARCH}")
set(CPACK_TOPLEVEL_TAG "Linux-${ARCH}")
set(<API key> "extract-sv-reads")
set(<API key> science)
set(<API key> optional)
#set(<API key> "libbz2-1.0 (>= 1.0.5-4ubuntu0.1), libc6 (>= 2.11.1-0ubuntu7.8), libgcc1 (>= 1:4.4.3-4ubuntu5), libstdc++6 (>= 4.4.3-4ubuntu5), zlib1g (>= 1:1.2.3.3.dfsg-15ubuntu1)")
if (CMAKE_BUILD_TYPE MATCHES package)
set(CPACK_GENERATOR "DEB")
else(CMAKE_BUILD_TYPE MATCHES package)
set(CPACK_GENERATOR "TGZ")
endif(CMAKE_BUILD_TYPE MATCHES package)
configure_file(debian/postinst.in debian/postinst @ONLY)
configure_file(debian/prerm.in debian/prerm @ONLY)
set(<API key> "debian/postinst;debian/prerm")
include(CPack) |
#pragma once
#if defined(PGA_D3D)
#include "D3DColorShader.h"
namespace PGA
{
namespace Rendering
{
using PGA::Rendering::D3D::ColorShader;
}
}
#else
#include "GLColorShader.h"
namespace PGA
{
namespace Rendering
{
using PGA::Rendering::GL::ColorShader;
}
}
#endif |
module Bugsnag::Middleware
# Extracts and attaches rails and rack environment data to an error report
class Rails3Request
SPOOF = "[SPOOF]".freeze
def initialize(bugsnag)
@bugsnag = bugsnag
end
def call(report)
if report.request_data[:rack_env]
env = report.request_data[:rack_env]
params = env["action_dispatch.request.parameters"]
client_ip = env["action_dispatch.remote_ip"].to_s rescue SPOOF
if params
# Set the automatic context
report.automatic_context = "#{params[:controller]}##{params[:action]}"
# Augment the request tab
report.add_tab(:request, {
:railsAction => "#{params[:controller]}##{params[:action]}",
:params => params
})
end
# Use action_dispatch.remote_ip for IP address fields and send request id
report.add_tab(:request, {
:clientIp => client_ip,
:requestId => env["action_dispatch.request_id"]
})
report.user["id"] = client_ip
end
@bugsnag.call(report)
end
end
end |
// <API key>.h
// Mobile Clinic
#import <UIKit/UIKit.h>
#import "<API key>.h"
#import "GenericCellProtocol.h"
#import "CancelDelegate.h"
//#import "<API key>.h"
@protocol <API key> <NSObject>
-(void)addPrescription:(NSMutableDictionary*)prescription;
@end
@interface <API key> : UIViewController <<API key>, UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITextField *medicineField;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property(nonatomic, weak) id<<API key>> delegate;
@property (nonatomic, strong) NSMutableDictionary *prescriptionData;
@property (weak, nonatomic) IBOutlet UITextField *drugName;
@property (weak, nonatomic) IBOutlet UITextField *duration;
@property (weak, nonatomic) IBOutlet UITextField *timeOfDay;
@property (weak, nonatomic) IBOutlet UIStepper *durationIncrementer;
@property (weak, nonatomic) IBOutlet UITextField *dosage;
- (IBAction)AddTimeOfDay:(id)sender;
-(void)resetView;
- (IBAction)<API key>:(id)sender;
- (IBAction)<API key>:(id)sender;
- (IBAction)searchMedicine:(id)sender;
@end |
#include "../../source/thewizardplusplus/wizard_parser/parser/rule_parser.hpp"
#include "../../source/thewizardplusplus/wizard_parser/parser/lookahead_parser.hpp"
#include "../../source/thewizardplusplus/wizard_parser/lexer/token.hpp"
#include "../../source/thewizardplusplus/wizard_parser/parser/ast_node.hpp"
#include "../../source/thewizardplusplus/wizard_parser/utilities/utilities.hpp"
#include "../vendor/catch/catch.hpp"
#include "../vendor/fakeit/fakeit.hpp"
TEST_CASE("parser::lookahead_parser class", "[parser]") {
using namespace thewizardplusplus::wizard_parser;
using namespace thewizardplusplus::wizard_parser::parser::operators;
SECTION("positive lookahead without tokens") {
auto mock_parser = fakeit::Mock<parser::rule_parser>{};
fakeit::When(Method(mock_parser, parse))
.Return(parser::parsing_result{});
fakeit::Fake(Dtor(mock_parser));
const auto lookahead_parser =
&parser::rule_parser::pointer{&mock_parser.get()};
const auto [ast, rest_tokens] = lookahead_parser->parse({});
CHECK(!ast.has_value());
CHECK(rest_tokens.empty());
fakeit::Verify(Method(mock_parser, parse)).Once();
fakeit::<API key>(mock_parser);
}
SECTION("positive lookahead without a match") {
auto tokens = lexer::token_group{{"one", "two", 1}, {"three", "four", 4}};
auto mock_parser = fakeit::Mock<parser::rule_parser>{};
fakeit::When(Method(mock_parser, parse))
.Return(parser::parsing_result{{}, lexer::token_span{tokens}.subspan(1)});
fakeit::Fake(Dtor(mock_parser));
const auto lookahead_parser =
&parser::rule_parser::pointer{&mock_parser.get()};
const auto [ast, rest_tokens] = lookahead_parser->parse(tokens);
CHECK(!ast.has_value());
CHECK(rest_tokens == lexer::token_span{tokens}.subspan(1));
fakeit::Verify(Method(mock_parser, parse)).Once();
fakeit::<API key>(mock_parser);
}
SECTION("positive lookahead with a match") {
const auto type = (+parser::ast_node_type::nothing)._to_string();
auto tokens = lexer::token_group{{"one", "two", 1}, {"three", "four", 4}};
auto mock_parser = fakeit::Mock<parser::rule_parser>{};
fakeit::When(Method(mock_parser, parse))
.Return(parser::parsing_result{
parser::ast_node{"one", "two", {}, 1},
lexer::token_span{tokens}.subspan(1)
});
fakeit::Fake(Dtor(mock_parser));
const auto lookahead_parser =
&parser::rule_parser::pointer{&mock_parser.get()};
const auto [ast, rest_tokens] = lookahead_parser->parse(tokens);
REQUIRE(ast.has_value());
CHECK(*ast == parser::ast_node{type, {}, {}, 1});
CHECK(rest_tokens == lexer::token_span{tokens}.subspan(1));
fakeit::Verify(Method(mock_parser, parse)).Once();
fakeit::<API key>(mock_parser);
}
SECTION("negative lookahead without tokens") {
const auto type = (+parser::ast_node_type::nothing)._to_string();
auto mock_parser = fakeit::Mock<parser::rule_parser>{};
fakeit::When(Method(mock_parser, parse))
.Return(parser::parsing_result{});
fakeit::Fake(Dtor(mock_parser));
const auto lookahead_parser =
!parser::rule_parser::pointer{&mock_parser.get()};
const auto [ast, rest_tokens] = lookahead_parser->parse({});
REQUIRE(ast.has_value());
CHECK(*ast == parser::ast_node{type, {}, {}, utilities::integral_infinity});
CHECK(rest_tokens.empty());
fakeit::Verify(Method(mock_parser, parse)).Once();
fakeit::<API key>(mock_parser);
}
SECTION("negative lookahead without a match") {
const auto type = (+parser::ast_node_type::nothing)._to_string();
auto tokens = lexer::token_group{{"one", "two", 1}, {"three", "four", 4}};
auto mock_parser = fakeit::Mock<parser::rule_parser>{};
fakeit::When(Method(mock_parser, parse))
.Return(parser::parsing_result{{}, lexer::token_span{tokens}.subspan(1)});
fakeit::Fake(Dtor(mock_parser));
const auto lookahead_parser =
!parser::rule_parser::pointer{&mock_parser.get()};
const auto [ast, rest_tokens] = lookahead_parser->parse(tokens);
REQUIRE(ast.has_value());
CHECK(*ast == parser::ast_node{type, {}, {}, 1});
CHECK(rest_tokens == lexer::token_span{tokens});
fakeit::Verify(Method(mock_parser, parse)).Once();
fakeit::<API key>(mock_parser);
}
SECTION("negative lookahead with a match") {
auto tokens = lexer::token_group{{"one", "two", 1}, {"three", "four", 4}};
auto mock_parser = fakeit::Mock<parser::rule_parser>{};
fakeit::When(Method(mock_parser, parse))
.Return(parser::parsing_result{
parser::ast_node{"one", "two", {}, 1},
lexer::token_span{tokens}.subspan(1)
});
fakeit::Fake(Dtor(mock_parser));
const auto lookahead_parser =
!parser::rule_parser::pointer{&mock_parser.get()};
const auto [ast, rest_tokens] = lookahead_parser->parse(tokens);
CHECK(!ast.has_value());
CHECK(rest_tokens == lexer::token_span{tokens});
fakeit::Verify(Method(mock_parser, parse)).Once();
fakeit::<API key>(mock_parser);
}
} |
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Pagina2Page } from '../pagina2/pagina2';
import { Pagina3Page}from '../pagina3/pagina3';
import { Pagina4Page}from '../pagina4/pagina4';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController) {
}
login(){
//this.navCtrl.push(Pagina4Page);
}
} |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
$(function(){
//if they scroll past the first page we show the side navigation
$(window).scroll(function(){
//console.log($(window).scrollTop());
if($(window).scrollTop() > $(window).height()){
$('.sidenav').show();
}else{
$('.sidenav').hide();
}
});
}); |
import React, { Component, PropTypes } from 'react';
import PatientForm from '../PatientForm';
export default class PatientInput extends Component {
static propTypes = {
patient: PropTypes.object.isRequired,
diaperTypes: PropTypes.array.isRequired,
onSubmit: PropTypes.func.isRequired,
onReset: PropTypes.func.isRequired,
onTemporarySave: PropTypes.func.isRequired,
onAddFields: PropTypes.func.isRequired,
onRemoveFields: PropTypes.func.isRequired,
}
constructor(props) {
super(props);
}
<API key>(patient) {
const { firstName, lastName, diapers } = patient;
const res = {
firstName,
lastName,
(Object.assign({}, ...diapers.map((diaper, index) => {
return {
[`diapers.${index}.type`]: diaper.type,
[`diapers.${index}.amount`]: diaper.amount,
};
}))),
};
return res;
}
<API key>(form) {
const { patient: { id } } = this.props;
const { firstName, lastName, ...splitedDiapers } = form;
const diaperKeys = Object.keys(splitedDiapers);
const diapers = [];
for (let i = 0, ii = diaperKeys.length; i < ii; i += 2) {
diapers.push({
type: splitedDiapers[diaperKeys[i]],
amount: splitedDiapers[diaperKeys[i + 1]],
});
}
return {
id,
firstName,
lastName,
diapers,
};
}
render() {
const { patient, diaperTypes, onSubmit, onReset, onAddFields, onRemoveFields, onTemporarySave } = this.props;
const initialValues = this.<API key>(patient);
return (
<PatientForm
fields={Object.keys(initialValues)}
initialValues={initialValues}
diaperTypes={diaperTypes}
onReset={onReset}
onSubmit={
(e) => {
onSubmit(this.<API key>(e));
}
}
onTemporarySave={
(e) => {
onTemporarySave(this.<API key>(e));
}
}
onAddFields={onAddFields}
onRemoveFields={onRemoveFields}/>
);
}
} |
<!DOCTYPE html>
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Welcome to picture_gallery</title>
</head>
<body>
<div id="navbar"></div>
<div id="app">
<div class="container-fluid">
<div class="card-deck">
<div class="card-block">
<h4>Welcome to picture_gallery</h4>
<p>If you're seeing this message, that means you haven't yet compiled your ClojureScript!</p>
<p>Please run <code>lein figwheel</code> to start the ClojureScript compiler and reload the page.</p>
<h4>For better ClojureScript development experience in Chrome follow these steps:</h4>
<ul>
<li>Open DevTools
<li>Go to Settings ("three dots" icon in the upper right corner of DevTools > Menu > Settings F1 > General > Console)
<li>Check-in "Enable custom formatters"
<li>Close DevTools
<li>Open DevTools
</ul>
<p>See <a href="http:
</div>
</div>
</div>
</div>
<!-- scripts and styles -->
{% style "/assets/bootstrap/css/bootstrap.min.css" %}
{% style "/assets/font-awesome/css/font-awesome.min.css" %}
{% style "/css/screen.css" %}
<script type="text/javascript">
var context = "{{servlet-context}}";
var csrfToken = "{{csrf-token}}";
</script>
{% script "/js/app.js" %}
</body>
</html> |
<html>
<head>
</head>
<body>
<h2>
Of The Interpreter Of The Scriptures Before Civill Soveraigns
</h2>
St.
<span class="latin">
Paul
</span>
coming
<span class="oldenglish">
to
</span>
Thessalonica,
<span class="oldenglish">
where
</span>
<span class="oldenglish">
was
</span>
a
<span class="oldfrench">
Synagogue
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
Jews, (Acts 17.2, 3.) "As
<span class="oldenglish">
his
</span>
<span class="oldfrench">
manner
</span>
was, went
<span class="oldenglish">
in
</span>
<span class="oldenglish">
unto
</span>
them,
<span class="oldenglish">
and
</span>
<span class="oldenglish">
three
</span>
<span class="oldenglish">
Sabbath
</span>
<span class="oldenglish">
dayes
</span>
<span class="oldfrench">
reasoned
</span>
<span class="oldenglish">
with
</span>
<span class="oldnorse">
them
</span>
<span class="oldenglish">
out
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
Scriptures,
<span class="oldenglish">
Opening
</span>
<span class="oldenglish">
and
</span>
alledging,
<span class="oldenglish">
that
</span>
<span class="oldenglish">
Christ
</span>
<span class="oldenglish">
must
</span>
<span class="oldenglish">
needs
</span>
<span class="oldenglish">
have
</span>
<span class="oldfrench">
suffered
</span>
<span class="oldenglish">
and
</span>
<span class="oldenglish">
risen
</span>
<span class="oldenglish">
again
</span>
<span class="oldenglish">
from
</span>
<span class="oldenglish">
the
</span>
dead;
<span class="oldenglish">
and
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
this
</span>
<span class="oldenglish">
Jesus
</span>
<span class="oldenglish">
whom
</span>
<span class="oldenglish">
he
</span>
<span class="oldenglish">
preached
</span>
<span class="oldenglish">
was
</span>
<span class="oldenglish">
the
</span>
Christ."
<span class="oldenglish">
The
</span>
<span class="latin">
Scriptures
</span>
<span class="oldenglish">
here
</span>
<span class="oldfrench">
mentioned
</span>
<span class="oldenglish">
were
</span>
<span class="oldenglish">
the
</span>
<span class="latin">
Scriptures
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
Jews,
<span class="oldenglish">
that
</span>
is,
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Old
</span>
Testament.
<span class="oldenglish">
The
</span>
men,
<span class="oldenglish">
to
</span>
<span class="oldenglish">
whom
</span>
<span class="oldenglish">
he
</span>
<span class="oldenglish">
was
</span>
<span class="oldenglish">
to
</span>
<span class="oldfrench">
prove
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
Jesus
</span>
<span class="oldenglish">
was
</span>
<span class="oldenglish">
the
</span>
Christ,
<span class="oldenglish">
and
</span>
<span class="oldenglish">
risen
</span>
<span class="oldenglish">
again
</span>
<span class="oldenglish">
from
</span>
<span class="oldenglish">
the
</span>
dead,
<span class="oldenglish">
were
</span>
<span class="oldenglish">
also
</span>
Jews,
<span class="oldenglish">
and
</span>
<span class="oldenglish">
did
</span>
beleeve already,
<span class="oldenglish">
that
</span>
<span class="oldnorse">
they
</span>
<span class="oldenglish">
were
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Word
</span>
<span class="oldenglish">
of
</span>
God.
<span class="oldenglish">
Hereupon
</span>
(as
<span class="oldenglish">
it
</span>
<span class="oldenglish">
is
</span>
<span class="oldenglish">
verse
</span>
4.)
<span class="oldenglish">
some
</span>
<span class="oldenglish">
of
</span>
<span class="oldnorse">
them
</span>
beleeved,
<span class="oldenglish">
and
</span>
(as
<span class="oldenglish">
it
</span>
<span class="oldenglish">
is
</span>
<span class="oldenglish">
in
</span>
<span class="oldenglish">
the
</span>
5. ver.)
<span class="oldenglish">
some
</span>
beleeved not.
<span class="oldenglish">
What
</span>
<span class="oldenglish">
was
</span>
<span class="oldenglish">
the
</span>
reason,
<span class="oldenglish">
when
</span>
<span class="oldnorse">
they
</span>
<span class="oldenglish">
all
</span>
beleeved
<span class="oldenglish">
the
</span>
Scripture,
<span class="oldenglish">
that
</span>
<span class="oldnorse">
they
</span>
<span class="oldenglish">
did
</span>
<span class="english">
not
</span>
<span class="oldenglish">
all
</span>
beleeve alike;
<span class="oldenglish">
but
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
some
</span>
approved,
<span class="oldenglish">
others
</span>
disapproved
<span class="oldenglish">
the
</span>
<span class="oldfrench">
Interpretation
</span>
<span class="oldenglish">
of
</span>
St.
<span class="latin">
Paul
</span>
<span class="oldenglish">
that
</span>
<span class="oldfrench">
cited
</span>
them;
<span class="oldenglish">
and
</span>
<span class="oldenglish">
every
</span>
<span class="oldenglish">
one
</span>
<span class="oldfrench">
Interpreted
</span>
<span class="oldnorse">
them
</span>
<span class="oldenglish">
to
</span>
himself?
<span class="oldenglish">
It
</span>
<span class="oldenglish">
was
</span>
this; S.
<span class="latin">
Paul
</span>
came
<span class="oldenglish">
to
</span>
<span class="oldnorse">
them
</span>
<span class="oldenglish">
without
</span>
<span class="oldenglish">
any
</span>
Legall Commission,
<span class="oldenglish">
and
</span>
<span class="oldenglish">
in
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
manner
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
one
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
would
</span>
<span class="english">
not
</span>
Command,
<span class="oldenglish">
but
</span>
Perswade;
<span class="oldenglish">
which
</span>
<span class="oldenglish">
he
</span>
<span class="oldenglish">
must
</span>
<span class="oldenglish">
needs
</span>
do,
<span class="oldenglish">
either
</span>
<span class="oldenglish">
by
</span>
Miracles,
<span class="oldenglish">
as
</span>
<span class="latin">
Moses
</span>
<span class="oldenglish">
did
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
the
</span>
<span class="latin">
Israelites
</span>
<span class="oldenglish">
in
</span>
Egypt,
<span class="oldenglish">
that
</span>
<span class="oldnorse">
they
</span>
<span class="oldenglish">
might
</span>
<span class="oldenglish">
see
</span>
<span class="oldenglish">
his
</span>
<span class="oldfrench">
Authority
</span>
<span class="oldenglish">
in
</span>
<span class="oldenglish">
Gods
</span>
works;
<span class="oldenglish">
or
</span>
<span class="oldenglish">
by
</span>
Reasoning
<span class="oldenglish">
from
</span>
<span class="oldenglish">
the
</span>
<span class="german">
already
</span>
received Scripture,
<span class="oldenglish">
that
</span>
<span class="oldnorse">
they
</span>
<span class="oldenglish">
might
</span>
<span class="oldenglish">
see
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
truth
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
his
</span>
<span class="oldfrench">
doctrine
</span>
<span class="oldenglish">
in
</span>
<span class="oldenglish">
Gods
</span>
Word.
<span class="oldenglish">
But
</span>
whosoever perswadeth
<span class="oldenglish">
by
</span>
reasoning
<span class="oldenglish">
from
</span>
<span class="oldfrench">
principles
</span>
written, maketh
<span class="oldenglish">
him
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
whom
</span>
hee speaketh Judge,
<span class="oldenglish">
both
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
meaning
<span class="oldenglish">
of
</span>
<span class="oldenglish">
those
</span>
principles,
<span class="oldenglish">
and
</span>
<span class="oldenglish">
also
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
force
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
his
</span>
<span class="latin">
inferences
</span>
<span class="oldenglish">
upon
</span>
them.
<span class="oldenglish">
If
</span>
<span class="oldenglish">
these
</span>
<span class="oldfrench">
Jews
</span>
<span class="oldenglish">
of
</span>
Thessalonica
<span class="oldenglish">
were
</span>
not,
<span class="oldenglish">
who
</span>
<span class="oldenglish">
else
</span>
<span class="oldenglish">
was
</span>
<span class="oldenglish">
the
</span>
<span class="latin">
Judge
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
what
</span>
S.
<span class="latin">
Paul
</span>
alledged
<span class="oldenglish">
out
</span>
<span class="oldenglish">
of
</span>
Scripture?
<span class="oldenglish">
If
</span>
S. Paul,
<span class="oldenglish">
what
</span>
<span class="oldenglish">
needed
</span>
<span class="oldenglish">
he
</span>
<span class="oldenglish">
to
</span>
quote
<span class="oldenglish">
any
</span>
<span class="french">
places
</span>
<span class="oldenglish">
to
</span>
<span class="oldfrench">
prove
</span>
<span class="oldenglish">
his
</span>
doctrine?
<span class="oldenglish">
It
</span>
had been
<span class="oldenglish">
enough
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
have
</span>
said, I find
<span class="oldenglish">
it
</span>
<span class="oldenglish">
so
</span>
<span class="oldenglish">
in
</span>
Scripture,
<span class="oldenglish">
that
</span>
<span class="oldenglish">
is
</span>
<span class="oldenglish">
to
</span>
say,
<span class="oldenglish">
in
</span>
<span class="oldenglish">
your
</span>
Laws,
<span class="oldenglish">
of
</span>
<span class="oldenglish">
which
</span>
I
<span class="oldenglish">
am
</span>
Interpreter,
<span class="oldenglish">
as
</span>
sent
<span class="oldenglish">
by
</span>
Christ.
<span class="oldenglish">
The
</span>
<span class="oldfrench">
Interpreter
</span>
<span class="oldenglish">
therefore
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
Scripture,
<span class="oldenglish">
to
</span>
<span class="oldenglish">
whose
</span>
<span class="oldfrench">
Interpretation
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
Jews
</span>
<span class="oldenglish">
of
</span>
Thessalonica
<span class="oldenglish">
were
</span>
bound
<span class="oldenglish">
to
</span>
stand,
<span class="oldenglish">
could
</span>
<span class="oldenglish">
be
</span>
none:
<span class="oldenglish">
every
</span>
<span class="oldenglish">
one
</span>
<span class="oldenglish">
might
</span>
beleeve,
<span class="oldenglish">
or
</span>
<span class="english">
not
</span>
beleeve, according
<span class="oldenglish">
as
</span>
<span class="oldenglish">
the
</span>
<span class="french">
Allegations
</span>
<span class="oldnorse">
seemed
</span>
<span class="oldenglish">
to
</span>
himselfe
<span class="oldenglish">
to
</span>
<span class="oldenglish">
be
</span>
agreeable,
<span class="oldenglish">
or
</span>
<span class="english">
not
</span>
<span class="oldfrench">
agreeable
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
the
</span>
meaning
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
<span class="french">
places
</span>
alledged.
<span class="oldenglish">
And
</span>
generally
<span class="oldenglish">
in
</span>
<span class="oldenglish">
all
</span>
<span class="americanenglish">
cases
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
world, hee
<span class="oldenglish">
that
</span>
pretendeth
<span class="oldenglish">
any
</span>
proofe, maketh
<span class="latin">
Judge
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
his
</span>
proofe
<span class="oldenglish">
him
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
whom
</span>
<span class="oldenglish">
he
</span>
addresseth
<span class="oldenglish">
his
</span>
speech.
<span class="oldenglish">
And
</span>
<span class="oldenglish">
as
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
the
</span>
<span class="americanenglish">
case
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
Jews
</span>
<span class="oldenglish">
in
</span>
particular,
<span class="oldnorse">
they
</span>
<span class="oldenglish">
were
</span>
bound
<span class="oldenglish">
by
</span>
expresse
<span class="oldenglish">
words
</span>
(Deut. 17.)
<span class="oldenglish">
to
</span>
<span class="oldfrench">
receive
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
determination
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
all
</span>
<span class="oldenglish">
hard
</span>
questions,
<span class="oldenglish">
from
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Priests
</span>
<span class="oldenglish">
and
</span>
<span class="latin">
Judges
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
Israel
</span>
<span class="oldenglish">
for
</span>
<span class="oldenglish">
the
</span>
time being.
<span class="oldenglish">
But
</span>
<span class="oldenglish">
this
</span>
<span class="oldenglish">
is
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
bee
</span>
understood
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
Jews
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
were
</span>
<span class="oldenglish">
yet
</span>
unconverted.
<span class="oldenglish">
For
</span>
<span class="oldenglish">
the
</span>
<span class="french">
Conversion
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
Gentiles,
<span class="oldenglish">
there
</span>
<span class="oldenglish">
was
</span>
<span class="oldenglish">
no
</span>
<span class="oldfrench">
use
</span>
<span class="oldenglish">
of
</span>
alledging
<span class="oldenglish">
the
</span>
Scriptures,
<span class="oldenglish">
which
</span>
<span class="oldnorse">
they
</span>
beleeved not.
<span class="oldenglish">
The
</span>
<span class="oldenglish">
Apostles
</span>
<span class="oldenglish">
therefore
</span>
<span class="english">
laboured
</span>
<span class="oldenglish">
by
</span>
<span class="oldfrench">
Reason
</span>
<span class="oldenglish">
to
</span>
<span class="french">
confute
</span>
<span class="oldnorse">
their
</span>
Idolatry;
<span class="oldenglish">
and
</span>
<span class="oldenglish">
that
</span>
done,
<span class="oldenglish">
to
</span>
perswade
<span class="oldnorse">
them
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
faith
</span>
<span class="oldenglish">
of
</span>
Christ,
<span class="oldenglish">
by
</span>
<span class="oldnorse">
their
</span>
<span class="oldfrench">
testimony
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
his
</span>
Life,
<span class="oldenglish">
and
</span>
Resurrection.
<span class="oldenglish">
So
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
there
</span>
<span class="oldenglish">
could
</span>
<span class="english">
not
</span>
<span class="oldenglish">
yet
</span>
<span class="oldenglish">
bee
</span>
<span class="oldenglish">
any
</span>
controversie concerning
<span class="oldenglish">
the
</span>
<span class="oldfrench">
authority
</span>
<span class="oldenglish">
to
</span>
<span class="oldfrench">
Interpret
</span>
Scripture;
<span class="americanenglish">
seeing
</span>
<span class="oldenglish">
no
</span>
<span class="oldenglish">
man
</span>
<span class="oldenglish">
was
</span>
obliged
<span class="oldfrench">
during
</span>
<span class="oldenglish">
his
</span>
infidelity,
<span class="oldenglish">
to
</span>
<span class="oldenglish">
follow
</span>
<span class="oldenglish">
any
</span>
<span class="oldenglish">
mans
</span>
<span class="oldfrench">
Interpretation
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
any
</span>
Scripture,
<span class="french">
except
</span>
<span class="oldenglish">
his
</span>
Soveraigns
<span class="oldfrench">
Interpretation
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Laws
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
his
</span>
countrey.
<span class="oldenglish">
Let
</span>
<span class="oldenglish">
us
</span>
<span class="oldenglish">
now
</span>
<span class="oldfrench">
consider
</span>
<span class="oldenglish">
the
</span>
<span class="french">
Conversion
</span>
<span class="oldenglish">
it
</span>
self,
<span class="oldenglish">
and
</span>
<span class="oldenglish">
see
</span>
<span class="oldenglish">
what
</span>
<span class="oldenglish">
there
</span>
<span class="oldenglish">
was
</span>
therein,
<span class="oldenglish">
that
</span>
<span class="oldenglish">
could
</span>
<span class="oldenglish">
be
</span>
<span class="oldfrench">
cause
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
such
</span>
<span class="oldenglish">
an
</span>
obligation. Men
<span class="oldenglish">
were
</span>
converted
<span class="oldenglish">
to
</span>
<span class="oldenglish">
no
</span>
<span class="oldenglish">
other
</span>
<span class="oldenglish">
thing
</span>
<span class="oldenglish">
then
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
the
</span>
Beleef
<span class="oldenglish">
of
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
which
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Apostles
</span>
preached:
<span class="oldenglish">
And
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Apostles
</span>
<span class="oldenglish">
preached
</span>
nothing,
<span class="oldenglish">
but
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
Jesus
</span>
<span class="oldenglish">
was
</span>
<span class="oldenglish">
the
</span>
Christ,
<span class="oldenglish">
that
</span>
<span class="oldenglish">
is
</span>
<span class="oldenglish">
to
</span>
say,
<span class="oldenglish">
the
</span>
<span class="oldenglish">
King
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
was
</span>
<span class="oldenglish">
to
</span>
save them,
<span class="oldenglish">
and
</span>
<span class="oldfrench">
reign
</span>
<span class="oldenglish">
over
</span>
<span class="oldnorse">
them
</span>
<span class="oldfrench">
eternally
</span>
<span class="oldenglish">
in
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
world
</span>
<span class="oldenglish">
to
</span>
come;
<span class="oldenglish">
and
</span>
<span class="french">
consequently
</span>
<span class="oldenglish">
that
</span>
hee
<span class="oldenglish">
was
</span>
<span class="english">
not
</span>
dead,
<span class="oldenglish">
but
</span>
<span class="oldenglish">
risen
</span>
<span class="oldenglish">
again
</span>
<span class="oldenglish">
from
</span>
<span class="oldenglish">
the
</span>
dead,
<span class="oldenglish">
and
</span>
gone
<span class="oldenglish">
up
</span>
<span class="oldenglish">
into
</span>
Heaven,
<span class="oldenglish">
and
</span>
<span class="oldenglish">
should
</span>
<span class="oldenglish">
come
</span>
<span class="oldenglish">
again
</span>
<span class="oldenglish">
one
</span>
<span class="oldenglish">
day
</span>
<span class="oldenglish">
to
</span>
judg
<span class="oldenglish">
the
</span>
world, (which
<span class="oldenglish">
also
</span>
<span class="oldenglish">
should
</span>
<span class="oldenglish">
rise
</span>
<span class="oldenglish">
again
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
be
</span>
judged,)
<span class="oldenglish">
and
</span>
<span class="french">
reward
</span>
<span class="oldenglish">
every
</span>
<span class="oldenglish">
man
</span>
according
<span class="oldenglish">
to
</span>
<span class="oldenglish">
his
</span>
works.
<span class="oldenglish">
None
</span>
<span class="oldenglish">
of
</span>
<span class="oldnorse">
them
</span>
<span class="oldenglish">
preached
</span>
<span class="oldenglish">
that
</span>
himselfe,
<span class="oldenglish">
or
</span>
<span class="oldenglish">
any
</span>
<span class="oldenglish">
other
</span>
<span class="oldenglish">
Apostle
</span>
<span class="oldenglish">
was
</span>
<span class="oldenglish">
such
</span>
<span class="oldenglish">
an
</span>
<span class="oldfrench">
Interpreter
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
Scripture,
<span class="oldenglish">
as
</span>
<span class="oldenglish">
all
</span>
<span class="oldenglish">
that
</span>
became Christians,
<span class="oldenglish">
ought
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
take
</span>
<span class="oldnorse">
their
</span>
<span class="oldfrench">
Interpretation
</span>
<span class="oldenglish">
for
</span>
Law.
<span class="oldenglish">
For
</span>
<span class="oldenglish">
to
</span>
<span class="oldfrench">
Interpret
</span>
<span class="oldenglish">
the
</span>
Laws,
<span class="oldenglish">
is
</span>
<span class="oldfrench">
part
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
<span class="latin">
Administration
</span>
<span class="oldenglish">
of
</span>
a
<span class="oldfrench">
present
</span>
Kingdome;
<span class="oldenglish">
which
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Apostles
</span>
had not.
<span class="oldnorse">
They
</span>
<span class="oldfrench">
prayed
</span>
then,
<span class="oldenglish">
and
</span>
<span class="oldenglish">
all
</span>
<span class="oldenglish">
other
</span>
<span class="oldfrench">
Pastors
</span>
<span class="oldenglish">
ever
</span>
since, "Let thy Kingdome come;"
<span class="oldenglish">
and
</span>
<span class="oldfrench">
exhorted
</span>
<span class="oldnorse">
their
</span>
Converts
<span class="oldenglish">
to
</span>
<span class="oldfrench">
obey
</span>
<span class="oldnorse">
their
</span>
<span class="oldenglish">
then
</span>
Ethnique Princes.
<span class="oldenglish">
The
</span>
<span class="oldenglish">
New
</span>
<span class="latin">
Testament
</span>
<span class="oldenglish">
was
</span>
<span class="english">
not
</span>
<span class="oldenglish">
yet
</span>
<span class="oldfrench">
published
</span>
<span class="oldenglish">
in
</span>
<span class="oldenglish">
one
</span>
Body.
<span class="oldenglish">
Every
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
Evangelists
</span>
<span class="oldenglish">
was
</span>
<span class="oldfrench">
Interpreter
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
his
</span>
<span class="oldenglish">
own
</span>
Gospel;
<span class="oldenglish">
and
</span>
<span class="oldenglish">
every
</span>
<span class="oldenglish">
Apostle
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
his
</span>
<span class="oldenglish">
own
</span>
Epistle;
<span class="oldenglish">
And
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Old
</span>
Testament,
<span class="oldenglish">
our
</span>
<span class="english">
Saviour
</span>
himselfe saith
<span class="oldenglish">
to
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
Jews
</span>
(John 5. 39.) "Search
<span class="oldenglish">
the
</span>
Scriptures;
<span class="oldenglish">
for
</span>
<span class="oldenglish">
in
</span>
<span class="oldnorse">
them
</span>
yee thinke
<span class="oldenglish">
to
</span>
<span class="oldenglish">
have
</span>
eternall life,
<span class="oldenglish">
and
</span>
<span class="oldnorse">
they
</span>
<span class="oldenglish">
are
</span>
<span class="oldnorse">
they
</span>
<span class="oldenglish">
that
</span>
testifie
<span class="oldenglish">
of
</span>
me."
<span class="oldenglish">
If
</span>
hee had
<span class="english">
not
</span>
meant
<span class="oldnorse">
they
</span>
<span class="oldenglish">
should
</span>
<span class="oldfrench">
Interpret
</span>
them, hee
<span class="oldenglish">
would
</span>
<span class="english">
not
</span>
<span class="oldenglish">
have
</span>
bidden
<span class="oldnorse">
them
</span>
<span class="oldenglish">
take
</span>
<span class="oldenglish">
thence
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
proof
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
his
</span>
being
<span class="oldenglish">
the
</span>
Christ;
<span class="oldenglish">
he
</span>
<span class="oldenglish">
would
</span>
<span class="oldenglish">
either
</span>
<span class="oldenglish">
have
</span>
<span class="oldfrench">
Interpreted
</span>
<span class="oldnorse">
them
</span>
himselfe,
<span class="oldenglish">
or
</span>
<span class="oldfrench">
referred
</span>
<span class="oldnorse">
them
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
Interpretation
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
Priests.
<span class="oldenglish">
When
</span>
a
<span class="oldfrench">
difficulty
</span>
arose,
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Apostles
</span>
<span class="oldenglish">
and
</span>
<span class="oldenglish">
Elders
</span>
<span class="oldenglish">
of
</span>
<span class="oldenglish">
the
</span>
Church
<span class="oldfrench">
assembled
</span>
<span class="oldenglish">
themselves
</span>
together,
<span class="oldenglish">
and
</span>
determined
<span class="oldenglish">
what
</span>
<span class="oldenglish">
should
</span>
<span class="oldenglish">
bee
</span>
preached,
<span class="oldenglish">
and
</span>
taught,
<span class="oldenglish">
and
</span>
<span class="oldenglish">
how
</span>
<span class="oldnorse">
they
</span>
<span class="oldenglish">
should
</span>
<span class="oldfrench">
Interpret
</span>
<span class="oldenglish">
the
</span>
<span class="latin">
Scriptures
</span>
<span class="oldenglish">
to
</span>
<span class="oldenglish">
the
</span>
People;
<span class="oldenglish">
but
</span>
<span class="oldenglish">
took
</span>
<span class="english">
not
</span>
<span class="oldenglish">
from
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
People
</span>
<span class="oldenglish">
the
</span>
<span class="oldfrench">
liberty
</span>
<span class="oldenglish">
to
</span>
read,
<span class="oldenglish">
and
</span>
<span class="oldfrench">
Interpret
</span>
<span class="oldnorse">
them
</span>
<span class="oldenglish">
to
</span>
themselves.
<span class="oldenglish">
The
</span>
<span class="oldenglish">
Apostles
</span>
sent
<span class="oldfrench">
divers
</span>
Letters
<span class="oldenglish">
to
</span>
<span class="oldenglish">
the
</span>
Churches,
<span class="oldenglish">
and
</span>
<span class="oldenglish">
other
</span>
<span class="oldenglish">
Writings
</span>
<span class="oldenglish">
for
</span>
<span class="oldnorse">
their
</span>
instruction;
<span class="oldenglish">
which
</span>
had been
<span class="oldenglish">
in
</span>
vain,
<span class="oldenglish">
if
</span>
<span class="oldnorse">
they
</span>
had
<span class="english">
not
</span>
allowed
<span class="oldnorse">
them
</span>
<span class="oldenglish">
to
</span>
Interpret,
<span class="oldenglish">
that
</span>
is,
<span class="oldenglish">
to
</span>
<span class="oldfrench">
consider
</span>
<span class="oldenglish">
the
</span>
meaning
<span class="oldenglish">
of
</span>
them.
<span class="oldenglish">
And
</span>
<span class="oldenglish">
as
</span>
<span class="oldenglish">
it
</span>
<span class="oldenglish">
was
</span>
<span class="oldenglish">
in
</span>
<span class="oldenglish">
the
</span>
<span class="oldenglish">
Apostles
</span>
time,
<span class="oldenglish">
it
</span>
<span class="oldenglish">
must
</span>
<span class="oldenglish">
be
</span>
<span class="oldenglish">
till
</span>
<span class="oldenglish">
such
</span>
time
<span class="oldenglish">
as
</span>
<span class="oldenglish">
there
</span>
<span class="oldenglish">
should
</span>
<span class="oldenglish">
be
</span>
Pastors,
<span class="oldenglish">
that
</span>
<span class="oldenglish">
could
</span>
<span class="english">
authorise
</span>
<span class="oldenglish">
an
</span>
Interpreter,
<span class="oldenglish">
whose
</span>
<span class="oldfrench">
Interpretation
</span>
<span class="oldenglish">
should
</span>
generally
<span class="oldenglish">
be
</span>
stood to:
<span class="oldenglish">
But
</span>
<span class="oldenglish">
that
</span>
<span class="oldenglish">
could
</span>
<span class="english">
not
</span>
<span class="oldenglish">
be
</span>
<span class="oldenglish">
till
</span>
Kings
<span class="oldenglish">
were
</span>
Pastors,
<span class="oldenglish">
or
</span>
<span class="oldfrench">
Pastors
</span>
Kings.
</body>
</html> |
package joshie.enchiridion.library;
import joshie.enchiridion.helpers.UUIDHelper;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.world.storage.WorldSavedData;
import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.HashMap;
import java.util.UUID;
public class LibrarySavedData extends WorldSavedData {
public static final String DATA_NAME = "Enchiridion-Library";
private HashMap<UUID, LibraryInventory> players = new HashMap<>();
public LibrarySavedData(String string) {
super(string);
}
public Collection<LibraryInventory> getPlayerData() {
return players.values();
}
public LibraryInventory getLibraryContents(PlayerEntity player) {
UUID uuid = UUIDHelper.getPlayerUUID(player);
if (players.containsKey(uuid)) {
return players.get(uuid);
} else {
if (players.containsKey(uuid)) {
return players.get(uuid);
} else {
LibraryInventory data = new LibraryInventory(player);
players.put(uuid, data);
markDirty();
return players.get(uuid);
}
}
}
/**
* CAN AND WILL RETURN NULL, IF THE UUID COULD NOT BE FOUND
**/
public LibraryInventory getLibraryContents(UUID uuid) {
if (players.containsKey(uuid)) {
return players.get(uuid);
} else {
ServerPlayerEntity player = UUIDHelper.getPlayerFromUUID(uuid);
if (player == null) return null;
else return getLibraryContents(player);
}
}
@Override
public void read(@Nonnull CompoundNBT nbt) {
ListNBT tag_list_players = nbt.getList("LibraryInventory", 10);
for (int i = 0; i < tag_list_players.size(); i++) {
CompoundNBT tag = tag_list_players.getCompound(i);
LibraryInventory data = new LibraryInventory();
boolean success;
try {
data.readFromNBT(tag);
success = true;
} catch (Exception e) {
success = false;
}
//Only add non failed loads
if (success) {
players.put(data.getUUID(), data);
}
}
}
@Override
@Nonnull
public CompoundNBT write(@Nonnull CompoundNBT nbt) {
ListNBT tag_list_players = new ListNBT();
players.entrySet().stream().filter(entry -> entry.getKey() != null && entry.getValue() != null).forEach(entry -> {
CompoundNBT tag = new CompoundNBT();
entry.getValue().writeToNBT(tag);
tag_list_players.add(tag);
});
nbt.put("LibraryInventory", tag_list_players);
return nbt;
}
} |
#region References
using Interop.UIAutomationClient;
#endregion
namespace TestR.Desktop.Elements
{
<summary>
Represents a calendar element.
</summary>
public class Calendar : DesktopElement
{
#region Constructors
internal Calendar(<API key> element, Application application, DesktopElement parent)
: base(element, application, parent)
{
}
#endregion
}
} |
ENV["RAILS_ENV"] ||= "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending! |
<reference path="ChangeLinr-0.2.0.ts" />
<reference path="StringFilr-0.2.1.ts" />
var PixelRendr;
(function (PixelRendr) {
"use strict";
/**
* Container for a "multiple" sprite, which is a sprite that contains separate
* Uint8ClampedArray pieces of data for different sections (such as top, middle, etc.)
*/
var SpriteMultiple = (function () {
/**
* Initializes a new instance of the SpriteMultiple class.
*
* @param sprites Data for each sprite to import, keyed by container.
* @param render The parsed sprite source.
*/
function SpriteMultiple(sprites, render) {
var sources = render.source[2];
this.sprites = sprites;
this.direction = render.source[1];
if (this.direction === "vertical" || this.direction === "corners") {
this.topheight = sources.topheight | 0;
this.bottomheight = sources.bottomheight | 0;
}
if (this.direction === "horizontal" || this.direction === "corners") {
this.rightwidth = sources.rightwidth | 0;
this.leftwidth = sources.leftwidth | 0;
}
this.middleStretch = sources.middleStretch || false;
}
return SpriteMultiple;
})();
PixelRendr.SpriteMultiple = SpriteMultiple;
})(PixelRendr || (PixelRendr = {}));
var PixelRendr;
(function (PixelRendr) {
"use strict";
/**
* Summary container for a single PixelRendr sprite source. The original source
* is stored, along with any generated outputs, information on its container,
* and any filter.
*/
var Render = (function () {
/**
* Initializes a new instance of the Render clsas.
*
* @param source The original command to create this render.
* @param filter An optional filter to change colors by, if source
* is a "filter" command.
*/
function Render(source, filter) {
this.source = source;
this.filter = filter;
this.sprites = {};
this.containers = [];
}
return Render;
})();
PixelRendr.Render = Render;
})(PixelRendr || (PixelRendr = {}));
var PixelRendr;
(function (PixelRendr_1) {
"use strict";
/**
* A moderately unusual graphics module designed to compress images as
* compressed text blobs and store the text blobs in a StringFilr. These tasks
* are performed and cached quickly enough for use in real-time environments,
* such as real-time video games.
*/
var PixelRendr = (function () {
/**
* Initializes a new instance of the PixelRendr class.
*
* @param settings Settings to be used for initialization.
*/
function PixelRendr(settings) {
if (!settings) {
throw new Error("No settings given to PixelRendr.");
}
if (!settings.paletteDefault) {
throw new Error("No paletteDefault given to PixelRendr.");
}
this.setPalette(settings.paletteDefault);
this.library = {
"raws": settings.library || {}
};
this.scale = settings.scale || 1;
this.filters = settings.filters || {};
this.flipVert = settings.flipVert || "flip-vert";
this.flipHoriz = settings.flipHoriz || "flip-horiz";
this.spriteWidth = settings.spriteWidth || "spriteWidth";
this.spriteHeight = settings.spriteHeight || "spriteHeight";
this.Uint8ClampedArray = settings.Uint8ClampedArray || window.Uint8ClampedArray || window.Uint8Array;
// The first ChangeLinr does the raw processing of Strings to sprites
// This is used to load & parse sprites into memory on startup
this.ProcessorBase = new ChangeLinr.ChangeLinr({
"transforms": {
"spriteUnravel": this.spriteUnravel.bind(this),
"spriteApplyFilter": this.spriteApplyFilter.bind(this),
"spriteExpand": this.spriteExpand.bind(this),
"spriteGetArray": this.spriteGetArray.bind(this)
},
"pipeline": ["spriteUnravel", "spriteApplyFilter", "spriteExpand", "spriteGetArray"]
});
// The second ChangeLinr does row repeating and flipping
// This is done on demand when given a sprite's settings Object
this.ProcessorDims = new ChangeLinr.ChangeLinr({
"transforms": {
"spriteRepeatRows": this.spriteRepeatRows.bind(this),
"<API key>": this.<API key>.bind(this)
},
"pipeline": ["spriteRepeatRows", "<API key>"]
});
// As a utility, a processor is included to encode image data to sprites
this.ProcessorEncode = new ChangeLinr.ChangeLinr({
"transforms": {
"imageGetData": this.imageGetData.bind(this),
"imageGetPixels": this.imageGetPixels.bind(this),
"imageMapPalette": this.imageMapPalette.bind(this),
"imageCombinePixels": this.imageCombinePixels.bind(this)
},
"pipeline": ["imageGetData", "imageGetPixels", "imageMapPalette", "imageCombinePixels"],
"doUseCache": false
});
this.library.sprites = this.libraryParse(this.library.raws);
// The BaseFiler provides a searchable 'view' on the library of sprites
this.BaseFiler = new StringFilr.StringFilr({
"library": this.library.sprites,
"normal": "normal" // to do: put this somewhere more official?
});
this.commandGenerators = {
"multiple": this.<API key>.bind(this),
"same": this.<API key>.bind(this),
"filter": this.<API key>.bind(this)
};
}
/* Simple gets
*/
/**
* @returns The base container for storing sprite information.
*/
PixelRendr.prototype.getBaseLibrary = function () {
return this.BaseFiler.getLibrary();
};
/**
* @returns The StringFilr interface on top of the base library.
*/
PixelRendr.prototype.getBaseFiler = function () {
return this.BaseFiler;
};
/**
* @returns The processor that turns raw strings into partial sprites.
*/
PixelRendr.prototype.getProcessorBase = function () {
return this.ProcessorBase;
};
/**
* @returns The processor that converts partial sprites and repeats rows.
*/
PixelRendr.prototype.getProcessorDims = function () {
return this.ProcessorDims;
};
/**
* @returns The processor that takes real images and compresses their data
* into sprite Strings.
*/
PixelRendr.prototype.getProcessorEncode = function () {
return this.ProcessorEncode;
};
/**
* Retrieves the base sprite under the given key.
*
* @param key A key for a base sprite.
* @returns The base sprite for the key. This will be a Uint8ClampedArray
* or SpriteMultiple if a sprite is found, or the deepest matching
* Object in the library if not.
*/
PixelRendr.prototype.getSpriteBase = function (key) {
return this.BaseFiler.get(key);
};
/* External APIs
*/
/**
* Replaces the current palette with a new one.
*
* @param palette The new palette to replace the current one.
*/
PixelRendr.prototype.changePalette = function (palette) {
this.setPalette(palette);
for (var sprite in this.library.sprites) {
if (!this.library.sprites.hasOwnProperty(sprite)) {
continue;
}
this.BaseFiler.clearCached(sprite);
}
};
/**
* Standard render function. Given a key, this finds the raw information via
* BaseFiler and processes it using ProcessorDims. Attributes are needed so
* the ProcessorDims can stretch it on width and height.
*
* @param key The general key for the sprite.
* @param attributes Additional attributes for the sprite; width and height
* Numbers are required.
* @returns A sprite for the given key and attributes.
*/
PixelRendr.prototype.decode = function (key, attributes) {
var render = this.BaseFiler.get(key), sprite;
if (!render) {
throw new Error("No sprite found for " + key + ".");
}
// If the render doesn't have a listing for this key, create one
if (!render.sprites.hasOwnProperty(key)) {
this.<API key>(render, key, attributes);
}
sprite = render.sprites[key];
if (!sprite || (sprite.constructor === this.Uint8ClampedArray && sprite.length === 0)) {
throw new Error("Could not generate sprite for " + key + ".");
}
return sprite;
};
/**
* Encodes an image into a sprite via ProcessorEncode.process.
*
* @param image An image to encode.
* @param callback An optional callback to call with image and the result.
* @param args Any additional arguments to pass to the callback.
*/
PixelRendr.prototype.encode = function (image, callback) {
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
var result = this.ProcessorEncode.process(image);
if (callback) {
callback.apply(void 0, [result, image].concat(args));
}
return result;
};
/**
* Fetches an image from a source and encodes it into a sprite via
* ProcessEncode.process. An HtmlImageElement is created and given an onload
* of this.encode.
*
* @param uri The URI of an image to encode.
* @param callback A callback to call on the results.
*/
PixelRendr.prototype.encodeUri = function (uri, callback) {
var image = document.createElement("img");
image.onload = this.encode.bind(this, image, callback);
image.src = uri;
};
/**
* Miscellaneous utility to generate a complete palette from raw image pixel
* data. Unique [r,g,b,a] values are found using tree-based caching, and
* separated into grayscale (r,g,b equal) and general (r,g,b unequal). If a
* pixel has a=0, it's completely transparent and goes before anything else
* in the palette. Grayscale colors come next in order of light to dark, and
* general colors come next sorted by decreasing r, g, and b in order.
*
* @param data The equivalent data from a context's getImageData(...).data.
* @param forceZeroColor Whether the palette should have a [0,0,0,0] color
* as the first element even if data does not contain
* it (by default, false).
* @param giveArrays Whether the resulting palettes should be converted to
* Arrays (by default, false).
* @returns A working palette that may be used in sprite settings (Array[] if
* giveArrays is true).
*/
PixelRendr.prototype.<API key> = function (data, forceZeroColor, giveArrays) {
var tree = {}, colorsGeneral = [], colorsGrayscale = [], output, i;
for (i = 0; i < data.length; i += 4) {
if (data[i + 3] === 0) {
forceZeroColor = true;
continue;
}
if (tree[data[i]]
&& tree[data[i]][data[i + 1]]
&& tree[data[i]][data[i + 1]][data[i + 2]]
&& tree[data[i]][data[i + 1]][data[i + 2]][data[i + 3]]) {
continue;
}
if (!tree[data[i]]) {
tree[data[i]] = {};
}
if (!tree[data[i]][data[i + 1]]) {
tree[data[i]][data[i + 1]] = {};
}
if (!tree[data[i]][data[i + 1]][data[i + 2]]) {
tree[data[i]][data[i + 1]][data[i + 2]] = {};
}
if (!tree[data[i]][data[i + 1]][data[i + 2]][data[i + 3]]) {
tree[data[i]][data[i + 1]][data[i + 2]][data[i + 3]] = true;
if (data[i] === data[i + 1] && data[i + 1] === data[i + 2]) {
colorsGrayscale.push(data.subarray(i, i + 4));
}
else {
colorsGeneral.push(data.subarray(i, i + 4));
}
}
}
// It's safe to sort grayscale colors just on their first values, since
// grayscale implies they're all the same.
colorsGrayscale.sort(function (a, b) {
return a[0] - b[0];
});
// For regular colors, sort by the first color that's not equal, so in
// order red, green, blue, alpha.
colorsGeneral.sort(function (a, b) {
for (i = 0; i < 4; i += 1) {
if (a[i] !== b[i]) {
return b[i] - a[i];
}
}
});
if (forceZeroColor) {
output = [new this.Uint8ClampedArray([0, 0, 0, 0])]
.concat(colorsGrayscale)
.concat(colorsGeneral);
}
else {
output = colorsGrayscale.concat(colorsGeneral);
}
if (!giveArrays) {
return output;
}
for (i = 0; i < output.length; i += 1) {
output[i] = Array.prototype.slice.call(output[i]);
}
return output;
};
PixelRendr.prototype.memcpyU8 = function (source, destination, readloc, writeloc, writelength) {
if (readloc === void 0) { readloc = 0; }
if (writeloc === void 0) { writeloc = 0; }
if (writelength === void 0) { writelength = Math.max(0, Math.min(source.length, destination.length)); }
// JIT compilation help
var lwritelength = writelength + 0, lwriteloc = writeloc + 0, lreadloc = readloc + 0;
while (lwritelength
destination[lwriteloc++] = source[lreadloc++];
}
};
/* Library parsing
*/
/**
* Recursively travels through a library, turning all raw sprites and
* commands into Renders.
*
* @param reference The raw source structure to be parsed.
* @param path The path to the current place within the library.
* @returns The parsed library Object.
*/
PixelRendr.prototype.libraryParse = function (reference) {
var setNew = {}, source, i;
// For each child of the current layer:
for (i in reference) {
if (!reference.hasOwnProperty(i)) {
continue;
}
source = reference[i];
switch (source.constructor) {
case String:
// Strings directly become IRenders
setNew[i] = new PixelRendr_1.Render(source);
break;
case Array:
// Arrays contain a String filter, a String[] source, and any
// number of following arguments
setNew[i] = new PixelRendr_1.Render(source, source[1]);
break;
default:
// If it's anything else, simply recurse
setNew[i] = this.libraryParse(source);
break;
}
// If a Render was created, mark setNew as a container
if (setNew[i].constructor === PixelRendr_1.Render) {
setNew[i].containers.push({
"container": setNew,
"key": i
});
}
}
return setNew;
};
/**
* Generates a sprite for a Render based on its internal source and an
* externally given String key and attributes Object. The sprite is stored
* in the Render's sprites container under that key.
*
* @param render A render whose sprite is being generated.
* @param key The key under which the sprite is stored.
* @param attributes Any additional information to pass to the sprite
* generation process.
*/
PixelRendr.prototype.<API key> = function (render, key, attributes) {
var sprite;
if (render.source.constructor === String) {
sprite = this.<API key>(render, key, attributes);
}
else {
sprite = this.commandGenerators[render.source[0]](render, key, attributes);
}
render.sprites[key] = sprite;
};
/**
* Generates the pixel data for a single sprite.
*
* @param render A render whose sprite is being generated.
* @param key The key under which the sprite is stored.
* @param attributes Any additional information to pass to the sprite generation
* process.
* @returns The output sprite.
*/
PixelRendr.prototype.<API key> = function (render, key, attributes) {
var base = this.ProcessorBase.process(render.source, key, render.filter), sprite = this.ProcessorDims.process(base, key, attributes);
return sprite;
};
/**
* Generates the pixel data for a SpriteMultiple to be generated by creating
* a container in a new SpriteMultiple and filing it with processed single
* sprites.
*
* @param render A render whose sprite is being generated.
* @param key The key under which the sprite is stored.
* @param attributes Any additional information to pass to the sprite generation
* process.
* @returns The output sprite.
*/
PixelRendr.prototype.<API key> = function (render, key, attributes) {
var sources = render.source[2], sprites = {}, sprite, path, output = new PixelRendr_1.SpriteMultiple(sprites, render), i;
for (i in sources) {
if (sources.hasOwnProperty(i)) {
path = key + " " + i;
sprite = this.ProcessorBase.process(sources[i], path, render.filter);
sprites[i] = this.ProcessorDims.process(sprite, path, attributes);
}
}
return output;
};
/**
* Generates the output of a "same" command. The referenced Render or
* directory are found, assigned to the old Render's directory, and
* this.decode is used to find the output.
*
* @param render A render whose sprite is being generated.
* @param key The key under which the sprite is stored.
* @param attributes Any additional information to pass to the
* sprite generation process.
* @returns The output sprite.
*/
PixelRendr.prototype.<API key> = function (render, key, attributes) {
var replacement = this.followPath(this.library.sprites, render.source[1], 0);
// The (now temporary) Render's containers are given the Render or directory
// referenced by the source path
this.<API key>(render, replacement);
// BaseFiler will need to remember the new entry for the key,
// so the cache is cleared and decode restarted
this.BaseFiler.clearCached(key);
return this.decode(key, attributes);
};
/**
* Generates the output of a "filter" command. The referenced Render or
* directory are found, converted into a filtered Render or directory, and
* this.decode is used to find the output.
*
* @param render A render whose sprite is being generated.
* @param key The key under which the sprite is stored.
* @param attributes Any additional information to pass to the sprite generation
* process.
* @returns The output sprite.
*/
PixelRendr.prototype.<API key> = function (render, key, attributes) {
var filter = this.filters[render.source[2]], found = this.followPath(this.library.sprites, render.source[1], 0), filtered;
if (!filter) {
console.warn("Invalid filter provided: " + render.source[2]);
}
// If found is a Render, create a new one as a filtered copy
if (found.constructor === PixelRendr_1.Render) {
filtered = new PixelRendr_1.Render(found.source, { filter: filter });
this.<API key>(filtered, key, attributes);
}
else {
// Otherwise it's an IRenderLibrary; go through that recursively
filtered = this.<API key>(found, filter);
}
// The (now unused) render gives the filtered Render or directory to its containers
this.<API key>(render, filtered);
if (filtered.constructor === PixelRendr_1.Render) {
return filtered.sprites[key];
}
else {
this.BaseFiler.clearCached(key);
return this.decode(key, attributes);
}
};
/**
* Recursively generates a directory of Renders from a filter. This is
* similar to this.libraryParse, though the filter is added and references
* aren't.
*
* @param directory The current directory of Renders to create filtered versions
* of.
* @param filter The filter being applied.
* @returns An output directory containing Renders with the filter.
*/
PixelRendr.prototype.<API key> = function (directory, filter) {
var output = {}, child, i;
for (i in directory) {
if (!directory.hasOwnProperty(i)) {
continue;
}
child = directory[i];
if (child.constructor === PixelRendr_1.Render) {
output[i] = new PixelRendr_1.Render(child.source, {
"filter": filter
});
}
else {
output[i] = this.<API key>(child, filter);
}
}
return output;
};
/**
* Switches all of a given Render's containers to point to a replacement instead.
*
* @param render A Render being replaced.
* @param replacement A replacement for render.
*/
PixelRendr.prototype.<API key> = function (render, replacement) {
var listing, i;
for (i = 0; i < render.containers.length; i += 1) {
listing = render.containers[i];
listing.container[listing.key] = replacement;
if (replacement.constructor === PixelRendr_1.Render) {
replacement.containers.push(listing);
}
}
};
/* Core pipeline functions
*/
/**
* Given a compressed raw sprite data string, this 'unravels' it. This is
* the first Function called in the base processor. It could output the
* Uint8ClampedArray immediately if given the area - deliberately does not
* to simplify sprite library storage.
*
* @param colors The raw sprite String, including commands like "p" and "x".
* @returns A version of the sprite with fancy commands replaced by numbers.
*/
PixelRendr.prototype.spriteUnravel = function (colors) {
var paletteref = this.<API key>(this.paletteDefault), digitsize = this.digitsizeDefault, clength = colors.length, current, rep, nixloc, output = "", loc = 0;
while (loc < clength) {
switch (colors[loc]) {
// A loop, ordered as 'x char times ,'
case "x":
// Get the location of the ending comma
nixloc = colors.indexOf(",", ++loc);
// Get the color
current = this.makeDigit(paletteref[colors.slice(loc, loc += digitsize)], this.digitsizeDefault);
// Get the rep times
rep = Number(colors.slice(loc, nixloc));
// Add that int to output, rep many times
while (rep
output += current;
}
loc = nixloc + 1;
break;
// A palette changer, in the form 'p[X,Y,Z...]' (or "p" for default)
case "p":
// If the next character is a "[", customize.
if (colors[++loc] === "[") {
nixloc = colors.indexOf("]");
// Isolate and split the new palette's numbers
paletteref = this.getPaletteReference(colors.slice(loc + 1, nixloc).split(","));
loc = nixloc + 1;
digitsize = this.<API key>(paletteref);
}
else {
// Otherwise go back to default
paletteref = this.getPaletteReference(this.paletteDefault);
digitsize = this.digitsizeDefault;
}
break;
// A typical number
default:
output += this.makeDigit(paletteref[colors.slice(loc, loc += digitsize)], this.digitsizeDefault);
break;
}
}
return output;
};
/**
* Repeats each number in the given string a number of times equal to the
* scale. This is the second Function called by the base processor.
*
* @param colors A series of sprite colors.
* @returns The same series, with each character repeated.
*/
PixelRendr.prototype.spriteExpand = function (colors) {
var output = "", clength = colors.length, i = 0, j, current;
// For each number,
while (i < clength) {
current = colors.slice(i, i += this.digitsizeDefault);
// Put it into output as many times as needed
for (j = 0; j < this.scale; ++j) {
output += current;
}
}
return output;
};
/**
* Used during post-processing before spriteGetArray to filter colors. This
* is the third Function used by the base processor, but it just returns the
* original sprite if no filter should be applied from attributes.
* Filters are applied here because the sprite is just the numbers repeated,
* so it's easy to loop through and replace them.
*
* @param colors A series of color characters.
* @param key The unique key identifying this chain of transforms.
* @param attributes Attributes describing the filter to use.
* @returns The original series of color characters, filtered.
*/
PixelRendr.prototype.spriteApplyFilter = function (colors, key, attributes) {
// If there isn't a filter (as is the norm), just return the sprite
if (!attributes || !attributes.filter) {
return colors;
}
var filter = attributes.filter, filterName = filter[0];
if (!filterName) {
return colors;
}
switch (filterName) {
// Palette filters switch all instances of one color with another
case "palette":
// Split the colors on on each digit
// ("...1234..." => [..., "12", "34", ...]
var split = colors.match(this.digitsplit), i;
// For each color filter to be applied, replace it
for (i in filter[1]) {
if (filter[1].hasOwnProperty(i)) {
this.arrayReplace(split, i, filter[1][i]);
}
}
return split.join("");
default:
console.warn("Unknown filter: '" + filterName + "'.");
}
return colors;
};
/**
* Converts an unraveled String of sprite numbers to the equivalent RGBA
* Uint8ClampedArray. Each colors number will be represented by four numbers
* in the output. This is the fourth Function called in the base processor.
*
* @param colors A series of color characters.
* @returns A series of pixels equivalent to the colors.
*/
PixelRendr.prototype.spriteGetArray = function (colors) {
var clength = colors.length, numcolors = clength / this.digitsizeDefault, split = colors.match(this.digitsplit), olength = numcolors * 4, output = new this.Uint8ClampedArray(olength), reference, i, j, k;
// For each color,
for (i = 0, j = 0; i < numcolors; ++i) {
// Grab its RGBA ints
reference = this.paletteDefault[Number(split[i])];
// Place each in output
for (k = 0; k < 4; ++k) {
output[j + k] = reference[k];
}
j += 4;
}
return output;
};
/**
* Repeats each row of a sprite based on the container attributes to create
* the actual sprite (before now, the sprite was 1 / scale as high as it
* should have been). This is the first Function called in the dimensions
* processor.
*
* @param sprite A series of sprite pixels.
* @param key The unique key identifying this chain of transforms.
* @param attributes The container Object (commonly a Thing in GameStarter),
* which must contain width and height numbers.
* @returns A version of the original sprite, with rows repeated.
*/
PixelRendr.prototype.spriteRepeatRows = function (sprite, key, attributes) {
var parsed = new this.Uint8ClampedArray(sprite.length * this.scale), rowsize = attributes[this.spriteWidth] * 4, height = attributes[this.spriteHeight] / this.scale, readloc = 0, writeloc = 0, i, j;
// For each row:
for (i = 0; i < height; ++i) {
// Add it to parsed x scale
for (j = 0; j < this.scale; ++j) {
this.memcpyU8(sprite, parsed, readloc, writeloc, rowsize);
writeloc += rowsize;
}
readloc += rowsize;
}
return parsed;
};
/**
* Optionally flips a sprite based on the flipVert and flipHoriz keys. This
* is the second Function in the dimensions processor and the last step
* before a sprite is deemed usable.
*
* @param sprite A series of sprite pixels.
* @param key The unique key identifying this chain of transforms.
* @param attributes The container Object (commonly a Thing in GameStarter),
* which must contain width and height numbers.
* @returns A version of the original sprite, with dimensions flipped.
*/
PixelRendr.prototype.<API key> = function (sprite, key, attributes) {
if (key.indexOf(this.flipHoriz) !== -1) {
if (key.indexOf(this.flipVert) !== -1) {
return this.flipSpriteArrayBoth(sprite);
}
else {
return this.<API key>(sprite, attributes);
}
}
else if (key.indexOf(this.flipVert) !== -1) {
return this.flipSpriteArrayVert(sprite, attributes);
}
return sprite;
};
/**
* Flips a sprite horizontally by reversing the pixels within each row. Rows
* are computing using the spriteWidth in attributes.
*
* @param sprite A series of sprite pixels.
* @param attributes The container Object (commonly a Thing in GameStarter),
* which must contain width and height numbers.
* @returns A version of the original sprite, flipped horizontally.
*/
PixelRendr.prototype.<API key> = function (sprite, attributes) {
var length = sprite.length + 0, width = attributes[this.spriteWidth] + 0, newsprite = new this.Uint8ClampedArray(length), rowsize = width * 4, newloc, oldloc, i, j, k;
// For each row:
for (i = 0; i < length; i += rowsize) {
newloc = i;
oldloc = i + rowsize - 4;
// For each pixel:
for (j = 0; j < rowsize; j += 4) {
// Copy it over
for (k = 0; k < 4; ++k) {
newsprite[newloc + k] = sprite[oldloc + k];
}
newloc += 4;
oldloc -= 4;
}
}
return newsprite;
};
/**
* Flips a sprite horizontally by reversing the order of the rows. Rows are
* computing using the spriteWidth in attributes.
*
* @param sprite A series of sprite pixels.
* @param attributes The container Object (commonly a Thing in GameStarter),
* which must contain width and height numbers.
* @returns A version of the original sprite, flipped vertically.
*/
PixelRendr.prototype.flipSpriteArrayVert = function (sprite, attributes) {
var length = sprite.length, width = attributes[this.spriteWidth] + 0, newsprite = new this.Uint8ClampedArray(length), rowsize = width * 4, newloc = 0, oldloc = length - rowsize, i, j;
// For each row
while (newloc < length) {
// For each pixel in the rows
for (i = 0; i < rowsize; i += 4) {
// For each rgba value
for (j = 0; j < 4; ++j) {
newsprite[newloc + i + j] = sprite[oldloc + i + j];
}
}
newloc += rowsize;
oldloc -= rowsize;
}
return newsprite;
};
/**
* Flips a sprite horizontally and vertically by reversing the order of the
* pixels. This doesn't actually need attributes.
*
* @param sprite A series of sprite pixels.
* @param attributes The container Object (commonly a Thing in GameStarter),
* which must contain width and height numbers.
* @returns A version of the original sprite, flipped horizontally and vertically.
*/
PixelRendr.prototype.flipSpriteArrayBoth = function (sprite) {
var length = sprite.length, newsprite = new this.Uint8ClampedArray(length), oldloc = sprite.length - 4, newloc = 0, i;
while (newloc < length) {
for (i = 0; i < 4; ++i) {
newsprite[newloc + i] = sprite[oldloc + i];
}
newloc += 4;
oldloc -= 4;
}
return newsprite;
};
/* Encoding pipeline functions
*/
/**
* Retrives the raw pixel data from an image element. It is copied onto a
* canvas, which as its context return the .getImageDate().data results.
* This is the first Fiunction used in the encoding processor.
*
* @param image An image whose data is to be retrieved.
*/
PixelRendr.prototype.imageGetData = function (image) {
var canvas = document.createElement("canvas"), context = canvas.getContext("2d");
canvas.width = image.width;
canvas.height = image.height;
context.drawImage(image, 0, 0);
return context.getImageData(0, 0, image.width, image.height).data;
};
/**
* Determines which pixels occur in the data and at what frequency. This is
* the second Function used in the encoding processor.
*
* @param data The raw pixel data obtained from the imageData of a canvas.
* @returns [pixels, occurences], where pixels is an array of [rgba] values
* and occurences is an Object mapping occurence frequencies of
* palette colors in pisels.
*/
PixelRendr.prototype.imageGetPixels = function (data) {
var pixels = new Array(data.length / 4), occurences = {}, pixel, i, j;
for (i = 0, j = 0; i < data.length; i += 4, j += 1) {
pixel = this.getClosestInPalette(this.paletteDefault, data.subarray(i, i + 4));
pixels[j] = pixel;
if (occurences.hasOwnProperty(pixel)) {
occurences[pixel] += 1;
}
else {
occurences[pixel] = 1;
}
}
return [pixels, occurences];
};
/**
* Concretely defines the palette to be used for a new sprite. This is the
* third Function used in the encoding processor, and creates a technically
* usable (but uncompressed) sprite with information to compress it.
*
* @param information [pixels, occurences], a result directly from imageGetPixels.
* @returns [palette, numbers, digitsize], where palette is a String[] of palette
* numbers, numbers is the actual sprite data, and digitsize is the sprite's
* digit size.
*/
PixelRendr.prototype.imageMapPalette = function (information) {
var pixels = information[0], occurences = information[1], palette = Object.keys(occurences), digitsize = this.<API key>(palette), paletteIndices = this.getValueIndices(palette), numbers = pixels.map(function (pixel) { return paletteIndices[pixel]; });
return [palette, numbers, digitsize];
};
/**
* Compresses a nearly complete sprite from imageMapPalette into a
* compressed, storage-ready String. This is the last Function in the
* encoding processor.
*
* @param information [palette, numbers, digitsize], a result directly from
* imageMapPalette.
* @returns The pixels from information, combined.
*/
PixelRendr.prototype.imageCombinePixels = function (information) {
var palette = information[0], numbers = information[1], digitsize = information[2], threshold = Math.max(3, Math.round(4 / digitsize)), output, current, digit, i = 0, j;
output = "p[" + palette.map(this.makeSizedDigit.bind(this, digitsize)).join(",") + "]";
while (i < numbers.length) {
j = i + 1;
current = numbers[i];
digit = this.makeDigit(current, digitsize);
while (current === numbers[j]) {
j += 1;
}
if (j - i > threshold) {
output += "x" + digit + String(j - i) + ",";
i = j;
}
else {
do {
output += digit;
i += 1;
} while (i < j);
}
}
return output;
};
/* Misc. utility functions
*/
/**
* Sets the palette and digitsizeDefault/digitsplit based off that palette.
*
* @param palette The palette being assigned to paletteDefault.
*/
PixelRendr.prototype.setPalette = function (palette) {
this.paletteDefault = palette;
this.digitsizeDefault = this.<API key>(this.paletteDefault);
this.digitsplit = new RegExp(".{1," + this.digitsizeDefault + "}", "g");
};
/**
* Determines how many digits will be required to represent a member of
* the palette.
*
* @param palette A palette of colors.
* @returns The equivalent digitsize for the palette.
*/
PixelRendr.prototype.<API key> = function (palette) {
var digitsize = 0, i;
for (i = palette.length; i >= 1; i /= 10) {
digitsize += 1;
}
return digitsize;
};
/**
* Determines how many digits will be required to represent a member of
* the palette.
*
* @param palette A palette of colors.
* @returns The equivalent digitsize for the palette.
*/
PixelRendr.prototype.<API key> = function (palette) {
return this.<API key>(Object.keys(palette));
};
/**
* Generates an actual palette Object for a given palette, using a digitsize
* calculated from the palette.
*
* @param palette A palette of colors
* @returns The actual palette Object for the given palette, with an index
* for every palette member.
*/
PixelRendr.prototype.getPaletteReference = function (palette) {
var output = {}, digitsize = this.<API key>(palette), i;
for (i = 0; i < palette.length; i += 1) {
output[this.makeDigit(i, digitsize)] = this.makeDigit(palette[i], digitsize);
}
return output;
};
/**
* Generates an actual palette Object for a given palette, using the default
* digitsize.
*
* @param palette A palette of colors.
* @returns The actual palette Object for the given palette, with an index
* for every palette member.
*/
PixelRendr.prototype.<API key> = function (palette) {
var output = {}, digit, i;
for (i = 0; i < palette.length; i += 1) {
digit = this.makeDigit(i, this.digitsizeDefault);
output[digit] = digit;
}
return output;
};
/**
* Finds which rgba value in a palette is closest to a given value. This is
* useful for determining which color in a pre-existing palette matches up
* with a raw image's pixel. This is determined by which palette color has
* the lowest total difference in integer values between r, g, b, and a.
*
* @param palette The palette of pre-existing colors.
* @param rgba The RGBA values being assigned, as Numbers in [0, 255].
* @returns The closest matching color index.
*/
PixelRendr.prototype.getClosestInPalette = function (palette, rgba) {
var bestDifference = Infinity, difference, bestIndex, i;
for (i = palette.length - 1; i >= 0; i -= 1) {
difference = this.arrayDifference(palette[i], rgba);
if (difference < bestDifference) {
bestDifference = difference;
bestIndex = i;
}
}
return bestIndex;
};
/**
* Creates a new String equivalent to an old String repeated any number of
* times. If times is 0, a blank String is returned.
*
* @param string The characters to repeat.
* @param times How many times to repeat (by default, 1).
* @returns The original string, repeated.
*/
PixelRendr.prototype.stringOf = function (string, times) {
return (times === 0) ? "" : new Array(1 + (times || 1)).join(string);
};
/**
* Turns a Number into a String with a prefix added to pad it to a certain
* number of digits.
*
* @param number The original Number being padded.
* @param size How many digits the output must contain.
* @param prefix A prefix to repeat for padding (by default, "0").
* @returns A Stringified digit of the given length.
* @example makeDigit(7, 3); // '007'
* @example makeDigit(7, 3, 1); // '117'
*/
PixelRendr.prototype.makeDigit = function (num, size, prefix) {
if (prefix === void 0) { prefix = "0"; }
return this.stringOf(prefix, Math.max(0, size - String(num).length)) + num;
};
/**
* Curry wrapper around makeDigit that reverses size and number argument
* order. Useful for binding makeDigit.
*
* @param number The original Number being padded.
* @param size How many digits the output must contain.
* @returns A stringified digit of the given length.
*/
PixelRendr.prototype.makeSizedDigit = function (size, number) {
return this.makeDigit(number, size, "0");
};
/**
* Replaces all instances of an element in an Array.
*
* @param array The original elements.
* @param removed The element to remove.
* @param inserted The element to insert.
* @returns The original Array, with the element replaced.
*/
PixelRendr.prototype.arrayReplace = function (array, removed, inserted) {
for (var i = 0; i < array.length; i += 1) {
if (array[i] === removed) {
array[i] = inserted;
}
}
return array;
};
/**
* Computes the sum of the differences of elements between two Arrays of
* equal length.
*
* @param a An Array of Numbers.
* @param b An Array of Numbers.
* @returns The sum of differences between a and b.
*/
PixelRendr.prototype.arrayDifference = function (a, b) {
var sum = 0, i;
for (i = a.length - 1; i >= 0; i -= 1) {
sum += Math.abs(a[i] - b[i]) | 0;
}
return sum;
};
/**
* Converts an Array to an Object mapping values to indices.
*
* @param array An Array to convert.
* @returns An Object with an index equal to each element of the Array.
*/
PixelRendr.prototype.getValueIndices = function (array) {
var output = {}, i;
for (i = 0; i < array.length; i += 1) {
output[array[i]] = i;
}
return output;
};
/**
* Follows a path inside an Object recursively, based on a given path.
*
* @param object An Object to delve within.
* @param path The ordered names of attributes to descend into.
* @param index The starting index in path.
* @returns A found element within object.
*/
PixelRendr.prototype.followPath = function (object, path, index) {
if (index < path.length && object.hasOwnProperty(path[index])) {
return this.followPath(object[path[index]], path, index + 1);
}
return object;
};
return PixelRendr;
})();
PixelRendr_1.PixelRendr = PixelRendr;
})(PixelRendr || (PixelRendr = {})); |
// Karma configuration
// Generated on Wed Nov 18 2015 17:58:09 GMT-0600 (CST)
var path = require('path');
var _ = require('lodash');
module.exports = function(config) {
config.set({
reportSlowerThan: 500,
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'./bower_components/mockfirebase/browser/mockfirebase.js',
'./bower_components/firebase/firebase.js',
'./bower_components/angular/angular.min.js',
'./bower_components/angularfire/dist/angularfire.min.js',
'./bower_components/angular-mocks/angular-mocks.js',
'./test*.js',
'./src/module.js',
'./src*.js',
'./src*.html'
],
// list of files to exclude
exclude: [],
// preprocess matching files before serving them to the browser
preprocessors: {
'src!(*.spec).js': ['coverage'],
'src*.html': ['ng-html2js']
},
<API key>: {
cacheIdFromPath: function(filepath) {
// example strips 'public/' from anywhere in the path
// module(app/templates/template.html) => app/public/templates/template.html
var newPath = filepath.replace(/^src\
return newPath;
},
moduleName: function (htmlPath, originalPath) {
var m = 'nowzoo.firebase.utils';
return m;
}
},
// test results reporter to use
// possible values: 'dots', 'progress', 'spec'
reporters: ['dots', 'coverage'],
coverageReporter: {
type : 'lcov',
dir : 'coverage/',
excludes: ['src*.spec.js']
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_DISABLE,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultanous
concurrency: Infinity
})
}; |
package de.danoeh.antennapod.menuhandler;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import android.widget.Toast;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.feed.FeedItem;
import de.danoeh.antennapod.core.feed.FeedMedia;
import de.danoeh.antennapod.core.gpoddernet.model.<API key>;
import de.danoeh.antennapod.core.gpoddernet.model.<API key>.Action;
import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.core.service.playback.PlaybackService;
import de.danoeh.antennapod.core.storage.DBTasks;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.storage.<API key>;
import de.danoeh.antennapod.core.util.IntentUtils;
import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.core.util.ShareUtils;
/**
* Handles interactions with the FeedItemMenu.
*/
public class FeedItemMenuHandler {
private static final String TAG = "FeedItemMenuHandler";
private FeedItemMenuHandler() {
}
/**
* Used by the MenuHandler to access different types of menus through one
* interface
*/
public interface MenuInterface {
/**
* Implementations of this method should call findItem(id) on their
* menu-object and call setVisibility(visibility) on the returned
* MenuItem object.
*/
abstract void setItemVisibility(int id, boolean visible);
}
/**
* This method should be called in the prepare-methods of menus. It changes
* the visibility of the menu items depending on a FeedItem's attributes.
*
* @param mi An instance of MenuInterface that the method uses to change a
* MenuItem's visibility
* @param selectedItem The FeedItem for which the menu is supposed to be prepared
* @param showExtendedMenu True if MenuItems that let the user share information about
* the FeedItem and visit its website should be set visible. This
* parameter should be set to false if the menu space is limited.
* @param queueAccess Used for testing if the queue contains the selected item
* @return Returns true if selectedItem is not null.
*/
public static boolean onPrepareMenu(Context context, MenuInterface mi, FeedItem selectedItem,
boolean showExtendedMenu, LongList queueAccess) {
if (selectedItem == null) {
return false;
}
boolean hasMedia = selectedItem.getMedia() != null;
boolean isPlaying = hasMedia
&& selectedItem.getState() == FeedItem.State.PLAYING;
FeedItem.State state = selectedItem.getState();
if (!isPlaying) {
mi.setItemVisibility(R.id.skip_episode_item, false);
}
boolean isInQueue = selectedItem.isTagged(FeedItem.TAG_QUEUE);
if(queueAccess == null || queueAccess.size() == 0 || queueAccess.get(0) == selectedItem.getId()) {
mi.setItemVisibility(R.id.move_to_top_item, false);
}
if(queueAccess == null || queueAccess.size() == 0 || queueAccess.get(queueAccess.size()-1) == selectedItem.getId()) {
mi.setItemVisibility(R.id.move_to_bottom_item, false);
}
if (!isInQueue || isPlaying) {
mi.setItemVisibility(R.id.<API key>, false);
}
if (!(!isInQueue && selectedItem.getMedia() != null)) {
mi.setItemVisibility(R.id.add_to_queue_item, false);
}
if (!showExtendedMenu || selectedItem.getLink() == null) {
mi.setItemVisibility(R.id.visit_website_item, false);
mi.setItemVisibility(R.id.share_link_item, false);
mi.setItemVisibility(R.id.<API key>, false);
}
if (!showExtendedMenu || !hasMedia || selectedItem.getMedia().getDownload_url() == null) {
mi.setItemVisibility(R.id.<API key>, false);
mi.setItemVisibility(R.id.<API key>, false);
}
if(false == hasMedia || selectedItem.getMedia().getPosition() <= 0) {
mi.setItemVisibility(R.id.<API key>, false);
mi.setItemVisibility(R.id.<API key>, false);
}
if (selectedItem.isPlayed()) {
mi.setItemVisibility(R.id.mark_read_item, false);
} else {
mi.setItemVisibility(R.id.mark_unread_item, false);
}
if(selectedItem.getMedia() == null || selectedItem.getMedia().getPosition() == 0) {
mi.setItemVisibility(R.id.reset_position, false);
}
if(false == UserPreferences.<API key>()) {
mi.setItemVisibility(R.id.<API key>, false);
mi.setItemVisibility(R.id.<API key>, false);
} else if(selectedItem.getAutoDownload()) {
mi.setItemVisibility(R.id.<API key>, false);
} else {
mi.setItemVisibility(R.id.<API key>, false);
}
if (selectedItem.getPaymentLink() == null || !selectedItem.getFlattrStatus().flattrable()) {
mi.setItemVisibility(R.id.support_item, false);
}
boolean isFavorite = selectedItem.isTagged(FeedItem.TAG_FAVORITE);
mi.setItemVisibility(R.id.<API key>, !isFavorite);
mi.setItemVisibility(R.id.<API key>, isFavorite);
return true;
}
/**
* The same method as onPrepareMenu(MenuInterface, FeedItem, boolean, QueueAccess), but lets the
* caller also specify a list of menu items that should not be shown.
*
* @param excludeIds Menu item that should be excluded
* @return true if selectedItem is not null.
*/
public static boolean onPrepareMenu(Context context, MenuInterface mi, FeedItem selectedItem,
boolean showExtendedMenu, LongList queueAccess, int... excludeIds) {
boolean rc = onPrepareMenu(context, mi, selectedItem, showExtendedMenu, queueAccess);
if (rc && excludeIds != null) {
for (int id : excludeIds) {
mi.setItemVisibility(id, false);
}
}
return rc;
}
public static boolean onMenuItemClicked(Context context, int menuItemId,
FeedItem selectedItem) throws <API key> {
switch (menuItemId) {
case R.id.skip_episode_item:
context.sendBroadcast(new Intent(PlaybackService.<API key>));
break;
case R.id.remove_item:
DBWriter.<API key>(context, selectedItem.getMedia().getId());
break;
case R.id.mark_read_item:
selectedItem.setPlayed(true);
DBWriter.markItemPlayed(selectedItem, FeedItem.PLAYED, false);
if(GpodnetPreferences.loggedIn()) {
FeedMedia media = selectedItem.getMedia();
// not all items have media, Gpodder only cares about those that do
if (media != null) {
<API key> actionPlay = new <API key>.Builder(selectedItem, Action.PLAY)
.currentDeviceId()
.currentTimestamp()
.started(media.getDuration() / 1000)
.position(media.getDuration() / 1000)
.total(media.getDuration() / 1000)
.build();
GpodnetPreferences.<API key>(actionPlay);
}
}
break;
case R.id.mark_unread_item:
selectedItem.setPlayed(false);
DBWriter.markItemPlayed(selectedItem, FeedItem.UNPLAYED, false);
if(GpodnetPreferences.loggedIn()) {
<API key> actionNew = new <API key>.Builder(selectedItem, Action.NEW)
.currentDeviceId()
.currentTimestamp()
.build();
GpodnetPreferences.<API key>(actionNew);
}
break;
case R.id.move_to_top_item:
DBWriter.moveQueueItemToTop(selectedItem.getId(), true);
return true;
case R.id.move_to_bottom_item:
DBWriter.<API key>(selectedItem.getId(), true);
case R.id.add_to_queue_item:
DBWriter.addQueueItem(context, selectedItem);
break;
case R.id.<API key>:
DBWriter.removeQueueItem(context, selectedItem, true);
break;
case R.id.<API key>:
DBWriter.addFavoriteItem(selectedItem);
break;
case R.id.<API key>:
DBWriter.removeFavoriteItem(selectedItem);
break;
case R.id.reset_position:
selectedItem.getMedia().setPosition(0);
DBWriter.markItemPlayed(selectedItem, FeedItem.UNPLAYED, true);
break;
case R.id.<API key>:
selectedItem.setAutoDownload(true);
DBWriter.<API key>(selectedItem, true);
break;
case R.id.<API key>:
selectedItem.setAutoDownload(false);
DBWriter.<API key>(selectedItem, false);
break;
case R.id.visit_website_item:
Uri uri = Uri.parse(selectedItem.getLink());
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
if(IntentUtils.isCallable(context, intent)) {
context.startActivity(intent);
} else {
Toast.makeText(context, context.getString(R.string.<API key>),
Toast.LENGTH_SHORT);
}
break;
case R.id.support_item:
DBTasks.<API key>(context, selectedItem);
break;
case R.id.share_link_item:
ShareUtils.shareFeedItemLink(context, selectedItem);
break;
case R.id.<API key>:
ShareUtils.<API key>(context, selectedItem);
break;
case R.id.<API key>:
ShareUtils.shareFeedItemLink(context, selectedItem, true);
break;
case R.id.<API key>:
ShareUtils.<API key>(context, selectedItem, true);
break;
default:
Log.d(TAG, "Unknown menuItemId: " + menuItemId);
return false;
}
// Refresh menu state
return true;
}
} |
require "nokogiri"
module DeviceCloud
class Monitor
RESOURCE_PATH = "/ws/Monitor"
attr_accessor :topic, :id, :element
def self.all(client)
xml_result = Nokogiri::XML.parse client.get RESOURCE_PATH
xml_result.xpath("//result/Monitor").map { |monitor| parse monitor }
end
def self.parse(xml)
topic = xml.xpath("monTopic").text
DeviceCloud::Monitor.new(topic, xml)
end
def initialize(topic, element = nil)
@topic = topic
@element = element
end
def resource_path
RESOURCE_PATH
end
def save(client)
response = client.post resource_path, build.to_xml
xml_res = Nokogiri::XML.parse response
@id = xml_res.xpath("//result/location").text
end
def delete(client)
raise NotImplementedError, "Incomplete"
puts client.delete resource_path
end
def update
end
def build
builder = Nokogiri::XML::Builder.new do |xml|
xml.Monitor {
xml.monTopic @topic
xml.monTransportType "http"
xml.monTransportUrl "https://staging.cleanintel.com/ivx/sync"
xml.monFormatType "json"
xml.monBatchSize 100
xml.monCompression "none"
xml.monBatchDuration 10
}
end
end
end
end |
<form>
<label>
First Name
<input type="text" id="first_name" value="" />
</label>
<label>
Last Name
<input type="text" id="first_name" value="" />
</label>
<label>
Phone
<input type="phone" id="phone" value="" />
</label>
<label>
Email
<input type="email" id="email" value="" />
</label>
<input type="submit" value="Add" />
</form> |
var WarArchive = {
imagesArray: null,
zoomIcon:'',
isTouch: document.createTouch !== undefined,
init: function(icon){
$(".archive-table tr").click(function(e){
WarArchive.zoomIcon = icon;
var index = $(".archive-table tr").index($(this)).toString();
WarArchive.fancyZoom(WarArchive.imagesArray[index]);
});
$.ajax({
url: '/bundles/armdmuseum/js/war-archive.json',
dataType: 'json',
success: function (data) {
for (var i in data) {
if (data.hasOwnProperty(i)) {
for (var j in data[i]) {
if (data[i].hasOwnProperty(j)) {
data[i][j] = {'href' : 'http://culture.ru/ru/uploads/media/war-archive/' + i + '/' + data[i][j]};
}
}
}
}
WarArchive.imagesArray = data;
},
error: function () {
alert('Error while loading war-archive.json');
}
})
},
fancyZoom: function(images) {
$.fancybox.open(images, {
autoSize: false,
scrolling: "no",
openEffect: 'none',
closeEffect: 'none',
prevEffect: 'none',
nextEffect: 'none',
helpers: {
title: null
},
mouseWheel: false,
afterLoad: function(){
},
beforeShow: function(){
$('.fancybox-image').css("visibility", "hidden");
},
afterShow: function() {
var $fbWrap = $($.fancybox.wrap),
winWidth = WarArchive.isTouch && window.innerWidth ? window.innerWidth : $(window).width(),
delta = winWidth - $fbWrap.width() - 50,
fbWrapWidth = ( delta > 0 ) ? $fbWrap.width() + delta : $fbWrap.width(),
zWidth = ( delta > 0 ) ? $.fancybox.inner.width() + delta : $.fancybox.inner.width();
$('.fancybox-image').css("visibility", "visible");
$('.fancybox-image').z({
width: zWidth,
height: $.fancybox.inner.height(),
initial_POSITION: "0, 0",
initial_ZOOM: $.fancybox.inner.width() / $('.fancybox-image').width() * 100,
button_ICON_IMAGE: WarArchive.zoomIcon,
border_SIZE: 0,
});
$fbWrap.css({'left':(winWidth - fbWrapWidth)/2,'width':fbWrapWidth});
},
onUpdate: function() {
var $fbInner = $($.fancybox.inner),
fbInnerHeight = $fbInner.height(),
$fbWrap = $($.fancybox.wrap),
winWidth = $(window).width(),
winWidth = WarArchive.isTouch && window.innerWidth ? window.innerWidth : $(window).width(),
delta = winWidth - $fbWrap.width() - 50,
fbWrapWidth = ( delta > 0 ) ? $fbWrap.width() + delta : $fbWrap.width(),
fbInnerWidth = ( delta > 0 ) ? $fbInner.width() + delta : $fbInner.width();
zoomer_.sW = fbInnerWidth;
zoomer_.sH = fbInnerHeight;
zoomer_.zoom = $.fancybox.inner.width() / $('.fancybox-image').width() * 100;
zoomer_.$holder.width(fbInnerWidth);
zoomer_.$holder.height(fbInnerHeight);
zoomer_.Reset();
$fbWrap.css({'left':(winWidth - fbWrapWidth)/2,'width':fbWrapWidth});
}
});
}
} |
#include <stdio.h>
#define NN 312
#define MM 156
#define MATRIX_A <API key>
#define UM <API key> /* Most significant 33 bits */
#define LM 0x7FFFFFFFULL /* Least significant 31 bits */
/* The array for the state vector */
static unsigned long long mt[NN];
/* mti==NN+1 means mt[NN] is not initialized */
static int mti=NN+1;
/* initializes mt[NN] with a seed */
void init_genrand64(unsigned long long seed)
{
mt[0] = seed;
for (mti=1; mti<NN; mti++)
mt[mti] = (<API key> * (mt[mti-1] ^ (mt[mti-1] >> 62)) + mti);
}
/* initialize by an array with array-length */
/* init_key is the array for initializing keys */
/* key_length is its length */
void init_by_array64(unsigned long long init_key[],
unsigned long long key_length)
{
unsigned long long i, j, k;
init_genrand64(19650218ULL);
i=1; j=0;
k = (NN>key_length ? NN : key_length);
for (; k; k
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 62)) * <API key>))
+ init_key[j] + j; /* non linear */
i++; j++;
if (i>=NN) { mt[0] = mt[NN-1]; i=1; }
if (j>=key_length) j=0;
}
for (k=NN-1; k; k
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 62)) * <API key>))
- i; /* non linear */
i++;
if (i>=NN) { mt[0] = mt[NN-1]; i=1; }
}
mt[0] = 1ULL << 63; /* MSB is 1; assuring non-zero initial array */
}
/* generates a random number on [0, 2^64-1]-interval */
unsigned long long genrand64_int64(void)
{
int i;
unsigned long long x;
static unsigned long long mag01[2]={0ULL, MATRIX_A};
if (mti >= NN) { /* generate NN words at one time */
/* if init_genrand64() has not been called, */
/* a default initial seed is used */
if (mti == NN+1)
init_genrand64(5489ULL);
for (i=0;i<NN-MM;i++) {
x = (mt[i]&UM)|(mt[i+1]&LM);
mt[i] = mt[i+MM] ^ (x>>1) ^ mag01[(int)(x&1ULL)];
}
for (;i<NN-1;i++) {
x = (mt[i]&UM)|(mt[i+1]&LM);
mt[i] = mt[i+(MM-NN)] ^ (x>>1) ^ mag01[(int)(x&1ULL)];
}
x = (mt[NN-1]&UM)|(mt[0]&LM);
mt[NN-1] = mt[MM-1] ^ (x>>1) ^ mag01[(int)(x&1ULL)];
mti = 0;
}
x = mt[mti++];
x ^= (x >> 29) & <API key>;
x ^= (x << 17) & <API key>;
x ^= (x << 37) & <API key>;
x ^= (x >> 43);
return x;
}
/* generates a random number on [0, 2^63-1]-interval */
long long genrand64_int63(void)
{
return (long long)(genrand64_int64() >> 1);
}
/* generates a random number on [0,1]-real-interval */
double genrand64_real1(void)
{
return (genrand64_int64() >> 11) * (1.0/9007199254740991.0);
}
/* generates a random number on [0,1)-real-interval */
double genrand64_real2(void)
{
return (genrand64_int64() >> 11) * (1.0/9007199254740992.0);
}
/* generates a random number on (0,1)-real-interval */
double genrand64_real3(void)
{
return ((genrand64_int64() >> 12) + 0.5) * (1.0/4503599627370496.0);
}
int main(void)
{
int i;
unsigned long long init[4]={0x12345ULL, 0x23456ULL, 0x34567ULL, 0x45678ULL}, length=4;
init_by_array64(init, length);
printf("1000 outputs of genrand64_int64()\n");
for (i=0; i<1000; i++) {
printf("%20llu ", genrand64_int64());
if (i%5==4) printf("\n");
}
printf("\n1000 outputs of genrand64_real2()\n");
for (i=0; i<1000; i++) {
printf("%10.8f ", genrand64_real2());
if (i%5==4) printf("\n");
}
return 0;
} |
#!/bin/bash
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# all copies or substantial portions of the Software.
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ABOUT
# A script to convert MySQL tables to InnoDB, or rebuild InnoDB tables.
# A simple (meaning zero validation of your usage) script to ALTER all tables to InnoDB Engine.
# If the table(s) are already InnoDB engine, they will be rebuilt, hence reclaiming fragmented space
# making this useful for just that operation on InnoDB.
# Assumptions: You have a ~/.my.cnf file in your home dir having user name and password with
# appropriate perissions. You can just just do this temporarily on your remote server.
# Test this on a clone of your server first to satisfy yourself with the results.
# Use at your own risk.
# If converting from MyISAM to InnoDB for the first time, it is best to configure InnoDB settings *before*
# first creating InnoDB tables.
# Argument(s): database name(s)
# Usage: $0 database1 [database2 database3 ...]
set -xv
DATABASES="$@"
echo "Converting all tables in ${DATABASES}..."
for DATABASE in $DATABASES
do
TABLES=`mysql --database=$DATABASE --skip-column-names --execute="SHOW TABLES;"`
for TABLE in $TABLES
do
mysql --database=$DATABASE --execute="ALTER TABLE $TABLE ENGINE=InnoDB;"
done
done |
// WARNING
// This file has been generated automatically by Xamarin Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;
namespace MvvmCrossPassaRegua.iOS.Views
{
[Register ("FirstView")]
partial class FirstView
{
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UILabel Label { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UITextField TextField { get; set; }
void <API key> ()
{
if (Label != null) {
Label.Dispose ();
Label = null;
}
if (TextField != null) {
TextField.Dispose ();
TextField = null;
}
}
}
} |
// KFTextField.h
// test001
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, <API key>) {
KFTextFieldNoVerify =0,
KFTextFieldNickname,
KFTextFieldNumberic,
KFTextFieldEmail
};
IB_DESIGNABLE
@interface KFTextField : UITextField <UITextFieldDelegate>
#pragma mark - Layout
@property (nonatomic) IBInspectable UIColor *kfBorderColor;
@property (nonatomic) IBInspectable UIColor *kfFocusBorderColor;
@property (nonatomic) IBInspectable CGFloat kfBorderWidth;
#pragma mark - Left SubView
@property (nonatomic) IBInspectable NSString *kfLeftText;
@property (nonatomic) IBInspectable UIColor *kfLeftColor;
@property (nonatomic) IBInspectable UIFont *kfLeftFont;
@property (nonatomic) IBInspectable UIColor *<API key>;
@property (nonatomic) IBInspectable CGFloat kfLeftWidth;
#pragma mark -- Border
@property (nonatomic) IBInspectable UIColor *kfLeftBorderColor;
@property (nonatomic) IBInspectable CGFloat kfLeftBorderWidth;
#pragma mark - Verify
/** TODO: add verify code */
@property (nonatomic) IBInspectable <API key> kfVerifyType;
@property (nonatomic) IBInspectable BOOL kfVerifed;
@property (nonatomic) IBInspectable UIColor *<API key>;
@property (nonatomic) IBInspectable UIColor *<API key>;
@end |
# CasperJS contributors
You can check out the [contribution graphs on github](https://github.com/n1k0/casperjs/graphs/contributors).
$ git shortlog -s -n | cut -c8-
Nicolas Perriault
oncletom
Brikou CARRE
hexid
hannyu
Julien Muetton
Chris Bosco
Matt Bowman
Chris Lorenzo
Victor Yap
JF Paradis
pborreli
nrabinowitz
Rob Barreca
Oleg Pudeyev
Tyler Ritchie
Darrell Hamilton
Solomon White
Andrew Childs
Luke Rodgers
Dave Lee
reina.sweet
Michael Geers
Jason Funk
Julien Moulin
Philip Hansen
Donovan Hutchinson
Reid Lynch
Reina Sweet
Elmar Langholz
Sean Massa
Thomas Rosenau
V Sreekanth
Vladimir Chizhov
Lee Byrd
Jan Schaumann
Clochix
snkashis
Andrew de Andrade
Ben Johnson
Ben Lowery
Charlie Park
Chris Winters
Christophe Benz
Harrison Reiser
Itamar Nabriski
Jan Pochyla
Jan-Martin Fruehwacht
Julian Gruber
Justin Slattery
Justine Tunney
KaroDidi
Leandro Boscariol
Maisons du monde
Marcel Duran
Mathieu Agopian
Mehdi Kabab
Mickaël Andrieu
Mikko Peltonen
Narno
Pascal Borreli
Rafael
Rafael Garcia
Raphaël Benitte
Rock Li
Tim Bunce
Yevgeny Smirnov
alfetopito
jean-philippe serafin |
FROM golang:alpine
COPY . /src
RUN cd /src/cmd/go && go build -mod=vendor -o /usr/bin/go
EXPOSE 8067
CMD ["/usr/bin/go", "--data=/data"] |
import React, { Component, PropTypes } from 'react';
/* Components */
import ProfileDetails from './ProfileDetails';
import ProfileLinkedTeams from './ProfileLinkedTeams';
import <API key> from './<API key>';
class Profile extends Component {
render() {
return (
<div id="Profile" className="list-group">
<ProfileDetails user={this.props.user}/>
<ProfileLinkedTeams {...this.props}/>
<<API key> {...this.props}/>
</div>
);
}
}
Profile.defaultProps = {
canLink: false,
canUnlink: false
};
Profile.propTypes = {
canLink: PropTypes.bool.isRequired,
canUnlink: PropTypes.bool.isRequired,
onLink: PropTypes.func,
onUnlink: PropTypes.func,
user: PropTypes.shape({
id: PropTypes.string.isRequired
}).isRequired
};
export default Profile; |
# PathSymbol3DLayer
PathSymbol3DLayer renders polyline geometries by extruding a 2D profile along the line, resulting in visualizations like tubes, walls, etc.
**Referenced by:** [LineSymbol3D](lineSymbol3D.md)
Properties
| Property | Details
|
| anchor | The position of the extrusion profile with respect to the polyline geometry.<br>If property is present, must be one of the following values: <ul><li>`bottom`</li><li>`center`</li><li>`top`</li></ul>
| cap | Shape of the beginning and the end of each line geometry.<br>If property is present, must be one of the following values: <ul><li>`butt`</li><li>`none`</li><li>`round`</li><li>`square`</li></ul>
| castShadows | Boolean to control the shadow casting behaviour of the rendered geometries.
| enable | Type:`Boolean`
| height | Path height in meters. If unspecified, it is equal to `width`.
| join | Shape of the intersection of two line segments.<br>If property is present, must be one of the following values: <ul><li>`bevel`</li><li>`miter`</li><li>`round`</li></ul>
| [material](material.md) | The material used to shade the geometry.
| profile | The shape which is extruded along the line.<br>If property is present, must be one of the following values: <ul><li>`circle`</li><li>`quad`</li></ul>
| profileRotation | Specifies the axes about which the profile may be rotated at the joins. Constraining the rotation axes leads to a fixed orientation of the profile for the specified directions.<br>If property is present, must be one of the following values: <ul><li>`all`</li><li>`heading`</li></ul>
| size | Path size (diameter) in meters. Ignored if either `width` or `height` are present.
| type | Specifies the type of symbol used.<br>Value of this property must be `Path`
| width | Path width in meters. If unspecified, it is equal to `height`.
Red tube Example
json
{
"symbolLayers": [
{
"type": "Path",
"material": {
"color": [
255,
0,
0
]
},
"size": 12
}
]
}
Thin wall Example
json
{
"symbolLayers": [
{
"type": "Path",
"profile": "quad",
"width": 0,
"height": 50,
"anchor": "bottom",
"profileRotation": "heading"
}
]
}
Strip Example
json
{
"symbolLayers": [
{
"type": "Path",
"profile": "quad",
"width": 10,
"height": 1,
"anchor": "center",
"profileRotation": "heading"
}
]
} |
#!/usr/bin/env node
var util = require('util'),
colors = require('colors'),
formatNumber = require('format-number')(),
minimist = require('minimist'),
musicVideo = require('youtube-best-video').findBestMusicVideo,
search = require('youtube-search'),
slashes = require('slashes'),
timelabel = require('timelabel'),
youtubeId = require('get-youtube-id'),
package = require('./package');
var FORMATS = {
'%t': 'title',
'%a': 'author',
'%d': 'description',
'%D': 'duration',
'%c': 'category',
'%T': 'thumbnail',
'%v': 'views',
'%f': 'favorites',
'%u': 'url',
'%p': 'published'
},
FPCENT = String.fromCharCode(65285),
MINIHOST = 'https://youtu.be/%s',
PRETTY =
colors.bold('%t') + ' (uploader: %a, views: ' + colors.green('%v')
+ ')\n' +
colors.bold('duration: ') + '%D\n' +
colors.bold('thumbnail: ') + '%T\n' +
colors.bold('description: ') + '%d\n' +
colors.bold('watch: ') + '%u\n\n';
var argv = minimist(process.argv.slice(2)),
terms = argv._.join(' '),
help = !!(argv.h || argv.help),
limit = +(argv.l || argv.limit) || 1,
offset = +(argv.o || argv.offset) || 1,
music = !!(argv.m || argv.music),
format = (argv.f || argv.format) || '%u',
pretty = (argv.p || argv.pretty),
nostrip = !!argv.nostrip,
inhuman = !!argv.inhuman;
if (pretty) {
format = PRETTY;
}
if (!nostrip) {
format = slashes.strip(format);
}
function showHelp() {
var formats;
console.log(colors.bold(package.name + ' - ' + package.version));
console.log(package.description + '\n');
formats = Object.keys(FORMATS).reduce(function (list, symbol) {
return list + '\t' + symbol + ' - ' + FORMATS[symbol] + '\n';
}, '');
console.log([
'Usage: ytsearch ' + colors.underline('<terms>')
+ ' ' + colors.bold('[options]') + '\n',
colors.bold('-h, --help'),
'\tDisplay this screen.',
colors.bold('-p, --pretty'),
'\tSets the format to something pleasing to look at.',
'\tdefault: ' + colors.underline('false'),
colors.bold('-f, --format') + ' ' +
colors.underline('"' + Object.keys(FORMATS).join(' ') + '"'),
'\tFormat a video\'s meta data with a specific format string.\n',
formats,
'\tdefault: ' + colors.underline('"%u"'),
colors.bold('-l, --limit') + ' ' + colors.underline('<number>'),
'\tLimit the amount of videos returned by the specified number.',
'\tdefault: ' + colors.underline('1'),
colors.bold('-o, --offset') + ' ' + colors.underline('<number>'),
'\tOffset the returned videos by the specified number.',
'\tdefault: ' + colors.underline('1'),
colors.bold('-m, --music'),
'\tSelect the best music track for the specified terms. Note that this',
'\tflag ignores limit and offset if set as it only returns one video.',
'\tdefault: ' + colors.underline('false'),
colors.bold('--nostrip'),
'\tDon\'t strip the backslashes from the format string.',
'\tdefault: ' + colors.underline('false'),
colors.bold('--inhuman'),
'\tDon\'t humanize any of the meta information.',
'\tdefault: ' + colors.underline('false')
].join('\n'));
}
function formatVideo(video) {
var display = format.slice();
// Replace "%" with full-width percents.
video.title = video.title.replace('%', FPCENT);
if (video.description) {
video.description = video.description.replace('%', FPCENT);
} else {
video.description = '';
}
video.url = util.format(MINIHOST, youtubeId(video.url));
try {
video.thumbnail = video.thumbnails[0].url;
} catch (e) {
video.thumbnail = '';
}
video.views = +video.statistics.viewCount || 0;
video.favorites = +video.statistics.favouriteCount || 0;
if (!inhuman) {
video.duration = timelabel((+video.duration * 1000) || 0, true);
video.views = formatNumber(video.views);
video.favorites = formatNumber(video.favorites);
}
Object.keys(FORMATS).forEach(function (symbol) {
if (format.indexOf(symbol) === -1) {
return;
}
display = display.replace(symbol, video[FORMATS[symbol]]);
});
return display;
}
if (help || !terms) {
return showHelp();
}
if (music) {
return musicVideo(terms, function (err, video) {
if (err) {
return console.error(err.stack);
}
process.stdout.write(formatVideo(video));
});
}
search(terms, {
startIndex: offset,
maxResults: limit
}, function (err, videos) {
if (err) {
return console.error(err.stack);
}
videos.forEach(function (video) {
process.stdout.write(formatVideo(video));
});
}); |
extern int <API key>(void);
int test_fun(int x, int y, int z)
{
int c = 0;
while ((x > y) && (x > z)) {
y = y + 1;
z = z + 1;
c = c + 1;
}
return c;
}
int main() {
return test_fun(<API key>(), <API key>(), <API key>());
} |
using System;
namespace Bluehands.Hypermedia.Client.Hypermedia.Attributes
{
[AttributeUsage(AttributeTargets.Property)]
public sealed class MandatoryAttribute : Attribute
{
}
} |
# SPA_project
Single-page web application using the Flask framework for Data Representation project
The module is taught to undergraduate students at [GMIT](http:
The lecturer is [Ian McLoughlin](https://ianmcloughlin.github.io).
# Web Application Project
# Data Representation and Querying Project 2016
Project Overview
I have created a Single-Page Web Application (SPA) that lets users calculate BMI.
This application was selected after some deliberation.
Initially, I considered three different applications:
1. A [Power supply calculator](http://outervision.com/<API key>) alternative.
2. A [BMI calculator](http:
3. A [Yelp](https:
I chose BMI calculator after some consideration, as I were more interested in the idea.
The project was guided by the following excerpt from the project instructions:
>You are required to develop a single-page web application(SPA) written in the programming language Python using the Flask framework.
You must devise an idea for a web application, write the software, write documentation explaining how the application works, and write a short user guide for it.
How to run the application
The application is written using the [Flask](http:
Both must be installed to run the project.
Jinja2 was used for html inheritance.
Once these prerequisites are installed, the application can be run locally:
bash
$ python run.py
Once the application is running, it can be accessed by pointing your browser at http://127.0.0.1:5000/ .
Architecture
This web application runs in [Python 3](https:
Python 3 and Flask were requirements for the project.
I chose SQLite as it is easy to use and does not require much setup to get the web application up and running.
Reference
BMI.js file Adapted from: http://blog.excelstrategiesllc.com/2014/11/18/<API key>
App Template Adapted from: https://github.com/mjhea0/thinkful-mentor/tree/master/python/jinja/flask_example |
require File.dirname(__FILE__) + '/../../spec_helper'
require 'cucumber/ast/tags'
module Cucumber
module Ast
describe Tags do
describe "#matches" do
it "should AND tags which are are in a list" do
Tags.matches?(['@one','@two','@three'], [['@one','@two']]).should == true
Tags.matches?(['@one','@three'], [['@one','@two']]).should == false
end
it "should OR tags in different lists" do
Tags.matches?(['@one'], [['@one'], ['@two']]).should == true
end
it "should AND and OR tags" do
Tags.matches?(['@one','@two'], [['@one'],['@two','@four']]).should == true
end
it "should NOT tags" do
Tags.matches?(['@one','@three'], [['@one', '~@two']]).should == true
Tags.matches?(['@one','@three'], [['~@one']]).should == false
end
end
end
end
end |
require 'forwardable'
module Decaptcha
class Client
extend Forwardable
attr_accessor :provider
PROVIDERS = {
:dbc_http => Decaptcha::Provider::DeathByCaptcha::HTTP,
:dbc_socket => Decaptcha::Provider::DeathByCaptcha::Socket,
}
def initialize(provider_name, provider_options = {})
@provider = PROVIDERS[provider_name.to_sym].new provider_options
end
def_delegators :@provider, :connect, :upload, :upload_and_poll, :result, :invalid, :delete, :balance
end
end |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<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.8"/>
<title>Faeris: E:/CodeSpace/Faeris/lib/libfaeris/src/sys/thread/FsConditionVariable.h Source File</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/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</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">Faeris
 <span id="projectnumber">v3.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<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="annotated.html"><span>Classes</span></a></li>
<li class="current"><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="files.html"><span>File List</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)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<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="<API key>.html">Faeris</a></li><li class="navelem"><a class="el" href="<API key>.html">lib</a></li><li class="navelem"><a class="el" href="<API key>.html">libfaeris</a></li><li class="navelem"><a class="el" href="<API key>.html">src</a></li><li class="navelem"><a class="el" href="<API key>.html">sys</a></li><li class="navelem"><a class="el" href="<API key>.html">thread</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">FsConditionVariable.h</div> </div>
</div><!--header
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment"></span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">/* FsConditionVariable.h */</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"></span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"></span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"></span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"></span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">/* a copy of this software and associated documentation files (the */</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">/* "Software"), to deal in the Software without restriction, including */</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">/* without limitation the rights to use, copy, modify, merge, publish, */</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"></span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">/* permit persons to whom the Software is furnished to do so, subject to */</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">/* the following conditions: */</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"></span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"></span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">/* included in all copies or substantial portions of the Software. */</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"></span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"></span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment">/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"></span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment">/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment">/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment">/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"></span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#ifndef <API key></span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#define <API key></span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include <pthread.h></span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "FsMacros.h"</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> NS_FS_BEGIN </div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keyword">class </span><a class="code" href="class_mutex.html">Mutex</a>;</div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="<API key>.html"> 38</a></span> <span class="keyword">class </span><a class="code" href="<API key>.html">ConditionVariable</a> </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> {</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <a class="code" href="<API key>.html">ConditionVariable</a>();</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  ~<a class="code" href="<API key>.html">ConditionVariable</a>();</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keywordtype">int</span> wait(<a class="code" href="class_mutex.html">Mutex</a>* mutex);</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordtype">int</span> signal();</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keywordtype">int</span> broadcast();</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  pthread_cond_t m_cond;</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> };</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> NS_FS_END </div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor">#endif </span><span class="comment">/*<API key>*/</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div>
<div class="ttc" id="<API key>"><div class="ttname"><a href="<API key>.html">ConditionVariable</a></div><div class="ttdef"><b>Definition:</b> <a href="<API key>.html#l00038">FsConditionVariable.h:38</a></div></div>
<div class="ttc" id="class_mutex_html"><div class="ttname"><a href="class_mutex.html">Mutex</a></div><div class="ttdef"><b>Definition:</b> <a href="_fs_mutex_8h_source.html#l00038">FsMutex.h:38</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Jan 23 2015 17:58:36 for Faeris by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html> |
<div class="<API key> container hidden-xs">
<a class="navbar-brand" href="<?php echo esc_url(home_url('/')); ?>">
<img src="<?php echo get_bloginfo('url') ?>/assets/img/less-logo_208x100.jpg" alt="LESS 17" width="208" height="100" />
</a>
<div class="pull-right header-right">
<p class="phone-number"><a href="tel:1-403-228-9199">1.403.228.9199</a></p>
<p class="address">930 17TH AVE SW</p>
<p class="address">CALGARY, AB</p>
</div>
</div>
<header class="banner navbar navbar-default" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand visible-xs-block" href="<?php echo esc_url(home_url('/')); ?>">
<img src="<?php echo get_bloginfo('url') ?>/assets/img/less-logo_208x100.jpg" alt="LESS 17" width="80"/>
</a>
</div>
<nav class="collapse navbar-collapse" role="navigation">
<?php
if (has_nav_menu('primary_navigation')) :
wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav navbar-nav'));
endif;
?>
</nav>
</div>
</header> |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (version 1.7.0_03) on Wed May 01 12:49:30 CEST 2013 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>net.sourceforge.pmd.lang.java.rule.basic (PMD 5.0.4 API)</title>
<meta name="date" content="2013-05-01">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<h1 class="bar"><a href="../../../../../../../net/sourceforge/pmd/lang/java/rule/basic/package-summary.html" target="classFrame">net.sourceforge.pmd.lang.java.rule.basic</a></h1>
<div class="indexContainer">
<h2 title="Classes">Classes</h2>
<ul title="Classes">
<li><a href="<API key>.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame"><API key></a></li>
<li><a href="<API key>.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame"><API key></a></li>
<li><a href="<API key>.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame"><API key></a></li>
<li><a href="<API key>.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame"><API key></a></li>
<li><a href="<API key>.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame"><API key></a></li>
<li><a href="<API key>.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame"><API key></a></li>
<li><a href="BrokenNullCheckRule.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame">BrokenNullCheckRule</a></li>
<li><a href="CheckResultSetRule.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame">CheckResultSetRule</a></li>
<li><a href="CheckSkipResultRule.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame">CheckSkipResultRule</a></li>
<li><a href="<API key>.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame"><API key></a></li>
<li><a href="<API key>.html" title="class in net.sourceforge.pmd.lang.java.rule.basic" target="classFrame"><API key></a></li>
</ul>
</div>
</body>
</html> |
'use strict';
const color = require('../config/color');
let demFeels = function () {};
demFeels.getEmotes = function () {
return {};
};
try {
demFeels = require('dem-feels');
} catch (e) {
console.error(e);
}
exports.parseEmoticons = parseEmoticons;
// for travis build
if (typeof demFeels.extendEmotes === 'function') {
// example extending emotes
demFeels.extendEmotes({
"wandoge":"http://i.imgur.com/N940pnA.png",
"feelswrm":"http://i.imgur.com/538WHXw.png",
"datboi":"http://i.imgur.com/h0XMIKj.gif",
"oshaswag":"http://orig08.deviantart.net/a30d/f/2015/010/5/8/<API key>.gif",
"oshascared":"http://orig08.deviantart.net/a43c/f/2014/319/4/a/<API key>.gif",
"oshajig":"http://orig08.deviantart.net/8dc5/f/2014/278/9/9/<API key>.gif",
"oshablush":"http://orig03.deviantart.net/b3cb/f/2014/361/7/b/<API key>.gif",
"oshahp":"http://orig00.deviantart.net/0774/f/2014/339/1/a/<API key>.gif",
"oshayep":"http://orig13.deviantart.net/63e7/f/2014/287/b/0/<API key>.gif",
"oshalol":"http://orig13.deviantart.net/3110/f/2014/333/9/e/<API key>.gif",
"oshacri":"http://orig00.deviantart.net/4753/f/2014/299/3/1/<API key>.gif",
"arkenosha":"http://orig03.deviantart.net/9ab0/f/2011/023/b/a/<API key>.jpg",
"oshasad":"http://orig12.deviantart.net/4fd7/f/2015/226/4/c/<API key>.gif",
"oshamad":"http://orig11.deviantart.net/e529/f/2013/232/2/1/<API key>.png",
"oshakink":"http://orig03.deviantart.net/71a3/f/2015/331/e/1/<API key>.png",
"oshalove":"https://embed.gyazo.com/<API key>.png",
"oshawink":"http://66.media.tumblr.com/<API key>/<API key>.gif",
"feelsmeta":"http://scontent.cdninstagram.com/t51.2885-15/s480x480/e15/<API key>.jpg?ig_cache_key=<API key>%3D%3D.2",
"hitmonfeels":"http://farm1.static.flickr.com/610/<API key>.jpg",
"feelsirn":"http://66.media.tumblr.com/<API key>/<API key>.png",
"feelsbell":"http://67.media.tumblr.com/<API key>/<API key>.gif",
"llamanv":"http:
'4Head': 'https://static-cdn.jtvnw.net/emoticons/v1/354/1.0',
'
'(ditto)': 'https://cdn.betterttv.net/emote/<API key>/2x',
'BlueCatz': 'http://i.imgur.com/v7UdPzU.png',
'Cate': 'http://i.imgur.com/728AQQN.jpg',
'DansGame': 'https://static-cdn.jtvnw.net/emoticons/v1/33/1.0',
'Doge': 'http://fc01.deviantart.net/fs71/f/2014/279/4/5/<API key>.png',
'EleGiggle': 'https://static-cdn.jtvnw.net/emoticons/v1/4339/2.0',
'enteimixtape': 'http://i.imgur.com/Zz5B7At.png',
'enteirawr': 'http://i.imgur.com/HZWoAMx.gif',
'FacePalm': 'http://i.imgur.com/lv3GmpM.png',
'FailFish': 'https://static-cdn.jtvnw.net/emoticons/v1/360/1.0',
'feelsackbr': 'http://i.imgur.com/BzZJedC.jpg?1',
'feelsamy': 'http://i.imgur.com/Aw8KAmi.gif',
'feelsapple': 'http://i.imgur.com/h42wGYF.gif',
'feelsarken': 'http://imgur.com/YCCDZWq.png',
'feelsasl': 'http://i.imgur.com/ZQbYp9l.gif',
'feelsbadHD': 'https://cdn.betterttv.net/emote/<API key>/2x',
'feelsbald': 'http://i.imgur.com/Gv2BFxs.png',
'feelsbd': 'http://i.imgur.com/YyEdmwX.png',
'feelsbebop': 'http://i.imgur.com/TDwC3wL.png',
'feelsbirb': 'http://i.imgur.com/o4KxmWe.png',
'feelsbm': 'http://i.imgur.com/xwfJb2z.png',
'feelsbn': 'http://i.imgur.com/wp51rIg.png',
'feelsbt': 'http://i.imgur.com/rghiV9b.png',
'feelsbunny': 'http://orig04.deviantart.net/a762/f/2012/352/9/5/<API key>.gif',
'feelschar': 'http://orig04.deviantart.net/9abc/f/2013/118/8/e/<API key>.gif',
'feelschime': 'http://i.imgur.com/uIIBChH.png',
'feelscool': 'http://i.imgur.com/qdGngVl.jpg?1',
'feelscop': 'http://i.imgur.com/eNaFHvR.png?1',
'feelscrazy': 'http://i.imgur.com/NiJsT5W.png',
'feelscri': 'http://i.imgur.com/QAuUW7u.jpg?1',
'feelscute': 'https://cdn.betterttv.net/emote/<API key>/2x',
'feelscx': 'http://i.imgur.com/zRSUw2n.gif',
'feelsdd': 'http://i.imgur.com/fXtdLtV.png',
'feelsdell': 'http://i.imgur.com/1CgwuDz.jpg',
'feelsdoge': 'http://i.imgur.com/GklYWvi.png',
'feelsdrg': 'http://i.imgur.com/UZzWcA3.png',
'feelsemo': 'http://i.imgur.com/FPolh5d.jpg',
'feelsentei': 'http://i.imgur.com/Wxc10fM.jpg',
'feelsevil': 'http://i.imgur.com/zOemc0n.png',
'feelsfdra': 'http://i.imgur.com/ZIcl9Zy.jpg',
'feelsfloat': 'http://i.imgur.com/XKP1Kpf.gif',
'feelsfro': 'http://i.imgur.com/ijJakJT.png',
'feelsgay': 'http://i.imgur.com/zQAacwu.png?1',
'feelsgm': 'https://cdn.betterttv.net/emote/<API key>/2x',
'feelsgn': 'http://i.imgur.com/juJQh0J.png',
'feelsgro': 'http://i.imgur.com/jLhP0bZ.png?1',
'feelshigh': 'http://i.imgur.com/s9I2bxp.jpg?1',
'feelshlwn': 'http://i.imgur.com/OHMDVNJ.jpg',
'feelsho': 'http://i.imgur.com/J4oUHm2.png?1',
'feelshp': 'http://i.imgur.com/1W19BDG.png',
'feelsilum': 'http://i.imgur.com/CnyGTTD.png',
'feelsjig': 'http://i.imgur.com/hSzqy5z.png?1',
'feelsjpn': 'http://i.imgur.com/Zz2WrQf.jpg',
'feelskawaii': 'http://i.imgur.com/kLnDaYD.png',
'feelsky': 'http://i.imgur.com/BtATPId.png?1',
'feelslag': 'https://cdn.betterttv.net/emote/<API key>/2x',
'feelslelouch': 'http://i.imgur.com/qZrV75o.png',
'feelsllama': 'http://i.imgur.com/oSLSk2I.gif',
'feelslot': 'http://i.imgur.com/tl88F7i.png?1',
'feelslug': 'http://i.imgur.com/REEBSOT.png?1',
'feelslux': 'http://i.imgur.com/hDKCZMt.gif',
'feelsmd': 'http://i.imgur.com/DJHMdSw.png',
'feelsmerry': 'https://cdn.betterttv.net/emote/<API key>/2x',
'feelsmixtape': 'http://i.imgur.com/7lncwng.png',
'feelsmmyea': 'https://cdn.betterttv.net/emote/<API key>/2x',
'feelsns': 'http://i.imgur.com/jYRFUYW.jpg?1',
'feelsnv': 'http://i.imgur.com/XF6kIdJ.png',
'feelsohwait': 'https://cdn.betterttv.net/emote/<API key>/2x',
'feelsok': 'http://i.imgur.com/gu3Osve.png',
'feelsorange': 'http://i.imgur.com/3fxXP16.jpg',
'feelspanda': 'http://i.imgur.com/qi7fue9.png',
'feelspaul': 'http://imgur.com/KuDZMJR.png',
'feelsPika': 'http://i.imgur.com/eoTrTkn.png?1',
'feelspika': 'http://i.imgur.com/mBq3BAW.png',
'feelspink': 'http://i.imgur.com/jqfB8Di.png',
'feelspix': 'http://cbc.pokecommunity.com/config/emoticons/pix.png',
'feelsspl': 'http://i.imgur.com/RIOKSJ3.gif',
'feelspn': 'http://i.imgur.com/wSSM6Zk.png',
'feelspoli': 'http://i.imgur.com/FnzhrWa.jpg?1',
'feelsPoli': 'http://i.imgur.com/sbKhXZE.jpg?1',
'feelspuke': 'http://i.imgur.com/nQbRspU.png?1',
'feelsrb': 'http://i.imgur.com/L6ak1Uk.png',
'feelsreally': 'https://cdn.betterttv.net/emote/<API key>/2x',
'feelsrekt': 'http://i.imgur.com/aNJyMr7.gif',
'feelsrg': 'http://i.imgur.com/DsRQCsI.png',
'feelsrs': 'http://i.imgur.com/qGEot0R.png',
'feelssad': 'https://cdn.betterttv.net/emote/<API key>/2x',
'feelssakis': 'http://i.imgur.com/yThm3fM.png?1',
'feelssammich': 'http://i.imgur.com/sVgkUF1.png?1',
'feelssaur': 'http://i.imgur.com/XABxFfF.jpg',
'feelssc': 'http://i.imgur.com/cm6oTZ1.png',
'feelsserp': 'http://i.imgur.com/PtCTxmY.png',
'feelsseis': 'http://i.imgur.com/gGGYxrE.png?1',
'feelsshi': 'http://i.imgur.com/VzlGZ1M.jpg',
'feelsshrk': 'http://i.imgur.com/amTG3jF.jpg',
'feelssht': 'http://i.imgur.com/s9owArF.png?1',
'feelsslo': 'http://i.imgur.com/iQuToJf.jpg?1',
'feelssnail': 'http://i.imgur.com/wf2ajCR.jpg',
'feelssnake': 'http://i.imgur.com/xoJnDUD.png',
'feelstea': 'http://i.imgur.com/M0f2zgJ.jpg?1',
'feelstired': 'http://i.imgur.com/EgYViOs.jpg',
'feelstrump': 'http://i.imgur.com/tqW8s6Y.png',
'feelsvolc': 'http://i.imgur.com/QXlKzZd.png?1',
'feelsvpn': 'http://i.imgur.com/ODTZISl.gif',
'feelsweird': 'https://cdn.betterttv.net/emote/<API key>/2x',
'feelswin': 'http://i.imgur.com/rbs9pZG.png?1',
'feelswndo': 'http://media.tumblr.com/<API key>/<API key>.gif',
'feelsya': 'https://cdn.betterttv.net/emote/<API key>/2x',
'funnylol': 'http://i.imgur.com/SlzCghq.png',
'gachiGASM': 'https://cdn.betterttv.net/emote/<API key>/2x',
'gudone': 'http://i.imgur.com/USkp1b9.png',
'gudsht': 'http://i.imgur.com/R9SO76u.png?1',
'happyface': 'http://imgur.com/krzCL3j.jpg',
'hmmface': 'http://i.imgur.com/Z5lOwfZ.png',
'hoSway': 'https://cdn.betterttv.net/emote/<API key>/2x',
'hypnotoad': 'http://i.imgur.com/lJtbSfl.gif',
'jcena': 'http://i.imgur.com/hPz30Ol.jpg?2',
'Kappa': 'http://i.imgur.com/ZxRU4z3.png?1',
'kappapride': 'http://i.imgur.com/GMs8OxU.jpg',
'Kreygasm': 'https://static-cdn.jtvnw.net/emoticons/v1/41/1.0',
'lelefp': 'http://i.imgur.com/pWlEKa3.jpg',
'lelelol': 'http://i.imgur.com/R2g0RHT.gif',
'lelewhat': 'http://i.imgur.com/capG93y.png',
'Lennyf': 'http://i.imgur.com/FhOwY2P.png',
'llamacool': 'http://i.imgur.com/X1x3728.gif',
'llamanoodle': 'http://i.imgur.com/SUZkz5p.gif',
'llamarawr': 'http://i.imgur.com/KWAQbPu.gif',
'llamatea': 'http://i.imgur.com/nJnakEU.gif',
'llamayawn': 'http://i.imgur.com/SVj8kBt.gif',
'meGusta': 'http://cdn.overclock.net/3/36/<API key>.png',
'MingLee': 'https://static-cdn.jtvnw.net/emoticons/v1/68856/2.0',
'noface': 'http://i.imgur.com/H744eRE.png',
'Obama': 'http://i.imgur.com/rBA9M7A.png',
'oshet': 'http://i.imgur.com/yr5DjuZ.png',
'PeoplesChamp': 'http://i.imgur.com/QMiMBKe.png',
'PogChamp': 'https://static-cdn.jtvnw.net/emoticons/v1/88/1.0',
'RareChar': 'https://cdn.betterttv.net/emote/<API key>/2x',
'Sanic': 'http://i.imgur.com/Y6etmna.png',
'stevo': 'http://imgur.com/Gid6Zjy.png',
'thumbsup': 'http://i.imgur.com/eWcFLLn.jpg',
'trollface': 'http://cdn.overclock.net/a/a0/<API key>.png',
'trumpW': 'https://static-cdn.jtvnw.net/emoticons/v1/35218/1.0',
'wtfman': 'http://i.imgur.com/kwR8Re9.png',
'WutFace': 'https://static-cdn.jtvnw.net/emoticons/v1/28087/2.0',
'xaa': 'http://i.imgur.com/V728AvL.png',
'Xaaentei': 'http://i.imgur.com/FgsNIPv.png',
'xoxo': 'http://orig00.deviantart.net/b49d/f/2014/220/5/3/<API key>.png',
'yayface': 'http://i.imgur.com/anY1jf8.png',
'yesface': 'http://i.imgur.com/k9YCF6K.png',
'youdontsay': 'http://r32.imgfast.net/users/3215/23/26/64/smiles/280467785.jpg',
'bomaye': 'http://i.imgur.com/cuDGGJW.gif',
'dedchat': 'http://i.imgur.com/W39kJHu.jpg',
'disarmher': 'http://i.imgur.com/y0gYGSx.gif',
'feelspac': 'http://i.imgur.com/Dc9DBUz.png',
'feelskink': 'http://i.imgur.com/ubnzm6w.gif',
'feelsok': 'http://i.imgur.com/gu3Osve.png',
'feelspika': 'http://i.imgur.com/mBq3BAW.png',
'feelspink': 'http://i.imgur.com/jqfB8Di.png',
'feelspn': 'http://i.imgur.com/wSSM6Zk.png',
'feelspr': 'http://i.imgur.com/3VtkKfJ.png',
'feelsrg': 'http://i.imgur.com/DsRQCsI.png',
'feelsrs': 'http://i.imgur.com/qGEot0R.png',
'feelssc': 'http://i.imgur.com/cm6oTZ1.png',
'feelstea': 'http://i.imgur.com/XQc8yZ2.gif',
'Focus': 'http://i.imgur.com/dUN6xWl.gif',
'noface': 'http://i.imgur.com/H744eRE.png',
'welldone': 'http://i.imgur.com/DfKT8GL.gif',
'Work': 'http://i.imgur.com/C6veCvt.gif',
'yousee': 'http://i.imgur.com/fjFRa6m.gif',
});
}
const emotes = demFeels.getEmotes();
const emotesKeys = Object.keys(emotes).sort();
/**
* Parse emoticons in message.
*
* @param {String} message
* @param {Object} room
* @param {Object} user
* @param {Boolean} pm - returns a string if it is in private messages
* @returns {Boolean|String}
*/
function parseEmoticons(message, room, user, pm) {
if (typeof message !== 'string' || (!pm && room.disableEmoticons)) return false;
let match = false;
let len = emotesKeys.length;
while (len
if (message && message.indexOf(emotesKeys[len]) >= 0) {
match = true;
break;
}
}
if (!match) return false;
// escape HTML
message = Tools.escapeHTML(message);
// add emotes
message = demFeels(message);
// __italics__
message = message.replace(/\_\_([^< ](?:[^<]*?[^< ])?)\_\_(?![^<]*?<\/a)/g, '<i>$1</i>');
// **bold**
message = message.replace(/\*\*([^< ](?:[^<]*?[^< ])?)\*\*/g, '<b>$1</b>');
let group = user.getIdentity().charAt(0);
if (room.auth) group = room.auth[user.userid] || group;
let style = "background:none;border:0;padding:0 5px 0 0;font-family:Verdana,Helvetica,Arial,sans-serif;font-size:9pt;cursor:pointer";
message = "<div class='chat'>" + "<small>" + group + "</small>" + "<button name='parseCommand' value='/user " + user.name + "' style='" + style + "'>" + "<b><font color='" + color(user.userid) + "'>" + user.name + ":</font></b>" + "</button><em class='mine'>" + message + "</em></div>";
if (pm) return message;
room.addRaw(message);
return true;
}
/**
* Create a two column table listing emoticons.
*
* @return {String} emotes table
*/
function create_table() {
let emotes_name = Object.keys(emotes);
let emotes_list = [];
let emotes_group_list = [];
let len = emotes_name.length;
for (let i = 0; i < len; i++) {
emotes_list.push("<td style='padding: 5px; box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5) inset; border-radius: 5px;'>" + "<img src='" + emotes[emotes_name[i]] + "'' title='" + emotes_name[i] + "' height='50' width='50' style='vertical-align: middle; padding-right: 5px;' />" + emotes_name[i] + "</td>");
}
for (let i = 0; i < len; i += 4) {
let emoteOutput = [emotes_list[i], emotes_list[i + 1], emotes_list[i + 2], emotes_list[i + 3]];
if (i < len) emotes_group_list.push("<tr>" + emoteOutput.join('') + "</tr>");
}
return (
"<div class='infobox'><center><font style='font-weight: bold; text-decoration: underline; color: #555;'>List of Emoticons</font></center>" +
"<div style='max-height: 300px; overflow-y: scroll; padding: 5px 0px;'><table style='background: rgba(245, 245, 245, 0.4); border: 1px solid #BBB;' width='100%'>" +
emotes_group_list.join("") +
"</table></div></div>"
);
}
let emotes_table = create_table();
exports.commands = {
blockemote: 'blockemoticons',
blockemotes: 'blockemoticons',
blockemoticon: 'blockemoticons',
blockemoticons: function (target, room, user) {
if (user.blockEmoticons === (target || true)) return this.sendReply("You are already blocking emoticons in private messages! To unblock, use /unblockemoticons");
user.blockEmoticons = true;
return this.sendReply("You are now blocking emoticons in private messages.");
},
blockemoticonshelp: ["/blockemoticons - Blocks emoticons in private messages. Unblock them with /unblockemoticons."],
unblockemote: 'unblockemoticons',
unblockemotes: 'unblockemoticons',
unblockemoticon: 'unblockemoticons',
unblockemoticons: function (target, room, user) {
if (!user.blockEmoticons) return this.sendReply("You are not blocking emoticons in private messages! To block, use /blockemoticons");
user.blockEmoticons = false;
return this.sendReply("You are no longer blocking emoticons in private messages.");
},
<API key>: ["/unblockemoticons - Unblocks emoticons in private messages. Block them with /blockemoticons."],
emotes: 'emoticons',
emoticons: function (target, room, user) {
if (!this.runBroadcast()) return;
this.sendReply("|raw|" + emotes_table);
},
emoticonshelp: ["/emoticons - Get a list of emoticons."],
toggleemote: 'toggleemoticons',
toggleemotes: 'toggleemoticons',
toggleemoticons: function (target, room, user) {
if (!this.can('declare', null, room)) return false;
room.disableEmoticons = !room.disableEmoticons;
this.sendReply("Disallowing emoticons is set to " + room.disableEmoticons + " in this room.");
if (room.disableEmoticons) {
this.add("|raw|<div class=\"broadcast-red\"><b>Emoticons are disabled!</b><br />Emoticons will not work.</div>");
} else {
this.add("|raw|<div class=\"broadcast-blue\"><b>Emoticons are enabled!</b><br />Emoticons will work now.</div>");
}
},
toggleemoticonshelp: ["/toggleemoticons - Toggle emoticons on or off."],
rande: 'randemote',
randemote: function (target, room, user) {
if (!this.runBroadcast()) return;
let rng = Math.floor(Math.random() * emotesKeys.length);
let randomEmote = emotesKeys[rng];
this.sendReplyBox("<img src='" + emotes[randomEmote] + "' title='" + randomEmote + "' height='50' width='50' />");
},
randemotehelp: ["/randemote - Get a random emote."],
}; |
/**
* @fileoverview This file is generated by the Angular 2 template compiler.
* Do not edit.
* @suppress {suspiciousCode,uselessCode,missingProperties}
*/
/* tslint:disable */
import * as import0 from '@angular/core/src/linker/ng_module_factory';
import * as import1 from '@angular/material/input/input';
import * as import2 from '@angular/common/src/common_module';
import * as import3 from '@angular/forms/src/directives';
import * as import4 from '@angular/forms/src/form_providers';
import * as import5 from '@angular/common/src/localization';
import * as import6 from '@angular/forms/src/directives/<API key>';
import * as import7 from '@angular/core/src/di/injector';
import * as import8 from '@angular/core/src/i18n/tokens';
import * as import9 from '@angular/core/src/linker/view';
import * as import10 from '@angular/core/src/change_detection/<API key>';
import * as import11 from '@angular/core/src/linker/view_utils';
import * as import12 from '@angular/core/src/render/api';
import * as import13 from '@angular/core/src/metadata/view';
import * as import14 from '@angular/core/src/linker/query_list';
import * as import15 from '@angular/core/src/linker/view_type';
import * as import16 from '@angular/core/src/change_detection/constants';
import * as import17 from '@angular/core/src/linker/component_factory';
import * as import18 from '@angular/core/src/linker/element_ref';
import * as import19 from '@angular/forms/src/directives/<API key>';
import * as import20 from './input.css.ngstyle';
import * as import21 from '../../forms/src/directives/<API key>.ngfactory';
import * as import22 from '../../forms/src/directives/validators.ngfactory';
import * as import23 from '../../forms/src/directives/ng_model.ngfactory';
import * as import24 from '../../forms/src/directives/ng_control_status.ngfactory';
import * as import25 from '@angular/core/src/linker/view_container';
import * as import26 from '@angular/forms/src/directives/<API key>';
import * as import27 from '@angular/forms/src/directives/validators';
import * as import28 from '@angular/forms/src/validators';
import * as import29 from '@angular/forms/src/directives/ng_model';
import * as import30 from '@angular/forms/src/directives/ng_control';
import * as import31 from '@angular/forms/src/directives/ng_control_status';
import * as import32 from '../../common/src/directives/ng_if.ngfactory';
import * as import33 from '@angular/core/src/linker/template_ref';
import * as import34 from '@angular/common/src/directives/ng_if';
class <API key> extends import0.NgModuleInjector<import1.MdInputModule> {
_CommonModule_0:import2.CommonModule;
<API key>:import3.<API key>;
_FormsModule_2:import4.FormsModule;
_MdInputModule_3:import1.MdInputModule;
__NgLocalization_4:import5.<API key>;
<API key>:import6.<API key>;
constructor(parent:import7.Injector) {
super(parent,([] as any[]),([] as any[]));
}
get _NgLocalization_4():import5.<API key> {
if ((this.__NgLocalization_4 == null)) { (this.__NgLocalization_4 = new import5.<API key>(this.parent.get(import8.LOCALE_ID))); }
return this.__NgLocalization_4;
}
get <API key>():import6.<API key> {
if ((this.<API key> == null)) { (this.<API key> = new import6.<API key>()); }
return this.<API key>;
}
createInternal():import1.MdInputModule {
this._CommonModule_0 = new import2.CommonModule();
this.<API key> = new import3.<API key>();
this._FormsModule_2 = new import4.FormsModule();
this._MdInputModule_3 = new import1.MdInputModule();
return this._MdInputModule_3;
}
getInternal(token:any,notFoundResult:any):any {
if ((token === import2.CommonModule)) { return this._CommonModule_0; }
if ((token === import3.<API key>)) { return this.<API key>; }
if ((token === import4.FormsModule)) { return this._FormsModule_2; }
if ((token === import1.MdInputModule)) { return this._MdInputModule_3; }
if ((token === import5.NgLocalization)) { return this._NgLocalization_4; }
if ((token === import6.<API key>)) { return this.<API key>; }
return notFoundResult;
}
destroyInternal():void {
}
}
export const <API key>:import0.NgModuleFactory<import1.MdInputModule> = new import0.NgModuleFactory(<API key>,import1.MdInputModule);
export class <API key> {
/*private*/ _eventHandler:Function;
context:import1.MdPlaceholder;
/*private*/ _changed:boolean;
constructor() {
this._changed = false;
this.context = new import1.MdPlaceholder();
}
ngOnDetach(view:import9.AppView<any>,componentView:import9.AppView<any>,el:any):void {
}
ngOnDestroy():void {
}
ngDoCheck(view:import9.AppView<any>,el:any,throwOnChange:boolean):boolean {
var changed:any = this._changed;
this._changed = false;
return changed;
}
checkHost(view:import9.AppView<any>,componentView:import9.AppView<any>,el:any,throwOnChange:boolean):void {
}
handleEvent(eventName:string,$event:any):boolean {
var result:boolean = true;
return result;
}
subscribe(view:import9.AppView<any>,_eventHandler:any):void {
this._eventHandler = _eventHandler;
}
}
export class Wrapper_MdInput {
/*private*/ _eventHandler:Function;
context:import1.MdInput;
/*private*/ _changed:boolean;
/*private*/ _changes:{[key: string]:any};
/*private*/ _expr_0:any;
/*private*/ _expr_1:any;
/*private*/ _expr_2:any;
/*private*/ _expr_3:any;
/*private*/ _expr_4:any;
/*private*/ _expr_5:any;
/*private*/ _expr_6:any;
/*private*/ _expr_7:any;
/*private*/ _expr_8:any;
/*private*/ _expr_9:any;
/*private*/ _expr_10:any;
/*private*/ _expr_11:any;
/*private*/ _expr_12:any;
/*private*/ _expr_13:any;
/*private*/ _expr_14:any;
/*private*/ _expr_15:any;
/*private*/ _expr_16:any;
/*private*/ _expr_17:any;
/*private*/ _expr_18:any;
/*private*/ _expr_19:any;
/*private*/ _expr_20:any;
/*private*/ _expr_21:any;
/*private*/ _expr_22:any;
/*private*/ _expr_23:any;
/*private*/ _expr_24:any;
/*private*/ _expr_25:any;
/*private*/ _expr_26:any;
/*private*/ _expr_27:any;
/*private*/ _expr_28:any;
/*private*/ _expr_29:any;
/*private*/ _expr_30:any;
/*private*/ _expr_31:any;
/*private*/ _expr_32:any;
subscription0:any;
subscription1:any;
constructor(p0:any) {
this._changed = false;
this._changes = {};
this.context = new import1.MdInput(p0);
this._expr_0 = import10.UNINITIALIZED;
this._expr_1 = import10.UNINITIALIZED;
this._expr_2 = import10.UNINITIALIZED;
this._expr_3 = import10.UNINITIALIZED;
this._expr_4 = import10.UNINITIALIZED;
this._expr_5 = import10.UNINITIALIZED;
this._expr_6 = import10.UNINITIALIZED;
this._expr_7 = import10.UNINITIALIZED;
this._expr_8 = import10.UNINITIALIZED;
this._expr_9 = import10.UNINITIALIZED;
this._expr_10 = import10.UNINITIALIZED;
this._expr_11 = import10.UNINITIALIZED;
this._expr_12 = import10.UNINITIALIZED;
this._expr_13 = import10.UNINITIALIZED;
this._expr_14 = import10.UNINITIALIZED;
this._expr_15 = import10.UNINITIALIZED;
this._expr_16 = import10.UNINITIALIZED;
this._expr_17 = import10.UNINITIALIZED;
this._expr_18 = import10.UNINITIALIZED;
this._expr_19 = import10.UNINITIALIZED;
this._expr_20 = import10.UNINITIALIZED;
this._expr_21 = import10.UNINITIALIZED;
this._expr_22 = import10.UNINITIALIZED;
this._expr_23 = import10.UNINITIALIZED;
this._expr_24 = import10.UNINITIALIZED;
this._expr_25 = import10.UNINITIALIZED;
this._expr_26 = import10.UNINITIALIZED;
this._expr_27 = import10.UNINITIALIZED;
this._expr_28 = import10.UNINITIALIZED;
this._expr_29 = import10.UNINITIALIZED;
this._expr_30 = import10.UNINITIALIZED;
this._expr_31 = import10.UNINITIALIZED;
this._expr_32 = import10.UNINITIALIZED;
}
ngOnDetach(view:import9.AppView<any>,componentView:import9.AppView<any>,el:any):void {
}
ngOnDestroy():void {
(this.subscription0 && this.subscription0.unsubscribe());
(this.subscription1 && this.subscription1.unsubscribe());
}
check_ariaLabel(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_0,currValue))) {
this._changed = true;
this.context.ariaLabel = currValue;
this._changes['ariaLabel'] = new import10.SimpleChange(this._expr_0,currValue);
this._expr_0 = currValue;
}
}
<API key>(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_1,currValue))) {
this._changed = true;
this.context.ariaLabelledBy = currValue;
this._changes['ariaLabelledBy'] = new import10.SimpleChange(this._expr_1,currValue);
this._expr_1 = currValue;
}
}
check_ariaDisabled(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_2,currValue))) {
this._changed = true;
this.context.ariaDisabled = currValue;
this._changes['ariaDisabled'] = new import10.SimpleChange(this._expr_2,currValue);
this._expr_2 = currValue;
}
}
check_ariaRequired(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_3,currValue))) {
this._changed = true;
this.context.ariaRequired = currValue;
this._changes['ariaRequired'] = new import10.SimpleChange(this._expr_3,currValue);
this._expr_3 = currValue;
}
}
check_ariaInvalid(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_4,currValue))) {
this._changed = true;
this.context.ariaInvalid = currValue;
this._changes['ariaInvalid'] = new import10.SimpleChange(this._expr_4,currValue);
this._expr_4 = currValue;
}
}
check_align(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_5,currValue))) {
this._changed = true;
this.context.align = currValue;
this._changes['align'] = new import10.SimpleChange(this._expr_5,currValue);
this._expr_5 = currValue;
}
}
check_dividerColor(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_6,currValue))) {
this._changed = true;
this.context.dividerColor = currValue;
this._changes['dividerColor'] = new import10.SimpleChange(this._expr_6,currValue);
this._expr_6 = currValue;
}
}
check_hintLabel(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_7,currValue))) {
this._changed = true;
this.context.hintLabel = currValue;
this._changes['hintLabel'] = new import10.SimpleChange(this._expr_7,currValue);
this._expr_7 = currValue;
}
}
check_autocomplete(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_8,currValue))) {
this._changed = true;
this.context.autocomplete = currValue;
this._changes['autocomplete'] = new import10.SimpleChange(this._expr_8,currValue);
this._expr_8 = currValue;
}
}
check_autocorrect(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_9,currValue))) {
this._changed = true;
this.context.autocorrect = currValue;
this._changes['autocorrect'] = new import10.SimpleChange(this._expr_9,currValue);
this._expr_9 = currValue;
}
}
<API key>(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_10,currValue))) {
this._changed = true;
this.context.autocapitalize = currValue;
this._changes['autocapitalize'] = new import10.SimpleChange(this._expr_10,currValue);
this._expr_10 = currValue;
}
}
check_id(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_11,currValue))) {
this._changed = true;
this.context.id = currValue;
this._changes['id'] = new import10.SimpleChange(this._expr_11,currValue);
this._expr_11 = currValue;
}
}
check_list(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_12,currValue))) {
this._changed = true;
this.context.list = currValue;
this._changes['list'] = new import10.SimpleChange(this._expr_12,currValue);
this._expr_12 = currValue;
}
}
check_max(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_13,currValue))) {
this._changed = true;
this.context.max = currValue;
this._changes['max'] = new import10.SimpleChange(this._expr_13,currValue);
this._expr_13 = currValue;
}
}
check_maxlength(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_14,currValue))) {
this._changed = true;
this.context.maxlength = currValue;
this._changes['maxlength'] = new import10.SimpleChange(this._expr_14,currValue);
this._expr_14 = currValue;
}
}
check_min(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_15,currValue))) {
this._changed = true;
this.context.min = currValue;
this._changes['min'] = new import10.SimpleChange(this._expr_15,currValue);
this._expr_15 = currValue;
}
}
check_minlength(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_16,currValue))) {
this._changed = true;
this.context.minlength = currValue;
this._changes['minlength'] = new import10.SimpleChange(this._expr_16,currValue);
this._expr_16 = currValue;
}
}
check_placeholder(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_17,currValue))) {
this._changed = true;
this.context.placeholder = currValue;
this._changes['placeholder'] = new import10.SimpleChange(this._expr_17,currValue);
this._expr_17 = currValue;
}
}
check_step(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_18,currValue))) {
this._changed = true;
this.context.step = currValue;
this._changes['step'] = new import10.SimpleChange(this._expr_18,currValue);
this._expr_18 = currValue;
}
}
check_tabindex(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_19,currValue))) {
this._changed = true;
this.context.tabindex = currValue;
this._changes['tabindex'] = new import10.SimpleChange(this._expr_19,currValue);
this._expr_19 = currValue;
}
}
check_type(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_20,currValue))) {
this._changed = true;
this.context.type = currValue;
this._changes['type'] = new import10.SimpleChange(this._expr_20,currValue);
this._expr_20 = currValue;
}
}
check_name(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_21,currValue))) {
this._changed = true;
this.context.name = currValue;
this._changes['name'] = new import10.SimpleChange(this._expr_21,currValue);
this._expr_21 = currValue;
}
}
check_rows(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_22,currValue))) {
this._changed = true;
this.context.rows = currValue;
this._changes['rows'] = new import10.SimpleChange(this._expr_22,currValue);
this._expr_22 = currValue;
}
}
check_cols(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_23,currValue))) {
this._changed = true;
this.context.cols = currValue;
this._changes['cols'] = new import10.SimpleChange(this._expr_23,currValue);
this._expr_23 = currValue;
}
}
check_wrap(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_24,currValue))) {
this._changed = true;
this.context.wrap = currValue;
this._changes['wrap'] = new import10.SimpleChange(this._expr_24,currValue);
this._expr_24 = currValue;
}
}
<API key>(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_25,currValue))) {
this._changed = true;
this.context.floatingPlaceholder = currValue;
this._changes['floatingPlaceholder'] = new import10.SimpleChange(this._expr_25,currValue);
this._expr_25 = currValue;
}
}
check_autofocus(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_26,currValue))) {
this._changed = true;
this.context.autofocus = currValue;
this._changes['autofocus'] = new import10.SimpleChange(this._expr_26,currValue);
this._expr_26 = currValue;
}
}
check_disabled(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_27,currValue))) {
this._changed = true;
this.context.disabled = currValue;
this._changes['disabled'] = new import10.SimpleChange(this._expr_27,currValue);
this._expr_27 = currValue;
}
}
check_readonly(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_28,currValue))) {
this._changed = true;
this.context.readonly = currValue;
this._changes['readonly'] = new import10.SimpleChange(this._expr_28,currValue);
this._expr_28 = currValue;
}
}
check_required(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_29,currValue))) {
this._changed = true;
this.context.required = currValue;
this._changes['required'] = new import10.SimpleChange(this._expr_29,currValue);
this._expr_29 = currValue;
}
}
check_spellcheck(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_30,currValue))) {
this._changed = true;
this.context.spellcheck = currValue;
this._changes['spellcheck'] = new import10.SimpleChange(this._expr_30,currValue);
this._expr_30 = currValue;
}
}
check_value(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_31,currValue))) {
this._changed = true;
this.context.value = currValue;
this._changes['value'] = new import10.SimpleChange(this._expr_31,currValue);
this._expr_31 = currValue;
}
}
ngDoCheck(view:import9.AppView<any>,el:any,throwOnChange:boolean):boolean {
var changed:any = this._changed;
this._changed = false;
if (!throwOnChange) { if (changed) {
this.context.ngOnChanges(this._changes);
this._changes = {};
} }
return changed;
}
checkHost(view:import9.AppView<any>,componentView:import9.AppView<any>,el:any,throwOnChange:boolean):void {
const currVal_32:any = this.context._align;
if (import11.checkBinding(throwOnChange,this._expr_32,currVal_32)) {
view.renderer.setElementAttribute(el,'align',((currVal_32 == null)? (null as any): currVal_32.toString()));
this._expr_32 = currVal_32;
}
}
handleEvent(eventName:string,$event:any):boolean {
var result:boolean = true;
if ((eventName == 'click')) {
const pd_sub_0:any = ((<any>this.context.focus()) !== false);
result = (pd_sub_0 && result);
}
return result;
}
subscribe(view:import9.AppView<any>,_eventHandler:any,emit0:boolean,emit1:boolean):void {
this._eventHandler = _eventHandler;
if (emit0) { (this.subscription0 = this.context.onBlur.subscribe(_eventHandler.bind(view,'blur'))); }
if (emit1) { (this.subscription1 = this.context.onFocus.subscribe(_eventHandler.bind(view,'focus'))); }
}
}
export class Wrapper_MdHint {
/*private*/ _eventHandler:Function;
context:import1.MdHint;
/*private*/ _changed:boolean;
/*private*/ _expr_0:any;
/*private*/ _expr_1:any;
/*private*/ _expr_2:any;
constructor() {
this._changed = false;
this.context = new import1.MdHint();
this._expr_0 = import10.UNINITIALIZED;
this._expr_1 = import10.UNINITIALIZED;
this._expr_2 = import10.UNINITIALIZED;
}
ngOnDetach(view:import9.AppView<any>,componentView:import9.AppView<any>,el:any):void {
}
ngOnDestroy():void {
}
check_align(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void {
if ((forceUpdate || import11.checkBinding(throwOnChange,this._expr_0,currValue))) {
this._changed = true;
this.context.align = currValue;
this._expr_0 = currValue;
}
}
ngDoCheck(view:import9.AppView<any>,el:any,throwOnChange:boolean):boolean {
var changed:any = this._changed;
this._changed = false;
return changed;
}
checkHost(view:import9.AppView<any>,componentView:import9.AppView<any>,el:any,throwOnChange:boolean):void {
const currVal_1:any = (this.context.align == 'end');
if (import11.checkBinding(throwOnChange,this._expr_1,currVal_1)) {
view.renderer.setElementClass(el,'md-right',currVal_1);
this._expr_1 = currVal_1;
}
const currVal_2:any = true;
if (import11.checkBinding(throwOnChange,this._expr_2,currVal_2)) {
view.renderer.setElementClass(el,'md-hint',currVal_2);
this._expr_2 = currVal_2;
}
}
handleEvent(eventName:string,$event:any):boolean {
var result:boolean = true;
return result;
}
subscribe(view:import9.AppView<any>,_eventHandler:any):void {
this._eventHandler = _eventHandler;
}
}
var <API key>:import12.RenderComponentType = import11.<API key>('',0,import13.ViewEncapsulation.None,([] as any[]),{});
class View_MdInput_Host0 extends import9.AppView<any> {
_el_0:any;
compView_0:import9.AppView<import1.MdInput>;
_MdInput_0_3:Wrapper_MdInput;
<API key>:any[];
<API key>:import14.QueryList<any>;
_query_MdHint_0_1:import14.QueryList<any>;
constructor(viewUtils:import11.ViewUtils,parentView:import9.AppView<any>,parentIndex:number,parentElement:any) {
super(View_MdInput_Host0,<API key>,import15.ViewType.HOST,viewUtils,parentView,parentIndex,parentElement,import16.<API key>.CheckAlways);
}
get <API key>():any[] {
if ((this.<API key> == null)) { (this.<API key> = [this._MdInput_0_3.context]); }
return this.<API key>;
}
createInternal(rootSelector:string):import17.ComponentRef<any> {
this._el_0 = import11.<API key>(this.renderer,'md-input',import11.EMPTY_INLINE_ARRAY,rootSelector,(null as any));
this.compView_0 = new View_MdInput0(this.viewUtils,this,0,this._el_0);
this._MdInput_0_3 = new Wrapper_MdInput(new import18.ElementRef(this._el_0));
this.<API key> = new import14.QueryList<any>();
this._query_MdHint_0_1 = new import14.QueryList<any>();
this.compView_0.create(this._MdInput_0_3.context);
var disposable_0:Function = import11.<API key>(this,this._el_0,new import11.InlineArray2(2,'click',(null as any)),this.eventHandler(this.handleEvent_0));
this.<API key>.reset(([] as any[]));
this._MdInput_0_3.context._placeholderChild = this.<API key>.first;
this.init(this._el_0,((<any>this.renderer).directRenderer? (null as any): [this._el_0]),[disposable_0]);
return new import17.ComponentRef_<any>(0,this,this._el_0,this._MdInput_0_3.context);
}
injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
if (((token === import1.MdInput) && (0 === requestNodeIndex))) { return this._MdInput_0_3.context; }
if (((token === import19.NG_VALUE_ACCESSOR) && (0 === requestNodeIndex))) { return this.<API key>; }
return notFoundResult;
}
<API key>(throwOnChange:boolean):void {
this._MdInput_0_3.ngDoCheck(this,this._el_0,throwOnChange);
if (!throwOnChange) {
if (this._query_MdHint_0_1.dirty) {
this._query_MdHint_0_1.reset(([] as any[]));
this._MdInput_0_3.context._hintChildren = this._query_MdHint_0_1;
this._query_MdHint_0_1.notifyOnChanges();
}
if ((this.numberOfChecks === 0)) { this._MdInput_0_3.context.ngAfterContentInit(); }
}
this._MdInput_0_3.checkHost(this,this.compView_0,this._el_0,throwOnChange);
this.compView_0.<API key>(throwOnChange);
}
destroyInternal():void {
this.compView_0.destroy();
this._MdInput_0_3.ngOnDestroy();
}
<API key>(cb:any,ctx:any):void {
cb(this._el_0,ctx);
}
<API key>(nodeIndex:number,ngContentIndex:number,cb:any,ctx:any):void {
if (((nodeIndex == 0) && (ngContentIndex == 0))) { }
if (((nodeIndex == 0) && (ngContentIndex == 1))) { }
if (((nodeIndex == 0) && (ngContentIndex == 2))) { }
if (((nodeIndex == 0) && (ngContentIndex == 3))) { }
}
handleEvent_0(eventName:string,$event:any):boolean {
this.compView_0.<API key>();
var result:boolean = true;
result = (this._MdInput_0_3.handleEvent(eventName,$event) && result);
return result;
}
}
export const MdInputNgFactory:import17.ComponentFactory<import1.MdInput> = new import17.ComponentFactory<import1.MdInput>('md-input, md-textarea',View_MdInput_Host0,import1.MdInput);
const styles_MdInput:any[] = [import20.styles];
class View_MdInput1 extends import9.AppView<any> {
_el_0:any;
<API key>:import21.<API key>;
<API key>:import22.<API key>;
_NG_VALIDATORS_0_5:any[];
<API key>:any[];
_NgModel_0_7:import23.Wrapper_NgModel;
_NgControl_0_8:any;
<API key>:import24.<API key>;
/*private*/ _expr_8:any;
/*private*/ _expr_9:any;
/*private*/ _expr_10:any;
/*private*/ _expr_11:any;
/*private*/ _expr_12:any;
/*private*/ _expr_13:any;
/*private*/ _expr_14:any;
/*private*/ _expr_15:any;
/*private*/ _expr_16:any;
/*private*/ _expr_17:any;
/*private*/ _expr_18:any;
/*private*/ _expr_19:any;
/*private*/ _expr_20:any;
/*private*/ _expr_21:any;
/*private*/ _expr_22:any;
/*private*/ _expr_23:any;
/*private*/ _expr_24:any;
/*private*/ _expr_25:any;
/*private*/ _expr_26:any;
/*private*/ _expr_27:any;
/*private*/ _expr_28:any;
/*private*/ _expr_29:any;
constructor(viewUtils:import11.ViewUtils,parentView:import9.AppView<any>,parentIndex:number,parentElement:any,<API key>:import25.ViewContainer) {
super(View_MdInput1,renderType_MdInput,import15.ViewType.EMBEDDED,viewUtils,parentView,parentIndex,parentElement,import16.<API key>.CheckAlways,<API key>);
this._expr_8 = import10.UNINITIALIZED;
this._expr_9 = import10.UNINITIALIZED;
this._expr_10 = import10.UNINITIALIZED;
this._expr_11 = import10.UNINITIALIZED;
this._expr_12 = import10.UNINITIALIZED;
this._expr_13 = import10.UNINITIALIZED;
this._expr_14 = import10.UNINITIALIZED;
this._expr_15 = import10.UNINITIALIZED;
this._expr_16 = import10.UNINITIALIZED;
this._expr_17 = import10.UNINITIALIZED;
this._expr_18 = import10.UNINITIALIZED;
this._expr_19 = import10.UNINITIALIZED;
this._expr_20 = import10.UNINITIALIZED;
this._expr_21 = import10.UNINITIALIZED;
this._expr_22 = import10.UNINITIALIZED;
this._expr_23 = import10.UNINITIALIZED;
this._expr_24 = import10.UNINITIALIZED;
this._expr_25 = import10.UNINITIALIZED;
this._expr_26 = import10.UNINITIALIZED;
this._expr_27 = import10.UNINITIALIZED;
this._expr_28 = import10.UNINITIALIZED;
this._expr_29 = import10.UNINITIALIZED;
}
createInternal(rootSelector:string):import17.ComponentRef<any> {
this._el_0 = import11.createRenderElement(this.renderer,(null as any),'input',new import11.InlineArray2(2,'class','md-input-element'),(null as any));
this.<API key> = new import21.<API key>(this.renderer,new import18.ElementRef(this._el_0));
this.<API key> = new import22.<API key>();
this._NG_VALIDATORS_0_5 = [this.<API key>.context];
this.<API key> = [this.<API key>.context];
this._NgModel_0_7 = new import23.Wrapper_NgModel((null as any),this._NG_VALIDATORS_0_5,(null as any),this.<API key>);
this._NgControl_0_8 = this._NgModel_0_7.context;
this.<API key> = new import24.<API key>(this._NgControl_0_8);
var disposable_0:Function = import11.<API key>(this,this._el_0,new import11.InlineArray16(10,'focus',(null as any),'blur',(null as any),'ngModelChange',(null as any),'change',(null as any),'input',(null as any)),this.eventHandler(this.handleEvent_0));
this._NgModel_0_7.subscribe(this,this.eventHandler(this.handleEvent_0),true);
this.init(this._el_0,((<any>this.renderer).directRenderer? (null as any): [this._el_0]),[disposable_0]);
return (null as any);
}
injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
if (((token === import26.<API key>) && (0 === requestNodeIndex))) { return this.<API key>.context; }
if (((token === import27.RequiredValidator) && (0 === requestNodeIndex))) { return this.<API key>.context; }
if (((token === import28.NG_VALIDATORS) && (0 === requestNodeIndex))) { return this._NG_VALIDATORS_0_5; }
if (((token === import19.NG_VALUE_ACCESSOR) && (0 === requestNodeIndex))) { return this.<API key>; }
if (((token === import29.NgModel) && (0 === requestNodeIndex))) { return this._NgModel_0_7.context; }
if (((token === import30.NgControl) && (0 === requestNodeIndex))) { return this._NgControl_0_8; }
if (((token === import31.NgControlStatus) && (0 === requestNodeIndex))) { return this.<API key>.context; }
return notFoundResult;
}
<API key>(throwOnChange:boolean):void {
this.<API key>.ngDoCheck(this,this._el_0,throwOnChange);
const currVal_0_1_0:any = this.parentView.context.required;
this.<API key>.check_required(currVal_0_1_0,throwOnChange,false);
this.<API key>.ngDoCheck(this,this._el_0,throwOnChange);
const currVal_0_2_0:any = this.parentView.context.disabled;
this._NgModel_0_7.check_isDisabled(currVal_0_2_0,throwOnChange,false);
const currVal_0_2_1:any = this.parentView.context.value;
this._NgModel_0_7.check_model(currVal_0_2_1,throwOnChange,false);
this._NgModel_0_7.ngDoCheck(this,this._el_0,throwOnChange);
this.<API key>.ngDoCheck(this,this._el_0,throwOnChange);
const currVal_8:any = (this.parentView.context.align == 'end');
if (import11.checkBinding(throwOnChange,this._expr_8,currVal_8)) {
this.renderer.setElementClass(this._el_0,'md-end',currVal_8);
this._expr_8 = currVal_8;
}
const currVal_9:any = this.parentView.context.ariaLabel;
if (import11.checkBinding(throwOnChange,this._expr_9,currVal_9)) {
this.renderer.setElementAttribute(this._el_0,'aria-label',((currVal_9 == null)? (null as any): currVal_9.toString()));
this._expr_9 = currVal_9;
}
const currVal_10:any = this.parentView.context.ariaLabelledBy;
if (import11.checkBinding(throwOnChange,this._expr_10,currVal_10)) {
this.renderer.setElementAttribute(this._el_0,'aria-labelledby',((currVal_10 == null)? (null as any): currVal_10.toString()));
this._expr_10 = currVal_10;
}
const currVal_11:any = this.parentView.context.ariaDisabled;
if (import11.checkBinding(throwOnChange,this._expr_11,currVal_11)) {
this.renderer.setElementAttribute(this._el_0,'aria-disabled',((currVal_11 == null)? (null as any): currVal_11.toString()));
this._expr_11 = currVal_11;
}
const currVal_12:any = this.parentView.context.ariaRequired;
if (import11.checkBinding(throwOnChange,this._expr_12,currVal_12)) {
this.renderer.setElementAttribute(this._el_0,'aria-required',((currVal_12 == null)? (null as any): currVal_12.toString()));
this._expr_12 = currVal_12;
}
const currVal_13:any = this.parentView.context.ariaInvalid;
if (import11.checkBinding(throwOnChange,this._expr_13,currVal_13)) {
this.renderer.setElementAttribute(this._el_0,'aria-invalid',((currVal_13 == null)? (null as any): currVal_13.toString()));
this._expr_13 = currVal_13;
}
const currVal_14:any = this.parentView.context.autocomplete;
if (import11.checkBinding(throwOnChange,this._expr_14,currVal_14)) {
this.renderer.setElementAttribute(this._el_0,'autocomplete',((currVal_14 == null)? (null as any): currVal_14.toString()));
this._expr_14 = currVal_14;
}
const currVal_15:any = this.parentView.context.autocorrect;
if (import11.checkBinding(throwOnChange,this._expr_15,currVal_15)) {
this.renderer.setElementAttribute(this._el_0,'autocorrect',((currVal_15 == null)? (null as any): currVal_15.toString()));
this._expr_15 = currVal_15;
}
const currVal_16:any = this.parentView.context.autocapitalize;
if (import11.checkBinding(throwOnChange,this._expr_16,currVal_16)) {
this.renderer.setElementAttribute(this._el_0,'autocapitalize',((currVal_16 == null)? (null as any): currVal_16.toString()));
this._expr_16 = currVal_16;
}
const currVal_17:any = this.parentView.context.autofocus;
if (import11.checkBinding(throwOnChange,this._expr_17,currVal_17)) {
this.renderer.setElementProperty(this._el_0,'autofocus',currVal_17);
this._expr_17 = currVal_17;
}
const currVal_18:any = this.parentView.context.inputId;
if (import11.checkBinding(throwOnChange,this._expr_18,currVal_18)) {
this.renderer.setElementProperty(this._el_0,'id',currVal_18);
this._expr_18 = currVal_18;
}
const currVal_19:any = this.parentView.context.list;
if (import11.checkBinding(throwOnChange,this._expr_19,currVal_19)) {
this.renderer.setElementAttribute(this._el_0,'list',((currVal_19 == null)? (null as any): currVal_19.toString()));
this._expr_19 = currVal_19;
}
const currVal_20:any = this.parentView.context.max;
if (import11.checkBinding(throwOnChange,this._expr_20,currVal_20)) {
this.renderer.setElementAttribute(this._el_0,'max',((currVal_20 == null)? (null as any): currVal_20.toString()));
this._expr_20 = currVal_20;
}
const currVal_21:any = this.parentView.context.maxlength;
if (import11.checkBinding(throwOnChange,this._expr_21,currVal_21)) {
this.renderer.setElementAttribute(this._el_0,'maxlength',((currVal_21 == null)? (null as any): currVal_21.toString()));
this._expr_21 = currVal_21;
}
const currVal_22:any = this.parentView.context.min;
if (import11.checkBinding(throwOnChange,this._expr_22,currVal_22)) {
this.renderer.setElementAttribute(this._el_0,'min',((currVal_22 == null)? (null as any): currVal_22.toString()));
this._expr_22 = currVal_22;
}
const currVal_23:any = this.parentView.context.minlength;
if (import11.checkBinding(throwOnChange,this._expr_23,currVal_23)) {
this.renderer.setElementAttribute(this._el_0,'minlength',((currVal_23 == null)? (null as any): currVal_23.toString()));
this._expr_23 = currVal_23;
}
const currVal_24:any = this.parentView.context.readonly;
if (import11.checkBinding(throwOnChange,this._expr_24,currVal_24)) {
this.renderer.setElementProperty(this._el_0,'readOnly',currVal_24);
this._expr_24 = currVal_24;
}
const currVal_25:any = this.parentView.context.spellcheck;
if (import11.checkBinding(throwOnChange,this._expr_25,currVal_25)) {
this.renderer.setElementProperty(this._el_0,'spellcheck',currVal_25);
this._expr_25 = currVal_25;
}
const currVal_26:any = this.parentView.context.step;
if (import11.checkBinding(throwOnChange,this._expr_26,currVal_26)) {
this.renderer.setElementAttribute(this._el_0,'step',((currVal_26 == null)? (null as any): currVal_26.toString()));
this._expr_26 = currVal_26;
}
const currVal_27:any = this.parentView.context.tabindex;
if (import11.checkBinding(throwOnChange,this._expr_27,currVal_27)) {
this.renderer.setElementAttribute(this._el_0,'tabindex',((currVal_27 == null)? (null as any): currVal_27.toString()));
this._expr_27 = currVal_27;
}
const currVal_28:any = this.parentView.context.type;
if (import11.checkBinding(throwOnChange,this._expr_28,currVal_28)) {
this.renderer.setElementProperty(this._el_0,'type',currVal_28);
this._expr_28 = currVal_28;
}
const currVal_29:any = this.parentView.context.name;
if (import11.checkBinding(throwOnChange,this._expr_29,currVal_29)) {
this.renderer.setElementAttribute(this._el_0,'name',((currVal_29 == null)? (null as any): currVal_29.toString()));
this._expr_29 = currVal_29;
}
this.<API key>.checkHost(this,this,this._el_0,throwOnChange);
this.<API key>.checkHost(this,this,this._el_0,throwOnChange);
}
<API key>():void {
(<View_MdInput0>this.parentView)._viewQuery_input_0.setDirty();
}
destroyInternal():void {
this._NgModel_0_7.ngOnDestroy();
}
<API key>(cb:any,ctx:any):void {
cb(this._el_0,ctx);
}
handleEvent_0(eventName:string,$event:any):boolean {
this.<API key>();
var result:boolean = true;
result = (this.<API key>.handleEvent(eventName,$event) && result);
if ((eventName == 'focus')) {
const pd_sub_0:any = ((<any>this.parentView.context._handleFocus($event)) !== false);
result = (pd_sub_0 && result);
}
if ((eventName == 'blur')) {
const pd_sub_1:any = ((<any>this.parentView.context._handleBlur($event)) !== false);
result = (pd_sub_1 && result);
}
if ((eventName == 'ngModelChange')) {
const pd_sub_2:any = ((<any>(this.parentView.context.value = $event)) !== false);
result = (pd_sub_2 && result);
}
if ((eventName == 'change')) {
const pd_sub_3:any = ((<any>this.parentView.context._handleChange($event)) !== false);
result = (pd_sub_3 && result);
}
return result;
}
}
class View_MdInput2 extends import9.AppView<any> {
_el_0:any;
<API key>:import21.<API key>;
<API key>:import22.<API key>;
_NG_VALIDATORS_0_5:any[];
<API key>:any[];
_NgModel_0_7:import23.Wrapper_NgModel;
_NgControl_0_8:any;
<API key>:import24.<API key>;
/*private*/ _expr_8:any;
/*private*/ _expr_9:any;
/*private*/ _expr_10:any;
/*private*/ _expr_11:any;
/*private*/ _expr_12:any;
/*private*/ _expr_13:any;
/*private*/ _expr_14:any;
/*private*/ _expr_15:any;
/*private*/ _expr_16:any;
/*private*/ _expr_17:any;
/*private*/ _expr_18:any;
/*private*/ _expr_19:any;
/*private*/ _expr_20:any;
/*private*/ _expr_21:any;
/*private*/ _expr_22:any;
/*private*/ _expr_23:any;
/*private*/ _expr_24:any;
/*private*/ _expr_25:any;
/*private*/ _expr_26:any;
constructor(viewUtils:import11.ViewUtils,parentView:import9.AppView<any>,parentIndex:number,parentElement:any,<API key>:import25.ViewContainer) {
super(View_MdInput2,renderType_MdInput,import15.ViewType.EMBEDDED,viewUtils,parentView,parentIndex,parentElement,import16.<API key>.CheckAlways,<API key>);
this._expr_8 = import10.UNINITIALIZED;
this._expr_9 = import10.UNINITIALIZED;
this._expr_10 = import10.UNINITIALIZED;
this._expr_11 = import10.UNINITIALIZED;
this._expr_12 = import10.UNINITIALIZED;
this._expr_13 = import10.UNINITIALIZED;
this._expr_14 = import10.UNINITIALIZED;
this._expr_15 = import10.UNINITIALIZED;
this._expr_16 = import10.UNINITIALIZED;
this._expr_17 = import10.UNINITIALIZED;
this._expr_18 = import10.UNINITIALIZED;
this._expr_19 = import10.UNINITIALIZED;
this._expr_20 = import10.UNINITIALIZED;
this._expr_21 = import10.UNINITIALIZED;
this._expr_22 = import10.UNINITIALIZED;
this._expr_23 = import10.UNINITIALIZED;
this._expr_24 = import10.UNINITIALIZED;
this._expr_25 = import10.UNINITIALIZED;
this._expr_26 = import10.UNINITIALIZED;
}
createInternal(rootSelector:string):import17.ComponentRef<any> {
this._el_0 = import11.createRenderElement(this.renderer,(null as any),'textarea',new import11.InlineArray2(2,'class','md-input-element <API key>'),(null as any));
this.<API key> = new import21.<API key>(this.renderer,new import18.ElementRef(this._el_0));
this.<API key> = new import22.<API key>();
this._NG_VALIDATORS_0_5 = [this.<API key>.context];
this.<API key> = [this.<API key>.context];
this._NgModel_0_7 = new import23.Wrapper_NgModel((null as any),this._NG_VALIDATORS_0_5,(null as any),this.<API key>);
this._NgControl_0_8 = this._NgModel_0_7.context;
this.<API key> = new import24.<API key>(this._NgControl_0_8);
var disposable_0:Function = import11.<API key>(this,this._el_0,new import11.InlineArray16(10,'focus',(null as any),'blur',(null as any),'ngModelChange',(null as any),'change',(null as any),'input',(null as any)),this.eventHandler(this.handleEvent_0));
this._NgModel_0_7.subscribe(this,this.eventHandler(this.handleEvent_0),true);
this.init(this._el_0,((<any>this.renderer).directRenderer? (null as any): [this._el_0]),[disposable_0]);
return (null as any);
}
injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
if (((token === import26.<API key>) && (0 === requestNodeIndex))) { return this.<API key>.context; }
if (((token === import27.RequiredValidator) && (0 === requestNodeIndex))) { return this.<API key>.context; }
if (((token === import28.NG_VALIDATORS) && (0 === requestNodeIndex))) { return this._NG_VALIDATORS_0_5; }
if (((token === import19.NG_VALUE_ACCESSOR) && (0 === requestNodeIndex))) { return this.<API key>; }
if (((token === import29.NgModel) && (0 === requestNodeIndex))) { return this._NgModel_0_7.context; }
if (((token === import30.NgControl) && (0 === requestNodeIndex))) { return this._NgControl_0_8; }
if (((token === import31.NgControlStatus) && (0 === requestNodeIndex))) { return this.<API key>.context; }
return notFoundResult;
}
<API key>(throwOnChange:boolean):void {
this.<API key>.ngDoCheck(this,this._el_0,throwOnChange);
const currVal_0_1_0:any = this.parentView.context.required;
this.<API key>.check_required(currVal_0_1_0,throwOnChange,false);
this.<API key>.ngDoCheck(this,this._el_0,throwOnChange);
const currVal_0_2_0:any = this.parentView.context.disabled;
this._NgModel_0_7.check_isDisabled(currVal_0_2_0,throwOnChange,false);
const currVal_0_2_1:any = this.parentView.context.value;
this._NgModel_0_7.check_model(currVal_0_2_1,throwOnChange,false);
this._NgModel_0_7.ngDoCheck(this,this._el_0,throwOnChange);
this.<API key>.ngDoCheck(this,this._el_0,throwOnChange);
const currVal_8:any = (this.parentView.context.align == 'end');
if (import11.checkBinding(throwOnChange,this._expr_8,currVal_8)) {
this.renderer.setElementClass(this._el_0,'md-end',currVal_8);
this._expr_8 = currVal_8;
}
const currVal_9:any = this.parentView.context.ariaLabel;
if (import11.checkBinding(throwOnChange,this._expr_9,currVal_9)) {
this.renderer.setElementAttribute(this._el_0,'aria-label',((currVal_9 == null)? (null as any): currVal_9.toString()));
this._expr_9 = currVal_9;
}
const currVal_10:any = this.parentView.context.ariaLabelledBy;
if (import11.checkBinding(throwOnChange,this._expr_10,currVal_10)) {
this.renderer.setElementAttribute(this._el_0,'aria-labelledby',((currVal_10 == null)? (null as any): currVal_10.toString()));
this._expr_10 = currVal_10;
}
const currVal_11:any = this.parentView.context.ariaDisabled;
if (import11.checkBinding(throwOnChange,this._expr_11,currVal_11)) {
this.renderer.setElementAttribute(this._el_0,'aria-disabled',((currVal_11 == null)? (null as any): currVal_11.toString()));
this._expr_11 = currVal_11;
}
const currVal_12:any = this.parentView.context.ariaRequired;
if (import11.checkBinding(throwOnChange,this._expr_12,currVal_12)) {
this.renderer.setElementAttribute(this._el_0,'aria-required',((currVal_12 == null)? (null as any): currVal_12.toString()));
this._expr_12 = currVal_12;
}
const currVal_13:any = this.parentView.context.ariaInvalid;
if (import11.checkBinding(throwOnChange,this._expr_13,currVal_13)) {
this.renderer.setElementAttribute(this._el_0,'aria-invalid',((currVal_13 == null)? (null as any): currVal_13.toString()));
this._expr_13 = currVal_13;
}
const currVal_14:any = this.parentView.context.autocomplete;
if (import11.checkBinding(throwOnChange,this._expr_14,currVal_14)) {
this.renderer.setElementAttribute(this._el_0,'autocomplete',((currVal_14 == null)? (null as any): currVal_14.toString()));
this._expr_14 = currVal_14;
}
const currVal_15:any = this.parentView.context.autocapitalize;
if (import11.checkBinding(throwOnChange,this._expr_15,currVal_15)) {
this.renderer.setElementAttribute(this._el_0,'autocapitalize',((currVal_15 == null)? (null as any): currVal_15.toString()));
this._expr_15 = currVal_15;
}
const currVal_16:any = this.parentView.context.cols;
if (import11.checkBinding(throwOnChange,this._expr_16,currVal_16)) {
this.renderer.setElementAttribute(this._el_0,'cols',((currVal_16 == null)? (null as any): currVal_16.toString()));
this._expr_16 = currVal_16;
}
const currVal_17:any = this.parentView.context.rows;
if (import11.checkBinding(throwOnChange,this._expr_17,currVal_17)) {
this.renderer.setElementAttribute(this._el_0,'rows',((currVal_17 == null)? (null as any): currVal_17.toString()));
this._expr_17 = currVal_17;
}
const currVal_18:any = this.parentView.context.wrap;
if (import11.checkBinding(throwOnChange,this._expr_18,currVal_18)) {
this.renderer.setElementAttribute(this._el_0,'wrap',((currVal_18 == null)? (null as any): currVal_18.toString()));
this._expr_18 = currVal_18;
}
const currVal_19:any = this.parentView.context.autofocus;
if (import11.checkBinding(throwOnChange,this._expr_19,currVal_19)) {
this.renderer.setElementProperty(this._el_0,'autofocus',currVal_19);
this._expr_19 = currVal_19;
}
const currVal_20:any = this.parentView.context.inputId;
if (import11.checkBinding(throwOnChange,this._expr_20,currVal_20)) {
this.renderer.setElementProperty(this._el_0,'id',currVal_20);
this._expr_20 = currVal_20;
}
const currVal_21:any = this.parentView.context.maxlength;
if (import11.checkBinding(throwOnChange,this._expr_21,currVal_21)) {
this.renderer.setElementAttribute(this._el_0,'maxlength',((currVal_21 == null)? (null as any): currVal_21.toString()));
this._expr_21 = currVal_21;
}
const currVal_22:any = this.parentView.context.minlength;
if (import11.checkBinding(throwOnChange,this._expr_22,currVal_22)) {
this.renderer.setElementAttribute(this._el_0,'minlength',((currVal_22 == null)? (null as any): currVal_22.toString()));
this._expr_22 = currVal_22;
}
const currVal_23:any = this.parentView.context.readonly;
if (import11.checkBinding(throwOnChange,this._expr_23,currVal_23)) {
this.renderer.setElementProperty(this._el_0,'readOnly',currVal_23);
this._expr_23 = currVal_23;
}
const currVal_24:any = this.parentView.context.spellcheck;
if (import11.checkBinding(throwOnChange,this._expr_24,currVal_24)) {
this.renderer.setElementProperty(this._el_0,'spellcheck',currVal_24);
this._expr_24 = currVal_24;
}
const currVal_25:any = this.parentView.context.tabindex;
if (import11.checkBinding(throwOnChange,this._expr_25,currVal_25)) {
this.renderer.setElementAttribute(this._el_0,'tabindex',((currVal_25 == null)? (null as any): currVal_25.toString()));
this._expr_25 = currVal_25;
}
const currVal_26:any = this.parentView.context.name;
if (import11.checkBinding(throwOnChange,this._expr_26,currVal_26)) {
this.renderer.setElementAttribute(this._el_0,'name',((currVal_26 == null)? (null as any): currVal_26.toString()));
this._expr_26 = currVal_26;
}
this.<API key>.checkHost(this,this,this._el_0,throwOnChange);
this.<API key>.checkHost(this,this,this._el_0,throwOnChange);
}
<API key>():void {
(<View_MdInput0>this.parentView)._viewQuery_input_0.setDirty();
}
destroyInternal():void {
this._NgModel_0_7.ngOnDestroy();
}
<API key>(cb:any,ctx:any):void {
cb(this._el_0,ctx);
}
handleEvent_0(eventName:string,$event:any):boolean {
this.<API key>();
var result:boolean = true;
result = (this.<API key>.handleEvent(eventName,$event) && result);
if ((eventName == 'focus')) {
const pd_sub_0:any = ((<any>this.parentView.context._handleFocus($event)) !== false);
result = (pd_sub_0 && result);
}
if ((eventName == 'blur')) {
const pd_sub_1:any = ((<any>this.parentView.context._handleBlur($event)) !== false);
result = (pd_sub_1 && result);
}
if ((eventName == 'ngModelChange')) {
const pd_sub_2:any = ((<any>(this.parentView.context.value = $event)) !== false);
result = (pd_sub_2 && result);
}
if ((eventName == 'change')) {
const pd_sub_3:any = ((<any>this.parentView.context._handleChange($event)) !== false);
result = (pd_sub_3 && result);
}
return result;
}
}
class View_MdInput4 extends import9.AppView<any> {
_el_0:any;
_text_1:any;
constructor(viewUtils:import11.ViewUtils,parentView:import9.AppView<any>,parentIndex:number,parentElement:any,<API key>:import25.ViewContainer) {
super(View_MdInput4,renderType_MdInput,import15.ViewType.EMBEDDED,viewUtils,parentView,parentIndex,parentElement,import16.<API key>.CheckAlways,<API key>);
}
createInternal(rootSelector:string):import17.ComponentRef<any> {
this._el_0 = import11.createRenderElement(this.renderer,(null as any),'span',new import11.InlineArray2(2,'class','<API key>'),(null as any));
this._text_1 = this.renderer.createText(this._el_0,'*',(null as any));
this.init(this._el_0,((<any>this.renderer).directRenderer? (null as any): [
this._el_0,
this._text_1
]
),(null as any));
return (null as any);
}
<API key>(cb:any,ctx:any):void {
cb(this._el_0,ctx);
}
}
class View_MdInput3 extends import9.AppView<any> {
_el_0:any;
_text_1:any;
_text_2:any;
_anchor_3:any;
/*private*/ _vc_3:import25.ViewContainer;
_TemplateRef_3_5:any;
_NgIf_3_6:import32.Wrapper_NgIf;
_text_4:any;
/*private*/ _expr_8:any;
/*private*/ _expr_9:any;
/*private*/ _expr_10:any;
/*private*/ _expr_11:any;
/*private*/ _expr_12:any;
/*private*/ _expr_13:any;
/*private*/ _expr_14:any;
constructor(viewUtils:import11.ViewUtils,parentView:import9.AppView<any>,parentIndex:number,parentElement:any,<API key>:import25.ViewContainer) {
super(View_MdInput3,renderType_MdInput,import15.ViewType.EMBEDDED,viewUtils,parentView,parentIndex,parentElement,import16.<API key>.CheckAlways,<API key>);
this._expr_8 = import10.UNINITIALIZED;
this._expr_9 = import10.UNINITIALIZED;
this._expr_10 = import10.UNINITIALIZED;
this._expr_11 = import10.UNINITIALIZED;
this._expr_12 = import10.UNINITIALIZED;
this._expr_13 = import10.UNINITIALIZED;
this._expr_14 = import10.UNINITIALIZED;
}
createInternal(rootSelector:string):import17.ComponentRef<any> {
this._el_0 = import11.createRenderElement(this.renderer,(null as any),'label',new import11.InlineArray2(2,'class','<API key>'),(null as any));
this._text_1 = this.renderer.createText(this._el_0,'\n ',(null as any));
this.projectNodes(this._el_0,1);
this._text_2 = this.renderer.createText(this._el_0,'',(null as any));
this._anchor_3 = this.renderer.<API key>(this._el_0,(null as any));
this._vc_3 = new import25.ViewContainer(3,0,this,this._anchor_3);
this._TemplateRef_3_5 = new import33.TemplateRef_(this,3,this._anchor_3);
this._NgIf_3_6 = new import32.Wrapper_NgIf(this._vc_3.vcRef,this._TemplateRef_3_5);
this._text_4 = this.renderer.createText(this._el_0,'\n ',(null as any));
this.init(this._el_0,((<any>this.renderer).directRenderer? (null as any): [
this._el_0,
this._text_1,
this._text_2,
this._anchor_3,
this._text_4
]
),(null as any));
return (null as any);
}
injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
if (((token === import33.TemplateRef) && (3 === requestNodeIndex))) { return this._TemplateRef_3_5; }
if (((token === import34.NgIf) && (3 === requestNodeIndex))) { return this._NgIf_3_6.context; }
return notFoundResult;
}
<API key>(throwOnChange:boolean):void {
const currVal_3_0_0:any = this.parentView.context.required;
this._NgIf_3_6.check_ngIf(currVal_3_0_0,throwOnChange,false);
this._NgIf_3_6.ngDoCheck(this,this._anchor_3,throwOnChange);
this._vc_3.<API key>(throwOnChange);
const currVal_8:any = this.parentView.context.inputId;
if (import11.checkBinding(throwOnChange,this._expr_8,currVal_8)) {
this.renderer.setElementAttribute(this._el_0,'for',((currVal_8 == null)? (null as any): currVal_8.toString()));
this._expr_8 = currVal_8;
}
const currVal_9:any = this.parentView.context.empty;
if (import11.checkBinding(throwOnChange,this._expr_9,currVal_9)) {
this.renderer.setElementClass(this._el_0,'md-empty',currVal_9);
this._expr_9 = currVal_9;
}
const currVal_10:any = this.parentView.context.focused;
if (import11.checkBinding(throwOnChange,this._expr_10,currVal_10)) {
this.renderer.setElementClass(this._el_0,'md-focused',currVal_10);
this._expr_10 = currVal_10;
}
const currVal_11:any = this.parentView.context.floatingPlaceholder;
if (import11.checkBinding(throwOnChange,this._expr_11,currVal_11)) {
this.renderer.setElementClass(this._el_0,'md-float',currVal_11);
this._expr_11 = currVal_11;
}
const currVal_12:any = (this.parentView.context.dividerColor == 'accent');
if (import11.checkBinding(throwOnChange,this._expr_12,currVal_12)) {
this.renderer.setElementClass(this._el_0,'md-accent',currVal_12);
this._expr_12 = currVal_12;
}
const currVal_13:any = (this.parentView.context.dividerColor == 'warn');
if (import11.checkBinding(throwOnChange,this._expr_13,currVal_13)) {
this.renderer.setElementClass(this._el_0,'md-warn',currVal_13);
this._expr_13 = currVal_13;
}
const currVal_14:any = import11.inlineInterpolate(1,'\n ',this.parentView.context.placeholder,'\n ');
if (import11.checkBinding(throwOnChange,this._expr_14,currVal_14)) {
this.renderer.setText(this._text_2,currVal_14);
this._expr_14 = currVal_14;
}
}
destroyInternal():void {
this._vc_3.destroyNestedViews();
}
<API key>(cb:any,ctx:any):void {
cb(this._el_0,ctx);
}
<API key>(nodeIndex:number):import9.AppView<any> {
if ((nodeIndex == 3)) { return new View_MdInput4(this.viewUtils,this,3,this._anchor_3,this._vc_3); }
return (null as any);
}
}
class View_MdInput5 extends import9.AppView<any> {
_el_0:any;
_text_1:any;
/*private*/ _expr_2:any;
constructor(viewUtils:import11.ViewUtils,parentView:import9.AppView<any>,parentIndex:number,parentElement:any,<API key>:import25.ViewContainer) {
super(View_MdInput5,renderType_MdInput,import15.ViewType.EMBEDDED,viewUtils,parentView,parentIndex,parentElement,import16.<API key>.CheckAlways,<API key>);
this._expr_2 = import10.UNINITIALIZED;
}
createInternal(rootSelector:string):import17.ComponentRef<any> {
this._el_0 = import11.createRenderElement(this.renderer,(null as any),'div',new import11.InlineArray2(2,'class','md-hint'),(null as any));
this._text_1 = this.renderer.createText(this._el_0,'',(null as any));
this.init(this._el_0,((<any>this.renderer).directRenderer? (null as any): [
this._el_0,
this._text_1
]
),(null as any));
return (null as any);
}
<API key>(throwOnChange:boolean):void {
const currVal_2:any = import11.inlineInterpolate(1,'',this.parentView.context.hintLabel,'');
if (import11.checkBinding(throwOnChange,this._expr_2,currVal_2)) {
this.renderer.setText(this._text_1,currVal_2);
this._expr_2 = currVal_2;
}
}
<API key>(cb:any,ctx:any):void {
cb(this._el_0,ctx);
}
}
var renderType_MdInput:import12.RenderComponentType = import11.<API key>('',4,import13.ViewEncapsulation.None,styles_MdInput,{});
export class View_MdInput0 extends import9.AppView<import1.MdInput> {
_viewQuery_input_0:import14.QueryList<any>;
_el_0:any;
_text_1:any;
_el_2:any;
_text_3:any;
_el_4:any;
_text_5:any;
_el_6:any;
_text_7:any;
_anchor_8:any;
/*private*/ _vc_8:import25.ViewContainer;
_TemplateRef_8_5:any;
_NgIf_8_6:import32.Wrapper_NgIf;
_text_9:any;
_anchor_10:any;
/*private*/ _vc_10:import25.ViewContainer;
_TemplateRef_10_5:any;
_NgIf_10_6:import32.Wrapper_NgIf;
_text_11:any;
_anchor_12:any;
/*private*/ _vc_12:import25.ViewContainer;
_TemplateRef_12_5:any;
_NgIf_12_6:import32.Wrapper_NgIf;
_text_13:any;
_text_14:any;
_el_15:any;
_text_16:any;
_text_17:any;
_el_18:any;
_text_19:any;
_el_20:any;
_text_21:any;
_text_22:any;
_anchor_23:any;
/*private*/ _vc_23:import25.ViewContainer;
_TemplateRef_23_5:any;
_NgIf_23_6:import32.Wrapper_NgIf;
_text_24:any;
_text_25:any;
_text_26:any;
/*private*/ _expr_40:any;
/*private*/ _expr_41:any;
/*private*/ _expr_42:any;
/*private*/ _expr_43:any;
constructor(viewUtils:import11.ViewUtils,parentView:import9.AppView<any>,parentIndex:number,parentElement:any) {
super(View_MdInput0,renderType_MdInput,import15.ViewType.COMPONENT,viewUtils,parentView,parentIndex,parentElement,import16.<API key>.CheckAlways);
this._expr_40 = import10.UNINITIALIZED;
this._expr_41 = import10.UNINITIALIZED;
this._expr_42 = import10.UNINITIALIZED;
this._expr_43 = import10.UNINITIALIZED;
}
createInternal(rootSelector:string):import17.ComponentRef<any> {
const parentRenderNode:any = this.renderer.createViewRoot(this.parentElement);
this._viewQuery_input_0 = new import14.QueryList<any>();
this._el_0 = import11.createRenderElement(this.renderer,parentRenderNode,'div',new import11.InlineArray2(2,'class','md-input-wrapper'),(null as any));
this._text_1 = this.renderer.createText(this._el_0,'\n ',(null as any));
this._el_2 = import11.createRenderElement(this.renderer,this._el_0,'div',new import11.InlineArray2(2,'class','md-input-table'),(null as any));
this._text_3 = this.renderer.createText(this._el_2,'\n ',(null as any));
this._el_4 = import11.createRenderElement(this.renderer,this._el_2,'div',new import11.InlineArray2(2,'class','md-input-prefix'),(null as any));
this.projectNodes(this._el_4,0);
this._text_5 = this.renderer.createText(this._el_2,'\n\n ',(null as any));
this._el_6 = import11.createRenderElement(this.renderer,this._el_2,'div',new import11.InlineArray2(2,'class','md-input-infix'),(null as any));
this._text_7 = this.renderer.createText(this._el_6,'\n ',(null as any));
this._anchor_8 = this.renderer.<API key>(this._el_6,(null as any));
this._vc_8 = new import25.ViewContainer(8,6,this,this._anchor_8);
this._TemplateRef_8_5 = new import33.TemplateRef_(this,8,this._anchor_8);
this._NgIf_8_6 = new import32.Wrapper_NgIf(this._vc_8.vcRef,this._TemplateRef_8_5);
this._text_9 = this.renderer.createText(this._el_6,'\n\n ',(null as any));
this._anchor_10 = this.renderer.<API key>(this._el_6,(null as any));
this._vc_10 = new import25.ViewContainer(10,6,this,this._anchor_10);
this._TemplateRef_10_5 = new import33.TemplateRef_(this,10,this._anchor_10);
this._NgIf_10_6 = new import32.Wrapper_NgIf(this._vc_10.vcRef,this._TemplateRef_10_5);
this._text_11 = this.renderer.createText(this._el_6,'\n\n\n ',(null as any));
this._anchor_12 = this.renderer.<API key>(this._el_6,(null as any));
this._vc_12 = new import25.ViewContainer(12,6,this,this._anchor_12);
this._TemplateRef_12_5 = new import33.TemplateRef_(this,12,this._anchor_12);
this._NgIf_12_6 = new import32.Wrapper_NgIf(this._vc_12.vcRef,this._TemplateRef_12_5);
this._text_13 = this.renderer.createText(this._el_6,'\n ',(null as any));
this._text_14 = this.renderer.createText(this._el_2,'\n\n ',(null as any));
this._el_15 = import11.createRenderElement(this.renderer,this._el_2,'div',new import11.InlineArray2(2,'class','md-input-suffix'),(null as any));
this.projectNodes(this._el_15,2);
this._text_16 = this.renderer.createText(this._el_2,'\n ',(null as any));
this._text_17 = this.renderer.createText(this._el_0,'\n\n ',(null as any));
this._el_18 = import11.createRenderElement(this.renderer,this._el_0,'div',new import11.InlineArray2(2,'class','md-input-underline'),(null as any));
this._text_19 = this.renderer.createText(this._el_18,'\n ',(null as any));
this._el_20 = import11.createRenderElement(this.renderer,this._el_18,'span',new import11.InlineArray2(2,'class','md-input-ripple'),(null as any));
this._text_21 = this.renderer.createText(this._el_18,'\n ',(null as any));
this._text_22 = this.renderer.createText(this._el_0,'\n\n ',(null as any));
this._anchor_23 = this.renderer.<API key>(this._el_0,(null as any));
this._vc_23 = new import25.ViewContainer(23,0,this,this._anchor_23);
this._TemplateRef_23_5 = new import33.TemplateRef_(this,23,this._anchor_23);
this._NgIf_23_6 = new import32.Wrapper_NgIf(this._vc_23.vcRef,this._TemplateRef_23_5);
this._text_24 = this.renderer.createText(this._el_0,'\n ',(null as any));
this.projectNodes(this._el_0,3);
this._text_25 = this.renderer.createText(this._el_0,'\n',(null as any));
this._text_26 = this.renderer.createText(parentRenderNode,'\n',(null as any));
this.init((null as any),((<any>this.renderer).directRenderer? (null as any): [
this._el_0,
this._text_1,
this._el_2,
this._text_3,
this._el_4,
this._text_5,
this._el_6,
this._text_7,
this._anchor_8,
this._text_9,
this._anchor_10,
this._text_11,
this._anchor_12,
this._text_13,
this._text_14,
this._el_15,
this._text_16,
this._text_17,
this._el_18,
this._text_19,
this._el_20,
this._text_21,
this._text_22,
this._anchor_23,
this._text_24,
this._text_25,
this._text_26
]
),(null as any));
return (null as any);
}
injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any {
if (((token === import33.TemplateRef) && (8 === requestNodeIndex))) { return this._TemplateRef_8_5; }
if (((token === import34.NgIf) && (8 === requestNodeIndex))) { return this._NgIf_8_6.context; }
if (((token === import33.TemplateRef) && (10 === requestNodeIndex))) { return this._TemplateRef_10_5; }
if (((token === import34.NgIf) && (10 === requestNodeIndex))) { return this._NgIf_10_6.context; }
if (((token === import33.TemplateRef) && (12 === requestNodeIndex))) { return this._TemplateRef_12_5; }
if (((token === import34.NgIf) && (12 === requestNodeIndex))) { return this._NgIf_12_6.context; }
if (((token === import33.TemplateRef) && (23 === requestNodeIndex))) { return this._TemplateRef_23_5; }
if (((token === import34.NgIf) && (23 === requestNodeIndex))) { return this._NgIf_23_6.context; }
return notFoundResult;
}
<API key>(throwOnChange:boolean):void {
const currVal_8_0_0:any = (this.context._elementType === 'input');
this._NgIf_8_6.check_ngIf(currVal_8_0_0,throwOnChange,false);
this._NgIf_8_6.ngDoCheck(this,this._anchor_8,throwOnChange);
const currVal_10_0_0:any = (this.context._elementType === 'textarea');
this._NgIf_10_6.check_ngIf(currVal_10_0_0,throwOnChange,false);
this._NgIf_10_6.ngDoCheck(this,this._anchor_10,throwOnChange);
const currVal_12_0_0:any = this.context._hasPlaceholder();
this._NgIf_12_6.check_ngIf(currVal_12_0_0,throwOnChange,false);
this._NgIf_12_6.ngDoCheck(this,this._anchor_12,throwOnChange);
const currVal_23_0_0:any = (this.context.hintLabel != '');
this._NgIf_23_6.check_ngIf(currVal_23_0_0,throwOnChange,false);
this._NgIf_23_6.ngDoCheck(this,this._anchor_23,throwOnChange);
this._vc_8.<API key>(throwOnChange);
this._vc_10.<API key>(throwOnChange);
this._vc_12.<API key>(throwOnChange);
this._vc_23.<API key>(throwOnChange);
const currVal_40:any = this.context.disabled;
if (import11.checkBinding(throwOnChange,this._expr_40,currVal_40)) {
this.renderer.setElementClass(this._el_18,'md-disabled',currVal_40);
this._expr_40 = currVal_40;
}
const currVal_41:any = this.context.focused;
if (import11.checkBinding(throwOnChange,this._expr_41,currVal_41)) {
this.renderer.setElementClass(this._el_20,'md-focused',currVal_41);
this._expr_41 = currVal_41;
}
const currVal_42:any = (this.context.dividerColor == 'accent');
if (import11.checkBinding(throwOnChange,this._expr_42,currVal_42)) {
this.renderer.setElementClass(this._el_20,'md-accent',currVal_42);
this._expr_42 = currVal_42;
}
const currVal_43:any = (this.context.dividerColor == 'warn');
if (import11.checkBinding(throwOnChange,this._expr_43,currVal_43)) {
this.renderer.setElementClass(this._el_20,'md-warn',currVal_43);
this._expr_43 = currVal_43;
}
if (!throwOnChange) { if (this._viewQuery_input_0.dirty) {
this._viewQuery_input_0.reset([
this._vc_8.mapNestedViews(View_MdInput1,(nestedView:View_MdInput1):any => {
return [new import18.ElementRef(nestedView._el_0)];
}),
this._vc_10.mapNestedViews(View_MdInput2,(nestedView:View_MdInput2):any => {
return [new import18.ElementRef(nestedView._el_0)];
})
]
);
this.context._inputElement = this._viewQuery_input_0.first;
} }
}
destroyInternal():void {
this._vc_8.destroyNestedViews();
this._vc_10.destroyNestedViews();
this._vc_12.destroyNestedViews();
this._vc_23.destroyNestedViews();
}
<API key>(nodeIndex:number):import9.AppView<any> {
if ((nodeIndex == 8)) { return new View_MdInput1(this.viewUtils,this,8,this._anchor_8,this._vc_8); }
if ((nodeIndex == 10)) { return new View_MdInput2(this.viewUtils,this,10,this._anchor_10,this._vc_10); }
if ((nodeIndex == 12)) { return new View_MdInput3(this.viewUtils,this,12,this._anchor_12,this._vc_12); }
if ((nodeIndex == 23)) { return new View_MdInput5(this.viewUtils,this,23,this._anchor_23,this._vc_23); }
return (null as any);
}
} |
<?php
namespace ptech\vegas;
use yii\base\<API key>;
use yii\base\Widget;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\web\JsExpression;
class Vegas extends Widget
{
/**
* @var string the DOM element the Widget is applied to.
*/
public $target = 'body';
public $slides = [];
/**
* @var array the HTML attributes for the widget container tag.
*/
public $options = [];
public $clientOptions = [];
/**
* Initializes the widget.
* This method will register the bootstrap asset bundle. If you override this method,
* make sure you call the parent implementation first.
*/
public function init()
{
parent::init();
if (empty($this->target)) {
throw new <API key>("The 'target' variable is required");
}
}
/**
* Renders the widget.
*/
public function run()
{
$this-><API key>();
}
/**
* Registers the required js files and script to initialize ChartJS plugin
*/
protected function <API key>()
{
$view = $this->getView();
VegasAsset::register($view);
$config = Json::encode($this->clientOptions);
$js = "jQuery('{$this->domTarget}').vegas($config)";
$view->registerJs($js);
}
protected function getDomTarget(){
return ($this->target === 'body') ? $this->target : '#'.$this->target;
}
} |
// Use of this source code is governed by a MIT-style
package admin
import (
api "github.com/gogits/go-gogs-client"
"github.com/G-Node/gogs/models"
"github.com/G-Node/gogs/pkg/context"
"github.com/G-Node/gogs/routes/api/v1/convert"
"github.com/G-Node/gogs/routes/api/v1/user"
)
// https://github.com/gogits/go-gogs-client/wiki/<API key>#<API key>
func CreateOrg(c *context.APIContext, form api.CreateOrgOption) {
u := user.GetUserByParams(c)
if c.Written() {
return
}
org := &models.User{
Name: form.UserName,
FullName: form.FullName,
Description: form.Description,
Website: form.Website,
Location: form.Location,
IsActive: true,
Type: models.<API key>,
}
if err := models.CreateOrganization(org, u); err != nil {
if models.<API key>(err) ||
models.IsErrNameReserved(err) ||
models.<API key>(err) {
c.Error(422, "", err)
} else {
c.Error(500, "CreateOrganization", err)
}
return
}
c.JSON(201, convert.ToOrganization(org))
} |
<!DOCTYPE html><html lang="en"><head></head><body><p>test</p><br/></body></html> |
using System;
using System.Net.NetworkInformation;
using System.Threading.Tasks;
namespace Audit.Core
{
public partial class AuditScope
{
<summary>
Shortcut to create an audit scope
</summary>
public static AuditScope Create(AuditScopeOptions options)
{
return new AuditScope(options).Start();
}
<summary>
Shortcut to create an audit scope
</summary>
public static async Task<AuditScope> CreateAsync(AuditScopeOptions options)
{
return await new AuditScope(options).StartAsync();
}
<summary>
Creates an audit scope with the given creation options as a Fluent API.
</summary>
public static IAuditScope Create(Action<<API key>> config)
{
var options = new AuditScopeOptions(config);
return new AuditScope(options).Start();
}
<summary>
Creates an audit scope with the given creation options as a Fluent API.
</summary>
public static async Task<IAuditScope> CreateAsync(Action<<API key>> config)
{
var options = new AuditScopeOptions(config);
return await new AuditScope(options).StartAsync();
}
<summary>
Shortcut to create an audit scope with the given Event type and Target.
</summary>
<param name="eventType">A string representing the type of the event.</param>
<param name="target">The target object getter.</param>
<param name="extraFields">An anonymous object that contains additional fields to be merged into the audit event.</param>
public static AuditScope Create(string eventType, Func<object> target, object extraFields = null)
{
var options = new AuditScopeOptions(eventType: eventType, targetGetter: target, extraFields: extraFields);
return new AuditScope(options).Start();
}
<summary>
Shortcut to create an audit scope with the given Event type and Target.
</summary>
<param name="eventType">A string representing the type of the event.</param>
<param name="target">The target object getter.</param>
<param name="extraFields">An anonymous object that contains additional fields to be merged into the audit event.</param>
public static async Task<AuditScope> CreateAsync(string eventType, Func<object> target, object extraFields = null)
{
var options = new AuditScopeOptions(eventType: eventType, targetGetter: target, extraFields: extraFields);
return await new AuditScope(options).StartAsync();
}
<summary>
Creates an audit scope with the given extra fields, and saves it right away
</summary>
<param name="eventType">Type of the event.</param>
<param name="extraFields">An anonymous object that can contain additional fields to be merged into the audit event.</param>
public static void Log(string eventType, object extraFields)
{
var options = new AuditScopeOptions()
{
EventType = eventType,
ExtraFields = extraFields,
IsCreateAndSave = true
};
new AuditScope(options).Start();
}
<summary>
Creates an audit scope with the given extra fields, and saves it right away
</summary>
<param name="eventType">Type of the event.</param>
<param name="extraFields">An anonymous object that can contain additional fields to be merged into the audit event.</param>
public static async Task LogAsync(string eventType, object extraFields)
{
var options = new AuditScopeOptions()
{
EventType = eventType,
ExtraFields = extraFields,
IsCreateAndSave = true
};
await new AuditScope(options).StartAsync();
}
}
} |
<div class="commune_descr limited">
<p>
Les Grandes-Loges est
un village
situé dans le département de Marne en Champagne-Ardenne. Elle comptait 244 habitants en 2008.</p>
<p>Si vous pensez emmenager à Les Grandes-Loges, vous pourrez facilement trouver une maison à vendre. </p>
<p>Le parc d'habitations, à Les Grandes-Loges, se décomposait en 2011 en zero appartements et 107 maisons soit
un marché plutôt équilibré.</p>
<p>La ville compte quelques équipements, elle propose entre autres un terrain de sport.</p>
<p>À coté de Les Grandes-Loges sont situées les communes de
<a href="{{VLROOT}}/immobilier/veuve_51617/">La Veuve</a> située à 4 km, 629 habitants,
<a href="{{VLROOT}}/immobilier/aigny_51003/">Aigny</a> située à 7 km, 216 habitants,
<a href="{{VLROOT}}/immobilier/vaudemange_51599/">Vaudemange</a> située à 5 km, 298 habitants,
<a href="{{VLROOT}}/immobilier/juvigny_51312/">Juvigny</a> à 5 km, 913 habitants,
<a href="{{VLROOT}}/immobilier/<API key>/">Livry-Louvercy</a> située à 5 km, 834 habitants,
<a href="{{VLROOT}}/immobilier/vadenay_51587/">Vadenay</a> à 7 km, 227 habitants,
entre autres. De plus, Les Grandes-Loges est située à seulement 28 km de <a href="{{VLROOT}}/immobilier/reims_51454/">Reims</a>.</p>
</div> |
# ShipCompliant - Ruby API Client
The ShipCompliant gem is an API Client for the [SOAP][soap_wiki] API provided by
ShipCompliant. This gem has been created for fast implementation and supports
the 9 main API calls.
[Documentation][documentation_path] | [RDoc][rdoc_path] | [CoreService V1.2][core_service_path]
[![Coverage Status]][coveralls_status] [![Build Status]][travis_status] [![Code Climate]][code_gpa]
## Installation
Add this line to your application's Gemfile:
ruby
gem 'ship_compliant'
And then execute:
bash
$ bundle install
Add this to `config/initializers/ship_compliant.rb`
ruby
ShipCompliant.configure do |c|
c.partner_key = ENV.fetch('SHIP_COMPLIANT_KEY')
c.username = ENV.fetch('SHIP_COMPLIANT_USER')
c.password = ENV.fetch('SHIP_COMPLIANT_PASS')
end
## Usage
TODO: Coming soon...
## Contributing
1. Fork it ( http://github.com/ShipCompliant/ship_compliant-ruby/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
[soap_wiki]: http://en.wikipedia.org/wiki/SOAP
<!-- Documenation Links -->
[documentation_path]: http://shipcompliant.github.io/ship_compliant-ruby/documentation/
[rdoc_path]: http://shipcompliant.github.io/ship_compliant-ruby/rdoc/
[core_service_path]: https://shipcompliant.desk.com/customer/portal/articles/<API key>?b_id=2759
<!-- Status Badges -->
[Coverage Status]: https://coveralls.io/repos/ShipCompliant/ship_compliant-ruby/badge.png?branch=master
[coveralls_status]: https://coveralls.io/r/ShipCompliant/ship_compliant-ruby?branch=master
[Build Status]: https://travis-ci.org/ShipCompliant/ship_compliant-ruby.png?branch=master
[travis_status]: https://travis-ci.org/ShipCompliant/ship_compliant-ruby
[Code Climate]: https://codeclimate.com/github/ShipCompliant/ship_compliant-ruby.png
[code_gpa]: https://codeclimate.com/github/ShipCompliant/ship_compliant-ruby |
var test = require('tape');
var sub = require('level-sublevel');
var level = require('level-test')();
var db = sub(level('update-test', { valueEncoding: 'json' }));
var assoc = require('../')(db);
assoc.add('hackerspace')
.hasMany('hackers', [ 'type', 'hacker' ])
.hasMany('tools', [ 'type', 'tool' ])
;
assoc.add('hacker').belongsTo('hackerspace');
assoc.add('tool')
.hasMany('usage', [ 'type', 'usage' ])
.belongsTo('hackerspace')
;
test('setup', function (t) {
db.batch(require('./data.json').map(function (row) {
return { type: 'put', key: row.key, value: row.value };
}), ready);
function ready () {
setTimeout(function () {
db.put('substack', {
"type": "hacker",
"name": "substack",
"hackerspace": "noisebridge"
});
}, 100);
setTimeout(function () { t.end() }, 200);
}
});
var sudoroomHackers = [
{key:"maxogden",value:{type:'hacker',name:'maxogden',hackerspace:'sudoroom'}},
{key:'wrought',value:{type:'hacker',name:'wrought',hackerspace:'sudoroom'}}
];
var noisebridgeHackers = [
{key:"ioerror",value:{type:"hacker",name:"ioerror",hackerspace:"noisebridge"}},
{key:"mitch",value:{type:"hacker",name:"mitch",hackerspace:"noisebridge"}},
{key:"substack",value:{type:"hacker",name:"substack",hackerspace:"noisebridge"}}
];
var expectedUsage = [
{
key: 'd06ab1',
value: {
type: 'usage',
tool: '8d9a83',
minutes: '45',
user: 'maxogden'
}
}
];
var expectedTools = [
{
key: "8d9a83",
value: {
type: "tool",
name: "3d printer",
hackerspace: "sudoroom"
}
},
{
key: "ea7e66",
value: {
type: "tool",
name: "piano",
hackerspace: "sudoroom"
}
}
];
test('updated', function (t) {
t.plan(7);
assoc.get('sudoroom', function (err, room) {
if (err) t.fail(err);
t.deepEqual(
Object.keys(room).sort(),
[ 'hackers', 'name', 'tools', 'type' ]
);
t.equal(room.name, 'sudoroom');
t.equal(room.type, 'hackerspace');
var hackers = [];
room.hackers()
.on('data', function (row) { hackers.push(row) })
.on('end', function () {
t.deepEqual(scrub(hackers), sudoroomHackers);
})
;
var tools = [];
room.tools()
.on('data', function (row) { tools.push(row) })
.on('end', function () {
t.deepEqual(scrub(tools), expectedTools);
})
;
});
assoc.get('noisebridge', function (err, room) {
var hackers = [];
room.hackers()
.on('data', function (row) { hackers.push(row) })
.on('end', function () {
t.deepEqual(scrub(hackers), noisebridgeHackers);
})
;
});
assoc.get('8d9a83', function (err, tool) {
var usage = [];
tool.usage()
.on('data', function (row) { usage.push(row) })
.on('end', function () {
t.deepEqual(scrub(usage), expectedUsage);
})
;
});
});
function scrub (rows) {
rows.forEach(function (ref) {
Object.keys(ref.value).forEach(function (key) {
if (typeof ref.value[key] === 'function') {
delete ref.value[key];
}
});
});
return rows;
} |
#pragma once
#include <LuminoEngine/Engine/Diagnostics.hpp>
#include "HLSLMetadataParser.hpp"
#include "ShaderTranspiler.hpp"
namespace ln {
namespace detail {
class ShaderRenderState;
class UnifiedShader
: public RefObject
{
public:
struct CodeInfo
{
UnifiedShaderTriple triple;
std::vector<byte_t> code;
//Ref<<API key>> refrection;
};
// 0 is invalid value.
using CodeContainerId = uint32_t;
using TechniqueId = uint32_t;
using PassId = uint32_t;
//static const int FileVersion = 1;
enum FileVersion {
FileVersion_1 = 1, // 0.7.0
FileVersion_2, // 0.8.0
FileVersion_3, // 0.9.0
FileVersion_Last,
FileVersion_Current = FileVersion_Last - 1,
};
static const String FileExt;
UnifiedShader(DiagnosticsManager* diag);
virtual ~UnifiedShader();
bool save(const Path& filePath);
bool load(Stream* stream);
bool addCodeContainer(ShaderStage2 stage, const std::string& entryPointName, CodeContainerId* outId);
void setCode(CodeContainerId container, const UnifiedShaderTriple& triple, const std::vector<byte_t>& code, <API key>* refrection);
//void setCode(ShaderStage2 stage, const std::string& entryPointName, const UnifiedShaderTriple& triple, const std::vector<byte_t>& code, <API key>* refrection);
bool hasCode(ShaderStage2 stage, const std::string& entryPointName, const UnifiedShaderTriple& triple) const;
bool findCodeContainer(ShaderStage2 stage, const std::string& entryPointName, CodeContainerId* outId) const;
const CodeInfo* findCode(CodeContainerId conteinreId, const UnifiedShaderTriple& triple) const;
const std::string& entryPointName(CodeContainerId conteinreId) const;
bool addTechnique(const std::string& name, TechniqueId* outTech);
int techniqueCount() const { return m_techniques.size(); }
TechniqueId techniqueId(int index) const { return indexToId(index); }
const std::string& techniqueName(TechniqueId techId) const { return m_techniques[idToIndex(techId)].name; }
bool addPass(TechniqueId parentTech, const std::string& name, PassId* outPass);
int <API key>(TechniqueId parentTech) const;
PassId <API key>(TechniqueId parentTech, int index) const;
int passCount() const { return m_passes.size(); }
PassId passId(int index) const { return indexToId(index); }
const std::string& passName(PassId passId) const { return m_passes[idToIndex(passId)].name; }
void setVertexShader(PassId pass, CodeContainerId code);
void setPixelShader(PassId pass, CodeContainerId code);
void setRenderState(PassId pass, ShaderRenderState* state);
//void setRefrection(PassId pass, <API key>* value);
void <API key>(PassId pass, const DescriptorLayout& layout);
CodeContainerId vertexShader(PassId pass) const;
CodeContainerId pixelShader(PassId pass) const;
ShaderRenderState* renderState(PassId pass) const;
const DescriptorLayout& descriptorLayout(PassId pass) const;
//<API key>* refrection(PassId pass) const;
void setAttributes(PassId pass, const std::vector<<API key>>& attrs);
const std::vector<<API key>>& attributes(PassId pass) const;
void saveCodes(const StringRef& perfix) const;
private:
int idToIndex(uint32_t id) const { return id - 1; }
uint32_t indexToId(int index) const { return index + 1; }
//int <API key>(ShaderStage2 stage, const std::string& entryPointName) const;
int <API key>(const std::string& name) const;
int findPassInfoIndex(TechniqueId tech, const std::string& name) const;
static void writeString(BinaryWriter* w, const std::string& str);
static void writeByteArray(BinaryWriter* w, const std::vector<byte_t>& data);
static std::string readString(BinaryReader* r);
static std::vector<byte_t> readByteArray(BinaryReader* r);
static bool checkSignature(BinaryReader* r, const char* sig, size_t len, DiagnosticsManager* diag);
struct CodeContainerInfo
{
ShaderStage2 stage;
std::string entryPointName;
std::vector<CodeInfo> codes;
};
struct TechniqueInfo
{
std::string name;
List<PassId> passes;
};
struct PassInfo
{
std::string name;
CodeContainerId vertexShader;
CodeContainerId pixelShader;
Ref<ShaderRenderState> renderState;
DescriptorLayout descriptorLayout;
std::vector<<API key>> attributes; // used by vertexShader
};
DiagnosticsManager* m_diag;
List<CodeContainerInfo> m_codeContainers;
List<TechniqueInfo> m_techniques;
List<PassInfo> m_passes;
};
} // namespace detail
} // namespace ln |
// karma configuration
var karmaConf = {
browserify: {
debug: true,
transform: [
['babelify']
]
},
browsers: ['Firefox_NoVR', 'Chrome'],
// machinima: prevent timeout during recording playback
<API key>: 600000,
client: {
captureConsole: false,
mocha: {'ui': 'tdd'}
},
customLaunchers: {
Firefox_NoVR: {
base: 'Firefox',
prefs: {
'dom.vr.enabled': false
}
}
},
files: [
// module and dependencies
{pattern: 'main.js', included: true},
// test files.
{pattern: '.*.test.js'},
// HTML machinima scenes (pre-processed by html2js)
'.*.js': ['browserify'], |
# <API key>
A plugin to generate boilerplate code for android development
This plugin generates all the private fields of all the xml elements having an id present in the xml layout in the corresponding activity or fragment class.
For example:
If the xml layout contains
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:hint="@string/hint_activity_login"
android:id="@+id/username"
android:layout_gravity="center_horizontal"/>
It will generate the corresponding field in the corresponding class of activity or fragment.
Private EditText username;
And in the onCreateView() of fragment it will generate
username=(EditText)v.findViewById(R.id.username);
The fragment class will look like this
Public class LoginFragment extends Fragment{
Private EditText username;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_login, container, false);
username = (EditText) v.findViewById(R.id.username);
return v;
}
And in the activity it will generate the required code in the
onCreate() method.
# How to use
Click on the jamknife menu item,then click generate code when the xml layout file is opened in the editor.
# How it works
It takes the activity or fragment class from the context line of the root xml element and generates the appropriate code as shown above.
context line example:
tools:context="com.example.shreyans.volleytest.Main22Activity"
it takes Main22Activity activity class and generates the code in that class. |
#!/usr/bin/env bash
source vars.sh
printUnitFile() {
read -r -d '' UNIT_CONTENTS << EOF
[Unit]
Description=${DESCRIPTION}
Wants=network-online.target
After=network.target network-online.target
[Install]
WantedBy=multi-user.target
[Service]
ExecStart=${INSTALL_FILE}
SyslogIdentifier=${CANONICAL_NAME}
Restart=always
RestartSec=10
EOF
echo "$UNIT_CONTENTS" > ${UNIT_FILE} || exit 1
}
printDetails() {
echo "name: $NAME"
echo "version: $VERSION"
echo "description: $DESCRIPTION"
echo "canonical name: $CANONICAL_NAME"
echo "conf dir: $CONF_DIR"
echo "conf file: $CONF_FILE"
echo "install file: $INSTALL_FILE"
echo "systemd unit file: $UNIT_FILE"
echo "docs dir: $DOCS_DIR"
echo "templates dir: $TPL_DIR"
}
mkdir -p "${CONF_DIR}" || exit 1
cp -rf docs "${DOCS_DIR}" || exit 1
if [ ! -f "${CONF_FILE}" ]; then
cp "conf.yml" "${CONF_FILE}" || exit 1
fi
mkdir -p "${TPL_DIR}" || exit 1
if [ ! -f "${EMAIL_INVITE_TPL}" ]; then
cp "invitation_email.html" "${EMAIL_INVITE_TPL}" || exit 1
fi
if [ ! -f "${PHONE_INVITE_TPL}" ]; then
cp "invitation_sms.tpl" "${PHONE_INVITE_TPL}" || exit 1
fi
if [ ! -f "${<API key>}" ]; then
cp "reset_pass_email.html" "${<API key>}" || exit 1
fi
if [ ! -f "${<API key>}" ]; then
cp "reset_pass_sms.tpl" "${<API key>}" || exit 1
fi
if [ ! -f "${EMAIL_VERIFY_TPL}" ]; then
cp "verify_email.html" "${EMAIL_VERIFY_TPL}" || exit 1
fi
if [ ! -f "${PHONE_VERIFY_TPL}" ]; then
cp "verify_sms.tpl" "${PHONE_VERIFY_TPL}" || exit 1
fi
mkdir -p "${INSTALL_DIR}" || exit 1
cp -f ../bin/app "${INSTALL_FILE}" || exit 1
printUnitFile
systemctl enable "${UNIT_NAME}"
systemctl daemon-reload
systemctl start "${UNIT_NAME}"
printDetails |
package wolfogre.khtd4;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity implements View.OnTouchListener {
GestureDetector gestureDetector;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((BoardView) findViewById(R.id.view)).restart();
Toast.makeText(MainActivity.this, "Restart!", Toast.LENGTH_SHORT).show();
}
});
View activity = findViewById(R.id.activity);
activity.setOnTouchListener(this);
activity.setFocusable(true);
activity.setClickable(true);
activity.setLongClickable(true);
gestureDetector = new GestureDetector( new GestureDetector.OnGestureListener() {
@Override
public boolean onDown(MotionEvent e) {
return false;
}
@Override
public void onShowPress(MotionEvent e) {
}
@Override
public boolean onSingleTapUp(MotionEvent e) {
return false;
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
return false;
}
@Override
public void onLongPress(MotionEvent e) {
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
((BoardView) findViewById(R.id.view)).changeDirection(velocityX, velocityY);
return false;
}
});
}
@Override
public boolean onTouch(View v, MotionEvent event) {
return gestureDetector.onTouchEvent(event);
}
} |
<?php
namespace Imagine\Gd;
use Imagine\Image\AbstractImage;
use Imagine\Image\ImageInterface;
use Imagine\Image\Box;
use Imagine\Image\BoxInterface;
use Imagine\Image\Metadata\MetadataBag;
use Imagine\Image\Palette\Color\ColorInterface;
use Imagine\Image\Fill\FillInterface;
use Imagine\Image\Point;
use Imagine\Image\PointInterface;
use Imagine\Image\Palette\PaletteInterface;
use Imagine\Image\Palette\Color\RGB as RGBColor;
use Imagine\Image\ProfileInterface;
use Imagine\Image\Palette\RGB;
use Imagine\Exception\<API key>;
use Imagine\Exception\<API key>;
use Imagine\Exception\RuntimeException;
/**
* Image implementation using the GD library
*/
final class Image extends AbstractImage
{
/**
* @var resource
*/
private $resource;
/**
* @var Layers|null
*/
private $layers;
/**
* @var PaletteInterface
*/
private $palette;
/**
* Constructs a new Image instance
*
* @param resource $resource
* @param PaletteInterface $palette
* @param MetadataBag $metadata
*/
public function __construct($resource, PaletteInterface $palette, MetadataBag $metadata)
{
$this->metadata = $metadata;
$this->palette = $palette;
$this->resource = $resource;
}
/**
* Makes sure the current image resource is destroyed
*/
public function __destruct()
{
if (is_resource($this->resource) && 'gd' === get_resource_type($this->resource)) {
imagedestroy($this->resource);
}
}
/**
* Returns Gd resource
*
* @return resource
*/
public function getGdResource()
{
return $this->resource;
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
final public function copy()
{
$size = $this->getSize();
$copy = $this->createImage($size, 'copy');
if (false === imagecopy($copy, $this->resource, 0, 0, 0, 0, $size->getWidth(), $size->getHeight())) {
throw new RuntimeException('Image copy operation failed');
}
return new Image($copy, $this->palette, $this->metadata);
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
final public function crop(PointInterface $start, BoxInterface $size)
{
if (!$start->in($this->getSize())) {
throw new <API key>('Crop coordinates must start at minimum 0, 0 position from top left corner, crop height and width must be positive integers and must not exceed the current image borders');
}
$width = $size->getWidth();
$height = $size->getHeight();
$dest = $this->createImage($size, 'crop');
if (false === imagecopy($dest, $this->resource, 0, 0, $start->getX(), $start->getY(), $width, $height)) {
throw new RuntimeException('Image crop operation failed');
}
imagedestroy($this->resource);
$this->resource = $dest;
return $this;
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
final public function paste(ImageInterface $image, PointInterface $start)
{
if (!$image instanceof self) {
throw new <API key>(sprintf('Gd\Image can only paste() Gd\Image instances, %s given', get_class($image)));
}
$size = $image->getSize();
if (!$this->getSize()->contains($size, $start)) {
throw new <API key>('Cannot paste image of the given size at the specified position, as it moves outside of the current image\'s box');
}
imagealphablending($this->resource, true);
imagealphablending($image->resource, true);
if (false === imagecopy($this->resource, $image->resource, $start->getX(), $start->getY(), 0, 0, $size->getWidth(), $size->getHeight())) {
throw new RuntimeException('Image paste operation failed');
}
imagealphablending($this->resource, false);
imagealphablending($image->resource, false);
return $this;
}
final public function thumbnailStrict(BoxInterface $size, $mode = ImageInterface::THUMBNAIL_INSET, $filter = ImageInterface::FILTER_UNDEFINED, $background = array(255, 255, 255, 1))
{
if(!$filter) {
$filter = ImageInterface::FILTER_UNDEFINED;
}
$thumbnail = $this->thumbnail($size, $mode, $filter);
$thumbWidth = $thumbnail->getSize()->getWidth();
$thumbHeight = $thumbnail->getSize()->getHeight();
$boxWidth = $size->getWidth();
$boxHeight = $size->getHeight();
$container = $thumbnail->createImage($size, 'resize');
$color = <API key>($container, $background[0], $background[1], $background[2], $background[3]);
imagefill($container, 0, 0, $color);
imagedestroy($this->resource);
$this->resource = $container;
if($thumbWidth < $boxWidth || $thumbHeight < $boxHeight) {
$this->paste($thumbnail, new Point(($boxWidth - $thumbWidth) / 2, ($boxHeight - $thumbHeight) / 2));
} else {
$this->paste($thumbnail, new Point(0, 0));
}
return $this;
}
final public function resizeMaxHeight($maxHeight = 100, $filter = ImageInterface::FILTER_UNDEFINED)
{
$width = imagesx($this->resource);
$height = imagesy($this->resource);
$size = new Box($width * $maxHeight / $height, $maxHeight);
return $this->resize($size, $filter);
}
final public function resizeMaxWidth($maxWidth = 100, $filter = ImageInterface::FILTER_UNDEFINED)
{
$width = imagesx($this->resource);
$height = imagesy($this->resource);
$size = new Box($maxWidth, $height * $maxWidth / $width);
return $this->resize($size, $filter);
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
final public function resize(BoxInterface $size, $filter = ImageInterface::FILTER_UNDEFINED)
{
if (ImageInterface::FILTER_UNDEFINED !== $filter) {
throw new <API key>('Unsupported filter type, GD only supports ImageInterface::FILTER_UNDEFINED filter');
}
$width = $size->getWidth();
$height = $size->getHeight();
$dest = $this->createImage($size, 'resize');
imagealphablending($this->resource, true);
imagealphablending($dest, true);
if (false === imagecopyresampled($dest, $this->resource, 0, 0, 0, 0, $width, $height, imagesx($this->resource), imagesy($this->resource))) {
throw new RuntimeException('Image resize operation failed');
}
imagealphablending($this->resource, false);
imagealphablending($dest, false);
imagedestroy($this->resource);
$this->resource = $dest;
return $this;
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
final public function rotate($angle, ColorInterface $background = null)
{
$color = $background ? $background : $this->palette->color('fff');
$resource = imagerotate($this->resource, -1 * $angle, $this->getColor($color));
if (false === $resource) {
throw new RuntimeException('Image rotate operation failed');
}
imagedestroy($this->resource);
$this->resource = $resource;
return $this;
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
final public function save($path = null, array $options = array())
{
$path = null === $path ? (isset($this->metadata['filepath']) ? $this->metadata['filepath'] : $path) : $path;
if (null === $path) {
throw new RuntimeException('You can omit save path only if image has been open from a file');
}
if (isset($options['format'])) {
$format = $options['format'];
} elseif ('' !== $extension = pathinfo($path, \PATHINFO_EXTENSION)) {
$format = $extension;
} else {
$originalPath = isset($this->metadata['filepath']) ? $this->metadata['filepath'] : null;
$format = pathinfo($originalPath, \PATHINFO_EXTENSION);
}
$this->saveOrOutput($format, $options, $path);
return $this;
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
public function show($format, array $options = array())
{
header('Content-type: '.$this->getMimeType($format));
$this->saveOrOutput($format, $options);
return $this;
}
/**
* {@inheritdoc}
*/
public function get($format, array $options = array())
{
ob_start();
$this->saveOrOutput($format, $options);
return ob_get_clean();
}
/**
* {@inheritdoc}
*/
public function __toString()
{
return $this->get('png');
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
final public function flipHorizontally()
{
$size = $this->getSize();
$width = $size->getWidth();
$height = $size->getHeight();
$dest = $this->createImage($size, 'flip');
for ($i = 0; $i < $width; $i++) {
if (false === imagecopy($dest, $this->resource, $i, 0, ($width - 1) - $i, 0, 1, $height)) {
throw new RuntimeException('Horizontal flip operation failed');
}
}
imagedestroy($this->resource);
$this->resource = $dest;
return $this;
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
final public function flipVertically()
{
$size = $this->getSize();
$width = $size->getWidth();
$height = $size->getHeight();
$dest = $this->createImage($size, 'flip');
for ($i = 0; $i < $height; $i++) {
if (false === imagecopy($dest, $this->resource, 0, $i, 0, ($height - 1) - $i, $width, 1)) {
throw new RuntimeException('Vertical flip operation failed');
}
}
imagedestroy($this->resource);
$this->resource = $dest;
return $this;
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
final public function strip()
{
// GD strips profiles and comment, so there's nothing to do here
return $this;
}
/**
* {@inheritdoc}
*/
public function draw()
{
return new Drawer($this->resource);
}
/**
* {@inheritdoc}
*/
public function effects()
{
return new Effects($this->resource);
}
/**
* {@inheritdoc}
*/
public function getSize()
{
return new Box(imagesx($this->resource), imagesy($this->resource));
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
public function applyMask(ImageInterface $mask)
{
if (!$mask instanceof self) {
throw new <API key>('Cannot mask non-gd images');
}
$size = $this->getSize();
$maskSize = $mask->getSize();
if ($size != $maskSize) {
throw new <API key>(sprintf('The given mask doesn\'t match current image\'s size, Current mask\'s dimensions are %s, while image\'s dimensions are %s', $maskSize, $size));
}
for ($x = 0, $width = $size->getWidth(); $x < $width; $x++) {
for ($y = 0, $height = $size->getHeight(); $y < $height; $y++) {
$position = new Point($x, $y);
$color = $this->getColorAt($position);
$maskColor = $mask->getColorAt($position);
$round = (int) round(max($color->getAlpha(), (100 - $color->getAlpha()) * $maskColor->getRed() / 255));
if (false === imagesetpixel($this->resource, $x, $y, $this->getColor($color->dissolve($round - $color->getAlpha())))) {
throw new RuntimeException('Apply mask operation failed');
}
}
}
return $this;
}
/**
* {@inheritdoc}
*
* @return ImageInterface
*/
public function fill(FillInterface $fill)
{
$size = $this->getSize();
for ($x = 0, $width = $size->getWidth(); $x < $width; $x++) {
for ($y = 0, $height = $size->getHeight(); $y < $height; $y++) {
if (false === imagesetpixel($this->resource, $x, $y, $this->getColor($fill->getColor(new Point($x, $y))))) {
throw new RuntimeException('Fill operation failed');
}
}
}
return $this;
}
/**
* {@inheritdoc}
*/
public function mask()
{
$mask = $this->copy();
if (false === imagefilter($mask->resource, <API key>)) {
throw new RuntimeException('Mask operation failed');
}
return $mask;
}
/**
* {@inheritdoc}
*/
public function histogram()
{
$size = $this->getSize();
$colors = array();
for ($x = 0, $width = $size->getWidth(); $x < $width; $x++) {
for ($y = 0, $height = $size->getHeight(); $y < $height; $y++) {
$colors[] = $this->getColorAt(new Point($x, $y));
}
}
return array_unique($colors);
}
/**
* {@inheritdoc}
*/
public function getColorAt(PointInterface $point)
{
if (!$point->in($this->getSize())) {
throw new RuntimeException(sprintf('Error getting color at point [%s,%s]. The point must be inside the image of size [%s,%s]', $point->getX(), $point->getY(), $this->getSize()->getWidth(), $this->getSize()->getHeight()));
}
$index = imagecolorat($this->resource, $point->getX(), $point->getY());
$info = imagecolorsforindex($this->resource, $index);
return $this->palette->color(array($info['red'], $info['green'], $info['blue']), max(min(100 - (int) round($info['alpha'] / 127 * 100), 100), 0));
}
/**
* {@inheritdoc}
*/
public function layers()
{
if (null === $this->layers) {
$this->layers = new Layers($this, $this->palette, $this->resource);
}
return $this->layers;
}
/**
* {@inheritdoc}
**/
public function interlace($scheme)
{
static $<API key> = array(
ImageInterface::INTERLACE_NONE => 0,
ImageInterface::INTERLACE_LINE => 1,
ImageInterface::INTERLACE_PLANE => 1,
ImageInterface::INTERLACE_PARTITION => 1,
);
if (!array_key_exists($scheme, $<API key>)) {
throw new <API key>('Unsupported interlace type');
}
imageinterlace($this->resource, $<API key>[$scheme]);
return $this;
}
/**
* {@inheritdoc}
*/
public function palette()
{
return $this->palette;
}
/**
* {@inheritdoc}
*/
public function profile(ProfileInterface $profile)
{
throw new RuntimeException('GD driver does not support color profiles');
}
/**
* {@inheritdoc}
*/
public function usePalette(PaletteInterface $palette)
{
if (!$palette instanceof RGB) {
throw new RuntimeException('GD driver only supports RGB palette');
}
$this->palette = $palette;
return $this;
}
/**
* Internal
*
* Performs save or show operation using one of GD's image... functions
*
* @param string $format
* @param array $options
* @param string $filename
*
* @throws <API key>
* @throws RuntimeException
*/
private function saveOrOutput($format, array $options, $filename = null)
{
$format = $this->normalizeFormat($format);
if (!$this->supported($format)) {
throw new <API key>(sprintf('Saving image in "%s" format is not supported, please use one of the following extensions: "%s"', $format, implode('", "', $this->supported())));
}
$save = 'image'.$format;
$args = array(&$this->resource, $filename);
// Preserve BC until version 1.0
if (isset($options['quality']) && !isset($options['<API key>'])) {
$options['<API key>'] = round((100 - $options['quality']) * 9 / 100);
}
if (isset($options['filters']) && !isset($options['<API key>'])) {
$options['<API key>'] = $options['filters'];
}
$options = $this->updateSaveOptions($options);
if ($format === 'jpeg' && isset($options['jpeg_quality'])) {
$args[] = $options['jpeg_quality'];
}
if ($format === 'png') {
if (isset($options['<API key>'])) {
if ($options['<API key>'] < 0 || $options['<API key>'] > 9) {
throw new <API key>('<API key> option should be an integer from 0 to 9');
}
$args[] = $options['<API key>'];
} else {
$args[] = -1; // use default level
}
if (isset($options['<API key>'])) {
if (~PNG_ALL_FILTERS & $options['<API key>']) {
throw new <API key>('<API key> option should be a combination of the PNG_FILTER_XXX constants');
}
$args[] = $options['<API key>'];
}
}
if (($format === 'wbmp' || $format === 'xbm') && isset($options['foreground'])) {
$args[] = $options['foreground'];
}
$this->setExceptionHandler();
if (false === <API key>($save, $args)) {
throw new RuntimeException('Save operation failed');
}
$this-><API key>();
}
/**
* Internal
*
* Generates a GD image
*
* @param BoxInterface $size
* @param string the operation initiating the creation
*
* @return resource
*
* @throws RuntimeException
*
*/
private function createImage(BoxInterface $size, $operation)
{
$resource = <API key>($size->getWidth(), $size->getHeight());
if (false === $resource) {
throw new RuntimeException('Image '.$operation.' failed');
}
if (false === imagealphablending($resource, false) || false === imagesavealpha($resource, true)) {
throw new RuntimeException('Image '.$operation.' failed');
}
if (function_exists('imageantialias')) {
imageantialias($resource, true);
}
$transparent = <API key>($resource, 255, 255, 255, 127);
imagefill($resource, 0, 0, $transparent);
<API key>($resource, $transparent);
return $resource;
}
/**
* Internal
*
* Generates a GD color from Color instance
*
* @param ColorInterface $color
*
* @return integer A color identifier
*
* @throws RuntimeException
* @throws <API key>
*/
private function getColor(ColorInterface $color)
{
if (!$color instanceof RGBColor) {
throw new <API key>('GD driver only supports RGB colors');
}
$index = <API key>($this->resource, $color->getRed(), $color->getGreen(), $color->getBlue(), round(127 * (100 - $color->getAlpha()) / 100));
if (false === $index) {
throw new RuntimeException(sprintf('Unable to allocate color "RGB(%s, %s, %s)" with transparency of %d percent', $color->getRed(), $color->getGreen(), $color->getBlue(), $color->getAlpha()));
}
return $index;
}
/**
* Internal
*
* Normalizes a given format name
*
* @param string $format
*
* @return string
*/
private function normalizeFormat($format)
{
$format = strtolower($format);
if ('jpg' === $format || 'pjpeg' === $format) {
$format = 'jpeg';
}
return $format;
}
/**
* Internal
*
* Checks whether a given format is supported by GD library
*
* @param string $format
*
* @return Boolean
*/
private function supported($format = null)
{
$formats = array('gif', 'jpeg', 'png', 'wbmp', 'xbm');
if (null === $format) {
return $formats;
}
return in_array($format, $formats);
}
private function setExceptionHandler()
{
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
if (0 === error_reporting()) {
return;
}
throw new RuntimeException($errstr, $errno, new \ErrorException($errstr, 0, $errno, $errfile, $errline));
}, E_WARNING | E_NOTICE);
}
private function <API key>()
{
<API key>();
}
/**
* Internal
*
* Get the mime type based on format.
*
* @param string $format
*
* @return string mime-type
*
* @throws RuntimeException
*/
private function getMimeType($format)
{
$format = $this->normalizeFormat($format);
if (!$this->supported($format)) {
throw new RuntimeException('Invalid format');
}
static $mimeTypes = array(
'jpeg' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
'wbmp' => 'image/vnd.wap.wbmp',
'xbm' => 'image/xbm',
);
return $mimeTypes[$format];
}
} |
package com.pixnfit.ws.tasks;
import android.content.Context;
import android.util.Log;
import com.pixnfit.utils.HTTPPostFile;
import org.json.JSONException;
import java.io.IOException;
import java.net.HttpURLConnection;
public abstract class WsPostFileAsyncTask<Params, Progress, Result> extends WsAsyncTask<Params, Progress, Result> {
private static final String TAG = WsPostFileAsyncTask.class.getSimpleName();
public WsPostFileAsyncTask(Context context) {
super(context);
}
@Override
protected Result doInBackground(Params... params) {
String url = getUrl(params);
try {
HttpURLConnection httpURLConnection = initConnection(url, "POST");
HTTPPostFile.uploadFile(httpURLConnection, getFile(params));
int responseCode = httpURLConnection.getResponseCode();
if (responseCode == <API key>()) {
Log.i(TAG, "POST " + url + ": success, HTTP " + responseCode);
String dataAsJSON = readConnection(httpURLConnection);
return toResult(dataAsJSON);
} else {
// Error
Log.e(TAG, "POST " + url + ": failed, error HTTP " + responseCode);
return null;
}
} catch (IOException e) {
// writing exception to log
Log.e(TAG, "POST " + url + ": IOException", e);
return null;
} catch (JSONException e) {
// writing exception to log
Log.e(TAG, "POST " + url + ": IOException", e);
return null;
}
}
@Override
protected final String getHTTPMethod() {
return HTTP_METHOD_POST;
}
@Override
protected final int <API key>() {
return HttpURLConnection.HTTP_CREATED;
}
protected abstract String getFile(Params... params);
} |
package org.robolectric.tester.android.view;
import android.graphics.drawable.Drawable;
import android.view.View;
import org.junit.Before;
import org.junit.Test;
import android.view.MenuItem;
import org.junit.runner.RunWith;
import org.robolectric.R;
import org.robolectric.Robolectric;
import org.robolectric.TestRunners;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(TestRunners.WithDefaults.class)
public class MenuItemTest {
private MenuItem item;
private <API key> listener;
@Before
public void setUp() throws Exception {
item = new TestMenuItem();
listener = new <API key>();
item.<API key>(listener);
}
@Test
public void <API key>() throws Exception {
assertThat(item.isChecked()).isFalse();
item.setChecked(true);
assertThat(item.isChecked()).isTrue();
}
@Test
public void <API key>() throws Exception {
assertThat(item.isCheckable()).isFalse();
item.setCheckable(true);
assertThat(item.isCheckable()).isTrue();
}
@Test
public void <API key>() throws Exception {
assertThat(item.isVisible()).isTrue();
item.setVisible(false);
assertThat(item.isVisible()).isFalse();
}
@Test
public void <API key>() throws Exception {
item.setActionView(null);
assertThat(item.expandActionView()).isFalse();
}
@Test
public void <API key>() throws Exception {
item.setActionView(new View(Robolectric.application));
assertThat(item.expandActionView()).isTrue();
assertThat(item.<API key>()).isTrue();
}
@Test
public void <API key>() throws Exception {
item.setActionView(new View(Robolectric.application));
item.expandActionView();
assertThat(listener.expanded).isTrue();
}
@Test
public void <API key>() throws Exception {
item.setActionView(null);
assertThat(item.collapseActionView()).isFalse();
}
@Test
public void <API key>() throws Exception {
item.setActionView(new View(Robolectric.application));
item.expandActionView();
assertThat(item.collapseActionView()).isTrue();
assertThat(item.<API key>()).isFalse();
}
@Test
public void <API key>() throws Exception {
item.setActionView(new View(Robolectric.application));
listener.expanded = true;
item.collapseActionView();
assertThat(listener.expanded).isFalse();
}
@Test
public void <API key>() throws Exception {
item = item.setEnabled(true);
assertThat(item).isNotNull();
item = item.<API key>(null);
assertThat(item).isNotNull();
item = item.setActionProvider(null);
assertThat(item).isNotNull();
item = item.setActionView(0);
assertThat(item).isNotNull();
item = item.setActionView(null);
assertThat(item).isNotNull();
item = item.<API key>('a');
assertThat(item).isNotNull();
item = item.setCheckable(false);
assertThat(item).isNotNull();
item = item.setChecked(true);
assertThat(item).isNotNull();
item = item.setIcon(null);
assertThat(item).isNotNull();
item = item.setIcon(0);
assertThat(item).isNotNull();
item = item.setIntent(null);
assertThat(item).isNotNull();
item = item.setNumericShortcut('6');
assertThat(item).isNotNull();
item = item.<API key>(null);
assertThat(item).isNotNull();
item = item.setShortcut('6', 'z');
assertThat(item).isNotNull();
item = item.<API key>(MenuItem.<API key>);
assertThat(item).isNotNull();
item = item.setTitleCondensed("condensed");
assertThat(item).isNotNull();
item = item.setVisible(true);
assertThat(item).isNotNull();
item = item.setTitle("title");
assertThat(item).isNotNull();
item = item.setTitle(0);
assertThat(item).isNotNull();
}
@Test
public void <API key>() throws Exception {
Drawable expectedDrawable = Robolectric.application.getResources().getDrawable(R.drawable.an_image);
assertThat(expectedDrawable).isNotNull();
assertThat(item.getIcon()).isNull();
item.setIcon(R.drawable.an_image);
assertThat(item.getIcon()).isEqualTo(expectedDrawable);
item.setIcon(0);
assertThat(item.getIcon()).isNull();
}
@Test
public void <API key>() throws Exception {
Drawable testDrawable = Robolectric.application.getResources().getDrawable(R.drawable.an_image);
assertThat(testDrawable).isNotNull();
assertThat(item.getIcon()).isNull();
item.setIcon(testDrawable);
assertThat(item.getIcon()).isSameAs(testDrawable);
}
@Test
public void <API key>() throws Exception {
assertThat(item.getIcon()).isNull();
item.setIcon(R.drawable.an_other_image);
Drawable expectedDrawable = Robolectric.application.getResources().getDrawable(R.drawable.an_other_image);
assertThat(item.getIcon()).isEqualTo(expectedDrawable);
}
@Test
public void <API key>() throws Exception {
assertThat(item.<API key>(listener)).isSameAs(item);
}
class <API key> implements MenuItem.<API key> {
private boolean expanded = false;
@Override
public boolean <API key>(MenuItem menuItem) {
expanded = true;
return true;
}
@Override
public boolean <API key>(MenuItem menuItem) {
expanded = false;
return true;
}
}
} |
<?php
namespace Mizmoz\App\Contract;
use Mizmoz\Config\Contract\ConfigInterface;
use Mizmoz\Container\Contract\ContainerInterface;
interface <API key>
{
/**
* Register the item with the application. This should be used by libraries such as the queue which will
* need to register the queue management UI etc.
*
* @param HttpAppInterface $app
* @param ContainerInterface $container
* @param ConfigInterface $config
*/
public function registerHttp(HttpAppInterface $app, ContainerInterface $container, ConfigInterface $config);
} |
var gulp = require("gulp"),
jshint = require("gulp-jshint"),
jsreporter = require("jshint-stylish"),
shell = require("gulp-shell");
gulp.task("jshint", function () {
gulp.src("./dnssearch.js")
.pipe(jshint())
.pipe(jshint.reporter(jsreporter));
});
gulp.task("test", function () {
gulp.src("")
.pipe(shell(["npm test"]));
});
gulp.task("default", ["build", "test"]);
gulp.task("build", ["jshint"]); |
/**
* Course Controller
*
* Handles viewing and editing courses
*/
import Config from '../../config/webbox.config';
import { EventLog, EventLogTypes } from '../models/eventLog';
import TestResult from '../models/testResult';
import CodeEmbed from '../models/codeEmbed';
import Thinky from '../util/thinky';
import Promise from 'bluebird';
import { RemoteActions } from '../../common/constants/Embed';
const R = Thinky.r;
export async function onEvent (request, h) {
const io = request.server.plugins['hapi-io'].io; // socket.io server reference
const username = request.auth.credentials.username;
const userId = request.auth.credentials.userid;
const eventData = request.payload.eventData || {};
let type;
let timeStamp;
// Type required a special handling for errors,
// this allows us to query errors easily
if (request.payload.eventName === EventLogTypes.Error) {
type = eventData.error || 'unknown';
} else {
type = '';
}
// TimeStamp checking
if (request.payload.timeStamp) {
try {
timeStamp = new Date(request.payload.timeStamp);
} catch (err) {
console.warn('websocket.onEvent received malformed timeStamp from user', userId, username);
timeStamp = new Date();
}
} else {
timeStamp = new Date();
}
// Pluck data to create event log
let logData = {
name: request.payload.eventName,
type: type,
message: eventData.message,
embedId: request.payload.embedId || '',
embedName: request.payload.embedName,
username: username,
userId: userId,
data: eventData,
timeStamp: timeStamp
};
// Create EventLog instance
const eventLog = new EventLog(logData);
// Validate EventLog using our defined schema
try {
eventLog.validate();
} catch (err) {
// Validation error, invalid data provided
console.error('websocket.onEvent received invalid event data', err);
// Leave generator
return h.response({message: 'invalid event data'});
}
// Data is valid
try {
await eventLog.save();
} catch (err) {
console.error('websocket.onEvent failed to save EventLog', err);
}
// Notify listeners for this example
if (io) {
// push the log event to listeners
try {
io.to(eventLog.embedId).emit('ide-event', eventLog);
} catch (e) {
console.log('failed broadcast', e);
}
}
// finished
return h.response({message: 'finished'});
}
function submission(request, credentials) {
const io = request.server.plugins['hapi-io'].io; // socket.io server reference
const embedId = request.payload.embedId;
if (embedId == null) {
return { error: 'Invalid or no embedId specified.' };
}
// Check owner
if (credentials.isOwner === true) {
return {
error: 'Dir gehört das Beispiel, du kannst nichts an dich selbst schicken.'
};
}
console.info('submission', credentials);
// Broadcast to room with embedId
if (io) {
// push the log event to listeners
console.log('Broadcast submission from user %s (%s)', credentials.userid, credentials.username);
io.to(embedId).emit('submission', request.payload);
}
return {};
}
function saveTestResult(request, credentials) {
const io = request.server.plugins['hapi-io'].io; // socket.io server reference
const embedId = request.payload.embedId;
const username = credentials.username;
const userId = credentials.userid;
const actionData = request.payload.actionData || {};
let timeStamp;
if (embedId == null) {
return { error: 'Invalid or no embedId specified.' };
}
// TimeStamp checking
if (request.payload.timeStamp) {
try {
timeStamp = new Date(request.payload.timeStamp);
} catch (err) {
console.warn('websocket.onEvent received malformed timeStamp from user', userId, username);
timeStamp = new Date();
}
} else {
timeStamp = new Date();
}
// Pluck data to create event log
let testResultData = {
userId: userId,
embedId: embedId,
score: actionData.score,
scorePercentage: actionData.scorePercentage,
data: actionData.data,
timeStamp: timeStamp
};
// Create TestResult instance
const testResult = new TestResult(testResultData);
// Validate TestResult using our defined schema
try {
testResult.validate();
} catch (err) {
// Validation error, invalid data provided
console.error('websocket.saveTestResult received invalid TestResult data', err);
// Leave generator
return {};
}
// Data is valid
TestResult.updateOrCreate(testResultData);
// Notify listeners for this example
if (io) {
// push the log event to listeners
try {
io.to(testResult.embedId).emit('user-testresult', testResult);
} catch (e) {
console.log('Failed broadcast', e);
}
}
return {};
}
/**
* Subscribing on room for receiving events
*/
function subscribe(request, credentials) {
const io = request.plugins['hapi-io'];
const embedId = request.payload.embedId;
let socket;
if (embedId == null) {
return { error: 'Invalid or no embedId specified.' };
}
// Check rights
if (!credentials.isOwner && !(Config.websocket.notify.authorsAllowed && credentials.isAuthor)) {
return {
error: Config.messages.websocket.subscribeNotAllowed
};
}
// Add user to room
if (io) {
socket = io.socket;
try {
socket.join(embedId);
} catch (e) {
console.error('websocket.subscribe', e);
}
}
return {};
}
/**
* Subscribing on room for receiving events
*/
function unsubscribe(request, credentials) {
const io = request.plugins['hapi-io'];
const embedId = request.payload.embedId;
let socket;
if (embedId == null) {
return { error: 'Invalid or no embedId specified.' };
}
// Check rights
if (!credentials.isOwner && !(Config.websocket.notify.authorsAllowed && credentials.isAuthor)) {
return {
error: Config.messages.websocket.subscribeNotAllowed
};
}
// Add user to room
if (io) {
socket = io.socket;
socket.leave(embedId);
}
return {};
}
async function <API key>(payload, credentials) {
let embedId;
let metadata;
if (!credentials.isOwner && !(Config.websocket.notify.authorsAllowed && credentials.isAuthor)) {
return {
error: 'Not allowed!'
};
}
embedId = payload.embedId;
if (embedId == null) {
return { error: 'Invalid or no embedId specified.' };
}
try {
let data = await CodeEmbed.get(embedId).pluck('meta', 'slug', 'id', 'createdAt', 'lastUpdate', '_creatorId').execute();
let meta = data.meta;
delete data.meta;
metadata = {...data, ...meta};
console.info('Retrieved code embed metadata (flattend)', metadata);
} catch (err) {
console.error('websocket.<API key> retrieving metadata for embed failed', err);
return { error: 'Could not get metadata. See logs.'};
}
return { metadata };
}
async function getTestResults (payload, credentials) {
let testResults;
let embedId;
let filter;
let order;
if (!credentials.isOwner && !(Config.websocket.notify.authorsAllowed && credentials.isAuthor)) {
return {
error: 'Not allowed!'
};
}
embedId = payload.embedId;
if (embedId == null) {
return { error: 'Invalid or no embedId specified.' };
}
filter = { embedId: embedId };
order = { index: 'timeStamp' };
try {
if (payload.startDate != null) {
testResults = await TestResult.orderBy(order)
.filter(filter)
.filter(R.row('timeStamp').during(R.ISO8601(payload.startDate.startDate), R.now()), {leftBound: 'open', rightBound: 'open'})
.run();
} else {
testResults = await TestResult.orderBy(order).filter(filter).run();
}
} catch (err) {
console.error('websocket.getTestResults EventLog filtering for embed failed', err);
return { error: 'Could not get test results. See logs.'};
}
return { testResults: testResults };
}
async function getEvents (payload, credentials) {
let events;
let embedId;
let filter;
let order;
if (!credentials.isOwner && !(Config.websocket.notify.authorsAllowed && credentials.isAuthor)) {
return {
error: 'Not allowed!'
};
}
embedId = payload.embedId;
console.info('getEvents payload', payload);
if (embedId == null) {
return { error: 'Invalid or no embedId specified.' };
}
filter = {
embedId: embedId,
archived: false
};
order = { index: 'timeStamp' };
try {
if (payload.startDate != null) {
events = await EventLog.orderBy(order)
.filter(filter)
.filter(R.row('timeStamp').during(R.ISO8601(payload.startDate.startDate), R.now()), {leftBound: 'open', rightBound: 'open'})
.run();
} else {
events = await EventLog.orderBy(order).filter(filter).run();
}
} catch (err) {
console.log('websocket.getEvents EventLog filtering for embed failed', err);
return { error: 'Could not get events. See logs.'};
}
return { events: events };
}
async function archiveEventLogs (payload, credentials) {
let embedId;
let filter;
if (!credentials.isOwner && !(Config.websocket.notify.authorsAllowed && credentials.isAuthor)) {
return {
error: 'Not allowed!'
};
}
embedId = payload.embedId;
if (embedId == null) {
return { error: 'Invalid or no embedId specified.' };
}
filter = {
embedId: embedId,
archived: false
};
try {
await EventLog.filter(filter).update({archived: true}).run();
console.info('Archived events for embed', embedId);
} catch (err) {
console.log('websocket.archiveEventLogs EventLog filtering for embed failed', err);
return { error: 'Could not archive events. See logs.'};
}
return { };
}
export async function onAction (request, h) {
const actionName = request.payload.action;
const credentials = request.auth.credentials;
let response;
if (!actionName) {
return h({error: 'Invalid action'});
}
console.info('Action requested', actionName, credentials, request.payload);
switch (actionName) {
case RemoteActions.GetEvents:
response = await getEvents(request.payload, credentials);
return response;
case RemoteActions.SubscribeToEvents:
response = subscribe(request, credentials);
return response;
case RemoteActions.<API key>:
response = unsubscribe(request, credentials);
return response;
case RemoteActions.ArchiveEventLogs:
response = await archiveEventLogs(request.payload, credentials);
return response;
case RemoteActions.Submission:
response = submission(request, credentials);
return response;
case RemoteActions.TestResult:
response = await saveTestResult(request, credentials);
return response;
case RemoteActions.GetTestResults:
response = await getTestResults(request.payload, credentials);
return response;
case RemoteActions.<API key>:
response = await <API key>(request.payload, credentials);
return response;
default:
return {error: 'Invalid action'};
}
} |
using ConstantineSpace.Tools;
using UnityEngine;
namespace ConstantineSpace.PinBall
{
public class Launcher : MonoBehaviour, ITouchHandler
{
[Header("Config")]
[SerializeField]
private Rigidbody2D _ball;
[SerializeField]
private readonly float _force = 10.0f;
<summary>
Launches the ball.
</summary>
public void LaunchBall(float touchTime)
{
touchTime = Mathf.Clamp(touchTime, 1.0f, 5.0f);
_ball.AddForce(new Vector2(0.0f, touchTime*_force), ForceMode2D.Impulse);
gameObject.SetActive(false);
}
<summary>
Touch event receiver.
</summary>
<param name="touchTime">The touch time.</param>
public void OnTouched(float touchTime)
{
LaunchBall(touchTime);
}
}
} |
<?php
declare(strict_types=1);
namespace Sonata\AdminBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\<API key>;
use Symfony\Component\DependencyInjection\ContainerBuilder;
final class <API key> implements <API key>
{
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('sonata.admin.maker')) {
return;
}
if (!$container->hasParameter('sonata.admin.configuration.default_controller')) {
return;
}
$defaultController = $container->getParameter('sonata.admin.configuration.default_controller');
\assert(\is_string($defaultController));
if (!$container->hasDefinition($defaultController)) {
return;
}
$adminMaker = $container->getDefinition('sonata.admin.maker');
$<API key> = $container->getDefinition($defaultController);
$adminMaker->replaceArgument(2, $<API key>->getClass());
}
} |
package cd4017be.automation.TileEntity;
import java.util.ArrayList;
import cd4017be.automation.Config;
import cd4017be.lib.Gui.DataContainer;
import cd4017be.lib.Gui.DataContainer.IGuiData;
import cd4017be.lib.Gui.SlotTank;
import cd4017be.lib.Gui.TileContainer;
import cd4017be.lib.Gui.TileContainer.TankSlot;
import cd4017be.lib.templates.AutomatedTile;
import cd4017be.lib.templates.Inventory;
import cd4017be.lib.templates.TankContainer;
import cd4017be.lib.util.Utils;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.<API key>;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.templates.<API key>;
/**
*
* @author CD4017BE
*/
public class Tank extends AutomatedTile implements IGuiData {
private int lastAmount;
public Tank() {
inventory = new Inventory(2, 2, null).group(0, 0, 1, Utils.ACC).group(1, 1, 2, Utils.ACC);
tanks = new TankContainer(1, 1).tank(0, this.capacity(), Utils.OUT, 0, 1);
}
protected int capacity() {return Config.tankCap[2];}
@Override
public void update()
{
super.update();
if (worldObj.isRemote) return;
int d = tanks.getAmount(0) - lastAmount;
if ((d != 0 && (tanks.getAmount(0) == 0 || lastAmount == 0)) || d * d > 250000){
lastAmount = tanks.getAmount(0);
this.markUpdate();
}
}
@Override
public void onDataPacket(NetworkManager net, <API key> pkt)
{
tanks.readFromNBT(pkt.getNbtCompound(), "tank");
}
@Override
public <API key> getUpdatePacket()
{
NBTTagCompound nbt = new NBTTagCompound();
tanks.writeToNBT(nbt, "tank");
return new <API key>(getPos(), -1, nbt);
}
@Override
public void initContainer(DataContainer cont) {
TileContainer container = (TileContainer)cont;
container.addItemSlot(new SlotTank(inventory, 0, 184, 74));
container.addItemSlot(new SlotTank(inventory, 1, 202, 74));
container.addPlayerInventory(8, 16);
container.addTankSlot(new TankSlot(tanks, 0, 184, 16, (byte)0x23));
}
@Override
public void onPlaced(EntityLivingBase entity, ItemStack item) {
tanks.setFluid(0, item.hasTagCompound() ? FluidStack.<API key>(item.getTagCompound().getCompoundTag(<API key>.FLUID_NBT_KEY)) : null);
}
@Override
public ArrayList<ItemStack> dropItem(IBlockState state, int fortune)
{
ItemStack item = new ItemStack(this.getBlockType());
if (tanks.getAmount(0) > 0) {
item.setTagCompound(new NBTTagCompound());
NBTTagCompound nbt = new NBTTagCompound();
tanks.fluids[0].writeToNBT(nbt);
item.getTagCompound().setTag(<API key>.FLUID_NBT_KEY, nbt);
}
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
list.add(item);
return list;
}
} |
.PHONY: ci cs-dry-run cs-fix help install test update
default: help
help:
@echo "usage: make COMMAND"
@echo ""
@echo "Available commands:"
@echo " ci to run both tests suite and check style"
@echo " cs-dry-run to show files that need to be fixed"
@echo " cs-fix to fix files that need to be fixed"
@echo " help to display this help"
@echo " install to install the project dependencies"
@echo " test to run the tests suite"
@echo " update to update the project dependencies"
ci: test cs-dry-run
cs-dry-run:
@if [ ! -f vendor/bin/php-cs-fixer ]; then make install; fi
vendor/bin/php-cs-fixer fix --dry-run --diff --verbose
cs-fix:
@if [ ! -f vendor/bin/php-cs-fixer ]; then make install; fi
vendor/bin/php-cs-fixer fix --verbose
install:
composer install
test:
@if [ ! -f vendor/bin/phpunit ]; then make install; fi
vendor/bin/phpunit
update:
composer update |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><API key> — AWS CLI 1.0.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/bootstrap.min.css" />
<script type="text/javascript" src="../../_static/jquery-1.9.1.min.js.html"></script>
<link rel="stylesheet" href="../../_static/guzzle.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<script type="text/javascript"><![CDATA[
var <API key> = {
URL_ROOT: '../../',
VERSION: '1.0.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
]]></script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="AWS CLI 1.0.0 documentation" href="../../index.html" />
<link rel="up" title="ec2" href="index.html" />
<link rel="next" title="<API key>" href="<API key>.html" />
<link rel="prev" title="describe-snapshots" href="describe-snapshots.html" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="../../_static/<API key>.min.css" />
</head>
<body>
<div class="navbar navbar-fixed-top ">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="../../index.html">AWS CLI</a>
<ul class="nav">
<li><a href="../../index.html">Home</a></li>
<li><a href="http://aws.amazon.com/documentation/cli/">Documentation</a></li>
<li><a href="https://forums.aws.amazon.com/forum.jspa?forumID=150">Forum</a></li>
<li><a href="https://github.com/aws/aws-cli">GitHub</a></li>
</ul>
<div class="pull-right" id="github-stars">
<iframe src="http://ghbtns.com/github-btn.html?user=aws&repo=aws-cli&type=watch&count=true&size=small" allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
</div>
</div>
</div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index" accesskey="I">index</a></li>
<li class="right">
<a href="<API key>.html" title="<API key>" accesskey="N">next</a> |</li>
<li class="right">
<a href="describe-snapshots.html" title="describe-snapshots" accesskey="P">previous</a> |</li>
<li><a href="../../index.html">AWS CLI 1.0.0 documentation</a> »</li>
<li><a href="../index.html">aws</a> »</li>
<li><a href="index.html" accesskey="U">ec2</a> »</li>
</ul>
</div>
<div class="container">
<div class="top-links">
<ul class="breadcrumb pull-right">
<li>
<a href="describe-snapshots.html" title="previous chapter (use the left arrow)">← describe-snapshots</a>
<span class="divider">/</span>
</li>
<li><a href="<API key>.html" title="next chapter (use the right arrow)"><API key> →</a></li>
</ul>
</div>
<div class="document clearer">
<div class="sphinxsidebar">
<div class="<API key>"><p class="logo left-bar-other">
<a href="../../index.html">
<img class="logo" src="../../_static/logo.png" alt="Logo" height="63" />
</a>
</p>
<h3><a href="../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#"><API key></a><ul>
<li><a class="reference internal" href="#description">Description</a></li>
<li><a class="reference internal" href="#synopsis">Synopsis</a></li>
<li><a class="reference internal" href="#options">Options</a></li>
</ul>
</li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="form-search margin-top-1em" action="../../search.html" method="get">
<input type="text" name="q" style="width: 105px" class="input-small search-query" />
<button type="submit" class="btn btn-small">Search</button>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript"><![CDATA[$('#searchbox').show(0);]]></script><div class="left-bar-other">
<h3>Feedback</h3>
<p class="feedback">Did you find this page useful? Do you have a suggestion? <a href="https://portal.aws.amazon.com/gp/aws/<API key>/documentation/aws_doc_feedback_02?service_name=AWSCLI&guide_name=Guide&api_version=1.0&file_name=reference/ec2/<API key>">Give us feedback</a> or
send us a <a href="https://github.com/aws/aws-cli">pull request</a> on GitHub.</p>
</div>
</div>
</div>
<div class="body">
<p>[ <a class="reference internal" href="../index.html"><em>aws</em></a> . <a class="reference internal" href="index.html"><em>ec2</em></a> ]</p>
<div class="section" id="<API key>">
<h1><API key><a class="headerlink" href="#<API key>" title="Permalink to this headline">¶</a></h1>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Describes the data feed for Spot Instances.</p>
<p>For conceptual information about Spot Instances, refer to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide .</p>
</div>
<div class="section" id="synopsis">
<h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><pre> <API key>
[--dry-run | --no-dry-run]</pre>
</div>
</div>
<div class="section" id="options">
<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
<p><tt class="docutils literal"><a name="//apple_ref/cpp/Option/--dry-run" class="dashAnchor" id="dry-run"></a><span class="pre">--dry-run</span></tt> | <tt class="docutils literal"><a name="//apple_ref/cpp/Option/--no-dry-run" class="dashAnchor" id="no-dry-run"></a><span class="pre">--no-dry-run</span></tt> (boolean)</p>
<p>Checks whether you have the required permissions for the action, without actually making the request. Using this option will result in one of two possible errorresponses. If you have the required permissions, the error response will be <tt class="docutils literal"><span class="pre">DryRunOperation</span></tt> . Otherwise it will be <tt class="docutils literal"><span class="pre"><API key></span></tt> .</p>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="footer-links">
<ul class="breadcrumb pull-right">
<li>
<a href="describe-snapshots.html" title="previous chapter (use the left arrow)">← describe-snapshots</a>
<span class="divider">/</span>
</li>
<li><a href="<API key>.html" title="next chapter (use the right arrow)"><API key> →</a></li>
</ul>
</div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index">index</a></li>
<li class="right">
<a href="<API key>.html" title="<API key>">next</a> |</li>
<li class="right">
<a href="describe-snapshots.html" title="describe-snapshots">previous</a> |</li>
<li><a href="../../index.html">AWS CLI 1.0.0 documentation</a> »</li>
<li><a href="../index.html">aws</a> »</li>
<li><a href="index.html">ec2</a> »</li>
</ul>
</div>
<div class="footer container">
&
</div>
<script type="text/javascript"><![CDATA[
$(document).keydown(function(e){
if (e.keyCode == 37) {
window.location = 'describe-snapshots.html';
return false;
} else if (e.keyCode == 39) {
window.location = '<API key>.html';
return false;
}
});
]]></script>
</body>
</html> |
<?php
declare(strict_types=1);
namespace Zelenin\HttpClient\Middleware\Cookie;
use Dflydev\FigCookies\SetCookie;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
use Zelenin\HttpClient\MiddlewareInterface;
use Zelenin\HttpClient\<API key>;
final class CookieRequest implements MiddlewareInterface
{
/**
* @var Storage
*/
private $storage;
/**
* @param Storage $storage
*/
public function __construct(Storage $storage)
{
$this->storage = $storage;
}
/**
* @inheritdoc
*/
public function process(RequestInterface $request, <API key> $handler): ResponseInterface
{
if (!$request->hasHeader('Cookie')) {
$cookies = [];
$setCookies = $this->storage->getAll();
foreach ($setCookies as $setCookie) {
if ($this->validForUri($setCookie, $request->getUri())) {
$cookies[] = sprintf('%s=%s', $setCookie->getName(), $setCookie->getValue());
}
}
if ($cookies) {
$request = $request->withHeader('Cookie', implode('; ', $cookies));
}
}
return $handler->handle($request);
}
/**
* @param string $cookieDomain
* @param string $requestDomain
*
* @return bool
*/
public function matchesDomain(string $cookieDomain, string $requestDomain): bool
{
$cookieDomain = ltrim($cookieDomain, '.');
if (!$cookieDomain || !strcasecmp($requestDomain, $cookieDomain)) {
return true;
}
if (filter_var($requestDomain, FILTER_VALIDATE_IP)) {
return false;
}
return (bool)preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $requestDomain);
}
/**
* @param SetCookie $setCookie
* @param UriInterface $uri
*
* @return bool
*/
private function validForUri(SetCookie $setCookie, UriInterface $uri): bool
{
$requestPath = $uri->getPath() ?: '/';
if ($setCookie->getSecure() && $uri->getScheme() !== 'https') {
return false;
}
if ($setCookie->getExpires() && time() > $setCookie->getExpires()) {
return false;
}
if (!$this->matchesPath($setCookie->getPath(), $requestPath)) {
return false;
}
if (!$this->matchesDomain($setCookie->getDomain(), $uri->getHost())) {
return false;
}
return true;
}
/**
* @param string $cookiePath
* @param string $requestPath
*
* @return bool
*/
private function matchesPath(string $cookiePath, string $requestPath): bool
{
if ($cookiePath === '/' || $cookiePath == $requestPath) {
return true;
}
if (0 !== strpos($requestPath, $cookiePath)) {
return false;
}
if (substr($cookiePath, -1, 1) === '/') {
return true;
}
return substr($requestPath, strlen($cookiePath), 1) === '/';
}
} |
#pragma once
#include <core/core.h>
#include <tuple>
NS_BEGIN(CORE_NAMESPACE)
template<size_t Idx, typename TTuple, typename TDefault=void,
bool use_default = Idx >= std::tuple_size<TTuple>::value >
struct <API key>{
typedef TDefault type;
};
template<size_t Idx, typename TTuple, typename TDefault>
struct <API key><Idx,TTuple,TDefault,false>{
typedef typename std::tuple_element<Idx,TTuple>::type type;
};
NS_END(CORE_NAMESPACE) |
<html><body>
<h4>Windows 10 x64 (19042.572) 20H2</h4><br>
<h2><API key></h2>
<font face="arial"> +0x000 queueBackground : Int4B<br>
+0x004 countImmediate : Uint4B<br>
+0x008 kindImmediate : <a href="./<API key>.html"><API key></a><br>
+0x00c payloadId : Uint4B<br>
+0x010 ignoredUse : Int4B<br>
+0x014 <API key> : Int4B<br>
</font></body></html> |
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Symbols
{
internal delegate void <API key><TArg>(DiagnosticBag bag, MethodSymbol overriddenMethod, MethodSymbol overridingMethod, bool topLevel, TArg arg);
internal delegate void <API key><TArg>(DiagnosticBag bag, MethodSymbol overriddenMethod, MethodSymbol overridingMethod, ParameterSymbol parameter, bool topLevel, TArg arg);
internal partial class <API key>
{
<summary>
In some circumstances (e.g. implicit implementation of an interface method by a non-virtual method in a
base type from another assembly) it is necessary for the compiler to generate explicit implementations for
some interface methods. They don't go in the symbol table, but if we are emitting, then we should
generate code for them.
</summary>
internal ImmutableArray<<API key>> <API key>(
Cancellation<API key>)
{
if (<API key>.IsDefault)
{
var diagnostics = DiagnosticBag.GetInstance();
try
{
cancellationToken.<API key>();
<API key>(diagnostics, cancellationToken);
cancellationToken.<API key>();
<API key>(diagnostics);
cancellationToken.<API key>();
<API key>(diagnostics);
if (this.IsInterface)
{
cancellationToken.<API key>();
this.<API key>(diagnostics);
}
if (<API key>.<API key>(
ref <API key>,
<API key>(diagnostics, cancellationToken),
default(ImmutableArray<<API key>>)).IsDefault)
{
// Do not cancel from this point on. We've assigned the member, so we must add
// the diagnostics.
<API key>(diagnostics);
state.NotePartComplete(CompletionPart.<API key>);
}
}
finally
{
diagnostics.Free();
}
}
return <API key>;
}
private void <API key>(DiagnosticBag diagnostics)
{
NamedTypeSymbol baseType = this.<API key>;
if (this.IsAbstract || (object)baseType == null || !baseType.IsAbstract)
{
return;
}
// CONSIDER: We know that no-one will ask for <API key> again
// (since this class is concrete), so we could just call the construction method
// directly to avoid storing the result.
foreach (var abstractMember in this.AbstractMembers)
{
// Dev10 reports failure to implement properties/events in terms of the accessors
if (abstractMember.Kind == SymbolKind.Method)
{
diagnostics.Add(ErrorCode.<API key>, this.Locations[0], this, abstractMember);
}
}
}
private ImmutableArray<<API key>> <API key>(
DiagnosticBag diagnostics,
Cancellation<API key>)
{
var <API key> = ArrayBuilder<<API key>>.GetInstance();
// NOTE: We can't iterator over this collection directly, since it is not ordered. Instead we
// iterate over AllInterfaces and filter out the interfaces that are not in this set. This is
// preferable to doing the DFS ourselves because both AllInterfaces and
// <API key> are cached and used in multiple places.
MultiDictionary<NamedTypeSymbol, NamedTypeSymbol> <API key> = this.<API key>;
foreach (var @interface in this.<API key>)
{
cancellationToken.<API key>();
if (!<API key>[@interface].Contains(@interface))
{
continue;
}
<API key>? <API key> = null;
foreach (var interfaceMember in @interface.GetMembersUnordered())
{
cancellationToken.<API key>();
// Only require implementations for members that can be implemented in C
SymbolKind interfaceMemberKind = interfaceMember.Kind;
switch (interfaceMemberKind)
{
case SymbolKind.Method:
case SymbolKind.Property:
case SymbolKind.Event:
if (!interfaceMember.<API key>())
{
continue;
}
break;
default:
continue;
}
<API key> <API key>;
if (this.IsInterface)
{
MultiDictionary<Symbol, Symbol>.ValueSet explicitImpl = this.<API key>(interfaceMember);
switch (explicitImpl.Count)
{
case 0:
continue; // There is no requirement to implement anything in an interface
case 1:
<API key> = new <API key>(explicitImpl.Single(), ImmutableArray<Diagnostic>.Empty);
break;
default:
Diagnostic diag = new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.<API key>, interfaceMember), this.Locations[0]);
<API key> = new <API key>(null, ImmutableArray.Create(diag));
break;
}
}
else
{
<API key> = this.<API key>(interfaceMember);
}
var implementingMember = <API key>.Symbol;
var <API key> = this.<API key>(<API key>, interfaceMember);
bool <API key> = (object)implementingMember != null;
if ((object)<API key> != null)
{
if (<API key>.IsVararg)
{
diagnostics.Add(
ErrorCode.<API key>,
<API key>(interfaceMember, this, implementingMember), implementingMember, interfaceMember, this);
}
else
{
<API key>.Add(<API key>);
}
}
if (<API key> && interfaceMemberKind == SymbolKind.Event)
{
// NOTE: unlike dev11, we're including a related location for the implementing type, because
// otherwise the only error location will be in the containing type of the implementing event
// (i.e. no indication of which type's interface list is actually problematic).
EventSymbol interfaceEvent = (EventSymbol)interfaceMember;
EventSymbol implementingEvent = (EventSymbol)implementingMember;
EventSymbol maybeWinRTEvent;
EventSymbol maybeRegularEvent;
if (interfaceEvent.<API key>)
{
maybeWinRTEvent = interfaceEvent; // Definitely WinRT.
maybeRegularEvent = implementingEvent; // Maybe regular.
}
else
{
maybeWinRTEvent = implementingEvent; // Maybe WinRT.
maybeRegularEvent = interfaceEvent; // Definitely regular.
}
if (interfaceEvent.<API key> != implementingEvent.<API key>)
{
// At this point (and not before), we know that maybeWinRTEvent is definitely a WinRT event and maybeRegularEvent is definitely a regular event.
var args = new object[] { implementingEvent, interfaceEvent, maybeWinRTEvent, maybeRegularEvent };
var info = new CSDiagnosticInfo(ErrorCode.<API key>, args, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<Location>(this.Locations[0]));
diagnostics.Add(info, implementingEvent.Locations[0]);
}
}
// Dev10: If a whole property is missing, report the property. If the property is present, but an accessor
// is missing, report just the accessor.
var <API key> = interfaceMemberKind == SymbolKind.Method ? ((MethodSymbol)interfaceMember).AssociatedSymbol : null;
if ((object)<API key> == null ||
<API key>(<API key>) ||
(<API key> && !implementingMember.IsAccessor()))
{
//we're here because
//(a) the interface member is not an accessor, or
//(b) the interface member is an accessor of an interesting (see <API key>) property or event, or
bool reportedAnError = false;
if (<API key>.Diagnostics.Any())
{
diagnostics.AddRange(<API key>.Diagnostics);
reportedAnError = <API key>.Diagnostics.Any(d => d.Severity == DiagnosticSeverity.Error);
}
if (!reportedAnError)
{
if (!<API key> ||
(!implementingMember.ContainingType.Equals(this, TypeCompareKind.ConsiderEverything) &&
implementingMember.<API key>().Contains(interfaceMember, <API key>.Instance)))
{
// NOTE: An alternative approach would be to keep track of this while searching for the implementing member.
// In some cases, we might even be able to stop looking and just accept that a base type has things covered
// (though we'd have to be careful about losing diagnostics and we might produce fewer bridge methods).
// However, this approach has the advantage that there is no cost unless we encounter a base type that
// claims to implement an interface, but we can't figure out how (i.e. free in nearly all cases).
<API key> = <API key> ?? <API key>(@interface);
<API key> matchResult = <API key>.GetValueOrDefault();
if (matchResult != <API key>.ExactMatch &&
<API key> && implementingMember.ContainingType.IsInterface)
{
<API key>(implementingMember.ContainingType, @interface, ref matchResult);
}
// If a base type from metadata declares that it implements the interface, we'll just trust it.
// (See fFoundImport in SymbolPreparer::<API key>.)
switch (matchResult)
{
case <API key>.NoMatch:
{
// CONSIDER: Dev10 does not emit this diagnostic for interface properties if the
// derived type attempts to implement an accessor directly as a method.
// Suppress for bogus properties and events and for indexed properties.
if (!interfaceMember.<API key>() && !interfaceMember.IsIndexedProperty())
{
DiagnosticInfo useSiteDiagnostic = interfaceMember.<API key>();
if (useSiteDiagnostic != null && useSiteDiagnostic.DefaultSeverity == DiagnosticSeverity.Error)
{
diagnostics.Add(useSiteDiagnostic, <API key>(@interface));
}
else
{
diagnostics.Add(ErrorCode.<API key>, <API key>(@interface), this, interfaceMember);
}
}
}
break;
case <API key>.ExactMatch:
break;
case <API key>.<API key>:
diagnostics.Add(ErrorCode.<API key>, <API key>(@interface), this, interfaceMember);
break;
default:
throw ExceptionUtilities.UnexpectedValue(matchResult);
}
}
if (<API key> && interfaceMemberKind == SymbolKind.Method)
{
// Don't report use site errors on properties - we'll report them on each of their accessors.
// Don't report use site errors for implementations in other types unless
// a synthesized implementation is needed that invokes the base method.
// We can do so only if there are no use-site errors.
if ((object)<API key> != null || TypeSymbol.Equals(implementingMember.ContainingType, this, TypeCompareKind.ConsiderEverything2))
{
DiagnosticInfo useSiteDiagnostic = interfaceMember.<API key>();
// CAVEAT: don't report <API key> since by-ref return types are
// specifically allowed for the purposes of interface implementation (for C++ interop).
// However, if there's a reference to the interface member in source, then we do want
// to produce a use site error.
if (useSiteDiagnostic != null && (ErrorCode)useSiteDiagnostic.Code != ErrorCode.<API key>)
{
// Don't report a use site error with a location in another compilation. For example,
// if the error is that a base type in another assembly implemented an interface member
// on our behalf and the use site error is that the current assembly does not reference
// some required assembly, then we want to report the error in the current assembly -
// not in the implementing assembly.
Location location = implementingMember.IsFromCompilation(this.<API key>)
? implementingMember.Locations[0]
: this.Locations[0];
Symbol.<API key>(useSiteDiagnostic, diagnostics, location);
}
}
}
}
}
}
}
return <API key>.ToImmutableAndFree();
}
protected abstract Location <API key>(NamedTypeSymbol @base);
#nullable enable
private Location <API key>(NamedTypeSymbol <API key>)
{
return <API key>(<API key>) ?? this.Locations[0];
}
internal Location? <API key>(NamedTypeSymbol <API key>)
#nullable restore
{
// We ideally want to identify the interface location in the base list with an exact match but
// will fall back and use the first derived interface if exact interface is not present.
// this is the similar logic as the VB implementation.
Debug.Assert(this.<API key>[<API key>].Contains(<API key>));
HashSet<DiagnosticInfo> unuseddiagnostics = null;
NamedTypeSymbol directInterface = null;
foreach (var iface in this.<API key>())
{
if (TypeSymbol.Equals(iface, <API key>, TypeCompareKind.ConsiderEverything2))
{
directInterface = iface;
break;
}
else if ((object)directInterface == null && iface.ImplementsInterface(<API key>, ref unuseddiagnostics))
{
directInterface = iface;
}
}
Debug.Assert((object)directInterface != null);
return <API key>(directInterface);
}
<summary>
It's not interesting to report diagnostics on implementation of interface accessors
if the corresponding events or properties are not implemented (i.e. we want to suppress
cascading diagnostics).
Caveat: Indexed property accessors are always interesting.
Caveat: It's also uninteresting if a WinRT event is implemented by a non-WinRT event,
or vice versa.
</summary>
private bool <API key>(Symbol <API key>)
{
Debug.Assert((object)<API key> != null);
// Accessors of indexed properties are always interesting.
if (<API key>.IsIndexedProperty())
{
return true;
}
Symbol <API key>;
if (this.IsInterface)
{
MultiDictionary<Symbol, Symbol>.ValueSet explicitImpl = this.<API key>(<API key>);
switch (explicitImpl.Count)
{
case 0:
return true;
case 1:
<API key> = explicitImpl.Single();
break;
default:
<API key> = null;
break;
}
}
else
{
<API key> = this.<API key>(<API key>);
}
// If the property or event wasn't implemented, then we'd prefer to report diagnostics about that.
if ((object)<API key> == null)
{
return false;
}
// If the property or event was an event and was implemented, but the WinRT-ness didn't agree,
// then we'd prefer to report diagnostics about that.
if (<API key>.Kind == SymbolKind.Event && <API key>.Kind == SymbolKind.Event &&
((EventSymbol)<API key>).<API key> != ((EventSymbol)<API key>).<API key>)
{
return false;
}
return true;
}
private enum <API key>
{
NoMatch,
<API key>,
ExactMatch,
}
private <API key> <API key>(NamedTypeSymbol @interface)
{
<API key> result = <API key>.NoMatch;
for (NamedTypeSymbol currType = this.<API key>; (object)currType != null; currType = currType.<API key>)
{
if (<API key>(currType, @interface, ref result))
{
break;
}
}
return result;
}
static private bool <API key>(NamedTypeSymbol currType, NamedTypeSymbol @interface, ref <API key> result)
{
MultiDictionary<NamedTypeSymbol, NamedTypeSymbol>.ValueSet set = currType.<API key>[@interface];
if (set.Count != 0)
{
if (set.Contains(@interface))
{
result = <API key>.ExactMatch;
return true;
}
else if (result == <API key>.NoMatch && set.Contains(@interface, Symbols.<API key>.IgnoringNullable))
{
result = <API key>.<API key>;
}
}
return false;
}
private void <API key>(NamedTypeSymbol baseInterface, NamedTypeSymbol @interface, ref <API key> matchResult)
{
// Let's check for the trivial case first
if (<API key>(baseInterface, @interface, ref matchResult))
{
return;
}
foreach (var interfaceType in this.<API key>)
{
if ((object)interfaceType == baseInterface)
{
continue;
}
if (interfaceType.Equals(baseInterface, TypeCompareKind.<API key>) &&
<API key>(interfaceType, @interface, ref matchResult))
{
return;
}
}
}
private void <API key>(
DiagnosticBag diagnostics,
Cancellation<API key>)
{
switch (this.TypeKind)
{
// These checks don't make sense for enums and delegates:
case TypeKind.Enum:
case TypeKind.Delegate:
return;
case TypeKind.Class:
case TypeKind.Struct:
case TypeKind.Interface:
case TypeKind.Submission: // we have to check that "override" is not used
break;
default:
throw ExceptionUtilities.UnexpectedValue(this.TypeKind);
}
foreach (var member in this.GetMembersUnordered())
{
cancellationToken.<API key>();
bool suppressAccessors;
switch (member.Kind)
{
case SymbolKind.Method:
var method = (MethodSymbol)member;
if (MethodSymbol.CanOverrideOrHide(method.MethodKind) && !method.IsAccessor())
{
if (member.IsOverride)
{
CheckOverrideMember(method, method.<API key>, diagnostics, out suppressAccessors);
}
else
{
var sourceMethod = method as <API key>;
if ((object)sourceMethod != null) // skip submission initializer
{
var isNew = sourceMethod.IsNew;
<API key>(method, isNew, method.<API key>, diagnostics, out suppressAccessors);
}
}
}
else if (method.MethodKind == MethodKind.Destructor)
{
// NOTE: Normal finalize methods CanOverrideOrHide and will go through the normal code path.
// First is fine, since there should only be one, since there are no parameters.
MethodSymbol overridden = method.<API key>(<API key>: true);
// NOTE: Dev11 doesn't expose symbols, so it can treat destructors as override and let them go through the normal
// checks. Roslyn can't, since the language says they are not virtual/override and that's what we need to expose
// in the symbol model. Having said that, Dev11 doesn't seem to produce override errors other than this one
// (see SymbolPreparer::prepareOperator).
if ((object)overridden != null && overridden.IsMetadataFinal)
{
diagnostics.Add(ErrorCode.<API key>, method.Locations[0], method, overridden);
}
}
break;
case SymbolKind.Property:
var property = (PropertySymbol)member;
var getMethod = property.GetMethod;
var setMethod = property.SetMethod;
// Handle the accessors here, instead of in the loop, so that we can ensure that
// they're checked *after* the corresponding property.
if (member.IsOverride)
{
CheckOverrideMember(property, property.<API key>, diagnostics, out suppressAccessors);
if (!suppressAccessors)
{
if ((object)getMethod != null)
{
CheckOverrideMember(getMethod, getMethod.<API key>, diagnostics, out suppressAccessors);
}
if ((object)setMethod != null)
{
CheckOverrideMember(setMethod, setMethod.<API key>, diagnostics, out suppressAccessors);
}
}
}
else if (property is <API key> sourceProperty)
{
var isNewProperty = sourceProperty.IsNew;
<API key>(property, isNewProperty, property.<API key>, diagnostics, out suppressAccessors);
if (!suppressAccessors)
{
if ((object)getMethod != null)
{
<API key>(getMethod, isNewProperty, getMethod.<API key>, diagnostics, out suppressAccessors);
}
if ((object)setMethod != null)
{
<API key>(setMethod, isNewProperty, setMethod.<API key>, diagnostics, out suppressAccessors);
}
}
}
break;
case SymbolKind.Event:
var @event = (EventSymbol)member;
var addMethod = @event.AddMethod;
var removeMethod = @event.RemoveMethod;
// Handle the accessors here, instead of in the loop, so that we can ensure that
// they're checked *after* the corresponding event.
if (member.IsOverride)
{
CheckOverrideMember(@event, @event.<API key>, diagnostics, out suppressAccessors);
if (!suppressAccessors)
{
if ((object)addMethod != null)
{
CheckOverrideMember(addMethod, addMethod.<API key>, diagnostics, out suppressAccessors);
}
if ((object)removeMethod != null)
{
CheckOverrideMember(removeMethod, removeMethod.<API key>, diagnostics, out suppressAccessors);
}
}
}
else
{
var isNewEvent = ((SourceEventSymbol)@event).IsNew;
<API key>(@event, isNewEvent, @event.<API key>, diagnostics, out suppressAccessors);
if (!suppressAccessors)
{
if ((object)addMethod != null)
{
<API key>(addMethod, isNewEvent, addMethod.<API key>, diagnostics, out suppressAccessors);
}
if ((object)removeMethod != null)
{
<API key>(removeMethod, isNewEvent, removeMethod.<API key>, diagnostics, out suppressAccessors);
}
}
}
break;
case SymbolKind.Field:
var sourceField = member as SourceFieldSymbol;
var isNewField = (object)sourceField != null && sourceField.IsNew;
// We don't want to report diagnostics for field-like event backing fields (redundant),
// but that shouldn't be an issue since they shouldn't be in the member list.
Debug.Assert((object)sourceField == null || (object)sourceField.AssociatedSymbol == null ||
sourceField.AssociatedSymbol.Kind != SymbolKind.Event);
CheckNewModifier(member, isNewField, diagnostics);
break;
case SymbolKind.NamedType:
CheckNewModifier(member, ((<API key>)member).IsNew, diagnostics);
break;
}
}
}
private void CheckNewModifier(Symbol symbol, bool isNew, DiagnosticBag diagnostics)
{
Debug.Assert(symbol.Kind == SymbolKind.Field || symbol.Kind == SymbolKind.NamedType);
// Do not give warnings about missing 'new' modifier for implicitly declared members,
// e.g. backing fields for auto-properties
if (symbol.<API key>)
{
return;
}
if (symbol.ContainingType.IsInterface)
{
<API key>(symbol, isNew,
<API key>.<API key>(symbol, <API key>: true),
diagnostics, out _);
return;
}
// for error cases
if ((object)this.<API key> == null)
{
return;
}
int symbolArity = symbol.GetMemberArity();
Location symbolLocation = symbol.Locations.FirstOrDefault();
bool unused = false;
NamedTypeSymbol currType = this.<API key>;
while ((object)currType != null)
{
foreach (var hiddenMember in currType.GetMembers(symbol.Name))
{
if (hiddenMember.Kind == SymbolKind.Method && !((MethodSymbol)hiddenMember).<API key>(symbol.Kind))
{
continue;
}
HashSet<DiagnosticInfo> useSiteDiagnostics = null;
bool isAccessible = AccessCheck.IsSymbolAccessible(hiddenMember, this, ref useSiteDiagnostics);
diagnostics.Add(symbolLocation, useSiteDiagnostics);
if (isAccessible && hiddenMember.GetMemberArity() == symbolArity)
{
if (!isNew)
{
diagnostics.Add(ErrorCode.WRN_NewRequired, symbolLocation, symbol, hiddenMember);
}
<API key>(symbol, symbolLocation, hiddenMember, diagnostics, ref unused);
return;
}
}
currType = currType.<API key>;
}
if (isNew)
{
diagnostics.Add(ErrorCode.WRN_NewNotRequired, symbolLocation, symbol);
}
}
private static void CheckOverrideMember(Symbol overridingMember, <API key> <API key>,
DiagnosticBag diagnostics, out bool suppressAccessors)
{
Debug.Assert((object)overridingMember != null);
Debug.Assert(<API key> != null);
suppressAccessors = false;
var <API key> = overridingMember.Kind == SymbolKind.Method;
var <API key> = overridingMember.Kind == SymbolKind.Property;
var <API key> = overridingMember.Kind == SymbolKind.Event;
Debug.Assert(<API key> ^ <API key> ^ <API key>);
var <API key> = overridingMember.Locations[0];
var overriddenMembers = <API key>.OverriddenMembers;
Debug.Assert(!overriddenMembers.IsDefault);
if (overriddenMembers.Length == 0)
{
var hiddenMembers = <API key>.HiddenMembers;
Debug.Assert(!hiddenMembers.IsDefault);
if (hiddenMembers.Any())
{
ErrorCode errorCode =
<API key> ? ErrorCode.<API key> :
<API key> ? ErrorCode.<API key> :
ErrorCode.<API key>;
diagnostics.Add(errorCode, <API key>, overridingMember, hiddenMembers[0]);
}
else
{
Symbol <API key> = null;
if (<API key>)
{
<API key> = ((MethodSymbol)overridingMember).AssociatedSymbol;
}
if ((object)<API key> == null)
{
bool suppressError = false;
if (<API key> || overridingMember.IsIndexer())
{
var parameterTypes = <API key>
? ((MethodSymbol)overridingMember).<API key>
: ((PropertySymbol)overridingMember).<API key>;
foreach (var parameterType in parameterTypes)
{
if (<API key>(parameterType.Type))
{
suppressError = true; // The parameter type must be fixed before the override can be found, so suppress error
break;
}
}
}
if (!suppressError)
{
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingMember);
}
}
else if (<API key>.Kind == SymbolKind.Property) //no specific errors for event accessors
{
PropertySymbol associatedProperty = (PropertySymbol)<API key>;
PropertySymbol overriddenProperty = associatedProperty.OverriddenProperty;
if ((object)overriddenProperty == null)
{
//skip remaining checks
}
else if (associatedProperty.GetMethod == overridingMember && (object)overriddenProperty.GetMethod == null)
{
diagnostics.Add(ErrorCode.ERR_NoGetToOverride, <API key>, overridingMember, overriddenProperty);
}
else if (associatedProperty.SetMethod == overridingMember && (object)overriddenProperty.SetMethod == null)
{
diagnostics.Add(ErrorCode.ERR_NoSetToOverride, <API key>, overridingMember, overriddenProperty);
}
else
{
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingMember);
}
}
}
}
else
{
NamedTypeSymbol overridingType = overridingMember.ContainingType;
if (overriddenMembers.Length > 1)
{
diagnostics.Add(ErrorCode.ERR_AmbigOverride, <API key>,
overriddenMembers[0].OriginalDefinition, overriddenMembers[1].OriginalDefinition, overridingType);
suppressAccessors = true;
}
else
{
<API key>(overridingMember, overriddenMembers[0], diagnostics, ref suppressAccessors);
}
}
// From: SymbolPreparer.cpp
// DevDiv Bugs 115384: Both out and ref parameters are implemented as references. In addition, out parameters are
// decorated with OutAttribute. In CLR when a signature is looked up in virtual dispatch, CLR does not distinguish
// between these to parameter types. The choice is the last method in the vtable. Therefore we check and warn if
// there would potentially be a mismatch in CLRs and C#s choice of the overridden method. Unfortunately we have no
// way of communicating to CLR which method is the overridden one. We only run into this problem when the
// parameters are generic.
var <API key> = <API key>.<API key>;
Debug.Assert(!<API key>.IsDefault);
if (<API key>.Length > 1 && overridingMember.Kind == SymbolKind.Method) // The runtime doesn't define overriding for properties or events.
{
// CONSIDER: Dev10 doesn't seem to report this warning for indexers.
var ambiguousMethod = <API key>[0];
diagnostics.Add(ErrorCode.<API key>, ambiguousMethod.Locations[0], ambiguousMethod, overridingMember);
suppressAccessors = true;
}
return;
static void <API key>(Symbol overridingMember, Symbol overriddenMember, DiagnosticBag diagnostics, ref bool suppressAccessors)
{
var <API key> = overridingMember.Locations[0];
var <API key> = overridingMember.Kind == SymbolKind.Method;
var <API key> = overridingMember.Kind == SymbolKind.Property;
var <API key> = overridingMember.Kind == SymbolKind.Event;
var overridingType = overridingMember.ContainingType;
//otherwise, it would have been excluded during lookup
HashSet<DiagnosticInfo> <API key> = null;
Debug.Assert(AccessCheck.IsSymbolAccessible(overriddenMember, overridingType, ref <API key>));
Debug.Assert(overriddenMember.Kind == overridingMember.Kind);
if (overriddenMember.<API key>())
{
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingMember, overriddenMember);
suppressAccessors = true;
}
else if (!overriddenMember.IsVirtual && !overriddenMember.IsAbstract && !overriddenMember.IsOverride &&
!(<API key> && ((MethodSymbol)overriddenMember).MethodKind == MethodKind.Destructor)) //destructors are metadata virtual
{
// CONSIDER: To match Dev10, skip the error for properties, and don't suppressAccessors
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingMember, overriddenMember);
suppressAccessors = true;
}
else if (overriddenMember.IsSealed)
{
// CONSIDER: To match Dev10, skip the error for properties, and don't suppressAccessors
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingMember, overriddenMember);
suppressAccessors = true;
}
else if (!<API key>(overriddenMember, overridingMember))
{
var accessibility = SyntaxFacts.GetText(overriddenMember.<API key>);
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingMember, accessibility, overriddenMember);
suppressAccessors = true;
}
else if (overridingMember.ContainsTupleNames() &&
<API key>.<API key>(overridingMember, overriddenMember))
{
// it is ok to override with no tuple names, for compatibility with C# 6, but otherwise names should match
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingMember, overriddenMember);
}
else
{
// As in dev11, we don't compare obsoleteness to the <API key> member,
// but to the least-overridden member.
var <API key> = overriddenMember.<API key>(overriddenMember.ContainingType);
overridingMember.<API key>();
<API key>.<API key>();
Debug.Assert(overridingMember.ObsoleteState != ThreeState.Unknown);
Debug.Assert(<API key>.ObsoleteState != ThreeState.Unknown);
bool <API key> = overridingMember.ObsoleteState == ThreeState.True;
bool <API key> = <API key>.ObsoleteState == ThreeState.True;
if (<API key> != <API key>)
{
ErrorCode code = <API key>
? ErrorCode.<API key>
: ErrorCode.<API key>;
diagnostics.Add(code, <API key>, overridingMember, <API key>);
}
if (<API key>)
{
<API key>((PropertySymbol)overridingMember, (PropertySymbol)overriddenMember, diagnostics, ref suppressAccessors);
}
else if (<API key>)
{
EventSymbol overridingEvent = (EventSymbol)overridingMember;
EventSymbol overriddenEvent = (EventSymbol)overriddenMember;
TypeWithAnnotations <API key> = overridingEvent.TypeWithAnnotations;
TypeWithAnnotations <API key> = overriddenEvent.TypeWithAnnotations;
// Ignore custom modifiers because this diagnostic is based on the C# semantics.
if (!<API key>.Equals(<API key>, TypeCompareKind.AllIgnoreOptions))
{
// if the type is or contains an error type, the type must be fixed before the override can be found, so suppress error
if (!<API key>(<API key>.Type))
{
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingMember, overriddenMember, <API key>.Type);
}
suppressAccessors = true; //we get really unhelpful errors from the accessor if the type is mismatched
}
else
{
<API key>(overridingEvent.<API key>, overriddenEvent, overridingEvent,
diagnostics,
(diagnostics, overriddenEvent, overridingEvent, location) => diagnostics.Add(ErrorCode.<API key>, location),
<API key>);
}
}
else
{
Debug.Assert(<API key>);
var overridingMethod = (MethodSymbol)overridingMember;
var overriddenMethod = (MethodSymbol)overriddenMember;
if (overridingMethod.IsGenericMethod)
{
overriddenMethod = overriddenMethod.Construct(overridingMethod.<API key>);
}
// Check for mismatched byref returns and return type. Ignore custom modifiers, because this diagnostic is based on the C# semantics.
if (overridingMethod.RefKind != overriddenMethod.RefKind)
{
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingMember, overriddenMember);
}
else if (!overridingMethod.<API key>.Equals(overriddenMethod.<API key>, TypeCompareKind.AllIgnoreOptions))
{
// if the Return type is or contains an error type, the return type must be fixed before the override can be found, so suppress error
if (!<API key>(overridingMethod.ReturnType))
{
// error CS0508: return type must be 'C<V>' to match overridden member 'M<T>()'
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingMember, overriddenMember, overriddenMethod.ReturnType);
}
}
else if (overriddenMethod.IsRuntimeFinalizer())
{
diagnostics.Add(ErrorCode.<API key>, <API key>);
}
else if (!overridingMethod.IsAccessor())
{
// Accessors will have already been checked above
<API key>(
<API key>,
overriddenMethod,
overridingMethod,
diagnostics,
checkReturnType: true,
checkParameters: true);
}
}
// NOTE: this error may be redundant (if an error has already been reported
// for the return type or parameter type in question), but the scenario is
// too rare to justify complicated checks.
DiagnosticInfo useSiteDiagnostic = overriddenMember.<API key>();
if (useSiteDiagnostic != null)
{
suppressAccessors = <API key>(useSiteDiagnostic, diagnostics, overridingMember.Locations[0]);
}
}
static void <API key>(PropertySymbol overridingProperty, PropertySymbol overriddenProperty, DiagnosticBag diagnostics, ref bool suppressAccessors)
{
var <API key> = overridingProperty.Locations[0];
var overridingType = overridingProperty.ContainingType;
TypeWithAnnotations <API key> = overridingProperty.TypeWithAnnotations;
TypeWithAnnotations <API key> = overriddenProperty.TypeWithAnnotations;
// Check for mismatched byref returns and return type. Ignore custom modifiers, because this diagnostic is based on the C# semantics.
if (overridingProperty.RefKind != overriddenProperty.RefKind)
{
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingProperty, overriddenProperty);
suppressAccessors = true; //we get really unhelpful errors from the accessor if the ref kind is mismatched
}
else if (!<API key>.Equals(<API key>, TypeCompareKind.AllIgnoreOptions))
{
// if the type is or contains an error type, the type must be fixed before the override can be found, so suppress error
if (!<API key>(<API key>.Type))
{
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingProperty, overriddenProperty, <API key>.Type);
}
suppressAccessors = true; //we get really unhelpful errors from the accessor if the type is mismatched
}
else
{
if (overridingProperty.GetMethod is object)
{
MethodSymbol overriddenGetMethod = overriddenProperty.<API key>();
<API key>(
overridingProperty.GetMethod.Locations[0],
overriddenGetMethod,
overridingProperty.GetMethod,
diagnostics,
checkReturnType: true,
// Don't check parameters on the getter if there is a setter
// because they will be a subset of the setter
checkParameters: overridingProperty.SetMethod is null ||
overriddenGetMethod?.AssociatedSymbol != overriddenProperty ||
overriddenProperty.<API key>()?.AssociatedSymbol != overriddenProperty);
}
if (overridingProperty.SetMethod is object)
{
var <API key> = overriddenProperty.<API key>();
<API key>(
overridingProperty.SetMethod.Locations[0],
<API key>,
overridingProperty.SetMethod,
diagnostics,
checkReturnType: false,
checkParameters: true);
if (<API key> is object &&
overridingProperty.SetMethod.IsInitOnly != <API key>.IsInitOnly)
{
diagnostics.Add(ErrorCode.<API key>, <API key>, overridingProperty, overriddenProperty);
}
}
}
// If the overriding property is sealed, then the overridden accessors cannot be inaccessible, since we
// have to override them to make them sealed in metadata.
// CONSIDER: It might be nice if this had its own error code(s) since it's an implementation restriction,
// rather than a language restriction as above.
if (overridingProperty.IsSealed)
{
MethodSymbol <API key> = overridingProperty.<API key>();
HashSet<DiagnosticInfo> useSiteDiagnostics = null;
if (overridingProperty.GetMethod != <API key> && !AccessCheck.IsSymbolAccessible(<API key>, overridingType, ref useSiteDiagnostics))
{
diagnostics.Add(ErrorCode.ERR_NoGetToOverride, <API key>, overridingProperty, overriddenProperty);
}
MethodSymbol <API key> = overridingProperty.<API key>();
if (overridingProperty.SetMethod != <API key> && !AccessCheck.IsSymbolAccessible(<API key>, overridingType, ref useSiteDiagnostics))
{
diagnostics.Add(ErrorCode.ERR_NoSetToOverride, <API key>, overridingProperty, overriddenProperty);
}
diagnostics.Add(<API key>, useSiteDiagnostics);
}
}
}
static void <API key>(
Location <API key>,
MethodSymbol overriddenMethod,
MethodSymbol overridingMethod,
DiagnosticBag diagnostics,
bool checkReturnType,
bool checkParameters)
{
<API key>(overridingMethod.<API key>, overriddenMethod, overridingMethod, diagnostics,
checkReturnType ? ReportBadReturn : null,
checkParameters ? ReportBadParameter : null,
<API key>);
}
}
internal static bool <API key>(TypeSymbol typeSymbol)
{
return (object)typeSymbol.VisitType((currentTypeSymbol, unused1, unused2) => currentTypeSymbol.IsErrorType(), (object)null) != null;
}
static readonly <API key><Location> ReportBadReturn =
(DiagnosticBag diagnostics, MethodSymbol overriddenMethod, MethodSymbol overridingMethod, bool topLevel, Location location)
=> diagnostics.Add(topLevel ?
ErrorCode.<API key> :
ErrorCode.<API key>,
location);
static readonly <API key><Location> ReportBadParameter =
(DiagnosticBag diagnostics, MethodSymbol overriddenMethod, MethodSymbol overridingMethod, ParameterSymbol overridingParameter, bool topLevel, Location location)
=> diagnostics.Add(
topLevel ? ErrorCode.<API key> : ErrorCode.<API key>,
location,
new FormattedSymbol(overridingParameter, SymbolDisplayFormat.ShortFormat));
internal static void <API key><TArg>(
CSharpCompilation compilation,
MethodSymbol overriddenMethod,
MethodSymbol overridingMethod,
DiagnosticBag diagnostics,
<API key><TArg> <API key>,
<API key><TArg> <API key>,
TArg extraArgument)
{
if (!<API key>(compilation, overriddenMethod, overridingMethod))
{
return;
}
if ((overriddenMethod.<API key> & <API key>.DoesNotReturn) == <API key>.DoesNotReturn &&
(overridingMethod.<API key> & <API key>.DoesNotReturn) != <API key>.DoesNotReturn)
{
diagnostics.Add(ErrorCode.<API key>, overridingMethod.Locations[0], new FormattedSymbol(overridingMethod, SymbolDisplayFormat.<API key>));
}
var conversions = compilation.Conversions.WithNullability(true);
if (<API key> != null)
{
// check nested nullability
if (!<API key>(
conversions,
overridingMethod.RefKind,
overridingMethod.<API key>.Type,
overriddenMethod.<API key>.Type))
{
<API key>(diagnostics, overriddenMethod, overridingMethod, false, extraArgument);
return;
}
// check top-level nullability including flow analysis annotations
if (!NullableWalker.<API key>(
overridingMethod.RefKind == RefKind.Ref ? RefKind.Ref : RefKind.Out,
overriddenMethod.<API key>,
overriddenMethod.<API key>,
overridingMethod.<API key>,
overridingMethod.<API key>))
{
<API key>(diagnostics, overriddenMethod, overridingMethod, true, extraArgument);
return;
}
}
if (<API key> == null)
{
return;
}
ImmutableArray<ParameterSymbol> <API key> = overridingMethod.GetParameters();
var <API key> = overriddenMethod.GetParameters();
for (int i = 0; i < overriddenMethod.ParameterCount; i++)
{
var overriddenParameter = <API key>[i];
var <API key> = overriddenParameter.TypeWithAnnotations;
var overridingParameter = <API key>[i];
var <API key> = overridingParameter.TypeWithAnnotations;
// check nested nullability
if (!<API key>(
conversions,
overridingParameter.RefKind,
<API key>.Type,
<API key>.Type))
{
<API key>(diagnostics, overriddenMethod, overridingMethod, overridingParameter, false, extraArgument);
}
// check top-level nullability including flow analysis annotations
else if (!NullableWalker.<API key>(
overridingParameter.RefKind,
<API key>,
overriddenParameter.<API key>,
<API key>,
overridingParameter.<API key>))
{
<API key>(diagnostics, overriddenMethod, overridingMethod, overridingParameter, true, extraArgument);
}
}
static bool <API key>(
ConversionsBase conversions,
RefKind refKind,
TypeSymbol sourceType,
TypeSymbol targetType)
{
switch (refKind)
{
case RefKind.Ref:
// ref variables are invariant
return sourceType.Equals(
targetType,
TypeCompareKind.AllIgnoreOptions & ~(TypeCompareKind.<API key>));
case RefKind.Out:
// out variables have inverted variance
(sourceType, targetType) = (targetType, sourceType);
break;
default:
break;
}
Debug.Assert(conversions.IncludeNullability);
HashSet<DiagnosticInfo> <API key> = null;
return conversions.<API key>(sourceType, targetType, ref <API key>).Kind != ConversionKind.NoConversion;
}
}
private static bool <API key>(
CSharpCompilation compilation,
Symbol overriddenMember,
Symbol overridingMember)
{
// Don't do any validation if the nullable feature is not enabled or
// the override is not written directly in source
return overriddenMember is object &&
overridingMember is object &&
compilation is object &&
compilation.IsFeatureEnabled(MessageID.<API key>);
}
internal static void <API key><TArg>(
CSharpCompilation compilation,
EventSymbol overriddenEvent,
EventSymbol overridingEvent,
DiagnosticBag diagnostics,
Action<DiagnosticBag, EventSymbol, EventSymbol, TArg> reportMismatch,
TArg extraArgument)
{
if (!<API key>(compilation, overriddenEvent, overridingEvent))
{
return;
}
var conversions = compilation.Conversions.WithNullability(true);
if (!conversions.<API key>(overriddenEvent.TypeWithAnnotations, overridingEvent.TypeWithAnnotations))
{
reportMismatch(diagnostics, overriddenEvent, overridingEvent, extraArgument);
}
}
private static void <API key>(
Symbol hidingMember,
bool hidingMemberIsNew,
<API key> <API key>,
DiagnosticBag diagnostics, out bool suppressAccessors)
{
suppressAccessors = false;
var <API key> = hidingMember.Locations[0];
Debug.Assert(<API key> != null);
Debug.Assert(!<API key>.OverriddenMembers.Any()); //since hidingMethod.IsOverride is false
Debug.Assert(!<API key>.<API key>.Any()); //since hidingMethod.IsOverride is false
var hiddenMembers = <API key>.HiddenMembers;
Debug.Assert(!hiddenMembers.IsDefault);
if (hiddenMembers.Length == 0)
{
if (hidingMemberIsNew && !hidingMember.IsAccessor())
{
diagnostics.Add(ErrorCode.WRN_NewNotRequired, <API key>, hidingMember);
}
}
else
{
var diagnosticAdded = false;
//for interfaces, we always report WRN_NewRequired
//if we went into the loop, the pseudo-abstract nature of interfaces would throw off the other checks
if (!hidingMember.ContainingType.IsInterface)
{
foreach (var hiddenMember in hiddenMembers)
{
diagnosticAdded |= <API key>(hidingMember, <API key>, hiddenMember, diagnostics, ref suppressAccessors);
//can actually get both, so don't use else if
if (!hidingMemberIsNew && hiddenMember.Kind == hidingMember.Kind &&
!hidingMember.IsAccessor() &&
(hiddenMember.IsAbstract || hiddenMember.IsVirtual || hiddenMember.IsOverride) &&
!(hidingMember is <API key>))
{
diagnostics.Add(ErrorCode.<API key>, <API key>, hidingMember, hiddenMember);
diagnosticAdded = true;
}
if (diagnosticAdded)
{
break;
}
}
}
if (!hidingMemberIsNew && !(hidingMember is <API key>) && !diagnosticAdded && !hidingMember.IsAccessor() && !hidingMember.IsOperator())
{
diagnostics.Add(ErrorCode.WRN_NewRequired, <API key>, hidingMember, hiddenMembers[0]);
}
}
}
<summary>
If necessary, report a diagnostic for a hidden abstract member.
</summary>
<returns>True if a diagnostic was reported.</returns>
private static bool <API key>(Symbol hidingMember, Location <API key>, Symbol hiddenMember, DiagnosticBag diagnostics, ref bool suppressAccessors)
{
switch (hiddenMember.Kind)
{
case SymbolKind.Method:
case SymbolKind.Property:
case SymbolKind.Event:
break; // Can result in diagnostic
default:
return false; // Cannot result in diagnostic
}
// If the hidden member isn't abstract, the diagnostic doesn't apply.
// If the hiding member is in a non-abstract type, then suppress this cascading error.
if (!hiddenMember.IsAbstract || !hidingMember.ContainingType.IsAbstract)
{
return false;
}
switch (hidingMember.<API key>)
{
case Accessibility.Internal:
case Accessibility.Private:
case Accessibility.<API key>:
break;
case Accessibility.Public:
case Accessibility.ProtectedOrInternal:
case Accessibility.Protected:
{
// At this point we know we're going to report <API key>, we just have to
// figure out the substitutions.
switch (hidingMember.Kind)
{
case SymbolKind.Method:
var <API key> = ((MethodSymbol)hidingMember).AssociatedSymbol;
if ((object)<API key> != null)
{
//Dev10 reports that the property/event is doing the hiding, rather than the method
diagnostics.Add(ErrorCode.<API key>, <API key>.Locations[0], <API key>, hiddenMember);
break;
}
goto default;
case SymbolKind.Property:
case SymbolKind.Event:
// NOTE: We used to let the accessors take care of this case, but then we weren't handling the case
// where a hiding and hidden properties did not have any accessors in common.
// CONSIDER: Dev10 actually reports an error for each accessor of a hidden property/event, but that seems unnecessary.
suppressAccessors = true;
goto default;
default:
diagnostics.Add(ErrorCode.<API key>, <API key>, hidingMember, hiddenMember);
break;
}
return true;
}
default:
throw ExceptionUtilities.UnexpectedValue(hidingMember.<API key>);
}
return false;
}
private static bool <API key>(Symbol overridden, Symbol overriding)
{
// Check declared accessibility rather than effective accessibility since there's a different
// check (CS0560) that determines whether the containing types have compatible accessibility.
if (!overriding.ContainingAssembly.HasInternalAccessTo(overridden.ContainingAssembly) &&
overridden.<API key> == Accessibility.ProtectedOrInternal)
{
return overriding.<API key> == Accessibility.Protected;
}
else
{
return overridden.<API key> == overriding.<API key>;
}
}
#nullable enable
<summary>
It is invalid for a type to directly (vs through a base class) implement two interfaces that
unify (i.e. are the same for some substitution of type parameters).
</summary>
<remarks>
CONSIDER: check this while building up <API key> (only in the <API key> case).
</remarks>
private void <API key>(DiagnosticBag diagnostics)
{
if (!this.IsGenericType)
{
return;
}
// CONSIDER: filtering the list to only include generic types would save iterations.
int numInterfaces = this.<API key>.Count;
if (numInterfaces < 2)
{
return;
}
// NOTE: a typical approach to finding duplicates in less than quadratic time
// is to use a HashSet with an appropriate comparer. Unfortunately, this approach
// does not apply (at least, not straightforwardly), because CanUnifyWith is not
// transitive and, thus, is not an equivalence relation.
NamedTypeSymbol[] interfaces = this.<API key>.Keys.ToArray();
for (int i1 = 0; i1 < numInterfaces; i1++)
{
for (int i2 = i1 + 1; i2 < numInterfaces; i2++)
{
NamedTypeSymbol interface1 = interfaces[i1];
NamedTypeSymbol interface2 = interfaces[i2];
// CanUnifyWith is the real check - the others just short-circuit
if (interface1.IsGenericType && interface2.IsGenericType &&
TypeSymbol.Equals(interface1.OriginalDefinition, interface2.OriginalDefinition, TypeCompareKind.ConsiderEverything2) &&
interface1.CanUnifyWith(interface2))
{
if (<API key>(interface1).SourceSpan.Start > <API key>(interface2).SourceSpan.Start)
{
// Mention interfaces in order of their appearance in the base list, for consistency.
var temp = interface1;
interface1 = interface2;
interface2 = temp;
}
diagnostics.Add(ErrorCode.<API key>, this.Locations[0], this, interface1, interface2);
}
}
}
}
#nullable restore
<summary>
Though there is a method that C# considers to be an implementation of the interface method, that
method may not be considered an implementation by the CLR. In particular, implicit implementation
methods that are non-virtual or that have different (usually fewer) custom modifiers than the
interface method, will not be considered CLR overrides. To address this problem, we either make
them virtual (in metadata, not in C#), or we introduce an explicit interface implementation that
delegates to the implicit implementation.
</summary>
<param name="<API key>">Returned from <API key>.</param>
<param name="interfaceMember">The interface method or property that is being implemented.</param>
<returns>Synthesized implementation or null if not needed.</returns>
private <API key> <API key>(<API key> <API key>, Symbol interfaceMember)
{
if (interfaceMember.<API key> != Accessibility.Public)
{
// Non-public interface members cannot be implemented implicitly,
// appropriate errors are reported elsewhere. Let's not synthesize
// forwarding methods, or modify metadata virtualness of the
// implementing methods.
return null;
}
foreach (Diagnostic diagnostic in <API key>.Diagnostics)
{
if (diagnostic.Severity == DiagnosticSeverity.Error)
{
return null;
}
}
Symbol implementingMember = <API key>.Symbol;
//don't worry about properties or events - we'll catch them through their accessors
if ((object)implementingMember == null || implementingMember.Kind != SymbolKind.Method)
{
return null;
}
MethodSymbol interfaceMethod = (MethodSymbol)interfaceMember;
MethodSymbol implementingMethod = (MethodSymbol)implementingMember;
// Interface properties/events with non-public accessors cannot be implemented implicitly,
// appropriate errors are reported elsewhere. Let's not synthesize
// forwarding methods, or modify metadata virtualness of the
// implementing accessors, even for public ones.
if (interfaceMethod.AssociatedSymbol?.<API key>() == true)
{
return null;
}
//explicit implementations are always respected by the CLR
if (implementingMethod.<API key>.Contains(interfaceMethod, <API key>.Instance))
{
return null;
}
MethodSymbol <API key> = implementingMethod.OriginalDefinition;
bool <API key> = true;
// If the implementing method is from a source file in the same module and the
// override is correct from the runtime's perspective (esp the custom modifiers
// match), then we can just twiddle the metadata virtual bit. Otherwise, we need
// to create an explicit implementation that delegates to the real implementation.
if (<API key>.<API key>.Equals(implementingMethod, interfaceMethod) &&
<API key>(implementingMethod, @interfaceMethod.ContainingType))
{
if (ReferenceEquals(this.ContainingModule, <API key>.ContainingModule))
{
<API key> <API key> = <API key> as <API key>;
if ((object)<API key> != null)
{
<API key>.<API key>();
<API key> = false;
}
}
else if (implementingMethod.IsMetadataVirtual(<API key>: true))
{
// If the signatures match and the implementation method is definitely virtual, then we're set.
<API key> = false;
}
}
if (!<API key>)
{
return null;
}
return new <API key>(interfaceMethod, implementingMethod, this);
}
<summary>
The CLR will only look for an implementation of an interface method in a type that
1) declares that it implements that interface; or
2) is a base class of a type that declares that it implements the interface but not
a subtype of a class that declares that it implements the interface.
For example,
interface I
class A
class B : A, I
class C : B
class D : C, I
Suppose the runtime is looking for D's implementation of a member of I. It will look in
D because of (1), will not look in C, will look in B because of (1), and will look in A
because of (2).
The key point is that it does not look in C, which C# *does*.
</summary>
private static bool <API key>(MethodSymbol implementingMethod, NamedTypeSymbol @interface)
{
NamedTypeSymbol type = implementingMethod.ContainingType;
if (type.<API key>.ContainsKey(@interface))
{
return true;
}
NamedTypeSymbol baseType = type.<API key>;
return (object)baseType == null || !baseType.<API key>.Contains(@interface);
}
<summary>
If C# picks a different implementation than the CLR (see <API key>), then we might
still be okay, but dynamic dispatch might result in C#'s choice getting called anyway.
</summary>
<remarks>
This is based on SymbolPreparer::IsCLRMethodImplSame in the native compiler.
ACASEY: What the native compiler actually does is compute the C# answer, compute the CLR answer,
and then confirm that they override the same method. What I've done here is check for the situations
where the answers could disagree. I believe the results will be equivalent. If in doubt, a more conservative
check would be implementingMethod.ContainingType.<API key>.Contains(@interface).
</remarks>
private static bool <API key>(MethodSymbol implementingMethod, NamedTypeSymbol @interface)
{
MethodSymbol curr = implementingMethod;
while ((object)curr != null)
{
if (<API key>(curr, @interface))
{
return true;
}
curr = curr.OverriddenMethod;
}
return false;
}
internal sealed override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit()
{
return <API key>();
}
}
} |
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually
#pragma once
#include <common/common.h>
#include <_FILETIME.hpp>
START_ATF_NAMESPACE
struct <API key>
{
_FILETIME ftExpires;
_FILETIME ftLastModified;
};
END_ATF_NAMESPACE |
class LinkedList():
def __init__(self, value=None):
self.value = value
self.before = None
self.behind = None
def __str__(self):
if self.value is not None:
return str(self.value)
else:
return 'None'
def init():
return LinkedList('HEAD')
def delete(linked_list):
if isinstance(linked_list, LinkedList):
if linked_list.behind is not None:
delete(linked_list.behind)
linked_list.behind = None
linked_list.before = None
linked_list.value = None
def insert(linked_list, index, node):
node = LinkedList(node)
if isinstance(linked_list, LinkedList):
i = 0
while linked_list.behind is not None:
if i == index:
break
i += 1
linked_list = linked_list.behind
if linked_list.behind is not None:
node.behind = linked_list.behind
linked_list.behind.before = node
node.before, linked_list.behind = linked_list, node
def remove(linked_list, index):
if isinstance(linked_list, LinkedList):
i = 0
while linked_list.behind is not None:
if i == index:
break
i += 1
linked_list = linked_list.behind
if linked_list.behind is not None:
linked_list.behind,before = linked_list.before
if linked_list.before is not None:
linked_list.before.behind = linked_list.behind
linked_list.behind = None
linked_list.before = None
linked_list.value = None
def trave(linked_list):
if isinstance(linked_list, LinkedList):
print(linked_list)
if linked_list.behind is not None:
trave(linked_list.behind)
def find(linked_list, index):
if isinstance(linked_list, LinkedList):
i = 0
while linked_list.behind is not None:
if i == index:
return linked_list
i += 1
linked_list = linked_list.behind
else:
if i < index:
raise Exception(404)
return linked_list |
import ChromaPy32 as Chroma # Import the Chroma Module
from time import sleep
Keypad = Chroma.Keypad() # Initialize a new Keypad Instance
RED = (255, 0, 0) # Initialize a new color by RGB (RED,GREEN,BLUE)
Keypad.setbyRow(2, RED) # sets the whole third row of the Keyboad-Grid to red
Keypad.applyGrid() # applies the Keypad-Grid to the connected Keypad
sleep(5) |
package io.geobit.chain.entity.blockchain;
import io.geobit.common.entity.TransactionInOut;
import java.util.List;
public class BlockChainProcTrans {
private String hash; /* hash della transazione */
private Character type; /* D: deposit | W: withdraw | T: taken deposit*/
private String address; /* from address or destination address*/
private Long timestamp;
private Boolean spent; /* true means already spent */
private Long value; /* value>0:INCOMING value<0:OUTGOING */
private Integer index; /* index of output??? */
private String prevOutId;
private String prevOutAddress;
private String txIndex; /* indice di transazione*/
private Integer blockHeight;
private int n;
private List<String> toList;
private List<TransactionInOut> toOut;
public List<TransactionInOut> getToOut() {
return toOut;
}
public void setToOut(List<TransactionInOut> toOut) {
this.toOut = toOut;
}
public List<String> getToList() {
return toList;
}
public void setToList(List<String> toList) {
this.toList = toList;
}
public int getN() {
return n;
}
public void setN(int n) {
this.n = n;
}
public Integer getBlockHeight() {
return blockHeight;
}
public void setBlockHeight(Integer blockHeight) {
this.blockHeight = blockHeight;
}
public String getHash() {
return hash;
}
public void setHash(String hash) {
this.hash = hash;
}
public String getPrevOutAddress() {
return prevOutAddress;
}
public void setPrevOutAddress(String prevOutAddress) {
this.prevOutAddress = prevOutAddress;
}
public Character getType() {
return type;
}
public void setType(Character type) {
this.type = type;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Long getTimestamp() {
return timestamp;
}
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
public Boolean getSpent() {
return spent;
}
public void setSpent(Boolean spent) {
this.spent = spent;
}
public Long getValue() {
return value;
}
public void setValue(Long value) {
this.value = value;
}
public String getTxIndex() {
return txIndex;
}
public void setTxIndex(String txIndex) {
this.txIndex = txIndex;
}
public String getPrevOutId() {
return prevOutId;
}
public void setPrevOutId(String prevOutId) {
this.prevOutId = prevOutId;
}
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
@Override
public String toString() {
return "BlockChainProcTrans [hash=" + hash + ", type=" + type
+ ", address=" + address + ", timestamp=" + timestamp
+ ", spent=" + spent + ", value=" + value + ", index=" + index
+ ", prevOutId=" + prevOutId + ", prevOutAddress="
+ prevOutAddress + ", txIndex=" + txIndex + "]";
}
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>elpi: Not compatible </title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.15.0 / elpi - 1.8.2~8.12</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
elpi
<small>
1.8.2~8.12
<span class="label label-info">Not compatible </span>
</small>
</h1>
<p> <em><script>document.write(moment("2022-02-01 04:13:48 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-01 04:13:48 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.15.0 Formal proof management system
dune 2.9.3 Fast, portable, and opinionated build system
ocaml 4.12.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.12.1 Official release 4.12.1
ocaml-config 2 OCaml Switch Configuration
<API key> 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Enrico Tassi <enrico.tassi@inria.fr>"
authors: [ "Enrico Tassi" ]
license: "LGPL-2.1-or-later"
homepage: "https://github.com/LPCIC/coq-elpi"
bug-reports: "https://github.com/LPCIC/coq-elpi/issues"
dev-repo: "git+https://github.com/LPCIC/coq-elpi"
build: [ make "COQBIN=%{bin}%/" "ELPIDIR=%{prefix}%/lib/elpi" "OCAMLWARN=" ]
install: [ make "install" "COQBIN=%{bin}%/" "ELPIDIR=%{prefix}%/lib/elpi" ]
depends: [
"elpi" {>= "1.12.0" & < "1.13.0~"}
"coq" {>= "8.12" & < "8.13~" }
]
tags: [ "logpath:elpi" ]
synopsis: "Elpi extension language for Coq"
description: """
Coq-elpi provides a Coq plugin that embeds ELPI.
It also provides a way to embed Coq&
the Higher-Order Abstract Syntax approach
and a way to read terms back. In addition to that it exports to ELPI a
set of Coq's primitives, e.g. printing a message, accessing the
environment of theorems and data types, defining a new constant and so on.
For convenience it also provides a quotation and anti-quotation for Coq's
syntax in λProlog. E.g. `{{nat}}` is expanded to the type name of natural
numbers, or `{{A -> B}}` to the representation of a product by unfolding
the `->` notation. Finally it provides a way to define new vernacular commands
and
new tactics."""
url {
src: "https://github.com/LPCIC/coq-elpi/archive/v1.8.2_8.12.tar.gz"
checksum: "sha256=<SHA256-like>"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install </h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-elpi.1.8.2~8.12 coq.8.15.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.15.0).
The following dependencies couldn't be met:
- coq-elpi -> coq < 8.13~ -> ocaml < 4.12
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-elpi.1.8.2~8.12</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install </h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https:
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html> |
#ifndef _LOW_LEVEL_H_
#define _LOW_LEVEL_H_
#include "rtos.h"
void uart_configuration(void);
#endif |
package identity
import (
"fmt"
"io/ioutil"
"net/http"
)
type Legacy struct {
client *http.Client
}
func (l *Legacy) Auth(creds *Credentials) (*AuthDetails, error) {
if l.client == nil {
l.client = http.DefaultClient
}
request, err := http.NewRequest("GET", creds.URL, nil)
if err != nil {
return nil, err
}
request.Header.Set("X-Auth-User", creds.User)
request.Header.Set("X-Auth-Key", creds.Secrets)
response, err := l.client.Do(request)
defer response.Body.Close()
if err != nil {
return nil, err
}
if response.StatusCode != http.StatusNoContent {
content, _ := ioutil.ReadAll(response.Body)
return nil, fmt.Errorf("Failed to Authenticate (code %d %s): %s",
response.StatusCode, response.Status, content)
}
details := &AuthDetails{}
details.Token = response.Header.Get("X-Auth-Token")
if details.Token == "" {
return nil, fmt.Errorf("Did not get valid Token from auth request")
}
details.RegionServiceURLs = make(map[string]ServiceURLs)
serviceURLs := make(ServiceURLs)
// Legacy authentication doesn't require a region so use "".
details.RegionServiceURLs[""] = serviceURLs
nova_url := response.Header.Get("<API key>")
if nova_url == "" {
return nil, fmt.Errorf("Did not get valid nova management URL from auth request")
}
serviceURLs["compute"] = nova_url
swift_url := response.Header.Get("X-Storage-Url")
if swift_url == "" {
return nil, fmt.Errorf("Did not get valid swift management URL from auth request")
}
serviceURLs["object-store"] = swift_url
return details, nil
} |
<?php
namespace Acf\AdminBundle\Form\Docgroupperso;
use Acf\DataBundle\Entity\Company;
use Acf\DataBundle\Repository\CompanyRepository;
use Acf\DataBundle\Repository\<API key>;
use Sasedev\Form\EntityidBundle\Form\Type\EntityidType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\<API key>;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
*
* @author sasedev <seif.salah@gmail.com>
*/
class NewTForm extends AbstractType
{
/**
*
* @var Company
*/
private $company;
/**
* Form builder
*
* @param <API key> $builder
* @param array $options
*
* @return null
*/
public function buildForm(<API key> $builder, array $options)
{
$this->company = $options['company'];
if (null == $this->company) {
$builder->add('company', EntityType::class, array(
'label' => 'Docgroupperso.company.label',
'class' => 'AcfDataBundle:Company',
'query_builder' => function (CompanyRepository $br) {
return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
},
'choice_label' => 'corporateName',
'multiple' => false,
'by_reference' => true,
'required' => true
));
$builder->add('parent', EntityType::class, array(
'label' => 'Docgroupperso.parent.label',
'class' => 'AcfDataBundle:Docgroupperso',
'query_builder' => function (<API key> $dgr) {
return $dgr->createQueryBuilder('d')->orderBy('d.pageUrlFull', 'ASC');
},
'choice_label' => 'pageUrlFull',
'multiple' => false,
'by_reference' => true,
'required' => false,
'placeholder' => 'Options.choose',
'empty_data' => null
));
$builder->add('clone', EntityType::class, array(
'label' => 'Docgroup.clone.label',
'class' => 'AcfDataBundle:Docgroupperso',
'query_builder' => function (<API key> $dgr) {
return $dgr->createQueryBuilder('d')->orderBy('d.pageUrlFull', 'ASC');
},
'choice_label' => 'pageUrlFull',
'multiple' => false,
'by_reference' => true,
'required' => false,
'placeholder' => 'Options.choose',
'mapped' => false
));
} else {
$companyId = $this->company->getId();
$builder->add('company', EntityidType::class, array(
'label' => 'Docgroupperso.company.label',
'class' => 'AcfDataBundle:Company',
'query_builder' => function (CompanyRepository $br) use ($companyId) {
return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
},
'choice_label' => 'id',
'multiple' => false,
'by_reference' => true,
'required' => true
));
$builder->add('parent', EntityType::class, array(
'label' => 'Docgroupperso.parent.label',
'class' => 'AcfDataBundle:Docgroupperso',
'query_builder' => function (<API key> $dgr) use ($companyId) {
return $dgr->createQueryBuilder('d')->join('d.company', 'c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('d.pageUrlFull', 'ASC');
},
'choice_label' => 'pageUrlFull',
'multiple' => false,
'by_reference' => true,
'required' => false,
'placeholder' => 'Options.choose',
'empty_data' => null
));
$builder->add('clone', EntityType::class, array(
'label' => 'Docgroup.clone.label',
'class' => 'AcfDataBundle:Docgroupperso',
'query_builder' => function (<API key> $dgr) use ($companyId) {
return $dgr->createQueryBuilder('d')->join('d.company', 'c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('d.pageUrlFull', 'ASC');
},
'choice_label' => 'pageUrlFull',
'multiple' => false,
'by_reference' => true,
'required' => false,
'placeholder' => 'Options.choose',
'mapped' => false
));
}
$builder->add('label', TextType::class, array(
'label' => 'Docgroupperso.label.label'
));
$builder->add('otherInfos', TextareaType::class, array(
'label' => 'Docgroupperso.otherInfos.label',
'required' => false
));
}
/**
*
* @return string
*/
public function getName()
{
return '<API key>';
}
/**
*
* {@inheritdoc} @see AbstractType::getBlockPrefix()
*/
public function getBlockPrefix()
{
return $this->getName();
}
/**
* get the default options
*
* @return multitype:string multitype:string
*/
public function getDefaultOptions()
{
return array(
'validation_groups' => array(
'label',
'parent'
),
'company' => null
);
}
/**
*
* {@inheritdoc} @see AbstractType::configureOptions()
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults($this->getDefaultOptions());
}
} |
using System;
namespace Agiil.Auth
{
public sealed class <API key> {}
} |
package com.scooter1556.sms.android;
public class SMS {
public static class Codec {
public static final int UNSUPPORTED = -1;
public static final int COPY = 0;
public static final int AVC_BASELINE = 10;
public static final int AVC_MAIN = 11;
public static final int AVC_HIGH = 12;
public static final int AVC_HIGH10 = 13;
public static final int MPEG2 = 20;
public static final int HEVC_MAIN = 30;
public static final int HEVC_MAIN10 = 31;
public static final int HEVC_HDR10 = 32;
public static final int VC1 = 40;
public static final int AAC = 1000;
public static final int AC3 = 1001;
public static final int EAC3 = 1002;
public static final int DTS = 1003;
public static final int DTSHD = 1004;
public static final int PCM = 1005;
public static final int TRUEHD = 1006;
public static final int MP3 = 1007;
public static final int DSD = 1008;
public static final int FLAC = 1009;
public static final int ALAC = 1010;
public static final int VORBIS = 1011;
public static final int SUBRIP = 2000;
public static final int WEBVTT = 2001;
public static final int PGS = 2002;
public static final int DVB = 2003;
public static final int DVD = 2004;
}
public static class Format {
public static final int UNSUPPORTED = -1;
public static final int NONE = 0;
public static final int AAC = 1;
public static final int AC3 = 2;
public static final int AVI = 3;
public static final int DSF = 4;
public static final int DTS = 5;
public static final int FLAC = 6;
public static final int H264 = 7;
public static final int H265 = 8;
public static final int HLS_TS = 9;
public static final int MATROSKA = 10;
public static final int MP3 = 11;
public static final int MP4 = 12;
public static final int MPEG = 13;
public static final int MPEGTS = 14;
public static final int OGG = 15;
public static final int SUBRIP = 16;
public static final int WAV = 17;
public static final int WEBVTT = 18;
public static final int HLS_FMP4 = 19;
public static final int MPEG_DASH = 21;
}
public static class MediaType {
public static final int AUDIO = 0;
public static final int VIDEO = 1;
public static final int SUBTITLE = 2;
}
public static class Client {
public static final int UNSUPPORTED = 0;
public static final int ANDROID = 1;
public static final int ANDROID_TV = 2;
public static final int CHROMECAST = 3;
}
public static class ReplaygainMode {
public static final int OFF = 0;
public static final int NATIVE_TRACK = 1;
public static final int NATIVE_ALBUM = 2;
public static final int TRACK = 3;
public static final int ALBUM = 4;
}
} |
using System;
using System.Text;
using System.Web;
using System.Web.Http.Description;
namespace MyWebAPIServer.Areas.HelpPage
{
public static class <API key>
{
<summary>
Generates an URI-friendly ID for the <see cref="ApiDescription"/>. E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}"
</summary>
<param name="description">The <see cref="ApiDescription"/>.</param>
<returns>The ID as a string.</returns>
public static string GetFriendlyId(this ApiDescription description)
{
string path = description.RelativePath;
string[] urlParts = path.Split('?');
string localPath = urlParts[0];
string queryKeyString = null;
if (urlParts.Length > 1)
{
string query = urlParts[1];
string[] queryKeys = HttpUtility.ParseQueryString(query).AllKeys;
queryKeyString = String.Join("_", queryKeys);
}
StringBuilder friendlyPath = new StringBuilder();
friendlyPath.AppendFormat("{0}-{1}",
description.HttpMethod.Method,
localPath.Replace("/", "-").Replace("{", String.Empty).Replace("}", String.Empty));
if (queryKeyString != null)
{
friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-'));
}
return friendlyPath.ToString();
}
}
} |
- [x] Add search Bar
- [x] Add Github Authentication
- [] Allow users to post links with tags
- [x] Allow users to view links posted by them in seperate view
- [x] Implement settings for push notifications
- [x] Show link open count
- [x] Allow users to bookmark links which appear in bookmarks section of app
- [x] Allow users to sort links |
\hypertarget{<API key>}{\section{/home/cecilia/\-Documents/\-Symptogen/src/power Directory Reference}
\label{<API key>}\index{/home/cecilia/\-Documents/\-Symptogen/src/power Directory Reference@{/home/cecilia/\-Documents/\-Symptogen/src/power Directory Reference}}
}
\subsection*{Files}
\begin{DoxyCompactItemize}
\item
file \hyperlink{_fever_8cpp}{Fever.\-cpp}
\item
file \hyperlink{_fever_8h}{Fever.\-h}
\item
file \hyperlink{_headache_8cpp}{Headache.\-cpp}
\item
file \hyperlink{_headache_8h}{Headache.\-h}
\item
file \hyperlink{_power_8cpp}{Power.\-cpp}
\item
file \hyperlink{_power_8h}{Power.\-h}
\item
file \hyperlink{_sneeze_8cpp}{Sneeze.\-cpp}
\item
file \hyperlink{_sneeze_8h}{Sneeze.\-h}
\end{DoxyCompactItemize} |
const { <API key> } = (EventTarget = window.EventTargetShim);
const NULL_FN = () => 0;
function <API key>(isFinal, transcript) {
const results = [
[
{
confidence: 0.9,
transcript
}
]
];
results[0].isFinal = isFinal;
return results;
}
function <API key>() {
const consumers = [];
const jobs = [];
return {
cancel() {
jobs.splice(0);
},
consume(fn, context) {
consumers.push({ fn, context });
jobs.length && consumers.shift().fn(...jobs.shift());
},
hasConsumer() {
return !!consumers.length && consumers[0].context;
},
hasJob() {
return !!jobs.length;
},
peek() {
return jobs[0];
},
produce(...args) {
jobs.push(args);
consumers.length && consumers.shift().fn(...jobs.shift());
}
};
}
const <API key> = <API key>();
const <API key> = <API key>();
class SpeechRecognition extends EventTarget {
constructor() {
super();
this.grammars = null;
this.lang = 'en-US';
this.continuous = false;
this.interimResults = false;
this.maxAlternatives = 1;
this.serviceURI = 'mock://microsoft.com/<API key>';
this.abort = this.stop = NULL_FN;
}
start() {
<API key>.consume((scenario, ...args) => {
if (!this[scenario]) {
throw new Error(`Cannot find speech scenario named "${scenario}" in mockWebSpeech.js`);
} else {
this[scenario](...args);
}
}, this);
}
microphoneMuted() {
this.abort = this.stop = NULL_FN;
this.dispatchEvent({ type: 'start' });
this.dispatchEvent({ type: 'audiostart' });
this.dispatchEvent({ type: 'audioend' });
this.dispatchEvent({ type: 'error', error: 'no-speech' });
this.dispatchEvent({ type: 'end' });
}
birdTweet() {
this.abort = this.stop = NULL_FN;
this.dispatchEvent({ type: 'start' });
this.dispatchEvent({ type: 'audiostart' });
this.dispatchEvent({ type: 'soundstart' });
this.dispatchEvent({ type: 'soundend' });
this.dispatchEvent({ type: 'audioend' });
this.dispatchEvent({ type: 'end' });
}
<API key>() {
this.abort = this.stop = NULL_FN;
this.dispatchEvent({ type: 'start' });
this.dispatchEvent({ type: 'audiostart' });
this.dispatchEvent({ type: 'soundstart' });
this.dispatchEvent({ type: 'speechstart' });
this.dispatchEvent({ type: 'speechend' });
this.dispatchEvent({ type: 'soundend' });
this.dispatchEvent({ type: 'audioend' });
this.dispatchEvent({ type: 'end' });
}
airplaneMode() {
this.abort = this.stop = NULL_FN;
this.dispatchEvent({ type: 'start' });
this.dispatchEvent({ type: 'audiostart' });
this.dispatchEvent({ type: 'audioend' });
this.dispatchEvent({ type: 'error', error: 'network' });
this.dispatchEvent({ type: 'end' });
}
accessDenied() {
this.abort = this.stop = NULL_FN;
this.dispatchEvent({ type: 'error', error: 'not-allowed' });
this.dispatchEvent({ type: 'end' });
}
<API key>() {
this.abort = () => {
this.dispatchEvent({ type: 'audioend' });
this.dispatchEvent({ type: 'error', error: 'aborted' });
this.dispatchEvent({ type: 'end' });
};
this.stop = NULL_FN;
this.dispatchEvent({ type: 'start' });
this.dispatchEvent({ type: 'audiostart' });
}
recognize(transcript) {
this.abort = this.stop = NULL_FN;
this.dispatchEvent({ type: 'start' });
this.dispatchEvent({ type: 'audiostart' });
this.dispatchEvent({ type: 'soundstart' });
this.dispatchEvent({ type: 'speechstart' });
this.interimResults &&
this.dispatchEvent({ type: 'result', results: <API key>(false, transcript) });
this.dispatchEvent({ type: 'speechend' });
this.dispatchEvent({ type: 'soundend' });
this.dispatchEvent({ type: 'audioend' });
this.dispatchEvent({ type: 'result', results: <API key>(true, transcript) });
this.dispatchEvent({ type: 'end' });
}
recognizing(transcript) {
this.abort = this.stop = NULL_FN;
this.dispatchEvent({ type: 'start' });
this.dispatchEvent({ type: 'audiostart' });
this.dispatchEvent({ type: 'soundstart' });
this.dispatchEvent({ type: 'speechstart' });
this.interimResults &&
this.dispatchEvent({ type: 'result', results: <API key>(false, transcript) });
}
recognizeButAborted(transcript) {
this.abort = () => {
this.dispatchEvent({ type: 'speechend' });
this.dispatchEvent({ type: 'soundend' });
this.dispatchEvent({ type: 'audioend' });
this.dispatchEvent({ type: 'error', error: 'aborted' });
this.dispatchEvent({ type: 'end' });
};
this.stop = NULL_FN;
this.dispatchEvent({ type: 'start' });
this.dispatchEvent({ type: 'audiostart' });
this.dispatchEvent({ type: 'soundstart' });
this.dispatchEvent({ type: 'speechstart' });
this.interimResults &&
this.dispatchEvent({ type: 'result', results: <API key>(false, transcript) });
}
<API key>(transcript) {
this.abort = this.stop = NULL_FN;
this.dispatchEvent({ type: 'start' });
this.dispatchEvent({ type: 'audiostart' });
this.dispatchEvent({ type: 'soundstart' });
this.dispatchEvent({ type: 'speechstart' });
this.interimResults &&
this.dispatchEvent({ type: 'result', results: <API key>(false, transcript) });
this.dispatchEvent({ type: 'speechend' });
this.dispatchEvent({ type: 'soundend' });
this.dispatchEvent({ type: 'audioend' });
this.dispatchEvent({ type: 'result', results: <API key>(false, transcript) });
this.dispatchEvent({ type: 'end' });
}
}
[
'audiostart',
'audioend',
'end',
'error',
'nomatch',
'result',
'soundstart',
'soundend',
'speechstart',
'speechend',
'start'
].forEach(name => <API key>(SpeechRecognition.prototype, name));
class SpeechGrammarList {
addFromString() {
throw new Error('Not implemented');
}
addFromURI() {
throw new Error('Not implemented');
}
}
const <API key> = [
{
default: true,
lang: 'en-US',
localService: true,
name: 'Mock Voice (en-US)',
voiceURI: 'mock://web-speech/voice/en-US'
},
{
default: false,
lang: 'zh-YUE',
localService: true,
name: 'Mock Voice (zh-YUE)',
voiceURI: 'mock://web-speech/voice/zh-YUE'
}
];
class SpeechSynthesis extends EventTarget {
constructor() {
super();
this.<API key> = true;
}
getVoices() {
return <API key>;
}
cancel() {
<API key>.cancel();
}
pause() {
throw new Error('pause is not implemented.');
}
resume() {
throw new Error('resume is not implemented.');
}
speak(utterance) {
// We prime the speech engine by sending an empty utterance on start.
// We should ignore the first utterance if it is empty.
if (!this.<API key> || utterance.text) {
<API key>.produce(utterance);
}
this.<API key> = false;
}
}
<API key>(SpeechSynthesis.prototype, 'voiceschanged');
class <API key> extends EventTarget {
constructor(text) {
super();
this.lang = <API key>[0].lang;
this.pitch = 1;
this.rate = 1;
this.text = text;
this.voice = <API key>[0];
this.volume = 1;
}
}
['boundary', 'end', 'error', 'mark', 'pause', 'resume', 'start'].forEach(name =>
<API key>(<API key>.prototype, name)
);
window.WebSpeechMock = {
mockEndSynthesize() {
return new Promise(resolve => {
<API key>.consume(utterance => {
utterance.dispatchEvent({ type: 'end' });
const { lang, pitch, rate, text, voice, volume } = utterance;
resolve({ lang, pitch, rate, text, voice, volume });
});
});
},
mockErrorSynthesize(error = 'artificial-error') {
return new Promise(resolve => {
<API key>.consume(utterance => {
utterance.dispatchEvent({ error, type: 'error' });
const { lang, pitch, rate, text, voice, volume } = utterance;
resolve({ lang, pitch, rate, text, voice, volume });
});
});
},
mockRecognize(...args) {
<API key>.produce(...args);
},
mockStartSynthesize() {
const [utterance] = <API key>.peek() || [];
if (!utterance) {
throw new Error('No utterance pending synthesize.');
}
utterance.dispatchEvent({ type: 'start' });
const { lang, pitch, rate, text, voice, volume } = utterance;
return { lang, pitch, rate, text, voice, volume };
},
<API key>() {
const context = <API key>.hasConsumer();
if (context) {
const { continuous, grammars, interimResults, lang, maxAlternatives, serviceURI } = context;
return {
continuous,
grammars,
interimResults,
lang,
maxAlternatives,
serviceURI
};
} else {
return false;
}
},
<API key>() {
return <API key>.hasJob();
},
SpeechGrammarList,
SpeechRecognition,
speechSynthesis: new SpeechSynthesis(),
<API key>
}; |
$("#application").ready(function(){
$("#my-profile").click(function(e){
e.preventDefault();
hideMessage("#<API key>");
unboundErrors("#profile-form");
$.ajax(
base_url("users/get_current_user"),
{
method: "GET",
dataType: "json",
success: function(resp, status, req) {
$("#first_name").val(resp.data.first_name);
$("#last_name").val(resp.data.last_name);
$("#email").val(resp.data.email);
$("#city").val(resp.data.city);
$("#password").val("");
$("#repassword").val("");
},
error: function(req, status, error) {
boundErrors(req.responseJSON.level, req.responseJSON.data);
displayMessage("#<API key>", req.responseJSON.message, req.responseJSON.level, true);
}
}
);
});
$("#btn-save-profile").click(function(){
$.ajax(
base_url("users/save_current_user"),
{
method: "POST",
data: $("#profile-form").serialize(),
dataType: "json",
success: function(resp, status, req) {
unboundErrors("#profile-form");
displayMessage("#<API key>", resp.message, resp.level, true);
},
error: function(req, status, error) {
boundErrors("#profile-form", req.responseJSON.level, req.responseJSON.data, true);
displayMessage("#<API key>", req.responseJSON.message, req.responseJSON.level, true);
}
}
);
});
});
$(".application.places.my_places").ready(function(){
function savePlace() {
$("#btn-save").prop("disabled", true);
$.ajax(
base_url("places/save"),
{
method: "POST",
data: $("#save-form").serialize(),
dataType: "json",
success: function(resp, status, req) {
unboundErrors("#save-form");
displayMessage("#<API key>", resp.message, resp.level, true);
// Add element if is new
var current_place_id = $("#current_place_id").val();
if(current_place_id == "") {
$("#places-list").prepend('<li class="list-group-item"><a class="place-link" href="#" data-id="'+resp.data.id+'">'+resp.data.name+'</a><i class="remove-place fa fa-times fa-2x pull-right" data-id="'+resp.data.id+'" aria-hidden="true"></i></li>');
bindLoad();
bindRemove;
} else {
// Update element
$(".place-link[data-id="+current_place_id+"]").text($("#name").val());
}
$("#btn-save").prop("disabled", false);
clearPlace();
},
error: function(req, status, error) {
boundErrors("#save-form", req.responseJSON.level, req.responseJSON.data, true);
displayMessage("#<API key>", req.responseJSON.message, req.responseJSON.level, true);
$("#btn-save").prop("disabled", false);
}
}
);
}
function clearPlace() {
$("#current_place_id").val("");
$("#name").val("");
$("#address").val("");
}
function loadPlace(id) {
$.ajax(
base_url("places/find/".concat(id)),
{
method: "GET",
dataType: "json",
success: function(resp, status, req) {
// load place
hideMessage("#<API key>");
unboundErrors("#save-form");
$("#current_place_id").val(resp.data.id);
$("#name").val(resp.data.name);
$("#address").val(resp.data.address);
$("#google_place_id").val(resp.data.google_place_id);
},
error: function(req, status, error) {
displayMessage("#<API key>", req.responseJSON.message, req.responseJSON.level, true);
}
}
);
}
function removePlace(id) {
$.ajax(
base_url("places/remove/".concat(id)),
{
method: "GET",
dataType: "json",
success: function(resp, status, req) {
// remove place
hideMessage("#<API key>");
unboundErrors("#save-form");
$(".place-link[data-id="+id+"]").parent().slideUp(400, function(){
displayMessage("#<API key>", resp.message, resp.level, true);
});
},
error: function(req, status, error) {
displayMessage("#<API key>", req.responseJSON.message, req.responseJSON.level, true);
}
}
);
}
function getRandomPlace() {
$.ajax(
base_url("places/get_random/"),
{
method: "GET",
dataType: "json",
success: function(resp, status, req) {
// remove place
hideMessage("#<API key>");
hideMessage("#<API key>");
hideMessage("#<API key>");
unboundErrors("#save-form");
geocodePlaceId(resp.data.google_place_id);
$("#random-place").slideUp(400, function(){
$("#place-name").text(resp.data.name);
$("#place-address").text(resp.data.address);
$(this).slideDown(400);
});
},
error: function(req, status, error) {
displayMessage("#<API key>", req.responseJSON.message, req.responseJSON.level, true);
}
}
);
}
function bindLoad() {
$(".place-link").click(function(e){
e.preventDefault();
loadPlace($(this).data("id"));
});
}
function bindRemove() {
$(".remove-place").click(function(){
removePlace($(this).data("id"));
});
}
$("#save-form").submit(function(e){
e.preventDefault();
});
$("#btn-save").click(function(){
savePlace();
});
$("#random-picker-form").submit(function(){
e.preventDefault();
});
$("#btn-random").click(function(){
getRandomPlace();
});
bindLoad();
bindRemove();
}); |
<!DOCTYPE html>
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<meta charset="utf-8">
<title>Statistics</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="data.js"></script>
<script type="text/javascript" src="script.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=MML_HTMLorMML" type="text/javascript"></script>
</head>
<body>
<form id="form"></form>
<h1>Statistics</h1>
<p id="intro">
This page is designed to demonstrate the various calculations required for A'level Statistics.
Students can generate data and see the results of the calculations; also students can try the calculations for themselves and check against the computer's results.
</p>
<div id="content">
<div id="tabsdiv">
<ul id="tabs">
<li class="tabstyle"><a href="#" class="nolink current"
id="datadef"><span class="abbrev">DD</span><span class="full">Data Definintion</span></a>
<li class="tabstyle"><a href="#" class="nolink"
id="rawdata"><span class="abbrev">RD</span><span class="full">Raw Data<span></a>
<li class="tabstyle"><a href="#" class="nolink" id="datarep"><span class="abbrev">GP</span><span class="full">Grouping</span></a>
<li class="tabstyle"><a href="#" class="nolink" id="freqtab"><span class="abbrev">FT</span><span class="full">Frequency Table</span></a>
<li class="tabstyle"><a href="#" class="nolink" id="stem"><span class="abbrev">SL</span><span class="full">Stem and Leaf</span></a>
<li class="tabstyle"><a href="#" class="nolink" id="hist"><span class="abbrev">HG</span><span class="full">Histogram</span></a>
<li class="tabstyle"><a href="#" class="nolink" id="box"><span class="abbrev">BP</span><span class="full">Boxplot</span></a>
<li class="tabstyle"><a href="#" class="nolink" id="samstat"><span class="abbrev">SS</span><span class="full">Sample Statistics</span></a>
<li class="tabstyle correlate"><a href="#" class="nolink" id="correl"><span class="abbrev">CO</span><span class="full">Correlation</span></a>
<li class="tabstyle"><a href="#" class="nolink" id="help"><span class="abbrev">?</span><span class="full">Help</span></a>
</ul>
</div>
<div id="main">
<div id="datadefdiv">
<h3>Data Definintion</h3>
<div id="data_defn_X" class="dataform">
<h4>First Data Sample</h4>
<table id="autoXtable">
<tr>
<td>
<label for="type">
Data type:
</label>
</td>
<td>
<select name="type" form="form">
<option value="continuous">Continuous</option>
<option value="rounded">Continuous but rounded</option>
<option value="discrete">Discrete</option>
</select>
</td>
</tr>
<tr id="autoXrow">
<td>
<label for="auto_X">
Auto:
</label>
</td>
<td>
<input type="checkbox" name="auto_X" id="auto_X"
value="" form="form">
</td>
</tr>
</table>
<table class="text dataTable">
<tbody id="self_data_X">
<tr>
<td>
<label for="adata_X">
Data:
</label>
</td>
<td>
<textarea name="adata_X" id="adata_X" value=""
form="form" class="dataInput"></textarea>
</td>
</tr>
</tbody>
<tbody id="auto_data_X">
<tr>
<td>
<label for="distribution_X">
Distribution:
</label>
</td>
<td>
<select name="distribution_X" form="form">
<optgroup id="ctsdist_X" label="Continuous Distributions">
<option id="defcts_X" value="gaussian">Gaussian (Normal)</option>
<option value="exponential">(Translated) Exponential</option>
<option value="uniform">Uniform</option>
<option value="lognormal">Log-Normal</option>
</optgroup>
<optgroup id="discretedist_X" label="Discrete Distributions">
<option id="defdisc_X" value="binomial">Binomial</option>
<option value="poisson">Poisson</option>
<option value="uniformd">Uniform</option>
</optgroup>
</select>
</td>
</tr>
<tr>
<td>
<label for="number_X">
Number of points:
</label>
</td>
<td>
<input type="text" name="number_X" id="number_X" value="20" form="form">
</td>
</tr>
<tr>
<td>
<label for="mean_X">
<span id="cts_mean_X">
Distribution mean:
</span>
<span id="binomial_mean_X">
Number of trials:
</span>
<span id="uniformd_mean_X">
Maximum:
</span>
</label>
</td>
<td>
<input type="text" name="mean_X" id="mean_X" value="20" form="form">
</td>
</tr>
<tr>
<td>
<label for="stddev_X">
<span id="cts_stddev_X">
Standard deviation:
</span>
<span id="binomial_stddev_X">
Probability of success:
</span>
</label>
</td>
<td>
<input type="text" name="stddev_X" id="stddev_X" value="5" form="form">
</td>
</tr>
<tr>
<td>
<label for="edata_X">
Extra data points:
</label>
</td>
<td>
<input type="text" name="edata_X" id="edata_X" value="" form="form">
</td>
</tr>
</tbody>
<tr>
<td>
</td>
<td>
<button type="button" name="reset" id="reset" form="form">Generate
data</button>
</td>
</tr>
</table>
</div>
<div id="data_defn_Y" class="dataform">
<h4>Second Data Sample</h4>
<table>
<tr id="enableYrow">
<td>
<label for="active_Y">
Enable:
</label>
</td>
<td>
<input type="checkbox" name="enable_Y" id="enable_Y" value="" form="form">
</td>
</tr>
<tr class="second">
<td>
<label for="auto_Y">
Auto:
</label>
</td>
<td>
<input type="checkbox" name="auto_Y" id="auto_Y"
value="" form="form">
</td>
</tr>
</table>
<table class="text second dataTable">
<tbody id="self_data_Y">
<tr>
<td>
<label for="adata_Y">
Data:
</label>
</td>
<td>
<textarea name="adata_Y" id="adata_Y" value=""
form="form" class="dataInput"></textarea>
</td>
</tr>
</tbody>
<tbody id="auto_data_Y">
<tr>
<td>
<label for="distribution_Y">
Distribution:
</label>
</td>
<td>
<select name="distribution_Y" form="form">
<optgroup id="ctsdist_Y" label="Continuous Distributions">
<option id="defcts_Y" value="gaussian">Gaussian (Normal)</option>
<option value="exponential">(Translated) Exponential</option>
<option value="uniform">Uniform</option>
<option value="lognormal">Log-Normal</option>
</optgroup>
<optgroup id="discretedist_Y" label="Discrete Distributions">
<option id="defdisc_Y" value="binomial">Binomial</option>
<option value="poisson">Poisson</option>
<option value="uniformd">Uniform</option>
</optgroup>
</select>
</td>
</tr>
<tr>
<td>
<label for="number_Y">
Number of points:
</label>
</td>
<td>
<input type="text" name="number_Y" id="number_Y" value="20" form="form">
</td>
</tr>
<tr>
<td>
<label for="mean_Y">
<span id="cts_mean_Y">
Distribution mean:
</span>
<span id="binomial_mean_Y">
Number of trials:
</span>
<span id="uniformd_mean_Y">
Maximum:
</span>
</label>
</td>
<td>
<input type="text" name="mean_Y" id="mean_Y" value="20" form="form">
</td>
</tr>
<tr>
<td>
<label for="stddev_Y">
<span id="cts_stddev_Y">
Standard deviation:
</span>
<span id="binomial_stddev_Y">
Probability of success:
</span>
</label>
</td>
<td>
<input type="text" name="stddev_Y" id="stddev_Y" value="5" form="form">
</td>
</tr>
<tr>
<td>
<label for="edata_Y">
Extra data points:
</label>
</td>
<td>
<input type="text" name="edata_Y" id="edata_Y" value="" form="form">
</td>
</tr>
<tr>
<td>
<label for="quantiles">
Generate quantiles:
</label>
</td>
<td>
<input type="checkbox" name="quantiles" id="quantiles" value="" form="form">
</td>
</tr>
<tr>
<td>
<label for="correlate">
Force correlation:
</label>
</td>
<td>
<input type="checkbox" name="correlate" id="correlate" value="" form="form">
</td>
</tr>
<tr>
<td>
<label for="correlation">
Desired correlation:
</label>
</td>
<td>
<input type="text" name="correlation" id="correlation" checked="" form="form">
</td>
</tr>
<tr>
<td>
<label for="coding">
Apply coding:
</label>
</td>
<td>
<input type="checkbox" name="coding" id="coding" value="" form="form">
<math xmlns='http:
display='inline'><mi>Y</mi><mo>=</mo>
</math>
<input type="text" name="coding_a" id="coding_a"
value="1" form="form" class="coding">
<math xmlns='http:
display='inline'>
<mi>X</mi><mo>+</mo></math>
<input type="text" name="coding_b" id="coding_b"
value="0" form="form" class="coding">
</td>
</tr>
</table>
</div>
</div>
<div id="rawdatadiv">
<h3>Raw Data</h3>
<table class="data_table">
<tr>
<td class="first">
First Sample:
</td>
<td id="data_X" class="data">
</td>
</tr>
<tr class="second">
<td>
Second Sample:
</td>
<td id="data_Y" class="data">
</td>
</tr>
<tr class="correlate">
<td>
Paired Data:
</td>
<td id="data_XY" class="data">
</td>
</tr>
</table>
<h3>Sorted Raw Data</h3>
<table class="data_table">
<tr>
<td class="first">
First Sample:
</td>
<td id="sdata_X" class="data">
</td>
</tr>
<tr class="second">
<td>
Second Sample:
</td>
<td id="sdata_Y" class="data">
</td>
</tr>
</table>
</div>
<div id="datarepdiv">
<h3>Data Representation</h3>
<table class="text">
<tr>
<td>
<label for="even">
Even class intervals:
</label>
</td>
<td>
<input type="checkbox" name="even" id="even" checked="1"
value="" form="form">
</td>
</tr>
<tr>
<td>
<label for="classb">
Class offset:
</label>
</td>
<td>
<input type="text" name="classb" id="classb" value="0" form="form">
</td>
</tr>
<tr>
<td>
<label for="classw">
Class interval width:
</label>
</td>
<td>
<input type="text" name="classw" id="classw" value="10" form="form">
</td>
</tr>
<tr>
<td>
<label for="classes">
Class endpoints:
</label>
</td>
<td>
<input type="text" name="classes" id="classes" value="" form="form">
</td>
</tr>
<tr>
<td>
</td>
<td>
<button type="button" name="regroup" id="regroup"
form="form">Regroup data</button>
</td>
</tr>
</table>
</div>
<div id="freqtabdiv">
<h3>Frequency Table</h3>
<table id="freq">
<thead>
<tr>
<th colspan='2'>
Class Interval
</th>
<th colspan='2'>
Frequency
</th>
</tr>
<tr>
<th colspan='2'>
</th>
<th class='first'>
First
</th>
<th class='second'>
Second
</th>
</tr>
</thead>
<tbody id="freqrows">
</tbody>
</table>
</div>
<div id="stemdiv">
<h3>Stem and Leaf
Diagram</h3>
<p>
(Data rounded to nearest whole number.)
</p>
<table id="stem">
<thead>
<tr>
<th class="second" id="leftleaf">
First Leaf
</th>
<th>
Stem
</th>
<th id="rightleaf">
<span id="leaflabel" class="second">Second</span> Leaf
</th>
</tr>
<tbody id="stemrows">
</tbody>
</table>
</div>
<div id="histdiv">
<h3>Histogram</h3>
<canvas id="histogram" height="100"></canvas>
<table id="readings" class="text">
<tr>
<td>
Mark:
</td>
<td>
<span id="mark"></span>
</td>
</tr>
<tr>
<td class="first">
Points from first sample below mark:
</td>
<td>
<span id="below_X" class="first"></span>
</td>
</tr>
<tr>
<td class="first">
Approximate points from first sample below mark:
</td>
<td>
<span id="abelow_X" class="first"></span>
</td>
</tr>
<tr>
<td class="second">
Points from second sample below mark:
</td>
<td>
<span id="below_Y" class="second"></span>
</td>
</tr>
<tr>
<td class="second">
Approximate points from second sample below mark:
</td>
<td>
<span id="abelow_Y" class="second"></span>
</td>
</tr>
</table>
</div>
<div id="boxdiv">
<h3>Boxplot</h3>
<canvas id="boxplot" height="100"></canvas>
</div>
<div id="samstatdiv">
<h3>Sample Statistics</h3>
<table id="stats" class="text">
<tr>
<th></th>
<th class="first">First Sample</th>
<th class="second">Second Sample</th>
</tr>
<tbody>
<tr>
<td>
<span class='stooltip'>Size:</span>
<span class='tooltip'>
The <span class='defn'>size</span> of a data set is
the number of values.
This is usually denotes by
<math xmlns='http:
</td>
<td id="size_X" class="first">
</td>
<td id="size_Y" class="second">
</td>
</tr>
<tr>
<td>
<span class='stooltip'>Mean:</span>
<span class='tooltip'>
The <span class='defn'>mean</span> of a data set is
the sum of the values divided by the number of values.
<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'><mover><mi>x</mi><mo>¯</mo></mover><mo>=</mo><mfrac><mn>1</mn><mi>n</mi></mfrac><msubsup><mo lspace="thinmathspace" rspace="thinmathspace">∑</mo> <mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow> <mi>n</mi></msubsup><msub><mi>x</mi> <mi>i</mi></msub></math> </span>
</td>
<td id="smean_X" class="first">
</td>
<td id="smean_Y" class="second">
</td>
</tr>
<tr>
<td>
<span class='stooltip'>Median:</span>
<span class='tooltip'>
The <span class='defn'>median</span> of a data set is
the middle value when they are listed in order.
If there are an even number, it is the average of the
two middle values.
</span>
</td>
<td id="smedian_X" class="first">
</td>
<td id="smedian_Y" class="second">
</td>
</tr>
<tr>
<td>
<span class="cts"><span class='stooltip'>Modal class:</span><span class='tooltip'>
To define the <span class='defn'>modal class</span> of a data
set, the data needs to be divided into classes as in
a frequency table.
Then the <span class='defn'>modal class</span> is
the class or classes containing the most elements of
the data set.
</span>
</span><span class="discrete"><span class='stooltip'>Mode:</span><span class='tooltip'>
The <span class='defn'>mode</span> of a data
set is the value or values that occur most
frequently in the data.
</span></span>
</td>
<td id="smode_X" class="first">
</td>
<td id="smode_Y" class="second">
</td>
</tr>
<tr>
<td>
<span class='stooltip'>Variance:</span>
<span class='tooltip'>
The <span class='defn'>variance</span> of a data set
is a measure of its spread. It is defined as:
<math xmlns='http:
display='block'><msup><mi>σ</mi> <mn>2</mn></msup><mo>=</mo><mfrac><mn>1</mn><mi>n</mi></mfrac><msubsup><mo lspace="thinmathspace"
rspace="thinmathspace">∑</mo> <mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow> <mi>n</mi></msubsup><mo stretchy="false">(</mo><msub><mi>x</mi> <mi>i</mi></msub><mo>−</mo><mover><mi>x</mi><mo>¯</mo></mover><msup><mo stretchy="false">)</mo> <mn>2</mn></msup></math>
(where <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mover><mi>x</mi><mo>¯</mo></mover></math> is the mean) but is more conveniently calculated using the formula:
<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'><msup><mi>σ</mi> <mn>2</mn></msup><mo>=</mo><mfrac><mn>1</mn><mi>n</mi></mfrac><munderover><mo lspace="thinmathspace" rspace="thinmathspace">∑</mo> <mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow> <mi>n</mi></munderover><msubsup><mi>x</mi> <mi>i</mi> <mn>2</mn></msubsup><mo>−</mo><msup><mover><mi>x</mi><mo>¯</mo></mover> <mn>2</mn></msup></math>
</span>
</td>
<td id="svariance_X" class="first">
</td>
<td id="svariance_Y" class="second">
</td>
</tr>
<tr>
<td>
<span class='stooltip'>Standard Deviation:</span>
<span class='tooltip'>
The <span class='defn'>standard deviation</span> of a
data set is a measure of its spread.
It is defined as the square root of the variance.
</span>
</td>
<td id="sstddev_X" class="first">
</td>
<td id="sstddev_Y" class="second">
</td>
</tr>
<tr>
<td>
<span class='stooltip'>Lower Quartile:</span>
<span class='tooltip'>
The <span class='defn'>lower quartile</span> of a data
set is the value such that a quarter of the points lie
below that value and three-quarters lie above. Its
definition is slightly different depending on whether
or not there is an actual data point satisfying that
property.
</span>
</td>
<td id="slowq_X" class="first">
</td>
<td id="slowq_Y" class="second">
</td>
</tr>
<tr>
<td>
<span class='stooltip'>Upper Quartile:</span>
<span class='tooltip'>
The <span class='defn'>upper quartile</span> of a data
set is the value such that three-quarters of the points lie
below that value and a quarter lie above. Its
definition is slightly different depending on whether
or not there is an actual data point satisfying that
property.
</span>
</td>
<td id="supq_X" class="first">
</td>
<td id="supq_Y" class="second">
</td>
</tr>
<tr>
<td>
<span class='stooltip'>Inter-Quartile Range:</span>
<span class='tooltip'>
The <span class='defn'>inter-quartile range</span> of
a data set is a measure of its spread. It is defined
as the upper quartile minus the lower quartile.
</span>
</td>
<td id="siqrange_X" class="first">
</td>
<td id="siqrange_Y" class="second">
</td>
</tr>
<tr class='rowSpacer'>
<td>
Skewness
<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mfrac><mrow><mn>3</mn><mo stretchy="false">(</mo><mover><mi>x</mi><mo>¯</mo></mover><mo>−</mo><mo lspace="0em" rspace="thinmathspace">median</mo><mo stretchy="false">)</mo></mrow><mi>σ</mi></mfrac></math>:
</td>
<td id="smedskew_X" class="first">
</td>
<td id="smedskew_Y" class="second">
</td>
</tr>
<tr class='discrete'>
<td>
Skewness
<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mfrac><mrow><mover><mi>x</mi><mo>¯</mo></mover><mo>−</mo><mo lspace="0em" rspace="thinmathspace">mode</mo></mrow><mi>σ</mi></mfrac></math>:
</td>
<td id="smodeskew_X" class="first">
</td>
<td id="smodeskew_Y" class="second">
</td>
</tr>
<tr>
<td>
Quartile skewness coefficient:
</td>
<td id="sskewq_X" class="first">
</td>
<td id="sskewq_Y" class="second">
</td>
</tr>
<tr>
<td>
<span class='stooltip'>Lilliefors Normality Test:</span>
<span class='tooltip'>
The <span class='defn'>Lilliefors Normailty
Test</span> of a data set is a hypothesis test with
null hypothesis that the data is drawn from a
normally distributed population. If this number is
above the significance level then the null
hypothesis is to be rejected. This test was chosen
as it is straightforward to implement using the
approximations due to Abdi and Molin.
</span>
</td>
<td id="lilliefors_X" class="first">
</td>
<td id="lilliefors_Y" class="second">
</td>
</tr>
<tr class='rowSpacer'>
<td>
Estimate of Mean:
</td>
<td id="sbmean_X" class="first">
</td>
<td id="sbmean_Y" class="second">
</td>
</tr>
<tr>
<td>
Estimate of Variance:
</td>
<td id="sbvariance_X" class="first">
</td>
<td id="sbvariance_Y" class="second">
</td>
</tr>
<tr>
<td>
Estimate of Standard Deviation:
</td>
<td id="sbstddev_X" class="first">
</td>
<td id="sbstddev_Y" class="second">
</td>
</tr>
<tr>
<td>
Estimate of Median:
</td>
<td id="sbmedian_X" class="first">
</td>
<td id="sbmedian_Y" class="second">
</td>
</tr>
<tr>
<td>
Estimate of Lower Quartile:
</td>
<td id="sblowq_X" class="first">
</td>
<td id="sblowq_Y" class="second">
</td>
</tr>
<tr>
<td>
Estimate of Upper Quartile:
</td>
<td id="sbupq_X" class="first">
</td>
<td id="sbupq_Y" class="second">
</td>
</tr>
<tr>
<td>
Estimate of Inter-Quartile Range:
</td>
<td id="sbiqrange_X" class="first">
</td>
<td id="sbiqrange_Y" class="second">
</td>
</tr>
</tbody>
<tbody id='quantiles'>
<tr class='rowSpacer'>
<td>
Additional quantile calculations:
</td>
</tr>
<tr id='quantile_1'>
<td class='quantiles'>
<button name='add_1' id='add_1' form='form' class='plus'>+</button><input type='text' id='kth_1' form='form'
class='quantile'>th quantile of <input type='text' id='nth_1' form='form' class='quantile'>
</td>
<td id='quantile_1_X'>
</td>
<td id='quantile_1_Y' class='second'>
</td>
</tr>
<tr>
<td>
Estimate:
</td>
<td id='equantile_1_X'>
</td>
<td id='equantile_1_Y' class='second'>
</td>
</tr>
</tbody>
</table>
</div>
<div id="correldiv">
<h3>Correlation</h3>
<div>
<canvas id='scatter'></canvas>
<div id='corrmathml'>
<div>
<h4>Regression Calculation</h4>
<math xmlns='http:
display='inline'>
<mrow>
<mtable columnalign="right left right left
right left right left
right left"
columnspacing="0em">
<mtr>
<mtd>
<mi>Y</mi>
</mtd>
<mtd>
<mo>=</mo>
<mn id='gradient'>7</mn>
<mi>X</mi>
<mo>+</mo>
<mn id='intercept'>8</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mtext>Error</mtext>
</mtd>
<mtd>
<mo>=</mo>
<mn id='error'>0</mn>
</mtd>
</mtr>
</mtable>
</mrow>
</math>
</div>
<div>
<button type="button" name="resetre" id="resetre"
form="form">Reset regression line</button>
</div>
<div>
<h4>Correlation and Summary Statistics</h4>
<math xmlns='http:
display='inline'>
<mrow>
<mtable columnalign="right left right left
right left right left
right left"
columnspacing="0em">
<mtr>
<mtd>
<msub>
<mi>S</mi>
<mrow>
<mi>x</mi>
<mi>x</mi>
</mrow>
</msub>
</mtd>
<mtd>
<mo>=</mo>
<mn id='Sxx'>3</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>S</mi>
<mrow>
<mi>y</mi>
<mi>y</mi>
</mrow>
</msub>
</mtd>
<mtd>
<mo>=</mo>
<mn id='Syy'>4</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>S</mi>
<mrow>
<mi>x</mi>
<mi>y</mi>
</mrow>
</msub>
</mtd>
<mtd>
<mo>=</mo>
<mn id='Sxy'>5</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>r</mi><mo>=</mo><mfrac><mrow><msub><mi>S</mi> <mrow><mi>x</mi><mi>y</mi></mrow></msub></mrow><msqrt><mrow><msub><mi>S</mi> <mrow><mi>x</mi><mi>x</mi></mrow></msub><msub><mi>S</mi> <mrow><mi>y</mi><mi>y</mi></mrow></msub></mrow></msqrt></mfrac>
</mtd>
<mtd>
<mo>=</mo>
<mn id='pmcc'>6</mn>
</mtd>
</mtr>
</mtable>
</mrow>
</math>
</div>
</div>
</div>
</div>
<div id="helpdiv">
<h3>Help</h3>
<p>
The purpose of this webpage is to provide a playground for
A'level statistics.
</p>
<p>
A brief overview of the tabs is as follows.
</p>
<ul>
<li><span class="tabname">Data Definition.</span> For
defining or inputting the data to be studied.
<li><span class="tabname">Raw Data.</span> Once the data
has been defined, it can be viewed here. It is listed both
sorted and unsorted, and if two data sets of equal length
are used then two data sets are combined into a list of pairs.
<li><span class="tabname">Grouping.</span> Many data
analyses start with data in groups. This tab allows one to
specify the groupings.
<li><span class="tabname">Frequency Table.</span> Following
the grouping, this tab displays the corresponding frequency tables.
<li><span class="tabname">Stem and Leaf.</span> This tab
displays the data sets as stem and leaf diagrams.
<li><span class="tabname">Histogram.</span> This tab
displays the grouped data in histograms. It also allows for
the definition of a <span class="emph">mark</span> and
counts the number of data points below the mark, both actual
and estimated from the frequency table.
<li><span class="tabname">Boxplot.</span> This tab displays
the data as a boxplot, with outliers defined using the
interquartile range definition.
<li><span class="tabname">Sample Statistics.</span> This
tab displays lots of statistics calculated from the data
sets.
<li><span class="tabname">Correlation.</span> If the two
data sets are of the same length, this tab shows the
correlation between them. It displays a scatter plot,
calculates the correlation coefficient, and the regression
line. It is possible to modify the regression line to see
how the error varies.
</ul>
<h4>Data Definition</h4>
<p>
There are many options for defining the data set.
</p>
<ul>
<li><span class="dataopt">Data type.</span> There are three
types of data which modify how the program treats the data.
<ul>
<li><span class="dataopt">Continous.</span> The data is
considered as being drawn from a continuous distribution.
<li><span class="dataopt">Continous but rounded.</span>
The data is considered as being drawn from a continuous
distribution but a rounding function is applied
(currently only "to nearest integer" is available).
This means that the data appears discrete but is
treated as having been drawn from a continuous
distribution.
<li><span class="dataopt">Discrete.</span> The data is
considered as being drawn from a discrete distribution.
</ul>
<li><span class="dataopt">Enable.</span> It is possible to
work with either one or two data sets. Checking this box
enables the second data set.
<li><span class="dataopt">Auto.</span> The data can be
automatically generated or entered directly. If this is
checked, the data is automatically generated. If not, it
can be entered directly in
the <span class="dataopt">Data</span> textarea. The data
points can be separated by commas, semi-colons, or spaces
(including tabs and newlines).
<li><span class="dataopt">Distribution.</span> Depending on
the data type, various standard distributions are
available. Each requires some parameters. The available
distributions are:
<ul>
<li>Continuous distributions. All are specified by
giving the mean and standard deviation. The Exponential
and Log-Normal distributions are good sources of skewed data.
<ul>
<li><span class="dataopt">Gaussian (Normal)</span>
<li><span class="dataopt">(Translated)
Exponential</span>
<li><span class="dataopt">Uniform</span>
<li><span class="dataopt">Log-Normal</span>
</ul>
<li>Discrete distributions.
<ul>
<li><span class="dataopt">Binomial</span>
<li><span class="dataopt">Poisson</span>
<li><span class="dataopt">Uniform</span>
</ul>
</ul>
<li><span class="dataopt">Number of points.</span> This is
the number of points to generate. If both data sets have
the same number of points, regression analysis is enabled.
<li><span class="dataopt">Extra data points.</span> It is
possible to add additional data points to the generated
data.
<li><span class="dataopt">Generate data.</span>
Most of the time, the data should update itself when
the options are changed. Sometimes it might be
necessary or desirable to manually generate it.
<li><span class="dataopt">Generate quantiles.</span> Rather
than generate the second data set randomly (from the given
distribution), it is possible to generate the quantiles
corresponding to the number of data points in the first data
sample. This can be used as a simple test for whether or
not the first data set fits the given distribution: plotting
a scatter plot of the data sets and looking at the
correlation coefficient provides evidence to this (in these
circumstances, the scatter plot is known as
a <span class="dataopt">QQ-plot</span>.
<li><span class="dataopt">Force correlation.</span> If this
checkbox is ticked, the program attempts to coerce the
second data set to be correlated to the first with the given
<span class="dataopt">Desired correlation</span>. The final
correlation may not be precisely equal to the desired
correlation.
<li><span class="dataopt">Apply coding.</span> If this
checkbox is ticked, the second data set is generated by
applying the given coding to the first data set.
</ul>
<h4>Grouping</h4>
<p>
The <span class="tabname">Frequency
Table</span>, <span class="tabname">Histogram</span>, and
some of the <span class="tabname">Sample Statistics</span>
depend on putting the data into groups. This tab allows one
to define those groups.
</p>
<p>
There are two ways to define the groups.
If <span class="dataopt">Even class intervals</span> is
checked then the groups are of equal widths and so are
specified by the width and the initial offset from zero.
If it is not checked, one must specify the boundaries
individually.
</p>
<p>
The groups are assumed to be open at the top end. That is,
if <math xmlns='http:
display='inline'><mi>a</mi></math> and <math xmlns='http:
display='inline'><mi>b</mi></math> are two
boundaries, the group
is <math xmlns='http:
</p>
<h4>Histogram</h4>
<p>
The interactivity in
the <span class="tabname">Histogram</span> tab is the
ability to move the red marker. The purpose of this is to
show the effect of interpolation. After the mark is set,
the program calculates how many data points are below the
mark together with an estimate of how many data points there
are using interpolation on the groups. Thus it is possible
to compare the grouped estimate with the actual figure.
</p>
<h4>Sample Statistics</h4>
<p>
In this tab, an array of statistics is computed from the
data sample(s). Hovering over a title reveals a brief
description of the statistics. Where a statistic contains
the word "Estimate", it is based on the grouped data. Extra
quantiles can be calculated using the input boxes at the
bottom. For example, to work out the 70th percentile, enter
"70" and "100" in the boxes so that it reads
"70th quantile of 100".
</p>
<p>
<h4>Correlation</h4>
<p>
This tab is only displayed if there are two data sets of the
same length. It displays a scatter plot together with the
relevant statistics for correlation and regression analysis.
</p>
<p>
It is possible to adjust the line to demonstrate
that the regression line is the best fit. Clicking and
dragging on the
scatter plot will adjust the line to pass through the mouse
or touch
point. If the mouse is near the centre of the scatter plot
then the y-intercept is adjusted, if the mouse is near the
edges then the gradient is adjusted.
Clicking <span class="dataopt">Reset regression line</span>
resets the line back to the regression line.
</p>
</div>
</div>
</div>
</body>
</html> |
package br.gov.servicos.config;
import lombok.experimental.FieldDefaults;
import org.elasticsearch.action.admin.cluster.health.<API key>;
import org.elasticsearch.action.admin.cluster.health.<API key>;
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest;
import org.elasticsearch.client.AdminClient;
import org.elasticsearch.client.Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;
import static br.gov.servicos.config.<API key>.IMPORTADOR;
import static br.gov.servicos.config.<API key>.PERSISTENTE;
import static lombok.AccessLevel.PRIVATE;
import static org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus.GREEN;
@Component
@FieldDefaults(level = PRIVATE, makeFinal = true)
public class <API key> implements HealthIndicator {
AdminClient client;
@Autowired
public <API key>(Client client) {
this.client = client.admin();
}
@Override
public Health health() {
try {
<API key> request = new <API key>(IMPORTADOR, PERSISTENTE);
<API key> response = client.cluster().health(request).actionGet();
Health.Builder health = response.getStatus() != GREEN ? Health.down() : Health.up();
health.withDetail("status", response.getStatus())
.withDetail("nodes", response.getNumberOfNodes());
if (response.getNumberOfNodes() > 0) {
NodeInfo[] nodeInfos = client.cluster().nodesInfo(new NodesInfoRequest()).actionGet().getNodes();
for (int i = 0; i < nodeInfos.length; i++) {
health = health.withDetail("node-" + i, nodeInfos[i].getNode().getName());
}
}
return health.build();
} catch (Exception e) {
return Health.down().withException(e).build();
}
}
} |
var hasBlockedContent = false;
(function () {
angular.module('piwikApp.service').factory('piwikApi', piwikApiService);
piwikApiService.$inject = ['$http', '$q', '$rootScope', 'piwik', '$window'];
function piwikApiService ($http, $q, $rootScope, piwik, $window) {
var url = 'index.php';
var format = 'json';
var getParams = {};
var postParams = {};
var allRequests = [];
/**
* Adds params to the request.
* If params are given more then once, the latest given value is used for the request
*
* @param {object} params
* @return {void}
*/
function addParams (params) {
if (typeof params == 'string') {
params = piwik.broadcast.getValuesFromUrl(params);
}
for (var key in params) {
getParams[key] = params[key];
}
}
function withTokenInUrl()
{
postParams['token_auth'] = piwik.token_auth;
}
function <API key>() {
return getParams && getParams['module'] === 'API' && getParams['method'];
}
function reset () {
getParams = {};
postParams = {};
}
function isErrorResponse(response) {
return response && angular.isObject(response) && response.result == 'error';
}
function <API key>(response, options) {
if (response.message
&& options.<API key>
) {
var UI = require('piwik/UI');
var notification = new UI.Notification();
notification.show(response.message, {
context: 'error',
type: 'toast',
id: 'ajaxHelper',
placeat: options.placeat
});
notification.<API key>();
}
}
/**
* Send the request
* @return $promise
*/
function send (options) {
if (!options) {
options = {};
}
if (options.<API key> === undefined) {
options.<API key> = true;
}
function onSuccess(response)
{
response = response.data;
if (!angular.isDefined(response) || response === null) {
return $q.reject(null);
} else if (isErrorResponse(response)) {
<API key>(response, options);
return $q.reject(response.message || null);
} else {
return response;
}
}
function onError(response)
{
var message = 'Something went wrong';
if (response && (response.status === 0 || response.status === -1)) {
message = 'Request was possibly aborted';
}
return $q.reject(message);
}
var deferred = $q.defer(),
requestPromise = deferred.promise;
var headers = {
'Content-Type': 'application/<API key>',
// ie 8,9,10 caches ajax requests, prevent this
'cache-control': 'no-cache'
};
var requestFormat = format;
if (getParams.format && getParams.format.toLowerCase() !== 'json' && getParams.format.toLowerCase() !== 'json2') {
requestFormat = getParams.format;
}
var ajaxCall = {
method: 'POST',
url: url,
responseType: requestFormat,
params: <API key>(getParams),
data: $.param(getPostParams(postParams)),
timeout: requestPromise,
headers: headers
};
var promise = $http(ajaxCall).then(onSuccess, onError);
// we can't modify requestPromise directly and add an abort method since for some reason it gets
// removed after then/finally/catch is called.
var addAbortMethod = function (to, deferred) {
return {
then: function () {
return addAbortMethod(to.then.apply(to, arguments), deferred);
},
'finally': function () {
return addAbortMethod(to.finally.apply(to, arguments), deferred);
},
'catch': function () {
return addAbortMethod(to.catch.apply(to, arguments), deferred);
},
abort: function () {
deferred.resolve();
return this;
}
};
};
var request = addAbortMethod(promise, deferred);
allRequests.push(request);
return request;
}
/**
* Get the parameters to send as POST
*
* @param {object} params parameter object
* @return {object}
* @private
*/
function getPostParams (params) {
if (<API key>()) {
params.token_auth = piwik.token_auth;
}
return params;
}
/**
* Mixin the default parameters to send as GET
*
* @param {object} getParamsToMixin parameter object
* @return {object}
* @private
*/
function <API key> (getParamsToMixin) {
var segment = piwik.broadcast.getValueFromHash('segment', $window.location.href.split('
// we have to decode the value manually because broadcast will not decode anything itself. if we don't,
// angular will encode it again before sending the value in an HTTP request.
segment = decodeURIComponent(segment);
var defaultParams = {
idSite: piwik.idSite || piwik.broadcast.getValueFromUrl('idSite'),
period: piwik.period || piwik.broadcast.getValueFromUrl('period'),
segment: segment
};
// never append token_auth to url
if (getParamsToMixin.token_auth) {
getParamsToMixin.token_auth = null;
delete getParamsToMixin.token_auth;
}
for (var key in defaultParams) {
if (!getParamsToMixin[key] && !postParams[key] && defaultParams[key]) {
getParamsToMixin[key] = defaultParams[key];
}
}
// handle default date & period if not already set
if (!getParamsToMixin.date && !postParams.date) {
getParamsToMixin.date = piwik.currentDateString || piwik.broadcast.getValueFromUrl('date');
if (getParamsToMixin.period == 'range' && piwik.currentDateString) {
getParamsToMixin.date = piwik.startDateString + ',' + getParamsToMixin.date;
}
}
return getParamsToMixin;
}
function abortAll() {
reset();
allRequests.forEach(function (request) {
request.abort();
});
allRequests = [];
}
function abort () {
abortAll();
}
/**
* Perform a reading API request.
* @param getParams
*/
function fetch (getParams, options) {
getParams.module = getParams.module || 'API';
if (!getParams.format) {
getParams.format = 'JSON2';
}
addParams(getParams);
var promise = send(options);
reset();
return promise;
}
function post(getParams, _postParams_, options) {
if (_postParams_) {
if (postParams && postParams.token_auth && !_postParams_.token_auth) {
_postParams_.token_auth = postParams.token_auth;
}
postParams = _postParams_;
}
return fetch(getParams, options);
}
function addPostParams(_postParams_) {
if (_postParams_) {
angular.merge(postParams, _postParams_);
}
}
/**
* Convenience method that will perform a bulk request using Piwik's API.getBulkRequest method.
* Bulk requests allow you to execute multiple Piwik requests with one HTTP request.
*
* @param {object[]} requests
* @param {object} options
* @return {HttpPromise} a promise that is resolved when the request finishes. The argument passed
* to the .then(...) callback will be an array with one element per request
* made.
*/
function bulkFetch(requests, options) {
var <API key> = {
urls: requests.map(function (requestObj) { return '?' + $.param(requestObj); })
};
var deferred = $q.defer(),
requestPromise = post({method: "API.getBulkRequest"}, <API key>, options).then(function (response) {
if (!(response instanceof Array)) {
response = [response];
}
// check for errors
for (var i = 0; i != response.length; ++i) {
var specificResponse = response[i];
if (isErrorResponse(specificResponse)) {
deferred.reject(specificResponse.message || null);
<API key>(specificResponse, options || {});
return;
}
}
deferred.resolve(response);
}).catch(function () {
deferred.reject.apply(deferred, arguments);
});
return deferred.promise;
}
return {
withTokenInUrl: withTokenInUrl,
bulkFetch: bulkFetch,
post: post,
fetch: fetch,
addPostParams: addPostParams,
/**
* @deprecated
*/
abort: abort,
abortAll: abortAll
};
}
})(); |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `BitwiseOperator` trait in crate `rustc_lint`.">
<meta name="keywords" content="rust, rustlang, rust-lang, BitwiseOperator">
<title>rustc_lint::middle::dataflow::BitwiseOperator - Rust</title>
<link rel="stylesheet" type="text/css" href="../../../main.css">
<link rel="shortcut icon" href="http:
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]
<section class="sidebar">
<a href='../../../rustc_lint/index.html'><img src='http:
<p class='location'><a href='../../index.html'>rustc_lint</a>::<wbr><a href='../index.html'>middle</a>::<wbr><a href='index.html'>dataflow</a></p><script>window.sidebarCurrent = {name: 'BitwiseOperator', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</section>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press 'S' to search, '?' for more options..."
type="search">
</div>
</form>
</nav>
<section id='main' class="content trait">
<h1 class='fqn'><span class='in-band'>Trait <a href='../../index.html'>rustc_lint</a>::<wbr><a href='../index.html'>middle</a>::<wbr><a href='index.html'>dataflow</a>::<wbr><a class='trait' href=''>BitwiseOperator</a><wbr><a class='stability Unstable' title=''>Unstable</a></span><span class='out-of-band'><span id='render-detail'>
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
</span><a id='src-30332' href='../../../rustc/middle/dataflow/trait.BitwiseOperator.html?gotosrc=30332'>[src]</a></span></h1>
<pre class='rust trait'>pub trait BitwiseOperator {
fn <a href='#tymethod.join' class='fnname'>join</a>(&self, succ: <a href='../../../std/primitive.usize.html'>usize</a>, pred: <a href='../../../std/primitive.usize.html'>usize</a>) -> <a href='../../../std/primitive.usize.html'>usize</a>;
}</pre>
<h2 id='required-methods'>Required Methods</h2>
<div class='methods'>
<h3 id='tymethod.join' class='method'><a class='stability Unstable' title='Unstable'></a><code>fn <a href='#tymethod.join' class='fnname'>join</a>(&self, succ: <a href='../../../std/primitive.usize.html'>usize</a>, pred: <a href='../../../std/primitive.usize.html'>usize</a>) -> <a href='../../../std/primitive.usize.html'>usize</a></code></h3><div class='docblock'><p>Joins two predecessor bits together, typically either <code>|</code> or <code>&</code></p>
</div></div>
<h2 id='implementors'>Implementors</h2>
<ul class='item-list' id='implementors-list'>
<li><a class='stability Unstable' title='Unstable'></a><code>impl <a class='trait' href='../../../rustc_lint/middle/dataflow/trait.BitwiseOperator.html' title='rustc_lint::middle::dataflow::BitwiseOperator'>BitwiseOperator</a> for <a class='struct' href='../../../rustc/middle/dataflow/struct.Union.html' title='rustc::middle::dataflow::Union'>Union</a></code></li>
<li><a class='stability Unstable' title='Unstable'></a><code>impl <a class='trait' href='../../../rustc_lint/middle/dataflow/trait.BitwiseOperator.html' title='rustc_lint::middle::dataflow::BitwiseOperator'>BitwiseOperator</a> for <a class='struct' href='../../../rustc/middle/dataflow/struct.Subtract.html' title='rustc::middle::dataflow::Subtract'>Subtract</a></code></li>
</ul><script type="text/javascript" async
src="../../../implementors/rustc/middle/dataflow/trait.BitwiseOperator.js">
</script></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<div id="help" class="hidden">
<div class="shortcuts">
<h1>Keyboard shortcuts</h1>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h1>Search tricks</h1>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>typedef</code> (or
<code>tdef</code>).
</p>
</div>
</div>
<script>
window.rootPath = "../../../";
window.currentCrate = "rustc_lint";
window.playgroundUrl = "";
</script>
<script src="../../../jquery.js"></script>
<script src="../../../main.js"></script>
<script async src="../../../search-index.js"></script>
</body>
</html> |
<?php
class Harviacode
{
private $host;
private $user;
private $password;
private $database;
private $sql;
function __construct()
{
$this->connection();
}
function connection()
{
$db = file_get_contents('../application/config/database.php');
$db = explode("\$db['default'] = array(", $db);
$db = explode(");", $db[1]);
$db = explode(',', $db[0]);
for ($i = 0; $i < count($db); $i++) {
$host = explode(' => ', $db[$i]);
$data[] = trim($host[1], "'");
}
$this->host = $data[1];
$this->user = $data[2];
$this->password = $data[3];
$this->database = $data[4];
$this->sql = new mysqli($this->host, $this->user, $this->password, $this->database);
if ($this->sql->connect_error) {
echo $this->sql->connect_error . ", please check 'application/config/database.php'.";
die();
}
}
function table_list()
{
$query = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?";
$stmt = $this->sql->prepare($query) OR die("Error code :" . $this->sql->errno . " (not_primary_field)");
$stmt->bind_param('s', $this->database);
$stmt->bind_result($table_name);
$stmt->execute();
while ($stmt->fetch()) {
$fields[] = array('table_name' => $table_name);
}
return $fields;
$stmt->close();
$this->sql->close();
}
function primary_field($table)
{
$query = "SELECT COLUMN_NAME,COLUMN_KEY FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=? AND TABLE_NAME=? AND COLUMN_KEY = 'PRI'";
$stmt = $this->sql->prepare($query) OR die("Error code :" . $this->sql->errno . " (primary_field)");
$stmt->bind_param('ss', $this->database, $table);
$stmt->bind_result($column_name, $column_key);
$stmt->execute();
$stmt->fetch();
return $column_name;
$stmt->close();
$this->sql->close();
}
function not_primary_field($table)
{
$query = "SELECT COLUMN_NAME,COLUMN_KEY,DATA_TYPE,COLUMN_COMMENT,IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=? AND TABLE_NAME=? AND COLUMN_KEY <> 'PRI'";
$stmt = $this->sql->prepare($query) OR die("Error code :" . $this->sql->errno . " (not_primary_field)");
$stmt->bind_param('ss', $this->database, $table);
$stmt->bind_result($column_name, $column_key, $data_type,$column_comment,$is_nullable);
$stmt->execute();
while ($stmt->fetch()) {
if ($column_name =='created_at' or
$column_name =='updated_at' or
$column_name =='deleted_at' or
$column_name =='created_by' or
$column_name =='updated_by'
) {
continue;
}
$get_arr = array('column_name' => $column_name, 'column_key' => $column_key, 'data_type' => $data_type,'is_nullable'=>$is_nullable);
$get_arr['f_name'] = $column_name;
$get_arr['validation'] = "";
if (!empty($column_comment)) {
$j = json_decode($column_comment);
if($j){
if (isset($j->n)) {
$get_arr['f_name'] = $j->n;
}
if (isset($j->v)) {
$get_arr['validation'] = $j->v;
}
}
}
$fields[] = $get_arr;
}
return $fields;
$stmt->close();
$this->sql->close();
}
function all_field($table)
{
$query = "SELECT COLUMN_NAME,COLUMN_KEY,DATA_TYPE,COLUMN_COMMENT FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=? AND TABLE_NAME=?";
$stmt = $this->sql->prepare($query) OR die("Error code :" . $this->sql->errno . " (not_primary_field)");
$stmt->bind_param('ss', $this->database, $table);
$stmt->bind_result($column_name, $column_key, $data_type,$column_comment);
$stmt->execute();
while ($stmt->fetch()) {
if ($column_name =='created_at' or
$column_name =='updated_at' or
$column_name =='deleted_at' or
$column_name =='created_by' or
$column_name =='updated_by'
) {
continue;
}
$get_arr = array('column_name' => $column_name, 'column_key' => $column_key, 'data_type' => $data_type);
$get_arr['f_name'] = $column_name;
if (!empty($column_comment)) {
$j = json_decode($column_comment);
if($j){
if (isset($j->n)) {
$get_arr['f_name'] = $j->n;
}
}
}
$fields[] = $get_arr;
}
return $fields;
$stmt->close();
$this->sql->close();
}
public function table_process($stmt)
{
# code...
}
function reference_field($table)
{
$query = " SELECT column_name,<API key>,<API key>
FROM
information_schema.key_column_usage
WHERE
<API key> is not null
and table_schema = ?
and table_name = ?";
$stmt = $this->sql->prepare($query) OR die("Error code :" . $this->sql->errno . " (not_primary_field)");
$stmt->bind_param('ss', $this->database, $table);
$stmt->bind_result($column_name, $<API key>, $<API key>);
$stmt->execute();
while ($stmt->fetch()) {
$fields[$column_name] = array(
'column_name' => $column_name,
'r_table' => $<API key>,
'r_column' => $<API key>,
'r_model' => ucfirst($<API key>).'_model'
);
}
return $fields;
$stmt->close();
$this->sql->close();
}
public function with_reference($all,$reference)
{
foreach ($all as $key => $row) {
$all[$key]['r_table']=false;
$all[$key]['r_column']=false;
$all[$key]['r_model']=false;
$all[$key]['r_label']=false;
$all[$key]['img']=false;
if(array_key_exists($row["column_name"], $reference) ) {
$all[$key]['r_table']=$reference[$row["column_name"]]["r_table"];
$all[$key]['r_column']=$reference[$row["column_name"]]["r_column"];
$all[$key]['r_model']=$reference[$row["column_name"]]["r_model"];
$all[$key]['r_label']='$this->'.$reference[$row["column_name"]]["r_model"].'->label';
}elseif (strpos($row['column_name'], '_img') !== false) {
$all[$key]['img']=true;
}elseif (strpos($row['column_name'], '_file') !== false) {
$all[$key]['file']=true;
}
}
return $all;
}
}
$hc = new Harviacode();
?> |
public class LightOffCommand implements Command {
Light light;
public LightOffCommand(Light light) {
this.light = light;
}
public void execute() {
light.off();
}
public void undo() {
light.on();
}
} |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<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.6"/>
<title>RelaxAuto: Namespace Members</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/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</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">RelaxAuto
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<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 class="current"><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</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="namespaces.html"><span>Namespace List</span></a></li>
<li class="current"><a href="namespacemembers.html"><span>Namespace Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li><a href="namespacemembers.html"><span>All</span></a></li>
<li class="current"><a href="<API key>.html"><span>Functions</span></a></li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
 <ul>
<li>check_for_errors()
: <a class="el" href="namespacemain.html#<API key>">main</a>
</li>
<li><API key>()
: <a class="el" href="namespaceauto.html#<API key>">auto</a>
</li>
<li><API key>()
: <a class="el" href="namespaceauto.html#<API key>">auto</a>
</li>
<li>find_min_max_volume()
: <a class="el" href="namespaceauto.html#<API key>">auto</a>
</li>
<li><API key>()
: <a class="el" href="namespaceauto.html#<API key>">auto</a>
</li>
<li>get_volumes()
: <a class="el" href="namespaceauto.html#<API key>">auto</a>
</li>
<li>run_automation()
: <a class="el" href="namespacemain.html#<API key>">main</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Dec 21 2014 14:50:37 for RelaxAuto by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html> |
import os
from typing import Optional
import semver
from gitflow import _, version
from gitflow.common import Result
from gitflow.const import VersioningScheme
from gitflow.version import VersionConfig
def <API key>(version_config, prev_version, global_seq):
if version_config.versioning_scheme == VersioningScheme.SEMVER_WITH_SEQ:
if prev_version is not None:
version_seq = semver.parse_version_info(prev_version).prerelease
if version_seq is not None:
# must throw if not an integer
version_seq = int(version_seq)
if global_seq is None:
raise ValueError('the version sequence number is defined, while the global one is not')
if version_seq > global_seq:
raise ValueError('the version sequence number is greater than the global sequence number')
if global_seq is None:
global_seq = 0
else:
global_seq = None
return global_seq
def version_bump_major(version_config: VersionConfig, version: Optional[str], global_seq: Optional[int]):
result = Result()
try:
global_seq = <API key>(version_config, version, global_seq)
except ValueError as e:
result.error(os.EX_DATAERR, "version increment failed", str(e))
if not result.has_errors():
version_info = semver.parse_version_info(
semver.bump_major(version)) if version is not None else semver.parse_version_info("0.0.0")
pre_release = True
result.value = semver.format_version(
version_info.major,
version_info.minor,
version_info.patch,
(version_config.qualifiers[0] + ".1" if pre_release else None)
if version_config.versioning_scheme != VersioningScheme.SEMVER_WITH_SEQ
else global_seq + 1,
None)
return result
def version_bump_minor(version_config: VersionConfig, version: Optional[str], global_seq: Optional[int]):
result = Result()
try:
global_seq = <API key>(version_config, version, global_seq)
except ValueError as e:
result.error(os.EX_DATAERR, "version increment failed", str(e))
if not result.has_errors():
version_info = semver.parse_version_info(
semver.bump_minor(version)) if version is not None else semver.parse_version_info("0.0.0")
pre_release = True
result.value = semver.format_version(
version_info.major,
version_info.minor,
version_info.patch,
(version_config.qualifiers[0] + ".1" if pre_release else None)
if version_config.versioning_scheme != VersioningScheme.SEMVER_WITH_SEQ
else global_seq + 1,
None)
return result
def version_bump_patch(version_config: VersionConfig, version: Optional[str], global_seq: Optional[int]):
result = Result()
try:
global_seq = <API key>(version_config, version, global_seq)
except ValueError as e:
result.error(os.EX_DATAERR, "version increment failed", str(e))
if not result.has_errors():
version_info = semver.parse_version_info(
semver.bump_patch(version)) if version is not None else semver.parse_version_info("0.0.0")
pre_release = True
result.value = semver.format_version(
version_info.major,
version_info.minor,
version_info.patch,
(version_config.qualifiers[0] + ".1" if pre_release else None)
if version_config.versioning_scheme != VersioningScheme.SEMVER_WITH_SEQ
else global_seq + 1,
None)
return result
def <API key>(version_config: VersionConfig, version: Optional[str], global_seq: Optional[int]):
result = Result()
version_info = semver.parse_version_info(version) if version is not None else semver.parse_version_info("0.0.0")
new_qualifier = None
if not version_config.qualifiers:
result.error(os.EX_USAGE,
_("Failed to increment the pre-release qualifier of version {version}.")
.format(version=repr(version)),
_("The version scheme does not contain qualifiers")
)
return result
if version_info.prerelease:
<API key> = version_info.prerelease.split(".")
qualifier = <API key>[0]
qualifier_index = version_config.qualifiers.index(qualifier) if qualifier in version_config.qualifiers else -1
if qualifier_index < 0:
result.error(os.EX_DATAERR,
_("Failed to increment the pre-release qualifier of version {version}.")
.format(version=repr(version)),
_("The current qualifier is invalid: {qualifier}")
.format(qualifier=repr(qualifier)))
else:
qualifier_index += 1
if qualifier_index < len(version_config.qualifiers):
new_qualifier = version_config.qualifiers[qualifier_index]
else:
result.error(os.EX_DATAERR,
_("Failed to increment the pre-release qualifier {qualifier} of version {version}.")
.format(qualifier=qualifier, version=repr(version)),
_("There are no further qualifiers with higher precedence, configured qualifiers are:\n"
"{listing}\n"
"The sub command 'bump-to-release' may be used for a final bump.")
.format(
listing='\n'.join(' - ' + repr(qualifier) for qualifier in version_config.qualifiers))
)
else:
result.error(os.EX_DATAERR,
_("Failed to increment the pre-release qualifier of version {version}.")
.format(version=version),
_("Pre-release increments cannot be performed on release versions."))
if not result.has_errors() and new_qualifier is not None:
result.value = semver.format_version(
version_info.major,
version_info.minor,
version_info.patch,
new_qualifier + ".1",
None)
return result
def <API key>(version_config: VersionConfig, version: Optional[str], global_seq: Optional[int]):
result = Result()
version_info = semver.parse_version_info(version) if version is not None else semver.parse_version_info("0.0.0")
if version_info.prerelease:
<API key> = version_info.prerelease.split(".")
if len(<API key>) > 0 and <API key>[0].upper() == "SNAPSHOT":
if len(<API key>) == 1:
result.error(os.EX_DATAERR,
_("The pre-release increment has been skipped."),
_("In order to retain Maven compatibility, "
"the pre-release component of snapshot versions must not be versioned."))
else:
result.error(os.EX_DATAERR,
_("Failed to increment the pre-release component of version {version}.")
.format(version=repr(version)),
_("Snapshot versions must not have a pre-release version."))
result.value = version
elif len(<API key>) == 1:
if version_config.versioning_scheme != VersioningScheme.SEMVER_WITH_SEQ:
result.error(os.EX_DATAERR,
_("Failed to increment the pre-release component of version {version}.")
.format(version=repr(version)),
_("The qualifier {qualifier} must already be versioned.")
.format(qualifier=repr(<API key>[0]))
)
result.value = semver.bump_prerelease(version)
else:
result.error(os.EX_DATAERR,
_("Failed to increment the pre-release component of version {version}.")
.format(version=repr(version)),
_("Pre-release increments cannot be performed on release versions.")
)
if result.has_errors():
result.value = None
elif result.value is not None and not semver.compare(result.value, version) > 0:
result.value = None
if not result.value:
result.error(os.EX_SOFTWARE,
_("Failed to increment the pre-release of version {version} for unknown reasons.")
.format(version=repr(version)),
None)
return result
def <API key>(version_config: VersionConfig, version: Optional[str], global_seq: Optional[int]):
result = Result()
version_info = semver.parse_version_info(version) if version is not None else semver.parse_version_info("0.0.0")
if version_config.versioning_scheme == VersioningScheme.SEMVER_WITH_SEQ:
result.error(os.EX_USAGE,
_("Failed to increment version to release: {version}.")
.format(version=repr(version)),
_("Sequential versions cannot be release versions."))
return result
if not version_info.prerelease:
result.error(os.EX_DATAERR,
_("Failed to increment version to release: {version}.")
.format(version=repr(version)),
_("Only pre-release versions can be incremented to a release version."))
if not result.has_errors():
result.value = semver.format_version(
version_info.major,
version_info.minor,
version_info.patch,
None,
None)
return result
class VersionSet(object):
__new_version = None
def __init__(self, new_version):
self.__new_version = new_version
def __call__(self, version_config: VersionConfig, old_version: Optional[str], global_seq: Optional[int]):
result = Result()
result.add_subresult(version.validate_version(version_config, self.__new_version))
result.value = self.__new_version
return result
def get_sequence_number(version_config: VersionConfig, new_version_info: semver.VersionInfo):
if version_config.versioning_scheme == VersioningScheme.SEMVER_WITH_SEQ:
return int(new_version_info.prerelease)
else:
return None |
#include <iostream>
#include "solution.h"
int main()
{
Solution s;
vector<int> num = { -2,1,-3,4,-1,2,1,-5,4 };
cout << s.maxSubArray(num);
system("pause");
return 0;
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>bignums: 2 m 29 s </title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / extra-dev</a></li>
<li class="active"><a href="">8.10.0 / bignums - 8.10+beta1</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
bignums
<small>
8.10+beta1
<span class="label label-success">2 m 29 s </span>
</small>
</h1>
<p> <em><script>document.write(moment("2020-07-31 23:28:00 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-31 23:28:00 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.10.0 Formal proof management system
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Laurent.Thery@inria.fr"
homepage: "https://github.com/coq/bignums"
dev-repo: "git+https://github.com/coq/bignums.git"
bug-reports: "https://github.com/coq/bignums/issues"
authors: [
"Laurent Théry"
"Benjamin Grégoire"
"Arnaud Spiwack"
"Evgeny Makarov"
"Pierre Letouzey"
]
license: "LGPL-2.1-only"
build: [
[make "-j%{jobs}%" {ocaml:version >= "4.06"}]
]
install: [
[make "install"]
]
depends: [
"ocaml"
"coq" {>= "8.10" & < "8.11~"}
]
tags: [
"keyword:integer numbers"
"keyword:rational numbers"
"keyword:arithmetic"
"keyword:arbitrary-precision"
"category:Miscellaneous/Coq Extensions"
"category:Mathematics/Arithmetic and Number Theory/Number theory"
"category:Mathematics/Arithmetic and Number Theory/Rational numbers"
"logpath:Bignums"
]
synopsis: "Bignums, the Coq library of arbitrary large numbers"
description:
"Provides BigN, BigZ, BigQ that used to be part of Coq standard library < 8.7."
url {
src: "https://github.com/coq/bignums/archive/V8.10+beta1.tar.gz"
checksum: "md5=<API key>"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install </h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-bignums.8.10+beta1 coq.8.10.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 2h opam install -y --deps-only coq-bignums.8.10+beta1 coq.8.10.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>6 s</dd>
</dl>
<h2>Install </h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 2h opam install -y coq-bignums.8.10+beta1 coq.8.10.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>2 m 29 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 10 M</p>
<ul>
<li>899 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/BigN.vo</code></li>
<li>788 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDiv.vo</code></li>
<li>715 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSqrt.vo</code></li>
<li>564 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/NMake.vo</code></li>
<li>554 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDiv.glob</code></li>
<li>535 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigZ/BigZ.vo</code></li>
<li>372 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleMul.vo</code></li>
<li>346 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSqrt.glob</code></li>
<li>317 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigQ/QMake.vo</code></li>
<li>300 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDivn1.vo</code></li>
<li>289 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/NMake_gen.vo</code></li>
<li>286 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleLift.vo</code></li>
<li>274 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleCyclic.vo</code></li>
<li>264 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/NMake.glob</code></li>
<li>201 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDivn1.glob</code></li>
<li>198 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleCyclic.glob</code></li>
<li>197 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/NMake_gen.glob</code></li>
<li>186 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSigNAxioms.vo</code></li>
<li>185 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigZ/ZMake.vo</code></li>
<li>185 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSigZAxioms.vo</code></li>
<li>182 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleMul.glob</code></li>
<li>168 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigQ/BigQ.vo</code></li>
<li>152 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleLift.glob</code></li>
<li>145 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigQ/QMake.glob</code></li>
<li>124 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigNumPrelude.vo</code></li>
<li>118 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaQ/QSig.vo</code></li>
<li>116 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigZ/ZMake.glob</code></li>
<li>109 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/Nbasic.vo</code></li>
<li>104 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSub.vo</code></li>
<li>99 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleBase.vo</code></li>
<li>88 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleAdd.vo</code></li>
<li>88 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSub.glob</code></li>
<li>74 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleBase.glob</code></li>
<li>72 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleAdd.glob</code></li>
<li>70 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/Nbasic.glob</code></li>
<li>68 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigNumPrelude.glob</code></li>
<li>63 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/<API key>.cmxs</code></li>
<li>62 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSigNAxioms.glob</code></li>
<li>62 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSigZAxioms.glob</code></li>
<li>56 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSig.vo</code></li>
<li>55 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDiv.v</code></li>
<li>52 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/NMake.v</code></li>
<li>52 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSig.vo</code></li>
<li>48 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSqrt.v</code></li>
<li>37 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaQ/QSig.glob</code></li>
<li>35 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSig.glob</code></li>
<li>35 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigQ/QMake.v</code></li>
<li>33 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/NMake_gen.v</code></li>
<li>31 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSig.glob</code></li>
<li>28 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleCyclic.v</code></li>
<li>24 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleMul.v</code></li>
<li>21 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigZ/ZMake.v</code></li>
<li>20 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDivn1.v</code></li>
<li>19 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleLift.v</code></li>
<li>16 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/Nbasic.v</code></li>
<li>16 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigZ/BigZ.glob</code></li>
<li>13 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/BigN.glob</code></li>
<li>13 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleBase.v</code></li>
<li>13 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigNumPrelude.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSub.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSigZAxioms.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigQ/BigQ.glob</code></li>
<li>12 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSigNAxioms.v</code></li>
<li>11 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleAdd.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/<API key>.cmi</code></li>
<li>8 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/<API key>.cmx</code></li>
<li>7 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaQ/QSig.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigZ/BigZ.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigN/BigN.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSig.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/BigQ/BigQ.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSig.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bignums/<API key>.cmxa</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-bignums.8.10+beta1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https:
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html> |
#include <stdlib.h>
#include <string.h>
#ifdef USE_MEMTRACK
#include <memtrack.h>
#endif
#include "base/memory_blocks_pool.h"
struct MemoryBlocksPool {
void *blocks;
int *ids;
size_t blocks_count;
size_t block_size;
size_t blocks_num;
};
#define GET_INDEX(id) ((id) >> 16)
#define GET_ID(id) ((id) & 0xffff)
#define MAKE_ID(id, index) ((id << 16) + (index))
#define MEM_BLOCK_AT_POOL(pool, index) ((char *) ((pool)->blocks) + (index) * ((pool)->block_size))
extern MEMORY_BLOCKS_POOL*
<API key>(size_t block_size, size_t blocks_num) {
MEMORY_BLOCKS_POOL *pool = malloc(sizeof(MEMORY_BLOCKS_POOL));
pool->block_size = block_size;
pool->blocks_num = blocks_num;
pool->blocks_count = 0;
pool->blocks = malloc(block_size * blocks_num);
pool->ids = malloc(sizeof(int) * blocks_num);
return pool;
}
extern void
<API key>(MEMORY_BLOCKS_POOL *pool) {
free(pool->blocks);
pool->blocks = NULL;
free(pool->ids);
pool->ids = NULL;
free(pool);
}
extern size_t
<API key>(MEMORY_BLOCKS_POOL *pool) {
return pool->blocks_count;
}
extern int
<API key>(const MEMORY_BLOCKS_POOL *pool, int id) {
int real_id = GET_ID(id);
int index = GET_INDEX(id);
if (pool->ids[index] == real_id)
return index;
return -1;
}
extern void *
<API key>(const MEMORY_BLOCKS_POOL *pool, int id) {
int index = <API key>(pool, id);
if (index != -1)
return MEM_BLOCK_AT_POOL(pool, index);
return NULL;
}
extern void *
<API key>(const MEMORY_BLOCKS_POOL *pool, int index) {
return MEM_BLOCK_AT_POOL(pool, index);
}
extern int
<API key>(MEMORY_BLOCKS_POOL *pool, void *value) {
static int object_id = 0;
int index = pool->blocks_count;
memcpy(MEM_BLOCK_AT_POOL(pool, index), value, pool->block_size);
pool->blocks_count++;
int id = object_id++; // TODO: make thread safe
pool->ids[index] = id;
return MAKE_ID(id, index);
}
extern void
<API key>(MEMORY_BLOCKS_POOL *pool, int id) {
int index = <API key>(pool, id);
if (index == -1)
return;
memcpy(MEM_BLOCK_AT_POOL(pool, index), MEM_BLOCK_AT_POOL(pool, pool->blocks_count - 1), pool->block_size);
pool->ids[index] = pool->ids[pool->blocks_count - 1];
pool->blocks_count
}
/*void
MBP_test(void) {
int values[] = {10, 20, 30, 40, 50};
MEMORY_BLOCKS_POOL *pool;
int id;
pool = <API key>(sizeof(int), countof(values));
for (size_t i = 0; i < countof(values); i++) {
int o = <API key>(pool, &values[i]);
if (i == 2)
id = o;
}
for (int i = 0; i < MBP_size(pool); i++)
printf("%d\n", *((int*)MBP_block_at(pool, i)));
int v = -1;
if (<API key>(pool, id))
v = *((int*)<API key>(pool, id));
printf("ID %#x VALUE=%d\n", id, v);
<API key>(pool, id);
for (int i = 0; i < MBP_size(pool); i++)
printf("%d\n", *((int*)MBP_block_at(pool, i)));
v = -1;
if (<API key>(pool, id))
v = *((int*)<API key>(pool, id));
printf("ID %#x VALUE=%d\n", id, v);
<API key>(pool);
exit(0);
}*/ |
package com.falconi.lisandro.cyclingroutes;
import android.app.Application;
import android.test.ApplicationTestCase;
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} |
INSERT INTO Events VALUES(
NULL,
'hoge',
'xxxx',
'TEST',
'2015-05-05',
'Hello, world!',
'2015-04-20'
);
INSERT INTO Events VALUES(
NULL,
'foo',
'xxxx',
'BIRTHDAY',
'2015-11-11',
'Happy birth day!',
'2015-04-21'
); |
<?php
namespace axelitus\Patterns\Creational;
use axelitus\Base\Exceptions;
use axelitus\Patterns\Interfaces;
use axelitus\Patterns\Utils;
/**
* Class Singleton
*
* Defines a Singleton object.
*
* @package axelitus\Patterns\Creational
*/
abstract class Singleton
{
/**
* @type array $instances Holds the Singleton instances array map (as the static var is shared amongst all derivable classes).
*/
protected static $instances = [];
/**
* @type array $cache Holds cache information about the classes.
*/
protected static $cache = [];
/**
* Prevents this class from being directly instantiated but allows sub classes to define the needed constructor logic.
*/
protected function __construct()
{
}
/**
* Gets the current Singleton instance.
*
* Automatically creates an instance if non exists. If one instance already exists, the argument list is ignored.
*
* @param mixed $args,... The arguments for creating the Singleton instance.
*
* @return Singleton The Singleton instance.
*/
public static function instance()
{
$class = get_called_class();
if (!array_key_exists($class, static::$instances)) {
if (!array_key_exists($class, static::$cache)) {
static::$cache[$class]['forgeable'] = Utils::class_implements(
$class,
'axelitus\Patterns\Interfaces\Forgeable'
);
}
$args = func_get_args();
if (static::$cache[$class]['forgeable']) {
static::$instances[$class] = <API key>([$class, 'forge'], $args);
} else {
$ref = new \ReflectionClass($class);
$ctor = $ref->getConstructor();
$ctor->setAccessible(true);
static::$instances[$class] = $ref-><API key>();
$ctor->invokeArgs(static::$instances[$class], $args);
}
}
return static::$instances[$class];
}
/**
* Removes the current Singleton instance.
*/
public static function remove()
{
$class = get_called_class();
unset(static::$instances[$class]);
}
/**
* Renews the Singleton instance.
*
* It automatically disposes the previously existing instance and creates a new one.
*
* @param mixed $args,... The arguments for creating the Singleton instance.
*
* @return Singleton The new Singleton instance.
*/
public static function renew()
{
$class = get_called_class();
$args = func_get_args();
static::remove();
return <API key>([$class, 'instance'], $args);
}
/**
* No serialization allowed
*
* @final
* @throws Exceptions\<API key>
*/
final public function __sleep()
{
throw new Exceptions\<API key>("No serialization allowed.", E_USER_ERROR);
}
/**
* No unserialization allowed
*
* @final
* @throws Exceptions\<API key>
*/
final public function __wakeup()
{
throw new Exceptions\<API key>("No unserialization allowed.", E_USER_ERROR);
}
/**
* No cloning allowed
*
* @final
* @throws Exceptions\<API key>
*/
final public function __clone()
{
throw new Exceptions\<API key>("No cloning allowed.", E_USER_ERROR);
}
} |
<?php
namespace Tests;
use Tests\Objects\User;
use Tests\Objects\Post;
use AccessControl\Enum\Role;
use AccessControl\Provider;
use AccessControl\Component\Group;
class TestCase extends \<API key>
{
private $user;
private $posts = array();
/** @var Provider */
private $acl;
public function setUp()
{
$this->user = new User('Test', 1, Role::ROLE_USER);
$perms_1 = array('edit.record'=>1);
$perms_2 = array('delete.record'=>1);
$group_1 = Group::<API key>($perms_1);
$group_2 = Group::<API key>($perms_2);
$this->user->addGroup($group_1);
$this->user->addGroup($group_2);
$this->posts['valid'] = new Post('valid', 1);
$this->posts['invalid'] = new Post('invalid', 2);
$this->acl = Provider::createForUser($this->user);
}
public function testGroup()
{
$can_edit = $this->acl->userCan('edit.record');
$this->assertEquals($can_edit, true, "userCan(edit.record)");
$can_publish = $this->acl->userCan('publish.record');
$this->assertEquals($can_publish, false, "userCan(publish.record)");
$can_delete = $this->acl->userCan('delete.record');
$this->assertEquals($can_delete, true, "userCan(delete.record)");
}
public function testOwner()
{
$is_owner = $this->acl->ownerValidFor($this->posts['valid']);
$this->assertEquals($is_owner, true, "ownerValidFor(this->posts['valid'])");
$is_not_owner = $this->acl->ownerValidFor($this->posts['invalid']);
$this->assertEquals($is_not_owner, false, "ownerValidFor(this->posts['invalid'])");
}
public function testRole()
{
$role_match = $this->acl->roleMatch(Role::ROLE_VISITOR);
$this->assertEquals($role_match, true, "roleMatch(Role::ROLE_VISITOR)");
$role_match = $this->acl->roleMatch(Role::ROLE_USER);
$this->assertEquals($role_match, true, "roleMatch(Role::ROLE_USER)");
$role_not_match = $this->acl->roleMatch(Role::ROLE_ROOT);
$this->assertEquals($role_not_match, false, "roleMatch(Role::ROLE_ROOT)");
}
}
// > END TestCase < |
/* ftdbgmem.c */
/* Memory debugger (body). */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* understand and accept it fully. */
#include <ft2build.h>
#include FT_CONFIG_CONFIG_H
#include FT_INTERNAL_DEBUG_H
#include <API key>
#include FT_SYSTEM_H
#include FT_ERRORS_H
#include FT_TYPES_H
#ifdef FT_DEBUG_MEMORY
#define KEEPALIVE /* `Keep alive' means that freed blocks aren't released
* to the heap. This is useful to detect double-frees
* or weird heap corruption, but it uses large amounts of
* memory, however.
*/
#include <API key>
FT_BASE_DEF( const char* ) _ft_debug_file = 0;
FT_BASE_DEF( long ) _ft_debug_lineno = 0;
extern void
FT_DumpMemory( FT_Memory memory );
typedef struct FT_MemSourceRec_* FT_MemSource;
typedef struct FT_MemNodeRec_* FT_MemNode;
typedef struct FT_MemTableRec_* FT_MemTable;
#define FT_MEM_VAL( addr ) ((FT_PtrDist)(FT_Pointer)( addr ))
/*
* This structure holds statistics for a single allocation/release
* site. This is useful to know where memory operations happen the
* most.
*/
typedef struct FT_MemSourceRec_
{
const char* file_name;
long line_no;
FT_Long cur_blocks; /* current number of allocated blocks */
FT_Long max_blocks; /* max. number of allocated blocks */
FT_Long all_blocks; /* total number of blocks allocated */
FT_Long cur_size; /* current cumulative allocated size */
FT_Long max_size; /* maximum cumulative allocated size */
FT_Long all_size; /* total cumulative allocated size */
FT_Long cur_max; /* current maximum allocated size */
FT_UInt32 hash;
FT_MemSource link;
} FT_MemSourceRec;
/*
* We don't need a resizable array for the memory sources, because
* their number is pretty limited within FreeType.
*/
#define <API key> 128
/*
* This structure holds information related to a single allocated
* memory block. If KEEPALIVE is defined, blocks that are freed by
* FreeType are never released to the system. Instead, their `size'
* field is set to -size. This is mainly useful to detect double frees,
* at the price of large memory footprint during execution.
*/
typedef struct FT_MemNodeRec_
{
FT_Byte* address;
FT_Long size; /* < 0 if the block was freed */
FT_MemSource source;
#ifdef KEEPALIVE
const char* free_file_name;
FT_Long free_line_no;
#endif
FT_MemNode link;
} FT_MemNodeRec;
/*
* The global structure, containing compound statistics and all hash
* tables.
*/
typedef struct FT_MemTableRec_
{
FT_ULong size;
FT_ULong nodes;
FT_MemNode* buckets;
FT_ULong alloc_total;
FT_ULong alloc_current;
FT_ULong alloc_max;
FT_ULong alloc_count;
FT_Bool bound_total;
FT_ULong alloc_total_max;
FT_Bool bound_count;
FT_ULong alloc_count_max;
FT_MemSource sources[<API key>];
FT_Bool keep_alive;
FT_Memory memory;
FT_Pointer memory_user;
FT_Alloc_Func alloc;
FT_Free_Func free;
FT_Realloc_Func realloc;
} FT_MemTableRec;
#define FT_MEM_SIZE_MIN 7
#define FT_MEM_SIZE_MAX 13845163
#define FT_FILENAME( x ) ((x) ? (x) : "unknown file")
/*
* Prime numbers are ugly to handle. It would be better to implement
* L-Hashing, which is 10% faster and doesn't require divisions.
*/
static const FT_UInt ft_mem_primes[] =
{
7,
11,
19,
37,
73,
109,
163,
251,
367,
557,
823,
1237,
1861,
2777,
4177,
6247,
9371,
14057,
21089,
31627,
47431,
71143,
106721,
160073,
240101,
360163,
540217,
810343,
1215497,
1823231,
2734867,
4102283,
6153409,
9230113,
13845163,
};
static FT_ULong
<API key>( FT_ULong num )
{
FT_UInt project_obj222id;
for ( project_obj222id = 0;
project_obj222id < sizeof ( ft_mem_primes ) / sizeof ( ft_mem_primes[0] ); project_obj222id++ )
if ( ft_mem_primes[project_obj222id] > num )
return ft_mem_primes[project_obj222id];
return FT_MEM_SIZE_MAX;
}
extern void
ft_mem_debug_panic( const char* fmt,
)
{
va_list ap;
printf( "FreeType.Debug: " );
va_start( ap, fmt );
vprintf( fmt, ap );
va_end( ap );
printf( "\n" );
exit( EXIT_FAILURE );
}
static FT_Pointer
ft_mem_table_alloc( FT_MemTable table,
FT_Long size )
{
FT_Memory memory = table->memory;
FT_Pointer block;
memory->user = table->memory_user;
block = table->alloc( memory, size );
memory->user = table;
return block;
}
static void
ft_mem_table_free( FT_MemTable table,
FT_Pointer block )
{
FT_Memory memory = table->memory;
memory->user = table->memory_user;
table->free( memory, block );
memory->user = table;
}
static void
ft_mem_table_resize( FT_MemTable table )
{
FT_ULong new_size;
new_size = <API key>( table->nodes );
if ( new_size != table->size )
{
FT_MemNode* new_buckets;
FT_ULong project_obj222id;
new_buckets = (FT_MemNode *)
ft_mem_table_alloc( table,
new_size * sizeof ( FT_MemNode ) );
if ( new_buckets == NULL )
return;
FT_ARRAY_ZERO( new_buckets, new_size );
for ( project_obj222id = 0; project_obj222id < table->size; project_obj222id++ )
{
FT_MemNode node, next, *pnode;
FT_PtrDist hash;
node = table->buckets[project_obj222id];
while ( node )
{
next = node->link;
hash = FT_MEM_VAL( node->address ) % new_size;
pnode = new_buckets + hash;
node->link = pnode[0];
pnode[0] = node;
node = next;
}
}
if ( table->buckets )
ft_mem_table_free( table, table->buckets );
table->buckets = new_buckets;
table->size = new_size;
}
}
static FT_MemTable
ft_mem_table_new( FT_Memory memory )
{
FT_MemTable table;
table = (FT_MemTable)memory->alloc( memory, sizeof ( *table ) );
if ( table == NULL )
goto Exit;
FT_ZERO( table );
table->size = FT_MEM_SIZE_MIN;
table->nodes = 0;
table->memory = memory;
table->memory_user = memory->user;
table->alloc = memory->alloc;
table->realloc = memory->realloc;
table->free = memory->free;
table->buckets = (FT_MemNode *)
memory->alloc( memory,
table->size * sizeof ( FT_MemNode ) );
if ( table->buckets )
FT_ARRAY_ZERO( table->buckets, table->size );
else
{
memory->free( memory, table );
table = NULL;
}
Exit:
return table;
}
static void
<API key>( FT_MemTable table )
{
FT_ULong project_obj222id;
FT_Long leak_count = 0;
FT_ULong leaks = 0;
FT_DumpMemory( table->memory );
/* remove all blocks from the table, revealing leaked ones */
for ( project_obj222id = 0; project_obj222id < table->size; project_obj222id++ )
{
FT_MemNode *pnode = table->buckets + project_obj222id, next, node = *pnode;
while ( node )
{
next = node->link;
node->link = 0;
if ( node->size > 0 )
{
printf(
"leaked memory block at address %p, size %8ld in (%s:%ld)\n",
node->address, node->size,
FT_FILENAME( node->source->file_name ),
node->source->line_no );
leak_count++;
leaks += node->size;
ft_mem_table_free( table, node->address );
}
node->address = NULL;
node->size = 0;
ft_mem_table_free( table, node );
node = next;
}
table->buckets[project_obj222id] = 0;
}
ft_mem_table_free( table, table->buckets );
table->buckets = NULL;
table->size = 0;
table->nodes = 0;
/* remove all sources */
for ( project_obj222id = 0; project_obj222id < <API key>; project_obj222id++ )
{
FT_MemSource source, next;
for ( source = table->sources[project_obj222id]; source != NULL; source = next )
{
next = source->link;
ft_mem_table_free( table, source );
}
table->sources[project_obj222id] = NULL;
}
printf( "FreeType: total memory allocations = %ld\n",
table->alloc_total );
printf( "FreeType: maximum memory footprint = %ld\n",
table->alloc_max );
ft_mem_table_free( table, table );
if ( leak_count > 0 )
ft_mem_debug_panic(
"FreeType: %ld bytes of memory leaked in %ld blocks\n",
leaks, leak_count );
printf( "FreeType: no memory leaks detected\n" );
}
static FT_MemNode*
<API key>( FT_MemTable table,
FT_Byte* address )
{
FT_PtrDist hash;
FT_MemNode *pnode, node;
hash = FT_MEM_VAL( address );
pnode = table->buckets + ( hash % table->size );
for (;;)
{
node = pnode[0];
if ( !node )
break;
if ( node->address == address )
break;
pnode = &node->link;
}
return pnode;
}
static FT_MemSource
<API key>( FT_MemTable table )
{
FT_UInt32 hash;
FT_MemSource node, *pnode;
/* cast to FT_PtrDist first since void* can be larger */
/* than FT_UInt32 and GCC 4.1.1 emits a warning */
hash = (FT_UInt32)(FT_PtrDist)(void*)_ft_debug_file +
(FT_UInt32)( 5 * _ft_debug_lineno );
pnode = &table->sources[hash % <API key>];
for ( ;; )
{
node = *pnode;
if ( node == NULL )
break;
if ( node->file_name == _ft_debug_file &&
node->line_no == _ft_debug_lineno )
goto Exit;
pnode = &node->link;
}
node = (FT_MemSource)ft_mem_table_alloc( table, sizeof ( *node ) );
if ( node == NULL )
ft_mem_debug_panic(
"not enough memory to perform memory debugging\n" );
node->file_name = _ft_debug_file;
node->line_no = _ft_debug_lineno;
node->cur_blocks = 0;
node->max_blocks = 0;
node->all_blocks = 0;
node->cur_size = 0;
node->max_size = 0;
node->all_size = 0;
node->cur_max = 0;
node->link = NULL;
node->hash = hash;
*pnode = node;
Exit:
return node;
}
static void
ft_mem_table_set( FT_MemTable table,
FT_Byte* address,
FT_ULong size,
FT_Long delta )
{
FT_MemNode *pnode, node;
if ( table )
{
FT_MemSource source;
pnode = <API key>( table, address );
node = *pnode;
if ( node )
{
if ( node->size < 0 )
{
/* This block was already freed. Our memory is now completely */
/* corrupted! */
/* This can only happen in keep-alive mode. */
ft_mem_debug_panic(
"memory heap corrupted (allocating freed block)" );
}
else
{
/* This block was already allocated. This means that our memory */
/* is also corrupted! */
ft_mem_debug_panic(
"memory heap corrupted (re-allocating allocated block at"
" %p, of size %ld)\n"
"org=%s:%d new=%s:%d\n",
node->address, node->size,
FT_FILENAME( node->source->file_name ), node->source->line_no,
FT_FILENAME( _ft_debug_file ), _ft_debug_lineno );
}
}
/* we need to create a new node in this table */
node = (FT_MemNode)ft_mem_table_alloc( table, sizeof ( *node ) );
if ( node == NULL )
ft_mem_debug_panic( "not enough memory to run memory tests" );
node->address = address;
node->size = size;
node->source = source = <API key>( table );
if ( delta == 0 )
{
/* this is an allocation */
source->all_blocks++;
source->cur_blocks++;
if ( source->cur_blocks > source->max_blocks )
source->max_blocks = source->cur_blocks;
}
if ( size > (FT_ULong)source->cur_max )
source->cur_max = size;
if ( delta != 0 )
{
/* we are growing or shrinking a reallocated block */
source->cur_size += delta;
table->alloc_current += delta;
}
else
{
/* we are allocating a new block */
source->cur_size += size;
table->alloc_current += size;
}
source->all_size += size;
if ( source->cur_size > source->max_size )
source->max_size = source->cur_size;
node->free_file_name = NULL;
node->free_line_no = 0;
node->link = pnode[0];
pnode[0] = node;
table->nodes++;
table->alloc_total += size;
if ( table->alloc_current > table->alloc_max )
table->alloc_max = table->alloc_current;
if ( table->nodes * 3 < table->size ||
table->size * 3 < table->nodes )
ft_mem_table_resize( table );
}
}
static void
ft_mem_table_remove( FT_MemTable table,
FT_Byte* address,
FT_Long delta )
{
if ( table )
{
FT_MemNode *pnode, node;
pnode = <API key>( table, address );
node = *pnode;
if ( node )
{
FT_MemSource source;
if ( node->size < 0 )
ft_mem_debug_panic(
"freeing memory block at %p more than once at (%s:%ld)\n"
"block allocated at (%s:%ld) and released at (%s:%ld)",
address,
FT_FILENAME( _ft_debug_file ), _ft_debug_lineno,
FT_FILENAME( node->source->file_name ), node->source->line_no,
FT_FILENAME( node->free_file_name ), node->free_line_no );
/* scramble the node's content for additional safety */
FT_MEM_SET( address, 0xF3, node->size );
if ( delta == 0 )
{
source = node->source;
source->cur_blocks
source->cur_size -= node->size;
table->alloc_current -= node->size;
}
if ( table->keep_alive )
{
/* we simply invert the node's size to indicate that the node */
/* was freed. */
node->size = -node->size;
node->free_file_name = _ft_debug_file;
node->free_line_no = _ft_debug_lineno;
}
else
{
table->nodes
*pnode = node->link;
node->size = 0;
node->source = NULL;
ft_mem_table_free( table, node );
if ( table->nodes * 3 < table->size ||
table->size * 3 < table->nodes )
ft_mem_table_resize( table );
}
}
else
ft_mem_debug_panic(
"trying to free unknown block at %p in (%s:%ld)\n",
address,
FT_FILENAME( _ft_debug_file ), _ft_debug_lineno );
}
}
extern FT_Pointer
ft_mem_debug_alloc( FT_Memory memory,
FT_Long size )
{
FT_MemTable table = (FT_MemTable)memory->user;
FT_Byte* block;
if ( size <= 0 )
ft_mem_debug_panic( "negative block size allocation (%ld)", size );
/* return NULL if the maximum number of allocations was reached */
if ( table->bound_count &&
table->alloc_count >= table->alloc_count_max )
return NULL;
/* return NULL if this allocation would overflow the maximum heap size */
if ( table->bound_total &&
table->alloc_total_max - table->alloc_current > (FT_ULong)size )
return NULL;
block = (FT_Byte *)ft_mem_table_alloc( table, size );
if ( block )
{
ft_mem_table_set( table, block, (FT_ULong)size, 0 );
table->alloc_count++;
}
_ft_debug_file = "<unknown>";
_ft_debug_lineno = 0;
return (FT_Pointer)block;
}
extern void
ft_mem_debug_free( FT_Memory memory,
FT_Pointer block )
{
FT_MemTable table = (FT_MemTable)memory->user;
if ( block == NULL )
ft_mem_debug_panic( "trying to free NULL in (%s:%ld)",
FT_FILENAME( _ft_debug_file ),
_ft_debug_lineno );
ft_mem_table_remove( table, (FT_Byte*)block, 0 );
if ( !table->keep_alive )
ft_mem_table_free( table, block );
table->alloc_count
_ft_debug_file = "<unknown>";
_ft_debug_lineno = 0;
}
extern FT_Pointer
<API key>( FT_Memory memory,
FT_Long cur_size,
FT_Long new_size,
FT_Pointer block )
{
FT_MemTable table = (FT_MemTable)memory->user;
FT_MemNode node, *pnode;
FT_Pointer new_block;
FT_Long delta;
const char* file_name = FT_FILENAME( _ft_debug_file );
FT_Long line_no = _ft_debug_lineno;
/* unlikely, but possible */
if ( new_size == cur_size )
return block;
/* the following is valid according to ANSI C */
#if 0
if ( block == NULL || cur_size == 0 )
ft_mem_debug_panic( "trying to reallocate NULL in (%s:%ld)",
file_name, line_no );
#endif
/* while the following is allowed in ANSI C also, we abort since */
/* such case should be handled by FreeType. */
if ( new_size <= 0 )
ft_mem_debug_panic(
"trying to reallocate %p to size 0 (current is %ld) in (%s:%ld)",
block, cur_size, file_name, line_no );
/* check `cur_size' value */
pnode = <API key>( table, (FT_Byte*)block );
node = *pnode;
if ( !node )
ft_mem_debug_panic(
"trying to reallocate unknown block at %p in (%s:%ld)",
block, file_name, line_no );
if ( node->size <= 0 )
ft_mem_debug_panic(
"trying to reallocate freed block at %p in (%s:%ld)",
block, file_name, line_no );
if ( node->size != cur_size )
ft_mem_debug_panic( "invalid ft_realloc request for %p. cur_size is "
"%ld instead of %ld in (%s:%ld)",
block, cur_size, node->size, file_name, line_no );
/* return NULL if the maximum number of allocations was reached */
if ( table->bound_count &&
table->alloc_count >= table->alloc_count_max )
return NULL;
delta = (FT_Long)( new_size - cur_size );
/* return NULL if this allocation would overflow the maximum heap size */
if ( delta > 0 &&
table->bound_total &&
table->alloc_current + (FT_ULong)delta > table->alloc_total_max )
return NULL;
new_block = (FT_Byte *)ft_mem_table_alloc( table, new_size );
if ( new_block == NULL )
return NULL;
ft_mem_table_set( table, (FT_Byte*)new_block, new_size, delta );
ft_memcpy( new_block, block, cur_size < new_size ? cur_size : new_size );
ft_mem_table_remove( table, (FT_Byte*)block, delta );
_ft_debug_file = "<unknown>";
_ft_debug_lineno = 0;
if ( !table->keep_alive )
ft_mem_table_free( table, block );
return new_block;
}
extern FT_Int
ft_mem_debug_init( FT_Memory memory )
{
FT_MemTable table;
FT_Int result = 0;
if ( getenv( "FT2_DEBUG_MEMORY" ) )
{
table = ft_mem_table_new( memory );
if ( table )
{
const char* p;
memory->user = table;
memory->alloc = ft_mem_debug_alloc;
memory->realloc = <API key>;
memory->free = ft_mem_debug_free;
p = getenv( "FT2_ALLOC_TOTAL_MAX" );
if ( p != NULL )
{
FT_Long total_max = ft_atol( p );
if ( total_max > 0 )
{
table->bound_total = 1;
table->alloc_total_max = (FT_ULong)total_max;
}
}
p = getenv( "FT2_ALLOC_COUNT_MAX" );
if ( p != NULL )
{
FT_Long total_count = ft_atol( p );
if ( total_count > 0 )
{
table->bound_count = 1;
table->alloc_count_max = (FT_ULong)total_count;
}
}
p = getenv( "FT2_KEEP_ALIVE" );
if ( p != NULL )
{
FT_Long keep_alive = ft_atol( p );
if ( keep_alive > 0 )
table->keep_alive = 1;
}
result = 1;
}
}
return result;
}
extern void
ft_mem_debug_done( FT_Memory memory )
{
FT_MemTable table = (FT_MemTable)memory->user;
if ( table )
{
memory->free = table->free;
memory->realloc = table->realloc;
memory->alloc = table->alloc;
<API key>( table );
memory->user = NULL;
}
}
static int
<API key>( const void* p1,
const void* p2 )
{
FT_MemSource s1 = *(FT_MemSource*)p1;
FT_MemSource s2 = *(FT_MemSource*)p2;
if ( s2->max_size > s1->max_size )
return 1;
else if ( s2->max_size < s1->max_size )
return -1;
else
return 0;
}
extern void
FT_DumpMemory( FT_Memory memory )
{
FT_MemTable table = (FT_MemTable)memory->user;
if ( table )
{
FT_MemSource* bucket = table->sources;
FT_MemSource* limit = bucket + <API key>;
FT_MemSource* sources;
FT_UInt nn, count;
const char* fmt;
count = 0;
for ( ; bucket < limit; bucket++ )
{
FT_MemSource source = *bucket;
for ( ; source; source = source->link )
count++;
}
sources = (FT_MemSource*)ft_mem_table_alloc(
table, sizeof ( *sources ) * count );
count = 0;
for ( bucket = table->sources; bucket < limit; bucket++ )
{
FT_MemSource source = *bucket;
for ( ; source; source = source->link )
sources[count++] = source;
}
ft_qsort( sources, count, sizeof ( *sources ), <API key> );
printf( "FreeType Memory Dump: "
"current=%ld max=%ld total=%ld count=%ld\n",
table->alloc_current, table->alloc_max,
table->alloc_total, table->alloc_count );
printf( " block block sizes sizes sizes source\n" );
printf( " count high sum highsum max location\n" );
printf( "
fmt = "%6ld %6ld %8ld %8ld %8ld %s:%d\n";
for ( nn = 0; nn < count; nn++ )
{
FT_MemSource source = sources[nn];
printf( fmt,
source->cur_blocks, source->max_blocks,
source->cur_size, source->max_size, source->cur_max,
FT_FILENAME( source->file_name ),
source->line_no );
}
printf( "
ft_mem_table_free( table, sources );
}
}
#else /* !FT_DEBUG_MEMORY */
/* ANSI C doesn't like empty source files */
typedef int _debug_mem_dummy;
#endif /* !FT_DEBUG_MEMORY */
/* END */ |
'use strict';
System.register(['../common/widget-base', '../common/constants', '../common/decorators', '../common/common', '<API key>/Scripts/ej/datavisualization/ej.sunburstchart.min'], function (_export, _context) {
"use strict";
var WidgetBase, constants, generateBindables, inject, inlineView, customElement, children, _dec, _dec2, _dec3, _dec4, _dec5, _class, _desc, _value, _class2, _descriptor, ejSunburstChart;
function _initDefineProp(target, property, descriptor, context) {
if (!descriptor) return;
Object.defineProperty(target, property, {
enumerable: descriptor.enumerable,
configurable: descriptor.configurable,
writable: descriptor.writable,
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
});
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function <API key>(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}
function <API key>(target, property, decorators, descriptor, context) {
var desc = {};
Object['ke' + 'ys'](descriptor).forEach(function (key) {
desc[key] = descriptor[key];
});
desc.enumerable = !!desc.enumerable;
desc.configurable = !!desc.configurable;
if ('value' in desc || desc.initializer) {
desc.writable = true;
}
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
return decorator(target, property, desc) || desc;
}, desc);
if (context && desc.initializer !== void 0) {
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
desc.initializer = undefined;
}
if (desc.initializer === void 0) {
Object['define' + 'Property'](target, property, desc);
desc = null;
}
return desc;
}
function <API key>(descriptor, context) {
throw new Error('Decorating class property failed. Please ensure that <API key> is enabled.');
}
return {
setters: [function (_commonWidgetBase) {
WidgetBase = _commonWidgetBase.WidgetBase;
}, function (_commonConstants) {
constants = _commonConstants.constants;
}, function (_commonDecorators) {
generateBindables = _commonDecorators.generateBindables;
}, function (_commonCommon) {
inject = _commonCommon.inject;
inlineView = _commonCommon.inlineView;
customElement = _commonCommon.customElement;
children = _commonCommon.children;
}, function (<API key>) {}],
execute: function () {
_export('ejSunburstChart', ejSunburstChart = (_dec = customElement(constants.elementPrefix + 'sunburst-chart'), _dec2 = inlineView('' + constants.<API key>), _dec3 = generateBindables('ejSunburstChart', ['background', 'valueMemberPath', 'border', 'segmentBorder', 'dataSource', 'palette', 'parentNode', 'xName', 'yName', 'isResponsive', 'size', 'visible', 'tooltip', 'points', 'startAngle', 'endAngle', 'radius', 'innerRadius', 'dataLabelSettings', 'title', 'highlightSettings', 'selectionSettings', 'levels', 'legend', 'theme', 'margin', 'enableAnimation', 'opacity', 'zoomSettings', 'animationType']), _dec4 = inject(Element), _dec5 = children(constants.elementPrefix + 'sunburst-levels'), _dec(_class = _dec2(_class = _dec3(_class = _dec4(_class = (_class2 = function (_WidgetBase) {
_inherits(ejSunburstChart, _WidgetBase);
function ejSunburstChart(element) {
_classCallCheck(this, ejSunburstChart);
var _this = <API key>(this, _WidgetBase.call(this));
_initDefineProp(_this, 'levels', _descriptor, _this);
_this.element = element;
_this.hasChildProperty = true;
_this.childPropertyName = 'levels';
return _this;
}
return ejSunburstChart;
}(WidgetBase), (_descriptor = <API key>(_class2.prototype, 'levels', [_dec5], {
enumerable: true,
initializer: function initializer() {
return [];
}
})), _class2)) || _class) || _class) || _class) || _class));
_export('ejSunburstChart', ejSunburstChart);
}
};
}); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.