text
stringlengths
2
1.04M
meta
dict
<!DOCTYPE html> <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> <!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--> <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--> <head> <!-- Basic Page Needs ================================================== --> <meta charset="utf-8"> <title>Brian Zeligson | {% block page_title %}{% endblock %}</title> <meta name="description" content=""> <meta name="author" content=""> <!-- Mobile Specific Metas ================================================== --> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <!-- CSS ================================================== --> <link rel="stylesheet" href="/static/stylesheets/base.css"> <link rel="stylesheet" href="/static/stylesheets/skeleton.css"> <link rel="stylesheet" href="/static/stylesheets/layout.css"> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!-- Favicons ================================================== --> <link rel="shortcut icon" href="/static/images/favicon.ico"> <link rel="apple-touch-icon" href="/static/images/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="72x72" href="/static/images/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="114x114" href="/static/images/apple-touch-icon-114x114.png"> </head> <body> <!-- Primary Page Layout ================================================== --> <!-- Delete everything in this .container and get started on your own site! --> <div class="container" id="main"> <div class="sixteen columns"> <h1 class="remove-bottom" style="margin-top: 40px">{% block page_header %}{% endblock %}</h1> <hr /> </div> <div class="two columns" id="left"> &nbsp; </div> <div class="twelve columns" id="middle"> {% block content %} {% endblock %} </div> <div class="two columns" id="right"> &nbsp; </div> </div><!-- container --> <!-- JS ================================================== --> <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> <script src="/static/javascripts/tabs.js"></script> <!-- End Document ================================================== --> </body> </html>
{ "content_hash": "5f1b82b7b3eb6673d44bf30882f5f97f", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 97, "avg_line_length": 32.54666666666667, "alnum_prop": 0.5014338385907415, "repo_name": "beezee/GAE-Django-site", "id": "a5cd7da9c91e264d9d2d71dcb0f9be2599a0f235", "size": "2441", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/base.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "92725" }, { "name": "Python", "bytes": "4218425" } ], "symlink_target": "" }
LIBPE_NAMESPACE_BEGIN enum { DEFAULT_IO_MIN_BLOCK_SIZE = 16 * 1024, DEFAULT_IO_MAX_BLOCK_SIZE = 2 * 1024 * 1024, DEFAULT_IO_COUNT = 3, }; UINT64 s_nPELoaderMinBlockSize = 0; UINT64 s_nPELoaderMaxBlockSize = 0; void LIBPE_API SetPELoaderIOBlockSize(UINT64 nMinBlockSize, UINT64 nMaxBlockSize) { s_nPELoaderMinBlockSize = nMinBlockSize; s_nPELoaderMaxBlockSize = nMaxBlockSize; } UINT64 GetPreferredPELoaderIOBlockSize(UINT64 nFileSize) { UINT64 nMinBlockSize = (s_nPELoaderMaxBlockSize == 0) ? DEFAULT_IO_MIN_BLOCK_SIZE : s_nPELoaderMinBlockSize; UINT64 nMaxBlockSize = (s_nPELoaderMaxBlockSize == 0) ? DEFAULT_IO_MAX_BLOCK_SIZE : s_nPELoaderMaxBlockSize; UINT64 nBlockSize = nFileSize / DEFAULT_IO_COUNT; if(nBlockSize < nMinBlockSize) { return nBlockSize; } if(nBlockSize > nMaxBlockSize) { return nMaxBlockSize; } return (((nBlockSize & 0x3FFF) != 0) ? ((nBlockSize | 0x3FFF) + 1) : nBlockSize); } LIBPE_NAMESPACE_END
{ "content_hash": "13791720bcd29526ec0479906f345dac", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 112, "avg_line_length": 32.61290322580645, "alnum_prop": 0.7002967359050445, "repo_name": "r12f/libpe", "id": "e5bc7a21864913c7c4d81f6d37cb25872bbd163a", "size": "1032", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Source/LibPEConfig.cpp", "mode": "33261", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "3323" }, { "name": "C++", "bytes": "157524" } ], "symlink_target": "" }
// kube-version-change is a simple utility for converting a // kubernetes object into a different api version. package main import ( "bytes" "encoding/json" "io" "io/ioutil" "log" "os" "runtime" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" _ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta1" _ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta2" _ "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3" "github.com/ghodss/yaml" flag "github.com/spf13/pflag" ) var ( inputSource = flag.StringP("input", "i", "-", "Input source; '-' means stdin") outputDest = flag.StringP("output", "o", "-", "Output destination; '-' means stdout") rewrite = flag.StringP("rewrite", "r", "", "If nonempty, use this as both input and output.") outputVersion = flag.StringP("out-version", "v", "v1beta3", "Version to convert input to") ) // isYAML determines whether data is JSON or YAML formatted by seeing // if it will parse as json. func isYAML(data []byte) bool { var unused interface{} if err := json.Unmarshal(data, &unused); err != nil { return true } return false } func main() { runtime.GOMAXPROCS(runtime.NumCPU()) flag.Parse() if *rewrite != "" { *inputSource = *rewrite *outputDest = *rewrite } var in io.Reader if *inputSource == "-" { in = os.Stdin } else { f, err := os.Open(*inputSource) if err != nil { log.Fatalf("Couldn't open %q: %q", *inputSource, err) } defer f.Close() in = f } data, err := ioutil.ReadAll(in) if err != nil { log.Fatalf("Couldn't read from input: %q", err) } isYAML := isYAML(data) if isYAML { data, err = yaml.YAMLToJSON(data) if err != nil { log.Fatalf("Failed to convert YAML to JSON: %q", err) } } obj, err := api.Scheme.Decode(data) if err != nil { log.Fatalf("Couldn't decode input: %q", err) } outData, err := api.Scheme.EncodeToVersion(obj, *outputVersion) if err != nil { log.Fatalf("Failed to encode to version %q: %q", *outputVersion, err) } if isYAML { outData, err = yaml.JSONToYAML(outData) if err != nil { log.Fatalf("Failed to convert to YAML: %q", err) } } else if true { // TODO: figure out if input JSON was pretty. var buf bytes.Buffer err = json.Indent(&buf, outData, "", " ") if err != nil { log.Fatalf("Failed to indent JSON: %q", err) } outData = buf.Bytes() } var out io.Writer if *outputDest == "-" { out = os.Stdout } else { f, err := os.Create(*outputDest) if err != nil { log.Fatalf("Couldn't open %q: %q", *outputDest, err) } defer f.Close() out = f } if _, err = out.Write(outData); err != nil { log.Fatalf("Failed to write: %q", err) } }
{ "content_hash": "5c5b8d5d0015c1f3acb36dd959e64714", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 100, "avg_line_length": 23.269565217391303, "alnum_prop": 0.6420029895366218, "repo_name": "yichengq/kubernetes", "id": "db84e9d455a655d0729355e3e310875976f4d14c", "size": "3254", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "cmd/kube-version-change/version.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "4137" }, { "name": "Go", "bytes": "7140375" }, { "name": "HTML", "bytes": "8901" }, { "name": "Java", "bytes": "3411" }, { "name": "JavaScript", "bytes": "15474" }, { "name": "Makefile", "bytes": "7983" }, { "name": "Nginx", "bytes": "1013" }, { "name": "PHP", "bytes": "736" }, { "name": "Python", "bytes": "8416" }, { "name": "Ruby", "bytes": "2778" }, { "name": "Scheme", "bytes": "1112" }, { "name": "Shell", "bytes": "586590" } ], "symlink_target": "" }
import os import zipfile import shutil from tempfile import gettempdir from uuid import uuid4 from lagring import Asset, StorageException, AssetProcessingException class DirectoryAsset(Asset): """ Asset type to store directory assets. Source can be a directory or zip archive which is unpacked upon upload to the storage. """ def _get_temp_path(self): return os.path.join(gettempdir(), str(uuid4())) def _unzip(self, path, storage, meta): if zipfile.is_zipfile(path): temp_dir = self._get_temp_path() def cleanup(): shutil.rmtree(temp_dir) with zipfile.ZipFile(path, 'r') as z: z.extractall(temp_dir) temp_src = storage.asset_source_adapter(temp_dir) return temp_src, meta, cleanup else: raise AssetProcessingException('Valid zip-archive expected') def upload(self, storage, src, meta=None): if src.type == 'directory': return src, meta, None elif src.type == 'file': return self._unzip(src.path, storage, meta) elif src.type == 'stream': temp_path = self._get_temp_path() with open(temp_path, 'wb') as f: shutil.copyfileobj(src.stream, f) new_src, _, cleanup = self._unzip(temp_path, storage, meta) def cleanup2(): cleanup() os.remove(temp_path) return new_src, meta, cleanup2 else: raise StorageException('Unknown source type')
{ "content_hash": "36164ff917cef9601393d868f362be50", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 88, "avg_line_length": 31.6, "alnum_prop": 0.5854430379746836, "repo_name": "neoden/lagring", "id": "5640345344fbf8e8bfcf6eefb4be1bfed09a742b", "size": "1580", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lagring/assets/directory.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "32644" }, { "name": "Shell", "bytes": "20" } ], "symlink_target": "" }
package hr.fer.zemris.jcms.web.actions.data; import hr.fer.zemris.jcms.web.actions.data.support.IMessageLogger; /** * Podatkovna struktura za akciju {@link AdminAssessmentEdit}. * * @author marcupic * */ public class TransferUsersFromGroupData extends BaseGroup { private Long groupID; private Long sourceGroupID; private Long mpID; /** * Konstruktor. * @param messageLogger lokalizirane poruke */ public TransferUsersFromGroupData(IMessageLogger messageLogger) { super(messageLogger); } public Long getGroupID() { return groupID; } public void setGroupID(Long groupID) { this.groupID = groupID; } public Long getSourceGroupID() { return sourceGroupID; } public void setSourceGroupID(Long sourceGroupID) { this.sourceGroupID = sourceGroupID; } public Long getMpID() { return mpID; } public void setMpID(Long mpID) { this.mpID = mpID; } }
{ "content_hash": "caae244444907c66e65534ba15559977", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 66, "avg_line_length": 19.8, "alnum_prop": 0.734006734006734, "repo_name": "KarloKnezevic/Ferko", "id": "f63d0eda953dbad1df807affd6928efeda47fdf2", "size": "891", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/java/hr/fer/zemris/jcms/web/actions/data/TransferUsersFromGroupData.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php /** * PluginThematique form. * * @package ##PROJECT_NAME## * @subpackage filter * @author ##AUTHOR_NAME## * @version SVN: $Id: sfDoctrineFormFilterPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ */ abstract class PluginThematiqueFormFilter extends BaseThematiqueFormFilter { }
{ "content_hash": "9bc904f47590d5cb1a8996035ec4ef71", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 107, "avg_line_length": 24.307692307692307, "alnum_prop": 0.7120253164556962, "repo_name": "ornicar/dmOppPlugin", "id": "36f95bd2dd23928542dd0eab152175551b83b1b1", "size": "316", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/filter/doctrine/PluginThematiqueFormFilter.class.php", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "2800" }, { "name": "PHP", "bytes": "49217" } ], "symlink_target": "" }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE563_Unused_Variable__unused_value_int_02.c Label Definition File: CWE563_Unused_Variable__unused_value.label.xml Template File: sources-sinks-02.tmpl.c */ /* * @description * CWE: 563 Unused Variable * BadSource: Initialize data * GoodSource: Initialize and use data * Sinks: * GoodSink: Use data * BadSink : Initialize and use data * Flow Variant: 02 Control flow: if(1) and if(0) * * */ #include "std_testcase.h" #include <wchar.h> #ifndef OMITBAD void CWE563_Unused_Variable__unused_value_int_02_bad() { int data; if(1) { /* POTENTIAL FLAW: Initialize, but do not use data */ data = 5; } if(1) { /* POTENTIAL FLAW: Possibly over-write the initial value of data before using it */ data = 10; printIntLine(data); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodB2G1() - use badsource and goodsink by changing the second 1 to 0 */ static void goodB2G1() { int data; if(1) { /* POTENTIAL FLAW: Initialize, but do not use data */ data = 5; } if(0) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { /* FIX: Use data without over-writing its value */ printIntLine(data); } } /* goodB2G2() - use badsource and goodsink by reversing the blocks in the second if */ static void goodB2G2() { int data; if(1) { /* POTENTIAL FLAW: Initialize, but do not use data */ data = 5; } if(1) { /* FIX: Use data without over-writing its value */ printIntLine(data); } } /* goodG2B1() - use goodsource and badsink by changing the first 1 to 0 */ static void goodG2B1() { int data; if(0) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { /* FIX: Initialize and use data before it is overwritten */ data = 5; printIntLine(data); } if(1) { /* POTENTIAL FLAW: Possibly over-write the initial value of data before using it */ data = 10; printIntLine(data); } } /* goodG2B2() - use goodsource and badsink by reversing the blocks in the first if */ static void goodG2B2() { int data; if(1) { /* FIX: Initialize and use data before it is overwritten */ data = 5; printIntLine(data); } if(1) { /* POTENTIAL FLAW: Possibly over-write the initial value of data before using it */ data = 10; printIntLine(data); } } void CWE563_Unused_Variable__unused_value_int_02_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE563_Unused_Variable__unused_value_int_02_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE563_Unused_Variable__unused_value_int_02_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
{ "content_hash": "5d0f8c7ff2f0cf80a154ee3c7ea5b839", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 91, "avg_line_length": 23.993589743589745, "alnum_prop": 0.5856265028052364, "repo_name": "maurer/tiamat", "id": "749a25244455cc8344e42cb332f15046ba0dbe4a", "size": "3743", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "samples/Juliet/testcases/CWE563_Unused_Variable/CWE563_Unused_Variable__unused_value_int_02.c", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.trino.plugin.clickhouse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import io.trino.Session; import io.trino.plugin.jdbc.BaseJdbcConnectorTest; import io.trino.sql.planner.plan.AggregationNode; import io.trino.testing.MaterializedResult; import io.trino.testing.TestingConnectorBehavior; import io.trino.testing.sql.SqlExecutor; import io.trino.testing.sql.TestTable; import org.testng.SkipException; import org.testng.annotations.Test; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.OptionalInt; import static io.trino.plugin.clickhouse.ClickHouseTableProperties.ENGINE_PROPERTY; import static io.trino.plugin.clickhouse.ClickHouseTableProperties.ORDER_BY_PROPERTY; import static io.trino.plugin.clickhouse.ClickHouseTableProperties.PARTITION_BY_PROPERTY; import static io.trino.plugin.clickhouse.ClickHouseTableProperties.PRIMARY_KEY_PROPERTY; import static io.trino.plugin.clickhouse.ClickHouseTableProperties.SAMPLE_BY_PROPERTY; import static io.trino.spi.type.VarcharType.VARCHAR; import static io.trino.testing.MaterializedResult.resultBuilder; import static io.trino.testing.assertions.Assert.assertEquals; import static io.trino.testing.sql.TestTable.randomTableSuffix; import static java.lang.String.format; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; public abstract class BaseClickHouseConnectorTest extends BaseJdbcConnectorTest { protected TestingClickHouseServer clickhouseServer; @Override protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior) { switch (connectorBehavior) { case SUPPORTS_PREDICATE_PUSHDOWN_WITH_VARCHAR_EQUALITY: case SUPPORTS_PREDICATE_PUSHDOWN_WITH_VARCHAR_INEQUALITY: case SUPPORTS_TOPN_PUSHDOWN: return false; case SUPPORTS_ARRAY: case SUPPORTS_ROW_TYPE: return false; case SUPPORTS_NEGATIVE_DATE: return false; case SUPPORTS_DELETE: return false; default: return super.hasBehavior(connectorBehavior); } } @Override @Test(dataProvider = "testColumnNameDataProvider") public void testColumnName(String columnName) { throw new SkipException("TODO: test not implemented yet"); } @Override public void testRenameColumn() { // ClickHouse need resets all data in a column for specified column which to be renamed throw new SkipException("TODO: test not implemented yet"); } @Override public void testAddColumnWithCommentSpecialCharacter(String comment) { // Override because default storage engine doesn't support renaming columns try (TestTable table = new TestTable(getQueryRunner()::execute, "test_add_column_", "(a_varchar varchar NOT NULL) WITH (engine = 'mergetree', order_by = ARRAY['a_varchar'])")) { assertUpdate("ALTER TABLE " + table.getName() + " ADD COLUMN b_varchar varchar COMMENT " + varcharLiteral(comment)); assertEquals(getColumnComment(table.getName(), "b_varchar"), comment); } } @Override public void testAddAndDropColumnName(String columnName) { // TODO: Enable this test assertThatThrownBy(() -> super.testAddAndDropColumnName(columnName)) .hasMessageContaining("is not supported by storage Log"); throw new SkipException("TODO"); } @Override public void testRenameColumnName(String columnName) { // TODO: Enable this test if (columnName.equals("a.dot")) { assertThatThrownBy(() -> super.testRenameColumnName(columnName)) .hasMessageContaining("Cannot rename column from nested struct to normal column"); throw new SkipException("TODO"); } assertThatThrownBy(() -> super.testRenameColumnName(columnName)) .hasMessageContaining("is not supported by storage Log"); throw new SkipException("TODO"); } @Override protected Optional<String> filterColumnNameTestData(String columnName) { // TODO: Investigate why a\backslash allows creating a table, but it throws an exception when selecting if (columnName.equals("a\\backslash`")) { return Optional.empty(); } return Optional.of(columnName); } @Override public void testDropColumn() { String tableName = "test_drop_column_" + randomTableSuffix(); // only MergeTree engine table can drop column assertUpdate("CREATE TABLE " + tableName + "(x int NOT NULL, y int, a int) WITH (engine = 'MergeTree', order_by = ARRAY['x'])"); assertUpdate("INSERT INTO " + tableName + "(x,y,a) SELECT 123, 456, 111", 1); assertUpdate("ALTER TABLE " + tableName + " DROP COLUMN IF EXISTS y"); assertUpdate("ALTER TABLE " + tableName + " DROP COLUMN IF EXISTS notExistColumn"); assertQueryFails("SELECT y FROM " + tableName, ".* Column 'y' cannot be resolved"); assertUpdate("DROP TABLE " + tableName); assertFalse(getQueryRunner().tableExists(getSession(), tableName)); assertUpdate("ALTER TABLE IF EXISTS " + tableName + " DROP COLUMN notExistColumn"); assertUpdate("ALTER TABLE IF EXISTS " + tableName + " DROP COLUMN IF EXISTS notExistColumn"); assertFalse(getQueryRunner().tableExists(getSession(), tableName)); // the columns are referenced by order_by/order_by property can not be dropped assertUpdate("CREATE TABLE " + tableName + "(x int NOT NULL, y int, a int NOT NULL) WITH " + "(engine = 'MergeTree', order_by = ARRAY['x'], partition_by = ARRAY['a'])"); assertQueryFails("ALTER TABLE " + tableName + " DROP COLUMN x", "(?s).* Missing columns: 'x' while processing query: 'x', required columns: 'x' 'x'.*"); assertQueryFails("ALTER TABLE " + tableName + " DROP COLUMN a", "(?s).* Missing columns: 'a' while processing query: 'a', required columns: 'a' 'a'.*"); } @Override public void testAddColumnConcurrently() { // TODO: Default storage engine doesn't support adding new columns throw new SkipException("TODO: test not implemented yet"); } @Override public void testAddColumn() { String tableName = "test_add_column_" + randomTableSuffix(); // Only MergeTree engine table can add column assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree', order_by = ARRAY['id'])"); assertUpdate("INSERT INTO " + tableName + " (id, x) VALUES(1, 'first')", 1); assertQueryFails("ALTER TABLE " + tableName + " ADD COLUMN X bigint", ".* Column 'X' already exists"); assertQueryFails("ALTER TABLE " + tableName + " ADD COLUMN q bad_type", ".* Unknown type 'bad_type' for column 'q'"); assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN a varchar"); assertUpdate("INSERT INTO " + tableName + " SELECT 2, 'second', 'xxx'", 1); assertQuery( "SELECT x, a FROM " + tableName, "VALUES ('first', NULL), ('second', 'xxx')"); assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN b double"); assertUpdate("INSERT INTO " + tableName + " SELECT 3, 'third', 'yyy', 33.3E0", 1); assertQuery( "SELECT x, a, b FROM " + tableName, "VALUES ('first', NULL, NULL), ('second', 'xxx', NULL), ('third', 'yyy', 33.3)"); assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN IF NOT EXISTS c varchar"); assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN IF NOT EXISTS c varchar"); assertUpdate("INSERT INTO " + tableName + " SELECT 4, 'fourth', 'zzz', 55.3E0, 'newColumn'", 1); assertQuery( "SELECT x, a, b, c FROM " + tableName, "VALUES ('first', NULL, NULL, NULL), ('second', 'xxx', NULL, NULL), ('third', 'yyy', 33.3, NULL), ('fourth', 'zzz', 55.3, 'newColumn')"); assertUpdate("DROP TABLE " + tableName); assertFalse(getQueryRunner().tableExists(getSession(), tableName)); assertUpdate("ALTER TABLE IF EXISTS " + tableName + " ADD COLUMN x bigint"); assertUpdate("ALTER TABLE IF EXISTS " + tableName + " ADD COLUMN IF NOT EXISTS x bigint"); assertFalse(getQueryRunner().tableExists(getSession(), tableName)); } @Override public void testAddNotNullColumnToNonEmptyTable() { // Override because the default storage type doesn't support adding columns try (TestTable table = new TestTable(getQueryRunner()::execute, "test_add_notnull_col", "(a_varchar varchar NOT NULL) WITH (engine = 'MergeTree', order_by = ARRAY['a_varchar'])")) { String tableName = table.getName(); assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN b_varchar varchar NOT NULL"); assertFalse(columnIsNullable(tableName, "b_varchar")); assertUpdate("INSERT INTO " + tableName + " VALUES ('a', 'b')", 1); // ClickHouse set an empty character as the default value assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN c_varchar varchar NOT NULL"); assertFalse(columnIsNullable(tableName, "c_varchar")); assertQuery("SELECT c_varchar FROM " + tableName, "VALUES ''"); } } @Test @Override public void testAddColumnWithComment() { // Override because the default storage type doesn't support adding columns try (TestTable table = new TestTable(getQueryRunner()::execute, "test_add_col_desc_", "(a_varchar varchar NOT NULL) WITH (engine = 'MergeTree', order_by = ARRAY['a_varchar'])")) { String tableName = table.getName(); assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN b_varchar varchar COMMENT 'test new column comment'"); assertThat(getColumnComment(tableName, "b_varchar")).isEqualTo("test new column comment"); assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN empty_comment varchar COMMENT ''"); assertNull(getColumnComment(tableName, "empty_comment")); } } @Override public void testAlterTableAddLongColumnName() { // TODO: Find the maximum column name length in ClickHouse and enable this test. throw new SkipException("TODO"); } @Override public void testAlterTableRenameColumnToLongName() { // TODO: Find the maximum column name length in ClickHouse and enable this test. throw new SkipException("TODO"); } @Test @Override public void testShowCreateTable() { assertThat(computeActual("SHOW CREATE TABLE orders").getOnlyValue()) .isEqualTo("CREATE TABLE clickhouse.tpch.orders (\n" + " orderkey bigint,\n" + " custkey bigint,\n" + " orderstatus varchar,\n" + " totalprice double,\n" + " orderdate date,\n" + " orderpriority varchar,\n" + " clerk varchar,\n" + " shippriority integer,\n" + " comment varchar\n" + ")\n" + "WITH (\n" + " engine = 'LOG'\n" + ")"); } @Override public void testDescribeTable() { MaterializedResult expectedColumns = resultBuilder(getSession(), VARCHAR, VARCHAR, VARCHAR, VARCHAR) .row("orderkey", "bigint", "", "") .row("custkey", "bigint", "", "") .row("orderstatus", "varchar", "", "") .row("totalprice", "double", "", "") .row("orderdate", "date", "", "") .row("orderpriority", "varchar", "", "") .row("clerk", "varchar", "", "") .row("shippriority", "integer", "", "") .row("comment", "varchar", "", "") .build(); MaterializedResult actualColumns = computeActual("DESCRIBE orders"); assertEquals(actualColumns, expectedColumns); } @Override protected TestTable createTableWithDefaultColumns() { return new TestTable( onRemoteDatabase(), "tpch.tbl", "(col_required Int64," + "col_nullable Nullable(Int64)," + "col_default Nullable(Int64) DEFAULT 43," + "col_nonnull_default Int64 DEFAULT 42," + "col_required2 Int64) ENGINE=Log"); } @Override public void testCharVarcharComparison() { assertThatThrownBy(super::testCharVarcharComparison) .hasMessageContaining("For query: ") .hasMessageContaining("Actual rows") .hasMessageContaining("Expected rows"); // TODO run the test with clickhouse.map-string-as-varchar throw new SkipException(""); } @Test public void testDifferentEngine() { String tableName = "test_add_column_" + randomTableSuffix(); // MergeTree assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree', order_by = ARRAY['id'])"); assertTrue(getQueryRunner().tableExists(getSession(), tableName)); assertUpdate("DROP TABLE " + tableName); assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'mergetree', order_by = ARRAY['id'])"); assertTrue(getQueryRunner().tableExists(getSession(), tableName)); assertUpdate("DROP TABLE " + tableName); // MergeTree without order by assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree')", "The property of order_by is required for table engine MergeTree\\(\\)"); // MergeTree with optional assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR, logdate DATE NOT NULL) WITH " + "(engine = 'MergeTree', order_by = ARRAY['id'], partition_by = ARRAY['toYYYYMM(logdate)'])"); assertTrue(getQueryRunner().tableExists(getSession(), tableName)); assertUpdate("DROP TABLE " + tableName); //Log families assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'log')"); assertUpdate("DROP TABLE " + tableName); assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'tinylog')"); assertUpdate("DROP TABLE " + tableName); assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'stripelog')"); assertUpdate("DROP TABLE " + tableName); //NOT support engine assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'bad_engine')", "Unable to set catalog 'clickhouse' table property 'engine' to.*"); } @Test public void testTableProperty() { String tableName = "test_add_column_" + randomTableSuffix(); // no table property, it should create a table with default Log engine table assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR)"); assertTrue(getQueryRunner().tableExists(getSession(), tableName)); assertUpdate("DROP TABLE " + tableName); // one required property assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'Log')"); assertThat((String) computeScalar("SHOW CREATE TABLE " + tableName)) .isEqualTo(format("" + "CREATE TABLE clickhouse.tpch.%s (\n" + " id integer NOT NULL,\n" + " x varchar\n" + ")\n" + "WITH (\n" + " engine = 'LOG'\n" + ")", tableName)); assertUpdate("DROP TABLE " + tableName); assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'StripeLog')"); assertThat((String) computeScalar("SHOW CREATE TABLE " + tableName)) .isEqualTo(format("" + "CREATE TABLE clickhouse.tpch.%s (\n" + " id integer NOT NULL,\n" + " x varchar\n" + ")\n" + "WITH (\n" + " engine = 'STRIPELOG'\n" + ")", tableName)); assertUpdate("DROP TABLE " + tableName); assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'TinyLog')"); assertThat((String) computeScalar("SHOW CREATE TABLE " + tableName)) .isEqualTo(format("" + "CREATE TABLE clickhouse.tpch.%s (\n" + " id integer NOT NULL,\n" + " x varchar\n" + ")\n" + "WITH (\n" + " engine = 'TINYLOG'\n" + ")", tableName)); assertUpdate("DROP TABLE " + tableName); // Log engine DOES NOT any property assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'Log', order_by=ARRAY['id'])", ".* doesn't support PARTITION_BY, PRIMARY_KEY, ORDER_BY or SAMPLE_BY clauses.*\\n.*"); assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'Log', partition_by=ARRAY['id'])", ".* doesn't support PARTITION_BY, PRIMARY_KEY, ORDER_BY or SAMPLE_BY clauses.*\\n.*"); assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'Log', sample_by='id')", ".* doesn't support PARTITION_BY, PRIMARY_KEY, ORDER_BY or SAMPLE_BY clauses.*\\n.*"); // optional properties assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree', order_by = ARRAY['id'])"); assertThat((String) computeScalar("SHOW CREATE TABLE " + tableName)) .isEqualTo(format("" + "CREATE TABLE clickhouse.tpch.%s (\n" + " id integer NOT NULL,\n" + " x varchar\n" + ")\n" + "WITH (\n" + " engine = 'MERGETREE',\n" + " order_by = ARRAY['id'],\n" + " primary_key = ARRAY['id']\n" + // order_by become primary_key automatically in ClickHouse ")", tableName)); assertUpdate("DROP TABLE " + tableName); // the column refers by order by must be not null assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree', order_by = ARRAY['id', 'x'])", ".* Sorting key cannot contain nullable columns.*\\n.*"); assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree', order_by = ARRAY['id'], primary_key = ARRAY['id'])"); assertThat((String) computeScalar("SHOW CREATE TABLE " + tableName)) .isEqualTo(format("" + "CREATE TABLE clickhouse.tpch.%s (\n" + " id integer NOT NULL,\n" + " x varchar\n" + ")\n" + "WITH (\n" + " engine = 'MERGETREE',\n" + " order_by = ARRAY['id'],\n" + " primary_key = ARRAY['id']\n" + ")", tableName)); assertUpdate("DROP TABLE " + tableName); assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR NOT NULL, y VARCHAR NOT NULL) WITH (engine = 'MergeTree', order_by = ARRAY['id', 'x', 'y'], primary_key = ARRAY['id', 'x'])"); assertThat((String) computeScalar("SHOW CREATE TABLE " + tableName)) .isEqualTo(format("" + "CREATE TABLE clickhouse.tpch.%s (\n" + " id integer NOT NULL,\n" + " x varchar NOT NULL,\n" + " y varchar NOT NULL\n" + ")\n" + "WITH (\n" + " engine = 'MERGETREE',\n" + " order_by = ARRAY['id','x','y'],\n" + " primary_key = ARRAY['id','x']\n" + ")", tableName)); assertUpdate("DROP TABLE " + tableName); assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x BOOLEAN NOT NULL, y VARCHAR NOT NULL) WITH (engine = 'MergeTree', order_by = ARRAY['id', 'x'], primary_key = ARRAY['id','x'], sample_by = 'x' )"); assertThat((String) computeScalar("SHOW CREATE TABLE " + tableName)) .isEqualTo(format("" + "CREATE TABLE clickhouse.tpch.%s (\n" + " id integer NOT NULL,\n" + " x smallint NOT NULL,\n" + " y varchar NOT NULL\n" + ")\n" + "WITH (\n" + " engine = 'MERGETREE',\n" + " order_by = ARRAY['id','x'],\n" + " primary_key = ARRAY['id','x'],\n" + " sample_by = 'x'\n" + ")", tableName)); assertUpdate("DROP TABLE " + tableName); // Partition column assertUpdate("CREATE TABLE " + tableName + "(id int NOT NULL, part int NOT NULL) WITH " + "(engine = 'MergeTree', order_by = ARRAY['id'], partition_by = ARRAY['part'])"); assertThat((String) computeScalar("SHOW CREATE TABLE " + tableName)) .isEqualTo(format("" + "CREATE TABLE clickhouse.tpch.%s (\n" + " id integer NOT NULL,\n" + " part integer NOT NULL\n" + ")\n" + "WITH (\n" + " engine = 'MERGETREE',\n" + " order_by = ARRAY['id'],\n" + " partition_by = ARRAY['part'],\n" + " primary_key = ARRAY['id']\n" + ")", tableName)); assertUpdate("DROP TABLE " + tableName); // Primary key must be a prefix of the sorting key, assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x boolean NOT NULL, y boolean NOT NULL) WITH (engine = 'MergeTree', order_by = ARRAY['id'], sample_by = ARRAY['x', 'y'])", "Invalid value for catalog 'clickhouse' table property 'sample_by': .*"); // wrong property type assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL) WITH (engine = 'MergeTree', order_by = 'id')", "Invalid value for catalog 'clickhouse' table property 'order_by': .*"); assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL) WITH (engine = 'MergeTree', order_by = ARRAY['id'], primary_key = 'id')", "Invalid value for catalog 'clickhouse' table property 'primary_key': .*"); assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL) WITH (engine = 'MergeTree', order_by = ARRAY['id'], primary_key = ARRAY['id'], partition_by = 'id')", "Invalid value for catalog 'clickhouse' table property 'partition_by': .*"); } @Test public void testSetTableProperties() throws Exception { try (TestTable table = new TestTable( getQueryRunner()::execute, "test_alter_table_properties", "(p1 int NOT NULL, p2 boolean NOT NULL, x VARCHAR) WITH (engine = 'MergeTree', order_by = ARRAY['p1', 'p2'], primary_key = ARRAY['p1', 'p2'])")) { assertThat(getTableProperties("tpch", table.getName())) .containsExactlyEntriesOf(ImmutableMap.of( "engine", "MergeTree", "order_by", "p1, p2", "partition_by", "", "primary_key", "p1, p2", "sample_by", "")); assertUpdate("ALTER TABLE " + table.getName() + " SET PROPERTIES sample_by = 'p2'"); assertThat(getTableProperties("tpch", table.getName())) .containsExactlyEntriesOf(ImmutableMap.of( "engine", "MergeTree", "order_by", "p1, p2", "partition_by", "", "primary_key", "p1, p2", "sample_by", "p2")); } } @Test public void testAlterInvalidTableProperties() { try (TestTable table = new TestTable( getQueryRunner()::execute, "test_alter_table_properties", "(p1 int NOT NULL, p2 int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree', order_by = ARRAY['p1', 'p2'], primary_key = ARRAY['p1', 'p2'])")) { assertQueryFails( "ALTER TABLE " + table.getName() + " SET PROPERTIES invalid_property = 'p2'", "Catalog 'clickhouse' table property 'invalid_property' does not exist"); } } @Override protected TestTable createTableWithUnsupportedColumn() { return new TestTable( onRemoteDatabase(), "tpch.test_unsupported_column_present", "(one bigint, two Array(UInt8), three String) ENGINE=Log"); } @Override protected Optional<DataMappingTestSetup> filterDataMappingSmokeTestData(DataMappingTestSetup dataMappingTestSetup) { switch (dataMappingTestSetup.getTrinoTypeName()) { case "boolean": // ClickHouse does not have built-in support for boolean type and we map boolean to tinyint. // Querying the column with a boolean predicate subsequently fails with "Cannot apply operator: tinyint = boolean" return Optional.empty(); case "varbinary": // here in this test class we map ClickHouse String into varchar, so varbinary ends up a varchar return Optional.empty(); case "date": // TODO (https://github.com/trinodb/trino/issues/7101) enable the test return Optional.empty(); case "time": case "time(6)": case "timestamp": case "timestamp(6)": case "timestamp(3) with time zone": case "timestamp(6) with time zone": return Optional.of(dataMappingTestSetup.asUnsupported()); } return Optional.of(dataMappingTestSetup); } // TODO: Remove override once decimal predicate pushdown is implemented (https://github.com/trinodb/trino/issues/7100) @Override public void testNumericAggregationPushdown() { String schemaName = getSession().getSchema().orElseThrow(); try (TestTable testTable = createAggregationTestTable(schemaName + ".test_aggregation_pushdown", ImmutableList.of("100.000, 100000000.000000000, 100.000, 100000000", "123.321, 123456789.987654321, 123.321, 123456789"))) { assertThat(query("SELECT min(short_decimal), min(long_decimal), min(a_bigint), min(t_double) FROM " + testTable.getName())).isFullyPushedDown(); assertThat(query("SELECT max(short_decimal), max(long_decimal), max(a_bigint), max(t_double) FROM " + testTable.getName())).isFullyPushedDown(); assertThat(query("SELECT sum(short_decimal), sum(long_decimal), sum(a_bigint), sum(t_double) FROM " + testTable.getName())).isFullyPushedDown(); assertThat(query("SELECT avg(a_bigint), avg(t_double) FROM " + testTable.getName())).isFullyPushedDown(); assertThat(query("SELECT avg(short_decimal), avg(long_decimal) FROM " + testTable.getName())).isNotFullyPushedDown(AggregationNode.class); } } @Override protected TestTable createAggregationTestTable(String name, List<String> rows) { return new TestTable(onRemoteDatabase(), name, "(short_decimal Nullable(Decimal(9, 3)), long_decimal Nullable(Decimal(30, 10)), t_double Nullable(Float64), a_bigint Nullable(Int64)) Engine=Log", rows); } @Override protected TestTable createTableWithDoubleAndRealColumns(String name, List<String> rows) { return new TestTable(onRemoteDatabase(), name, "(t_double Nullable(Float64), u_double Nullable(Float64), v_real Nullable(Float32), w_real Nullable(Float32)) Engine=Log", rows); } @Test @Override public void testInsertIntoNotNullColumn() { try (TestTable table = new TestTable(getQueryRunner()::execute, "test_insert_not_null_", "(nullable_col INTEGER, not_null_col INTEGER NOT NULL)")) { assertUpdate(format("INSERT INTO %s (not_null_col) VALUES (2)", table.getName()), 1); assertQuery("SELECT * FROM " + table.getName(), "VALUES (NULL, 2)"); // ClickHouse inserts default values (e.g. 0 for integer column) even if we don't specify default clause in CREATE TABLE statement assertUpdate(format("INSERT INTO %s (nullable_col) VALUES (1)", table.getName()), 1); assertQuery("SELECT * FROM " + table.getName(), "VALUES (NULL, 2), (1, 0)"); } try (TestTable table = new TestTable(getQueryRunner()::execute, "test_commuted_not_null_table", "(nullable_col BIGINT, not_null_col BIGINT NOT NULL)")) { assertUpdate(format("INSERT INTO %s (not_null_col) VALUES (2)", table.getName()), 1); assertQuery("SELECT * FROM " + table.getName(), "VALUES (NULL, 2)"); assertQueryFails(format("INSERT INTO %s (not_null_col, nullable_col) VALUES (NULL, 3)", table.getName()), "NULL value not allowed for NOT NULL column: not_null_col"); } try (TestTable table = new TestTable(getQueryRunner()::execute, "not_null_no_cast", "(nullable_col INTEGER, not_null_col INTEGER NOT NULL)")) { assertUpdate(format("INSERT INTO %s (not_null_col) VALUES (2)", table.getName()), 1); assertQuery("SELECT * FROM " + table.getName(), "VALUES (NULL, 2)"); // This is enforced by the engine and not the connector assertQueryFails(format("INSERT INTO %s (not_null_col, nullable_col) VALUES (NULL, 3)", table.getName()), "NULL value not allowed for NOT NULL column: not_null_col"); assertQueryFails(format("INSERT INTO %s (not_null_col, nullable_col) VALUES (TRY(5/0), 4)", table.getName()), "NULL value not allowed for NOT NULL column: not_null_col"); assertQueryFails(format("INSERT INTO %s (not_null_col) VALUES (TRY(6/0))", table.getName()), "NULL value not allowed for NOT NULL column: not_null_col"); } } @Override protected String errorMessageForCreateTableAsSelectNegativeDate(String date) { return "Date must be between 1970-01-01 and 2106-02-07 in ClickHouse: " + date; } @Override protected String errorMessageForInsertNegativeDate(String date) { return "Date must be between 1970-01-01 and 2106-02-07 in ClickHouse: " + date; } @Test @Override public void testDateYearOfEraPredicate() { // Override because the connector throws an exception instead of an empty result when the value is out of supported range assertQuery("SELECT orderdate FROM orders WHERE orderdate = DATE '1997-09-14'", "VALUES DATE '1997-09-14'"); assertQueryFails( "SELECT * FROM orders WHERE orderdate = DATE '-1996-09-14'", errorMessageForDateYearOfEraPredicate("-1996-09-14")); } protected String errorMessageForDateYearOfEraPredicate(String date) { return "Date must be between 1970-01-01 and 2106-02-07 in ClickHouse: " + date; } @Override public void testCharTrailingSpace() { assertThatThrownBy(super::testCharTrailingSpace) .hasMessageStartingWith("Failed to execute statement: CREATE TABLE tpch.char_trailing_space"); throw new SkipException("Implement test for ClickHouse"); } @Override public void testNativeQuerySimple() { // table function disabled for ClickHouse, because it doesn't provide ResultSetMetaData, so the result relation type cannot be determined assertQueryFails("SELECT * FROM TABLE(system.query(query => 'SELECT 1'))", "line 1:21: Table function system.query not registered"); } @Override public void testNativeQueryParameters() { // table function disabled for ClickHouse, because it doesn't provide ResultSetMetaData, so the result relation type cannot be determined Session session = Session.builder(getSession()) .addPreparedStatement("my_query_simple", "SELECT * FROM TABLE(system.query(query => ?))") .addPreparedStatement("my_query", "SELECT * FROM TABLE(system.query(query => format('SELECT %s FROM %s', ?, ?)))") .build(); assertQueryFails(session, "EXECUTE my_query_simple USING 'SELECT 1 a'", "line 1:21: Table function system.query not registered"); assertQueryFails(session, "EXECUTE my_query USING 'a', '(SELECT 2 a) t'", "line 1:21: Table function system.query not registered"); } @Override public void testNativeQuerySelectFromNation() { // table function disabled for ClickHouse, because it doesn't provide ResultSetMetaData, so the result relation type cannot be determined assertQueryFails( format("SELECT * FROM TABLE(system.query(query => 'SELECT name FROM %s.nation WHERE nationkey = 0'))", getSession().getSchema().orElseThrow()), "line 1:21: Table function system.query not registered"); } @Override public void testNativeQuerySelectFromTestTable() { // table function disabled for ClickHouse, because it doesn't provide ResultSetMetaData, so the result relation type cannot be determined try (TestTable testTable = simpleTable()) { assertQueryFails( format("SELECT * FROM TABLE(system.query(query => 'SELECT * FROM %s'))", testTable.getName()), "line 1:21: Table function system.query not registered"); } } @Override public void testNativeQuerySelectUnsupportedType() { // table function disabled for ClickHouse, because it doesn't provide ResultSetMetaData, so the result relation type cannot be determined try (TestTable testTable = createTableWithUnsupportedColumn()) { String unqualifiedTableName = testTable.getName().replaceAll("^\\w+\\.", ""); // Check that column 'two' is not supported. assertQuery("SELECT column_name FROM information_schema.columns WHERE table_name = '" + unqualifiedTableName + "'", "VALUES 'one', 'three'"); assertUpdate("INSERT INTO " + testTable.getName() + " (one, three) VALUES (123, 'test')", 1); assertThatThrownBy(() -> query(format("SELECT * FROM TABLE(system.query(query => 'SELECT * FROM %s'))", testTable.getName()))) .hasMessage("line 1:21: Table function system.query not registered"); } } @Override public void testNativeQueryCreateStatement() { // table function disabled for ClickHouse, because it doesn't provide ResultSetMetaData, so the result relation type cannot be determined assertFalse(getQueryRunner().tableExists(getSession(), "numbers")); assertThatThrownBy(() -> query("SELECT * FROM TABLE(system.query(query => 'CREATE TABLE numbers(n INTEGER)'))")) .hasMessage("line 1:21: Table function system.query not registered"); assertFalse(getQueryRunner().tableExists(getSession(), "numbers")); } @Override public void testNativeQueryInsertStatementTableDoesNotExist() { // table function disabled for ClickHouse, because it doesn't provide ResultSetMetaData, so the result relation type cannot be determined assertFalse(getQueryRunner().tableExists(getSession(), "non_existent_table")); assertThatThrownBy(() -> query("SELECT * FROM TABLE(system.query(query => 'INSERT INTO non_existent_table VALUES (1)'))")) .hasMessage("line 1:21: Table function system.query not registered"); } @Override public void testNativeQueryInsertStatementTableExists() { // table function disabled for ClickHouse, because it doesn't provide ResultSetMetaData, so the result relation type cannot be determined try (TestTable testTable = simpleTable()) { assertThatThrownBy(() -> query(format("SELECT * FROM TABLE(system.query(query => 'INSERT INTO %s VALUES (3)'))", testTable.getName()))) .hasMessage("line 1:21: Table function system.query not registered"); assertQuery("SELECT * FROM " + testTable.getName(), "VALUES 1, 2"); } } @Override public void testNativeQueryIncorrectSyntax() { // table function disabled for ClickHouse, because it doesn't provide ResultSetMetaData, so the result relation type cannot be determined assertThatThrownBy(() -> query("SELECT * FROM TABLE(system.query(query => 'some wrong syntax'))")) .hasMessage("line 1:21: Table function system.query not registered"); } @Override protected TestTable simpleTable() { // override because Clickhouse requires engine specification return new TestTable(onRemoteDatabase(), "tpch.simple_table", "(col BIGINT) Engine=Log", ImmutableList.of("1", "2")); } @Override public void testCreateTableWithLongTableName() { // Override because ClickHouse connector can create a table which can't be dropped String baseTableName = "test_create_" + randomTableSuffix(); String validTableName = baseTableName + "z".repeat(maxTableNameLength().orElseThrow() - baseTableName.length()); assertUpdate("CREATE TABLE " + validTableName + " (a bigint)"); assertTrue(getQueryRunner().tableExists(getSession(), validTableName)); assertThatThrownBy(() -> assertUpdate("DROP TABLE " + validTableName)) .hasMessageMatching("(?s).*(Bad path syntax|File name too long).*"); String invalidTableName = baseTableName + "z".repeat(maxTableNameLength().orElseThrow() - baseTableName.length() + 1); assertThatThrownBy(() -> query("CREATE TABLE " + invalidTableName + " (a bigint)")) .hasMessageMatching("(?s).*(Cannot open file|File name too long).*"); // ClickHouse lefts a table even if the above statement failed assertTrue(getQueryRunner().tableExists(getSession(), validTableName)); } @Override public void testRenameSchemaToLongName() { // Override because the max length is different from CREATE SCHEMA case String sourceTableName = "test_rename_source_" + randomTableSuffix(); assertUpdate("CREATE SCHEMA " + sourceTableName); String baseSchemaName = "test_rename_target_" + randomTableSuffix(); // The numeric value depends on file system int maxLength = 255 - ".sql".length(); String validTargetSchemaName = baseSchemaName + "z".repeat(maxLength - baseSchemaName.length()); assertUpdate("ALTER SCHEMA " + sourceTableName + " RENAME TO " + validTargetSchemaName); assertThat(computeActual("SHOW SCHEMAS").getOnlyColumnAsSet()).contains(validTargetSchemaName); assertUpdate("DROP SCHEMA " + validTargetSchemaName); assertUpdate("CREATE SCHEMA " + sourceTableName); String invalidTargetSchemaName = validTargetSchemaName + "z"; assertThatThrownBy(() -> assertUpdate("ALTER SCHEMA " + sourceTableName + " RENAME TO " + invalidTargetSchemaName)) .satisfies(this::verifySchemaNameLengthFailurePermissible); assertThat(computeActual("SHOW SCHEMAS").getOnlyColumnAsSet()).doesNotContain(invalidTargetSchemaName); } @Override protected OptionalInt maxSchemaNameLength() { // The numeric value depends on file system return OptionalInt.of(255 - ".sql.tmp".length()); } @Override protected void verifySchemaNameLengthFailurePermissible(Throwable e) { assertThat(e).hasMessageContaining("File name too long"); } @Override public void testRenameTableToLongTableName() { // Override because ClickHouse connector can rename to a table which can't be dropped String sourceTableName = "test_source_long_table_name_" + randomTableSuffix(); assertUpdate("CREATE TABLE " + sourceTableName + " AS SELECT 123 x", 1); String baseTableName = "test_target_long_table_name_" + randomTableSuffix(); // The max length is different from CREATE TABLE case String validTargetTableName = baseTableName + "z".repeat(255 - ".sql".length() - baseTableName.length()); assertUpdate("ALTER TABLE " + sourceTableName + " RENAME TO " + validTargetTableName); assertTrue(getQueryRunner().tableExists(getSession(), validTargetTableName)); assertQuery("SELECT x FROM " + validTargetTableName, "VALUES 123"); assertThatThrownBy(() -> assertUpdate("DROP TABLE " + validTargetTableName)) .hasMessageMatching("(?s).*(Bad path syntax|File name too long).*"); assertUpdate("CREATE TABLE " + sourceTableName + " AS SELECT 123 x", 1); String invalidTargetTableName = validTargetTableName + "z"; assertThatThrownBy(() -> assertUpdate("ALTER TABLE " + sourceTableName + " RENAME TO " + invalidTargetTableName)) .hasMessageMatching("(?s).*(Cannot rename|File name too long).*"); assertFalse(getQueryRunner().tableExists(getSession(), invalidTargetTableName)); } @Override protected SqlExecutor onRemoteDatabase() { return clickhouseServer::execute; } private Map<String, String> getTableProperties(String schemaName, String tableName) throws SQLException { String sql = "SELECT * FROM system.tables WHERE database = ? AND name = ?"; try (Connection connection = DriverManager.getConnection(clickhouseServer.getJdbcUrl()); PreparedStatement preparedStatement = connection.prepareStatement(sql)) { preparedStatement.setString(1, schemaName); preparedStatement.setString(2, tableName); ResultSet resultSet = preparedStatement.executeQuery(); ImmutableMap.Builder<String, String> properties = ImmutableMap.builder(); while (resultSet.next()) { properties.put(ENGINE_PROPERTY, resultSet.getString("engine")); properties.put(ORDER_BY_PROPERTY, resultSet.getString("sorting_key")); properties.put(PARTITION_BY_PROPERTY, resultSet.getString("partition_key")); properties.put(PRIMARY_KEY_PROPERTY, resultSet.getString("primary_key")); properties.put(SAMPLE_BY_PROPERTY, resultSet.getString("sampling_key")); } return properties.buildOrThrow(); } } }
{ "content_hash": "4e16afdc9bbbbdfadd592b994cd1208c", "timestamp": "", "source": "github", "line_count": 875, "max_line_length": 222, "avg_line_length": 51.14057142857143, "alnum_prop": 0.607647269151694, "repo_name": "smartnews/presto", "id": "8743919c371bae58119a7d1af75d5225a12975db", "size": "44748", "binary": false, "copies": "1", "ref": "refs/heads/smartnews", "path": "plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/BaseClickHouseConnectorTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "50268" }, { "name": "CSS", "bytes": "13515" }, { "name": "Dockerfile", "bytes": "1967" }, { "name": "Groovy", "bytes": "1702" }, { "name": "HTML", "bytes": "30842" }, { "name": "Java", "bytes": "61596519" }, { "name": "JavaScript", "bytes": "232261" }, { "name": "PLSQL", "bytes": "85" }, { "name": "Python", "bytes": "5266" }, { "name": "Scala", "bytes": "10145" }, { "name": "Shell", "bytes": "51516" }, { "name": "Smarty", "bytes": "1938" } ], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in J. Mycol. 8: 72 (1902) #### Original name Cercospora cydoniae Rangel ### Remarks null
{ "content_hash": "498b5bd5dc4745f2ca00fd6a69cf0cbf", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 26, "avg_line_length": 11.461538461538462, "alnum_prop": 0.6912751677852349, "repo_name": "mdoering/backbone", "id": "36bbe032e36564c5191cb765bbaf03f19891c693", "size": "199", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Dothideomycetes/Capnodiales/Mycosphaerellaceae/Cercospora/Cercospora cydoniae/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package cgeo.geocaching.sensors; import cgeo.geocaching.location.Geopoint; import cgeo.geocaching.settings.Settings; import cgeo.geocaching.utils.Log; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationManager; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; import org.apache.commons.lang3.StringUtils; public class GeoData extends Location { private static final String INITIAL_PROVIDER = "initial"; private static final String HOME_PROVIDER = "home"; public static final String LOW_POWER_PROVIDER = "low-power"; // Some devices will not have the last position available (for example the emulator). In this case, // rather than waiting forever for a position update which might never come, we emulate it by placing // the user arbitrarily at Paris Notre-Dame, one of the most visited free tourist attractions in the world. public static final GeoData DUMMY_LOCATION = new GeoData(new Location(INITIAL_PROVIDER)); static { DUMMY_LOCATION.setLatitude(48.85308); DUMMY_LOCATION.setLongitude(2.34962); } public GeoData(final Location location) { super(location); } @Nullable static Location determineBestLocation(@Nullable final Location gpsLocation, @Nullable final Location netLocation) { if (gpsLocation == null) { return netLocation; } if (netLocation == null || System.currentTimeMillis() <= gpsLocation.getTime() + 30000) { return gpsLocation; } return gpsLocation.getTime() >= netLocation.getTime() ? gpsLocation : netLocation; } public LocationProviderType getLocationProvider() { switch (getProvider()) { case LocationManager.GPS_PROVIDER: return LocationProviderType.GPS; case LocationManager.NETWORK_PROVIDER: return LocationProviderType.NETWORK; case LocationManager.FUSED_PROVIDER: return LocationProviderType.FUSED; case LOW_POWER_PROVIDER: return LocationProviderType.LOW_POWER; case HOME_PROVIDER: return LocationProviderType.HOME; default: return LocationProviderType.LAST; } } @NonNull public Geopoint getCoords() { return new Geopoint(this); } @Nullable public static GeoData getInitialLocation(final Context context) { final LocationManager geoManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); if (geoManager != null) { try { if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // we do not have permission to access the location of the user, therefore we return a dummy location return DUMMY_LOCATION; } // Try to find a sensible initial location from the last locations known to Android. final Location lastGpsLocation = geoManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); final Location lastNetworkLocation = geoManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); final Location bestLocation = determineBestLocation(lastGpsLocation, lastNetworkLocation); if (bestLocation != null) { bestLocation.setProvider(INITIAL_PROVIDER); return new GeoData(bestLocation); } } catch (final Exception e) { // This error is non-fatal as its only consequence is that we will start with a dummy location // instead of a previously known one. Log.e("Error when retrieving last known location", e); } } else { Log.w("No LocationManager available"); } final String homeLocationStr = Settings.getHomeLocation(); if (StringUtils.isNotBlank(homeLocationStr)) { try { final Geopoint homeLocation = new Geopoint(homeLocationStr); Log.i("No last known location available, using home location"); final Location initialLocation = new Location(HOME_PROVIDER); initialLocation.setLatitude(homeLocation.getLatitude()); initialLocation.setLongitude(homeLocation.getLongitude()); return new GeoData(initialLocation); } catch (final Geopoint.ParseException e) { Log.w("Unable to parse home location " + homeLocationStr, e); } } Log.i("No last known location nor home location available"); return null; } public static boolean isArtificialLocationProvider(final String provider) { return provider.equals(INITIAL_PROVIDER) || provider.equals(HOME_PROVIDER); } }
{ "content_hash": "0fa557ca93e0cc4ff89ad4ffb6771e94", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 153, "avg_line_length": 43.63333333333333, "alnum_prop": 0.6613827349121467, "repo_name": "cgeo/cgeo", "id": "c3d32d3541abe9abf31795784141cfc03b9f7429", "size": "5236", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "main/src/cgeo/geocaching/sensors/GeoData.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AIDL", "bytes": "2756" }, { "name": "HTML", "bytes": "3106894" }, { "name": "Java", "bytes": "6683227" }, { "name": "Python", "bytes": "1215" }, { "name": "Shell", "bytes": "8308" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="?android:attr/listDivider" android:orientation="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center_vertical" android:onClick="onClickQuickStatsButton"> <ImageView android:layout_width="60px" android:layout_height="60px" android:onClick="onClickQuickStatsButton" android:paddingLeft="15dp" android:src="@drawable/quick_stats" /> <TextView android:id="@+id/quickstats_button" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:clickable="true" android:gravity="center_vertical|left" android:onClick="onClickQuickStatsButton" android:paddingLeft="15dp" android:text="quick stats" android:textColor="@drawable/main_menu_text_color" android:textSize="12pt" /> </LinearLayout> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="2dp" android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="2dp" android:scaleType="fitXY" android:src="@android:drawable/divider_horizontal_dark" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center_vertical" android:onClick="onClickEncyclopediaButton"> <ImageView android:layout_width="60px" android:layout_height="60px" android:onClick="onClickEncyclopediaButton" android:paddingLeft="15dp" android:src="@drawable/encyclopedia" /> <TextView android:id="@+id/encyclopedia_button" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:clickable="true" android:gravity="center_vertical|left" android:onClick="onClickEncyclopediaButton" android:paddingLeft="15dp" android:text="encyclopedia" android:textColor="@drawable/main_menu_text_color" android:textSize="12pt" /> </LinearLayout> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="2dp" android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="2dp" android:scaleType="fitXY" android:src="@android:drawable/divider_horizontal_dark" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center_vertical" android:onClick="onClickMessagesButton"> <ImageView android:layout_width="60px" android:layout_height="60px" android:onClick="onClickMessagesButton" android:paddingLeft="15dp" android:src="@drawable/messages" /> <TextView android:id="@+id/messages_button" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:clickable="true" android:gravity="center_vertical|left" android:onClick="onClickMessagesButton" android:paddingLeft="15dp" android:text="messages" android:textColor="@drawable/main_menu_text_color" android:textSize="12pt" /> </LinearLayout> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="2dp" android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="2dp" android:scaleType="fitXY" android:src="@android:drawable/divider_horizontal_dark" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center_vertical" android:onClick="onClickCalculatorButton"> <ImageView android:layout_width="60px" android:layout_height="60px" android:onClick="onClickCalculatorButton" android:paddingLeft="15dp" android:src="@drawable/calculator" /> <TextView android:id="@+id/calculator_button" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:clickable="true" android:gravity="center_vertical|left" android:onClick="onClickCalculatorButton" android:paddingLeft="15dp" android:text="calculator" android:textColor="@drawable/main_menu_text_color" android:textSize="12pt" /> </LinearLayout> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="2dp" android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="2dp" android:scaleType="fitXY" android:src="@android:drawable/divider_horizontal_dark" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center_vertical" android:onClick="onClickGameTrackerButton"> <ImageView android:layout_width="60px" android:layout_height="60px" android:onClick="onClickGameTrackerButton" android:paddingLeft="15dp" android:src="@drawable/game_tracker" /> <TextView android:id="@+id/game_tracker_button" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:clickable="true" android:gravity="center_vertical|left" android:onClick="onClickGameTrackerButton" android:paddingLeft="15dp" android:text="game tracker" android:textColor="@drawable/main_menu_text_color" android:textSize="12pt" /> </LinearLayout> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="2dp" android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="2dp" android:scaleType="fitXY" android:src="@android:drawable/divider_horizontal_dark" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center_vertical" android:onClick="onClickTutorialButton"> <ImageView android:layout_width="60px" android:layout_height="60px" android:onClick="onClickTutorialButton" android:paddingLeft="15dp" android:src="@drawable/tutorial" /> <TextView android:id="@+id/tutorial_button" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:clickable="true" android:gravity="center_vertical|left" android:onClick="onClickTutorialButton" android:paddingLeft="15dp" android:text="tutorial" android:textColor="@drawable/main_menu_text_color" android:textSize="12pt" /> </LinearLayout> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="2dp" android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="2dp" android:scaleType="fitXY" android:src="@android:drawable/divider_horizontal_dark" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center_vertical" android:onClick="onClickAboutButton"> <ImageView android:layout_width="60px" android:layout_height="60px" android:onClick="onClickAboutButton" android:paddingLeft="15dp" android:src="@drawable/about" /> <TextView android:id="@+id/about_button" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:clickable="true" android:gravity="center_vertical|left" android:onClick="onClickAboutButton" android:paddingLeft="15dp" android:text="about" android:textColor="@drawable/main_menu_text_color" android:textSize="12pt" /> </LinearLayout> </LinearLayout>
{ "content_hash": "56548edbf257164aeadfc68ce54fa026", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 73, "avg_line_length": 37.265151515151516, "alnum_prop": 0.6180117910144338, "repo_name": "movitto/nethack-encyclopedia", "id": "07c13624bd93f1746ebbb1a0d6b273044f126ccc", "size": "9838", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/main.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "89102" }, { "name": "Ruby", "bytes": "7410" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <string name="actionbar_share">"Teilen"</string> <string name="actionbar_web_search">"Websuche"</string> <string name="actionbar_textselection_title">"Textauswahl"</string> <string name="media_player_error_title">"Videowiedergabe nicht möglich"</string> <string name="media_player_error_text_invalid_progressive_playback">"Leider ist dieses Video nicht für Streaming auf diesem Gerät gültig."</string> <string name="media_player_error_text_unknown">"Dieses Video kann leider nicht abgespielt werden."</string> <string name="media_player_error_button">"OK"</string> <string name="media_player_loading_video">"Video wird geladen"</string> <string name="profiler_started_toast">"Profiler gestartet"</string> <string name="profiler_stopped_toast">"Profiler ist fertig. Die Ergebnisse befinden sich in der Datei %1$s."</string> <string name="profiler_no_storage_toast">"Profiler kann nicht gestartet werden, da der externe Speicher nicht bereit ist."</string> <string name="profiler_error_toast">"Profiler konnte nicht gestartet werden."</string> </resources>
{ "content_hash": "773251c4a9e4b0047caf8949d3c8746b", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 147, "avg_line_length": 77.66666666666667, "alnum_prop": 0.7708154506437769, "repo_name": "judax/OculusMobileSDKHeadTrackingXWalkViewExtension", "id": "43db4c2afdc85c2b36eb304dfd8828a934c5ecaf", "size": "1169", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "3rdparty/crosswalk-webview-18.48.477.13-arm/res/values-de/android_content_strings.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "22429" } ], "symlink_target": "" }
require 'test_helper' class WelcomeControllerTest < ActionDispatch::IntegrationTest test 'be redirected to the pull request controller' do get welcome_index_url assert_response :redirect end end
{ "content_hash": "8e9846bdc5c7cc309951f18da93b060c", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 61, "avg_line_length": 26, "alnum_prop": 0.7788461538461539, "repo_name": "davetrollope/gitstats", "id": "8539da58ca01109f703fb03fdd607f250ca814e2", "size": "208", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/controllers/welcome_controller_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1344" }, { "name": "CoffeeScript", "bytes": "422" }, { "name": "HTML", "bytes": "31846" }, { "name": "JavaScript", "bytes": "1254" }, { "name": "Ruby", "bytes": "102380" }, { "name": "Shell", "bytes": "313" } ], "symlink_target": "" }
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Logit'] , ['LinearTrend'] , ['BestCycle'] , ['ARX'] );
{ "content_hash": "4e616f983720044e1360c137b1a4b883", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 77, "avg_line_length": 37.5, "alnum_prop": 0.7, "repo_name": "antoinecarme/pyaf", "id": "c584a34d5c51c201367f583d13a7f283ca27e1c0", "size": "150", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/model_control/detailed/transf_Logit/model_control_one_enabled_Logit_LinearTrend_BestCycle_ARX.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Makefile", "bytes": "6773299" }, { "name": "Procfile", "bytes": "24" }, { "name": "Python", "bytes": "54209093" }, { "name": "R", "bytes": "807" }, { "name": "Shell", "bytes": "3619" } ], "symlink_target": "" }
extern "Java" { namespace java { namespace awt { class Color; class Dimension; class Graphics; } } namespace javax { namespace swing { namespace plaf { namespace basic { class BasicArrowButton; } } } } } class javax::swing::plaf::basic::BasicArrowButton : public ::javax::swing::JButton { public: BasicArrowButton(jint); BasicArrowButton(jint, ::java::awt::Color *, ::java::awt::Color *, ::java::awt::Color *, ::java::awt::Color *); virtual jboolean isFocusTraversable(); virtual jint getDirection(); virtual void setDirection(jint); virtual void paint(::java::awt::Graphics *); virtual ::java::awt::Dimension * getPreferredSize(); virtual ::java::awt::Dimension * getMinimumSize(); virtual ::java::awt::Dimension * getMaximumSize(); virtual void paintTriangle(::java::awt::Graphics *, jint, jint, jint, jint, jboolean); private: void paintTriangleNorth(::java::awt::Graphics *, jint, jint, jint, jboolean); void paintTriangleSouth(::java::awt::Graphics *, jint, jint, jint, jboolean); void paintTriangleEast(::java::awt::Graphics *, jint, jint, jint, jboolean); void paintTriangleWest(::java::awt::Graphics *, jint, jint, jint, jboolean); public: // actually protected jint __attribute__((aligned(__alignof__( ::javax::swing::JButton)))) direction; public: // actually package-private ::java::awt::Color * shadow; ::java::awt::Color * darkShadow; ::java::awt::Color * highlight; public: static ::java::lang::Class class$; }; #endif // __javax_swing_plaf_basic_BasicArrowButton__
{ "content_hash": "d101cf7fe54681278d7368194200821e", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 113, "avg_line_length": 29.196428571428573, "alnum_prop": 0.6501529051987768, "repo_name": "the-linix-project/linix-kernel-source", "id": "033f499aaf85f54a059c3c7ec72d90ab1a3ab12a", "size": "1857", "binary": false, "copies": "160", "ref": "refs/heads/master", "path": "gccsrc/gcc-4.7.2/libjava/javax/swing/plaf/basic/BasicArrowButton.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ada", "bytes": "38139979" }, { "name": "Assembly", "bytes": "3723477" }, { "name": "Awk", "bytes": "83739" }, { "name": "C", "bytes": "103607293" }, { "name": "C#", "bytes": "55726" }, { "name": "C++", "bytes": "38577421" }, { "name": "CLIPS", "bytes": "6933" }, { "name": "CSS", "bytes": "32588" }, { "name": "Emacs Lisp", "bytes": "13451" }, { "name": "FORTRAN", "bytes": "4294984" }, { "name": "GAP", "bytes": "13089" }, { "name": "Go", "bytes": "11277335" }, { "name": "Haskell", "bytes": "2415" }, { "name": "Java", "bytes": "45298678" }, { "name": "JavaScript", "bytes": "6265" }, { "name": "Matlab", "bytes": "56" }, { "name": "OCaml", "bytes": "148372" }, { "name": "Objective-C", "bytes": "995127" }, { "name": "Objective-C++", "bytes": "436045" }, { "name": "PHP", "bytes": "12361" }, { "name": "Pascal", "bytes": "40318" }, { "name": "Perl", "bytes": "358808" }, { "name": "Python", "bytes": "60178" }, { "name": "SAS", "bytes": "1711" }, { "name": "Scilab", "bytes": "258457" }, { "name": "Shell", "bytes": "2610907" }, { "name": "Tcl", "bytes": "17983" }, { "name": "TeX", "bytes": "1455571" }, { "name": "XSLT", "bytes": "156419" } ], "symlink_target": "" }
/* * This file has been modified by Niel Lebeck to change the access modifiers * of enclosed classes and methods. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. */ /** * @author Vasily Zakharov */ package org.apache.harmony.rmi.compiler; import java.io.File; import org.apache.harmony.rmi.common.RMIUtil; import org.apache.harmony.rmi.internal.nls.Messages; /** * Utility functions for RMI compiler. * * This class cannot be instantiated. * * @author Vasily Zakharov */ public final class RmicUtil implements RmicConstants { /** * This class cannot be instantiated. */ private RmicUtil() {} /** * Returns suitable name for a parameter based on its class name and number. * * @param cls * Parameter class. * * @param number * Parameter number. * * @return Suitable name for a parameter. */ public static String getParameterName(Class cls, int number) { StringBuilder buffer = new StringBuilder(paramPrefix); while (cls.isArray()) { buffer.append(arrayPrefix); cls = cls.getComponentType(); } buffer.append(RMIUtil.getShortName(cls) + '_' + number); return buffer.toString(); } /** * Creates source code fragment for method parameter, * wrapping primitive types into respective Object types. * * @param cls * Parameter class. * * @param varName * Parameter variable name. * * @return Source code fragment for method parameter, * for Object types it's just <code>varName</code>, * for primitive types (e. g. <code>int</code>) * it's a string like this: * <code>"new java.lang.Integer(varName)"</code>. */ static String getObjectParameterString(Class cls, String varName) { return (cls.isPrimitive() ? ("new " + RMIUtil.getWrappingClass(cls).getName() //$NON-NLS-1$ + '(' + varName + ')') : varName); } /** * Returns string with capitalized first letter. * * @param str * String. * * @return String with capitalized first letter, * or string itself if the string is empty. */ static String firstLetterToUpperCase(String str) { int length = str.length(); if (length < 1) { return str; } char[] array = new char[length]; str.getChars(0, length, array, 0); array[0] = Character.toUpperCase(array[0]); return String.copyValueOf(array); } /** * Returns name of the class with capitalized first letter * for primitive classes and <code>Object</code> for non-primitive classes. * * @param cls * Class. * * @return Returns name of the class with capitalized first letter * for primitive classes and <code>Object</code> for non-primitive * classes. */ static String getHandlingType(Class cls) { return (cls.isPrimitive() ? firstLetterToUpperCase(cls.getName()) : "Object"); //$NON-NLS-1$ } /** * Creates source code fragment for reading object from a stream, * correctly handling primitive types. * * @param cls * Class of object being read. * * @param streamName * Name of stream to read variable from. * * @return Source code fragment for reading object, * for Object class it's like * <code>"streamName.readObject()"</code>, * for other Object types (e. g. <code>Vector</code>) * it's a string like this: * <code>"(java.util.Vector) streamName.readObject()"</code>, * for primitive types (e. g. <code>int</code>) * it's a string like this: * <code>"streamName.readInt()"</code>. */ static String getReadObjectString(Class cls, String streamName) { // For primitive types, use respective special read method. // For non-primitive types, use readObject() and cast (if not Object). return (((!cls.isPrimitive() && (cls != Object.class)) ? ('(' + RMIUtil.getCanonicalName(cls) + ") ") : "") //$NON-NLS-1$ //$NON-NLS-2$ + streamName + ".read" + getHandlingType(cls) + "()"); //$NON-NLS-1$ //$NON-NLS-2$ } /** * Creates source code fragment for writing object to a stream, * correctly handling primitive types. * * @param cls * Class of object to write. * * @param varName * Name of the variable to write. * * @param streamName * Name of stream to write variable to. * * @return Source code fragment for writing object, * for object types it's like * <code>"streamName.writeObject(varName)"</code>, * for primitive types (e. g. <code>int</code>) * it's a string like this: * <code>"streamName.writeInt(varName)"</code>. */ static String getWriteObjectString(Class cls, String varName, String streamName) { // For primitive types, use respective special write method. // For non-primitive types, use writeObject(). return (streamName + ".write" + getHandlingType(cls) //$NON-NLS-1$ + '(' + varName +')'); } /** * Creates source code fragment for return object, * correctly de-wrapping primitive types. * * @param cls * Return class. * * @param varName * Return variable name. * * @return Source code fragment for return object, * for {@link Object} class it's just <code>varName</code>, * for other Object types (e. g. <code>Vector</code>) * it's a string like this: * <code>"((java.util.Vector) varName)"</code>, * for primitive types (e. g. <code>int</code>) * it's a string like this: * <code>"((java.lang.Integer) varName).intValue()"</code>. */ public static String getReturnObjectString(Class cls, String varName) { // For Object return type, do nothing. if (cls == Object.class) { return varName; } // For all other types, create the respective cast statement. StringBuilder buffer = new StringBuilder("(("); //$NON-NLS-1$ buffer.append(RMIUtil.getCanonicalName(RMIUtil.getWrappingClass(cls))); buffer.append(") " + varName + ')'); //$NON-NLS-1$ // For primitive types, include case to primitive type. if (cls.isPrimitive()) { buffer.append('.' + cls.getName() + "Value()"); //$NON-NLS-1$ } return buffer.toString(); } /** * Creates a file object for a directory created basing on the specified * base directory and the package name for subdirectory. * * @param base * Base directory. * * @param packageName * Package name (for subdirectory). * * @return File object for a directory like this: * <code>baseDir/my/java/package</code>. * * @throws RMICompilerException * If directory cannot be created. */ static File getPackageDir(String base, String packageName) throws RMICompilerException { File dir = new File(base, (packageName != null) ? packageName : ""); //$NON-NLS-1$ if (dir.exists() ? !dir.isDirectory() : !dir.mkdirs()) { // rmi.4E=Can't create target directory: {0} throw new RMICompilerException(Messages.getString("rmi.4E", dir)); //$NON-NLS-1$ } return dir; } /** * Creates a file object for a file created basing on the specified * directory and the name of file itself. * * @param dir * Directory to create the file in. * * @param fileName * Name of file itself. * * @return File object for a file name like this: * <code>dir/fileName</code>. * * @throws RMICompilerException * If file cannot be created. */ static File getPackageFile(File dir, String fileName) throws RMICompilerException { File file = new File(dir, fileName); if (file.exists() ? !(file.isFile() && file.canWrite()) : !dir.canWrite()) { // rmi.4F=Can't create file: {0} throw new RMICompilerException(Messages.getString("rmi.4F", file)); //$NON-NLS-1$ } return file; } }
{ "content_hash": "0998310645f3155c83cea19c298ad20e", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 98, "avg_line_length": 33.78798586572438, "alnum_prop": 0.5762392804852541, "repo_name": "UWSysLab/Sapphire", "id": "2d1088ec8fedcd3e87bf48fc0974b55408cc0ca0", "size": "9562", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sapphire/app/src/main/java/org/apache/harmony/rmi/compiler/RmicUtil.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "13818" }, { "name": "Java", "bytes": "1224198" }, { "name": "Python", "bytes": "6344" }, { "name": "Shell", "bytes": "98" } ], "symlink_target": "" }
package us.dot.its.jpo.ode.asn1.j2735.msg.ids; public abstract class ConnectedVehicleMessageID { public abstract boolean equals(Object other); public abstract int hashCode(); public abstract String toString(); public abstract long getMessageId(); }
{ "content_hash": "c0ef76881562d47a12f4566a20206e0e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 49, "avg_line_length": 29.333333333333332, "alnum_prop": 0.7613636363636364, "repo_name": "hmusavi/jpo-ode", "id": "32063bf61b98161e4f5cff6aad5423db8b2e3413", "size": "264", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "jpo-ode-core/src/main/java/us/dot/its/jpo/ode/asn1/j2735/msg/ids/ConnectedVehicleMessageID.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1948" }, { "name": "C", "bytes": "4075" }, { "name": "CSS", "bytes": "1617" }, { "name": "HTML", "bytes": "4849" }, { "name": "Java", "bytes": "2739989" }, { "name": "JavaScript", "bytes": "3219" }, { "name": "Shell", "bytes": "7650" } ], "symlink_target": "" }
<h1 ng-click="home.signOut()">LOGGED IN AS: {{home.userEmail}}</h1> <table> <tr class="tableHeader"> <th class="idHeader">ID</th> <th class="descriptionHeader">DESCRIPTION</th> <th class="priorityHeader">PRIORITY</th> <th class="statusHeader">STATUS</th> <th class="actionsHeader">ACTIONS</th> </tr> <input class="inputEdit" ng-model="home.editField" ng-show="home.editingTask"> <button class="saveButton" ng-click="home.updateFirebaseDescription(home.editField, home.indexEdit)" ng-show="home.editingTask">Save</button> <button class="saveButton" ng-click="home.editingTask = false" ng-show="home.editingTask">cancel</button> <tr class="tableRow" ng-repeat="list in home.toDoListFirebase track by $index " ng-show="!home.editingTask"> <td class="idRow">{{list.id}}</td> <td class="descriptionRow"> <h3 class="pEdit">{{list.description}}</h3> <button class="editButton" ng-click="home.editingTask = true; home.indexEdit = $index; home.editField = list.description">Edit</button> </td> <td class="priorityRow">{{list.priority}} <select ng-model="home.changePriority[$index]" ng-change="home.updateFirebasePriority(home.changePriority[$index], $index); home.changeFirebasePriorityColor($index)"> <option value="high">HIGH</option> <option value="medium">MEDIUM</option> <option value="low">LOW</option> </select> </td> <td class="statusRow">{{list.status}} <select ng-model="home.changeStatus[$index]" ng-change="home.updateFirebaseStatus(home.changeStatus[$index], $index)"> <option value="incomplete">INCOMPLETE</option> <option value="complete">COMPLETE</option> </select> </td> <td class="actionsRow"><button ng-click="home.removeFirebaseItem($index)">REMOVE ITEM</button></td> </tr> </table> <input ng-model="home.newToDoItem" type="text"> <button ng-click="home.addRecordToFirebase(home.newToDoItem)">ADD ITEM</button></td> <button ng-click="home.removeAll()">Remove All</button></td>
{ "content_hash": "f54c8144eec3be56368e3c778d3ebf40", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 172, "avg_line_length": 50.85, "alnum_prop": 0.6863323500491643, "repo_name": "rgamaesilva/toDoListAngularFire", "id": "eb6ea2354fa206ee703863bda183d1ef493aab66", "size": "2034", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dist/templates/home.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "282" }, { "name": "HTML", "bytes": "4119" }, { "name": "JavaScript", "bytes": "9566" } ], "symlink_target": "" }
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ /* * This code was generated by https://github.com/googleapis/google-api-java-client-services/ * Modify at your own risk. */ package com.google.api.services.cloudtasks.v2beta3.model; /** * HTTP request. * * The task will be pushed to the worker as an HTTP request. If the worker or the redirected worker * acknowledges the task by returning a successful HTTP response code ([`200` - `299`]), the task * will removed from the queue. If any other HTTP response code is returned or no response is * received, the task will be retried according to the following: * * * User-specified throttling: retry configuration, rate limits, and the queue's state. * * * System throttling: To prevent the worker from overloading, Cloud Tasks may temporarily reduce * the queue's effective rate. User-specified settings will not be changed. * * System throttling happens because: * * * Cloud Tasks backoffs on all errors. Normally the backoff specified in rate limits will be * used. But if the worker returns `429` (Too Many Requests), `503` (Service Unavailable), or * the rate of errors is high, Cloud Tasks will use a higher backoff rate. The retry * specified in the `Retry-After` HTTP response header is considered. * * * To prevent traffic spikes and to smooth sudden large traffic spikes, dispatches ramp up * slowly when the queue is newly created or idle and if large numbers of tasks suddenly become * available to dispatch (due to spikes in create task rates, the queue being unpaused, or many * tasks that are scheduled at the same time). * * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Cloud Tasks API. For a detailed explanation see: * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> * </p> * * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class HttpRequest extends com.google.api.client.json.GenericJson { /** * HTTP request body. * * A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set * body on a task with an incompatible HttpMethod. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String body; /** * HTTP request headers. * * This map contains the header field names and values. Headers can be set when the task is * created. * * These headers represent a subset of the headers that will accompany the task's HTTP request. * Some HTTP request headers will be ignored or replaced. * * A partial list of headers that will be ignored or replaced is: * * * Host: This will be computed by Cloud Tasks and derived from HttpRequest.url. * Content- * Length: This will be computed by Cloud Tasks. * User-Agent: This will be set to `"Google-Cloud- * Tasks"`. * X-Google-*: Google use only. * X-AppEngine-*: Google use only. * * `Content-Type` won't be set by Cloud Tasks. You can explicitly set `Content-Type` to a media * type when the task is created. For example, `Content-Type` can be set to `"application/octet- * stream"` or `"application/json"`. * * Headers which can have multiple values (according to RFC2616) can be specified using comma- * separated values. * * The size of the headers must be less than 80KB. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.util.Map<String, java.lang.String> headers; /** * The HTTP method to use for the request. The default is POST. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String httpMethod; /** * If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be * generated and attached as an `Authorization` header in the HTTP request. * * This type of authorization should generally only be used when calling Google APIs hosted on * *.googleapis.com. * The value may be {@code null}. */ @com.google.api.client.util.Key private OAuthToken oauthToken; /** * If specified, an [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) token * will be generated and attached as an `Authorization` header in the HTTP request. * * This type of authorization can be used for many scenarios, including calling Cloud Run, or * endpoints where you intend to validate the token yourself. * The value may be {@code null}. */ @com.google.api.client.util.Key private OidcToken oidcToken; /** * Required. The full url path that the request will be sent to. * * This string must begin with either "http://" or "https://". Some examples are: * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will encode some characters * for safety and compatibility. The maximum allowed URL length is 2083 characters after encoding. * * The `Location` header response from a redirect response [`300` - `399`] may be followed. The * redirect is not counted as a separate attempt. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String url; /** * HTTP request body. * * A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set * body on a task with an incompatible HttpMethod. * @see #decodeBody() * @return value or {@code null} for none */ public java.lang.String getBody() { return body; } /** * HTTP request body. * * A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set * body on a task with an incompatible HttpMethod. * @see #getBody() * @return Base64 decoded value or {@code null} for none * * @since 1.14 */ public byte[] decodeBody() { return com.google.api.client.util.Base64.decodeBase64(body); } /** * HTTP request body. * * A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set * body on a task with an incompatible HttpMethod. * @see #encodeBody() * @param body body or {@code null} for none */ public HttpRequest setBody(java.lang.String body) { this.body = body; return this; } /** * HTTP request body. * * A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set * body on a task with an incompatible HttpMethod. * @see #setBody() * * <p> * The value is encoded Base64 or {@code null} for none. * </p> * * @since 1.14 */ public HttpRequest encodeBody(byte[] body) { this.body = com.google.api.client.util.Base64.encodeBase64URLSafeString(body); return this; } /** * HTTP request headers. * * This map contains the header field names and values. Headers can be set when the task is * created. * * These headers represent a subset of the headers that will accompany the task's HTTP request. * Some HTTP request headers will be ignored or replaced. * * A partial list of headers that will be ignored or replaced is: * * * Host: This will be computed by Cloud Tasks and derived from HttpRequest.url. * Content- * Length: This will be computed by Cloud Tasks. * User-Agent: This will be set to `"Google-Cloud- * Tasks"`. * X-Google-*: Google use only. * X-AppEngine-*: Google use only. * * `Content-Type` won't be set by Cloud Tasks. You can explicitly set `Content-Type` to a media * type when the task is created. For example, `Content-Type` can be set to `"application/octet- * stream"` or `"application/json"`. * * Headers which can have multiple values (according to RFC2616) can be specified using comma- * separated values. * * The size of the headers must be less than 80KB. * @return value or {@code null} for none */ public java.util.Map<String, java.lang.String> getHeaders() { return headers; } /** * HTTP request headers. * * This map contains the header field names and values. Headers can be set when the task is * created. * * These headers represent a subset of the headers that will accompany the task's HTTP request. * Some HTTP request headers will be ignored or replaced. * * A partial list of headers that will be ignored or replaced is: * * * Host: This will be computed by Cloud Tasks and derived from HttpRequest.url. * Content- * Length: This will be computed by Cloud Tasks. * User-Agent: This will be set to `"Google-Cloud- * Tasks"`. * X-Google-*: Google use only. * X-AppEngine-*: Google use only. * * `Content-Type` won't be set by Cloud Tasks. You can explicitly set `Content-Type` to a media * type when the task is created. For example, `Content-Type` can be set to `"application/octet- * stream"` or `"application/json"`. * * Headers which can have multiple values (according to RFC2616) can be specified using comma- * separated values. * * The size of the headers must be less than 80KB. * @param headers headers or {@code null} for none */ public HttpRequest setHeaders(java.util.Map<String, java.lang.String> headers) { this.headers = headers; return this; } /** * The HTTP method to use for the request. The default is POST. * @return value or {@code null} for none */ public java.lang.String getHttpMethod() { return httpMethod; } /** * The HTTP method to use for the request. The default is POST. * @param httpMethod httpMethod or {@code null} for none */ public HttpRequest setHttpMethod(java.lang.String httpMethod) { this.httpMethod = httpMethod; return this; } /** * If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be * generated and attached as an `Authorization` header in the HTTP request. * * This type of authorization should generally only be used when calling Google APIs hosted on * *.googleapis.com. * @return value or {@code null} for none */ public OAuthToken getOauthToken() { return oauthToken; } /** * If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be * generated and attached as an `Authorization` header in the HTTP request. * * This type of authorization should generally only be used when calling Google APIs hosted on * *.googleapis.com. * @param oauthToken oauthToken or {@code null} for none */ public HttpRequest setOauthToken(OAuthToken oauthToken) { this.oauthToken = oauthToken; return this; } /** * If specified, an [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) token * will be generated and attached as an `Authorization` header in the HTTP request. * * This type of authorization can be used for many scenarios, including calling Cloud Run, or * endpoints where you intend to validate the token yourself. * @return value or {@code null} for none */ public OidcToken getOidcToken() { return oidcToken; } /** * If specified, an [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) token * will be generated and attached as an `Authorization` header in the HTTP request. * * This type of authorization can be used for many scenarios, including calling Cloud Run, or * endpoints where you intend to validate the token yourself. * @param oidcToken oidcToken or {@code null} for none */ public HttpRequest setOidcToken(OidcToken oidcToken) { this.oidcToken = oidcToken; return this; } /** * Required. The full url path that the request will be sent to. * * This string must begin with either "http://" or "https://". Some examples are: * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will encode some characters * for safety and compatibility. The maximum allowed URL length is 2083 characters after encoding. * * The `Location` header response from a redirect response [`300` - `399`] may be followed. The * redirect is not counted as a separate attempt. * @return value or {@code null} for none */ public java.lang.String getUrl() { return url; } /** * Required. The full url path that the request will be sent to. * * This string must begin with either "http://" or "https://". Some examples are: * `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will encode some characters * for safety and compatibility. The maximum allowed URL length is 2083 characters after encoding. * * The `Location` header response from a redirect response [`300` - `399`] may be followed. The * redirect is not counted as a separate attempt. * @param url url or {@code null} for none */ public HttpRequest setUrl(java.lang.String url) { this.url = url; return this; } @Override public HttpRequest set(String fieldName, Object value) { return (HttpRequest) super.set(fieldName, value); } @Override public HttpRequest clone() { return (HttpRequest) super.clone(); } }
{ "content_hash": "9944b9121c23294ebf5724a436fff76d", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 182, "avg_line_length": 38.590529247910865, "alnum_prop": 0.6922910350801212, "repo_name": "googleapis/google-api-java-client-services", "id": "9ae787a30ef0ff254164d655979a50ec24b6127d", "size": "13854", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "clients/google-api-services-cloudtasks/v2beta3/1.27.0/com/google/api/services/cloudtasks/v2beta3/model/HttpRequest.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<resources> <string name="app_name">Weight Log</string> <string name="open_nav_drawer">Open navigation drawer.</string> <string name="close_nav_drawer">Close navigation drawer.</string> <string name="nav_drawer_menu_log">Log</string> <string name="nav_drawer_menu_import_export">Import / Export</string> <string name="nav_drawer_menu_stats">Statistics</string> <string name="nav_drawer_menu_settings">Settings</string> <string name="graph_title">Weight Over Time</string> <string name="graph_domain_title">date</string> <string name="graph_range_title">kg</string> <string name="graph_weight_series_title">weight</string> <string name="import_export_location_label">Location</string> <string name="import_export_import_button">Import</string> <string name="import_export_export_button">Export</string> <string name="import_export_file_not_found_exception">File not found!</string> <string name="import_export_read_io_exception">Can\'t read file!</string> <string name="import_export_write_io_exception">Can\'t write to file!</string> <string name="import_export_external_storage_unmounted">External storage not available!</string> <string name="add_weight_dialog_title">Current body weight</string> <string name="add_weight_dialog_ok_button">@android:string/ok</string> <string name="add_weight_dialog_cancel_button">@android:string/cancel</string> <string name="delete_weight_dialog_title">Delete?</string> <string name="delete_weight_dialog_ok_button">@android:string/ok</string> <string name="delete_weight_dialog_cancel_button">@android:string/cancel</string> <string name="import_dialog_title">Import data</string> <string name="import_dialog_ok_button">@android:string/ok</string> <string name="import_dialog_cancel_button">@android:string/cancel</string> <string name="export_dialog_title">Export data</string> <string name="export_dialog_ok_button">@android:string/ok</string> <string name="export_dialog_cancel_button">@android:string/cancel</string> <string name="import_notification_title">Import</string> <string name="import_notification_file_not_found_exception">File not found!</string> <string name="import_notification_io_exception">Can\'t read file!</string> <string name="export_notification_title">Export</string> <string name="export_notification_io_exception">Can\'t write to file!</string> <string name="weight_log_remove_snack_undo">UNDO</string> <string name="weight_log_context_menu_delete">Delete</string> <string name="preference_category_data">Data</string> <string name="preference_import">Import</string> <string name="preference_import_progress">Importing…</string> <string name="preference_import_summary">Import from file \"weight_log.csv\"</string> <string name="preference_export">Export</string> <string name="preference_export_progress">Exporting…</string> <string name="preference_export_summary">Export to file \"weight_log.csv\"</string> </resources>
{ "content_hash": "09fca5dccde2a84672e9aa5d671e87f6", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 100, "avg_line_length": 54.01754385964912, "alnum_prop": 0.7232867814225398, "repo_name": "halfbull/WeightLog", "id": "b30e72db30fb3e2be4595b4be8312345549dded8", "size": "3083", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/values/strings.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "77214" } ], "symlink_target": "" }
/* K&R getline */ int getline(char *, int lim); /* Run through each line or input string */ void runner(char *); /* Check for syntax errors */ int checkSyntax(char c); int i = 0; /* reusable counter */
{ "content_hash": "39fcfa3d69d2b46270c68479234f0242", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 43, "avg_line_length": 25.375, "alnum_prop": 0.6551724137931034, "repo_name": "msnorm/forums", "id": "1b915ebb01ea36fc7ec2110702b3e24ce370c3d2", "size": "203", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "kandr/ex1-24/ex1-24.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "27058" }, { "name": "Python", "bytes": "57428" }, { "name": "Shell", "bytes": "12087" } ], "symlink_target": "" }
![jsinspect](http://danielstjules.com/github/jsinspect-logo.png) Detect copy-pasted and structurally similar code. The inspector identifies duplicate code, even if modified, as well as common boilerplate or logic that should be the target of refactoring. [![Build Status](https://travis-ci.org/danielstjules/jsinspect.svg?branch=master)](https://travis-ci.org/danielstjules/jsinspect) * [Overview](#overview) * [Installation](#installation) * [Usage](#usage) * [Integration](#integration) * [Reporters](#reporters) * [Performance](#performance) ## Overview We've all had to deal with code smell, and duplicate code is a common source. While some instances are easy to spot, this type of searching is the perfect use-case for a helpful CLI tool. Existing solutions do exist for this purpose, but are often token-based and rely on string searching methods such as the Rabin–Karp algorithm. Why isn't this always ideal? Those tools may struggle with code that has wildly varying identifiers, despite having the same structure and behavior. And copy-pasted code is but one type of code duplication. Common boilerplate and repeated logic can be identified as well using jsinspect, since it doesn't work on tokens - it uses the ASTs of the parsed code. You have the freedom to specify a threshold determining the smallest subset of nodes to analyze. This will identify code with a similar structure, based on the AST node types, e.g. BlockStatement, VariableDeclaration, ObjectExpression, etc. For copy-paste oriented detection, you can even limit the search to nodes with matching identifiers. The tool accepts a list of paths to parse, and outputs any matches along with a series of 2-way diffs. Any directories among the paths are walked recursively, and only `.js` files are analyzed. Any `node_modules` and `bower_components` dirs are also ignored. Being built for JavaScript, it also ignores ES6 module declarations, CommonJS require statements, and AMD define expressions. ![screenshot](http://danielstjules.com/github/jsinspect-example.png) ## Installation It can be installed via `npm` using: ``` bash npm install -g jsinspect ``` Also available: [grunt-jsinspect](https://github.com/stefanjudis/grunt-jsinspect), and [gulp-jsinspect](https://github.com/alexeyraspopov/gulp-jsinspect) ## Usage ``` Usage: jsinspect [options] <paths ...> Duplicate code and structure detection for JavaScript. Identifier matching is disabled by default. Example use: jsinspect -t 30 -i --ignore "Test.js" ./path/to/src Options: -h, --help output usage information -V, --version output the version number -t, --threshold <number> number of nodes (default: 15) -i, --identifiers match identifiers -j --jsx process jsx files (default off) -c, --config path to config file (default: .jsinspectrc) -r, --reporter [default|json|pmd] specify the reporter to use -s, --suppress <number> length to suppress diffs (default: 100, off: 0) -D, --no-diff disable 2-way diffs -C, --no-color disable colors --ignore <pattern> ignore paths matching a regex ``` If a `.jsinspectrc` file is located in the project directory, its values will be used in place of the defaults listed above. For example: ``` javascript { "threshold": 30, "identifiers": true, "ignore": "Test.js|Spec.js", // used as RegExp, "reporter": "json", "suppress": 100 } ``` On first use with a project, you may want to run the tool with the following options, while running explicitly on the lib/src directories, and not the test/spec dir. ``` jsinspect -t 30 -i ./path/to/src ``` From there, feel free to try incrementally decreasing the threshold and ignoring identifiers. A threshold of 20 may lead you to discover new areas of interest for refactoring or cleanup. Each project or library may be different. ## Integration It's simple to run jsinspect on your library source as part of a build process. It will exit with an error code of 0 when no matches are found, resulting in a passing step, and a positive error code corresponding to its failure. For example, with Travis CI, you could add the following entries to your `.travis.yml`: ``` yaml before_script: - "npm install -g jsinspect" script: - "jsinspect -t 30 ./path/to/src" ``` Note that in the above example, we're using a threshold of 30 for detecting structurally similar code. A lower threshold may work for your build process, but ~30 should help detect unnecessary boilerplate, while avoiding excessive output. To have jsinspect run with each job, but not block or fail the build, you can use something like the following: ``` yaml script: - "jsinspect -t 30 ./path/to/src || true" ``` ## Reporters Aside from the default reporter, both JSON and PMD CPD-style XML reporters are available. Note that in the JSON example below, indentation and formatting has been applied. #### JSON ``` json [{ "instances":[ {"path":"spec/fixtures/intersection.js","lines":[1,5]}, {"path":"spec/fixtures/intersection.js","lines":[7,11]} ], "diffs":[ { "-":{"path":"spec/fixtures/intersection.js","lines":[1,5]}, "+":{"path":"spec/fixtures/intersection.js","lines":[7,11]}, "diff":"- function intersectionA(array1, array2) {\n- array1.filter(function(n) {\n- return array2.indexOf(n) != -1;\n+ function intersectionB(arrayA, arrayB) {\n+ arrayA.filter(function(n) {\n+ return arrayB.indexOf(n) != -1;\n });\n }\n" } ] }] ``` #### PMD CPD XML ``` xml <?xml version="1.0" encoding="utf-8"?> <pmd-cpd> <duplication lines="10"> <file path="/jsinspect/spec/fixtures/intersection.js" line="1"/> <file path="/jsinspect/spec/fixtures/intersection.js" line="7"/> <codefragment> - spec/fixtures/intersection.js:1,5 + spec/fixtures/intersection.js:7,11 - function intersectionA(array1, array2) { - array1.filter(function(n) { - return array2.indexOf(n) != -1; + function intersectionB(arrayA, arrayB) { + arrayA.filter(function(n) { + return arrayB.indexOf(n) != -1; }); } </codefragment> </duplication> </pmd-cpd> ``` ## Performance Running on a medium sized code base, with a 2.4Ghz i5 MPB, yielded the following results: ``` bash $ find src/ -name '*.js' | xargs wc -l # ... 44810 total $ time jsinspect -t 30 src/ # Looking for structural similarities.. 41 matches found across 800 files real 0m1.542s user 0m1.472s sys 0m0.071s $ time jsinspect -i -t 15 src/ # Looking for copy-pasted code.. 96 matches found across 800 files real 0m1.283s user 0m1.196s sys 0m0.084s ``` Much of the overhead comes from diff generation, so a greater number of matches will increase running time.
{ "content_hash": "933866418c958345c61634f90bd85a39", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 269, "avg_line_length": 32.19718309859155, "alnum_prop": 0.7045785943423739, "repo_name": "beni55/jsinspect", "id": "69c92be2c1094e2ff07f929e4b7cad3239da7479", "size": "6860", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "57471" } ], "symlink_target": "" }
using System; namespace Incontrl.Sdk.Models { public class Tracker { public Guid Id { get; set; } public string Type { get; set; } public string Url { get; set; } public string DocumentUrl { get; set; } } public class DocumentTracking { public int Reads { get; set; } public string Recipient { get; set; } public DateTime Created { get; set; } public DateTime? LastRead { get; set; } } public class UpdateDocumentTrackingRequest { public int Reads { get; set; } public DateTime? LastRead { get; set; } } }
{ "content_hash": "2e051cc004e2da949c35632b14597cb6", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 47, "avg_line_length": 24.076923076923077, "alnum_prop": 0.5782747603833865, "repo_name": "indice-co/Incontrl.Net", "id": "7cc8246ffe536cda69cd600851e172bd9758b060", "size": "628", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Incontrl.Sdk/Models/DocumentTracking.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "319183" } ], "symlink_target": "" }
WebdriverIO Selenium Standalone Service ======================================= Handling the Selenium server is out of the scope of the actual WebdriverIO project. This service helps you to run Selenium seamlessly when running tests with the [WDIO testrunner](https://webdriver.io/guide/testrunner/gettingstarted). It uses the well-known [selenium-standalone](https://www.npmjs.com/package/selenium-standalone) NPM package that automatically sets up the standalone server and all required drivers for you. __Note:__ If you use this service you don't need any other driver services (e.g. [wdio-chromedriver-service](https://www.npmjs.com/package/wdio-chromedriver-service)) anymore. All local browsers can be started using this service. ## Installation Before starting make sure you have JDK installed. The easiest way is to keep `@wdio/selenium-standalone-service` as a devDependency in your `package.json`. You can do it by: ```sh npm install @wdio/selenium-standalone-service --save-dev ``` Instructions on how to install `WebdriverIO` can be found [here.](https://webdriver.io/docs/gettingstarted) ## Configuration By default, ChromeDriver, Geckodriver and some other browser drivers based on the OS are available when installed on the user's system. To use the service you need to add `selenium-standalone` to your service array: ```js /** * simplified mode (available since v6.11.0) * set `true` to use the version provided by `selenium-standalone`, 'latest' by default */ export const config = { // ... services: [ ['selenium-standalone', { drivers: { firefox: '0.29.1', chrome: true, chromiumedge: 'latest' } }] ], // ... }; ``` Control browser driver installation/running separately. ```js // wdio.conf.js const drivers = { chrome: { version: '91.0.4472.101' }, // https://chromedriver.chromium.org/ firefox: { version: '0.29.1' }, // https://github.com/mozilla/geckodriver/releases chromiumedge: { version: '85.0.564.70' } // https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ } export const config = { // ... services: [ ['selenium-standalone', { logPath: 'logs', installArgs: { drivers }, // drivers to install args: { drivers } // drivers to use }] ], // ... }; ``` ### Custom Configurations By default the service starts on `localhost:4444` and ensures that all capabilities are able to connect to it. If you prefer to run on a different port please specify `port` as an option in your capabilities, e.g.: ```js // wdio.conf.js export const config = { // ... services: [ ['selenium-standalone', { logPath: './temp', args: { version: "3.141.59", seleniumArgs: ['-host', '127.0.0.1','-port', '5555'] }, }] ], capabilities: [{ browserName: 'chrome', port: 5555 }, { browserName: 'firefox', port: 5555 }, { browserName: 'MicrosoftEdge', port: 5555 }] // ... } ``` ## Options The following options can be added to the wdio.conf.js file. ### logPath Path where all logs from the Selenium server should be stored. Type: `String` Default: `{}` Example: ```js logPath : './', ``` ### [`args`](https://github.com/vvo/selenium-standalone/blob/HEAD/docs/API.md#seleniumstartopts) Map of arguments for the Selenium server, passed directly to `Selenium.start()`. Please note that latest drivers have to be installed, see `installArgs`. Type: `Object` Default: `{}` Example: ```js args: { version : "3.141.59", drivers : { chrome : { version : "91.0.4472.101", arch : process.arch } } }, ``` ### [`installArgs`](https://github.com/vvo/selenium-standalone/blob/HEAD/docs/API.md#seleniuminstallopts) Map of arguments for the Selenium server, passed directly to `Selenium.install()`. By default, versions will be installed based on what is set in the selenium-standalone package. The defaults can be overridden by specifying the versions. Type: `Object` Default: `{}` Example: ```js installArgs: { version : "3.141.59", baseURL : "https://github.com/SeleniumHQ/selenium/releases/download", drivers : { chrome : { version : "91.0.4472.101", arch : process.arch, baseURL : "https://chromedriver.storage.googleapis.com" } } }, ``` ### skipSeleniumInstall Boolean for skipping `selenium-standalone` server install. Type: `Boolean` Default: `false` ---- For more information on WebdriverIO see the [homepage](https://webdriver.io).
{ "content_hash": "f77453b19b80c95dfb754a504fb50f49", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 425, "avg_line_length": 28.839506172839506, "alnum_prop": 0.6508989726027398, "repo_name": "webdriverio/webdriverio", "id": "4c679c987838dc9c1fb015793e982a328e8d0c49", "size": "4672", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "packages/wdio-selenium-standalone-service/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "25022" }, { "name": "Dockerfile", "bytes": "600" }, { "name": "EJS", "bytes": "31368" }, { "name": "Gherkin", "bytes": "2916" }, { "name": "JavaScript", "bytes": "166511" }, { "name": "Shell", "bytes": "171" }, { "name": "TypeScript", "bytes": "3000925" } ], "symlink_target": "" }
layout: doc title: Editing the Wiki OSM permalink: /hr/intermediate/editing-the-wiki/ lang: hr category: intermediate --- Editing the OSM Wiki ==================== This guide is available in [English as a Google document](https://docs.google.com/document/d/1G2LrM0ASKh7X175Hi16srnOBtofmsZwlj5x7EJTvi1g/edit) or Please refer to it in [French](/fr/intermediate/editing-the-wiki/) To help produce translations for this site, go to [https://www.transifex.com](https://www.transifex.com) and search for **HOT-OSM**.
{ "content_hash": "6f32e02470276346921b9351dddcf805", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 145, "avg_line_length": 34.53333333333333, "alnum_prop": 0.7393822393822393, "repo_name": "feyeandal/test", "id": "97ea88d8e9b7a3f3ba7c6689d49706438b37d2f2", "size": "522", "binary": false, "copies": "4", "ref": "refs/heads/local", "path": "_posts/hr/intermediate/0300-12-25-editing-the-wiki.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "18164" }, { "name": "HTML", "bytes": "21833" }, { "name": "JavaScript", "bytes": "838" }, { "name": "Python", "bytes": "9017" }, { "name": "Ruby", "bytes": "2880" } ], "symlink_target": "" }
// --------------------------------------------------------------------------- // // @file TwOpenGLCore.cpp // @author Philippe Decaudin // @license This file is part of the AntTweakBar library. // For conditions of distribution and use, see License.txt // // --------------------------------------------------------------------------- /* #pragma warning GL3 //// used for development #define GL3_PROTOTYPES 1 //// #include <GL3/gl3.h> //// #define ANT_OGL_HEADER_INCLUDED //// */ #include "TwPrecomp.h" #if defined ANT_OSX # include <OpenGL/gl3.h> # define ANT_OGL_HEADER_INCLUDED #else # include <gl/GL.h> #endif #include "LoadOGLCore.h" #include "TwOpenGLCore.h" #include "TwMgr.h" #include <iostream> using namespace std; extern const char *g_ErrCantLoadOGL; extern const char *g_ErrCantUnloadOGL; // --------------------------------------------------------------------------- //#ifdef _DEBUG #if 0 static void CheckGLCoreError(const char *file, int line, const char *func) { int err=0; char msg[256]; #ifdef ANT_WINDOWS if(!wglGetCurrentContext()) return; #endif while( (err=_glGetError())!=0 ) { sprintf(msg, "%s(%d) : [%s] GL_CORE_ERROR=0x%x\n", file, line, func, err); #ifdef ANT_WINDOWS OutputDebugStringA(msg); #endif fprintf(stderr, msg); } } # ifdef __FUNCTION__ # define CHECK_GL_ERROR CheckGLCoreError(__FILE__, __LINE__, __FUNCTION__) # else # define CHECK_GL_ERROR CheckGLCoreError(__FILE__, __LINE__, "") # endif #else # define CHECK_GL_ERROR ((void)(0)) #endif // --------------------------------------------------------------------------- static GLuint BindFont(const CTexFont *_Font) { GLuint TexID = 0; _glGenTextures(1, &TexID); _glBindTexture(GL_TEXTURE_2D, TexID); _glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); _glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); _glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); _glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); _glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); _glPixelStorei(GL_UNPACK_ALIGNMENT, 1); _glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, _Font->m_TexWidth, _Font->m_TexHeight, 0, GL_RED, GL_UNSIGNED_BYTE, _Font->m_TexBytes); _glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); _glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); _glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_NEAREST); _glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST); _glBindTexture(GL_TEXTURE_2D, 0); return TexID; } static void UnbindFont(GLuint _FontTexID) { if( _FontTexID>0 ) _glDeleteTextures(1, &_FontTexID); } // --------------------------------------------------------------------------- static GLuint CompileShader(GLuint shader) { _glCompileShader(shader); CHECK_GL_ERROR; GLint status; _glGetShaderiv(shader, GL_COMPILE_STATUS, &status); CHECK_GL_ERROR; if (status == GL_FALSE) { GLint infoLogLength; _glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLogLength); CHECK_GL_ERROR; GLchar strInfoLog[256]; _glGetShaderInfoLog(shader, sizeof(strInfoLog), NULL, strInfoLog); CHECK_GL_ERROR; #ifdef ANT_WINDOWS OutputDebugStringA("Compile failure: "); OutputDebugStringA(strInfoLog); OutputDebugStringA("\n"); #endif fprintf(stderr, "Compile failure: %s\n", strInfoLog); shader = 0; } return shader; } static GLuint LinkProgram(GLuint program) { _glLinkProgram(program); CHECK_GL_ERROR; GLint status; _glGetProgramiv(program, GL_LINK_STATUS, &status); CHECK_GL_ERROR; if (status == GL_FALSE) { GLint infoLogLength; _glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLogLength); CHECK_GL_ERROR; GLchar strInfoLog[256]; _glGetProgramInfoLog(program, sizeof(strInfoLog), NULL, strInfoLog); CHECK_GL_ERROR; #ifdef ANT_WINDOWS OutputDebugStringA("Linker failure: "); OutputDebugStringA(strInfoLog); OutputDebugStringA("\n"); #endif fprintf(stderr, "Linker failure: %s\n", strInfoLog); program = 0; } return program; } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::ResizeTriBuffers(size_t _NewSize) { m_TriBufferSize = _NewSize; _glBindVertexArray(m_TriVArray); _glBindBuffer(GL_ARRAY_BUFFER, m_TriVertices); _glBufferData(GL_ARRAY_BUFFER, m_TriBufferSize*sizeof(Vec2), 0, GL_DYNAMIC_DRAW); _glBindBuffer(GL_ARRAY_BUFFER, m_TriUVs); _glBufferData(GL_ARRAY_BUFFER, m_TriBufferSize*sizeof(Vec2), 0, GL_DYNAMIC_DRAW); _glBindBuffer(GL_ARRAY_BUFFER, m_TriColors); _glBufferData(GL_ARRAY_BUFFER, m_TriBufferSize*sizeof(color32), 0, GL_DYNAMIC_DRAW); CHECK_GL_ERROR; } // --------------------------------------------------------------------------- int CTwGraphOpenGLCore::Init() { m_Drawing = false; m_FontTexID = 0; m_FontTex = NULL; if( LoadOpenGLCore()==0 ) { g_TwMgr->SetLastError(g_ErrCantLoadOGL); return 0; } // Create line/rect shaders const GLchar *lineRectVS[] = { "#version 150 core\n" "in vec3 vertex;" "in vec4 color;" "out vec4 fcolor;" "void main() { gl_Position = vec4(vertex, 1); fcolor = color; }" }; m_LineRectVS = _glCreateShader(GL_VERTEX_SHADER); _glShaderSource(m_LineRectVS, 1, lineRectVS, NULL); CompileShader(m_LineRectVS); const GLchar *lineRectFS[] = { "#version 150 core\n" "precision highp float;" "in vec4 fcolor;" "out vec4 outColor;" "void main() { outColor = fcolor; }" }; m_LineRectFS = _glCreateShader(GL_FRAGMENT_SHADER); _glShaderSource(m_LineRectFS, 1, lineRectFS, NULL); CompileShader(m_LineRectFS); m_LineRectProgram = _glCreateProgram(); _glAttachShader(m_LineRectProgram, m_LineRectVS); _glAttachShader(m_LineRectProgram, m_LineRectFS); _glBindAttribLocation(m_LineRectProgram, 0, "vertex"); _glBindAttribLocation(m_LineRectProgram, 1, "color"); LinkProgram(m_LineRectProgram); // Create line/rect vertex buffer const GLfloat lineRectInitVertices[] = { 0,0,0, 0,0,0, 0,0,0, 0,0,0 }; const color32 lineRectInitColors[] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; _glGenVertexArrays(1, &m_LineRectVArray); _glBindVertexArray(m_LineRectVArray); _glGenBuffers(1, &m_LineRectVertices); _glBindBuffer(GL_ARRAY_BUFFER, m_LineRectVertices); _glBufferData(GL_ARRAY_BUFFER, sizeof(lineRectInitVertices), lineRectInitVertices, GL_DYNAMIC_DRAW); _glGenBuffers(1, &m_LineRectColors); _glBindBuffer(GL_ARRAY_BUFFER, m_LineRectColors); _glBufferData(GL_ARRAY_BUFFER, sizeof(lineRectInitColors), lineRectInitColors, GL_DYNAMIC_DRAW); // Create triangles shaders const GLchar *triVS[] = { "#version 150 core\n" "uniform vec2 offset;" "uniform vec2 wndSize;" "in vec2 vertex;" "in vec4 color;" "out vec4 fcolor;" "void main() { gl_Position = vec4(2.0*(vertex.x+offset.x-0.5)/wndSize.x - 1.0, 1.0 - 2.0*(vertex.y+offset.y-0.5)/wndSize.y, 0, 1); fcolor = color; }" }; m_TriVS = _glCreateShader(GL_VERTEX_SHADER); _glShaderSource(m_TriVS, 1, triVS, NULL); CompileShader(m_TriVS); const GLchar *triUniVS[] = { "#version 150 core\n" "uniform vec2 offset;" "uniform vec2 wndSize;" "uniform vec4 color;" "in vec2 vertex;" "out vec4 fcolor;" "void main() { gl_Position = vec4(2.0*(vertex.x+offset.x-0.5)/wndSize.x - 1.0, 1.0 - 2.0*(vertex.y+offset.y-0.5)/wndSize.y, 0, 1); fcolor = color; }" }; m_TriUniVS = _glCreateShader(GL_VERTEX_SHADER); _glShaderSource(m_TriUniVS, 1, triUniVS, NULL); CompileShader(m_TriUniVS); m_TriFS = m_TriUniFS = m_LineRectFS; m_TriProgram = _glCreateProgram(); _glAttachShader(m_TriProgram, m_TriVS); _glAttachShader(m_TriProgram, m_TriFS); _glBindAttribLocation(m_TriProgram, 0, "vertex"); _glBindAttribLocation(m_TriProgram, 1, "color"); LinkProgram(m_TriProgram); m_TriLocationOffset = _glGetUniformLocation(m_TriProgram, "offset"); m_TriLocationWndSize = _glGetUniformLocation(m_TriProgram, "wndSize"); m_TriUniProgram = _glCreateProgram(); _glAttachShader(m_TriUniProgram, m_TriUniVS); _glAttachShader(m_TriUniProgram, m_TriUniFS); _glBindAttribLocation(m_TriUniProgram, 0, "vertex"); _glBindAttribLocation(m_TriUniProgram, 1, "color"); LinkProgram(m_TriUniProgram); m_TriUniLocationOffset = _glGetUniformLocation(m_TriUniProgram, "offset"); m_TriUniLocationWndSize = _glGetUniformLocation(m_TriUniProgram, "wndSize"); m_TriUniLocationColor = _glGetUniformLocation(m_TriUniProgram, "color"); const GLchar *triTexFS[] = { "#version 150 core\n" "precision highp float;" "uniform sampler2D tex;" "in vec2 fuv;" "in vec4 fcolor;" "out vec4 outColor;" // texture2D is deprecated and replaced by texture with GLSL 3.30 but it seems // that on Mac Lion backward compatibility is not ensured. #if defined(ANT_OSX) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070) "void main() { outColor.rgb = fcolor.bgr; outColor.a = fcolor.a * texture(tex, fuv).r; }" #else "void main() { outColor.rgb = fcolor.bgr; outColor.a = fcolor.a * texture2D(tex, fuv).r; }" #endif }; m_TriTexFS = _glCreateShader(GL_FRAGMENT_SHADER); _glShaderSource(m_TriTexFS, 1, triTexFS, NULL); CompileShader(m_TriTexFS); const GLchar *triTexVS[] = { "#version 150 core\n" "uniform vec2 offset;" "uniform vec2 wndSize;" "in vec2 vertex;" "in vec2 uv;" "in vec4 color;" "out vec2 fuv;" "out vec4 fcolor;" "void main() { gl_Position = vec4(2.0*(vertex.x+offset.x-0.5)/wndSize.x - 1.0, 1.0 - 2.0*(vertex.y+offset.y-0.5)/wndSize.y, 0, 1); fuv = uv; fcolor = color; }" }; m_TriTexVS = _glCreateShader(GL_VERTEX_SHADER); _glShaderSource(m_TriTexVS, 1, triTexVS, NULL); CompileShader(m_TriTexVS); const GLchar *triTexUniVS[] = { "#version 150 core\n" "uniform vec2 offset;" "uniform vec2 wndSize;" "uniform vec4 color;" "in vec2 vertex;" "in vec2 uv;" "out vec4 fcolor;" "out vec2 fuv;" "void main() { gl_Position = vec4(2.0*(vertex.x+offset.x-0.5)/wndSize.x - 1.0, 1.0 - 2.0*(vertex.y+offset.y-0.5)/wndSize.y, 0, 1); fuv = uv; fcolor = color; }" }; m_TriTexUniVS = _glCreateShader(GL_VERTEX_SHADER); _glShaderSource(m_TriTexUniVS, 1, triTexUniVS, NULL); CompileShader(m_TriTexUniVS); m_TriTexUniFS = m_TriTexFS; m_TriTexProgram = _glCreateProgram(); _glAttachShader(m_TriTexProgram, m_TriTexVS); _glAttachShader(m_TriTexProgram, m_TriTexFS); _glBindAttribLocation(m_TriTexProgram, 0, "vertex"); _glBindAttribLocation(m_TriTexProgram, 1, "uv"); _glBindAttribLocation(m_TriTexProgram, 2, "color"); LinkProgram(m_TriTexProgram); m_TriTexLocationOffset = _glGetUniformLocation(m_TriTexProgram, "offset"); m_TriTexLocationWndSize = _glGetUniformLocation(m_TriTexProgram, "wndSize"); m_TriTexLocationTexture = _glGetUniformLocation(m_TriTexProgram, "tex"); m_TriTexUniProgram = _glCreateProgram(); _glAttachShader(m_TriTexUniProgram, m_TriTexUniVS); _glAttachShader(m_TriTexUniProgram, m_TriTexUniFS); _glBindAttribLocation(m_TriTexUniProgram, 0, "vertex"); _glBindAttribLocation(m_TriTexUniProgram, 1, "uv"); _glBindAttribLocation(m_TriTexUniProgram, 2, "color"); LinkProgram(m_TriTexUniProgram); m_TriTexUniLocationOffset = _glGetUniformLocation(m_TriTexUniProgram, "offset"); m_TriTexUniLocationWndSize = _glGetUniformLocation(m_TriTexUniProgram, "wndSize"); m_TriTexUniLocationColor = _glGetUniformLocation(m_TriTexUniProgram, "color"); m_TriTexUniLocationTexture = _glGetUniformLocation(m_TriTexUniProgram, "tex"); // Create tri vertex buffer _glGenVertexArrays(1, &m_TriVArray); _glGenBuffers(1, &m_TriVertices); _glGenBuffers(1, &m_TriUVs); _glGenBuffers(1, &m_TriColors); ResizeTriBuffers(16384); // set initial size CHECK_GL_ERROR; return 1; } // --------------------------------------------------------------------------- int CTwGraphOpenGLCore::Shut() { assert(m_Drawing==false); UnbindFont(m_FontTexID); CHECK_GL_ERROR; _glDeleteProgram(m_LineRectProgram); m_LineRectProgram = 0; _glDeleteShader(m_LineRectVS); m_LineRectVS = 0; _glDeleteShader(m_LineRectFS); m_LineRectFS = 0; _glDeleteProgram(m_TriProgram); m_TriProgram = 0; _glDeleteShader(m_TriVS); m_TriVS = 0; _glDeleteProgram(m_TriUniProgram); m_TriUniProgram = 0; _glDeleteShader(m_TriUniVS); m_TriUniVS = 0; _glDeleteProgram(m_TriTexProgram); m_TriTexProgram = 0; _glDeleteShader(m_TriTexVS); m_TriTexVS = 0; _glDeleteShader(m_TriTexFS); m_TriTexFS = 0; _glDeleteProgram(m_TriTexUniProgram); m_TriTexUniProgram = 0; _glDeleteShader(m_TriTexUniVS); m_TriTexUniVS = 0; _glDeleteBuffers(1, &m_LineRectVertices); m_LineRectVertices = 0; _glDeleteBuffers(1, &m_LineRectColors); m_LineRectColors = 0; _glDeleteVertexArrays(1, &m_LineRectVArray); m_LineRectVArray = 0; _glDeleteBuffers(1, &m_TriVertices); m_TriVertices = 0; _glDeleteBuffers(1, &m_TriColors); m_TriColors = 0; _glDeleteBuffers(1, &m_TriUVs); m_TriUVs = 0; _glDeleteVertexArrays(1, &m_TriVArray); m_TriVArray = 0; CHECK_GL_ERROR; int Res = 1; if( UnloadOpenGLCore()==0 ) { g_TwMgr->SetLastError(g_ErrCantUnloadOGL); Res = 0; } return Res; } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::BeginDraw(int _WndWidth, int _WndHeight) { CHECK_GL_ERROR; assert(m_Drawing==false && _WndWidth>0 && _WndHeight>0); m_Drawing = true; m_WndWidth = _WndWidth; m_WndHeight = _WndHeight; m_OffsetX = 0; m_OffsetY = 0; // _glGetIntegerv(GL_VIEWPORT, m_PrevViewport); CHECK_GL_ERROR; if( _WndWidth>0 && _WndHeight>0 ) { GLint Vp[4]; Vp[0] = 0; Vp[1] = 0; Vp[2] = _WndWidth-1; Vp[3] = _WndHeight-1; _glViewport(Vp[0], Vp[1], Vp[2], Vp[3]); } // m_PrevVArray = 0; // _glGetIntegerv(GL_VERTEX_ARRAY_BINDING, (GLint*)&m_PrevVArray); CHECK_GL_ERROR; _glBindVertexArray(0); CHECK_GL_ERROR; // m_PrevLineWidth = 1; // _glGetFloatv(GL_LINE_WIDTH, &m_PrevLineWidth); CHECK_GL_ERROR; _glLineWidth(1); CHECK_GL_ERROR; // m_PrevLineSmooth = _glIsEnabled(GL_LINE_SMOOTH); _glDisable(GL_LINE_SMOOTH); CHECK_GL_ERROR; // m_PrevCullFace = _glIsEnabled(GL_CULL_FACE); CullFaceEnable( false ); // m_PrevDepthTest = _glIsEnabled(GL_DEPTH_TEST); _glDisable(GL_DEPTH_TEST); CHECK_GL_ERROR; // m_PrevBlend = _glIsEnabled(GL_BLEND); _glEnable(GL_BLEND); CHECK_GL_ERROR; // m_PrevScissorTest = _glIsEnabled(GL_SCISSOR_TEST); _glDisable(GL_SCISSOR_TEST); CHECK_GL_ERROR; // _glGetIntegerv(GL_SCISSOR_BOX, m_PrevScissorBox); CHECK_GL_ERROR; // _glGetIntegerv(GL_BLEND_SRC, &m_PrevSrcBlend); CHECK_GL_ERROR; // _glGetIntegerv(GL_BLEND_DST, &m_PrevDstBlend); CHECK_GL_ERROR; _glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); CHECK_GL_ERROR; // m_PrevTexture = 0; // _glGetIntegerv(GL_TEXTURE_BINDING_2D, &m_PrevTexture); CHECK_GL_ERROR; _glBindTexture(GL_TEXTURE_2D, 0); CHECK_GL_ERROR; m_PrevProgramObject = 0; // _glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*)&m_PrevProgramObject); CHECK_GL_ERROR; _glBindVertexArray(0); CHECK_GL_ERROR; _glUseProgram(0); CHECK_GL_ERROR; // m_PrevActiveTexture = 0; // _glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint*)&m_PrevActiveTexture); CHECK_GL_ERROR; _glActiveTexture(GL_TEXTURE0); CHECK_GL_ERROR; } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::EndDraw() { assert(m_Drawing==true); m_Drawing = false; /* _glLineWidth(m_PrevLineWidth); CHECK_GL_ERROR; if( m_PrevLineSmooth ) { _glEnable(GL_LINE_SMOOTH); CHECK_GL_ERROR; } else { _glDisable(GL_LINE_SMOOTH); CHECK_GL_ERROR; } if( m_PrevCullFace ) { _glEnable(GL_CULL_FACE); CHECK_GL_ERROR; } else { _glDisable(GL_CULL_FACE); CHECK_GL_ERROR; } if( m_PrevDepthTest ) { _glEnable(GL_DEPTH_TEST); CHECK_GL_ERROR; } else { _glDisable(GL_DEPTH_TEST); CHECK_GL_ERROR; } if( m_PrevBlend ) { _glEnable(GL_BLEND); CHECK_GL_ERROR; } else { _glDisable(GL_BLEND); CHECK_GL_ERROR; } if( m_PrevScissorTest ) { _glEnable(GL_SCISSOR_TEST); CHECK_GL_ERROR; } else { _glDisable(GL_SCISSOR_TEST); CHECK_GL_ERROR; } _glScissor(m_PrevScissorBox[0], m_PrevScissorBox[1], m_PrevScissorBox[2], m_PrevScissorBox[3]); CHECK_GL_ERROR; _glBlendFunc(m_PrevSrcBlend, m_PrevDstBlend); CHECK_GL_ERROR; _glBindTexture(GL_TEXTURE_2D, m_PrevTexture); CHECK_GL_ERROR; // _glUseProgram(m_PrevProgramObject); CHECK_GL_ERROR; _glBindVertexArray(m_PrevVArray); CHECK_GL_ERROR; _glViewport(m_PrevViewport[0], m_PrevViewport[1], m_PrevViewport[2], m_PrevViewport[3]); CHECK_GL_ERROR; CHECK_GL_ERROR;*/ } // --------------------------------------------------------------------------- bool CTwGraphOpenGLCore::IsDrawing() { return m_Drawing; } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::Restore() { UnbindFont(m_FontTexID); m_FontTexID = 0; m_FontTex = NULL; } // --------------------------------------------------------------------------- static inline float ToNormScreenX(float x, int wndWidth) { return 2.0f*((float)x-0.5f)/wndWidth - 1.0f; } static inline float ToNormScreenY(float y, int wndHeight) { return 1.0f - 2.0f*((float)y-0.5f)/wndHeight; } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::DrawLine(int _X0, int _Y0, int _X1, int _Y1, color32 _Color0, color32 _Color1, bool _AntiAliased) { CHECK_GL_ERROR; assert(m_Drawing==true); //const GLfloat dx = +0.0f; const GLfloat dx = 0; //GLfloat dy = -0.2f; const GLfloat dy = -0.5f; if( _AntiAliased ) _glEnable(GL_LINE_SMOOTH); else _glDisable(GL_LINE_SMOOTH); _glBindVertexArray(m_LineRectVArray); GLfloat x0 = ToNormScreenX(_X0+dx + m_OffsetX, m_WndWidth); GLfloat y0 = ToNormScreenY(_Y0+dy + m_OffsetY, m_WndHeight); GLfloat x1 = ToNormScreenX(_X1+dx + m_OffsetX, m_WndWidth); GLfloat y1 = ToNormScreenY(_Y1+dy + m_OffsetY, m_WndHeight); GLfloat vertices[] = { x0,y0,0, x1,y1,0 }; _glBindBuffer(GL_ARRAY_BUFFER, m_LineRectVertices); _glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices); _glVertexAttribPointer(0, 3, GL_FLOAT, GL_TRUE, 0, NULL); _glEnableVertexAttribArray(0); color32 colors[] = { _Color0, _Color1 }; _glBindBuffer(GL_ARRAY_BUFFER, m_LineRectColors); _glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(colors), colors); _glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, NULL); _glEnableVertexAttribArray(1); _glUseProgram(m_LineRectProgram); _glDrawArrays(GL_LINES, 0, 2); if( _AntiAliased ) _glDisable(GL_LINE_SMOOTH); CHECK_GL_ERROR; } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::DrawRect(int _X0, int _Y0, int _X1, int _Y1, color32 _Color00, color32 _Color10, color32 _Color01, color32 _Color11) { CHECK_GL_ERROR; assert(m_Drawing==true); // border adjustment if(_X0<_X1) ++_X1; else if(_X0>_X1) ++_X0; if(_Y0<_Y1) --_Y0; else if(_Y0>_Y1) --_Y1; _glBindVertexArray(m_LineRectVArray); GLfloat x0 = ToNormScreenX((float)_X0 + m_OffsetX, m_WndWidth); GLfloat y0 = ToNormScreenY((float)_Y0 + m_OffsetY, m_WndHeight); GLfloat x1 = ToNormScreenX((float)_X1 + m_OffsetX, m_WndWidth); GLfloat y1 = ToNormScreenY((float)_Y1 + m_OffsetY, m_WndHeight); GLfloat vertices[] = { x0,y0,0, x1,y0,0, x0,y1,0, x1,y1,0 }; _glBindBuffer(GL_ARRAY_BUFFER, m_LineRectVertices); _glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices); _glVertexAttribPointer(0, 3, GL_FLOAT, GL_TRUE, 0, NULL); _glEnableVertexAttribArray(0); GLuint colors[] = { _Color00, _Color10, _Color01, _Color11 }; _glBindBuffer(GL_ARRAY_BUFFER, m_LineRectColors); _glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(colors), colors); _glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, NULL); _glEnableVertexAttribArray(1); _glUseProgram(m_LineRectProgram); _glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); CHECK_GL_ERROR; } // --------------------------------------------------------------------------- void *CTwGraphOpenGLCore::NewTextObj() { return new CTextObj; } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::DeleteTextObj(void *_TextObj) { assert(_TextObj!=NULL); delete static_cast<CTextObj *>(_TextObj); } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::BuildText(void *_TextObj, const std::string *_TextLines, color32 *_LineColors, color32 *_LineBgColors, int _NbLines, const CTexFont *_Font, int _Sep, int _BgWidth) { assert(m_Drawing==true); assert(_TextObj!=NULL); assert(_Font!=NULL); if( _Font != m_FontTex ) { UnbindFont(m_FontTexID); m_FontTexID = BindFont(_Font); m_FontTex = _Font; } CTextObj *TextObj = static_cast<CTextObj *>(_TextObj); TextObj->m_TextVerts.resize(0); TextObj->m_TextUVs.resize(0); TextObj->m_BgVerts.resize(0); TextObj->m_Colors.resize(0); TextObj->m_BgColors.resize(0); int x, x1, y, y1, i, Len; unsigned char ch; const unsigned char *Text; color32 LineColor = COLOR32_RED; for( int Line=0; Line<_NbLines; ++Line ) { x = 0; y = Line * (_Font->m_CharHeight+_Sep); y1 = y+_Font->m_CharHeight; Len = (int)_TextLines[Line].length(); Text = (const unsigned char *)(_TextLines[Line].c_str()); if( _LineColors!=NULL ) LineColor = (_LineColors[Line]&0xff00ff00) | GLubyte(_LineColors[Line]>>16) | (GLubyte(_LineColors[Line])<<16); for( i=0; i<Len; ++i ) { ch = Text[i]; x1 = x + _Font->m_CharWidth[ch]; TextObj->m_TextVerts.push_back(Vec2(x , y )); TextObj->m_TextVerts.push_back(Vec2(x1, y )); TextObj->m_TextVerts.push_back(Vec2(x , y1)); TextObj->m_TextVerts.push_back(Vec2(x1, y )); TextObj->m_TextVerts.push_back(Vec2(x1, y1)); TextObj->m_TextVerts.push_back(Vec2(x , y1)); TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU0[ch], _Font->m_CharV0[ch])); TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU1[ch], _Font->m_CharV0[ch])); TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU0[ch], _Font->m_CharV1[ch])); TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU1[ch], _Font->m_CharV0[ch])); TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU1[ch], _Font->m_CharV1[ch])); TextObj->m_TextUVs.push_back(Vec2(_Font->m_CharU0[ch], _Font->m_CharV1[ch])); if( _LineColors!=NULL ) { TextObj->m_Colors.push_back(LineColor); TextObj->m_Colors.push_back(LineColor); TextObj->m_Colors.push_back(LineColor); TextObj->m_Colors.push_back(LineColor); TextObj->m_Colors.push_back(LineColor); TextObj->m_Colors.push_back(LineColor); } x = x1; } if( _BgWidth>0 ) { TextObj->m_BgVerts.push_back(Vec2(-1 , y )); TextObj->m_BgVerts.push_back(Vec2(_BgWidth+1, y )); TextObj->m_BgVerts.push_back(Vec2(-1 , y1)); TextObj->m_BgVerts.push_back(Vec2(_BgWidth+1, y )); TextObj->m_BgVerts.push_back(Vec2(_BgWidth+1, y1)); TextObj->m_BgVerts.push_back(Vec2(-1 , y1)); if( _LineBgColors!=NULL ) { color32 LineBgColor = (_LineBgColors[Line]&0xff00ff00) | GLubyte(_LineBgColors[Line]>>16) | (GLubyte(_LineBgColors[Line])<<16); TextObj->m_BgColors.push_back(LineBgColor); TextObj->m_BgColors.push_back(LineBgColor); TextObj->m_BgColors.push_back(LineBgColor); TextObj->m_BgColors.push_back(LineBgColor); TextObj->m_BgColors.push_back(LineBgColor); TextObj->m_BgColors.push_back(LineBgColor); } } } } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::DrawText(void *_TextObj, int _X, int _Y, color32 _Color, color32 _BgColor) { CHECK_GL_ERROR; assert(m_Drawing==true); assert(_TextObj!=NULL); CTextObj *TextObj = static_cast<CTextObj *>(_TextObj); if( TextObj->m_TextVerts.size()<4 && TextObj->m_BgVerts.size()<4 ) return; // nothing to draw // draw character background triangles if( (_BgColor!=0 || TextObj->m_BgColors.size()==TextObj->m_BgVerts.size()) && TextObj->m_BgVerts.size()>=4 ) { size_t numBgVerts = TextObj->m_BgVerts.size(); if( numBgVerts > m_TriBufferSize ) ResizeTriBuffers(numBgVerts + 2048); _glBindVertexArray(m_TriVArray); _glBindBuffer(GL_ARRAY_BUFFER, m_TriVertices); _glBufferSubData(GL_ARRAY_BUFFER, 0, numBgVerts*sizeof(Vec2), &(TextObj->m_BgVerts[0])); _glVertexAttribPointer(0, 2, GL_FLOAT, GL_TRUE, 0, NULL); _glEnableVertexAttribArray(0); _glDisableVertexAttribArray(1); _glDisableVertexAttribArray(2); if( TextObj->m_BgColors.size()==TextObj->m_BgVerts.size() && _BgColor==0 ) { _glBindBuffer(GL_ARRAY_BUFFER, m_TriColors); _glBufferSubData(GL_ARRAY_BUFFER, 0, numBgVerts*sizeof(color32), &(TextObj->m_BgColors[0])); _glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, NULL); _glEnableVertexAttribArray(1); _glUseProgram(m_TriProgram); _glUniform2f(m_TriLocationOffset, (float)_X, (float)_Y); _glUniform2f(m_TriLocationWndSize, (float)m_WndWidth, (float)m_WndHeight); } else { _glUseProgram(m_TriUniProgram); _glUniform4f(m_TriUniLocationColor, GLfloat((_BgColor>>16)&0xff)/256.0f, GLfloat((_BgColor>>8)&0xff)/256.0f, GLfloat(_BgColor&0xff)/256.0f, GLfloat((_BgColor>>24)&0xff)/256.0f); _glUniform2f(m_TriUniLocationOffset, (float)_X, (float)_Y); _glUniform2f(m_TriUniLocationWndSize, (float)m_WndWidth, (float)m_WndHeight); } _glDrawArrays(GL_TRIANGLES, 0, (GLsizei)TextObj->m_BgVerts.size()); } // draw character triangles if( TextObj->m_TextVerts.size()>=4 ) { _glActiveTexture(GL_TEXTURE0); _glBindTexture(GL_TEXTURE_2D, m_FontTexID); size_t numTextVerts = TextObj->m_TextVerts.size(); if( numTextVerts > m_TriBufferSize ) ResizeTriBuffers(numTextVerts + 2048); _glBindVertexArray(m_TriVArray); _glDisableVertexAttribArray(2); _glBindBuffer(GL_ARRAY_BUFFER, m_TriVertices); _glBufferSubData(GL_ARRAY_BUFFER, 0, numTextVerts*sizeof(Vec2), &(TextObj->m_TextVerts[0])); _glVertexAttribPointer(0, 2, GL_FLOAT, GL_TRUE, 0, NULL); _glEnableVertexAttribArray(0); _glBindBuffer(GL_ARRAY_BUFFER, m_TriUVs); _glBufferSubData(GL_ARRAY_BUFFER, 0, numTextVerts*sizeof(Vec2), &(TextObj->m_TextUVs[0])); _glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, NULL); _glEnableVertexAttribArray(1); if( TextObj->m_Colors.size()==TextObj->m_TextVerts.size() && _Color==0 ) { _glBindBuffer(GL_ARRAY_BUFFER, m_TriColors); _glBufferSubData(GL_ARRAY_BUFFER, 0, numTextVerts*sizeof(color32), &(TextObj->m_Colors[0])); _glVertexAttribPointer(2, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, NULL); _glEnableVertexAttribArray(2); _glUseProgram(m_TriTexProgram); _glUniform2f(m_TriTexLocationOffset, (float)_X, (float)_Y); _glUniform2f(m_TriTexLocationWndSize, (float)m_WndWidth, (float)m_WndHeight); _glUniform1i(m_TriTexLocationTexture, 0); } else { _glUseProgram(m_TriTexUniProgram); _glUniform4f(m_TriTexUniLocationColor, GLfloat((_Color>>16)&0xff)/256.0f, GLfloat((_Color>>8)&0xff)/256.0f, GLfloat(_Color&0xff)/256.0f, GLfloat((_Color>>24)&0xff)/256.0f); _glUniform2f(m_TriTexUniLocationOffset, (float)_X, (float)_Y); _glUniform2f(m_TriTexUniLocationWndSize, (float)m_WndWidth, (float)m_WndHeight); _glUniform1i(m_TriTexUniLocationTexture, 0); } _glDrawArrays(GL_TRIANGLES, 0, (GLsizei)TextObj->m_TextVerts.size()); } CHECK_GL_ERROR; } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::ChangeViewport(int _X0, int _Y0, int _Width, int _Height, int _OffsetX, int _OffsetY) { // glViewport impacts the NDC; use glScissor instead m_OffsetX = _X0 + _OffsetX; m_OffsetY = _Y0 + _OffsetY; SetScissor(_X0, _Y0, _Width, _Height); } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::RestoreViewport() { m_OffsetX = m_OffsetY = 0; SetScissor(0, 0, 0, 0); } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::SetScissor(int _X0, int _Y0, int _Width, int _Height) { if( _Width>0 && _Height>0 ) { _glScissor(_X0-1, m_WndHeight-_Y0-_Height, _Width-1, _Height); _glEnable(GL_SCISSOR_TEST); } else _glDisable(GL_SCISSOR_TEST); } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::CullFaceEnable( bool enable ) { m_PrevCullFaceEnabled = enable; if( m_PrevCullFaceEnabled ) _glEnable( GL_CULL_FACE ); else _glDisable( GL_CULL_FACE ); } void CTwGraphOpenGLCore::SaveCullFaceEnabled() { m_SavedCullFaceEnabled = m_PrevCullFaceEnabled; } void CTwGraphOpenGLCore::RestoreCullFaceEnabled() { m_PrevCullFaceEnabled = m_SavedCullFaceEnabled; if( m_PrevCullFaceEnabled ) _glEnable( GL_CULL_FACE ); else _glDisable( GL_CULL_FACE ); } // --------------------------------------------------------------------------- void CTwGraphOpenGLCore::DrawTriangles(int _NumTriangles, int *_Vertices, color32 *_Colors, Cull _CullMode) { assert(m_Drawing==true); const GLfloat dx = +0.0f; const GLfloat dy = +0.0f; // Backup states SaveCullFaceEnabled(); _glCullFace(GL_BACK); if( _CullMode==CULL_CW ) { CullFaceEnable( true ); _glFrontFace(GL_CCW); } else if( _CullMode==CULL_CCW ) { CullFaceEnable( true ); _glFrontFace(GL_CW); } else CullFaceEnable( false ); _glUseProgram(m_TriProgram); _glBindVertexArray(m_TriVArray); _glUniform2f(m_TriLocationOffset, (float)m_OffsetX+dx, (float)m_OffsetY+dy); _glUniform2f(m_TriLocationWndSize, (float)m_WndWidth, (float)m_WndHeight); _glDisableVertexAttribArray(2); size_t numVerts = 3*_NumTriangles; if( numVerts > m_TriBufferSize ) ResizeTriBuffers(numVerts + 2048); _glBindBuffer(GL_ARRAY_BUFFER, m_TriVertices); _glBufferSubData(GL_ARRAY_BUFFER, 0, numVerts*2*sizeof(int), _Vertices); _glVertexAttribPointer(0, 2, GL_INT, GL_FALSE, 0, NULL); _glEnableVertexAttribArray(0); _glBindBuffer(GL_ARRAY_BUFFER, m_TriColors); _glBufferSubData(GL_ARRAY_BUFFER, 0, numVerts*sizeof(color32), _Colors); _glVertexAttribPointer(1, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, NULL); _glEnableVertexAttribArray(1); _glDrawArrays(GL_TRIANGLES, 0, (GLsizei)numVerts); // Reset states RestoreCullFaceEnabled(); CHECK_GL_ERROR; } // ---------------------------------------------------------------------------
{ "content_hash": "061620fcac8db6e29c0bf9bca7e00e17", "timestamp": "", "source": "github", "line_count": 964, "max_line_length": 189, "avg_line_length": 34.149377593360995, "alnum_prop": 0.5969015795868773, "repo_name": "sosolimited/Cinder", "id": "8874b220006fa08e4a95025ea03b0530fc65bb1d", "size": "32920", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/AntTweakBar/TwOpenGLCore.cpp", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "21049461" }, { "name": "C++", "bytes": "15725341" }, { "name": "CMake", "bytes": "1511" }, { "name": "GLSL", "bytes": "6897" }, { "name": "HLSL", "bytes": "1954" }, { "name": "Makefile", "bytes": "56239" }, { "name": "Objective-C", "bytes": "503599" }, { "name": "Objective-C++", "bytes": "257617" }, { "name": "Python", "bytes": "171254" }, { "name": "Shell", "bytes": "761" } ], "symlink_target": "" }
project_path: /web/_project.yaml book_path: /web/updates/_book.yaml description: The virtual viewport seperates layout and viewing of the viewport. {# wf_updated_on: 2015-01-19 #} {# wf_published_on: 2015-01-19 #} {# wf_tags: news,virtualviewport #} # What the Virtual Viewport? {: .page-title } {% include "web/_shared/contributors/mattgaunt.html" %} In [Chrome M40](https://code.google.com/p/chromium/issues/detail?id=148816) there is a change to the viewport that is pretty subtle, but should make a big difference to users. When mobile browsers started out, the lack of a viewport meta tag meant they would make the web page think it had approximately 980px of screen real estate and render at this size. With a viewport meta tag, developers could define the width, most common of which is "device-width", which sets the screen size to that of the device. You can [learn more on Web Fundamentals](/web/fundamentals/design-and-ui/responsive/fundamentals/set-the-viewport). The way [Rick Byers](https://plus.google.com/+RickByers/about) describes the virtual viewport is as follows: the idea of the virtual viewport is to split the notion of "the viewport" into two, "the layout viewport" (where fixed position items are attached) and "the visual viewport" (What the users actually see). ## **Super Simple Example** The website videojs.com is a good example because it's appbar is fixed to the top and has links on both the left and right side of the appbar. The image below shows what you would see if you zoomed in on a site and tried panning left and right. The top devices are Chrome M39, which doesn't have a virtual viewport and the bottom 3 are from Chrome M40, which has a virtual viewport. <p style="text-align: center;"> <img style="max-width: 100%; height: auto;" src="/web/updates/images/2015-01-19-virtual-viewport/image00.png" alt="pixelated rendering" /> </p> <p style="text-align: center;"> <img style="max-width: 100%; height: auto;" src="/web/updates/images/2015-01-19-virtual-viewport/image01.png" alt="pixelated rendering" /> </p> In Chrome M39, you will see the appbar after you zoom in, but scrolling to the right doesn't allow you to view the links on the right side of the bar, you'll only ever see the logo. Compare this to Chrome M40 (which has a "virtual viewport") and you'll see that the "visual viewport" scrolls everything inside the "layout viewport", allowing you to view the links on the right. Internet Explorer already has this behaviour and these changes bring us more closely inline with them. ### html { overflow: hidden; } The only major developer facing change that comes with this is that in M39, you could apply overflow: hidden to the html element and your page would still scroll, in M40, this is no longer supported, the page will simply not scroll. ### **More Solid Info** You want to learn more huh? Well then, you can view the slide deck below OR check out [Rick's Google+ Post](https://plus.google.com/+RickByers/posts/bpxrWN4G3X5), which you really should do since he's much better at this stuff than me ;) <p style="text-align: center;"> <iframe src="https://docs.google.com/presentation/embed?id=1nJvJqL2dw5STi5FFpR6tP371vSpDWWs5Beksbfitpzc&amp;start=false&amp;loop=false&amp;" frameborder="0" style="max-width: 600px; width: 100%; height: 400px;"></iframe> </p> {% include "comment-widget.html" %}
{ "content_hash": "6b13ce3619a315f74203af4395df5d57", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 232, "avg_line_length": 44.671052631578945, "alnum_prop": 0.7525773195876289, "repo_name": "robdodson/WebFundamentals", "id": "5bd1c431141e0f6a2487b947552a98bd8795f2af", "size": "3395", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/content/en/updates/2015/01/What-the-Viewport.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "19211" }, { "name": "HTML", "bytes": "430053" }, { "name": "JavaScript", "bytes": "218301" }, { "name": "Python", "bytes": "247837" }, { "name": "Shell", "bytes": "270" }, { "name": "Smarty", "bytes": "20750" } ], "symlink_target": "" }
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> </head> <body> <?PHP error_reporting(-1); ?> <style> body {padding:0px;} #overlay { position: fixed; display: none; z-index: 10; height: 100%; width: 100%; background-image: url(bgtrans.png); } #overlay #overlay-content { background-color: white; position: absolute; z-index: 10; left: 20%; top: 20%; min-height: 60%; width: 60%; box-shadow: 10px 10px 10px #888888; border-radius: 10px; background-image: url(../images/popup-title-bg.png); background-repeat: repeat-x; background-position: left top; /*border: 1px solid #fff;*/ } #overlay #overlay-content #overlay-title { position: relative; float: left; width: 100%; color: #FFF; font-size: 1.2em; line-height: 2em; text-align: center; } #overlay #overlay-content #overlay-text { background-color: #fff; position: relative; clear: both; float: left; width: 96%; color: #000; font-size: 1em; line-height: 1.4em; text-align: center; padding: 2%; max-height: 450px; overflow: auto; } #close {border-radius:15px; width:1%; padding:25px; background-color:white;} .ro {border-radius:15px;} </style> <!-- start of popup overlay !--> <div id="overlay" > <div id="overlay-content" class="ro"> <div id="close">X</div> <div id="overlay-title"> </div> <div id="overlay-text"> <h1>Modal Working</h1> <p>Some content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and content and that's it.</p> </div> <div style="clear: both;"></div> </div> <div style="clear: both;"></div> </div> <!-- end of popup overlay !--> <a href = "#" title="Modal Title" class="show-overlay" id="accidentLocation">Location (click to view/amend)</a> <!-- The title above sets the title of the modal. The ID corresponds to what goes in the popup-call.php file. If you add a : after the page in the id e.g. accidentLocation:123, it will send the text within the form post. --> <?php if($_POST['callPage'] == "accidentLocation") { require("popups/accidentLocation.php"); } ?> <script> $(".show-overlay").click(function(e) { $("#overlay").show(); $("#overlay #overlay-content #overlay-title").text($(this).attr("title")); var pageValues = $(this).attr("id").split(":"); var callPage = pageValues[0]; var callValues = pageValues[1]; }) $.post( "pages/popup-call.php", { callPage: callPage, callValues: callValues }) .done(function( data ) { $("#overlay #overlay-content #overlay-text").html(data); }); }); $("#close").click(function(e) { $("#overlay").hide(); }); $("#overlay").hide(); </script> <!-- The overlay is an image over the entire page and sits something that looks like a modal box on top. It calls the popup-call.php page and dumps the content into the modal box. --> </body> </html>
{ "content_hash": "d6b9ceb27f55a9da207b89389b536934", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 490, "avg_line_length": 25.383561643835616, "alnum_prop": 0.5866162978953049, "repo_name": "CommLegal/experts-select", "id": "2c431966ab5c554e1f0fdd29678c69fc8ef9a073", "size": "3706", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "testings.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "3760" }, { "name": "CSS", "bytes": "78282" }, { "name": "HTML", "bytes": "206288" }, { "name": "JavaScript", "bytes": "391050" }, { "name": "PHP", "bytes": "1623085" } ], "symlink_target": "" }
''' ==================================================================== Copyright (c) 2016 Barry A Scott. All rights reserved. This software is licensed as described in the file LICENSE.txt, which you should have received as part of this distribution. ==================================================================== wb_hg_commit_dialog.py ''' from PyQt5 import QtWidgets from PyQt5 import QtCore import wb_main_window import wb_tracked_qwidget import wb_ui_components import wb_scm_table_view # # add tool bars and menu for use in the commit window # class HgCommitWindowComponents(wb_ui_components.WbMainWindowComponents): def __init__( self, factory ): super().__init__( 'hg', factory ) def setupTableContextMenu( self, m, addMenu ): super().setupTableContextMenu( m, addMenu ) act = self.ui_actions m.addSection( T_('Diff') ) addMenu( m, T_('Diff HEAD vs. Working'), act.tableActionHgDiffHeadVsWorking, act.enablerHgDiffHeadVsWorking, 'toolbar_images/diff.png' ) m.addSection( T_('Hg Actions') ) addMenu( m, T_('Add'), act.tableActionHgAdd_Bg, act.enablerHgFilesAdd, 'toolbar_images/include.png' ) m.addSeparator() addMenu( m, T_('Revert'), act.tableActionHgRevert_Bg, act.enablerHgFilesRevert, 'toolbar_images/revert.png' ) addMenu( m, T_('Delete…'), act.tableActionHgDelete_Bg, act.main_window.table_view.enablerTableFilesExists ) def setupToolBarAtLeft( self, addToolBar, addTool ): t = addToolBar( T_('hg logo'), style='font-size: 20pt; width: 40px; color: #cc0000' ) self.all_toolbars.append( t ) addTool( t, 'Hg', self.main_window.projectActionSettings ) def setupToolBarAtRight( self, addToolBar, addTool ): act = self.ui_actions # ---------------------------------------- t = addToolBar( T_('hg info') ) self.all_toolbars.append( t ) addTool( t, T_('Diff'), act.tableActionHgDiffSmart, act.enablerHgDiffSmart, 'toolbar_images/diff.png' ) addTool( t, T_('Commit History'), act.tableActionHgLogHistory_Bg, act.enablerHgLogHistory, 'toolbar_images/history.png' ) # ---------------------------------------- t = addToolBar( T_('hg state') ) self.all_toolbars.append( t ) addTool( t, T_('Add'), act.tableActionHgAdd_Bg, act.enablerHgFilesAdd, 'toolbar_images/include.png' ) addTool( t, T_('Revert'), act.tableActionHgRevert_Bg, act.enablerHgFilesRevert, 'toolbar_images/revert.png' ) class WbHgCommitDialog(wb_main_window.WbMainWindow, wb_tracked_qwidget.WbTrackedModeless): commitAccepted = QtCore.pyqtSignal() commitClosed = QtCore.pyqtSignal() def __init__( self, app, hg_project ): self.__pyqt_bug_already_closed_why_call_close_event_again = False self.app = app self.hg_project = hg_project self.table_view = None super().__init__( app, app.debug_options.debugLogMainWindow ) self.ui_component = HgCommitWindowComponents( self.app.getScmFactory( 'hg' ) ) self.setWindowTitle( T_('Commit %(project_name)s - %(app_name)s') % {'project_name': hg_project.projectName() ,'app_name': ' '.join( app.app_name_parts )} ) self.setWindowIcon( self.app.getAppQIcon() ) # on Qt on macOS table will trigger selectionChanged that needs table_model self.table_view = wb_scm_table_view.WbScmTableView( self.app, self ) self.all_included_files = set() self.table_view.setIncludedFilesSet( self.all_included_files ) # unchanged files should not be interesting for a commit self.table_view.setShowControlledAndNotChangedFiles( False ) self.ui_component.setTopWindow( self.app.top_window ) self.ui_component.setMainWindow( self, self.table_view ) # setup the chrome self.setupMenuBar( self.menuBar() ) self.setupToolBar() self.__setupTableContextMenu() # ---------------------------------------- self.filter_text = QtWidgets.QLineEdit() self.filter_text.setClearButtonEnabled( True ) self.filter_text.setMaxLength( 256 ) self.filter_text.setPlaceholderText( T_('Filter by name') ) self.filter_text.textChanged.connect( self.table_view.table_sortfilter.setFilterText ) self.h_filter_layout = QtWidgets.QHBoxLayout() self.h_filter_widget = QtWidgets.QWidget() self.h_filter_widget.setLayout( self.h_filter_layout ) self.h_filter_layout.addWidget( QtWidgets.QLabel( T_('Filter:') ), 0 ) self.h_filter_layout.addWidget( self.filter_text, 1 ) self.v_table_layout = QtWidgets.QVBoxLayout() self.v_table_layout.addWidget( self.h_filter_widget ) self.v_table_layout.addWidget( self.table_view ) self.v_table_widget = QtWidgets.QWidget() self.v_table_widget.setLayout( self.v_table_layout ) self.label_message = QtWidgets.QLabel( T_('Commit Log Message') ) self.message = QtWidgets.QPlainTextEdit( '' ) self.v_message_layout = QtWidgets.QVBoxLayout() self.v_message_layout.addWidget( self.label_message ) self.v_message_layout.addWidget( self.message ) self.v_message_widget = QtWidgets.QWidget() self.v_message_widget.setLayout( self.v_message_layout ) self.buttons = QtWidgets.QDialogButtonBox() self.ok_button = self.buttons.addButton( self.buttons.Ok ) self.buttons.addButton( self.buttons.Cancel ) # ---------------------------------------- self.v_split = QtWidgets.QSplitter() self.v_split.setOrientation( QtCore.Qt.Vertical ) self.v_split.addWidget( self.v_table_widget ) self.v_split.addWidget( self.v_message_widget ) # ---------------------------------------- self.layout = QtWidgets.QVBoxLayout() self.layout.addWidget( self.v_split ) self.layout.addWidget( self.buttons ) # ---------------------------------------- self.widget = QtWidgets.QWidget() self.widget.setLayout( self.layout ) self.setCentralWidget( self.widget ) em = self.app.fontMetrics().width( 'm' ) ex = self.app.fontMetrics().lineSpacing() self.resize( 100*em, 50*ex ) self.ok_button.setEnabled( False ) # connections self.buttons.accepted.connect( self.handleAccepted ) self.buttons.rejected.connect( self.close ) self.message.textChanged.connect( self.enableOkButton ) def completeInit( self ): self.debugLog( 'completeInit()' ) # set focus self.message.setFocus() self.updateTableView() # Qt has a habit of resetting the column widths # completeInit will set to the designed width self.table_view.completeInit() # set splitter position table_size_ratio = 0.7 height = sum( self.v_split.sizes() ) table_height = int( height * table_size_ratio ) message_height = height - table_height self.v_split.setSizes( [table_height, message_height] ) self.updateActionEnabledStates() def setupMenuBar( self, mb ): m = mb.addMenu( T_('&View') ) tv = self.table_view self._addMenu( m, T_('Show Controlled and Changed files'), tv.setShowControlledAndChangedFiles, checker=tv.checkerShowControlledAndChangedFiles ) self._addMenu( m, T_('Show Controlled and Not Changed files'), tv.setShowControlledAndNotChangedFiles, checker=tv.checkerShowControlledAndNotChangedFiles ) self._addMenu( m, T_('Show Uncontrolled files'), tv.setShowUncontrolledFiles, checker=tv.checkerShowUncontrolledFiles ) self._addMenu( m, T_('Show Ignored files'), tv.setShowIgnoredFiles, checker=tv.checkerShowIgnoredFiles ) m = mb.addMenu( T_('File &Actions') ) self._addMenu( m, T_('Edit'), self.table_view.tableActionEdit, self.table_view.enablerTableFilesExists, 'toolbar_images/edit.png' ) self._addMenu( m, T_('Open'), self.table_view.tableActionOpen, self.table_view.enablerTableFilesExists, 'toolbar_images/open.png' ) self.ui_component.setupMenuBar( mb, self._addMenu ) def __setupTableContextMenu( self ): self.debugLog( '__setupTableContextMenu' ) # --- setup scm_type specific menu m = QtWidgets.QMenu( self ) m.addSection( T_('File Actions') ) self._addMenu( m, T_('Edit'), self.table_view.tableActionEdit, self.table_view.enablerTableFilesExists, 'toolbar_images/edit.png' ) self._addMenu( m, T_('Open'), self.table_view.tableActionOpen, self.table_view.enablerTableFilesExists, 'toolbar_images/open.png' ) self.ui_component.setupTableContextMenu( m, self._addMenu ) def tableContextMenu( self, global_pos ): self.debugLog( 'tableContextMenu( %r )' % (global_pos,) ) self.ui_component.getTableContextMenu().exec_( global_pos ) def setupToolBar( self ): # --- setup common toolbars t = self.tool_bar_table = self._addToolBar( T_('table') ) self._addTool( t, T_('Edit'), self.table_view.tableActionEdit, self.table_view.enablerTableFilesExists, 'toolbar_images/edit.png' ) self._addTool( t, T_('Open'), self.table_view.tableActionOpen, self.table_view.enablerTableFilesExists, 'toolbar_images/open.png' ) # --- setup scm_type specific tool bars self.ui_component.setupToolBarAtRight( self._addToolBar, self._addTool ) def closeEvent( self, event ): super().closeEvent( event ) if self.__pyqt_bug_already_closed_why_call_close_event_again: return self.__pyqt_bug_already_closed_why_call_close_event_again = True self.commitClosed.emit() def handleAccepted( self ): self.commitAccepted.emit() def enableOkButton( self ): text = self.message.toPlainText() self.ok_button.setEnabled( text.strip() != '' and self.hg_project.numModifiedFiles() != 0 ) def getMessage( self ): return self.message.toPlainText().strip() def updateSingleton( self ): self.updateTableView() def updateTableView( self ): # caller will have updated the hg project state already self.table_view.setScmProjectTreeNode( self.hg_project.flat_tree ) def isScmTypeActive( self, scm_type ): return scm_type == 'hg' def updateActionEnabledStates( self ): # can be called during __init__ on macOS version if self.table_view is None or self.table_view.table_model is None: return self.updateEnableStates() self.enableOkButton()
{ "content_hash": "79cd9da07b21c1c8d605368a843fba6e", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 163, "avg_line_length": 40.402255639097746, "alnum_prop": 0.6331069135572718, "repo_name": "barry-scott/git-workbench", "id": "b6830989d07af080e909102c7b1ee3d75712822c", "size": "10749", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Source/Hg/wb_hg_commit_dialog.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1280" }, { "name": "Makefile", "bytes": "2088" }, { "name": "Python", "bytes": "198101" }, { "name": "Shell", "bytes": "4708" } ], "symlink_target": "" }
var SerialPort = require('serialport').SerialPort , bindPhysical = require('../index').bindPhysical , mqtt = require('mqtt') , SERIAL_PORT = process.env.SERIAL_PORT || '/dev/ttyACM0' // create an mqtt client , options = { 'host': 'YOUR_MQTT_HOST' , 'port': 'YOUR_MQTT_PORT' , 'username': 'USERNAME' , 'password': 'PASSWORD' } , client = mqtt.connect(options) client.on('connect', function() { console.log('mqtt connected') }) client.on('error', function (err) { console.log(err) }) // create a local serial port var serialPort = new SerialPort(SERIAL_PORT,{ baudrate: 57600, buffersize: 1 }) // bind the serial port to the mqtt client bindPhysical({ serialPort: serialPort, client: client, transmitTopic: 'serialClient', receiveTopic: 'physicalDevice' })
{ "content_hash": "217c389d608736a2be37629264aad7ea", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 59, "avg_line_length": 24.941176470588236, "alnum_prop": 0.6320754716981132, "repo_name": "Orientsoft/borgnix-examples", "id": "012eea5f4586c9de9593638e187abe5bff9a0ad3", "size": "848", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "arduino-pi/bindSerialPort.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "848" } ], "symlink_target": "" }
<?php namespace MusicaToulouse\WebsiteBundle\Twig; class DateTimeExtension extends \Twig_Extension { public function getFilters() { return array( 'toDateString' => new \Twig_Filter_Method($this, 'toDateString'), ); } public function toDateString($date, $format) { //setlocale(LC_ALL, "fr-FR"); setlocale (LC_TIME, 'fr_FR.utf8','fra'); return strftime($format,strtotime($date)); } public function getName() { return 'datetime_extension'; } } ?>
{ "content_hash": "a5d9aa988b3a8cab6f419ab30be826d5", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 77, "avg_line_length": 20.884615384615383, "alnum_prop": 0.5966850828729282, "repo_name": "Akashan/MusicaToulouse", "id": "b9110bf9deca750006ff571d215bfabfc64d64c2", "size": "543", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/MusicaToulouse/WebsiteBundle/Twig/DateTimeExtension.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "7295" }, { "name": "PHP", "bytes": "50130" } ], "symlink_target": "" }
struct GLFWwindow; IMGUI_API bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks); IMGUI_API void ImGui_ImplGlfwGL3_Shutdown(); IMGUI_API void ImGui_ImplGlfwGL3_NewFrame(); IMGUI_API void ImGui_ImplGlfwGL3_RenderDrawData(ImDrawData* draw_data); // Use if you want to reset your rendering device without losing ImGui state. IMGUI_API void ImGui_ImplGlfwGL3_InvalidateDeviceObjects(); IMGUI_API bool ImGui_ImplGlfwGL3_CreateDeviceObjects(); // GLFW callbacks (installed by default if you enable 'install_callbacks' during initialization) // Provided here if you want to chain callbacks. // You can also handle inputs yourself and use those as a reference. IMGUI_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); IMGUI_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset); IMGUI_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); IMGUI_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c);
{ "content_hash": "c838e0df689b642e0359abaa46b469e2", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 114, "avg_line_length": 63.166666666666664, "alnum_prop": 0.7554969217238346, "repo_name": "ThisIsNotRocketScience/Eurorack-KDS", "id": "6cbbe4a5cdbacbb9c2857b43d805ed5b7321dcd9", "size": "2149", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "VIsualStudio_EuroRackSimulator/libs/imgui-master/examples/opengl3_example/imgui_impl_glfw_gl3.h", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "3674" }, { "name": "Batchfile", "bytes": "6781" }, { "name": "C", "bytes": "74147156" }, { "name": "C#", "bytes": "78988" }, { "name": "C++", "bytes": "2569956" }, { "name": "CMake", "bytes": "21818" }, { "name": "GLSL", "bytes": "1386" }, { "name": "HTML", "bytes": "12539" }, { "name": "Makefile", "bytes": "95594" }, { "name": "Objective-C", "bytes": "41867" }, { "name": "Objective-C++", "bytes": "30433" }, { "name": "Python", "bytes": "13378" }, { "name": "Shell", "bytes": "140" } ], "symlink_target": "" }
package it.francescosantagati.jam; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; /** * A no-synchronized mailbox remotely accessible and belonging to a particular agent. * Other agents can send message by specifying the recipient. * * @author Francesco Santagati */ public class MessageBoxNoSync<E extends Message> extends UnicastRemoteObject { protected int maxMessages; protected AgentID owner; protected List<E> box; /** * Construct a message box with a max message limit. * * @param owner Agent ID * @throws RemoteException when fail to connect */ public MessageBoxNoSync(AgentID owner) throws RemoteException { this(owner, 10); } /** * Construct a message box with a max message limit. * * @param owner Agent ID * @param maxMessages Max message number * @throws RemoteException when fail to connect */ public MessageBoxNoSync(AgentID owner, int maxMessages) throws RemoteException { this.owner = owner; this.maxMessages = maxMessages; box = new ArrayList<>(maxMessages); } /** * @return it.francescosantagati.jam.AgentID */ public AgentID getOwner() { return owner; } /** * Check if box is empty. * * @return True if is empty, False otherwise */ public boolean isBoxEmpty() { return box.isEmpty(); } /** * Check if box is full * * @return Trus if is full. False otherwise */ public boolean isBoxFull() { return maxMessages == box.size(); } /** * Insert an element in message box. * * @param element An element * @throws JAMMessageBoxException if message box is full * @throws InterruptedException if write fail */ public void writeMessage(E element) throws InterruptedException, JAMMessageBoxException { if (element == null) { throw new IllegalArgumentException("Wrong parameters"); } if (isBoxFull()) { throw new JAMMessageBoxException("it.francescosantagati.jam.Message box is full"); } box.add(element); } /** * Retrieve and delete from message box the first message sent by agent and with performative provided. * If no message found an exception it.francescosantagati.jam.JAMMessageBoxException will be thrown * * @param agentID it.francescosantagati.jam.AgentID * @param performative it.francescosantagati.jam.Performative * @return message * @throws JAMMessageBoxException if message not found * @throws InterruptedException if read fail */ public Message readMessage(AgentID agentID, Performative performative) throws JAMMessageBoxException, InterruptedException { if (agentID == null || performative == null) { throw new IllegalArgumentException("Wrong parameters"); } if (box.isEmpty()) { throw new JAMMessageBoxException("it.francescosantagati.jam.Message box is empty"); } ListIterator<E> it = box.listIterator(); while (it.hasNext()) { Message m = it.next(); if (agentID.equals(m.getSender()) && m.getPerformative().toString().equals(performative.toString())) { it.remove(); return m; } } throw new JAMMessageBoxException("it.francescosantagati.jam.Message not found"); } /** * Retrieve and delete from message box the first message sent by agent provided. * If no message found an exception it.francescosantagati.jam.JAMMessageBoxException will be thrown * * @param agentID it.francescosantagati.jam.AgentID * @return message * @throws JAMMessageBoxException if message not found * @throws InterruptedException if read fail */ public Message readMessage(AgentID agentID) throws JAMMessageBoxException, InterruptedException { if (agentID == null) { throw new IllegalArgumentException("Wrong parameters"); } if (box.isEmpty()) { throw new JAMMessageBoxException("it.francescosantagati.jam.Message box is empty"); } ListIterator<E> it = box.listIterator(); while (it.hasNext()) { Message m = it.next(); if (agentID.equals(m.getSender())) { it.remove(); return m; } } throw new JAMMessageBoxException("it.francescosantagati.jam.Message not found"); } /** * Retrieve and delete from message box the first message with performative provided. * If no message found an exception it.francescosantagati.jam.JAMMessageBoxException will be thrown * * @param performative it.francescosantagati.jam.Performative * @return message * @throws JAMMessageBoxException if message not found * @throws InterruptedException if read fail */ public Message readMessage(Performative performative) throws JAMMessageBoxException, InterruptedException { if (performative == null) { throw new IllegalArgumentException("Wrong parameters"); } if (box.isEmpty()) { throw new JAMMessageBoxException("it.francescosantagati.jam.Message box is empty"); } ListIterator<E> it = box.listIterator(); while (it.hasNext()) { Message m = it.next(); if (m.getPerformative().toString().equals(performative.toString())) { it.remove(); return m; } } throw new JAMMessageBoxException("it.francescosantagati.jam.Message not found"); } /** * Retrieve and delete from message box the first message. * If no message found an exception it.francescosantagati.jam.JAMMessageBoxException will be thrown * * @return message * @throws JAMMessageBoxException if message not found * @throws InterruptedException if read fail */ public Message readMessage() throws JAMMessageBoxException, InterruptedException { return readMessage(new GenericAgentID()); } /** * Check if a message sent by agent and with provided performative is in the message box. * * @param agentID it.francescosantagati.jam.AgentID * @param performative it.francescosantagati.jam.Performative * @return True if message found, false otherwise */ public boolean isThereMessage(AgentID agentID, Performative performative) { if (agentID == null || performative == null) { throw new IllegalArgumentException("Wrong parameters"); } for (E m : box) { if (agentID.equals(m.getSender()) && m.getPerformative().toString().equals(performative.toString())) { return true; } } return false; } /** * Check if a message sent by provided agent in the message box. * * @param agentID it.francescosantagati.jam.AgentID * @return True if message found, false otherwise */ public boolean isThereMessage(AgentID agentID) { for (E m : box) { if (agentID.equals(m.getSender())) { return true; } } return false; } /** * Check if a message with provided performative is in the message box. * * @param performative it.francescosantagati.jam.Performative * @return True if message found, false otherwise */ public boolean isThereMessage(Performative performative) { for (E m : box) { if (m.getPerformative().toString().equals(performative.toString())) { return true; } } return false; } /** * Check if a message is in the message box. * * @return True if message found, false otherwise */ public boolean isThereMessage() { return ! box.isEmpty(); } }
{ "content_hash": "4976f7eb952637d4eda05eec4d85bd97", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 128, "avg_line_length": 33.49173553719008, "alnum_prop": 0.6314620604565083, "repo_name": "FrancescoSantagati/java-agent-middleware", "id": "e7f84685b0cf261cd3b4817617e5116d2d31e850", "size": "8105", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jam/src/main/java/it/francescosantagati/jam/MessageBoxNoSync.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "78967" }, { "name": "Shell", "bytes": "926" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="it"> <head> <!-- Generated by javadoc (version 1.7.0_09) on Thu Jan 30 17:31:24 CET 2014 --> <title>UnrecognizedInstructionException</title> <meta name="date" content="2014-01-30"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="UnrecognizedInstructionException"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/UnrecognizedInstructionException.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../it/uniroma1/sapy/parsing/UnrecognizedExpressionException.html" title="class in it.uniroma1.sapy.parsing"><span class="strong">Prev Class</span></a></li> <li>Next Class</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?it/uniroma1/sapy/parsing/UnrecognizedInstructionException.html" target="_top">Frames</a></li> <li><a href="UnrecognizedInstructionException.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#methods_inherited_from_class_java.lang.Throwable">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">it.uniroma1.sapy.parsing</div> <h2 title="Class UnrecognizedInstructionException" class="title">Class UnrecognizedInstructionException</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>java.lang.Throwable</li> <li> <ul class="inheritance"> <li>java.lang.Exception</li> <li> <ul class="inheritance"> <li>it.uniroma1.sapy.parsing.UnrecognizedInstructionException</li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Serializable</dd> </dl> <hr> <br> <pre>public class <span class="strong">UnrecognizedInstructionException</span> extends java.lang.Exception</pre> <div class="block">Eccezione utilizzata per segnalare errori di parsing di istruzioni. <p> La classe <a href="../../../../it/uniroma1/sapy/parsing/Parser.html" title="class in it.uniroma1.sapy.parsing"><code>Parser</code></a> utilizza un metodo per arricchire la descrizione dell'errore avvenuto con le coordinate numero di linea e posizione nella riga dell'avvenuto errore di parsing. </p></div> <dl><dt><span class="strong">Author:</span></dt> <dd>Michele Reale, matricola 1315785</dd> <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../serialized-form.html#it.uniroma1.sapy.parsing.UnrecognizedInstructionException">Serialized Form</a></dd></dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>private static long</code></td> <td class="colLast"><code><strong><a href="../../../../it/uniroma1/sapy/parsing/UnrecognizedInstructionException.html#serialVersionUID">serialVersionUID</a></strong></code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../it/uniroma1/sapy/parsing/UnrecognizedInstructionException.html#UnrecognizedInstructionException(java.lang.String)">UnrecognizedInstructionException</a></strong>(java.lang.String&nbsp;message)</code> <div class="block">Inizializza l'eccezione con un messaggio descrittivo dell'errore di parsing avvenuto.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Throwable"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Throwable</h3> <code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field_detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="serialVersionUID"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>serialVersionUID</h4> <pre>private static final&nbsp;long serialVersionUID</pre> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#it.uniroma1.sapy.parsing.UnrecognizedInstructionException.serialVersionUID">Constant Field Values</a></dd></dl> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="UnrecognizedInstructionException(java.lang.String)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>UnrecognizedInstructionException</h4> <pre>UnrecognizedInstructionException(java.lang.String&nbsp;message)</pre> <div class="block">Inizializza l'eccezione con un messaggio descrittivo dell'errore di parsing avvenuto.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>message</code> - Stringa contenente la descrizione del'errore di parsing avvenuto.</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/UnrecognizedInstructionException.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../it/uniroma1/sapy/parsing/UnrecognizedExpressionException.html" title="class in it.uniroma1.sapy.parsing"><span class="strong">Prev Class</span></a></li> <li>Next Class</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?it/uniroma1/sapy/parsing/UnrecognizedInstructionException.html" target="_top">Frames</a></li> <li><a href="UnrecognizedInstructionException.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#methods_inherited_from_class_java.lang.Throwable">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "3afcb0d68f372bea8bcf0861995c8ead", "timestamp": "", "source": "github", "line_count": 301, "max_line_length": 252, "avg_line_length": 35.91694352159468, "alnum_prop": 0.6441587272222736, "repo_name": "mrambler90/sapy14", "id": "79d91fba92a7c0653313306042f04ba7e1bf5201", "size": "10811", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sapy/javadoc/it/uniroma1/sapy/parsing/UnrecognizedInstructionException.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
/** * External dependencies */ import { __ } from '@googleforcreators/i18n'; /** * External dependencies */ import PropTypes from 'prop-types'; import styled from 'styled-components'; import { useRef, useEffect, useState, useMemo, useCallback, useFocusOut, } from '@googleforcreators/react'; import { useGridViewKeys } from '@googleforcreators/design-system'; /** * Internal dependencies */ import { CardGrid } from '../../../../../components'; import { StoriesPropType, StoryMenuPropType, PageSizePropType, RenameStoryPropType, } from '../../../../../types'; import { PAGE_WRAPPER, STORY_CONTEXT_MENU_ACTIONS, } from '../../../../../constants'; import { useConfig } from '../../../../config'; import StoryGridItem from '../storyGridItem'; const StoryGrid = styled(CardGrid)` width: calc(100% - ${PAGE_WRAPPER.GUTTER}px); `; const StoryGridView = ({ stories, pageSize, storyMenu, renameStory, returnStoryFocusId, }) => { const { isRTL } = useConfig(); const containerRef = useRef(); const gridRef = useRef(); const itemRefs = useRef({}); const [activeGridItemId, setActiveGridItemId] = useState(); const activeGridItemIdRef = useRef(); const gridItemIds = useMemo(() => stories.map(({ id }) => id), [stories]); useGridViewKeys({ containerRef, gridRef, itemRefs, isRTL, currentItemId: activeGridItemId, items: stories, }); // We only want to force focus when returning to the grid from a dialog // By checking to see if the active grid item no longer exists // in tandem with the returnStoryFocusId being present from the parent // AND that the activeGridItemIdRef.current is null we know that // the user is coming from a dialog not just moving grid items useEffect(() => { if ( !activeGridItemId && returnStoryFocusId?.value && !activeGridItemIdRef.current ) { const newFocusId = returnStoryFocusId?.value; setActiveGridItemId(newFocusId); // grab the menu button and refocus const firstFocusableElement = itemRefs.current?.[ newFocusId ]?.querySelectorAll(['button', 'a'])?.[0]; firstFocusableElement?.focus(); } }, [activeGridItemId, returnStoryFocusId]); // when keyboard focus changes through FocusableGridItem // immediately focus the edit preview layer on top of preview useEffect(() => { if (activeGridItemId) { activeGridItemIdRef.current = activeGridItemId; } }, [activeGridItemId]); // Additional functionality needed when closing context menus to maintain grid item focus const handleMenuToggle = useCallback( (evt, id) => { storyMenu.handleMenuToggle(id); // Conditionally return the focus to the grid when menu is closed using `tab` if (id < 0 && evt?.keyCode === 9) { // Menu is closing. const isNext = !evt?.shiftKey; const idToFocus = isNext ? gridItemIds[gridItemIds.indexOf(activeGridItemId) + 1] : activeGridItemId; returnStoryFocusId.set(idToFocus); activeGridItemIdRef.current = null; setActiveGridItemId(null); } }, [activeGridItemId, gridItemIds, returnStoryFocusId, storyMenu] ); // if keyboard is used instead of mouse the useFocusOut doesn't get triggered // that is where we are setting active grid item ID to null // by doing this here as well we are ensuring consistent functionality const manuallySetFocusOut = useCallback(() => { activeGridItemIdRef.current = null; setActiveGridItemId(null); returnStoryFocusId.set(null); }, [returnStoryFocusId]); useFocusOut(containerRef, () => setActiveGridItemId(null), []); const modifiedStoryMenu = useMemo(() => { const actions = [ STORY_CONTEXT_MENU_ACTIONS.DELETE, STORY_CONTEXT_MENU_ACTIONS.RENAME, STORY_CONTEXT_MENU_ACTIONS.DUPLICATE, ]; const menuItems = storyMenu.menuItems.map((item) => { const _item = { ...item }; if (actions.includes(item?.value)) { _item.action = (story) => { manuallySetFocusOut(); item.action(story); }; } return _item; }); return { ...storyMenu, handleMenuToggle, menuItems, }; }, [handleMenuToggle, storyMenu, manuallySetFocusOut]); const memoizedStoryGrid = useMemo( () => stories.map((story) => { return ( <StoryGridItem onFocus={() => setActiveGridItemId(story.id)} isActive={activeGridItemId === story.id} ref={(el) => { itemRefs.current[story.id] = el; }} key={story.id} pageSize={pageSize} renameStory={renameStory} story={story} storyMenu={modifiedStoryMenu} /> ); }), [activeGridItemId, modifiedStoryMenu, pageSize, renameStory, stories] ); return ( <div ref={containerRef}> <StoryGrid pageSize={pageSize} ref={gridRef} role="list" ariaLabel={__('Viewing stories', 'web-stories')} > {memoizedStoryGrid} </StoryGrid> </div> ); }; StoryGridView.propTypes = { stories: StoriesPropType, pageSize: PageSizePropType.isRequired, storyMenu: StoryMenuPropType, renameStory: RenameStoryPropType, returnStoryFocusId: PropTypes.shape({ value: PropTypes.number, set: PropTypes.func, }), }; export default StoryGridView;
{ "content_hash": "c995e12901d09b033e08b1dc8b73f6cb", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 91, "avg_line_length": 27.595959595959595, "alnum_prop": 0.640190336749634, "repo_name": "GoogleForCreators/web-stories-wp", "id": "372105a2a5eb19478d6989219263404d6fc0f3da", "size": "6058", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "packages/dashboard/src/app/views/myStories/content/storyGridView/index.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "45312" }, { "name": "HTML", "bytes": "81613" }, { "name": "JavaScript", "bytes": "9026703" }, { "name": "PHP", "bytes": "1840505" }, { "name": "Shell", "bytes": "28629" }, { "name": "TypeScript", "bytes": "3393384" } ], "symlink_target": "" }
 @protocol InterfaceSocial <NSObject> - (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo; - (void) submitScore: (NSString*) leaderboardID withScore: (long) score; - (void) showLeaderboard: (NSString*) leaderboardID; - (void) unlockAchievement: (NSMutableDictionary*) achInfo; - (void) showAchievements; - (void) setDebugMode: (BOOL) debug; - (NSString*) getSDKVersion; - (NSString*) getPluginVersion; @end
{ "content_hash": "a8ac744b3c6992ea4bc237a2c1d58dda", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 72, "avg_line_length": 30, "alnum_prop": 0.7452380952380953, "repo_name": "bianfeng-shenbin/plugin", "id": "8150e7b3638f9d497f3370dbab765649b6846d38", "size": "1660", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "protocols/platform/ios/InterfaceSocial.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "14052" }, { "name": "C++", "bytes": "380594" }, { "name": "CSS", "bytes": "26162" }, { "name": "HTML", "bytes": "3128" }, { "name": "Java", "bytes": "787938" }, { "name": "Makefile", "bytes": "1990" }, { "name": "Objective-C", "bytes": "1712265" }, { "name": "Objective-C++", "bytes": "115875" }, { "name": "Python", "bytes": "26592" }, { "name": "Shell", "bytes": "23666" } ], "symlink_target": "" }
describe('Config Loader', function() local configLoader = require 'busted.modules.configuration_loader'() local testConfig, cliArgs, defaults before_each(function() testConfig = { _all = { other = 'stuff', }, default = { output = 'utfTerminal' }, windows = { output = 'plainTerminal' } } cliArgs = { } defaults = { } end) it('returns a valid config with no config file', function() local testConfig = { } local config, err = configLoader(testConfig, cliArgs) assert.are.same({}, config) assert.are.equal(nil, err) end) it('returns a valid config with default config', function() local config, err = configLoader(testConfig, cliArgs) assert.are.same(testConfig.default.output, config.output) assert.are.same(testConfig._all.other, config.other) assert.are.equal(nil, err) end) it('returns a valid config with specified config', function() cliArgs.run = 'windows' local config, err = configLoader(testConfig, cliArgs) assert.are.same(testConfig.windows.output, config.output) assert.are.same(testConfig._all.other, config.other) assert.are.equal(nil, err) end) it('returns a valid config with specified config and defaults specified', function() defaults = { output = 'TAP' } cliArgs.run = 'windows' local config, err = configLoader(testConfig, cliArgs, defaults) assert.are.same(testConfig.windows.output, config.output) assert.are.same(testConfig._all.other, config.other) assert.are.equal(nil, err) end) it('returns a valid config with cliArgs and defaults specified', function() cliArgs = { output = 'TAP' } local config, err = configLoader(testConfig, cliArgs, defaults) assert.are.same(cliArgs.output, config.output) assert.are.same(testConfig._all.other, config.other) assert.are.equal(nil, err) end) it('returns a valid config with defaults if no configs present', function() defaults = { output = 'TAP' } local config, err = configLoader({}, {}, defaults) assert.are.same(defaults, config) assert.are.equal(nil, err) end) it('returns an error with an invalid config', function() local config, err = configLoader('invalid', cliArgs) assert.are_not.equal(nil, err) end) it('returns an error with an invalid run', function() cliArgs.run = 'invalid' local config, err = configLoader(testConfig, cliArgs) assert.are_not.equal(nil, err) end) end)
{ "content_hash": "dcc5469182033b2390a74d5f806722ed", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 86, "avg_line_length": 29.904761904761905, "alnum_prop": 0.67078025477707, "repo_name": "perusio/lua-busted-debian-package", "id": "104e0bc0329443f0a34b242d106b1113397e3d61", "size": "2512", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "spec/modules/configuration_loader_spec.lua", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "93" }, { "name": "Lua", "bytes": "199399" }, { "name": "MoonScript", "bytes": "483" }, { "name": "Shell", "bytes": "6186" } ], "symlink_target": "" }
namespace content { // Owns a platform specific event; used to pass own and pass event through // platform independent code. struct CONTENT_EXPORT NativeWebKeyboardEvent : NON_EXPORTED_BASE(public WebKit::WebKeyboardEvent) { NativeWebKeyboardEvent(); explicit NativeWebKeyboardEvent(gfx::NativeEvent native_event); #if defined(USE_AURA) NativeWebKeyboardEvent(ui::EventType type, bool is_char, wchar_t character, int state, double time_stamp_seconds); #elif defined(OS_MACOSX) || defined(TOOLKIT_GTK) // TODO(suzhe): Limit these constructors to Linux native Gtk port. // For Linux Views port, after using RenderWidgetHostViewViews to replace // RenderWidgetHostViewGtk, we can use constructors for TOOLKIT_VIEWS defined // below. NativeWebKeyboardEvent(wchar_t character, int state, double time_stamp_seconds); #elif defined(OS_ANDROID) NativeWebKeyboardEvent(WebKit::WebInputEvent::Type type, int modifiers, double time_secs, int keycode, int unicode_character, bool is_system_key); // Takes ownership of android_key_event. NativeWebKeyboardEvent(jobject android_key_event, WebKit::WebInputEvent::Type type, int modifiers, double time_secs, int keycode, int unicode_character, bool is_system_key); #endif NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event); ~NativeWebKeyboardEvent(); NativeWebKeyboardEvent& operator=(const NativeWebKeyboardEvent& event); gfx::NativeEvent os_event; // True if the browser should ignore this event if it's not handled by the // renderer. This happens for RawKeyDown events that are created while IME is // active and is necessary to prevent backspace from doing "history back" if // it is hit in ime mode. // Currently, it's only used by Linux and Mac ports. bool skip_in_browser; #if defined(TOOLKIT_GTK) // True if the key event matches an edit command. In order to ensure the edit // command always work in web page, the browser should not pre-handle this key // event as a reserved accelerator. See http://crbug.com/54573 bool match_edit_command; #endif }; // Returns a bitmak of values from ui/base/events.h. CONTENT_EXPORT int GetModifiersFromNativeWebKeyboardEvent( const NativeWebKeyboardEvent& event); } // namespace content #endif // CONTENT_PUBLIC_BROWSER_NATIVE_WEB_KEYBOARD_EVENT_H_
{ "content_hash": "5a8ea0e86be10d1eadaa969563d1d570", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 80, "avg_line_length": 39.594202898550726, "alnum_prop": 0.6500732064421669, "repo_name": "keishi/chromium", "id": "9af8e73859fea7728d459455f5bb4792996014b2", "size": "3308", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "content/public/browser/native_web_keyboard_event.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "853" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "1172794" }, { "name": "C", "bytes": "67452317" }, { "name": "C#", "bytes": "1132" }, { "name": "C++", "bytes": "132681259" }, { "name": "F#", "bytes": "381" }, { "name": "Go", "bytes": "19048" }, { "name": "Java", "bytes": "361412" }, { "name": "JavaScript", "bytes": "16603687" }, { "name": "Objective-C", "bytes": "9609581" }, { "name": "PHP", "bytes": "97796" }, { "name": "Perl", "bytes": "918683" }, { "name": "Python", "bytes": "6407891" }, { "name": "R", "bytes": "524" }, { "name": "Shell", "bytes": "4192593" }, { "name": "Tcl", "bytes": "277077" } ], "symlink_target": "" }
/*global phantom:true*/ /*global require:true*/ /*global window:true*/ /** * system.args * [1] - fs path for css file */ (function(){ "use strict"; var system = require( "system" ); var fs = require( "fs" ); var errorHandler = function(msg, trace) { var msgStack = ["PHANTOM ERROR: " + msg]; if (trace && trace.length) { msgStack.push("TRACE:"); trace.forEach(function(t) { msgStack.push(" -> " + (t.file || t.sourceURL) + ": " + t.line + (t.function ? " (in function " + t.function +")" : "")); }); } system.stderr.write( msgStack.join("\n") + "\n" ); phantom.exit(1); }; var cssFile = system.args[1]; /** * Wait until the test condition is true or a timeout occurs. Useful for waiting * on a server response or for a ui change (fadeIn, etc.) to occur. * * @param testFx javascript condition that evaluates to a boolean, * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or * as a callback function. * @param onReady what to do when testFx condition is fulfilled, * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or * as a callback function. * @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used. */ var waitFor = function(testFx, onReady, timeOutMillis) { var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3000, //< Default Max Timout is 3s start = new Date().getTime(), condition = false, interval; interval = window.setInterval(function() { if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) { // If not time-out yet and condition not yet fulfilled condition = testFx(); } else { if(!condition) { // If condition still not fulfilled (timeout but condition is 'false') throw new Error( "The filename you have given is not found at this url." ); } else { // Condition fulfilled (timeout and/or condition is 'true') onReady(); window.clearInterval(interval); } } }, 250); //< repeat check every 250ms }; var page = require("webpage").create(); page.settings.webSecurityEnabled = false; page.settings.localToRemoteUrlAccessEnabled = true; phantom.onError = errorHandler; page.onError = errorHandler; page.onConsoleMessage = function(msg) { system.stdout.write( "Console output: " + msg + "\n"); system.stderr.write( "Console output error: " + msg + "\n"); }; page.onLoadFinished = function(status) { if( status !== "success" ){ throw new Error( "page didn't open properly" ); } waitFor(function(){ return page.evaluate(function(){ return window.document.styleSheets.length && Array.prototype.every.call(window.document.styleSheets, function(sheet){ return !!sheet && !!sheet.cssRules && !!sheet.cssRules.length; }); }); }, function(){ var styleSheet = page.evaluate(function(){ var Rule = function(rule){ var rules = []; this.media = rule.media; this.cssText = rule.cssText; this.selectorText = rule.selectorText; try { rules = Array.prototype.slice.call(rule.cssRules); } catch(e) { rules = []; } this.cssRules = rules.map(function(r){ return new Rule(r); }); if( this.media ){ this.media.mediaText = rule.media.mediaText; } }; var rules = Array.prototype.slice.call(window.document.styleSheets[0].cssRules); var ret = rules.map(function(rule){ // Sometimes Phantom is terrible. This is for when those times blow the whole world up try { return new Rule(rule); } catch (e){ } }) .filter(function(el){ return !!el; }); return JSON.stringify(ret); }); system.stdout.write(styleSheet); phantom.exit(); }); }; var contents = fs.read( cssFile ); page.content = "<!DOCTYPE html><html><head><style>" + contents + "</style></head><body></body></html>"; }());
{ "content_hash": "8604a56436249455a27e80e9c23885b5", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 125, "avg_line_length": 29.954198473282442, "alnum_prop": 0.6261467889908257, "repo_name": "danielmall/danielmallcom", "id": "22ccf74646addeebb1990a4d075e8f0b47200304", "size": "3924", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "node_modules/criticalcss/lib/rules.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "215" }, { "name": "CSS", "bytes": "276352" }, { "name": "JavaScript", "bytes": "61472" }, { "name": "PHP", "bytes": "1362754" } ], "symlink_target": "" }
using System; using NUnit.Framework; using NUnit.Framework.Interfaces; namespace SIL.TestUtilities { /// <summary> /// A NUnit action attribute that enables offline mode for the SLDR during unit tests. This attribute can be /// placed on a test fixture, test assembly, or test to disable online access to the live SLDR server. /// </summary> [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Assembly, AllowMultiple = true)] public class OfflineSldrAttribute : Attribute, ITestAction { private OfflineSldr _offlineSldr; private int _refCount; public void BeforeTest(ITest test) { if (_refCount == 0) _offlineSldr = new OfflineSldr(); _refCount++; } public void AfterTest(ITest test) { _refCount--; if (_refCount == 0) { _offlineSldr.Dispose(); _offlineSldr = null; } } /// <summary> /// Provides the target for the action attribute. This action will be run on all tests and suites (fixtures/assemblies). /// </summary> public ActionTargets Targets => ActionTargets.Test | ActionTargets.Suite; } }
{ "content_hash": "a8e2a10ea15f863c3dd50ceee6106318", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 146, "avg_line_length": 28.871794871794872, "alnum_prop": 0.7149200710479574, "repo_name": "gmartin7/libpalaso", "id": "d8ac18b4611231fe5cfb755e66e71be01d82a0ae", "size": "1126", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "SIL.TestUtilities/OfflineSldrAttribute.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "7676" }, { "name": "C#", "bytes": "7049595" }, { "name": "HTML", "bytes": "46279" }, { "name": "Makefile", "bytes": "529" }, { "name": "Python", "bytes": "7859" }, { "name": "Shell", "bytes": "1331" }, { "name": "XSLT", "bytes": "51874" } ], "symlink_target": "" }
<div class="container-fluid"> <div class="row"> <div class="col-md-12"> <h2>About</h2> <p class="lead"> This application was developed by <a href="http://capricasoftware.co.uk">Caprica Software Limited</a>. </p> <hr> <h3>Contact</h3> <p> For questions or comments please see the <a href="https://github.com/caprica/bootlace">Github project page</a>, alternatively email below: </p> <pre>mark &lt;dot&gt; lee &lt;at&gt; capricasoftware &lt;dot&gt; co &lt;dot&gt; uk</pre> </div> </div> </div>
{ "content_hash": "35a314f54431b2be26721f16e781ff95", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 127, "avg_line_length": 38.8235294117647, "alnum_prop": 0.5151515151515151, "repo_name": "caprica/bootlace", "id": "0b02fd4a15c601a24bc8050d1aa5ea4991ea0ef4", "size": "660", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/resources/static/components/about/about.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "4026" }, { "name": "HTML", "bytes": "12070" }, { "name": "Java", "bytes": "50240" }, { "name": "JavaScript", "bytes": "51987" } ], "symlink_target": "" }
module.exports = require('../isElement');
{ "content_hash": "da8d583f06b37371c6f47b12343fd2fa", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 41, "avg_line_length": 43, "alnum_prop": 0.6744186046511628, "repo_name": "Moccine/global-service-plus.com", "id": "c9277a32e86c5f6d30eded6861949eb030e32e05", "size": "43", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "web/libariries/bootstrap/node_modules/grunt-jscs/node_modules/lodash/fp/isElement.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1629941" }, { "name": "HTML", "bytes": "967450" }, { "name": "JavaScript", "bytes": "390886" }, { "name": "Makefile", "bytes": "404" }, { "name": "PHP", "bytes": "233061" } ], "symlink_target": "" }
/**************************************************************************** * uint.c * * Computer Science 50 * David J. Malan * * Prints a signed 8-bit integer and an unsigned 8-bit integer. * * Demonstrates signed, fixed-width types. ***************************************************************************/ #include <stdint.h> #include <stdio.h> int main(void) { // declare and print signed 8-bit integer int8_t i = 0xff; printf("%d\n", i); // declare and print signed 8-bit integer uint8_t u = 0xff; printf("%d\n", u); }
{ "content_hash": "6002344d99db71ccfaa9acb36c86cb49", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 77, "avg_line_length": 22.03846153846154, "alnum_prop": 0.44502617801047123, "repo_name": "feliposz/learning-stuff", "id": "0e31bc78dd7c5592c8b10df35963440716a8885e", "size": "573", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "harvard-cs50/src7/uint.c", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "43479" }, { "name": "Batchfile", "bytes": "805" }, { "name": "C", "bytes": "272611" }, { "name": "C#", "bytes": "45057" }, { "name": "C++", "bytes": "1955" }, { "name": "CSS", "bytes": "37278" }, { "name": "Groff", "bytes": "27095" }, { "name": "HTML", "bytes": "1213734" }, { "name": "Haskell", "bytes": "129361" }, { "name": "Java", "bytes": "467704" }, { "name": "JavaScript", "bytes": "132019" }, { "name": "Makefile", "bytes": "5618" }, { "name": "NewLisp", "bytes": "24" }, { "name": "PHP", "bytes": "57486" }, { "name": "Pascal", "bytes": "19005" }, { "name": "Perl", "bytes": "39" }, { "name": "Python", "bytes": "105058" }, { "name": "Racket", "bytes": "499244" }, { "name": "Ruby", "bytes": "5920" }, { "name": "Shell", "bytes": "248" }, { "name": "Visual Basic", "bytes": "7290" }, { "name": "XSLT", "bytes": "791" } ], "symlink_target": "" }
<html> <head> <title>File Source for index.php</title> <link rel="stylesheet" type="text/css" href="../media/style.css"> </head> <body> <table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> <tr> <td class="header_top">PHPExcel</td> </tr> <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt="" /></td></tr> <tr> <td class="header_menu"> [ <a href="../classtrees_PHPExcel.html" class="menu">class tree: PHPExcel</a> ] [ <a href="../elementindex_PHPExcel.html" class="menu">index: PHPExcel</a> ] [ <a href="../elementindex.html" class="menu">all elements</a> ] </td> </tr> <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt="" /></td></tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="200" class="menu"> <div id="todolist"> <p><a href="../todolist.html">Todo List</a></p> </div> <b>Packages:</b><br /> <a href="../li_PHPExcel.html">PHPExcel</a><br /> <a href="../li_com-tecnick-tcpdf.html">com-tecnick-tcpdf</a><br /> <a href="../li_JAMA.html">JAMA</a><br /> <a href="../li_Math_Stats.html">Math_Stats</a><br /> <a href="../li_PHPExcel_CachedObjectStorage.html">PHPExcel_CachedObjectStorage</a><br /> <a href="../li_PHPExcel_Calculation.html">PHPExcel_Calculation</a><br /> <a href="../li_PHPExcel_Cell.html">PHPExcel_Cell</a><br /> <a href="../li_PHPExcel_Reader.html">PHPExcel_Reader</a><br /> <a href="../li_PHPExcel_Reader_Excel5.html">PHPExcel_Reader_Excel5</a><br /> <a href="../li_PHPExcel_RichText.html">PHPExcel_RichText</a><br /> <a href="../li_PHPExcel_Settings.html">PHPExcel_Settings</a><br /> <a href="../li_PHPExcel_Shared.html">PHPExcel_Shared</a><br /> <a href="../li_PHPExcel_Shared_Best_Fit.html">PHPExcel_Shared_Best_Fit</a><br /> <a href="../li_PHPExcel_Shared_Escher.html">PHPExcel_Shared_Escher</a><br /> <a href="../li_PHPExcel_Shared_OLE.html">PHPExcel_Shared_OLE</a><br /> <a href="../li_PHPExcel_Style.html">PHPExcel_Style</a><br /> <a href="../li_PHPExcel_Worksheet.html">PHPExcel_Worksheet</a><br /> <a href="../li_PHPExcel_Worksheet_Drawing.html">PHPExcel_Worksheet_Drawing</a><br /> <a href="../li_PHPExcel_Writer.html">PHPExcel_Writer</a><br /> <a href="../li_PHPExcel_Writer_Excel5.html">PHPExcel_Writer_Excel5</a><br /> <a href="../li_PHPExcel_Writer_Excel2007.html">PHPExcel_Writer_Excel2007</a><br /> <br /><br /> </td> <td> <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top"> <h1 align="center">Source for file index.php</h1> <p>Documentation is available at <a href="../PHPExcel/_PHPExcel---Shared---JAMA---docs---index.php.html">index.php</a></p> <div class="src-code"> <ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li> <li><div class="src-line"><a name="a2"></a><span class="src-inc">include_once&nbsp;</span><span class="src-str">&quot;includes/header.php&quot;</span><span class="src-sym">;</span></div></li> <li><div class="src-line"><a name="a3"></a><span class="src-inc">include_once&nbsp;</span><span class="src-str">&quot;includes/navbar.php&quot;</span><span class="src-sym">;</span></div></li> <li><div class="src-line"><a name="a4"></a><span class="src-php">?&gt;</span></div></li> <li><div class="src-line"><a name="a5"></a>&nbsp;</div></li> <li><div class="src-line"><a name="a6"></a>&lt;p&gt;</div></li> <li><div class="src-line"><a name="a7"></a>JAMA&nbsp;is&nbsp;a&nbsp;proposed&nbsp;standard&nbsp;matrix&nbsp;class&nbsp;for&nbsp;Java.&nbsp;The&nbsp;JAMA&nbsp;introduction&nbsp;</div></li> <li><div class="src-line"><a name="a8"></a>describes&nbsp;&quot;JAMA&nbsp;:&nbsp;A&nbsp;Java&nbsp;Matrix&nbsp;Package&quot;&nbsp;in&nbsp;this&nbsp;way:</div></li> <li><div class="src-line"><a name="a9"></a>&lt;/p&gt;&nbsp;</div></li> <li><div class="src-line"><a name="a10"></a>&nbsp;</div></li> <li><div class="src-line"><a name="a11"></a>&lt;blockquote&gt;</div></li> <li><div class="src-line"><a name="a12"></a>JAMA&nbsp;is&nbsp;a&nbsp;basic&nbsp;linear&nbsp;algebra&nbsp;package&nbsp;for&nbsp;Java.&nbsp;It&nbsp;provides&nbsp;user-level&nbsp;classes&nbsp;for&nbsp;</div></li> <li><div class="src-line"><a name="a13"></a>constructing&nbsp;and&nbsp;manipulating&nbsp;real,&nbsp;dense&nbsp;matrices.&nbsp;&nbsp;It&nbsp;is&nbsp;meant&nbsp;to&nbsp;provide&nbsp;sufficient&nbsp;</div></li> <li><div class="src-line"><a name="a14"></a>functionality&nbsp;for&nbsp;routine&nbsp;problems,&nbsp;packaged&nbsp;in&nbsp;a&nbsp;way&nbsp;that&nbsp;is&nbsp;natural&nbsp;and&nbsp;understandable&nbsp;</div></li> <li><div class="src-line"><a name="a15"></a>to&nbsp;non-experts.&nbsp;&nbsp;It&nbsp;is&nbsp;intended&nbsp;to&nbsp;serve&nbsp;as&nbsp;the&nbsp;standard&nbsp;matrix&nbsp;class&nbsp;for&nbsp;Java,&nbsp;and&nbsp;</div></li> <li><div class="src-line"><a name="a16"></a>will&nbsp;be&nbsp;proposed&nbsp;as&nbsp;such&nbsp;to&nbsp;the&nbsp;Java&nbsp;Grande&nbsp;Forum&nbsp;and&nbsp;then&nbsp;to&nbsp;Sun.&nbsp;&nbsp;A&nbsp;straightforward&nbsp;</div></li> <li><div class="src-line"><a name="a17"></a>public-domain&nbsp;reference&nbsp;implementation&nbsp;has&nbsp;been&nbsp;developed&nbsp;by&nbsp;the&nbsp;MathWorks&nbsp;and&nbsp;NIST&nbsp;as&nbsp;</div></li> <li><div class="src-line"><a name="a18"></a>a&nbsp;strawman&nbsp;for&nbsp;such&nbsp;a&nbsp;class.&nbsp;&nbsp;We&nbsp;are&nbsp;releasing&nbsp;this&nbsp;version&nbsp;in&nbsp;order&nbsp;to&nbsp;obtain&nbsp;public&nbsp;</div></li> <li><div class="src-line"><a name="a19"></a>comment.&nbsp;There&nbsp;is&nbsp;no&nbsp;guarantee&nbsp;that&nbsp;future&nbsp;versions&nbsp;of&nbsp;JAMA&nbsp;will&nbsp;be&nbsp;compatible&nbsp;with&nbsp;this&nbsp;one.&nbsp;&nbsp;</div></li> <li><div class="src-line"><a name="a20"></a>&lt;/blockquote&gt;</div></li> <li><div class="src-line"><a name="a21"></a>&nbsp;</div></li> <li><div class="src-line"><a name="a22"></a>&lt;p&gt;</div></li> <li><div class="src-line"><a name="a23"></a>The&nbsp;development&nbsp;team&nbsp;below&nbsp;has&nbsp;successfully&nbsp;ported&nbsp;the&nbsp;JAMA&nbsp;API&nbsp;to&nbsp;PHP.&nbsp;&nbsp;You&nbsp;can&nbsp;explore&nbsp;</div></li> <li><div class="src-line"><a name="a24"></a>this&nbsp;site&nbsp;to&nbsp;learn&nbsp;more&nbsp;about&nbsp;this&nbsp;project&nbsp;and&nbsp;it's&nbsp;current&nbsp;development&nbsp;status.</div></li> <li><div class="src-line"><a name="a25"></a>&lt;/p&gt;</div></li> <li><div class="src-line"><a name="a26"></a>&nbsp;</div></li> <li><div class="src-line"><a name="a27"></a><span class="src-php">&lt;?php</span></div></li> <li><div class="src-line"><a name="a28"></a><span class="src-inc">include_once&nbsp;</span><span class="src-str">&quot;includes/credits.php&quot;</span><span class="src-sym">;</span></div></li> <li><div class="src-line"><a name="a29"></a><span class="src-inc">include_once&nbsp;</span><span class="src-str">&quot;includes/footer.php&quot;</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li> <li><div class="src-line"><a name="a30"></a><span class="src-php">?&gt;</span></div></li> </ol> </div> <div class="credit"> <hr /> Documentation generated on Tue, 01 Jun 2010 17:05:02 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a> </div> </td></tr></table> </td> </tr> </table> </body> </html>
{ "content_hash": "5c97de1fd178c16014e354e26924f891", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 513, "avg_line_length": 78.08571428571429, "alnum_prop": 0.5971459934138309, "repo_name": "xenophy/xFrameworkPX", "id": "6d08299d7d41acf8452df533601544b3346fd1b2", "size": "8199", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/PHPExcel/Documentation/API/__filesource/fsource_PHPExcel__PHPExcelSharedJAMAdocsindex.php.html", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "12667398" }, { "name": "PHP", "bytes": "16973398" }, { "name": "Shell", "bytes": "1360" } ], "symlink_target": "" }
#include "LConnectToMaster.h" LConnectToMaster::LConnectToMaster() { m_unMaxPacketProcessOnce = 100; } LConnectToMaster::~LConnectToMaster() { } bool LConnectToMaster::Initialize(char* pConnectToMasterServerConfigFile) { if (pConnectToMasterServerConfigFile == NULL) { return false; } LConnectorConfigProcessor ccp; if (!ccp.Initialize(pConnectToMasterServerConfigFile, "LoginServer_1_To_MasterServer")) { return false; } if (!m_ConnectorToMasterServer.Initialize(ccp.GetConnectorInitializeParams())) { return false; } return true; } // 获取接收的数据 LPacketSingle* LConnectToMaster::GetOneRecvedPacket() { return m_ConnectorToMasterServer.GetOneRecvedPacket(); } // 释放一个接收的数据包 void LConnectToMaster::FreePacket(LPacketSingle* pPacket) { if (pPacket == NULL) { return ; } return m_ConnectorToMasterServer.FreePacket(pPacket); } // 发送数据 // 取一个发送数据包 LPacketSingle* LConnectToMaster::GetOneSendPacketPool(unsigned short usPacketSize) { return m_ConnectorToMasterServer.GetOneSendPacketPool(usPacketSize); } // 添加一个发送数据包 bool LConnectToMaster::AddOneSendPacket(LPacketSingle* pPacket) { if (pPacket == NULL) { return false; } return m_ConnectorToMasterServer.AddOneSendPacket(pPacket); } bool LConnectToMaster::IsConnectted() { return m_ConnectorToMasterServer.IsConnectted(); } bool LConnectToMaster::StopConnectToMaster() { return m_ConnectorToMasterServer.StopThreadAndStopConnector(); } void LConnectToMaster::ReleaseConnectToMasterResource() { m_ConnectorToMasterServer.ReleaseConnectorResource(); }
{ "content_hash": "451f9bfbb3925dd1635f851351456682", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 88, "avg_line_length": 19.3, "alnum_prop": 0.7862694300518135, "repo_name": "MBeanwenshengming/linuxgameserver", "id": "b83ace2f29d3a342894d299f0b495ab95252f1c4", "size": "2713", "binary": false, "copies": "1", "ref": "refs/heads/1.0", "path": "LoginServer/LConnectToMaster.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "37608" }, { "name": "C++", "bytes": "1581301" }, { "name": "HTML", "bytes": "24438" }, { "name": "Makefile", "bytes": "136036" }, { "name": "Objective-C", "bytes": "2407" }, { "name": "SQLPL", "bytes": "3580" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/button_bg_press" android:state_pressed="true"/> <item android:drawable="@drawable/button_bg_normal"/> </selector>
{ "content_hash": "3855df95ac4bfd71e669ae65c7f79d1c", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 85, "avg_line_length": 52.8, "alnum_prop": 0.7196969696969697, "repo_name": "CyanFlxy/KnockKnock", "id": "ebc4047c814ba57d689fc232ea03a7fa9ec3b748", "size": "264", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/drawable/button_bg.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "29" }, { "name": "Java", "bytes": "325477" } ], "symlink_target": "" }
import os import unittest import numpy as np from sourcefinder import accessors from sourcefinder.accessors.fitsimage import FitsImage from sourcefinder.testutil.data import DATAPATH from sourcefinder.testutil.data import fits_file from sourcefinder.testutil.decorators import requires_data from sourcefinder.testutil.mock import SyntheticImage import sourcefinder from sourcefinder import image as sfimage from sourcefinder.image import ImageData from sourcefinder.utility.uncertain import Uncertain BOX_IN_BEAMPIX = 10 # HARDCODING - FIXME! (see also monitoringlist recipe) GRB120422A = os.path.join(DATAPATH, "GRB120422A-120429.fits") class TestNumpySubroutines(unittest.TestCase): def testBoxSlicing(self): """ Tests a routine to return a window on an image. Previous implementation returned correct sized box, but central pixel was often offset unnecessarily. This method always returns a centred chunk. """ a = np.arange(1, 101) a = a.reshape(10, 10) x, y = 3, 3 central_value = a[y, x] # 34 round_down_to_single_pixel = a[ sfimage.ImageData.box_slice_about_pixel(x, y, 0.9)] self.assertEquals(round_down_to_single_pixel, [[central_value]]) chunk_3_by_3 = a[sfimage.ImageData.box_slice_about_pixel(x, y, 1)] self.assertEquals(chunk_3_by_3.shape, (3, 3)) self.assertEqual(central_value, chunk_3_by_3[1, 1]) chunk_3_by_3_round_down = a[ sfimage.ImageData.box_slice_about_pixel(x, y, 1.9)] self.assertListEqual(list(chunk_3_by_3.reshape(9)), list(chunk_3_by_3_round_down.reshape(9)) ) class TestMapsType(unittest.TestCase): """ Check that rms, bg maps are of correct type. """ @requires_data(GRB120422A) def testmaps_array_type(self): self.image = accessors.sourcefinder_image_from_accessor( FitsImage(GRB120422A), margin=10) self.assertIsInstance(self.image.rmsmap, np.ma.MaskedArray) self.assertIsInstance(self.image.backmap, np.ma.MaskedArray) class TestFitFixedPositions(unittest.TestCase): """Test various fitting cases where the pixel position is predetermined""" @requires_data( os.path.join(DATAPATH, 'NCP_sample_image_1.fits')) def setUp(self): """ NB the required image has been committed to the tkp/data subversion repository. (See tkp/data/unittests/tkp_lib for a full copy of all the unittest data). Source positions / background positions were simply picked out by eye in DS9 """ self.image = accessors.sourcefinder_image_from_accessor( accessors.open( os.path.join(DATAPATH, 'NCP_sample_image_1.fits')) ) self.assertListEqual(list(self.image.data.shape), [1024, 1024]) self.boxsize = BOX_IN_BEAMPIX * max(self.image.beam[0], self.image.beam[1]) self.bright_src_posn = (35.76726, 86.305771) # RA, DEC self.background_posn = (6.33731, 82.70002) # RA, DEC # #NB Peak of forced gaussian fit is simply plucked from a previous run; # so merely ensures *consistent*, rather than *correct*, results. self.known_fit_results = (self.bright_src_posn[0], # RA, self.bright_src_posn[1], # Dec 13.457697411730384) # Peak def testSourceAtGivenPosition(self): posn = self.bright_src_posn img = self.image results = self.image.fit_fixed_positions(positions=[posn], boxsize=self.boxsize, threshold=0.0)[0] self.assertAlmostEqual(results.ra.value, self.known_fit_results[0], delta=0.01) self.assertAlmostEqual(results.dec.value, self.known_fit_results[1], delta=0.01) self.assertAlmostEqual(results.peak.value, self.known_fit_results[2], delta=0.01) def testLowFitThreshold(self): """ Low fit threshold is equivalent to zero threshold If we supply an extremely low threshold do we get a similar result to a zero threshold, for a bright source? """ posn = self.bright_src_posn img = self.image low_thresh_results = self.image.fit_fixed_positions(positions=[posn], boxsize=BOX_IN_BEAMPIX * max( img.beam[0], img.beam[1]), threshold=-1e20)[0] self.assertAlmostEqual(low_thresh_results.ra.value, self.known_fit_results[0], delta=0.01) self.assertAlmostEqual(low_thresh_results.dec.value, self.known_fit_results[1], delta=0.01) self.assertAlmostEqual(low_thresh_results.peak.value, self.known_fit_results[2], delta=0.01) def testHighFitThreshold(self): """ High fit threshold throws error If we supply an extremely high threshold, we expect to get back a fitting error since all pixels should be masked out. """ posn = self.bright_src_posn img = self.image with self.assertRaises(ValueError): results = self.image.fit_fixed_positions(positions=[posn], boxsize=BOX_IN_BEAMPIX * max( img.beam[0], img.beam[1]), threshold=1e20) def testBackgroundAtGivenPosition(self): """ No source at given position (but still in the image frame) Note, if we request zero threshold, then the region will be unfittable, since it is largely below that thresh. Rather than pick an arbitrarily low threshold, we set it to None. """ img = self.image results = self.image.fit_fixed_positions( positions=[self.background_posn], boxsize=BOX_IN_BEAMPIX * max(img.beam[0], img.beam[1]), threshold=None )[0] self.assertAlmostEqual(results.peak.value, 0, delta=results.peak.error * 1.0) def testGivenPositionOutsideImage(self): """If given position is outside image then result should be NoneType""" img = self.image # Generate a position halfway up the y-axis, but at negative x-position. pixel_posn_negative_x = (-50, img.data.shape[1] / 2.0) # and halfway up the y-axis, but at x-position outside array limit: pixel_posn_high_x = (img.data.shape[0] + 50, img.data.shape[1] / 2.0) sky_posns_out_of_img = [ img.wcs.p2s(pixel_posn_negative_x), img.wcs.p2s(pixel_posn_high_x), ] # print "Out of image?", sky_posn_out_of_img # print "Out of image (pixel backconvert)?", img.wcs.s2p(sky_posn_out_of_img) results = self.image.fit_fixed_positions(positions=sky_posns_out_of_img, boxsize=BOX_IN_BEAMPIX * max( img.beam[0], img.beam[1])) self.assertListEqual([], results) def testTooCloseToEdgePosition(self): """Same if right on the edge -- too few pixels to fit""" img = self.image boxsize = BOX_IN_BEAMPIX * max(img.beam[0], img.beam[1]) edge_posn = img.wcs.p2s((0 + boxsize / 2 - 2, img.data.shape[1] / 2.0)) results = self.image.fit_fixed_positions( positions=[edge_posn], boxsize=boxsize, threshold=-1e10 ) self.assertListEqual([], results) def testErrorBoxOverlapsEdge(self): """ Error box overflows image Sometimes when fitting at a fixed position, we get extremely large uncertainty values. These create an error box on position which extends outside the image, causing errors when we try to calculate the RA / Dec uncertainties. This test ensures we handle this case gracefully. """ img = self.image fake_params = sourcefinder.extract.ParamSet() fake_params.values.update({ 'peak': Uncertain(0.0, 0.5), 'flux': Uncertain(0.0, 0.5), 'xbar': Uncertain(5.5, 10000.5), # Danger Will Robinson 'ybar': Uncertain(5.5, 3), 'semimajor': Uncertain(4, 200), 'semiminor': Uncertain(4, 2), 'theta': Uncertain(30, 10), }) fake_params.sig = 0 det = sourcefinder.extract.Detection(fake_params, img) # Raises runtime error prior to bugfix for issue #3294 det._physical_coordinates() self.assertEqual(det.ra.error, float('inf')) self.assertEqual(det.dec.error, float('inf')) def testForcedFitAtNans(self): """ Should not return a fit if the position was largely masked due to NaNs """ forcedfit_sky_posn = self.bright_src_posn forcedfit_pixel_posn = self.image.wcs.s2p(forcedfit_sky_posn) fitting_boxsize = BOX_IN_BEAMPIX * max(self.image.beam[0], self.image.beam[1]) nandata = self.image.rawdata.copy() x0, y0 = forcedfit_pixel_posn # If we totally cover the fitting box in NaNs, then there are no # valid pixels and fit gets rejected. # However, if we only cover the central quarter (containing all the # real signal!) then we get a dodgy fit back. nanbox_radius = fitting_boxsize / 2 boxsize_proportion = 0.5 nanbox_radius *= boxsize_proportion nandata[int(x0 - nanbox_radius):int(x0 + nanbox_radius + 1), int(y0 - nanbox_radius):int(y0 + nanbox_radius + 1)] = float('nan') # Dump image data for manual inspection: # import astropy.io.fits as fits # # output_data = self.image.rawdata # output_data = nandata # hdu = fits.PrimaryHDU((output_data).transpose()) # hdu.writeto('/tmp/nandata.fits',clobber=True) nan_image = ImageData(nandata, beam=self.image.beam, wcs=self.image.wcs) results = nan_image.fit_fixed_positions( positions=[self.bright_src_posn], boxsize=fitting_boxsize, threshold=None ) print(results) self.assertFalse(results) class TestSimpleImageSourceFind(unittest.TestCase): """Now lets test drive the routines which find new sources""" @requires_data(GRB120422A) def testSingleSourceExtraction(self): """ Single source extaction From visual inspection we only expect a single source in the image, at around 5 or 6 sigma detection level.""" ew_sys_err, ns_sys_err = 0.0, 0.0 known_result = ( 136.89603241069054, 14.022184792492785, # RA, DEC 5.341819139061954e-4, 1.3428186757078464e-3, # Err, Err 7.226590529214518e-4, 1.0918184742211533e-4, # Peak flux, err 6.067963179204716e-4, 1.7037685531724465e-4, # Integrated flux, err 6.192259965962862, 25.516190123153514, # Significance level, Beam semimajor-axis width (arcsec) 10.718798843620489, 178.62899212789304, # Beam semiminor-axis width (arcsec), Beam parallactic angle ew_sys_err, ns_sys_err, 5.181697175052841, # error_radius 1, # fit_type 0.59184643302, # chisq 0.67199741142, # reduced chisq ) self.image = accessors.sourcefinder_image_from_accessor( FitsImage(GRB120422A)) results = self.image.extract(det=5, anl=3) results = [result.serialize(ew_sys_err, ns_sys_err) for result in results] # Our modified kappa,sigma clipper gives a slightly lower noise # which catches an extra noise peak at the 5 sigma level. self.assertEqual(len(results), 2) r = results[1] self.assertEqual(len(r), len(known_result)) for i in range(len(r)): self.assertAlmostEqual(r[i], known_result[i], places=0) @requires_data(GRB120422A) def testForceSourceShape(self): """ Force source shape to beam This image contains a single source (with parameters as listed under testSingleSourceExtraction(), above). Here we force the lengths of the major/minor axes to be held constant when fitting. """ self.image = accessors.sourcefinder_image_from_accessor( FitsImage(GRB120422A)) results = self.image.extract(det=5, anl=3, force_beam=True) self.assertEqual(results[0].smaj.value, self.image.beam[0]) self.assertEqual(results[0].smin.value, self.image.beam[1]) @requires_data(os.path.join(DATAPATH, 'SWIFT_554620-130504.fits')) @requires_data(os.path.join(DATAPATH, 'SWIFT_554620-130504.image')) def testWcsConversionConsistency(self): """ Check that extracting a source from FITS and CASA versions of the same dataset gives the same results (especially, RA and Dec). """ fits_image = accessors.sourcefinder_image_from_accessor( FitsImage(os.path.join(DATAPATH, 'SWIFT_554620-130504.fits'))) # Abuse the KAT7 CasaImage class here, since we just want to access # the pixel data and the WCS: casa_image = accessors.sourcefinder_image_from_accessor( accessors.kat7casaimage.Kat7CasaImage( os.path.join(DATAPATH, 'SWIFT_554620-130504.image'))) ew_sys_err, ns_sys_err = 0.0, 0.0 fits_results = fits_image.extract(det=5, anl=3) fits_results = [result.serialize(ew_sys_err, ns_sys_err) for result in fits_results] casa_results = casa_image.extract(det=5, anl=3) casa_results = [result.serialize(ew_sys_err, ns_sys_err) for result in casa_results] # Our modified kappa,sigma clipper gives a slightly lower noise # which catches two extra noise peaks at the 5 sigma level. self.assertEqual(len(fits_results), 3) self.assertEqual(len(casa_results), 3) fits_src = fits_results[0] casa_src = casa_results[0] self.assertEqual(len(fits_src), len(casa_src)) for idx, _ in enumerate(fits_src): self.assertAlmostEqual(fits_src[idx], casa_src[idx], places=5) @requires_data(GRB120422A) def testNoLabelledIslandsCase(self): """ If an image is in fact very boring and flat/empty, then we may not even locate any labelled islands, if the analysis threshold is set high enough. (We reproduce this test case, even though GRB120422A-120429 has a source in the image, just by setting the thresholds very high - this avoids requiring additional data). """ self.image = accessors.sourcefinder_image_from_accessor( FitsImage(GRB120422A)) results = self.image.extract(det=5e10, anl=5e10) results = [result.serialize() for result in results] self.assertEqual(len(results), 0) class TestMaskedSource(unittest.TestCase): """ Source is masked Check that we don't find sources when they fall within a masked region of the image. """ @requires_data(GRB120422A) def testWholeSourceMasked(self): """ Source in masked region """ self.image = accessors.sourcefinder_image_from_accessor( FitsImage(GRB120422A)) self.image.data[250:280, 250:280] = np.ma.masked results = self.image.extract(det=5, anl=3) self.assertFalse(results) @requires_data(GRB120422A) def testWholeSourceMasked(self): """ Part of source masked Tip of major axis is around 267, 264 """ self.image = accessors.sourcefinder_image_from_accessor( FitsImage(GRB120422A)) self.image.data[266:269, 263:266] = np.ma.masked # Our modified kappa,sigma clipper gives a slightly lower noise # which catches an extra noise peak at the 5 sigma level. self.image.data[42:50, 375:386] = np.ma.masked results = self.image.extract(det=5, anl=3) self.assertFalse(results) class TestMaskedBackground(unittest.TestCase): # We force the mask by setting the usable region << grid size. @requires_data(fits_file) def testMaskedBackgroundForcedFit(self): """ Background at forced fit is masked """ self.image = accessors.sourcefinder_image_from_accessor( accessors.open(fits_file), radius=1.0) result = self.image.fit_to_point(256, 256, 10, 0, None) self.assertFalse(result) @requires_data(fits_file) def testMaskedBackgroundBlind(self): self.image = accessors.sourcefinder_image_from_accessor( accessors.open(fits_file), radius=1.0) result = self.image.extract(det=10.0, anl=3.0) self.assertFalse(result) class TestFailureModes(unittest.TestCase): """ If we get pathological data we should probably throw an exception and let the calling code decide what to do. """ def testFlatImage(self): sfimage = accessors.sourcefinder_image_from_accessor( SyntheticImage(data=np.zeros((512, 512)))) self.assertTrue(np.ma.max(sfimage.data) == np.ma.min(sfimage.data), msg="Data should be flat") with self.assertRaises(RuntimeError): sfimage.extract(det=5, anl=3)
{ "content_hash": "d5e37da14f5b4dc0a655c8417d782d4c", "timestamp": "", "source": "github", "line_count": 448, "max_line_length": 89, "avg_line_length": 40.75892857142857, "alnum_prop": 0.5963855421686747, "repo_name": "transientskp/pyse", "id": "5f83fcd781caa72c2d3e2f9f155a1a7172b8714d", "size": "18260", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/test_image.py", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Dockerfile", "bytes": "368" }, { "name": "Python", "bytes": "277081" }, { "name": "Shell", "bytes": "463" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <rootTag> <Award> <AwardTitle>The stability of colloidal metallic nanoparticles in reactive chemical environments</AwardTitle> <AwardEffectiveDate>03/01/2010</AwardEffectiveDate> <AwardExpirationDate>02/28/2013</AwardExpirationDate> <AwardAmount>420000</AwardAmount> <AwardInstrument> <Value>Continuing grant</Value> </AwardInstrument> <Organization> <Code>03090000</Code> <Directorate> <LongName>Direct For Mathematical &amp; Physical Scien</LongName> </Directorate> <Division> <LongName>Division Of Chemistry</LongName> </Division> </Organization> <ProgramOfficer> <SignBlockName>Zeev Rosenzweig</SignBlockName> </ProgramOfficer> <AbstractNarration>The Macromolecular, Supramolecular and Nanochemistry (MSN) program of the Division of Chemistry will support the research program of Prof. Mostafa El Sayed of Georgia Institute of Technology. Prof. El Sayed's research program focuses on the development of plasmonic nanocatalysts, a new generation of materials at the frontier of the field of chemical catalysis. Prof. El Sayed and his students will examine the effects of two new properties of nanoparticles on the rates of chemical and photo-chemical reactions: 1) the cage effect on the rates of chemical reactions when they occur inside a nano-cage and nano-frame type nanoparticle; 2) the effect of plasmonic fields and other properties of nanogold on the rates of some chemical and photochemical reactions. The project will provide excellent educational opportunity for trainees desiring to work at the forefront of catalysis research.</AbstractNarration> <MinAmdLetterDate>03/16/2010</MinAmdLetterDate> <MaxAmdLetterDate>01/13/2012</MaxAmdLetterDate> <ARRAAmount/> <AwardID>0957335</AwardID> <Investigator> <FirstName>Mostafa</FirstName> <LastName>El-Sayed</LastName> <EmailAddress>mostafa.el-sayed@chemistry.gatech.edu</EmailAddress> <StartDate>03/16/2010</StartDate> <EndDate/> <RoleCode>Principal Investigator</RoleCode> </Investigator> <Institution> <Name>Georgia Tech Research Corporation</Name> <CityName>Atlanta</CityName> <ZipCode>303320420</ZipCode> <PhoneNumber>4048944819</PhoneNumber> <StreetAddress>Office of Sponsored Programs</StreetAddress> <CountryName>United States</CountryName> <StateName>Georgia</StateName> <StateCode>GA</StateCode> </Institution> </Award> </rootTag>
{ "content_hash": "fb256510beb1dab10df39a6b4883e3ae", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 934, "avg_line_length": 53.333333333333336, "alnum_prop": 0.74140625, "repo_name": "jallen2/Research-Trend", "id": "a95bf973c99d75aadfe1270f994b5538ee5cda81", "size": "2560", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CU_Funding/2009/0957335.xml", "mode": "33261", "license": "mit", "language": [], "symlink_target": "" }
package org.apache.camel.builder.endpoint.dsl; import java.util.*; import java.util.concurrent.*; import java.util.function.*; import java.util.stream.*; import javax.annotation.Generated; import org.apache.camel.builder.EndpointConsumerBuilder; import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** * Transform XML payloads using an XSLT template using Saxon. * * Generated by camel build tools - do NOT edit this file! */ @Generated("org.apache.camel.maven.packaging.EndpointDslMojo") public interface XsltSaxonEndpointBuilderFactory { /** * Builder for endpoint for the XSLT Saxon component. */ public interface XsltSaxonEndpointBuilder extends EndpointProducerBuilder { default AdvancedXsltSaxonEndpointBuilder advanced() { return (AdvancedXsltSaxonEndpointBuilder) this; } /** * Whether to allow using StAX as the javax.xml.transform.Source. You * can enable this if the XSLT library supports StAX such as the Saxon * library (camel-saxon). The Xalan library (default in JVM) does not * support StAXSource. * * The option is a: &lt;code&gt;boolean&lt;/code&gt; type. * * Default: true * Group: producer * * @param allowStAX the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder allowStAX(boolean allowStAX) { doSetProperty("allowStAX", allowStAX); return this; } /** * Whether to allow using StAX as the javax.xml.transform.Source. You * can enable this if the XSLT library supports StAX such as the Saxon * library (camel-saxon). The Xalan library (default in JVM) does not * support StAXSource. * * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt; * type. * * Default: true * Group: producer * * @param allowStAX the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder allowStAX(String allowStAX) { doSetProperty("allowStAX", allowStAX); return this; } /** * Cache for the resource content (the stylesheet file) when it is * loaded. If set to false Camel will reload the stylesheet file on each * message processing. This is good for development. A cached stylesheet * can be forced to reload at runtime via JMX using the * clearCachedStylesheet operation. * * The option is a: &lt;code&gt;boolean&lt;/code&gt; type. * * Default: true * Group: producer * * @param contentCache the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder contentCache(boolean contentCache) { doSetProperty("contentCache", contentCache); return this; } /** * Cache for the resource content (the stylesheet file) when it is * loaded. If set to false Camel will reload the stylesheet file on each * message processing. This is good for development. A cached stylesheet * can be forced to reload at runtime via JMX using the * clearCachedStylesheet operation. * * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt; * type. * * Default: true * Group: producer * * @param contentCache the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder contentCache(String contentCache) { doSetProperty("contentCache", contentCache); return this; } /** * If you have output=file then this option dictates whether or not the * output file should be deleted when the Exchange is done processing. * For example suppose the output file is a temporary file, then it can * be a good idea to delete it after use. * * The option is a: &lt;code&gt;boolean&lt;/code&gt; type. * * Default: false * Group: producer * * @param deleteOutputFile the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder deleteOutputFile( boolean deleteOutputFile) { doSetProperty("deleteOutputFile", deleteOutputFile); return this; } /** * If you have output=file then this option dictates whether or not the * output file should be deleted when the Exchange is done processing. * For example suppose the output file is a temporary file, then it can * be a good idea to delete it after use. * * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt; * type. * * Default: false * Group: producer * * @param deleteOutputFile the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder deleteOutputFile( String deleteOutputFile) { doSetProperty("deleteOutputFile", deleteOutputFile); return this; } /** * Whether or not to throw an exception if the input body is null. * * The option is a: &lt;code&gt;boolean&lt;/code&gt; type. * * Default: true * Group: producer * * @param failOnNullBody the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder failOnNullBody(boolean failOnNullBody) { doSetProperty("failOnNullBody", failOnNullBody); return this; } /** * Whether or not to throw an exception if the input body is null. * * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt; * type. * * Default: true * Group: producer * * @param failOnNullBody the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder failOnNullBody(String failOnNullBody) { doSetProperty("failOnNullBody", failOnNullBody); return this; } /** * Option to specify which output type to use. Possible values are: * string, bytes, DOM, file. The first three options are all in memory * based, where as file is streamed directly to a java.io.File. For file * you must specify the filename in the IN header with the key * XsltConstants.XSLT_FILE_NAME which is also CamelXsltFileName. Also * any paths leading to the filename must be created beforehand, * otherwise an exception is thrown at runtime. * * The option is a: * &lt;code&gt;org.apache.camel.component.xslt.XsltOutput&lt;/code&gt; * type. * * Default: string * Group: producer * * @param output the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder output( org.apache.camel.component.xslt.XsltOutput output) { doSetProperty("output", output); return this; } /** * Option to specify which output type to use. Possible values are: * string, bytes, DOM, file. The first three options are all in memory * based, where as file is streamed directly to a java.io.File. For file * you must specify the filename in the IN header with the key * XsltConstants.XSLT_FILE_NAME which is also CamelXsltFileName. Also * any paths leading to the filename must be created beforehand, * otherwise an exception is thrown at runtime. * * The option will be converted to a * &lt;code&gt;org.apache.camel.component.xslt.XsltOutput&lt;/code&gt; * type. * * Default: string * Group: producer * * @param output the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder output(String output) { doSetProperty("output", output); return this; } /** * The number of javax.xml.transform.Transformer object that are cached * for reuse to avoid calls to Template.newTransformer(). * * The option is a: &lt;code&gt;int&lt;/code&gt; type. * * Default: 0 * Group: producer * * @param transformerCacheSize the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder transformerCacheSize( int transformerCacheSize) { doSetProperty("transformerCacheSize", transformerCacheSize); return this; } /** * The number of javax.xml.transform.Transformer object that are cached * for reuse to avoid calls to Template.newTransformer(). * * The option will be converted to a &lt;code&gt;int&lt;/code&gt; type. * * Default: 0 * Group: producer * * @param transformerCacheSize the value to set * @return the dsl builder */ default XsltSaxonEndpointBuilder transformerCacheSize( String transformerCacheSize) { doSetProperty("transformerCacheSize", transformerCacheSize); return this; } } /** * Advanced builder for endpoint for the XSLT Saxon component. */ public interface AdvancedXsltSaxonEndpointBuilder extends EndpointProducerBuilder { default XsltSaxonEndpointBuilder basic() { return (XsltSaxonEndpointBuilder) this; } /** * Whether the producer should be started lazy (on the first message). * By starting lazy you can use this to allow CamelContext and routes to * startup in situations where a producer may otherwise fail during * starting and cause the route to fail being started. By deferring this * startup to be lazy then the startup failure can be handled during * routing messages via Camel's routing error handlers. Beware that when * the first message is processed then creating and starting the * producer may take a little time and prolong the total processing time * of the processing. * * The option is a: &lt;code&gt;boolean&lt;/code&gt; type. * * Default: false * Group: producer (advanced) * * @param lazyStartProducer the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder lazyStartProducer( boolean lazyStartProducer) { doSetProperty("lazyStartProducer", lazyStartProducer); return this; } /** * Whether the producer should be started lazy (on the first message). * By starting lazy you can use this to allow CamelContext and routes to * startup in situations where a producer may otherwise fail during * starting and cause the route to fail being started. By deferring this * startup to be lazy then the startup failure can be handled during * routing messages via Camel's routing error handlers. Beware that when * the first message is processed then creating and starting the * producer may take a little time and prolong the total processing time * of the processing. * * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt; * type. * * Default: false * Group: producer (advanced) * * @param lazyStartProducer the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder lazyStartProducer( String lazyStartProducer) { doSetProperty("lazyStartProducer", lazyStartProducer); return this; } /** * To use a custom org.xml.sax.EntityResolver with * javax.xml.transform.sax.SAXSource. * * The option is a: &lt;code&gt;org.xml.sax.EntityResolver&lt;/code&gt; * type. * * Group: advanced * * @param entityResolver the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder entityResolver( org.xml.sax.EntityResolver entityResolver) { doSetProperty("entityResolver", entityResolver); return this; } /** * To use a custom org.xml.sax.EntityResolver with * javax.xml.transform.sax.SAXSource. * * The option will be converted to a * &lt;code&gt;org.xml.sax.EntityResolver&lt;/code&gt; type. * * Group: advanced * * @param entityResolver the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder entityResolver( String entityResolver) { doSetProperty("entityResolver", entityResolver); return this; } /** * Allows to configure to use a custom * javax.xml.transform.ErrorListener. Beware when doing this then the * default error listener which captures any errors or fatal errors and * store information on the Exchange as properties is not in use. So * only use this option for special use-cases. * * The option is a: * &lt;code&gt;javax.xml.transform.ErrorListener&lt;/code&gt; type. * * Group: advanced * * @param errorListener the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder errorListener( javax.xml.transform.ErrorListener errorListener) { doSetProperty("errorListener", errorListener); return this; } /** * Allows to configure to use a custom * javax.xml.transform.ErrorListener. Beware when doing this then the * default error listener which captures any errors or fatal errors and * store information on the Exchange as properties is not in use. So * only use this option for special use-cases. * * The option will be converted to a * &lt;code&gt;javax.xml.transform.ErrorListener&lt;/code&gt; type. * * Group: advanced * * @param errorListener the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder errorListener( String errorListener) { doSetProperty("errorListener", errorListener); return this; } /** * Allows you to use a custom * org.apache.camel.builder.xml.ResultHandlerFactory which is capable of * using custom org.apache.camel.builder.xml.ResultHandler types. * * The option is a: * &lt;code&gt;org.apache.camel.component.xslt.ResultHandlerFactory&lt;/code&gt; type. * * Group: advanced * * @param resultHandlerFactory the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder resultHandlerFactory( org.apache.camel.component.xslt.ResultHandlerFactory resultHandlerFactory) { doSetProperty("resultHandlerFactory", resultHandlerFactory); return this; } /** * Allows you to use a custom * org.apache.camel.builder.xml.ResultHandlerFactory which is capable of * using custom org.apache.camel.builder.xml.ResultHandler types. * * The option will be converted to a * &lt;code&gt;org.apache.camel.component.xslt.ResultHandlerFactory&lt;/code&gt; type. * * Group: advanced * * @param resultHandlerFactory the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder resultHandlerFactory( String resultHandlerFactory) { doSetProperty("resultHandlerFactory", resultHandlerFactory); return this; } /** * To use a custom Saxon configuration. * * The option is a: &lt;code&gt;net.sf.saxon.Configuration&lt;/code&gt; * type. * * Group: advanced * * @param saxonConfiguration the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder saxonConfiguration( net.sf.saxon.Configuration saxonConfiguration) { doSetProperty("saxonConfiguration", saxonConfiguration); return this; } /** * To use a custom Saxon configuration. * * The option will be converted to a * &lt;code&gt;net.sf.saxon.Configuration&lt;/code&gt; type. * * Group: advanced * * @param saxonConfiguration the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder saxonConfiguration( String saxonConfiguration) { doSetProperty("saxonConfiguration", saxonConfiguration); return this; } /** * Allows you to use a custom * net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add * camel-saxon to the classpath. The function is looked up in the * registry, where you can comma to separate multiple values to lookup. * * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type. * * Group: advanced * * @param saxonExtensionFunctions the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder saxonExtensionFunctions( String saxonExtensionFunctions) { doSetProperty("saxonExtensionFunctions", saxonExtensionFunctions); return this; } /** * Feature for XML secure processing (see javax.xml.XMLConstants). This * is enabled by default. However, when using Saxon Professional you may * need to turn this off to allow Saxon to be able to use Java extension * functions. * * The option is a: &lt;code&gt;boolean&lt;/code&gt; type. * * Default: true * Group: advanced * * @param secureProcessing the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder secureProcessing( boolean secureProcessing) { doSetProperty("secureProcessing", secureProcessing); return this; } /** * Feature for XML secure processing (see javax.xml.XMLConstants). This * is enabled by default. However, when using Saxon Professional you may * need to turn this off to allow Saxon to be able to use Java extension * functions. * * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt; * type. * * Default: true * Group: advanced * * @param secureProcessing the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder secureProcessing( String secureProcessing) { doSetProperty("secureProcessing", secureProcessing); return this; } /** * To use a custom XSLT transformer factory. * * The option is a: * &lt;code&gt;javax.xml.transform.TransformerFactory&lt;/code&gt; type. * * Group: advanced * * @param transformerFactory the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder transformerFactory( javax.xml.transform.TransformerFactory transformerFactory) { doSetProperty("transformerFactory", transformerFactory); return this; } /** * To use a custom XSLT transformer factory. * * The option will be converted to a * &lt;code&gt;javax.xml.transform.TransformerFactory&lt;/code&gt; type. * * Group: advanced * * @param transformerFactory the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder transformerFactory( String transformerFactory) { doSetProperty("transformerFactory", transformerFactory); return this; } /** * To use a custom XSLT transformer factory, specified as a FQN class * name. * * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type. * * Group: advanced * * @param transformerFactoryClass the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder transformerFactoryClass( String transformerFactoryClass) { doSetProperty("transformerFactoryClass", transformerFactoryClass); return this; } /** * A configuration strategy to apply on freshly created instances of * TransformerFactory. * * The option is a: * &lt;code&gt;org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy&lt;/code&gt; type. * * Group: advanced * * @param transformerFactoryConfigurationStrategy the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder transformerFactoryConfigurationStrategy( org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy transformerFactoryConfigurationStrategy) { doSetProperty("transformerFactoryConfigurationStrategy", transformerFactoryConfigurationStrategy); return this; } /** * A configuration strategy to apply on freshly created instances of * TransformerFactory. * * The option will be converted to a * &lt;code&gt;org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy&lt;/code&gt; type. * * Group: advanced * * @param transformerFactoryConfigurationStrategy the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder transformerFactoryConfigurationStrategy( String transformerFactoryConfigurationStrategy) { doSetProperty("transformerFactoryConfigurationStrategy", transformerFactoryConfigurationStrategy); return this; } /** * To use a custom javax.xml.transform.URIResolver. * * The option is a: * &lt;code&gt;javax.xml.transform.URIResolver&lt;/code&gt; type. * * Group: advanced * * @param uriResolver the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder uriResolver( javax.xml.transform.URIResolver uriResolver) { doSetProperty("uriResolver", uriResolver); return this; } /** * To use a custom javax.xml.transform.URIResolver. * * The option will be converted to a * &lt;code&gt;javax.xml.transform.URIResolver&lt;/code&gt; type. * * Group: advanced * * @param uriResolver the value to set * @return the dsl builder */ default AdvancedXsltSaxonEndpointBuilder uriResolver(String uriResolver) { doSetProperty("uriResolver", uriResolver); return this; } } public interface XsltSaxonBuilders { /** * XSLT Saxon (camel-xslt-saxon) * Transform XML payloads using an XSLT template using Saxon. * * Category: core,transformation * Since: 3.0 * Maven coordinates: org.apache.camel:camel-xslt-saxon * * @return the dsl builder for the headers' name. */ default XsltSaxonHeaderNameBuilder xsltSaxon() { return XsltSaxonHeaderNameBuilder.INSTANCE; } /** * XSLT Saxon (camel-xslt-saxon) * Transform XML payloads using an XSLT template using Saxon. * * Category: core,transformation * Since: 3.0 * Maven coordinates: org.apache.camel:camel-xslt-saxon * * Syntax: <code>xslt-saxon:resourceUri</code> * * Path parameter: resourceUri (required) * Path to the template. The following is supported by the default * URIResolver. You can prefix with: classpath, file, http, ref, or * bean. classpath, file and http loads the resource using these * protocols (classpath is default). ref will lookup the resource in the * registry. bean will call a method on a bean to be used as the * resource. For bean you can specify the method name after dot, eg * bean:myBean.myMethod * * @param path resourceUri * @return the dsl builder */ default XsltSaxonEndpointBuilder xsltSaxon(String path) { return XsltSaxonEndpointBuilderFactory.endpointBuilder("xslt-saxon", path); } /** * XSLT Saxon (camel-xslt-saxon) * Transform XML payloads using an XSLT template using Saxon. * * Category: core,transformation * Since: 3.0 * Maven coordinates: org.apache.camel:camel-xslt-saxon * * Syntax: <code>xslt-saxon:resourceUri</code> * * Path parameter: resourceUri (required) * Path to the template. The following is supported by the default * URIResolver. You can prefix with: classpath, file, http, ref, or * bean. classpath, file and http loads the resource using these * protocols (classpath is default). ref will lookup the resource in the * registry. bean will call a method on a bean to be used as the * resource. For bean you can specify the method name after dot, eg * bean:myBean.myMethod * * @param componentName to use a custom component name for the endpoint * instead of the default name * @param path resourceUri * @return the dsl builder */ default XsltSaxonEndpointBuilder xsltSaxon( String componentName, String path) { return XsltSaxonEndpointBuilderFactory.endpointBuilder(componentName, path); } } /** * The builder of headers' name for the XSLT Saxon component. */ public static class XsltSaxonHeaderNameBuilder { /** * The internal instance of the builder used to access to all the * methods representing the name of headers. */ private static final XsltSaxonHeaderNameBuilder INSTANCE = new XsltSaxonHeaderNameBuilder(); /** * The XSLT file name. * * The option is a: {@code String} type. * * Group: producer * * @return the name of the header {@code XsltFileName}. */ public String xsltFileName() { return "XsltFileName"; } } static XsltSaxonEndpointBuilder endpointBuilder( String componentName, String path) { class XsltSaxonEndpointBuilderImpl extends AbstractEndpointBuilder implements XsltSaxonEndpointBuilder, AdvancedXsltSaxonEndpointBuilder { public XsltSaxonEndpointBuilderImpl(String path) { super(componentName, path); } } return new XsltSaxonEndpointBuilderImpl(path); } }
{ "content_hash": "6ca3ead27352689e5691fac199435536", "timestamp": "", "source": "github", "line_count": 733, "max_line_length": 146, "avg_line_length": 39.15279672578445, "alnum_prop": 0.5947942437018712, "repo_name": "apache/camel", "id": "49c0089fb39505bed5bf22610148f56fc8dadf42", "size": "29501", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/XsltSaxonEndpointBuilderFactory.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Apex", "bytes": "6695" }, { "name": "Batchfile", "bytes": "2353" }, { "name": "CSS", "bytes": "5472" }, { "name": "Dockerfile", "bytes": "5676" }, { "name": "Elm", "bytes": "10852" }, { "name": "FreeMarker", "bytes": "8015" }, { "name": "Groovy", "bytes": "412301" }, { "name": "HTML", "bytes": "213802" }, { "name": "Java", "bytes": "114936384" }, { "name": "JavaScript", "bytes": "103655" }, { "name": "Jsonnet", "bytes": "1734" }, { "name": "Kotlin", "bytes": "41869" }, { "name": "Mustache", "bytes": "525" }, { "name": "RobotFramework", "bytes": "8461" }, { "name": "Ruby", "bytes": "88" }, { "name": "Shell", "bytes": "15327" }, { "name": "Tcl", "bytes": "4974" }, { "name": "Thrift", "bytes": "6979" }, { "name": "XQuery", "bytes": "699" }, { "name": "XSLT", "bytes": "276597" } ], "symlink_target": "" }
#include <string> #include <osquery/core.h> #include <osquery/config.h> #include <osquery/logger.h> #include <osquery/tables.h> #include "osquery/events/linux/syslog.h" #include "osquery/tables/events/event_utils.h" namespace osquery { FLAG(uint64, syslog_events_expiry, 60 * 60 * 24 * 30, // Keep 30 days by default "Timeout to expire event subscriber results"); FLAG(uint64, syslog_events_max, 100000, "Maximum number of events per type to buffer"); class SyslogEventSubscriber : public EventSubscriber<SyslogEventPublisher> { public: // Implement the pure virtual init interface. Status init() override { SyslogSubscriptionContextRef sc = createSubscriptionContext(); subscribe(&SyslogEventSubscriber::Callback, sc); return Status(0, "OK"); } size_t getEventsExpiry() override { return FLAGS_syslog_events_expiry; } size_t getEventsMax() override { return FLAGS_syslog_events_max; } Status Callback(const ECRef& ec, const SCRef& sc); }; REGISTER(SyslogEventSubscriber, "event_subscriber", "syslog"); Status SyslogEventSubscriber::Callback(const ECRef& ec, const SCRef& sc) { Row r(ec->fields); add(r); return Status(0, "OK"); } }
{ "content_hash": "a5a5a34fb94536b6e182faaa97eea332", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 76, "avg_line_length": 23.442307692307693, "alnum_prop": 0.7071369975389664, "repo_name": "friedbutter/osquery", "id": "a42aa4fc5a9c1cda39518646b266ce6033e135d1", "size": "1534", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "osquery/tables/events/linux/syslog_events.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "38093" }, { "name": "C++", "bytes": "2038572" }, { "name": "CMake", "bytes": "71896" }, { "name": "Makefile", "bytes": "6070" }, { "name": "Objective-C++", "bytes": "56747" }, { "name": "Shell", "bytes": "2038" }, { "name": "Thrift", "bytes": "2969" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>V8 API Reference Guide for node.js v0.5.4: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for node.js v0.5.4 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_value.html">Value</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">v8::Value Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="classv8_1_1_value.html">v8::Value</a>, including all inherited members.</p> <table class="directory"> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>BooleanValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a643fcf5c7c6136d819b0b4927f8d1724">Equals</a>(Handle&lt; Value &gt; that) const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Int32Value</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>IntegerValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a95c39ad189c09630dd90ee5c1a7e89a1">IsArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a6baff625780eac51413f2392250e81be">IsBoolean</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#aebb6cd7cbb34771df1973aef2e544931">IsBooleanObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#abcdd87539238a68f8337bae7d0a9c1ac">IsDate</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a7aed90ede9bf48b10f18cdb97d50fd1e">IsExternal</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a265c208159ff3163ecda1e9f71b99115">IsFalse</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a33f329c93a9f417e2d05b438e6e5429c">IsFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a70d4afaccc7903e6a01f40a46ad04188">IsInt32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a11293ed56e068b3bccdae482f2752f58">IsNativeError</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a0757712320a9bcfe5fc0a099524d986f">IsNull</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a32003b217768f535a4728bbd16ebd7d5">IsNumber</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a2b4dd15e4135823a4bb1128a60c063cf">IsNumberObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a360f1fe4a8ee74382f571a12eb14a222">IsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a36ba10231b5aaf6c63d8589cd53c9a73">IsRegExp</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#ab23a34b7df62806808e01b0908bf5f00">IsString</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a2ded13f1962fc1fa15eabc525fb433ee">IsStringObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#ae93277798682f4be9adc204a16c40591">IsTrue</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a2674a47b2550eb456a7ecfaf09d2f97e">IsUint32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#adeeae3576aecadc4176f94a415a70a90">IsUndefined</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>NumberValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>StrictEquals</b>(Handle&lt; Value &gt; that) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1_value.html#ab6b19a1e5aa5df50dfbb5d2ffa60bcdc">ToArrayIndex</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToBoolean</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToDetailString</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToInt32</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToInteger</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToNumber</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToObject</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToString</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ToUint32</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Uint32Value</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Aug 11 2015 23:47:18 for V8 API Reference Guide for node.js v0.5.4 by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
{ "content_hash": "b09f966be53f2a0c3faf5a83bea58045", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 293, "avg_line_length": 94.23404255319149, "alnum_prop": 0.6567321442010988, "repo_name": "v8-dox/v8-dox.github.io", "id": "2d392548d1c4a7ee81298de8db5bc225b0bcde34", "size": "13287", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "89bed19/html/classv8_1_1_value-members.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="robots" content="index, follow, all" /> <title>Hayttp\Mock\MockResponse | Hayttp API</title> <link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="../../css/bootstrap-theme.min.css"> <link rel="stylesheet" type="text/css" href="../../css/sami.css"> <script src="../../js/jquery-1.11.1.min.js"></script> <script src="../../js/bootstrap.min.js"></script> <script src="../../js/typeahead.min.js"></script> <script src="../../sami.js"></script> <meta name="MobileOptimized" content="width"> <meta name="HandheldFriendly" content="true"> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"> </head> <body id="class" data-name="class:Hayttp_Mock_MockResponse" data-root-path="../../"> <div id="content"> <div id="left-column"> <div id="control-panel"> <form action="#" method="GET"> <select id="version-switcher" name="version"> <option value="../../../1.0.0/index.html" data-version="1.0.0">1.0.0</option> <option value="../../../1.0.1/index.html" data-version="1.0.1">1.0.1</option> <option value="../../../master/index.html" data-version="master">master dev branch</option> </select> </form> <script> $('option[data-version="'+window.projectVersion+'"]').prop('selected', true); </script> <form id="search-form" action="../../search.html" method="GET"> <span class="glyphicon glyphicon-search"></span> <input name="search" class="typeahead form-control" type="search" placeholder="Search"> </form> </div> <div id="api-tree"></div> </div> <div id="right-column"> <nav id="site-nav" class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../index.html">Hayttp API</a> </div> <div class="collapse navbar-collapse" id="navbar-elements"> <ul class="nav navbar-nav"> <li><a href="../../classes.html">Classes</a></li> <li><a href="../../namespaces.html">Namespaces</a></li> <li><a href="../../interfaces.html">Interfaces</a></li> <li><a href="../../traits.html">Traits</a></li> <li><a href="../../doc-index.html">Index</a></li> <li><a href="../../search.html">Search</a></li> </ul> </div> </div> </nav> <div class="namespace-breadcrumbs"> <ol class="breadcrumb"> <li><span class="label label-default">class</span></li> <li><a href="../../Hayttp.html">Hayttp</a></li><li class="backslash">\</li><li><a href="../../Hayttp/Mock.html">Mock</a></li><li class="backslash">\</li><li>MockResponse</li> </ol> </div> <div id="page-content"> <div class="page-header"> <h1> MockResponse </h1> </div> <p> class <strong>MockResponse</strong> extends <a href="../../Hayttp/Response.html"><abbr title="Hayttp\Response">Response</abbr></a> (<a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php">View source</a>) </p> <div class="description"> <p>Mock Request.</p> <p>Extends base request, but adds mocking functionality</p> </div> <h2>Traits</h2> <div class="container-fluid underlined"> <div class="row"> <div class="col-md-6"> <a href="../../Hayttp/Traits/Common/Extendable.html"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a> </div> <div class="col-md-6"> Make a class dynamically extendable. </div> </div> <div class="row"> <div class="col-md-6"> <a href="../../Hayttp/Traits/Common/DebugInfo.html"><abbr title="Hayttp\Traits\Common\DebugInfo">DebugInfo</abbr></a> </div> <div class="col-md-6"> Add __debugInfo support. </div> </div> <div class="row"> <div class="col-md-6"> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> </div> <div class="col-md-6"> </div> </div> <div class="row"> <div class="col-md-6"> <a href="../../Hayttp/Traits/Response/Assertions.html"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> </div> <div class="col-md-6"> </div> </div> <div class="row"> <div class="col-md-6"> <a href="../../Hayttp/Traits/Response/StatusHelpers.html"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a> </div> <div class="col-md-6"> </div> </div> </div> <h2>Properties</h2> <table class="table table-condensed"> <tr> <td class="type" id="property_extensions"> static protected array </td> <td>$extensions</td> <td class="last"></td> <td><small>from&nbsp;<a href="../../Hayttp/Traits/Common/Extendable.html#property_extensions"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a></small></td> </tr> <tr> <td class="type" id="property_body"> protected string </td> <td>$body</td> <td class="last"></td> <td><small>from&nbsp;<a href="../../Hayttp/Response.html#property_body"><abbr title="Hayttp\Response">Response</abbr></a></small></td> </tr> <tr> <td class="type" id="property_headers"> protected array </td> <td>$headers</td> <td class="last"></td> <td><small>from&nbsp;<a href="../../Hayttp/Response.html#property_headers"><abbr title="Hayttp\Response">Response</abbr></a></small></td> </tr> <tr> <td class="type" id="property_metadata"> protected array </td> <td>$metadata</td> <td class="last"></td> <td><small>from&nbsp;<a href="../../Hayttp/Response.html#property_metadata"><abbr title="Hayttp\Response">Response</abbr></a></small></td> </tr> <tr> <td class="type" id="property_request"> protected <a href="../../Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a> </td> <td>$request</td> <td class="last"></td> <td><small>from&nbsp;<a href="../../Hayttp/Response.html#property_request"><abbr title="Hayttp\Response">Response</abbr></a></small></td> </tr> <tr> <td class="type" id="property_bomCharset"> protected string </td> <td>$bomCharset</td> <td class="last"></td> <td><small>from&nbsp;<a href="../../Hayttp/Response.html#property_bomCharset"><abbr title="Hayttp\Response">Response</abbr></a></small></td> </tr> <tr> <td class="type" id="property_bomEndian"> protected string </td> <td>$bomEndian</td> <td class="last"></td> <td><small>from&nbsp;<a href="../../Hayttp/Response.html#property_bomEndian"><abbr title="Hayttp\Response">Response</abbr></a></small></td> </tr> </table> <h2>Methods</h2> <div class="container-fluid underlined"> <div class="row"> <div class="col-md-2 type"> static&nbsp;bool </div> <div class="col-md-8 type"> <a href="#method_hasExtension">hasExtension</a>(string $methodName) <p>Has this class been extended with a given method?</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Common/Extendable.html#method_hasExtension"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> static&nbsp; </div> <div class="col-md-8 type"> <a href="#method_extend">extend</a>(string $methodName, callable $callable) <p>Add a method to the class.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Common/Extendable.html#method_extend"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> static&nbsp;<abbr title="Hayttp\Traits\Common\$object">$object</abbr> </div> <div class="col-md-8 type"> <a href="#method_mixin">mixin</a>(object $object) <p>Mix in all the public methods of an object.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Common/Extendable.html#method_mixin"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> mixed </div> <div class="col-md-8 type"> <a href="#method_execDynamicClosure">execDynamicClosure</a>(<a target="_blank" href="http://php.net/Closure">Closure</a> $closure, array $args) <p>Execute a static call with the correct class scope.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Common/Extendable.html#method_execDynamicClosure"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> static&nbsp;mixed </div> <div class="col-md-8 type"> <a href="#method_execStaticCallable">execStaticCallable</a>(<a target="_blank" href="http://php.net/Closure">Closure</a> $closure, array $args) <p>Execute a static call with the correct class scope.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Common/Extendable.html#method_execStaticCallable"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> mixed </div> <div class="col-md-8 type"> <a href="#method___call">__call</a>(string $methodName, array $args) <p>Magic Method for dynamic method names.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Common/Extendable.html#method___call"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> static&nbsp;mixed </div> <div class="col-md-8 type"> <a href="#method___callStatic">__callStatic</a>(string $methodName, array $args) <p>Magic Method for dynamic names of static methods.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Common/Extendable.html#method___callStatic"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> array </div> <div class="col-md-8 type"> <a href="#method_instanceVariables">instanceVariables</a>() <p>Public accessor for all instance variables.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Common/DebugInfo.html#method_instanceVariables"><abbr title="Hayttp\Traits\Common\DebugInfo">DebugInfo</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> array </div> <div class="col-md-8 type"> <a href="#method___debugInfo">__debugInfo</a>() <p>Return debug info for var_dump, et al.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Common/DebugInfo.html#method___debugInfo"><abbr title="Hayttp\Traits\Common\DebugInfo">DebugInfo</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> mixed </div> <div class="col-md-8 type"> <a href="#method_transform">transform</a>(callable $callback) <p>Transform this response into something else.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Callbacks.html#method_transform"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_apply">apply</a>(callable $callback, mixed $outResult = null) <p>Execute a callback.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Callbacks.html#method_apply"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_on5xx">on5xx</a>(callable $callback, mixed $outResult = null) <p>Execute a callback if statusCode is 5xx.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Callbacks.html#method_on5xx"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_on4xx">on4xx</a>(callable $callback, mixed $outResult = null) <p>Execute a callback if statusCode is 4xx.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Callbacks.html#method_on4xx"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_on3xx">on3xx</a>(callable $callback, mixed $outResult = null) <p>Execute a callback if statusCode is 3xx.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Callbacks.html#method_on3xx"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_on2xx">on2xx</a>(callable $callback, mixed $outResult = null) <p>Execute a callback if status code is 2xx.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Callbacks.html#method_on2xx"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_onError">onError</a>(callable $callback, mixed $outResult = null) <p>Execute a callback if status code is 4xx or 5xx.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Callbacks.html#method_onError"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_onRedirect">onRedirect</a>(callable $callback, mixed $outResult = null) <p>Execute a callback if status code is 3xx.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Callbacks.html#method_onRedirect"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_onSuccess">onSuccess</a>(callable $callback, mixed $outResult = null) <p>Execute a callback if status code indicates a success.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Callbacks.html#method_onSuccess"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_onStatusCode">onStatusCode</a>(int $statusCode, callable $callback, mixed $outResult = null) <p>Execute a callback if status code === $statusCode.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Callbacks.html#method_onStatusCode"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensure">ensure</a>(bool $success, <a href="../../Hayttp/Exceptions/ResponseException.html"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr></a> $exception) <p>Throw a ResponseException if $success is false.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensureStatusInRange">ensureStatusInRange</a>(int $min, int $max) <p>Ensure that status code is in a given range.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureStatusInRange"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensureStatusIn">ensureStatusIn</a>(array $validCodes) <p>Ensure that the status code is in a given et of codes.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureStatusIn"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensureStatus">ensureStatus</a>(int $validCode) <p>Ensure that the status code equals $validCode.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureStatus"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensure2xx">ensure2xx</a>() <p>Ensure that the status code is in the range [200.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure2xx"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensure200">ensure200</a>() <p>Ensure that the status code is 200.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure200"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensure201">ensure201</a>() <p>Ensure that the status code is 201.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure201"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensure204">ensure204</a>() <p>Ensure that the status code is 204.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure204"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensure301">ensure301</a>() <p>Ensure that the status code is 301.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure301"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensure302">ensure302</a>() <p>Ensure that the status code is 302.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure302"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensureJson">ensureJson</a>(array|object $data = [], bool $strict = true) <p>Ensure that the content type is application/json.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureJson"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensureXml">ensureXml</a>() <p>Ensure that the content type is application/xml.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureXml"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensureContentType">ensureContentType</a>(string|string[] $contentType) <p>Ensure that the response has a given content type.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureContentType"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensureSuccess">ensureSuccess</a>() <p>Ensure that the status code is in the range [200.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureSuccess"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensureRedirect">ensureRedirect</a>(string $url = null) <p>Assert whether the response is redirecting to a given URI.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureRedirect"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensureHasHeader">ensureHasHeader</a>(string $headerName, mixed $expectedValue = null) <p>Asserts that the response contains the given header and equals the optional value.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureHasHeader"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> </div> <div class="col-md-8 type"> <a href="#method_ensureContains">ensureContains</a>(string $value) <p>Assert that the given string is contained within the response.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureContains"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_is2xx">is2xx</a>() <p>Is the status code 2xx ?</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_is2xx"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_is3xx">is3xx</a>() <p>Is the status code 3xx ?</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_is3xx"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_is4xx">is4xx</a>() <p>Is the status code 3xx ?</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_is4xx"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_is5xx">is5xx</a>() <p>Is the status code 5xx ?</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_is5xx"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_isSuccess">isSuccess</a>() <p>Is this request a success? (i.e. a 2xx status code).</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_isSuccess"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_isRedirect">isRedirect</a>() <p>Is this request a redirect? (i.e. a 3xx status code).</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_isRedirect"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_isError">isError</a>() <p>Is this request a failure? (i.e. a 4xx or 5xx status code).</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_isError"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> </div> <div class="col-md-8 type"> <a href="#method___construct">__construct</a>(string $body, array $headers, array $metadata, <a href="../../Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a> $request) <p>Constructor.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method___construct"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string </div> <div class="col-md-8 type"> <a href="#method___toString">__toString</a>() <p>Cast to string.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method___toString"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string[] </div> <div class="col-md-8 type"> <a href="#method_parseStatusLine">parseStatusLine</a>() <p>Return the status line of the response.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_parseStatusLine"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> array </div> <div class="col-md-8 type"> <a href="#method_metadata">metadata</a>() <p>Get the (raw) metadata.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_metadata"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_request">request</a>() <p>Get the request that produced this response.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_request"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string </div> <div class="col-md-8 type"> <a href="#method_statusCode">statusCode</a>() <p>Get the HTTP Response Code.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_statusCode"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string </div> <div class="col-md-8 type"> <a href="#method_reasonPhrase">reasonPhrase</a>() <p>Get the http reason phrase.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_reasonPhrase"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string|null </div> <div class="col-md-8 type"> <a href="#method_contentType">contentType</a>() <p>Get the contents of the Content-Type header.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_contentType"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string|null </div> <div class="col-md-8 type"> <a href="#method_contentTypeWithoutCharset">contentTypeWithoutCharset</a>() <p>Get the content type, but remove anything after the first semi-colon.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_contentTypeWithoutCharset"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> array </div> <div class="col-md-8 type"> <a href="#method_headers">headers</a>() <p>Get the headers.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_headers"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string|null </div> <div class="col-md-8 type"> <a href="#method_header">header</a>(string $headerName) <p>Get the contents of a given header.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_header"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_isJson">isJson</a>() <p>Is this a json response.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_isJson"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_isXml">isXml</a>() <p>Is this an xml response.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_isXml"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_isPlainText">isPlainText</a>() <p>Is the response text/plain.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_isPlainText"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_isText">isText</a>() <p>Is this a text response.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_isText"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_isUrlEncoded">isUrlEncoded</a>() <p>Is this an url-encoded response.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_isUrlEncoded"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> bool </div> <div class="col-md-8 type"> <a href="#method_hasContentType">hasContentType</a>(string|string[] $contentType) <p>Does the response have a given content type.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_hasContentType"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string </div> <div class="col-md-8 type"> <a href="#method_body">body</a>() <p>Get the response body.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_body"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string|null </div> <div class="col-md-8 type"> <a href="#method_bomCharset">bomCharset</a>() <p>If a BOM was given in the response body, return the parsed charset.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_bomCharset"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string|null </div> <div class="col-md-8 type"> <a href="#method_bomEndian">bomEndian</a>() <p>If a BOM was given in the response body, return the detected endianness.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_bomEndian"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> mixed </div> <div class="col-md-8 type"> <a href="#method_decoded">decoded</a>() <p>Get the parsed body of the response.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_decoded"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> mixed </div> <div class="col-md-8 type"> <a href="#method_jsonDecoded">jsonDecoded</a>() <p>Parse the body as json and return it as a PHP value.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_jsonDecoded"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> <a target="_blank" href="http://php.net/SimpleXmlElement">SimpleXmlElement</a> </div> <div class="col-md-8 type"> <a href="#method_xmlDecoded">xmlDecoded</a>() <p>Parse the body as xml and return it as a SimpleXmlElement.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_xmlDecoded"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> array </div> <div class="col-md-8 type"> <a href="#method_urlDecoded">urlDecoded</a>() <p>Parse the response as url-encoded and return the parsed array.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_urlDecoded"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string </div> <div class="col-md-8 type"> <a href="#method_render">render</a>() <p>Get the entire response, including headers, as a string.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_render"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> string </div> <div class="col-md-8 type"> <a href="#method_renderHeaders">renderHeaders</a>() <p>Render headers in to a well-formatted string.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_renderHeaders"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> array </div> <div class="col-md-8 type"> <a href="#method_extraDebugInfo">extraDebugInfo</a>() <p>Get extra debug information.</p> </div> <div class="col-md-2"><small>from&nbsp;<a href="../../Hayttp/Response.html#method_extraDebugInfo"><abbr title="Hayttp\Response">Response</abbr></a></small></div> </div> <div class="row"> <div class="col-md-2 type"> static&nbsp;<a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_new">new</a>(<a href="../../Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a> $request, <a href="../../Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a> $route) <p>Factory.</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_with">with</a>(string $property, mixed $value) <p>Clone object with a new property value.</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_withStatus">withStatus</a>(int $statusCode, string $reasonPhrase, string $httpVersion = &#039;1.0&#039;) <p>Set the status code and reason phrase of the http response.</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_withHeaders">withHeaders</a>(array $headers) <p>Set headers on the mock response.</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_withAdditionalHeaders">withAdditionalHeaders</a>(array $additionalHeaders) <p>Add headers to the mock response.</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_withContentType">withContentType</a>(string $contentType) <p>Set the content type.</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_withHeader">withHeader</a>(string $name, string $value) <p>Add a header to the response.</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_withBody">withBody</a>(string $body) <p>Set the body of the response.</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_withJsonBody">withJsonBody</a>(array|object $payload) <p>Set the a json body.</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_withXmlBody">withXmlBody</a>($xml) <p>Set the a json body.</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> </div> <div class="col-md-8 type"> <a href="#method_withRoute">withRoute</a>(<a href="../../Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a> $route) <p>Add information about the route to the response.</p> </div> <div class="col-md-2"></div> </div> </div> <h2>Details</h2> <div id="method-details"> <div class="method-item"> <h3 id="method_hasExtension"> <div class="location">in <a href="../../Hayttp/Traits/Common/Extendable.html#method_hasExtension"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Common/Extendable.php#L36">line 36</a></div> <code> static bool <strong>hasExtension</strong>(string $methodName) </code> </h3> <div class="details"> <div class="method-description"> <p>Has this class been extended with a given method?</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$methodName</td> <td>The name of the method</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_extend"> <div class="location">in <a href="../../Hayttp/Traits/Common/Extendable.html#method_extend"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Common/Extendable.php#L47">line 47</a></div> <code> static <strong>extend</strong>(string $methodName, callable $callable) </code> </h3> <div class="details"> <div class="method-description"> <p>Add a method to the class.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$methodName</td> <td></td> </tr> <tr> <td>callable</td> <td>$callable</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_mixin"> <div class="location">in <a href="../../Hayttp/Traits/Common/Extendable.html#method_mixin"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Common/Extendable.php#L59">line 59</a></div> <code> static <abbr title="Hayttp\Traits\Common\$object">$object</abbr> <strong>mixin</strong>(object $object) </code> </h3> <div class="details"> <div class="method-description"> <p>Mix in all the public methods of an object.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>object</td> <td>$object</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Common\$object">$object</abbr></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_execDynamicClosure"> <div class="location">in <a href="../../Hayttp/Traits/Common/Extendable.html#method_execDynamicClosure"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Common/Extendable.php#L80">line 80</a></div> <code> mixed <strong>execDynamicClosure</strong>(<a target="_blank" href="http://php.net/Closure">Closure</a> $closure, array $args) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a static call with the correct class scope.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td><a target="_blank" href="http://php.net/Closure">Closure</a></td> <td>$closure</td> <td></td> </tr> <tr> <td>array</td> <td>$args</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>mixed</td> <td>Result of calling $callable(...$args)</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_execStaticCallable"> <div class="location">in <a href="../../Hayttp/Traits/Common/Extendable.html#method_execStaticCallable"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Common/Extendable.php#L95">line 95</a></div> <code> static mixed <strong>execStaticCallable</strong>(<a target="_blank" href="http://php.net/Closure">Closure</a> $closure, array $args) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a static call with the correct class scope.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td><a target="_blank" href="http://php.net/Closure">Closure</a></td> <td>$closure</td> <td></td> </tr> <tr> <td>array</td> <td>$args</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>mixed</td> <td>Result of calling $callable(...$args)</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method___call"> <div class="location">in <a href="../../Hayttp/Traits/Common/Extendable.html#method___call"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Common/Extendable.php#L110">line 110</a></div> <code> mixed <strong>__call</strong>(string $methodName, array $args) </code> </h3> <div class="details"> <div class="method-description"> <p>Magic Method for dynamic method names.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$methodName</td> <td></td> </tr> <tr> <td>array</td> <td>$args</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>mixed</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method___callStatic"> <div class="location">in <a href="../../Hayttp/Traits/Common/Extendable.html#method___callStatic"><abbr title="Hayttp\Traits\Common\Extendable">Extendable</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Common/Extendable.php#L134">line 134</a></div> <code> static mixed <strong>__callStatic</strong>(string $methodName, array $args) </code> </h3> <div class="details"> <div class="method-description"> <p>Magic Method for dynamic names of static methods.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$methodName</td> <td></td> </tr> <tr> <td>array</td> <td>$args</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>mixed</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_instanceVariables"> <div class="location">in <a href="../../Hayttp/Traits/Common/DebugInfo.html#method_instanceVariables"><abbr title="Hayttp\Traits\Common\DebugInfo">DebugInfo</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Common/DebugInfo.php#L27">line 27</a></div> <code> array <strong>instanceVariables</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Public accessor for all instance variables.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method___debugInfo"> <div class="location">in <a href="../../Hayttp/Traits/Common/DebugInfo.html#method___debugInfo"><abbr title="Hayttp\Traits\Common\DebugInfo">DebugInfo</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Common/DebugInfo.php#L37">line 37</a></div> <code> array <strong>__debugInfo</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return debug info for var_dump, et al.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_transform"> <div class="location">in <a href="../../Hayttp/Traits/Response/Callbacks.html#method_transform"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Callbacks.php#L22">line 22</a></div> <code> mixed <strong>transform</strong>(callable $callback) </code> </h3> <div class="details"> <div class="method-description"> <p>Transform this response into something else.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>callable</td> <td>$callback</td> <td>Callback with signature: callback($response, $request)</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>mixed</td> <td>The result from calling $callbale</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_apply"> <div class="location">in <a href="../../Hayttp/Traits/Response/Callbacks.html#method_apply"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Callbacks.php#L37">line 37</a></div> <code> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> <strong>apply</strong>(callable $callback, mixed $outResult = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a callback.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>callable</td> <td>$callback</td> <td>Callback with signature: callback($response, $request)</td> </tr> <tr> <td>mixed</td> <td>$outResult</td> <td>The result of calling $callback</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></td> <td>A clone of $this</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_on5xx"> <div class="location">in <a href="../../Hayttp/Traits/Response/Callbacks.html#method_on5xx"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Callbacks.php#L53">line 53</a></div> <code> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> <strong>on5xx</strong>(callable $callback, mixed $outResult = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a callback if statusCode is 5xx.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>callable</td> <td>$callback</td> <td>Callback with signature: callback($response, $request)</td> </tr> <tr> <td>mixed</td> <td>$outResult</td> <td>The result of calling $callback</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></td> <td>A clone of $this</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_on4xx"> <div class="location">in <a href="../../Hayttp/Traits/Response/Callbacks.html#method_on4xx"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Callbacks.php#L70">line 70</a></div> <code> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> <strong>on4xx</strong>(callable $callback, mixed $outResult = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a callback if statusCode is 4xx.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>callable</td> <td>$callback</td> <td>Callback with signature: callback($response, $request)</td> </tr> <tr> <td>mixed</td> <td>$outResult</td> <td>The result of calling $callback</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></td> <td>A clone of $this</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_on3xx"> <div class="location">in <a href="../../Hayttp/Traits/Response/Callbacks.html#method_on3xx"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Callbacks.php#L87">line 87</a></div> <code> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> <strong>on3xx</strong>(callable $callback, mixed $outResult = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a callback if statusCode is 3xx.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>callable</td> <td>$callback</td> <td>Callback with signature: callback($response, $request)</td> </tr> <tr> <td>mixed</td> <td>$outResult</td> <td>The result of calling $callback</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></td> <td>A clone of $this</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_on2xx"> <div class="location">in <a href="../../Hayttp/Traits/Response/Callbacks.html#method_on2xx"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Callbacks.php#L104">line 104</a></div> <code> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> <strong>on2xx</strong>(callable $callback, mixed $outResult = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a callback if status code is 2xx.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>callable</td> <td>$callback</td> <td>Callback with signature: callback($response, $request)</td> </tr> <tr> <td>mixed</td> <td>$outResult</td> <td>The result of calling $callback</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></td> <td>A clone of $this</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_onError"> <div class="location">in <a href="../../Hayttp/Traits/Response/Callbacks.html#method_onError"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Callbacks.php#L123">line 123</a></div> <code> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> <strong>onError</strong>(callable $callback, mixed $outResult = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a callback if status code is 4xx or 5xx.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>callable</td> <td>$callback</td> <td>Callback with signature: callback($response, $request)</td> </tr> <tr> <td>mixed</td> <td>$outResult</td> <td>The result of calling $callback</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></td> <td>A clone of $this</td> </tr> </table> <h4>See also</h4> <table class="table table-condensed"> <tr> <td>Request::isError()</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_onRedirect"> <div class="location">in <a href="../../Hayttp/Traits/Response/Callbacks.html#method_onRedirect"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Callbacks.php#L142">line 142</a></div> <code> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> <strong>onRedirect</strong>(callable $callback, mixed $outResult = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a callback if status code is 3xx.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>callable</td> <td>$callback</td> <td>Callback with signature: callback($response, $request)</td> </tr> <tr> <td>mixed</td> <td>$outResult</td> <td>The result of calling $callback</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></td> <td>A clone of $this</td> </tr> </table> <h4>See also</h4> <table class="table table-condensed"> <tr> <td>Request::isRedirect()</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_onSuccess"> <div class="location">in <a href="../../Hayttp/Traits/Response/Callbacks.html#method_onSuccess"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Callbacks.php#L161">line 161</a></div> <code> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> <strong>onSuccess</strong>(callable $callback, mixed $outResult = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a callback if status code indicates a success.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>callable</td> <td>$callback</td> <td>Callback with signature: callback($response, $request)</td> </tr> <tr> <td>mixed</td> <td>$outResult</td> <td>The result of calling $callback</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></td> <td>A clone of $this</td> </tr> </table> <h4>See also</h4> <table class="table table-condensed"> <tr> <td>Request::isSuccess()</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_onStatusCode"> <div class="location">in <a href="../../Hayttp/Traits/Response/Callbacks.html#method_onStatusCode"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Callbacks.php#L179">line 179</a></div> <code> <a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a> <strong>onStatusCode</strong>(int $statusCode, callable $callback, mixed $outResult = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Execute a callback if status code === $statusCode.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$statusCode</td> <td></td> </tr> <tr> <td>callable</td> <td>$callback</td> <td>Callback with signature: callback($response, $request)</td> </tr> <tr> <td>mixed</td> <td>$outResult</td> <td>the result form the callback</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Traits/Response/Callbacks.html"><abbr title="Hayttp\Traits\Response\Callbacks">Callbacks</abbr></a></td> <td>A clone of $this</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensure"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L29">line 29</a></div> <code> protected <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensure</strong>(bool $success, <a href="../../Hayttp/Exceptions/ResponseException.html"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr></a> $exception) </code> </h3> <div class="details"> <div class="method-description"> <p>Throw a ResponseException if $success is false.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td>$success</td> <td></td> </tr> <tr> <td><a href="../../Hayttp/Exceptions/ResponseException.html"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr></a></td> <td>$exception</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/ResponseException.html"><abbr title="Hayttp\Exceptions\ResponseException">ResponseException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensureStatusInRange"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureStatusInRange"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L48">line 48</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensureStatusInRange</strong>(int $min, int $max) </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that status code is in a given range.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$min</td> <td></td> </tr> <tr> <td>int</td> <td>$max</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensureStatusIn"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureStatusIn"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L75">line 75</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensureStatusIn</strong>(array $validCodes) </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the status code is in a given et of codes.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>array</td> <td>$validCodes</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensureStatus"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureStatus"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L99">line 99</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensureStatus</strong>(int $validCode) </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the status code equals $validCode.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$validCode</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensure2xx"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure2xx"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L121">line 121</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensure2xx</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the status code is in the range [200.</p> <p>..299].</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensure200"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure200"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L133">line 133</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensure200</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the status code is 200.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensure201"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure201"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L145">line 145</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensure201</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the status code is 201.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensure204"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure204"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L157">line 157</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensure204</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the status code is 204.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensure301"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure301"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L169">line 169</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensure301</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the status code is 301.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensure302"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensure302"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L181">line 181</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensure302</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the status code is 302.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensureJson"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureJson"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L196">line 196</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensureJson</strong>(array|object $data = [], bool $strict = true) </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the content type is application/json.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>array|object</td> <td>$data</td> <td></td> </tr> <tr> <td>bool</td> <td>$strict</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/ContentTypeException.html"><abbr title="Hayttp\Exceptions\Response\ContentTypeException">ContentTypeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensureXml"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureXml"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L237">line 237</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensureXml</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the content type is application/xml.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/ContentTypeException.html"><abbr title="Hayttp\Exceptions\Response\ContentTypeException">ContentTypeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensureContentType"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureContentType"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L251">line 251</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensureContentType</strong>(string|string[] $contentType) </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the response has a given content type.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string|string[]</td> <td>$contentType</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/ContentTypeException.html"><abbr title="Hayttp\Exceptions\Response\ContentTypeException">ContentTypeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensureSuccess"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureSuccess"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L277">line 277</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensureSuccess</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Ensure that the status code is in the range [200.</p> <p>..299].</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Exceptions/Response/StatusCodeException.html"><abbr title="Hayttp\Exceptions\Response\StatusCodeException">StatusCodeException</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensureRedirect"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureRedirect"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L289">line 289</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensureRedirect</strong>(string $url = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Assert whether the response is redirecting to a given URI.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$url</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensureHasHeader"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureHasHeader"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L303">line 303</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensureHasHeader</strong>(string $headerName, mixed $expectedValue = null) </code> </h3> <div class="details"> <div class="method-description"> <p>Asserts that the response contains the given header and equals the optional value.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$headerName</td> <td></td> </tr> <tr> <td>mixed</td> <td>$expectedValue</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_ensureContains"> <div class="location">in <a href="../../Hayttp/Traits/Response/Assertions.html#method_ensureContains"><abbr title="Hayttp\Traits\Response\Assertions">Assertions</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/Assertions.php#L337">line 337</a></div> <code> <abbr title="Hayttp\Traits\Response\$this">$this</abbr> <strong>ensureContains</strong>(string $value) </code> </h3> <div class="details"> <div class="method-description"> <p>Assert that the given string is contained within the response.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$value</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><abbr title="Hayttp\Traits\Response\$this">$this</abbr></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_is2xx"> <div class="location">in <a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_is2xx"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/StatusHelpers.php#L20">line 20</a></div> <code> bool <strong>is2xx</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is the status code 2xx ?</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_is3xx"> <div class="location">in <a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_is3xx"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/StatusHelpers.php#L32">line 32</a></div> <code> bool <strong>is3xx</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is the status code 3xx ?</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_is4xx"> <div class="location">in <a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_is4xx"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/StatusHelpers.php#L44">line 44</a></div> <code> bool <strong>is4xx</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is the status code 3xx ?</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_is5xx"> <div class="location">in <a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_is5xx"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/StatusHelpers.php#L56">line 56</a></div> <code> bool <strong>is5xx</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is the status code 5xx ?</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isSuccess"> <div class="location">in <a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_isSuccess"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/StatusHelpers.php#L70">line 70</a></div> <code> bool <strong>isSuccess</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is this request a success? (i.e. a 2xx status code).</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> <h4>See also</h4> <table class="table table-condensed"> <tr> <td>is2xx</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isRedirect"> <div class="location">in <a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_isRedirect"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/StatusHelpers.php#L80">line 80</a></div> <code> bool <strong>isRedirect</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is this request a redirect? (i.e. a 3xx status code).</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isError"> <div class="location">in <a href="../../Hayttp/Traits/Response/StatusHelpers.html#method_isError"><abbr title="Hayttp\Traits\Response\StatusHelpers">StatusHelpers</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Traits/Response/StatusHelpers.php#L90">line 90</a></div> <code> bool <strong>isError</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is this request a failure? (i.e. a 4xx or 5xx status code).</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method___construct"> <div class="location">in <a href="../../Hayttp/Response.html#method___construct"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L64">line 64</a></div> <code> <strong>__construct</strong>(string $body, array $headers, array $metadata, <a href="../../Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a> $request) </code> </h3> <div class="details"> <div class="method-description"> <p>Constructor.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$body</td> <td>response body</td> </tr> <tr> <td>array</td> <td>$headers</td> <td>response headers</td> </tr> <tr> <td>array</td> <td>$metadata</td> <td>engine-specific metadata about the connection</td> </tr> <tr> <td><a href="../../Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></td> <td>$request</td> <td>the request that yielded this response</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method___toString"> <div class="location">in <a href="../../Hayttp/Response.html#method___toString"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L86">line 86</a></div> <code> string <strong>__toString</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Cast to string.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_parseStatusLine"> <div class="location">in <a href="../../Hayttp/Response.html#method_parseStatusLine"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L98">line 98</a></div> <code> string[] <strong>parseStatusLine</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return the status line of the response.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string[]</td> <td></td> </tr> </table> <h4>Exceptions</h4> <table class="table table-condensed"> <tr> <td><a target="_blank" href="http://php.net/LogicException">LogicException</a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_metadata"> <div class="location">in <a href="../../Hayttp/Response.html#method_metadata"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L115">line 115</a></div> <code> array <strong>metadata</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get the (raw) metadata.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_request"> <div class="location">in <a href="../../Hayttp/Response.html#method_request"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L125">line 125</a></div> <code> <a href="../../Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a> <strong>request</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get the request that produced this response.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_statusCode"> <div class="location">in <a href="../../Hayttp/Response.html#method_statusCode"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L135">line 135</a></div> <code> string <strong>statusCode</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get the HTTP Response Code.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_reasonPhrase"> <div class="location">in <a href="../../Hayttp/Response.html#method_reasonPhrase"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L145">line 145</a></div> <code> string <strong>reasonPhrase</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get the http reason phrase.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_contentType"> <div class="location">in <a href="../../Hayttp/Response.html#method_contentType"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L155">line 155</a></div> <code> string|null <strong>contentType</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get the contents of the Content-Type header.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string|null</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_contentTypeWithoutCharset"> <div class="location">in <a href="../../Hayttp/Response.html#method_contentTypeWithoutCharset"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L165">line 165</a></div> <code> string|null <strong>contentTypeWithoutCharset</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get the content type, but remove anything after the first semi-colon.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string|null</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_headers"> <div class="location">in <a href="../../Hayttp/Response.html#method_headers"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L175">line 175</a></div> <code> array <strong>headers</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get the headers.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_header"> <div class="location">in <a href="../../Hayttp/Response.html#method_header"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L187">line 187</a></div> <code> string|null <strong>header</strong>(string $headerName) </code> </h3> <div class="details"> <div class="method-description"> <p>Get the contents of a given header.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$headerName</td> <td>The name of the header to search for</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string|null</td> <td>the contents of the header or null if it was not found</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isJson"> <div class="location">in <a href="../../Hayttp/Response.html#method_isJson"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L197">line 197</a></div> <code> bool <strong>isJson</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is this a json response.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isXml"> <div class="location">in <a href="../../Hayttp/Response.html#method_isXml"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L207">line 207</a></div> <code> bool <strong>isXml</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is this an xml response.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isPlainText"> <div class="location">in <a href="../../Hayttp/Response.html#method_isPlainText"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L220">line 220</a></div> <code> bool <strong>isPlainText</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is the response text/plain.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isText"> <div class="location">in <a href="../../Hayttp/Response.html#method_isText"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L232">line 232</a></div> <code> bool <strong>isText</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is this a text response.</p> <p>Is the mime type text/*</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isUrlEncoded"> <div class="location">in <a href="../../Hayttp/Response.html#method_isUrlEncoded"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L242">line 242</a></div> <code> bool <strong>isUrlEncoded</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Is this an url-encoded response.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_hasContentType"> <div class="location">in <a href="../../Hayttp/Response.html#method_hasContentType"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L254">line 254</a></div> <code> bool <strong>hasContentType</strong>(string|string[] $contentType) </code> </h3> <div class="details"> <div class="method-description"> <p>Does the response have a given content type.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string|string[]</td> <td>$contentType</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_body"> <div class="location">in <a href="../../Hayttp/Response.html#method_body"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L283">line 283</a></div> <code> string <strong>body</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get the response body.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_bomCharset"> <div class="location">in <a href="../../Hayttp/Response.html#method_bomCharset"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L293">line 293</a></div> <code> string|null <strong>bomCharset</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>If a BOM was given in the response body, return the parsed charset.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string|null</td> <td>One of ["UTF-8", "UTF-16", "UTF-32", null]</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_bomEndian"> <div class="location">in <a href="../../Hayttp/Response.html#method_bomEndian"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L303">line 303</a></div> <code> string|null <strong>bomEndian</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>If a BOM was given in the response body, return the detected endianness.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string|null</td> <td>One of ["little", "big", null]</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_decoded"> <div class="location">in <a href="../../Hayttp/Response.html#method_decoded"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L319">line 319</a></div> <code> mixed <strong>decoded</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get the parsed body of the response.</p> <p>If the content type is json, a json object is returned (not an array!)</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>mixed</td> <td>If Content-Type is xml, a SimpleXmlElement is returned. If Content-Type is json an array or StdClass is returned. If Content-Type is application/x-www-form-urlencoded, an array is returned. Otherwise, return the body as a string without decoding it.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_jsonDecoded"> <div class="location">in <a href="../../Hayttp/Response.html#method_jsonDecoded"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L341">line 341</a></div> <code> mixed <strong>jsonDecoded</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Parse the body as json and return it as a PHP value.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>mixed</td> <td><ul> <li>array or StdClass</li> </ul> </td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_xmlDecoded"> <div class="location">in <a href="../../Hayttp/Response.html#method_xmlDecoded"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L357">line 357</a></div> <code> <a target="_blank" href="http://php.net/SimpleXmlElement">SimpleXmlElement</a> <strong>xmlDecoded</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Parse the body as xml and return it as a SimpleXmlElement.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a target="_blank" href="http://php.net/SimpleXmlElement">SimpleXmlElement</a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_urlDecoded"> <div class="location">in <a href="../../Hayttp/Response.html#method_urlDecoded"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L373">line 373</a></div> <code> array <strong>urlDecoded</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Parse the response as url-encoded and return the parsed array.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td></td> </tr> </table> <h4>See also</h4> <table class="table table-condensed"> <tr> <td>parse_str</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_render"> <div class="location">in <a href="../../Hayttp/Response.html#method_render"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L385">line 385</a></div> <code> string <strong>render</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get the entire response, including headers, as a string.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_renderHeaders"> <div class="location">in <a href="../../Hayttp/Response.html#method_renderHeaders"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L397">line 397</a></div> <code> protected string <strong>renderHeaders</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Render headers in to a well-formatted string.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_extraDebugInfo"> <div class="location">in <a href="../../Hayttp/Response.html#method_extraDebugInfo"><abbr title="Hayttp\Response">Response</abbr></a> at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Response.php#L421">line 421</a></div> <code> array <strong>extraDebugInfo</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Get extra debug information.</p> <p>Used by the DebugInfo trait.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_new"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L35">line 35</a></div> <code> static <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>new</strong>(<a href="../../Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a> $request, <a href="../../Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a> $route) </code> </h3> <div class="details"> <div class="method-description"> <p>Factory.</p> <p>Create an empty response from a given request.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Request.html"><abbr title="Hayttp\Request">Request</abbr></a></td> <td>$request</td> <td></td> </tr> <tr> <td><a href="../../Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a></td> <td>$route</td> <td>Routing of parameters passed to the handler</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_with"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L61">line 61</a></div> <code> protected <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>with</strong>(string $property, mixed $value) </code> </h3> <div class="details"> <div class="method-description"> <p>Clone object with a new property value.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$property</td> <td></td> </tr> <tr> <td>mixed</td> <td>$value</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_withStatus"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L80">line 80</a></div> <code> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>withStatus</strong>(int $statusCode, string $reasonPhrase, string $httpVersion = &#039;1.0&#039;) </code> </h3> <div class="details"> <div class="method-description"> <p>Set the status code and reason phrase of the http response.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$statusCode</td> <td></td> </tr> <tr> <td>string</td> <td>$reasonPhrase</td> <td></td> </tr> <tr> <td>string</td> <td>$httpVersion</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_withHeaders"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L95">line 95</a></div> <code> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>withHeaders</strong>(array $headers) </code> </h3> <div class="details"> <div class="method-description"> <p>Set headers on the mock response.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>array</td> <td>$headers</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_withAdditionalHeaders"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L107">line 107</a></div> <code> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>withAdditionalHeaders</strong>(array $additionalHeaders) </code> </h3> <div class="details"> <div class="method-description"> <p>Add headers to the mock response.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>array</td> <td>$additionalHeaders</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_withContentType"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L130">line 130</a></div> <code> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>withContentType</strong>(string $contentType) </code> </h3> <div class="details"> <div class="method-description"> <p>Set the content type.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$contentType</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_withHeader"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L147">line 147</a></div> <code> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>withHeader</strong>(string $name, string $value) </code> </h3> <div class="details"> <div class="method-description"> <p>Add a header to the response.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$name</td> <td></td> </tr> <tr> <td>string</td> <td>$value</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_withBody"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L161">line 161</a></div> <code> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>withBody</strong>(string $body) </code> </h3> <div class="details"> <div class="method-description"> <p>Set the body of the response.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$body</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_withJsonBody"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L173">line 173</a></div> <code> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>withJsonBody</strong>(array|object $payload) </code> </h3> <div class="details"> <div class="method-description"> <p>Set the a json body.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>array|object</td> <td>$payload</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_withXmlBody"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L186">line 186</a></div> <code> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>withXmlBody</strong>($xml) </code> </h3> <div class="details"> <div class="method-description"> <p>Set the a json body.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td></td> <td>$xml</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_withRoute"> <div class="location">at <a href="https://github.com/moccalotto/hayttp/blob/master/Volumes/Macintosh HD/Code/github.com/moccalotto/hayttp/Mock/MockResponse.php#L200">line 200</a></div> <code> <a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a> <strong>withRoute</strong>(<a href="../../Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a> $route) </code> </h3> <div class="details"> <div class="method-description"> <p>Add information about the route to the response.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/Route.html"><abbr title="Hayttp\Mock\Route">Route</abbr></a></td> <td>$route</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Hayttp/Mock/MockResponse.html"><abbr title="Hayttp\Mock\MockResponse">MockResponse</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> </div> </div> <div id="footer"> Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>. </div> </div> </div> </body> </html>
{ "content_hash": "933dfde1d3e5f4eabdd28027e0eb5c30", "timestamp": "", "source": "github", "line_count": 4176, "max_line_length": 365, "avg_line_length": 43.01149425287356, "alnum_prop": 0.448595893461607, "repo_name": "moccalotto/moccalotto.github.com", "id": "47a5dfbb659a3fe3b41fb841d78f402cdc0e9984", "size": "179616", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/hayttp/api/master/Hayttp/Mock/MockResponse.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "27741" }, { "name": "HTML", "bytes": "7985" }, { "name": "PHP", "bytes": "1735" }, { "name": "Ruby", "bytes": "6803" }, { "name": "Shell", "bytes": "203" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qdeclarativeanimation.cpp --> <title>Qt 4.8: List of All Members for ParentAnimation</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="qdeclarativeelements.html">QML Elements</a></li> <li>List of All Members for ParentAnimation</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <p class="naviNextPrevious headerNavi"> </p><p/> <h1 class="title">List of All Members for ParentAnimation</h1> <p>This is the complete list of members for <a href="qml-parentanimation.html">QML ParentAnimation Element</a>, including inherited members.</p> <ul> <li class="fn"><span class="name"><b><a href="qml-animation.html#alwaysRunToEnd-prop">alwaysRunToEnd</a></b></span></li> <li class="fn"><span class="name"><b><a href="qml-animation.html#complete-method">complete</a></b></span> ()</li> <li class="fn"><span class="name"><b><a href="qml-animation.html#loops-prop">loops</a></b></span></li> <li class="fn"><span class="name"><b><a href="qml-parentanimation.html#newParent-prop">newParent</a></b></span></li> <li class="fn"><span class="name"><b><a href="qml-animation.html#pause-method">pause</a></b></span> ()</li> <li class="fn"><span class="name"><b><a href="qml-animation.html#paused-prop">paused</a></b></span></li> <li class="fn"><span class="name"><b><a href="qml-animation.html#restart-method">restart</a></b></span> ()</li> <li class="fn"><span class="name"><b><a href="qml-animation.html#resume-method">resume</a></b></span> ()</li> <li class="fn"><span class="name"><b><a href="qml-animation.html#running-prop">running</a></b></span></li> <li class="fn"><span class="name"><b><a href="qml-animation.html#start-method">start</a></b></span> ()</li> <li class="fn"><span class="name"><b><a href="qml-animation.html#stop-method">stop</a></b></span> ()</li> <li class="fn"><span class="name"><b><a href="qml-parentanimation.html#target-prop">target</a></b></span></li> <li class="fn"><span class="name"><b><a href="qml-parentanimation.html#via-prop">via</a></b></span></li> </ul> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>
{ "content_hash": "323e2c8695ed1e434b48ecfd1ebfee08", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 221, "avg_line_length": 49.522935779816514, "alnum_prop": 0.5706743238236384, "repo_name": "stephaneAG/PengPod700", "id": "ed01883e836485b378ab5020615f5d7264fe9e8a", "size": "10796", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "QtEsrc/qt-everywhere-opensource-src-4.8.5/doc/html/qml-parentanimation-members.html", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "167426" }, { "name": "Batchfile", "bytes": "25368" }, { "name": "C", "bytes": "3755463" }, { "name": "C#", "bytes": "9282" }, { "name": "C++", "bytes": "177871700" }, { "name": "CSS", "bytes": "600936" }, { "name": "GAP", "bytes": "758872" }, { "name": "GLSL", "bytes": "32226" }, { "name": "Groff", "bytes": "106542" }, { "name": "HTML", "bytes": "273585110" }, { "name": "IDL", "bytes": "1194" }, { "name": "JavaScript", "bytes": "435912" }, { "name": "Makefile", "bytes": "289373" }, { "name": "Objective-C", "bytes": "1898658" }, { "name": "Objective-C++", "bytes": "3222428" }, { "name": "PHP", "bytes": "6074" }, { "name": "Perl", "bytes": "291672" }, { "name": "Prolog", "bytes": "102468" }, { "name": "Python", "bytes": "22546" }, { "name": "QML", "bytes": "3580408" }, { "name": "QMake", "bytes": "2191574" }, { "name": "Scilab", "bytes": "2390" }, { "name": "Shell", "bytes": "116533" }, { "name": "TypeScript", "bytes": "42452" }, { "name": "Visual Basic", "bytes": "8370" }, { "name": "XQuery", "bytes": "25094" }, { "name": "XSLT", "bytes": "252382" } ], "symlink_target": "" }
#ifndef _ERR_H_ #define _ERR_H_ // // Error and Warning outputs // void errx (int eval, const char *fmt, ...); void err (int eval, const char *fmt, ...); void warnx(const char *fmt, ...); void warn (const char *fmt, ...); #endif
{ "content_hash": "ea6635cd7a68256a943e5a39977a8887", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 43, "avg_line_length": 16.533333333333335, "alnum_prop": 0.5685483870967742, "repo_name": "MattDevo/edk2", "id": "6207d18039560621b54caed28863b9898f784e27", "size": "990", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "StdLib/Include/err.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Assembly", "bytes": "4545237" }, { "name": "Batchfile", "bytes": "93042" }, { "name": "C", "bytes": "94289702" }, { "name": "C++", "bytes": "20170310" }, { "name": "CSS", "bytes": "1905" }, { "name": "DIGITAL Command Language", "bytes": "13695" }, { "name": "GAP", "bytes": "698245" }, { "name": "GDB", "bytes": "96" }, { "name": "HTML", "bytes": "472114" }, { "name": "Lua", "bytes": "249" }, { "name": "Makefile", "bytes": "231845" }, { "name": "NSIS", "bytes": "2229" }, { "name": "Objective-C", "bytes": "4147834" }, { "name": "PHP", "bytes": "674" }, { "name": "PLSQL", "bytes": "24782" }, { "name": "Perl", "bytes": "6218" }, { "name": "Python", "bytes": "27130096" }, { "name": "R", "bytes": "21094" }, { "name": "Roff", "bytes": "28192" }, { "name": "Shell", "bytes": "104362" }, { "name": "SourcePawn", "bytes": "29427" }, { "name": "Visual Basic", "bytes": "494" } ], "symlink_target": "" }
#include "debug/RubyPrefetcher.hh" #include "mem/ruby/slicc_interface/RubySlicc_ComponentMapping.hh" #include "mem/ruby/structures/Prefetcher.hh" #include "mem/ruby/system/RubySystem.hh" Prefetcher* PrefetcherParams::create() { return new Prefetcher(this); } Prefetcher::Prefetcher(const Params *p) : SimObject(p), m_num_streams(p->num_streams), m_array(p->num_streams), m_train_misses(p->train_misses), m_num_startup_pfs(p->num_startup_pfs), m_num_unit_filters(p->unit_filter), m_num_nonunit_filters(p->nonunit_filter), m_unit_filter(p->unit_filter, 0), m_negative_filter(p->unit_filter, 0), m_nonunit_filter(p->nonunit_filter, 0), m_prefetch_cross_pages(p->cross_page), m_page_shift(p->sys->getPageShift()) { assert(m_num_streams > 0); assert(m_num_startup_pfs <= MAX_PF_INFLIGHT); // create +1 stride filter m_unit_filter_index = 0; m_unit_filter_hit = new uint32_t[m_num_unit_filters]; for (uint32_t i =0; i < m_num_unit_filters; i++) { m_unit_filter_hit[i] = 0; } // create -1 stride filter m_negative_filter_index = 0; m_negative_filter_hit = new uint32_t[m_num_unit_filters]; for (int i =0; i < m_num_unit_filters; i++) { m_negative_filter_hit[i] = 0; } // create nonunit stride filter m_nonunit_index = 0; m_nonunit_stride = new int[m_num_nonunit_filters]; m_nonunit_hit = new uint32_t[m_num_nonunit_filters]; for (int i =0; i < m_num_nonunit_filters; i++) { m_nonunit_stride[i] = 0; m_nonunit_hit[i] = 0; } } Prefetcher::~Prefetcher() { delete m_unit_filter_hit; delete m_negative_filter_hit; delete m_nonunit_stride; delete m_nonunit_hit; } void Prefetcher::regStats() { numMissObserved .name(name() + ".miss_observed") .desc("number of misses observed") ; numAllocatedStreams .name(name() + ".allocated_streams") .desc("number of streams allocated for prefetching") ; numPrefetchRequested .name(name() + ".prefetches_requested") .desc("number of prefetch requests made") ; numPrefetchAccepted .name(name() + ".prefetches_accepted") .desc("number of prefetch requests accepted") ; numDroppedPrefetches .name(name() + ".dropped_prefetches") .desc("number of prefetch requests dropped") ; numHits .name(name() + ".hits") .desc("number of prefetched blocks accessed") ; numPartialHits .name(name() + ".partial_hits") .desc("number of misses observed for a block being prefetched") ; numPagesCrossed .name(name() + ".pages_crossed") .desc("number of prefetches across pages") ; numMissedPrefetchedBlocks .name(name() + ".misses_on_prefetched_blocks") .desc("number of misses for blocks that were prefetched, yet missed") ; } void Prefetcher::observeMiss(Addr address, const RubyRequestType& type) { DPRINTF(RubyPrefetcher, "Observed miss for %#x\n", address); Addr line_addr = makeLineAddress(address); numMissObserved++; // check to see if we have already issued a prefetch for this block uint32_t index = 0; PrefetchEntry *pfEntry = getPrefetchEntry(line_addr, index); if (pfEntry != NULL) { if (pfEntry->requestIssued[index]) { if (pfEntry->requestCompleted[index]) { // We prefetched too early and now the prefetch block no // longer exists in the cache numMissedPrefetchedBlocks++; return; } else { // The controller has issued the prefetch request, // but the request for the block arrived earlier. numPartialHits++; observePfHit(line_addr); return; } } else { // The request is still in the prefetch queue of the controller. // Or was evicted because of other requests. return; } } // check to see if this address is in the unit stride filter bool alloc = false; bool hit = accessUnitFilter(m_unit_filter, m_unit_filter_hit, m_unit_filter_index, line_addr, 1, alloc); if (alloc) { // allocate a new prefetch stream initializeStream(line_addr, 1, getLRUindex(), type); } if (hit) { DPRINTF(RubyPrefetcher, " *** hit in unit stride buffer\n"); return; } hit = accessUnitFilter(m_negative_filter, m_negative_filter_hit, m_negative_filter_index, line_addr, -1, alloc); if (alloc) { // allocate a new prefetch stream initializeStream(line_addr, -1, getLRUindex(), type); } if (hit) { DPRINTF(RubyPrefetcher, " *** hit in unit negative unit buffer\n"); return; } // check to see if this address is in the non-unit stride filter int stride = 0; // NULL value hit = accessNonunitFilter(address, &stride, alloc); if (alloc) { assert(stride != 0); // ensure non-zero stride prefetches initializeStream(line_addr, stride, getLRUindex(), type); } if (hit) { DPRINTF(RubyPrefetcher, " *** hit in non-unit stride buffer\n"); return; } } void Prefetcher::observePfMiss(Addr address) { numPartialHits++; DPRINTF(RubyPrefetcher, "Observed partial hit for %#x\n", address); issueNextPrefetch(address, NULL); } void Prefetcher::observePfHit(Addr address) { numHits++; DPRINTF(RubyPrefetcher, "Observed hit for %#x\n", address); issueNextPrefetch(address, NULL); } void Prefetcher::issueNextPrefetch(Addr address, PrefetchEntry *stream) { // get our corresponding stream fetcher if (stream == NULL) { uint32_t index = 0; stream = getPrefetchEntry(address, index); } // if (for some reason), this stream is unallocated, return. if (stream == NULL) { DPRINTF(RubyPrefetcher, "Unallocated stream, returning\n"); return; } // extend this prefetching stream by 1 (or more) Addr page_addr = pageAddress(stream->m_address); Addr line_addr = makeNextStrideAddress(stream->m_address, stream->m_stride); // possibly stop prefetching at page boundaries if (page_addr != pageAddress(line_addr)) { numPagesCrossed++; if (!m_prefetch_cross_pages) { // Deallocate the stream since we are not prefetching // across page boundries stream->m_is_valid = false; return; } } // launch next prefetch stream->m_address = line_addr; stream->m_use_time = m_controller->curCycle(); DPRINTF(RubyPrefetcher, "Requesting prefetch for %#x\n", line_addr); m_controller->enqueuePrefetch(line_addr, stream->m_type); } uint32_t Prefetcher::getLRUindex(void) { uint32_t lru_index = 0; Cycles lru_access = m_array[lru_index].m_use_time; for (uint32_t i = 0; i < m_num_streams; i++) { if (!m_array[i].m_is_valid) { return i; } if (m_array[i].m_use_time < lru_access) { lru_access = m_array[i].m_use_time; lru_index = i; } } return lru_index; } void Prefetcher::clearNonunitEntry(uint32_t index) { m_nonunit_filter[index] = 0; m_nonunit_stride[index] = 0; m_nonunit_hit[index] = 0; } void Prefetcher::initializeStream(Addr address, int stride, uint32_t index, const RubyRequestType& type) { numAllocatedStreams++; // initialize the stream prefetcher PrefetchEntry *mystream = &(m_array[index]); mystream->m_address = makeLineAddress(address); mystream->m_stride = stride; mystream->m_use_time = m_controller->curCycle(); mystream->m_is_valid = true; mystream->m_type = type; // create a number of initial prefetches for this stream Addr page_addr = pageAddress(mystream->m_address); Addr line_addr = makeLineAddress(mystream->m_address); // insert a number of prefetches into the prefetch table for (int k = 0; k < m_num_startup_pfs; k++) { line_addr = makeNextStrideAddress(line_addr, stride); // possibly stop prefetching at page boundaries if (page_addr != pageAddress(line_addr)) { numPagesCrossed++; if (!m_prefetch_cross_pages) { // deallocate this stream prefetcher mystream->m_is_valid = false; return; } } // launch prefetch numPrefetchRequested++; DPRINTF(RubyPrefetcher, "Requesting prefetch for %#x\n", line_addr); m_controller->enqueuePrefetch(line_addr, m_array[index].m_type); } // update the address to be the last address prefetched mystream->m_address = line_addr; } PrefetchEntry * Prefetcher::getPrefetchEntry(Addr address, uint32_t &index) { // search all streams for a match for (int i = 0; i < m_num_streams; i++) { // search all the outstanding prefetches for this stream if (m_array[i].m_is_valid) { for (int j = 0; j < m_num_startup_pfs; j++) { if (makeNextStrideAddress(m_array[i].m_address, -(m_array[i].m_stride*j)) == address) { return &(m_array[i]); } } } } return NULL; } bool Prefetcher::accessUnitFilter(std::vector<Addr>& filter_table, uint32_t *filter_hit, uint32_t &index, Addr address, int stride, bool &alloc) { //reset the alloc flag alloc = false; Addr line_addr = makeLineAddress(address); for (int i = 0; i < m_num_unit_filters; i++) { if (filter_table[i] == line_addr) { filter_table[i] = makeNextStrideAddress(filter_table[i], stride); filter_hit[i]++; if (filter_hit[i] >= m_train_misses) { alloc = true; } return true; } } // enter this address in the table int local_index = index; filter_table[local_index] = makeNextStrideAddress(line_addr, stride); filter_hit[local_index] = 0; local_index = local_index + 1; if (local_index >= m_num_unit_filters) { local_index = 0; } index = local_index; return false; } bool Prefetcher::accessNonunitFilter(Addr address, int *stride, bool &alloc) { //reset the alloc flag alloc = false; /// look for non-unit strides based on a (user-defined) page size Addr page_addr = pageAddress(address); Addr line_addr = makeLineAddress(address); for (uint32_t i = 0; i < m_num_nonunit_filters; i++) { if (pageAddress(m_nonunit_filter[i]) == page_addr) { // hit in the non-unit filter // compute the actual stride (for this reference) int delta = line_addr - m_nonunit_filter[i]; if (delta != 0) { // no zero stride prefetches // check that the stride matches (for the last N times) if (delta == m_nonunit_stride[i]) { // -> stride hit // increment count (if > 2) allocate stream m_nonunit_hit[i]++; if (m_nonunit_hit[i] > m_train_misses) { // This stride HAS to be the multiplicative constant of // dataBlockBytes (bc makeNextStrideAddress is // calculated based on this multiplicative constant!) *stride = m_nonunit_stride[i] / RubySystem::getBlockSizeBytes(); // clear this filter entry clearNonunitEntry(i); alloc = true; } } else { // delta didn't match ... reset m_nonunit_hit count for // this entry m_nonunit_hit[i] = 0; } // update the last address seen & the stride m_nonunit_stride[i] = delta; m_nonunit_filter[i] = line_addr; return true; } else { return false; } } } // not found: enter this address in the table m_nonunit_filter[m_nonunit_index] = line_addr; m_nonunit_stride[m_nonunit_index] = 0; m_nonunit_hit[m_nonunit_index] = 0; m_nonunit_index = m_nonunit_index + 1; if (m_nonunit_index >= m_num_nonunit_filters) { m_nonunit_index = 0; } return false; } void Prefetcher::print(std::ostream& out) const { out << name() << " Prefetcher State\n"; // print out unit filter out << "unit table:\n"; for (int i = 0; i < m_num_unit_filters; i++) { out << m_unit_filter[i] << std::endl; } out << "negative table:\n"; for (int i = 0; i < m_num_unit_filters; i++) { out << m_negative_filter[i] << std::endl; } // print out non-unit stride filter out << "non-unit table:\n"; for (int i = 0; i < m_num_nonunit_filters; i++) { out << m_nonunit_filter[i] << " " << m_nonunit_stride[i] << " " << m_nonunit_hit[i] << std::endl; } // print out allocated stream buffers out << "streams:\n"; for (int i = 0; i < m_num_streams; i++) { out << m_array[i].m_address << " " << m_array[i].m_stride << " " << m_array[i].m_is_valid << " " << m_array[i].m_use_time << std::endl; } } Addr Prefetcher::pageAddress(Addr addr) const { return maskLowOrderBits(addr, m_page_shift); }
{ "content_hash": "ac9d26febf1881d03a686b99e507d2c1", "timestamp": "", "source": "github", "line_count": 450, "max_line_length": 79, "avg_line_length": 30.593333333333334, "alnum_prop": 0.5736907096680468, "repo_name": "pombredanne/http-repo.gem5.org-gem5-", "id": "ce6d36c048f26295c4f7fae5fbda8114a80f6811", "size": "15339", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "src/mem/ruby/structures/Prefetcher.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "239800" }, { "name": "C", "bytes": "1025519" }, { "name": "C++", "bytes": "14937362" }, { "name": "CMake", "bytes": "2202" }, { "name": "Emacs Lisp", "bytes": "1969" }, { "name": "HTML", "bytes": "136898" }, { "name": "Hack", "bytes": "2489" }, { "name": "Java", "bytes": "3096" }, { "name": "Makefile", "bytes": "38436" }, { "name": "Perl", "bytes": "33602" }, { "name": "Protocol Buffer", "bytes": "7033" }, { "name": "Python", "bytes": "4004006" }, { "name": "Shell", "bytes": "65146" }, { "name": "VimL", "bytes": "4335" }, { "name": "Visual Basic", "bytes": "2884" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <integer name="grid_column_count">3</integer> </resources>
{ "content_hash": "f3cdcf0119cbcef79140bea555bf0f87", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 49, "avg_line_length": 28.25, "alnum_prop": 0.672566371681416, "repo_name": "kumaran127/nasa_epic", "id": "4e0b943a5e8e0afe0450fa2f9304f83ff37e97f2", "size": "113", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "app/src/main/res/values-land/integers.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "66898" } ], "symlink_target": "" }
@implementation NSNumberFormatter (TBL) +(NSNumberFormatter *)simpleNumberFormatter { NSMutableDictionary* dictionary = [[NSThread currentThread] threadDictionary]; NSString *key = @"NSNumberFormatter"; NSNumberFormatter* numberFormatter = [dictionary objectForKey:key]; if (numberFormatter == nil) { numberFormatter = [[NSNumberFormatter alloc] init]; [dictionary setObject:numberFormatter forKey:key]; #if !__has_feature(objc_arc) [numberFormatter autorelease]; #endif } return numberFormatter; } @end
{ "content_hash": "e06031e379394d3a32a46a82636dc006", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 82, "avg_line_length": 32.529411764705884, "alnum_prop": 0.7251356238698011, "repo_name": "twobitlabs/TBLCategories", "id": "1d861d5fab20a4488eee7717518dd2c106130623", "size": "632", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "NSNumberFormatter+TBL.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "37605" }, { "name": "Ruby", "bytes": "446" }, { "name": "Swift", "bytes": "82581" } ], "symlink_target": "" }
// -*- mode: java; c-basic-offset: 2; -*- // Copyright 2009-2011 Google, All Rights reserved // Copyright 2011-2012 MIT, All rights reserved // Released under the MIT License https://raw.github.com/mit-cml/app-inventor/master/mitlicense.txt package com.google.appinventor.client.widgets.boxes; import com.google.appinventor.client.output.OdeLog; import com.google.appinventor.client.properties.json.ClientJsonParser; import com.google.appinventor.client.widgets.boxes.Box.BoxDescriptor; import com.google.appinventor.shared.properties.json.JSONArray; import com.google.appinventor.shared.properties.json.JSONObject; import com.google.appinventor.shared.properties.json.JSONValue; import com.google.gwt.user.client.ui.AbsolutePanel; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.Widget; import com.allen_sauer.gwt.dnd.client.PickupDragController; import java.util.HashMap; import java.util.HashSet; import java.util.Map; /** * Desktop-like container for boxes. * * <p>Implements a panel which arranges boxes in columns. Boxes can be dragged * from one column to another or to a different position within the same * column. * * @see Box * */ public final class WorkAreaPanel extends SimplePanel implements LayoutChangeListener { // Field names for JSON object encoding of work area state private static final String NAME_ACTIVE_LAYOUT = "ActiveLayout"; private static final String NAME_LAYOUTS = "Layouts"; // Box registry for creating boxes private final BoxRegistry boxRegistry; // Active layout for work area private Layout layout; // List of available layouts private final Map<String, Layout> layouts; // Base panel of work area private final AbsolutePanel boundaryPanel; // Drag and drop controllers private final PickupDragController widgetDragController; // Last resize width and height private int width; private int height; /** * Creates a new work area. * * @param boxRegistry box registry for creating boxes * @param layout initial layout for work area */ public WorkAreaPanel(BoxRegistry boxRegistry, Layout layout) { this.boxRegistry = boxRegistry; this.layout = layout; layouts = new HashMap<String, Layout>(); layouts.put(layout.getName(), layout); boundaryPanel = new AbsolutePanel(); boundaryPanel.setSize("100%", "100%"); setWidget(boundaryPanel); setSize("100%", "100%"); widgetDragController = new PickupDragController(boundaryPanel, false); widgetDragController.setBehaviorMultipleSelection(false); switchLayout(layout.getName()); } @Override public void clear() { boundaryPanel.clear(); } @Override public void add(Widget widget) { boundaryPanel.add(widget); } /** * Must be invoked upon resizing of the work area panel. * * @param width new work width in pixel * @param height new work height in pixel */ public void onResize(int width, int height) { this.width = width; this.height = height; layout.onResize(width, height); } /** * Create a new box from the definition by the given box descriptor. * * @param bd box descriptor describing box to be created * @return new box */ public Box createBox(BoxDescriptor bd) { String boxType = bd.getType(); Box box = boxRegistry.getBox(boxType); if (box == null) { OdeLog.wlog("Unknown box type: " + boxType); } else { widgetDragController.makeDraggable(box, box.getHeader()); } return box; } /** * Returns work area's drag controller. * * @return drag controller */ public PickupDragController getWidgetDragController() { return widgetDragController; } /** * Returns a map of the layouts for the work area. * * @return map of layouts for work area */ public Map<String, Layout> getLayouts() { return layouts; } /** * Return state of work area and its layouts converted into JSON format. * * @return work area state in JSON format */ public String toJson() { StringBuilder sb = new StringBuilder(); sb.append("{\"" + NAME_ACTIVE_LAYOUT + "\":\""); sb.append(layout.getName()); sb.append("\",\"" + NAME_LAYOUTS + "\":["); String separator = ""; for (Layout layout : layouts.values()) { sb.append(separator); sb.append(layout.toJson()); separator = ","; } sb.append("]}"); return sb.toString(); } /** * Restores state of work area and its layouts from JSON. * * @param encodedState work area state in JSON format */ public void fromJson(String encodedState) { if (!encodedState.isEmpty()) { JSONObject state = new ClientJsonParser().parse(encodedState).asObject(); Map<String, JSONValue> properties = state.getProperties(); JSONArray layoutArray = properties.get(NAME_LAYOUTS).asArray(); // check if boxes encoded in JSON is the same set as in the registry HashSet<String> boxTypes = new HashSet<String>(); for (JSONValue layoutObject : layoutArray.getElements()) { ColumnLayout.boxTypesFromJson(layoutObject.asObject(), boxTypes); } // only restore state if the saved boxes match expected boxes if (boxTypes.equals(boxRegistry.getBoxTypes())) { for (JSONValue layoutObject : layoutArray.getElements()) { // TODO(user): Should we decide to support multiple layouts we // should select the layout type from a registry Layout layout = ColumnLayout.fromJson(layoutObject.asObject(), this); layouts.put(layout.getName(), layout); } switchLayout(properties.get(NAME_ACTIVE_LAYOUT).asString().getString()); } } } private void switchLayout(String layoutName) { if (layout != null) { layout.removeLayoutChangeListener(this); } layout = layouts.get(layoutName); layout.apply(this); layout.addLayoutChangeListener(this); // To ensure all boxes are appropriately sized onResize(width, height); } // LayoutChangeListener @Override public void onLayoutChange(Layout layout) { } }
{ "content_hash": "8942ccf59471ba39eb53976bb34439e8", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 99, "avg_line_length": 30.265402843601894, "alnum_prop": 0.66536172878171, "repo_name": "ajhalbleib/aicg", "id": "15f547b20ac54661d03d37be06de9172637ae73d", "size": "6386", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "appinventor/appengine/src/com/google/appinventor/client/widgets/boxes/WorkAreaPanel.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "5326205" }, { "name": "JavaScript", "bytes": "4563" }, { "name": "Python", "bytes": "1825" }, { "name": "Scheme", "bytes": "136243" } ], "symlink_target": "" }
package com.github.kislayverma.rulette.core.ruleinput.value; public interface IInputValueBuilder<T> { IInputValue<T> build(String value); }
{ "content_hash": "1551ad2747aac2d60972cb6e201cffa8", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 60, "avg_line_length": 29, "alnum_prop": 0.7862068965517242, "repo_name": "kislayverma/Rulette", "id": "7f4d489d25f072030d046e254651c8fc31c65559", "size": "145", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rulette-core/src/main/java/com/github/kislayverma/rulette/core/ruleinput/value/IInputValueBuilder.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "144317" } ], "symlink_target": "" }
from core import *
{ "content_hash": "0abf8f657310478c4a5c3bcb33c8bb55", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 18, "avg_line_length": 19, "alnum_prop": 0.7368421052631579, "repo_name": "breuleux/descr", "id": "5f7bf5b224078fe840877dc1348a2275cd47b7b8", "size": "20", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "descr/terminal/__init__.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "65167" } ], "symlink_target": "" }
namespace extensions { namespace { class ExtensionBindingsApiTest : public ExtensionApiTest {}; IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, UnavailableBindingsNeverRegistered) { // Test will request the 'storage' permission. PermissionsRequestFunction::SetIgnoreUserGestureForTests(true); ASSERT_TRUE(RunExtensionTest( "bindings/unavailable_bindings_never_registered")) << message_; } IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, ExceptionInHandlerShouldNotCrash) { ASSERT_TRUE(RunExtensionSubtest( "bindings/exception_in_handler_should_not_crash", "page.html")) << message_; } // Tests that an error raised during an async function still fires // the callback, but sets chrome.runtime.lastError. // FIXME should be in ExtensionBindingsApiTest. IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, LastError) { ASSERT_TRUE(LoadExtension( test_data_dir_.AppendASCII("browsertest").AppendASCII("last_error"))); // Get the ExtensionHost that is hosting our background page. extensions::ProcessManager* manager = extensions::ExtensionSystem::Get(browser()->profile())->process_manager(); extensions::ExtensionHost* host = FindHostWithPath(manager, "/bg.html", 1); bool result = false; ASSERT_TRUE(content::ExecuteScriptAndExtractBool( host->render_view_host(), "testLastError()", &result)); EXPECT_TRUE(result); } // Regression test that we don't delete our own bindings with about:blank // iframes. IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, AboutBlankIframe) { ResultCatcher catcher; ExtensionTestMessageListener listener("load", true); ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("bindings") .AppendASCII("about_blank_iframe"))); ASSERT_TRUE(listener.WaitUntilSatisfied()); const Extension* extension = LoadExtension( test_data_dir_.AppendASCII("bindings") .AppendASCII("internal_apis_not_on_chrome_object")); ASSERT_TRUE(extension); listener.Reply(extension->id()); ASSERT_TRUE(catcher.GetNextResult()) << message_; } IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, InternalAPIsNotOnChromeObject) { ASSERT_TRUE(RunExtensionSubtest( "bindings/internal_apis_not_on_chrome_object", "page.html")) << message_; } // Tests that we don't override events when bindings are re-injected. // Regression test for http://crbug.com/269149. IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, EventOverriding) { ASSERT_TRUE(RunExtensionTest("bindings/event_overriding")) << message_; } } // namespace } // namespace extensions
{ "content_hash": "8475c6a930e2b80421d2c8751ff6e03e", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 80, "avg_line_length": 36.61643835616438, "alnum_prop": 0.7153011597456042, "repo_name": "ondra-novak/chromium.src", "id": "3d8304caa033d8908a4a559fbd61f8a3921a59b3", "size": "3381", "binary": false, "copies": "18", "ref": "refs/heads/nw", "path": "chrome/browser/extensions/extension_bindings_apitest.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "35318" }, { "name": "Batchfile", "bytes": "7621" }, { "name": "C", "bytes": "8692951" }, { "name": "C++", "bytes": "206833388" }, { "name": "CSS", "bytes": "871479" }, { "name": "HTML", "bytes": "24541148" }, { "name": "Java", "bytes": "5457985" }, { "name": "JavaScript", "bytes": "17791684" }, { "name": "Makefile", "bytes": "92563" }, { "name": "Objective-C", "bytes": "1312233" }, { "name": "Objective-C++", "bytes": "7105758" }, { "name": "PHP", "bytes": "97817" }, { "name": "PLpgSQL", "bytes": "218379" }, { "name": "Perl", "bytes": "69392" }, { "name": "Protocol Buffer", "bytes": "387183" }, { "name": "Python", "bytes": "6929739" }, { "name": "Shell", "bytes": "473664" }, { "name": "Standard ML", "bytes": "4131" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "15206" } ], "symlink_target": "" }
package org.netbeans.modules.android.spi; /** * * @author arsi */ public interface MainActivityConfiguration { String getMainActivity(); boolean isAskBeforeLaunch(); boolean isUseFromManifest(); void setAskBeforeLaunch(boolean askBeforeLaunch); void setMainActivity(String mainActivity); void setUseFromManifest(boolean useFromManifest); }
{ "content_hash": "ed091dc3496e86ddfc03e28df1a25fb7", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 53, "avg_line_length": 17.09090909090909, "alnum_prop": 0.7420212765957447, "repo_name": "arsi-apli/NBANDROID-V2", "id": "0dd389c33afe95574b802d5dfc3b2b7c1f5022c0", "size": "1183", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "nbandroid.core/src/main/java/org/netbeans/modules/android/spi/MainActivityConfiguration.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "747732" }, { "name": "GAP", "bytes": "9978" }, { "name": "GLSL", "bytes": "632" }, { "name": "HTML", "bytes": "51779" }, { "name": "Java", "bytes": "3770028" } ], "symlink_target": "" }
import MessageService from '../services/MessageService'; import * as AppConstants from '../constants/AppConstants'; import GroupInfoDao from '../dao/GroupInfoDao'; import Firebase from 'firebase'; class FirebaseMessageHandler{ init(firebaseRef, phoneNumber, displayName){ this.phoneNumber = phoneNumber; this.displayName = displayName; this._firebase = firebaseRef; this._userRef = this._firebase.child('users').child(this.phoneNumber); this._privateMessageRef = this._firebase.child('private_messages'); this._groupMessageRef = this._firebase.child('group_messages'); this._groupInfoRef = this._firebase.child('group_info'); this._statusRef = this._firebase.child('message_status'); this.setupListeners(phoneNumber); } // Initialize Firebase listeners and callbacks for the supported bindings. setupListeners(phoneNumber){ this.initMessageReceivedListener(phoneNumber); this.initGroupMessageListener(); } initMessageReceivedListener(phoneNumber){ const self = this; this._privateMessageRef.child(phoneNumber).on("child_added", function(snapshot, prevChildKey) { console.log(snapshot.key()); let message = snapshot.val(); self.onMessageReceived(message, false, null); //delete once read try{ self._privateMessageRef.child(phoneNumber).child(snapshot.key()).set(null); this.updateStatus(message); }catch(err){ console.log("error removing the message "+ err); } }); } initGroupMessageListener(){ const self = this; let groupIDList = GroupInfoDao.getGroupIdList(); for(let i=0; i< groupIDList.length; i++){ let groupId = groupIDList[i]; this._groupMessageRef.child(groupId).on("child_added", function(snapshot, prevChildKey) { self.onGroupMessageReceived(groupId, snapshot.key(), snapshot.val()); }); } } sendPrivateMessage(recipientPhoneNumber, message, callback){ if(!this._privateMessageRef || !recipientPhoneNumber){ return; } message.senderId = this.phoneNumber; message.displayName = this.displayName; message.timestamp = Firebase.ServerValue.TIMESTAMP; this.removeUndefinedProps(message); let recipientMessageRef = this._privateMessageRef.child(recipientPhoneNumber); let newMessageRef = recipientMessageRef.push(); newMessageRef.setWithPriority(message, Firebase.ServerValue.TIMESTAMP, callback); } sendGroupMessage(groupId, message, callback) { if(!this._groupMessageRef || !groupId){ return; } message.senderId = this.phoneNumber; message.displayName = this.displayName; message.timestamp = Firebase.ServerValue.TIMESTAMP; this.removeUndefinedProps(message); console.log('groupId to send message is '+groupId); let targetGroupRef = this._groupMessageRef.child(groupId); let newMessageRef = targetGroupRef.push(); newMessageRef.setWithPriority(message, Firebase.ServerValue.TIMESTAMP, callback); } onGroupMessageReceived(groupId, key, message){ this.onMessageReceived(message, true, groupId); //delete once read try{ self._groupMessageRef.child(groupId).child(key).set(null); this.updateStatus(message); }catch(err){ console.log("error removing the group message "+ err); } } onMessageReceived(message, isGroupMessage, groupUid){ switch (message.type) { case AppConstants.PLAIN_TEXT: MessageService.handleIncomingTextMessage(message, isGroupMessage, groupUid); console.log("received message in UI "+ message); break; case AppConstants.IMAGE_MEDIA: console.log("received media message in UI "+ message); message.mediaStatus = AppConstants.PENDING_DOWNLOAD; MessageService.handleIncomingMediaMessage(message, isGroupMessage, groupUid); break; default: break; } } updateStatus(message){ if(!this._statusRef){ return; } let statusUpdateRef = this._statusRef.child(message.senderId); let newStatusUpdateRef = statusUpdateRef.push(); let statusMessage = {'status' : AppConstants.RECEIVED, 'receivedBy': this.phoneNumber, 'timestamp': Firebase.ServerValue.TIMESTAMP}; newStatusUpdateRef.setWithPriority(statusMessage, Firebase.ServerValue.TIMESTAMP); } removeUndefinedProps(obj) { for (var prop in obj) { if (obj.hasOwnProperty(prop) && obj[prop] === undefined) { delete obj[prop]; } } } } export default new FirebaseMessageHandler();
{ "content_hash": "3bab13f58ecf5edb33d455460a2913f9", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 140, "avg_line_length": 38.9, "alnum_prop": 0.6302155428119438, "repo_name": "ramsundark5/stitchchat", "id": "b423649d994cb77d2c23bd12e333a139d67e3ef5", "size": "5057", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/transport/FirebaseMessageHandler.js", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "83224" }, { "name": "JavaScript", "bytes": "300802" }, { "name": "Objective-C", "bytes": "55623" }, { "name": "Ruby", "bytes": "1594" }, { "name": "Swift", "bytes": "9683" } ], "symlink_target": "" }
Property sorting. Examples use the predefined property sorting table. To define a custom sorting order pass an array to `csscrush_set_property_sort_order()` ```crush color: red; background: #000; opacity: .5; display: block; position: absolute; ``` ```css position: absolute; display: block; opacity: .5; color: red; background: #000; ```
{ "content_hash": "1f74311bd97ff45284f999023ab935da", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 138, "avg_line_length": 17.15, "alnum_prop": 0.7259475218658892, "repo_name": "peteboere/css-crush", "id": "cd17817fdce234d21191e671290f132561d0a9a6", "size": "344", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/plugins/property-sorter.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "10352" }, { "name": "PHP", "bytes": "301786" } ], "symlink_target": "" }
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /** * \file * \brief C API: 16-bit Unicode handling macros * * This file defines macros to deal with 16-bit Unicode (UTF-16) code units and strings. * * For more information see utf.h and the ICU User Guide Strings chapter * (http://userguide.icu-project.org/strings). * * <em>Usage:</em> * ICU coding guidelines for if() statements should be followed when using these macros. * Compound statements (curly braces {}) must be used for if-else-while... * bodies and all macro statements should be terminated with semicolon. */ #ifndef __UTF16_H__ #define __UTF16_H__ #include "unicode/umachine.h" #ifndef __UTF_H__ # include "unicode/utf.h" #endif /* single-code point definitions -------------------------------------------- */ /** * Does this code unit alone encode a code point (BMP, not a surrogate)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_SINGLE(c) !U_IS_SURROGATE(c) /** * Is this code unit a lead surrogate (U+d800..U+dbff)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_LEAD(c) (((c)&0xfffffc00)==0xd800) /** * Is this code unit a trail surrogate (U+dc00..U+dfff)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00) /** * Is this code unit a surrogate (U+d800..U+dfff)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_SURROGATE(c) U_IS_SURROGATE(c) /** * Assuming c is a surrogate code point (U16_IS_SURROGATE(c)), * is it a lead surrogate? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0) /** * Assuming c is a surrogate code point (U16_IS_SURROGATE(c)), * is it a trail surrogate? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 4.2 */ #define U16_IS_SURROGATE_TRAIL(c) (((c)&0x400)!=0) /** * Helper constant for U16_GET_SUPPLEMENTARY. * @internal */ #define U16_SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000) /** * Get a supplementary code point value (U+10000..U+10ffff) * from its lead and trail surrogates. * The result is undefined if the input values are not * lead and trail surrogates. * * @param lead lead surrogate (U+d800..U+dbff) * @param trail trail surrogate (U+dc00..U+dfff) * @return supplementary code point (U+10000..U+10ffff) * @stable ICU 2.4 */ #define U16_GET_SUPPLEMENTARY(lead, trail) \ (((UChar32)(lead)<<10UL)+(UChar32)(trail)-U16_SURROGATE_OFFSET) /** * Get the lead surrogate (0xd800..0xdbff) for a * supplementary code point (0x10000..0x10ffff). * @param supplementary 32-bit code point (U+10000..U+10ffff) * @return lead surrogate (U+d800..U+dbff) for supplementary * @stable ICU 2.4 */ #define U16_LEAD(supplementary) (UChar)(((supplementary)>>10)+0xd7c0) /** * Get the trail surrogate (0xdc00..0xdfff) for a * supplementary code point (0x10000..0x10ffff). * @param supplementary 32-bit code point (U+10000..U+10ffff) * @return trail surrogate (U+dc00..U+dfff) for supplementary * @stable ICU 2.4 */ #define U16_TRAIL(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00) /** * How many 16-bit code units are used to encode this Unicode code point? (1 or 2) * The result is not defined if c is not a Unicode code point (U+0000..U+10ffff). * @param c 32-bit code point * @return 1 or 2 * @stable ICU 2.4 */ #define U16_LENGTH(c) ((uint32_t)(c)<=0xffff ? 1 : 2) /** * The maximum number of 16-bit code units per Unicode code point (U+0000..U+10ffff). * @return 2 * @stable ICU 2.4 */ #define U16_MAX_LENGTH 2 /** * Get a code point from a string at a random-access offset, * without changing the offset. * "Unsafe" macro, assumes well-formed UTF-16. * * The offset may point to either the lead or trail surrogate unit * for a supplementary code point, in which case the macro will read * the adjacent matching surrogate as well. * The result is undefined if the offset points to a single, unpaired surrogate. * Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT. * * @param s const UChar * string * @param i string offset * @param c output UChar32 variable * @see U16_GET * @stable ICU 2.4 */ #define U16_GET_UNSAFE(s, i, c) { \ (c)=(s)[i]; \ if(U16_IS_SURROGATE(c)) { \ if(U16_IS_SURROGATE_LEAD(c)) { \ (c)=U16_GET_SUPPLEMENTARY((c), (s)[(i)+1]); \ } else { \ (c)=U16_GET_SUPPLEMENTARY((s)[(i)-1], (c)); \ } \ } \ } /** * Get a code point from a string at a random-access offset, * without changing the offset. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The offset may point to either the lead or trail surrogate unit * for a supplementary code point, in which case the macro will read * the adjacent matching surrogate as well. * * The length can be negative for a NUL-terminated string. * * If the offset points to a single, unpaired surrogate, then * c is set to that unpaired surrogate. * Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, must be start<=i<length * @param length string length * @param c output UChar32 variable * @see U16_GET_UNSAFE * @stable ICU 2.4 */ #define U16_GET(s, start, i, length, c) { \ (c)=(s)[i]; \ if(U16_IS_SURROGATE(c)) { \ uint16_t __c2; \ if(U16_IS_SURROGATE_LEAD(c)) { \ if((i)+1!=(length) && U16_IS_TRAIL(__c2=(s)[(i)+1])) { \ (c)=U16_GET_SUPPLEMENTARY((c), __c2); \ } \ } else { \ if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ } \ } \ } \ } #ifndef U_HIDE_DRAFT_API /** * Get a code point from a string at a random-access offset, * without changing the offset. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The offset may point to either the lead or trail surrogate unit * for a supplementary code point, in which case the macro will read * the adjacent matching surrogate as well. * * The length can be negative for a NUL-terminated string. * * If the offset points to a single, unpaired surrogate, then * c is set to U+FFFD. * Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT_OR_FFFD. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, must be start<=i<length * @param length string length * @param c output UChar32 variable * @see U16_GET_UNSAFE * @draft ICU 60 */ #define U16_GET_OR_FFFD(s, start, i, length, c) { \ (c)=(s)[i]; \ if(U16_IS_SURROGATE(c)) { \ uint16_t __c2; \ if(U16_IS_SURROGATE_LEAD(c)) { \ if((i)+1!=(length) && U16_IS_TRAIL(__c2=(s)[(i)+1])) { \ (c)=U16_GET_SUPPLEMENTARY((c), __c2); \ } else { \ (c)=0xfffd; \ } \ } else { \ if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ } else { \ (c)=0xfffd; \ } \ } \ } \ } #endif // U_HIDE_DRAFT_API /* definitions with forward iteration --------------------------------------- */ /** * Get a code point from a string at a code point boundary offset, * and advance the offset to the next code point boundary. * (Post-incrementing forward iteration.) * "Unsafe" macro, assumes well-formed UTF-16. * * The offset may point to the lead surrogate unit * for a supplementary code point, in which case the macro will read * the following trail surrogate as well. * If the offset points to a trail surrogate, then that itself * will be returned as the code point. * The result is undefined if the offset points to a single, unpaired lead surrogate. * * @param s const UChar * string * @param i string offset * @param c output UChar32 variable * @see U16_NEXT * @stable ICU 2.4 */ #define U16_NEXT_UNSAFE(s, i, c) { \ (c)=(s)[(i)++]; \ if(U16_IS_LEAD(c)) { \ (c)=U16_GET_SUPPLEMENTARY((c), (s)[(i)++]); \ } \ } /** * Get a code point from a string at a code point boundary offset, * and advance the offset to the next code point boundary. * (Post-incrementing forward iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The length can be negative for a NUL-terminated string. * * The offset may point to the lead surrogate unit * for a supplementary code point, in which case the macro will read * the following trail surrogate as well. * If the offset points to a trail surrogate or * to a single, unpaired lead surrogate, then c is set to that unpaired surrogate. * * @param s const UChar * string * @param i string offset, must be i<length * @param length string length * @param c output UChar32 variable * @see U16_NEXT_UNSAFE * @stable ICU 2.4 */ #define U16_NEXT(s, i, length, c) { \ (c)=(s)[(i)++]; \ if(U16_IS_LEAD(c)) { \ uint16_t __c2; \ if((i)!=(length) && U16_IS_TRAIL(__c2=(s)[(i)])) { \ ++(i); \ (c)=U16_GET_SUPPLEMENTARY((c), __c2); \ } \ } \ } #ifndef U_HIDE_DRAFT_API /** * Get a code point from a string at a code point boundary offset, * and advance the offset to the next code point boundary. * (Post-incrementing forward iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The length can be negative for a NUL-terminated string. * * The offset may point to the lead surrogate unit * for a supplementary code point, in which case the macro will read * the following trail surrogate as well. * If the offset points to a trail surrogate or * to a single, unpaired lead surrogate, then c is set to U+FFFD. * * @param s const UChar * string * @param i string offset, must be i<length * @param length string length * @param c output UChar32 variable * @see U16_NEXT_UNSAFE * @draft ICU 60 */ #define U16_NEXT_OR_FFFD(s, i, length, c) { \ (c)=(s)[(i)++]; \ if(U16_IS_SURROGATE(c)) { \ uint16_t __c2; \ if(U16_IS_SURROGATE_LEAD(c) && (i)!=(length) && U16_IS_TRAIL(__c2=(s)[(i)])) { \ ++(i); \ (c)=U16_GET_SUPPLEMENTARY((c), __c2); \ } else { \ (c)=0xfffd; \ } \ } \ } #endif // U_HIDE_DRAFT_API /** * Append a code point to a string, overwriting 1 or 2 code units. * The offset points to the current end of the string contents * and is advanced (post-increment). * "Unsafe" macro, assumes a valid code point and sufficient space in the string. * Otherwise, the result is undefined. * * @param s const UChar * string buffer * @param i string offset * @param c code point to append * @see U16_APPEND * @stable ICU 2.4 */ #define U16_APPEND_UNSAFE(s, i, c) { \ if((uint32_t)(c)<=0xffff) { \ (s)[(i)++]=(uint16_t)(c); \ } else { \ (s)[(i)++]=(uint16_t)(((c)>>10)+0xd7c0); \ (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \ } \ } /** * Append a code point to a string, overwriting 1 or 2 code units. * The offset points to the current end of the string contents * and is advanced (post-increment). * "Safe" macro, checks for a valid code point. * If a surrogate pair is written, checks for sufficient space in the string. * If the code point is not valid or a trail surrogate does not fit, * then isError is set to TRUE. * * @param s const UChar * string buffer * @param i string offset, must be i<capacity * @param capacity size of the string buffer * @param c code point to append * @param isError output UBool set to TRUE if an error occurs, otherwise not modified * @see U16_APPEND_UNSAFE * @stable ICU 2.4 */ #define U16_APPEND(s, i, capacity, c, isError) { \ if((uint32_t)(c)<=0xffff) { \ (s)[(i)++]=(uint16_t)(c); \ } else if((uint32_t)(c)<=0x10ffff && (i)+1<(capacity)) { \ (s)[(i)++]=(uint16_t)(((c)>>10)+0xd7c0); \ (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \ } else /* c>0x10ffff or not enough space */ { \ (isError)=TRUE; \ } \ } /** * Advance the string offset from one code point boundary to the next. * (Post-incrementing iteration.) * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @see U16_FWD_1 * @stable ICU 2.4 */ #define U16_FWD_1_UNSAFE(s, i) { \ if(U16_IS_LEAD((s)[(i)++])) { \ ++(i); \ } \ } /** * Advance the string offset from one code point boundary to the next. * (Post-incrementing iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The length can be negative for a NUL-terminated string. * * @param s const UChar * string * @param i string offset, must be i<length * @param length string length * @see U16_FWD_1_UNSAFE * @stable ICU 2.4 */ #define U16_FWD_1(s, i, length) { \ if(U16_IS_LEAD((s)[(i)++]) && (i)!=(length) && U16_IS_TRAIL((s)[i])) { \ ++(i); \ } \ } /** * Advance the string offset from one code point boundary to the n-th next one, * i.e., move forward by n code points. * (Post-incrementing iteration.) * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @param n number of code points to skip * @see U16_FWD_N * @stable ICU 2.4 */ #define U16_FWD_N_UNSAFE(s, i, n) { \ int32_t __N=(n); \ while(__N>0) { \ U16_FWD_1_UNSAFE(s, i); \ --__N; \ } \ } /** * Advance the string offset from one code point boundary to the n-th next one, * i.e., move forward by n code points. * (Post-incrementing iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The length can be negative for a NUL-terminated string. * * @param s const UChar * string * @param i int32_t string offset, must be i<length * @param length int32_t string length * @param n number of code points to skip * @see U16_FWD_N_UNSAFE * @stable ICU 2.4 */ #define U16_FWD_N(s, i, length, n) { \ int32_t __N=(n); \ while(__N>0 && ((i)<(length) || ((length)<0 && (s)[i]!=0))) { \ U16_FWD_1(s, i, length); \ --__N; \ } \ } /** * Adjust a random-access offset to a code point boundary * at the start of a code point. * If the offset points to the trail surrogate of a surrogate pair, * then the offset is decremented. * Otherwise, it is not modified. * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @see U16_SET_CP_START * @stable ICU 2.4 */ #define U16_SET_CP_START_UNSAFE(s, i) { \ if(U16_IS_TRAIL((s)[i])) { \ --(i); \ } \ } /** * Adjust a random-access offset to a code point boundary * at the start of a code point. * If the offset points to the trail surrogate of a surrogate pair, * then the offset is decremented. * Otherwise, it is not modified. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, must be start<=i * @see U16_SET_CP_START_UNSAFE * @stable ICU 2.4 */ #define U16_SET_CP_START(s, start, i) { \ if(U16_IS_TRAIL((s)[i]) && (i)>(start) && U16_IS_LEAD((s)[(i)-1])) { \ --(i); \ } \ } /* definitions with backward iteration -------------------------------------- */ /** * Move the string offset from one code point boundary to the previous one * and get the code point between them. * (Pre-decrementing backward iteration.) * "Unsafe" macro, assumes well-formed UTF-16. * * The input offset may be the same as the string length. * If the offset is behind a trail surrogate unit * for a supplementary code point, then the macro will read * the preceding lead surrogate as well. * If the offset is behind a lead surrogate, then that itself * will be returned as the code point. * The result is undefined if the offset is behind a single, unpaired trail surrogate. * * @param s const UChar * string * @param i string offset * @param c output UChar32 variable * @see U16_PREV * @stable ICU 2.4 */ #define U16_PREV_UNSAFE(s, i, c) { \ (c)=(s)[--(i)]; \ if(U16_IS_TRAIL(c)) { \ (c)=U16_GET_SUPPLEMENTARY((s)[--(i)], (c)); \ } \ } /** * Move the string offset from one code point boundary to the previous one * and get the code point between them. * (Pre-decrementing backward iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The input offset may be the same as the string length. * If the offset is behind a trail surrogate unit * for a supplementary code point, then the macro will read * the preceding lead surrogate as well. * If the offset is behind a lead surrogate or behind a single, unpaired * trail surrogate, then c is set to that unpaired surrogate. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, must be start<i * @param c output UChar32 variable * @see U16_PREV_UNSAFE * @stable ICU 2.4 */ #define U16_PREV(s, start, i, c) { \ (c)=(s)[--(i)]; \ if(U16_IS_TRAIL(c)) { \ uint16_t __c2; \ if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ --(i); \ (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ } \ } \ } #ifndef U_HIDE_DRAFT_API /** * Move the string offset from one code point boundary to the previous one * and get the code point between them. * (Pre-decrementing backward iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The input offset may be the same as the string length. * If the offset is behind a trail surrogate unit * for a supplementary code point, then the macro will read * the preceding lead surrogate as well. * If the offset is behind a lead surrogate or behind a single, unpaired * trail surrogate, then c is set to U+FFFD. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, must be start<i * @param c output UChar32 variable * @see U16_PREV_UNSAFE * @draft ICU 60 */ #define U16_PREV_OR_FFFD(s, start, i, c) { \ (c)=(s)[--(i)]; \ if(U16_IS_SURROGATE(c)) { \ uint16_t __c2; \ if(U16_IS_SURROGATE_TRAIL(c) && (i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ --(i); \ (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ } else { \ (c)=0xfffd; \ } \ } \ } #endif // U_HIDE_DRAFT_API /** * Move the string offset from one code point boundary to the previous one. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @see U16_BACK_1 * @stable ICU 2.4 */ #define U16_BACK_1_UNSAFE(s, i) { \ if(U16_IS_TRAIL((s)[--(i)])) { \ --(i); \ } \ } /** * Move the string offset from one code point boundary to the previous one. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, must be start<i * @see U16_BACK_1_UNSAFE * @stable ICU 2.4 */ #define U16_BACK_1(s, start, i) { \ if(U16_IS_TRAIL((s)[--(i)]) && (i)>(start) && U16_IS_LEAD((s)[(i)-1])) { \ --(i); \ } \ } /** * Move the string offset from one code point boundary to the n-th one before it, * i.e., move backward by n code points. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @param n number of code points to skip * @see U16_BACK_N * @stable ICU 2.4 */ #define U16_BACK_N_UNSAFE(s, i, n) { \ int32_t __N=(n); \ while(__N>0) { \ U16_BACK_1_UNSAFE(s, i); \ --__N; \ } \ } /** * Move the string offset from one code point boundary to the n-th one before it, * i.e., move backward by n code points. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * @param s const UChar * string * @param start start of string * @param i string offset, must be start<i * @param n number of code points to skip * @see U16_BACK_N_UNSAFE * @stable ICU 2.4 */ #define U16_BACK_N(s, start, i, n) { \ int32_t __N=(n); \ while(__N>0 && (i)>(start)) { \ U16_BACK_1(s, start, i); \ --__N; \ } \ } /** * Adjust a random-access offset to a code point boundary after a code point. * If the offset is behind the lead surrogate of a surrogate pair, * then the offset is incremented. * Otherwise, it is not modified. * The input offset may be the same as the string length. * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @see U16_SET_CP_LIMIT * @stable ICU 2.4 */ #define U16_SET_CP_LIMIT_UNSAFE(s, i) { \ if(U16_IS_LEAD((s)[(i)-1])) { \ ++(i); \ } \ } /** * Adjust a random-access offset to a code point boundary after a code point. * If the offset is behind the lead surrogate of a surrogate pair, * then the offset is incremented. * Otherwise, it is not modified. * The input offset may be the same as the string length. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The length can be negative for a NUL-terminated string. * * @param s const UChar * string * @param start int32_t starting string offset (usually 0) * @param i int32_t string offset, start<=i<=length * @param length int32_t string length * @see U16_SET_CP_LIMIT_UNSAFE * @stable ICU 2.4 */ #define U16_SET_CP_LIMIT(s, start, i, length) { \ if((start)<(i) && ((i)<(length) || (length)<0) && U16_IS_LEAD((s)[(i)-1]) && U16_IS_TRAIL((s)[i])) { \ ++(i); \ } \ } #endif
{ "content_hash": "61454ab9fbeb59486b39b324cef7b803", "timestamp": "", "source": "github", "line_count": 731, "max_line_length": 106, "avg_line_length": 30.905608755129958, "alnum_prop": 0.6281427053824362, "repo_name": "brightdigit/speculid", "id": "35fd09861143cdfb1fb0002ade64e1a734927498", "size": "23028", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "frameworks/cairosvg/dependencies/icu4c/61.1/include/unicode/utf16.h", "mode": "33261", "license": "mit", "language": [ { "name": "AppleScript", "bytes": "570" }, { "name": "Objective-C", "bytes": "433" }, { "name": "Ruby", "bytes": "1512" }, { "name": "Shell", "bytes": "37750" }, { "name": "Swift", "bytes": "70545" } ], "symlink_target": "" }
swoole_https_client: method_put_with_payload --SKIPIF-- <?php require __DIR__ . "/../inc/skipif.inc"; ?> --INI-- assert.active=1 assert.warning=1 assert.bail=0 assert.quiet_eval=0 --FILE-- <?php require_once __DIR__ . "/../inc/zan.inc"; require_once __DIR__ . "/../../apitest/swoole_http_client/simple_https_client.php"; $simple_http_server = __DIR__ . "/../../apitest/swoole_http_server/simple_https_server.php"; $closeServer = start_server($simple_http_server, HTTP_SERVER_HOST, $port = get_one_free_port()); testMethod(HTTP_SERVER_HOST, $port, "PATCH", "put", function() use($closeServer) { echo "SUCCESS";$closeServer(); }); suicide(1000, SIGTERM, $closeServer); ?> --EXPECT-- SUCCESS
{ "content_hash": "e131ee3b5d4dc3e9c88ad569fcc9ac83", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 96, "avg_line_length": 25.88888888888889, "alnum_prop": 0.6666666666666666, "repo_name": "springleng/zan", "id": "fdf32528f026d06ab700efb8d684ccad7fe64d7c", "size": "708", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "php-test/phpt/swoole_https_client/method_put_with_payload.phpt", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1677311" }, { "name": "C++", "bytes": "6815" }, { "name": "CMake", "bytes": "1964" }, { "name": "JavaScript", "bytes": "644" }, { "name": "M4", "bytes": "13688" }, { "name": "Makefile", "bytes": "587" }, { "name": "PHP", "bytes": "702954" }, { "name": "Shell", "bytes": "2655" } ], "symlink_target": "" }
id: clipboard title: Clipboard --- > This API is deprecated and will be removed from react-native in the next release. Use [expo-clipboard](../sdk/clipboard.md) instead. `Clipboard` gives you an interface for setting and getting content from Clipboard on both Android and iOS --- ## Example ```js import React, { useState } from 'react' import { SafeAreaView, View, Text, TouchableOpacity, Clipboard, StyleSheet } from 'react-native' const App = () => { const [copiedText, setCopiedText] = useState('') const copyToClipboard = () => { Clipboard.setString('hello world') } const fetchCopiedText = async () => { const text = await Clipboard.getString() setCopiedText(text) } return ( <SafeAreaView style={{ flex: 1 }}> <View style={styles.container}> <TouchableOpacity onPress={() => copyToClipboard()}> <Text>Click here to copy to Clipboard</Text> </TouchableOpacity> <TouchableOpacity onPress={() => fetchCopiedText()}> <Text>View copied text</Text> </TouchableOpacity> <Text style={styles.copiedText}>{copiedText}</Text> </View> </SafeAreaView> ) } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center' }, copiedText: { marginTop: 10, color: 'red' } }) export default App ``` # Reference ## Methods ### `getString()` ```jsx static getString() ``` Get content of string type, this method returns a `Promise`, so you can use following code to get clipboard content ```jsx async _getContent() { var content = await Clipboard.getString(); } ``` --- ### `setString()` ```jsx static setString(content) ``` Set content of string type. You can use following code to set clipboard content ```jsx _setContent() { Clipboard.setString('hello world'); } ``` **Parameters:** | Name | Type | Required | Description | | ------- | ------ | -------- | ----------------------------------------- | | content | string | Yes | The content to be stored in the clipboard | _Notice_ Be careful when you're trying to copy to clipboard any data except `string` and `number`, some data need additional stringification. For example, if you will try to copy array - Android will raise an exception, but iOS will not.
{ "content_hash": "0c79986190ddea7650c08bf4acf27bd5", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 228, "avg_line_length": 22.548076923076923, "alnum_prop": 0.6332622601279317, "repo_name": "exponentjs/exponent", "id": "795e092173a2f69ac76873cc601e54e44a8ce14a", "size": "2349", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "docs/pages/versions/v42.0.0/react-native/clipboard.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "96902" }, { "name": "Batchfile", "bytes": "382" }, { "name": "C", "bytes": "896724" }, { "name": "C++", "bytes": "867983" }, { "name": "CSS", "bytes": "6732" }, { "name": "HTML", "bytes": "152590" }, { "name": "IDL", "bytes": "897" }, { "name": "Java", "bytes": "4588748" }, { "name": "JavaScript", "bytes": "9343259" }, { "name": "Makefile", "bytes": "8790" }, { "name": "Objective-C", "bytes": "10675806" }, { "name": "Objective-C++", "bytes": "364286" }, { "name": "Perl", "bytes": "5860" }, { "name": "Prolog", "bytes": "287" }, { "name": "Python", "bytes": "97564" }, { "name": "Ruby", "bytes": "45432" }, { "name": "Shell", "bytes": "6501" } ], "symlink_target": "" }
package com.gemstone.gemfire.internal.cache; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import org.apache.logging.log4j.Logger; import com.gemstone.gemfire.DataSerializer; import com.gemstone.gemfire.Instantiator; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolFactory; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.BridgePoolImpl; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.client.internal.RegisterDataSerializersOp; import com.gemstone.gemfire.cache.client.internal.RegisterInstantiatorsOp; import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.internal.InternalDataSerializer; import com.gemstone.gemfire.internal.InternalDataSerializer.SerializerAttributesHolder; import com.gemstone.gemfire.internal.InternalInstantiator; import com.gemstone.gemfire.internal.InternalInstantiator.InstantiatorAttributesHolder; import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; import com.gemstone.gemfire.internal.logging.LogService; import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage; /** * Implementation used by PoolManager. * * @author darrel * @since 5.7 * */ public class PoolManagerImpl { private static final Logger logger = LogService.getLogger(); private final static PoolManagerImpl impl = new PoolManagerImpl(true); public static PoolManagerImpl getPMI() { PoolManagerImpl result = CacheCreation.getCurrentPoolManager(); if (result == null) { result = impl; } return result; } private volatile Map<String,Pool> pools = Collections.emptyMap(); private volatile Iterator<Map.Entry<String,Pool>> itrForEmergencyClose = null; private final Object poolLock = new Object(); /** * True if this manager is a normal one owned by the PoolManager. * False if this is a special one owned by a xml CacheCreation. */ private final boolean normalManager; /** * @param addListener will be true if the is a real manager that needs to * register a connect listener. False if it is a fake * manager used internally by the XML code. */ public PoolManagerImpl(boolean addListener) { this.normalManager = addListener; } /** * Returns true if this is a normal manager; false if it is a fake one used * for xml parsing. */ public boolean isNormal() { return this.normalManager; } /** * Creates a new {@link PoolFactory pool factory}, * which is used to configure and create new {@link Pool}s. * @return the new pool factory */ public PoolFactory createFactory() { return new PoolFactoryImpl(this); } /** * Find by name an existing connection pool returning * the existing pool or <code>null</code> if it does not exist. * @param name the name of the connection pool * @return the existing connection pool or <code>null</code> if it does not exist. */ public Pool find(String name) { return this.pools.get(name); } /** * Set the keep alive flag before closing. Only for use with the deprecated * BridgeWriter/Loader code. A BridgeWriter is automatically * closed then the last region is disconnected from it, * so we need to mark the connections as keep alive * before we close the regions that use the bridge writer/loader * * @param keepAlive */ public static void setKeepAlive(boolean keepAlive) { for(Iterator<Pool> itr = PoolManager.getAll().values().iterator(); itr.hasNext(); ) { Pool nextPool = itr.next(); if(nextPool instanceof BridgePoolImpl) { BridgePoolImpl bridgePool = (BridgePoolImpl) nextPool; bridgePool.setKeepAlive(keepAlive); } } } /** * Destroys all created pool in this manager. */ public void close(boolean keepAlive) { // destroying connection pools synchronized(poolLock) { for (Iterator<Map.Entry<String,Pool>> itr = pools.entrySet().iterator(); itr.hasNext(); ) { Map.Entry<String,Pool> entry = itr.next(); PoolImpl pool = (PoolImpl)entry.getValue(); pool.basicDestroy(keepAlive); } pools = Collections.emptyMap(); itrForEmergencyClose = null; } } /** * @return a copy of the Pools Map */ public Map<String,Pool> getMap() { //debugStack("getMap: " + this.pools); return new HashMap<String,Pool>(this.pools); } /** * This is called by {@link PoolImpl#create} * @throws IllegalStateException if a pool with same name is already registered. */ public void register(Pool pool) { synchronized (this.poolLock) { Map<String,Pool> copy = new HashMap<String,Pool>(pools); String name = pool.getName(); //debugStack("register pool=" + name); Object old = copy.put(name, pool); if (old != null) { throw new IllegalStateException("A pool named \"" + name + "\" already exists."); } // Boolean specialCase=Boolean.getBoolean("gemfire.SPECIAL_DURABLE"); // if(specialCase && copy.size()>1){ // throw new IllegalStateException("Using SPECIAL_DURABLE system property" // + " and more than one pool already exists in client."); // } this.pools = Collections.unmodifiableMap(copy); this.itrForEmergencyClose = copy.entrySet().iterator(); } } /** * This is called by {@link Pool#destroy(boolean)} * @return true if pool unregistered from cache; false if someone else already did it */ public boolean unregister(Pool pool) { synchronized(this.poolLock) { Map<String,Pool> copy = new HashMap<String,Pool>(pools); String name = pool.getName(); //debugStack("unregister pool=" + name); Object rmPool = copy.remove(name); if (rmPool == null || rmPool != pool) { return false; } else { this.pools = Collections.unmodifiableMap(copy); this.itrForEmergencyClose = copy.entrySet().iterator(); return true; } } } @Override public String toString() { StringBuffer result = new StringBuffer(); result.append(super.toString()) .append("-") .append(this.normalManager? "normal":"xml"); return result.toString(); } /** * @param xmlPoolsOnly if true then only call readyForEvents on pools declared in XML. */ public static void readyForEvents(InternalDistributedSystem system, boolean xmlPoolsOnly) { boolean foundDurablePool = false; Map<String,Pool> pools = PoolManager.getAll(); for(Iterator<Pool> itr = pools.values().iterator(); itr.hasNext(); ) { PoolImpl p = (PoolImpl) itr.next(); if (p.isDurableClient()) { //TODO - handle an exception and attempt on all pools? foundDurablePool = true; if (!xmlPoolsOnly || p.getDeclaredInXML()) { p.readyForEvents(system); } } } if (pools.size() > 0 && !foundDurablePool) { throw new IllegalStateException(LocalizedStrings.PoolManagerImpl_ONLY_DURABLE_CLIENTS_SHOULD_CALL_READYFOREVENTS.toLocalizedString()); } } /** * @param instantiator */ public static void allPoolsRegisterInstantiator(Instantiator instantiator) { Instantiator[] instantiators = new Instantiator[1]; instantiators[0] = instantiator; for(Iterator<Pool> itr = PoolManager.getAll().values().iterator(); itr.hasNext(); ) { PoolImpl next = (PoolImpl) itr.next(); try { EventID eventId = InternalInstantiator.generateEventId(); if(eventId == null) { //cache must not exist, do nothing } else { RegisterInstantiatorsOp.execute(next, instantiators, InternalInstantiator.generateEventId()); } } catch(RuntimeException e) { logger.warn(LocalizedMessage.create(LocalizedStrings.PoolmanagerImpl_ERROR_REGISTERING_INSTANTIATOR_ON_POOL), e); } finally { next.releaseThreadLocalConnection(); } } } public static void allPoolsRegisterInstantiator(InstantiatorAttributesHolder holder) { InstantiatorAttributesHolder[] holders = new InstantiatorAttributesHolder[1]; holders[0] = holder; for(Iterator<Pool> itr = PoolManager.getAll().values().iterator(); itr.hasNext(); ) { PoolImpl next = (PoolImpl) itr.next(); try { EventID eventId = InternalInstantiator.generateEventId(); if(eventId == null) { //cache must not exist, do nothing } else { RegisterInstantiatorsOp.execute(next, holders, InternalInstantiator.generateEventId()); } } catch(RuntimeException e) { logger.warn(LocalizedMessage.create(LocalizedStrings.PoolmanagerImpl_ERROR_REGISTERING_INSTANTIATOR_ON_POOL), e); } finally { next.releaseThreadLocalConnection(); } } } public static void allPoolsRegisterDataSerializers( DataSerializer dataSerializer) { DataSerializer[] dataSerializers = new DataSerializer[1]; dataSerializers[0] = dataSerializer; for (Iterator<Pool> itr = PoolManager.getAll().values().iterator(); itr .hasNext();) { PoolImpl next = (PoolImpl)itr.next(); try { EventID eventId = (EventID)dataSerializer.getEventId(); if (eventId == null) { eventId = InternalDataSerializer.generateEventId(); } if (eventId == null) { // cache must not exist, do nothing } else { RegisterDataSerializersOp.execute(next, dataSerializers, eventId); } } catch (RuntimeException e) { logger.warn(LocalizedMessage.create( LocalizedStrings.PoolmanagerImpl_ERROR_REGISTERING_INSTANTIATOR_ON_POOL), e); } finally { next.releaseThreadLocalConnection(); } } } public static void allPoolsRegisterDataSerializers( SerializerAttributesHolder holder) { SerializerAttributesHolder[] holders = new SerializerAttributesHolder[1]; holders[0] = holder; for (Iterator<Pool> itr = PoolManager.getAll().values().iterator(); itr .hasNext();) { PoolImpl next = (PoolImpl)itr.next(); try { EventID eventId = (EventID)holder.getEventId(); if (eventId == null) { eventId = InternalDataSerializer.generateEventId(); } if (eventId == null) { // cache must not exist, do nothing } else { RegisterDataSerializersOp.execute(next, holders, eventId); } } catch (RuntimeException e) { logger.warn(LocalizedMessage.create( LocalizedStrings.PoolmanagerImpl_ERROR_REGISTERING_INSTANTIATOR_ON_POOL), e); } finally { next.releaseThreadLocalConnection(); } } } public static void emergencyClose() { if(impl == null) { return; } Iterator<Map.Entry<String,Pool>> itr= impl.itrForEmergencyClose; if(itr == null) { return; } while(itr.hasNext()) { Entry<String, Pool> next = itr.next(); ((PoolImpl) next.getValue()).emergencyClose(); } } public static void loadEmergencyClasses() { PoolImpl.loadEmergencyClasses(); } public Pool find(Region<?,?> region) { return find(region.getAttributes().getPoolName()); } }
{ "content_hash": "dd437e31bb807ce27b2768895ebe7c4a", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 140, "avg_line_length": 34.73652694610779, "alnum_prop": 0.6695397345285296, "repo_name": "ameybarve15/incubator-geode", "id": "7e680fb232311f7dba97df3fa1042a667d3c001b", "size": "12017", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolManagerImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1776" }, { "name": "CSS", "bytes": "44487" }, { "name": "HTML", "bytes": "124114" }, { "name": "Java", "bytes": "18710288" }, { "name": "JavaScript", "bytes": "315078" }, { "name": "Shell", "bytes": "7239" } ], "symlink_target": "" }
class CreateSignedUpUsers < ActiveRecord::Migration def self.up create_table :signed_up_users do |t| t.column :topic_id, :integer, :null => false t.column :creator_id, :integer, :null => false t.column :is_waitlisted, :boolean, :null => false t.column :preference_priority_number, :integer end add_index "signed_up_users", ["topic_id"], :name => "fk_signed_up_users_sign_up_topics" execute "alter table signed_up_users add constraint fk_signed_up_users_sign_up_topics foreign key (topic_id) references sign_up_topics(id)" end def self.down drop_table :signed_up_users end end
{ "content_hash": "c8fc210e15694c07fa4b7010fc7cad85", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 91, "avg_line_length": 33.55, "alnum_prop": 0.6423248882265276, "repo_name": "sid5788/expertiza", "id": "ba183043f2b288105732fcf09f1d33edbf9c0b82", "size": "671", "binary": false, "copies": "15", "ref": "refs/heads/master", "path": "db/migrate/117_create_signed_up_users.rb", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1250" }, { "name": "CSS", "bytes": "22922" }, { "name": "CoffeeScript", "bytes": "425" }, { "name": "HTML", "bytes": "556215" }, { "name": "JavaScript", "bytes": "114888" }, { "name": "Ruby", "bytes": "1530796" }, { "name": "Shell", "bytes": "1152" } ], "symlink_target": "" }
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" /> <link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/> <link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/> <!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]--> <style type="text/css" media="all"> @import url('../../../../../style.css'); @import url('../../../../../tree.css'); </style> <script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script> <script src="../../../../../package-nodes-tree.js" type="text/javascript"></script> <script src="../../../../../clover-tree.js" type="text/javascript"></script> <script src="../../../../../clover.js" type="text/javascript"></script> <script src="../../../../../clover-descriptions.js" type="text/javascript"></script> <script src="../../../../../cloud.js" type="text/javascript"></script> <title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title> </head> <body> <div id="page"> <header id="header" role="banner"> <nav class="aui-header aui-dropdown2-trigger-group" role="navigation"> <div class="aui-header-inner"> <div class="aui-header-primary"> <h1 id="logo" class="aui-header-logo aui-header-logo-clover"> <a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a> </h1> </div> <div class="aui-header-secondary"> <ul class="aui-nav"> <li id="system-help-menu"> <a class="aui-nav-link" title="Open online documentation" target="_blank" href="http://openclover.org/documentation"> <span class="aui-icon aui-icon-small aui-iconfont-help">&#160;Help</span> </a> </li> </ul> </div> </div> </nav> </header> <div class="aui-page-panel"> <div class="aui-page-panel-inner"> <div class="aui-page-panel-nav aui-page-panel-nav-clover"> <div class="aui-page-header-inner" style="margin-bottom: 20px;"> <div class="aui-page-header-image"> <a href="http://cardatechnologies.com" target="_top"> <div class="aui-avatar aui-avatar-large aui-avatar-project"> <div class="aui-avatar-inner"> <img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/> </div> </div> </a> </div> <div class="aui-page-header-main" > <h1> <a href="http://cardatechnologies.com" target="_top"> ABA Route Transit Number Validator 1.0.1-SNAPSHOT </a> </h1> </div> </div> <nav class="aui-navgroup aui-navgroup-vertical"> <div class="aui-navgroup-inner"> <ul class="aui-nav"> <li class=""> <a href="../../../../../dashboard.html">Project overview</a> </li> </ul> <div class="aui-nav-heading packages-nav-heading"> <strong>Packages</strong> </div> <div class="aui-nav project-packages"> <form method="get" action="#" class="aui package-filter-container"> <input type="text" autocomplete="off" class="package-filter text" placeholder="Type to filter packages..." name="package-filter" id="package-filter" title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/> </form> <p class="package-filter-no-results-message hidden"> <small>No results found.</small> </p> <div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator"> <div class="packages-tree-container"></div> <div class="clover-packages-lozenges"></div> </div> </div> </div> </nav> </div> <section class="aui-page-panel-content"> <div class="aui-page-panel-content-clover"> <div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs"> <li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li> <li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li> <li><a href="test-Test_AbaRouteValidator_13a.html">Class Test_AbaRouteValidator_13a</a></li> </ol></div> <h1 class="aui-h2-clover"> Test testAbaNumberCheck_26674_bad </h1> <table class="aui"> <thead> <tr> <th>Test</th> <th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th> <th><label title="When the test execution was started">Start time</label></th> <th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th> <th><label title="A failure or error message if the test is not successful.">Message</label></th> </tr> </thead> <tbody> <tr> <td> <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_13a.html?line=40241#src-40241" >testAbaNumberCheck_26674_bad</a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:42:20 </td> <td> 0.0 </td> <td> <div></div> <div class="errorMessage"></div> </td> </tr> </tbody> </table> <div>&#160;</div> <table class="aui aui-table-sortable"> <thead> <tr> <th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th> <th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_26674_bad</th> </tr> </thead> <tbody> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.AbaRouteValidationException</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/exceptions/AbaRouteValidationException.html?id=29968#AbaRouteValidationException" title="AbaRouteValidationException" name="sl-43">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.AbaRouteValidationException</a> </td> <td> <span class="sortValue">0.5714286</span>57.1% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td> </tr> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/ErrorCodes.html?id=29968#ErrorCodes" title="ErrorCodes" name="sl-42">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</a> </td> <td> <span class="sortValue">0.5714286</span>57.1% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td> </tr> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=29968#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a> </td> <td> <span class="sortValue">0.29411766</span>29.4% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="29.4% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:29.4%"></div></div></div> </td> </tr> </tbody> </table> </div> <!-- class="aui-page-panel-content-clover" --> <footer id="footer" role="contentinfo"> <section class="footer-body"> <ul> <li> Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1 on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT. </li> </ul> <ul> <li>OpenClover is free and open-source software. </li> </ul> </section> </footer> </section> <!-- class="aui-page-panel-content" --> </div> <!-- class="aui-page-panel-inner" --> </div> <!-- class="aui-page-panel" --> </div> <!-- id="page" --> </body> </html>
{ "content_hash": "f2265c67fe6cffc0c0636ead938f5cca", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 359, "avg_line_length": 46.765957446808514, "alnum_prop": 0.5304822565969063, "repo_name": "dcarda/aba.route.validator", "id": "099ea20117ad895461e74e71df62535f9c85ee68", "size": "10990", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_13a_testAbaNumberCheck_26674_bad_n4g.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "18715254" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Gemfile - RDoc Documentation</title> <script type="text/javascript"> var rdoc_rel_prefix = "./"; </script> <script src="./js/jquery.js"></script> <script src="./js/darkfish.js"></script> <link href="./css/fonts.css" rel="stylesheet"> <link href="./css/rdoc.css" rel="stylesheet"> <body id="top" role="document" class="file"> <nav role="navigation"> <div id="project-navigation"> <div id="home-section" role="region" title="Quick navigation" class="nav-section"> <h2> <a href="./index.html" rel="home">Home</a> </h2> <div id="table-of-contents-navigation"> <a href="./table_of_contents.html#pages">Pages</a> <a href="./table_of_contents.html#classes">Classes</a> <a href="./table_of_contents.html#methods">Methods</a> </div> </div> <div id="search-section" role="search" class="project-section initially-hidden"> <form action="#" method="get" accept-charset="utf-8"> <div id="search-field-wrapper"> <input id="search-field" role="combobox" aria-label="Search" aria-autocomplete="list" aria-controls="search-results" type="text" name="search" placeholder="Search" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"> </div> <ul id="search-results" aria-label="Search Results" aria-busy="false" aria-expanded="false" aria-atomic="false" class="initially-hidden"></ul> </form> </div> </div> <div id="project-metadata"> <div id="fileindex-section" class="nav-section"> <h3>Pages</h3> <ul class="link-list"> <li><a href="./CODE_OF_CONDUCT_md.html">CODE_OF_CONDUCT</a> <li><a href="./Gemfile.html">Gemfile</a> <li><a href="./Gemfile_lock.html">Gemfile.lock</a> <li><a href="./Guardfile.html">Guardfile</a> <li><a href="./LICENSE_txt.html">LICENSE</a> <li><a href="./README_md.html">README</a> <li><a href="./Rakefile.html">Rakefile</a> <li><a href="./bin/setup.html">setup</a> <li><a href="./referencia_gemspec.html">referencia.gemspec</a> </ul> </div> </div> </nav> <main role="main" aria-label="Page Gemfile"> <p>source &#39;<a href="https://rubygems.org">rubygems.org</a>&#39;</p> <p># Specify your gem&#39;s dependencies in <a href="referencia_gemspec.html">referencia.gemspec</a> gemspec</p> </main> <footer id="validator-badges" role="contentinfo"> <p><a href="http://validator.w3.org/check/referer">Validate</a> <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0. <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>. </footer>
{ "content_hash": "a7d256909e75c9959112393601824dea", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 134, "avg_line_length": 27.46, "alnum_prop": 0.6325564457392571, "repo_name": "hectorinoman/practica11LPP", "id": "7d21d2c8776671b8e78bb50a8a46c05b21dbe24b", "size": "2746", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/Gemfile.html", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "13493" }, { "name": "Shell", "bytes": "115" } ], "symlink_target": "" }
using Microsoft.Phone.Controls; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace RealEstateTourNotebook.Utils { public class Transitions { //Turnstile transition public static void UseTurnstileTransition(UIElement element) { TransitionService.SetNavigationInTransition(element, new NavigationInTransition() { Backward = new TurnstileTransition() { Mode = TurnstileTransitionMode.BackwardIn }, Forward = new TurnstileTransition() { Mode = TurnstileTransitionMode.ForwardIn } } ); TransitionService.SetNavigationOutTransition(element, new NavigationOutTransition() { Backward = new TurnstileTransition() { Mode = TurnstileTransitionMode.BackwardOut }, Forward = new TurnstileTransition() { Mode = TurnstileTransitionMode.ForwardOut } } ); } //Slide transition public static void UseSlideTransition(UIElement element) { TransitionService.SetNavigationInTransition(element, new NavigationInTransition() { Backward = new SlideTransition() { Mode = SlideTransitionMode.SlideRightFadeIn }, Forward = new SlideTransition() { Mode = SlideTransitionMode.SlideLeftFadeIn } } ); TransitionService.SetNavigationOutTransition(element, new NavigationOutTransition() { Backward = new SlideTransition() { Mode = SlideTransitionMode.SlideRightFadeOut }, Forward = new SlideTransition() { Mode = SlideTransitionMode.SlideLeftFadeOut } } ); } //Slide up/down transition public static void UseSlideUpDownTransition(UIElement element) { TransitionService.SetNavigationInTransition(element, new NavigationInTransition() { Backward = new SlideTransition() { Mode = SlideTransitionMode.SlideUpFadeIn }, Forward = new SlideTransition() { Mode = SlideTransitionMode.SlideDownFadeIn } } ); TransitionService.SetNavigationOutTransition(element, new NavigationOutTransition() { Backward = new SlideTransition() { Mode = SlideTransitionMode.SlideUpFadeOut }, Forward = new SlideTransition() { Mode = SlideTransitionMode.SlideDownFadeOut } } ); } //Swivel transition public static void UseSwivelTransition(UIElement element) { TransitionService.SetNavigationInTransition(element, new NavigationInTransition() { Backward = new SwivelTransition() { Mode = SwivelTransitionMode.BackwardIn }, Forward = new SwivelTransition() { Mode = SwivelTransitionMode.ForwardIn } } ); TransitionService.SetNavigationOutTransition(element, new NavigationOutTransition() { Backward = new SwivelTransition() { Mode = SwivelTransitionMode.BackwardOut }, Forward = new SwivelTransition() { Mode = SwivelTransitionMode.ForwardOut } } ); } //Rotate transition public static void UseRotateTransition(UIElement element) { TransitionService.SetNavigationInTransition(element, new NavigationInTransition() { Backward = new RotateTransition() { Mode = RotateTransitionMode.In90Clockwise }, Forward = new RotateTransition() { Mode = RotateTransitionMode.In180Clockwise } } ); TransitionService.SetNavigationOutTransition(element, new NavigationOutTransition() { Backward = new RotateTransition() { Mode = RotateTransitionMode.Out180Counterclockwise }, Forward = new RotateTransition() { Mode = RotateTransitionMode.Out90Counterclockwise } } ); } //Roll transition (doesn't have any modes) public static void UseRollTransition(UIElement element) { TransitionService.SetNavigationInTransition(element, new NavigationInTransition() { Backward = new RollTransition() { //Mode = RollTransitionMode.In90Clockwise }, Forward = new RollTransition() { //Mode = RollTransitionMode.In180Clockwise } } ); TransitionService.SetNavigationOutTransition(element, new NavigationOutTransition() { Backward = new RotateTransition() { //Mode = RotateTransitionMode.Out180Counterclockwise }, Forward = new RotateTransition() { //Mode = RotateTransitionMode.Out90Counterclockwise } } ); } } }
{ "content_hash": "5293ad8d4f1b9f056b24859dd9c68809", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 76, "avg_line_length": 33.68780487804878, "alnum_prop": 0.4462785983203012, "repo_name": "NamedJohnny/Real-Estate-Tour-Notebook-Windows-Phone-", "id": "57c0375f64434ef5d31196048356e284cb2bba5f", "size": "6908", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "RealEstateTourNotebook/Utils/Transitions.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "170033" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Symb. bot. upsal. 20(1): 264 (1972) #### Original name Sordaria insignis E.C. Hansen, 1876 ### Remarks null
{ "content_hash": "5966c8209f5728fb2948613ad823f38f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 15.076923076923077, "alnum_prop": 0.6887755102040817, "repo_name": "mdoering/backbone", "id": "b61070ccbd235a7b8d1943d0f5384a1b19e937ac", "size": "269", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Sordariomycetes/Sordariales/Lasiosphaeriaceae/Strattonia/Strattonia insignis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import styled, { css } from 'styled-components'; import { Document as _Document, Page as _Page } from 'react-pdf'; import { Button } from '../../atoms/Button'; import { transitions } from '../../theme/utils'; import { slideInDown } from '../../theme/animations'; const Wrapper = styled.div` position: absolute; top: 0; left: 0; display: flex; flex-flow: column nowrap; jsutify-content: center; align-items: center; width: 100vw; min-height: 100vh; background-color: ${({ theme }) => theme.color.greyLight}; `; const Preview = styled.div` margin-top: ${({ theme }) => theme.margin.double}; border: ${({ theme }) => theme.border.greyOpaque}; max-width: calc(100% - 2rem); max-height: calc(100vh - 6rem); overflow: scroll; visibility: hidden; opacity: 0; ${transitions.short('visibility', 'opacity')}; ${p => p.state === 'success' && css` visibility: visible; opacity: 1; `}; `; const Document = styled(_Document)``; const Page = styled(_Page)``; const CloseButton = styled(Button)` position: absolute; top: 0; left: 0; margin: 0; font-size: ${({ theme }) => theme.typeSize.body}; line-height: 3rem; color: ${({ theme }) => theme.color.greyDark}; background-color: transparent; ${transitions.short('color')}; ${slideInDown}; &:hover { color: ${({ theme }) => theme.color.brand}; background-color: transparent; } `; export { Wrapper, Preview, Document, Page, CloseButton };
{ "content_hash": "48b3e7fd515067feb2bc3746fd2abb24", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 65, "avg_line_length": 23.774193548387096, "alnum_prop": 0.6268656716417911, "repo_name": "sjofartstidningen/bryggan", "id": "6174bb9d2e843aea0d6357a8b70932977496045c", "size": "1474", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/molecules/PdfPreview/components.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2953" }, { "name": "HTML", "bytes": "1337" }, { "name": "JavaScript", "bytes": "148367" } ], "symlink_target": "" }
public: false image: "/media/landings/mfa-easy-to-implement/mfa-easy-to-implement.png" imageAlt: "Multifactor Autnetication (MFA) is easy to implement with Auth0." imagePosition: "right" budicon: 693 color: "#44C7F4" title: "Easy to implement" content: "You can have MFA implemented in minutes! Just flip a switch to enable the feature, select your provider (Google Authenticator or Duo), and customize it. You can even use any MFA provider or build your own, and integrate them through Auth0's extensibility." ---
{ "content_hash": "fbf7a6a99d8ddd9dc6ca15bcd85b54ba", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 266, "avg_line_length": 51.5, "alnum_prop": 0.7766990291262136, "repo_name": "miparnisari/docs", "id": "a886e51dbc0cf9859746295cd7c92e85da9b2afd", "size": "519", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "landings/modules/mfa-easy-to-implement.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1587" } ], "symlink_target": "" }
<?php final class PhabricatorPasswordSettingsPanel extends PhabricatorSettingsPanel { public function getPanelKey() { return 'password'; } public function getPanelName() { return pht('Password'); } public function getPanelGroup() { return pht('Authentication'); } public function isEnabled() { // There's no sense in showing a change password panel if this install // doesn't support password authentication. if (!PhabricatorPasswordAuthProvider::getPasswordProvider()) { return false; } return true; } public function processRequest(AphrontRequest $request) { $user = $request->getUser(); $token = id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( $user, $request, '/settings/'); $min_len = PhabricatorEnv::getEnvConfig('account.minimum-password-length'); $min_len = (int)$min_len; // NOTE: To change your password, you need to prove you own the account, // either by providing the old password or by carrying a token to // the workflow from a password reset email. $key = $request->getStr('key'); $password_type = PhabricatorAuthPasswordResetTemporaryTokenType::TOKENTYPE; $token = null; if ($key) { $token = id(new PhabricatorAuthTemporaryTokenQuery()) ->setViewer($user) ->withTokenResources(array($user->getPHID())) ->withTokenTypes(array($password_type)) ->withTokenCodes(array(PhabricatorHash::digest($key))) ->withExpired(false) ->executeOne(); } $e_old = true; $e_new = true; $e_conf = true; $errors = array(); if ($request->isFormPost()) { if (!$token) { $envelope = new PhutilOpaqueEnvelope($request->getStr('old_pw')); if (!$user->comparePassword($envelope)) { $errors[] = pht('The old password you entered is incorrect.'); $e_old = pht('Invalid'); } } $pass = $request->getStr('new_pw'); $conf = $request->getStr('conf_pw'); if (strlen($pass) < $min_len) { $errors[] = pht('Your new password is too short.'); $e_new = pht('Too Short'); } else if ($pass !== $conf) { $errors[] = pht('New password and confirmation do not match.'); $e_conf = pht('Invalid'); } else if (PhabricatorCommonPasswords::isCommonPassword($pass)) { $e_new = pht('Very Weak'); $e_conf = pht('Very Weak'); $errors[] = pht( 'Your new password is very weak: it is one of the most common '. 'passwords in use. Choose a stronger password.'); } if (!$errors) { // This write is unguarded because the CSRF token has already // been checked in the call to $request->isFormPost() and // the CSRF token depends on the password hash, so when it // is changed here the CSRF token check will fail. $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); $envelope = new PhutilOpaqueEnvelope($pass); id(new PhabricatorUserEditor()) ->setActor($user) ->changePassword($user, $envelope); unset($unguarded); if ($token) { // Destroy the token. $token->delete(); // If this is a password set/reset, kick the user to the home page // after we update their account. $next = '/'; } else { $next = $this->getPanelURI('?saved=true'); } id(new PhabricatorAuthSessionEngine())->terminateLoginSessions( $user, $request->getCookie(PhabricatorCookies::COOKIE_SESSION)); return id(new AphrontRedirectResponse())->setURI($next); } } $hash_envelope = new PhutilOpaqueEnvelope($user->getPasswordHash()); if (strlen($hash_envelope->openEnvelope())) { try { $can_upgrade = PhabricatorPasswordHasher::canUpgradeHash( $hash_envelope); } catch (PhabricatorPasswordHasherUnavailableException $ex) { $can_upgrade = false; // Only show this stuff if we aren't on the reset workflow. We can // do resets regardless of the old hasher's availability. if (!$token) { $errors[] = pht( 'Your password is currently hashed using an algorithm which is '. 'no longer available on this install.'); $errors[] = pht( 'Because the algorithm implementation is missing, your password '. 'can not be used or updated.'); $errors[] = pht( 'To set a new password, request a password reset link from the '. 'login screen and then follow the instructions.'); } } if ($can_upgrade) { $errors[] = pht( 'The strength of your stored password hash can be upgraded. '. 'To upgrade, either: log out and log in using your password; or '. 'change your password.'); } } $len_caption = null; if ($min_len) { $len_caption = pht('Minimum password length: %d characters.', $min_len); } $form = new AphrontFormView(); $form ->setUser($user) ->addHiddenInput('key', $key); if (!$token) { $form->appendChild( id(new AphrontFormPasswordControl()) ->setLabel(pht('Old Password')) ->setError($e_old) ->setName('old_pw')); } $form ->appendChild( id(new AphrontFormPasswordControl()) ->setDisableAutocomplete(true) ->setLabel(pht('New Password')) ->setError($e_new) ->setName('new_pw')); $form ->appendChild( id(new AphrontFormPasswordControl()) ->setDisableAutocomplete(true) ->setLabel(pht('Confirm Password')) ->setCaption($len_caption) ->setError($e_conf) ->setName('conf_pw')); $form ->appendChild( id(new AphrontFormSubmitControl()) ->setValue(pht('Change Password'))); $form->appendChild( id(new AphrontFormStaticControl()) ->setLabel(pht('Current Algorithm')) ->setValue(PhabricatorPasswordHasher::getCurrentAlgorithmName( new PhutilOpaqueEnvelope($user->getPasswordHash())))); $form->appendChild( id(new AphrontFormStaticControl()) ->setLabel(pht('Best Available Algorithm')) ->setValue(PhabricatorPasswordHasher::getBestAlgorithmName())); $form->appendRemarkupInstructions( pht( 'NOTE: Changing your password will terminate any other outstanding '. 'login sessions.')); $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Change Password')) ->setFormSaved($request->getStr('saved')) ->setFormErrors($errors) ->setForm($form); return array( $form_box, ); } }
{ "content_hash": "5e0b94a7b5f31c9a78fd8f6319a68095", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 80, "avg_line_length": 31.552995391705068, "alnum_prop": 0.5945669636337082, "repo_name": "Soluis/phabricator", "id": "f2db373945a95edbf46b37e62b9edb935d528324", "size": "6847", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/applications/settings/panel/PhabricatorPasswordSettingsPanel.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "160255" }, { "name": "CSS", "bytes": "348898" }, { "name": "Groff", "bytes": "30134" }, { "name": "JavaScript", "bytes": "879855" }, { "name": "Makefile", "bytes": "9933" }, { "name": "PHP", "bytes": "14322094" }, { "name": "Python", "bytes": "7385" }, { "name": "Shell", "bytes": "15980" } ], "symlink_target": "" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace Koopakiller.Apps.Brainstorming.Server.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
{ "content_hash": "202a2fd112f2e975f88c30f627d1e01c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 151, "avg_line_length": 43, "alnum_prop": 0.575134168157424, "repo_name": "Koopakiller/School", "id": "26e06f0283e8027bac13e1e135a6330eccb55816", "size": "1120", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Brainstorming/Server/Properties/Settings.Designer.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "86659" }, { "name": "Pascal", "bytes": "2813" }, { "name": "PowerShell", "bytes": "7420" } ], "symlink_target": "" }
<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KH2BR6C');</script> <!-- End Google Tag Manager --> <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"5565094"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script><noscript><img src="//bat.bing.com/action/0?ti=5565094&Ver=2" height="0" width="0" style="display:none; visibility: hidden;" /></noscript> <!-- BEGIN: Google Trusted Stores --> <script type="text/javascript"> var gts = gts || []; gts.push(["id", "736387"]); gts.push(["badge_position", "BOTTOM_LEFT"]); gts.push(["locale", "en_US"]); gts.push(["google_base_offer_id", "MeshVest"]); gts.push(["google_base_subaccount_id", "114544317"]); (function() { var gts = document.createElement("script"); gts.type = "text/javascript"; gts.async = true; gts.src = "https://www.googlecommerce.com/trustedstores/api/js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(gts, s); })(); </script> <!-- END: Google Trusted Stores --> <title> Kids Mesh Therapy Pressure Vest - XS, Blue </title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <link rel="icon" href="img/healthy-icon.png"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/icomoon-social.css"> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,600,800' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/leaflet.css" /> <!--[if lte IE 8]> <link rel="stylesheet" href="css/leaflet.ie.css" /> <![endif]--> <link rel="stylesheet" href="css/main.css"> <script src="js/modernizr-2.6.2-respond-1.1.0.min.js"></script> </head> <body> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KH2BR6C" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <!--[if lt IE 7]> <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p> <![endif]--> <!-- Microdata for Condition --> <div itemscope itemtype="http://schema.org/Product"> <meta itemprop="name" content="Kids Mesh Therapy Pressure Vest - XS, Blue " /> <meta itemprop="mpn" content="B00GQDAUBE" /> <meta itemprop="brand" content="" /> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <meta itemprop="priceCurrency" content="USD" /> <meta itemprop="price" content="31.97" /> <link itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition"/> <link itemprop="availability" content="http://schema.org/InStock"/> </div> </div> <!-- Navigation & Logo--> <div class="mainmenu-wrapper"> <div class="container"> <div class="menuextras"> <div class="extras"> <ul> <li class="shopping-cart-items"><i class="glyphicon glyphicon-shopping-cart icon-white"></i> <a id="buylink" href="http://secure.householditemshealthyliving.com/cgi-bin/UCEditor?merchantId=WCP">View Cart</a></li> </ul> </div> </div> <nav id="mainmenu" class="mainmenu"> <ul> <li class="logo-wrapper"><a href="index.html"><img src="img/healthy-logo.png" height="auto" width="200px" alt="Household Items Healthy Living"></a></li> <li> <a href="index.html">Home</a> </li> <li> <a href="product-page1.html">Products</a> </li> </ul> </nav> </div> </div> <!-- Page Title --> <div class="section section-breadcrumbs"> <div class="container"> <div class="row"> <div class="col-md-12"> <h1>Product Details</h1> </div> </div> </div> </div> <div class="section"> <div class="container"> <div class="row"> <!-- Product Image & Available Colors --> <div class="col-sm-6"> <div class="product-image-large"> <img src="img/51lpcDvIERL.jpg" alt="Kids Mesh Therapy Pressure Vest - XS, Blue "> </div> </div> <!-- End Product Image & Available Colors --> <!-- Product Summary & Options --> <div class="col-sm-6 product-details"> <h4>Kids Mesh Therapy Pressure Vest - XS, Blue</h4> <div class="price"> $31.97 </div> <h5>Quick Overview</h5> <p>Let your child breathe easy with this comfortable deep pressure vest! Our Pressure Mesh Vest gives the same great 'hug' as our Weighted Compression Vest, but without the added weight. Ideal for children with autism or sensory integration challenges, the pressure vests help to filter information and process an overload of sensory information.</p> <p>Simply adjust the hook and loop closures to apply firm pressure across the shoulders and trunk. The pressure vest for children can be worn all day, though it's recommended for intervals of 20 minutes while taking a test, eating dinner, doing homework, and other activities where sensory input is helpful.</p> <p>Wear in school, at home, in the clinic or on the road. Adult supervision recommended. Machine wash cold, line dry.</p> <table class="shop-item-selections"> <!-- Quantity --> <tr> <td><b>Quantity:</b></td> <td> <input type="text" class="form-control input-sm input-micro" value="1"> </td> </tr> <!-- Add to Cart Button --> <tr> <td>&nbsp;</td> <td> <a id="buylink" href="http://secure.householditemshealthyliving.com/cgi-bin/UCEditor?merchantId=WCP&ADD=MeshVest" class="btn btn"><i class="icon-shopping-cart icon-white"></i> Add to Cart</a> </td> </tr> </table> </div> <!-- End Product Summary & Options --> <!-- Full Description & Specification --> <div class="col-sm-12"> <div class="tabbable"> <!-- Tabs --> <ul class="nav nav-tabs product-details-nav"> <li class="active"><a href="#tab1" data-toggle="tab">Description</a></li> <li><a href="#tab2" data-toggle="tab">Specification</a></li> </ul> <!-- Tab Content (Full Description) --> <div class="tab-content product-detail-info"> <div class="tab-pane active" id="tab1"> <h4>Product Description</h4> <p> Customer Testimonial: "I love how the material is "breathable" so that he feels comfortable wearing this during the summer months. Also, the velcro closure allows for it to fit as snug as he needs it to be! Love this vest!!"-Elizabeth <ul> <li>Breathable mesh vest applies deep pressure</li> <li>Provides calming benefits for a sensory diet.</li> <li>Helps children filter sensory information and stay calm and focused</li> <li>Size: XS Chest: 19"-29.5" Length: 13"-14.5" Approx. Age: 4</li> </ul> </p> </div> <!-- Tab Content (Specification) --> <div class="tab-pane" id="tab2"> <table> <tr> <td>Shipping Weight: </td> <td>3.2 ounces</td> </tr> <tr> <td>Size: XS</td> <td>XS</td> </tr> <tr> <td>Chest:</td> <td> 19"-29.5"</td> </tr> <tr> <td>Age:</td> <td>4</td> </tr> <tr> <td>UPC:</td> <td>027829920821</td> </tr> </table> </div> </div> </div> </div> <!-- End Full Description & Specification --> </div> </div> </div> <!-- Footer --> <footer class="footer"> <div class="container"> <div class="row"> </div> <div class="col-footer col-md-3 col-xs-3"> <h3>About Us</h3> <p>Household Items Healthy Living offers items to help you live your life to the fullest whether it be handy household items or lifestyle improvement items.</p> </div> <div class="col-footer col-md-6 col-xs-6"> <h3>Our 7 Guarantees</h3> <table> <tr> <td><li><span>We'll beat other prices; email us.</span></li></td> <td><li><span>365-day return window. (<a href="return-policy.html">Return Policy</a>)</span></li></td> </tr> <tr> <td><li><span>Free USA shipping.</span></li></td> <td><li><span>Open bottles can be returned.</span></li></td> </tr> <tr> <td><li><span>Email response in 1 business day.</span></li></td> <td><li><span>Ships in 1 business day.</span></li></td> </tr> <tr> <td><li><span>We'll treat you like family.</span></li></td> </tr> </table> </div> <div class="col-footer col-md-3 col-xs-3" style="float: right;"> <h3>Contacts</h3> <p class="contact-us-details"> <b>Phone:</b> 1-888-881-2542<br/> <b>Email:</b> <a href="mailto:customercare@cuco.co">customercare@cuco.co</a> </p> </div> <div class="row"> <div class="col-md-12"> <div class="footer-copyright">&copy; 2017 Household Items Healthy Living. All rights reserved.</div> </div> </div> </div> </footer> <!-- Javascripts --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/jquery-1.9.1.min.js"><\/script>')</script> <script src="js/bootstrap.min.js"></script> <script src="http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.js"></script> <script src="js/jquery.fitvids.js"></script> <script src="js/jquery.sequence-min.js"></script> <script src="js/jquery.bxslider.js"></script> <script src="js/main-menu.js"></script> <script src="js/template.js"></script> </body> </html>
{ "content_hash": "07b09af990523818429371d2110f97cd", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 588, "avg_line_length": 46.91119691119691, "alnum_prop": 0.5423045267489712, "repo_name": "aliciamorrow/healthyliving", "id": "3cc912492c8b7d62290b6762604aa2376b4a077f", "size": "12150", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "product24.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "506385" }, { "name": "HTML", "bytes": "1204400" }, { "name": "JavaScript", "bytes": "122411" } ], "symlink_target": "" }
namespace proximity_auth { class ProximityAuthUIDelegate; // Implementation of CryptAuthEnrollerFactory with dependencies on Chrome. // TODO(tengs): Move this class out of the webui directory when we are ready to // do enrollments in Chrome. class CryptAuthEnrollerFactoryImpl : public CryptAuthEnrollerFactory { public: explicit CryptAuthEnrollerFactoryImpl(ProximityAuthUIDelegate* delegate); ~CryptAuthEnrollerFactoryImpl() override; // CryptAuthEnrollerFactory: scoped_ptr<CryptAuthEnroller> CreateInstance() override; private: // |delegate_| is not owned and must outlive this instance. ProximityAuthUIDelegate* const delegate_; DISALLOW_COPY_AND_ASSIGN(CryptAuthEnrollerFactoryImpl); }; } // namespace proximity_auth #endif // COMPONENTS_PROXIMITY_AUTH_WEBUI_CRYPTAUTH_ENROLLER_FACTORY_IMPL_H
{ "content_hash": "0a5b644e9fd9409f5db4b9c8163a35a1", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 79, "avg_line_length": 32.96, "alnum_prop": 0.7997572815533981, "repo_name": "Just-D/chromium-1", "id": "5ab9bf2bbd41811441e9f3ce829094842bca5e65", "size": "1244", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "components/proximity_auth/webui/cryptauth_enroller_factory_impl.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "37073" }, { "name": "Batchfile", "bytes": "8451" }, { "name": "C", "bytes": "9517927" }, { "name": "C++", "bytes": "244067615" }, { "name": "CSS", "bytes": "944025" }, { "name": "DM", "bytes": "60" }, { "name": "Groff", "bytes": "2494" }, { "name": "HTML", "bytes": "27307576" }, { "name": "Java", "bytes": "14757472" }, { "name": "JavaScript", "bytes": "20666212" }, { "name": "Makefile", "bytes": "70864" }, { "name": "Objective-C", "bytes": "1772355" }, { "name": "Objective-C++", "bytes": "10088862" }, { "name": "PHP", "bytes": "97817" }, { "name": "PLpgSQL", "bytes": "178732" }, { "name": "Perl", "bytes": "63937" }, { "name": "Protocol Buffer", "bytes": "485040" }, { "name": "Python", "bytes": "8652947" }, { "name": "Shell", "bytes": "481276" }, { "name": "Standard ML", "bytes": "5106" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "18347" } ], "symlink_target": "" }
<script src="<?php echo $this->path_theme_file; ?>assets/js/list_user.js"></script>
{ "content_hash": "040b5d8e1f2b0962c537bb562d9bc132", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 83, "avg_line_length": 83, "alnum_prop": 0.6867469879518072, "repo_name": "doanhvt/upload500", "id": "6cfefafb93fa5fd6c1aaa6a20b2315a27fa365af", "size": "83", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "application/views/default/list_user/header.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "421" }, { "name": "CSS", "bytes": "40979" }, { "name": "HTML", "bytes": "8227026" }, { "name": "JavaScript", "bytes": "96558" }, { "name": "PHP", "bytes": "1971143" }, { "name": "Shell", "bytes": "2419" } ], "symlink_target": "" }
<?php /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ declare(strict_types = 1); namespace Google\Web_Stories\Interfaces; /** * Interface Migration */ interface Migration { /** * Migrate * * @since 1.7.0 */ public function migrate(): void; }
{ "content_hash": "8b3fadf7aa3863e7f8f48e788e4aa408", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 75, "avg_line_length": 23.085714285714285, "alnum_prop": 0.7079207920792079, "repo_name": "GoogleForCreators/web-stories-wp", "id": "2f406b0dedd7bb156453083b7d4f2014083e8135", "size": "1018", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "includes/Interfaces/Migration.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "45312" }, { "name": "HTML", "bytes": "81613" }, { "name": "JavaScript", "bytes": "9026703" }, { "name": "PHP", "bytes": "1840505" }, { "name": "Shell", "bytes": "28629" }, { "name": "TypeScript", "bytes": "3393384" } ], "symlink_target": "" }
<?php require_once 'connection.php'; class search { public function get_search() { $sql = "SELECT * FROM save_history"; $db = new connection2(); $result = $db->query($sql); return $result; } } ?>
{ "content_hash": "2d8a1aa9bee517b7c08564c9f3c511c7", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 44, "avg_line_length": 16.1875, "alnum_prop": 0.4980694980694981, "repo_name": "aravindaw/multi-view", "id": "951d561a9c31edfeb9634fb9344b710e53c46427", "size": "259", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/search_tab/model/searches.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1661175" }, { "name": "HTML", "bytes": "417301" }, { "name": "Hack", "bytes": "2346" }, { "name": "JavaScript", "bytes": "1886547" }, { "name": "Less", "bytes": "227561" }, { "name": "PHP", "bytes": "9023049" }, { "name": "Python", "bytes": "5734" }, { "name": "SCSS", "bytes": "17115" }, { "name": "Shell", "bytes": "350" } ], "symlink_target": "" }
package com.xtremelabs.robolectric.shadows; import android.app.Application; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import com.xtremelabs.robolectric.tester.android.content.TestSharedPreferences; import com.xtremelabs.robolectric.internal.Implementation; import com.xtremelabs.robolectric.internal.Implements; import static com.xtremelabs.robolectric.Robolectric.shadowOf; /** * Shadow for {@code PreferenceManager} that returns instances of the {@link com.xtremelabs.robolectric.tester.android.content.TestSharedPreferences} utility class */ @Implements(PreferenceManager.class) public class ShadowPreferenceManager { @Implementation public static SharedPreferences getDefaultSharedPreferences(Context context) { ShadowApplication shadowApplication = shadowOf((Application) context.getApplicationContext()); return new TestSharedPreferences(shadowApplication.getSharedPreferenceMap(), "__default__", Context.MODE_PRIVATE); } }
{ "content_hash": "13983392b3d5830b6557335adc4d4c38", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 163, "avg_line_length": 41.68, "alnum_prop": 0.8214971209213052, "repo_name": "yxm4109/robolectric", "id": "21e2aed03bad81c2009789ad8b6a02672d809533", "size": "1042", "binary": false, "copies": "20", "ref": "refs/heads/master", "path": "src/main/java/com/xtremelabs/robolectric/shadows/ShadowPreferenceManager.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "134" }, { "name": "HTML", "bytes": "2359" }, { "name": "Java", "bytes": "1528845" }, { "name": "Ruby", "bytes": "1629" }, { "name": "Shell", "bytes": "367" } ], "symlink_target": "" }
Rails.application.routes.draw do Event::Initializer concern :deletion do get :delete, on: :member delete :destroy_all, on: :collection, path: '' end concern :crud do get :move, on: :member put :move, on: :member get :copy, on: :member put :copy, on: :member end concern :download do get :download, on: :collection end concern :import do get :import, on: :collection post :import, on: :collection get :download_logs, on: :collection end concern :ical_refresh do get :ical_refresh, on: :collection post :ical_refresh, on: :collection end concern :command do get :command, on: :member post :command, on: :member end concern :contains_urls do get :contains_urls, on: :member end concern :tag do post :tag, action: :set_tag_all, on: :collection delete :tag, action: :reset_tag_all, on: :collection end concern :michecker do get :michecker, on: :member post :michecker_start, on: :member get :michecker_result, on: :member end content "event" do get "/" => redirect { |p, req| "#{req.path}/pages" }, as: :main resources :pages, concerns: [:deletion, :crud, :download, :import, :ical_refresh, :command, :contains_urls, :tag, :michecker] resources :searches, only: [:index] end node "event" do get "page/(index.:format)" => "public#index", cell: "nodes/page" get "page/(:display.:format)" => "public#index", cell: "nodes/page", display: /[a-z]*/ get "page/:year:month/(:display.:format)" => "public#index", cell: "nodes/page", year: /\d{4}/, month: /\d{2}/, display: /[a-z]*/ get "page/:year:month:day/(index.:format)" => "public#daily", cell: "nodes/page", year: /\d{4}/, month: /\d{2}/, day: /\d{2}/ get "search/(index.:format)" => "public#index", cell: "nodes/search" end part "event" do get "calendar" => "public#index", cell: "parts/calendar" get "search" => "public#index", cell: "parts/search" end page "event" do get "page/:filename.:format" => "public#index", cell: "pages/page" get "search/(index.:format)" => "public#index", cell: "node/search" end namespace "event", path: ".s:site/event" do namespace "apis" do get "repeat_dates" => "repeat_dates#index" put "repeat_dates" => "repeat_dates#create" end end end
{ "content_hash": "88cff539f54ecbf212c0b614e1f8ef29", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 129, "avg_line_length": 27.952380952380953, "alnum_prop": 0.6192504258943782, "repo_name": "tany/ss", "id": "5f7660e695d8dccc819ea1959f1adf4958d8c955", "size": "2348", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/routes/event/routes.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "86617" }, { "name": "HTML", "bytes": "2954705" }, { "name": "JavaScript", "bytes": "5619171" }, { "name": "Ruby", "bytes": "10054601" }, { "name": "SCSS", "bytes": "481390" }, { "name": "Shell", "bytes": "21408" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace TestSpaApp.Models { // Models returned by MeController actions. public class GetViewModel { public string Hometown { get; set; } } }
{ "content_hash": "58dd2fc5798d6d3253c54ac20a3b4c98", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 47, "avg_line_length": 21.75, "alnum_prop": 0.7241379310344828, "repo_name": "idoychinov/Telerik_Academy_Homework", "id": "1757978af1e31ff2203845c4165de6a680b6013b", "size": "263", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ASP.NETWeb Forms/1.IntroductionToAspNet/WebApps/TestSpaApp/Models/MeViewModels.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "224148" }, { "name": "C#", "bytes": "3952663" }, { "name": "CSS", "bytes": "3475942" }, { "name": "CoffeeScript", "bytes": "4453" }, { "name": "JavaScript", "bytes": "8996873" }, { "name": "Pascal", "bytes": "14823" }, { "name": "PowerShell", "bytes": "1717649" }, { "name": "Puppet", "bytes": "404631" }, { "name": "Shell", "bytes": "315" }, { "name": "TypeScript", "bytes": "11219" }, { "name": "XSLT", "bytes": "2081" } ], "symlink_target": "" }
package cast import ( "fmt" "errors" ) func libError( msg string ) error { return errors.New( "mingle/cast: " + msg ) } func libErrorf( tmpl string, argv ...interface{} ) error { return fmt.Errorf( "mingle/cast: " + tmpl, argv... ) }
{ "content_hash": "b2649b0308024ed3500c922c093a8945", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 58, "avg_line_length": 18.071428571428573, "alnum_prop": 0.6086956521739131, "repo_name": "bitgirder/bitgirder-main", "id": "740a7be2224befa6d5e2b39fa86520b8e1768ae0", "size": "253", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mingle-cast/go/lib/mingle/cast/errorf.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "1182953" }, { "name": "Java", "bytes": "1608793" }, { "name": "JavaScript", "bytes": "11638" }, { "name": "Ruby", "bytes": "342315" } ], "symlink_target": "" }
<!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="utf-8"/> <title>WallRide</title> </head> <body> <script th:fragment="setting(selector)" th:inline="javascript"> /*<![CDATA[*/ $(function () { var ms = [ { name: 'Image', value:'<div class="col-sm-12"><img class="img-responsive" src="../../resources/img/sample.jpg" alt="" /></div><br/>' }, { name: 'Title+Content', value:'<h2>Lorem ipsum dolor</h2><p>Lorem ipsum dolor sit amet, vis affert mollis maiestatis no, at iusto rationibus eum, cu vix malis graeci sententiae. Adhuc tamquam et nec. Diam viderer feugiat ut nam, quo te consul scriptorem intellegebat. Diam audiam voluptua eam id. Te eos illum putant voluptatum.</p><br/>' }, { name: 'Image:Text', value:'<div class="row"><div class="col-sm-6"><img src="../../resources/img/sample.jpg" /></div><div class="col-sm-6"><p>Lorem ipsum dolor sit amet, vis affert mollis maiestatis no, at iusto rationibus eum, cu vix malis graeci sententiae. Adhuc tamquam et nec. Diam viderer feugiat ut nam, quo te consul scriptorem intellegebat. Diam audiam voluptua eam id. Te eos illum putant voluptatum.</p></div><br/>' }, { name: 'Image x 2', value: '<div class="row"><div class="col-sm-6"><img src="../../resources/img/sample.jpg" /></div><div class="col-sm-6"><img src="../../resources/img/sample.jpg" /></div></div><br/>' }, { name: 'Column x 3', value: '<div class="row"><div class="col-sm-4"><img src="../../resources/img/sample.jpg" /></div><div class="col-sm-4"><img src="../../resources/img/sample.jpg" /></div><div class="col-sm-4"><p>Lorem ipsum dolor sit amet, vis affert mollis maiestatis no, at iusto rationibus eum, cu vix malis graeci sententiae. Adhuc tamquam et nec. Diam viderer feugiat ut nam, quo te consul scriptorem intellegebat. Diam audiam voluptua eam id. Te eos illum putant voluptatum.</p></div></div><br/>' }, ]; var $contents = []; $.each(ms, function(i, m){ var values = {name: m.name, value: i}; $contents.push(values); }); var commandName = 'placeholders', iconName = commandName + 'Icon', buildListItem = function (name, value) { // Depending on prior validation, escaping may be needed here. return '<li><a class="fr-command" data-cmd="' + commandName + '" data-param1="' + value + '" title="' + name + '">' + name + '</a></li>'; }; // Define a global icon (any Font Awesome icon). $.FroalaEditor.DefineIcon(iconName, { NAME: 'plus' }); // Define a global dropdown button for the Froala WYSIWYG HTML editor. $.FroalaEditor.RegisterCommand(commandName, { title: 'レイアウト', type: 'dropdown', icon: iconName, options: {}, undo: true, focus: true, refreshAfterCallback: true, callback: function (cmd, val, params) { var editorInstance = this; editorInstance.html.insert(ms[val].value); }, refreshOnShow: function ($btn, $dropdown) { var editorInstance = this, list = $dropdown.find('ul.fr-dropdown-list'), listItems = '', placeholders = $contents; // access custom function added to froalaOptions on instance $.each(placeholders, function (i, placeholder) { listItems += buildListItem(placeholder.name, placeholder.value); }); list.empty().append(listItems); if (!editorInstance.selection.inEditor()) { // Move cursor position to end. editorInstance.selection.setAtEnd(editorInstance.$el.get(0)); editorInstance.selection.restore(); } } }); var selector = /*[[${selector}]]*/ '#'; $(selector).froalaEditor({ toolbarButtons: ['paragraphFormat', 'placeholders', 'bold', 'underline', 'formatUL', 'color', 'align', 'quote', 'insertLink', 'insertImage', 'insertFile', 'insertTable', 'undo', 'redo', 'html', 'fullscreen'], heightMin: 300, imageDefaultWidth: 0, imageDefaultAlign: 'left', imageUploadURL: /*[[@{~__${ADMIN_PATH}__/media/create.json}]]*/ '#', imageManagerLoadURL: /*[[@{~__${ADMIN_PATH}__/media/index.json}]]*/ '#', fileUploadURL: /*[[@{~__${ADMIN_PATH}__/media/create.json}]]*/ '#' }); }); /*]]>*/ </script> </body> </html>
{ "content_hash": "b4eb6bd2981862f8210c7c4e8dba1c48", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 490, "avg_line_length": 41.74038461538461, "alnum_prop": 0.612992398064962, "repo_name": "bevrard/wlr_gamedella", "id": "bcc9d2e70d119f6a7e15e52dd7002f62bf75e735", "size": "4353", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wallride-core/src/main/resources/templates/admin/froala.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "417401" }, { "name": "HTML", "bytes": "1034064" }, { "name": "Java", "bytes": "1134872" }, { "name": "JavaScript", "bytes": "2717790" }, { "name": "PHP", "bytes": "45732" }, { "name": "Shell", "bytes": "1345" } ], "symlink_target": "" }
{% extends "index.html" %} {% block head %} <meta name="description" content="Ein Tool zum einfachen wechseln des aktiven Wiedergabegerätes." /> <meta name="keywords" content="Tool Standard Wiedergabegerät Ändern Windows Vista 7 8 8.1" /> <link rel="alternate" hreflang="en" href="/en" /> {% endblock %} {% block heading %} <h1 class="wb-stl-heading1">Wiedergabegerät ändern mit <u>nur einem</u> Klick.</h1> {% endblock %} {% block content %} <h5 class="wb-stl-subtitle"> Ich habe ein USB-Headset. Windows schaltet die Soundausgabe auf Kopfhörer wenn man ein klassisches Headset (mit Klinke) einsteckt. Doch bei einem USB-Headset muss man das Lautsprecher-Icon im Tray rechtsklicken und dann über Wiedergabegeräte -&gt; Headset -&gt; OK gehen. Das sind 4 clicks und diverse Mausbewegungen. <br /><br />Mit ADSwitch geht's einfacher. Es fügt ein neues Icon in den Tray hinzu. Angeklickt schaltet es das aktuelle Wiedergabegerät stumm. Bei Doppelklick schaltet es auf das nächste freie Wiedergabegerät. Bei Rechtsklick öffnet sich das Kontext-Menü. <br /><br />ADSwitch is kostenlos und steht unter der <a href="http://opensource.org/licenses/MIT" target="_blank">MIT Lizenz</a>. <br /><br />Danke an Dave Amenta für das Bereitstellen der <a href="http://www.daveamenta.com/2011-05/programmatically-or-command-line-change-the-default-sound-playback-device-in-windows-7/" target="_blank">low level API</a>. </h5> {% endblock %} {% block download %} <span>Herunterladen</span> {% endblock %} {% block sourcecode %} <span>Quelltext</span> {% endblock %} {% block compatibility %} <p class="wb-stl-normal" style="text-align: right;">Läuft unter Windows Vista, Windows 7 und Windows 8.1. Wurde nicht mit Windows 10 getestet.</p> {% endblock %}
{ "content_hash": "b2c9e1d2964365f28c2faea9eafb4054", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 318, "avg_line_length": 54.5625, "alnum_prop": 0.736540664375716, "repo_name": "holli-holzer/adswitch", "id": "d27504529ba5b3350653670f4ca2ba7ed702ac20", "size": "1762", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Website/appspot/templates/index_de.html", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "7150" }, { "name": "CSS", "bytes": "7997" }, { "name": "HTML", "bytes": "6948" }, { "name": "Inno Setup", "bytes": "2750" }, { "name": "JavaScript", "bytes": "2087" }, { "name": "Perl", "bytes": "4745" }, { "name": "Python", "bytes": "940" }, { "name": "Shell", "bytes": "298" }, { "name": "Visual Basic", "bytes": "39712" } ], "symlink_target": "" }
#ifndef INCLUDE_LEARN_ALREGRESSOR_H #define INCLUDE_LEARN_ALREGRESSOR_H #include "core/ALARStructure.h" #include "ALISuperviseLearner.h" /*TODO Support other type*/ class ALRegressor:public ALISuperviseLearner { public: friend class ALNetRegressor; ALRegressor(){} virtual ~ALRegressor(){} virtual ALIMatrixPredictor* vLearn(const ALFloatMatrix* X, const ALFloatMatrix* Y) const override; private: ALSp<ALFloatMatrix> getMatrix(ALIMatrixPredictor* p); ALIMatrixPredictor* _regressMulti(const ALFloatMatrix* X, const ALFloatMatrix* YT) const; }; #endif
{ "content_hash": "cee9fa0ec855de005dc36e84163fd2e6", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 102, "avg_line_length": 33.88235294117647, "alnum_prop": 0.7743055555555556, "repo_name": "jxt1234/Abstract_Learning", "id": "324fd03297bb0c8154f2f213940a7f28c6a8dc7d", "size": "576", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/learn/ALRegressor.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "40662" }, { "name": "C++", "bytes": "547112" }, { "name": "CMake", "bytes": "3387" }, { "name": "Makefile", "bytes": "1331" }, { "name": "Python", "bytes": "6460" } ], "symlink_target": "" }
YUI.add('slider-base', function (Y, NAME) { /** * Create a sliding value range input visualized as a draggable thumb on a * background element. * * @module slider * @submodule slider-base */ var INVALID_VALUE = Y.Attribute.INVALID_VALUE; /** * Create a slider to represent an input control capable of representing a * series of intermediate states based on the position of the slider's thumb. * These states are typically aligned to a value algorithm whereby the thumb * position corresponds to a given value. Sliders may be oriented vertically or * horizontally, based on the <code>axis</code> configuration. * * @class SliderBase * @extends Widget * @param config {Object} Configuration object * @constructor */ function SliderBase() { SliderBase.superclass.constructor.apply( this, arguments ); } Y.SliderBase = Y.extend( SliderBase, Y.Widget, { // Y.Slider prototype /** * Construction logic executed during Slider instantiation. * * @method initializer * @protected */ initializer : function () { /** * The configured axis, stored for fast lookup since it's a writeOnce * attribute. This is for use by extension classes. For * implementation code, use <code>get( &quot;axis&quot; )</code> for * authoritative source. Never write to this property. * * @property axis * @type {String} * @protected */ this.axis = this.get( 'axis' ); /** * Cached fast access map for DOM properties and attributes that * pertain to accessing dimensional or positioning information * according to the Slider's axis (e.g. &quot;height&quot; vs. * &quot;width&quot;). Extension classes should add to this collection * for axis related strings if necessary. * * @property _key * @type {Object} * @protected */ this._key = { dim : ( this.axis === 'y' ) ? 'height' : 'width', minEdge: ( this.axis === 'y' ) ? 'top' : 'left', maxEdge: ( this.axis === 'y' ) ? 'bottom' : 'right', xyIndex: ( this.axis === 'y' ) ? 1 : 0 }; /** * Signals that the thumb has moved. Payload includes the thumb's * pixel offset from the top/left edge of the rail, and if triggered by * dragging the thumb, the <code>drag:drag</code> event. * * @event thumbMove * @param event {Event} The event object for the thumbMove with the * following extra properties: * <dl> * <dt>offset</dt> * <dd>Pixel offset from top/left of the slider to the new * thumb position</dd> * <dt>ddEvent (deprecated)</dt> * <dd><code>drag:drag</code> event from the thumb</dd> * <dt>originEvent</dt> * <dd><code>drag:drag</code> event from the thumb</dd> * </dl> */ this.publish( 'thumbMove', { defaultFn: this._defThumbMoveFn, queuable : true } ); }, /** * Create the DOM structure for the Slider. * * @method renderUI * @protected */ renderUI : function () { var contentBox = this.get( 'contentBox' ); /** * The Node instance of the Slider's rail element. Do not write to * this property. * * @property rail * @type {Node} */ this.rail = this.renderRail(); this._uiSetRailLength( this.get( 'length' ) ); /** * The Node instance of the Slider's thumb element. Do not write to * this property. * * @property thumb * @type {Node} */ this.thumb = this.renderThumb(); this.rail.appendChild( this.thumb ); // @TODO: insert( contentBox, 'replace' ) or setHTML? contentBox.appendChild( this.rail ); // <span class="yui3-slider-x"> contentBox.addClass( this.getClassName( this.axis ) ); }, /** * Creates the Slider rail DOM subtree for insertion into the Slider's * <code>contentBox</code>. Override this method if you want to provide * the rail element (presumably from existing markup). * * @method renderRail * @return {Node} the rail node subtree */ renderRail: function () { var minCapClass = this.getClassName( 'rail', 'cap', this._key.minEdge ), maxCapClass = this.getClassName( 'rail', 'cap', this._key.maxEdge ); return Y.Node.create( Y.Lang.sub( this.RAIL_TEMPLATE, { railClass : this.getClassName( 'rail' ), railMinCapClass: minCapClass, railMaxCapClass: maxCapClass } ) ); }, /** * Sets the rail length according to the <code>length</code> attribute. * * @method _uiSetRailLength * @param length {String} the length to apply to the rail style * @protected */ _uiSetRailLength: function ( length ) { this.rail.setStyle( this._key.dim, length ); }, /** * Creates the Slider thumb DOM subtree for insertion into the Slider's * rail. Override this method if you want to provide the thumb element * (presumably from existing markup). * * @method renderThumb * @return {Node} the thumb node subtree */ renderThumb: function () { this._initThumbUrl(); var imageUrl = this.get( 'thumbUrl' ); return Y.Node.create( Y.Lang.sub( this.THUMB_TEMPLATE, { thumbClass : this.getClassName( 'thumb' ), thumbShadowClass: this.getClassName( 'thumb', 'shadow' ), thumbImageClass : this.getClassName( 'thumb', 'image' ), thumbShadowUrl : imageUrl, thumbImageUrl : imageUrl, thumbAriaLabelId: this.getClassName( 'label', Y.guid()) // get unique id for specifying a label for ARIA } ) ); }, /** * Gives focus to the thumb enabling keyboard access after clicking thumb * * @method _onThumbClick * @protected */ _onThumbClick : function(e){ this.thumb.focus(); }, /** * Creates the Y.DD.Drag instance used to handle the thumb movement and * binds Slider interaction to the configured value model. * * @method bindUI * @protected */ bindUI : function () { // Begin keyboard listeners /////////////////////////////// var boundingBox = this.get("boundingBox"), //Y.one('body'), // Looking for a key event which will fire continously across browsers while the key is held down. keyEvent = (!Y.UA.opera) ? "down:" : "press:", // 38, 40 = arrow up/down, 33, 34 = page up/down, 35 , 36 = end/home keyEventSpec = keyEvent + "38,40,33,34,35,36", // 37 , 39 = arrow left/right keyLeftRightSpec = keyEvent + "37,39", // 37 , 39 = arrow left/right + meta (command/apple key) for mac keyLeftRightSpecMeta = keyEvent + "37+meta,39+meta"; boundingBox.on("key", this._onDirectionKey, keyEventSpec, this); boundingBox.on("key", this._onLeftRightKey, keyLeftRightSpec, this); boundingBox.on("key", this._onLeftRightKeyMeta, keyLeftRightSpecMeta, this); // End keyboard listeners ////////////////////////////////// this.thumb.on('click', this._onThumbClick, this); this._bindThumbDD(); this._bindValueLogic(); this.after( 'disabledChange', this._afterDisabledChange ); this.after( 'lengthChange', this._afterLengthChange ); }, /** * increments Slider value by a minor increment * * @method _incrMinor * @protected */ _incrMinor : function(){ this.set('value', (this.get('value') + this.get('minorStep'))); }, /** * decrements Slider value by a minor increment * * @method _decrMinor * @protected */ _decrMinor : function(){ this.set('value', (this.get('value') - this.get('minorStep'))); }, /** * increments Slider value by a major increment * * @method _incrMajor * @protected */ _incrMajor : function(){ this.set('value', (this.get('value') + this.get('majorStep'))); }, /** * decrements Slider value by a major increment * * @method _decrMajor * @protected */ _decrMajor : function(){ this.set('value', (this.get('value') - this.get('majorStep'))); }, /** * sets the Slider value to the min value. * * @method _setToMin * @protected */ _setToMin : function(e){ this.set('value', this.get('min')); }, /** * sets the Slider value to the max value. * * @method _setToMax * @protected */ _setToMax : function(e){ this.set('value', this.get('max')); }, /** * sets the Slider's value in response to key events. * Left and right keys are in a separate method * in case an implementation wants to increment values * but needs left and right arrow keys for other purposes. * * @method _onDirectionKey * @param e {Event} the key event * @protected */ _onDirectionKey : function(e) { e.preventDefault(); if(this.get('disabled') === false){ switch (e.charCode) { case 38: // up this._incrMinor(); break; case 40: // down this._decrMinor(); break; case 36: // home this._setToMin(); break; case 35: // end this._setToMax(); break; case 33: // page up this._incrMajor(); break; case 34: // page down this._decrMajor(); break; } } }, /** * sets the Slider's value in response to left or right key events * * @method _onLeftRightKey * @param e {Event} the key event * @protected */ _onLeftRightKey : function(e) { e.preventDefault(); if(this.get('disabled') === false){ switch (e.charCode) { case 37: // left this._decrMinor(); break; case 39: // right this._incrMinor(); break; } } }, /** * sets the Slider's value in response to left or right key events when a meta (mac command/apple) key is also pressed * * @method _onLeftRightKeyMeta * @param e {Event} the key event * @protected */ _onLeftRightKeyMeta : function(e) { e.preventDefault(); if(this.get('disabled') === false){ switch (e.charCode) { case 37: // left + meta this._setToMin(); break; case 39: // right + meta this._setToMax(); break; } } }, /** * Makes the thumb draggable and constrains it to the rail. * * @method _bindThumbDD * @protected */ _bindThumbDD: function () { var config = { constrain: this.rail }; // { constrain: rail, stickX: true } config[ 'stick' + this.axis.toUpperCase() ] = true; /** * The DD.Drag instance linked to the thumb node. * * @property _dd * @type {DD.Drag} * @protected */ this._dd = new Y.DD.Drag( { node : this.thumb, bubble : false, on : { 'drag:start': Y.bind( this._onDragStart, this ) }, after : { 'drag:drag': Y.bind( this._afterDrag, this ), 'drag:end' : Y.bind( this._afterDragEnd, this ) } } ); // Constrain the thumb to the rail this._dd.plug( Y.Plugin.DDConstrained, config ); }, /** * Stub implementation. Override this (presumably in a class extension) to * initialize any value logic that depends on the presence of the Drag * instance. * * @method _bindValueLogic * @protected */ _bindValueLogic: function () {}, /** * Moves the thumb to pixel offset position along the rail. * * @method _uiMoveThumb * @param offset {Number} the pixel offset to set as left or top style * @param [options] {Object} Details to send with the `thumbMove` event * @protected */ _uiMoveThumb: function ( offset, options ) { if ( this.thumb ) { this.thumb.setStyle( this._key.minEdge, offset + 'px' ); options || (options = {}); options.offset = offset; this.fire( 'thumbMove', options ); } }, /** * Dispatches the <code>slideStart</code> event. * * @method _onDragStart * @param e {Event} the <code>drag:start</code> event from the thumb * @protected */ _onDragStart: function ( e ) { /** * Signals the beginning of a thumb drag operation. Payload includes * the thumb's drag:start event. * * @event slideStart * @param event {Event} The event object for the slideStart with the * following extra properties: * <dl> * <dt>ddEvent (deprecated)</dt> * <dd><code>drag:start</code> event from the thumb</dd> * <dt>originEvent</dt> * <dd><code>drag:start</code> event from the thumb</dd> * </dl> */ this.fire('slideStart', { ddEvent: e, // for backward compatibility originEvent: e }); }, /** * Dispatches the <code>thumbMove</code> event. * * @method _afterDrag * @param e {Event} the <code>drag:drag</code> event from the thumb * @protected */ _afterDrag: function ( e ) { var thumbXY = e.info.xy[ this._key.xyIndex ], railXY = e.target.con._regionCache[ this._key.minEdge ]; this.fire( 'thumbMove', { offset : (thumbXY - railXY), ddEvent: e, // for backward compatibility originEvent: e } ); }, /** * Dispatches the <code>slideEnd</code> event. * * @method _onDragEnd * @param e {Event} the <code>drag:end</code> event from the thumb * @protected */ _afterDragEnd: function ( e ) { /** * Signals the end of a thumb drag operation. Payload includes * the thumb's drag:end event. * * @event slideEnd * @param event {Event} The event object for the slideEnd with the * following extra properties: * <dl> * <dt>ddEvent (deprecated)</dt> * <dd><code>drag:end</code> event from the thumb</dd> * <dt>originEvent</dt> * <dd><code>drag:end</code> event from the thumb</dd> * </dl> */ this.fire('slideEnd', { ddEvent: e, originEvent: e }); }, /** * Locks or unlocks the thumb. * * @method _afterDisabledChange * @param e {Event} The disabledChange event object * @protected */ _afterDisabledChange: function ( e ) { this._dd.set( 'lock', e.newVal ); }, /** * Handles changes to the <code>length</code> attribute. By default, it * triggers an update to the UI. * * @method _afterLengthChange * @param e {Event} The lengthChange event object * @protected */ _afterLengthChange: function ( e ) { if ( this.get( 'rendered' ) ) { this._uiSetRailLength( e.newVal ); this.syncUI(); } }, /** * Synchronizes the DOM state with the attribute settings. * * @method syncUI */ syncUI : function () { this._dd.con.resetCache(); this._syncThumbPosition(); // Forces a reflow of the bounding box to address IE8 inline-block // container not expanding correctly. bug 2527905 //this.get('boundingBox').toggleClass(''); this.thumb.set('aria-valuemin', this.get('min')); this.thumb.set('aria-valuemax', this.get('max')); this._dd.set('lock', this.get('disabled')); }, /** * Stub implementation. Override this (presumably in a class extension) to * ensure the thumb is in the correct position according to the value * alogorithm. * instance. * * @method _syncThumbPosition * @protected */ _syncThumbPosition: function () {}, /** * Validates the axis is &quot;x&quot; or &quot;y&quot; (case insensitive). * Converts to lower case for storage. * * @method _setAxis * @param v {String} proposed value for the axis attribute * @return {String} lowercased first character of the input string * @protected */ _setAxis : function (v) { v = ( v + '' ).toLowerCase(); return ( v === 'x' || v === 'y' ) ? v : INVALID_VALUE; }, /** * <p>Ensures the stored length value is a string with a quantity and unit. * Unit will be defaulted to &quot;px&quot; if not included. Rejects * values less than or equal to 0 and those that don't at least start with * a number.</p> * * <p>Currently only pixel lengths are supported.</p> * * @method _setLength * @param v {String} proposed value for the length attribute * @return {String} the sanitized value * @protected */ _setLength: function ( v ) { v = ( v + '' ).toLowerCase(); var length = parseFloat( v, 10 ), units = v.replace( /[\d\.\-]/g, '' ) || this.DEF_UNIT; return length > 0 ? ( length + units ) : INVALID_VALUE; }, /** * <p>Defaults the thumbURL attribute according to the current skin, or * &quot;sam&quot; if none can be determined. Horizontal Sliders will have * their <code>thumbUrl</code> attribute set to</p> * <p><code>&quot;/<em>configured</em>/<em>yu</em>i/<em>builddi</em>r/slider-base/assets/skins/sam/thumb-x.png&quot;</code></p> * <p>And vertical thumbs will get</p> * <p><code>&quot;/<em>configured</em>/<em>yui</em>/<em>builddir</em>/slider-base/assets/skins/sam/thumb-y.png&quot;</code></p> * * @method _initThumbUrl * @protected */ _initThumbUrl: function () { if (!this.get('thumbUrl')) { var skin = this.getSkinName() || 'sam', base = Y.config.base; // Unfortunate hack to avoid requesting image resources from the // combo service. The combo service does not serve images. if (base.indexOf('http://yui.yahooapis.com/combo') === 0) { base = 'http://yui.yahooapis.com/' + Y.version + '/build/'; } // <img src="/path/to/build/slider-base/assets/skins/sam/thumb-x.png"> this.set('thumbUrl', base + 'slider-base/assets/skins/' + skin + '/thumb-' + this.axis + '.png'); } }, /** * Bounding box template that will contain the Slider's DOM subtree. &lt;span&gt;s are used to support inline-block styling. * * @property BOUNDING_TEMPLATE * @type {String} * @default &lt;span>&lt;/span> */ BOUNDING_TEMPLATE : '<span></span>', /** * Content box template that will contain the Slider's rail and thumb. * * @property CONTENT_TEMPLATE * @type {String} * @default &lt;span>&lt;/span> */ CONTENT_TEMPLATE : '<span></span>', /** * Rail template that will contain the end caps and the thumb. * {placeholder}s are used for template substitution at render time. * * @property RAIL_TEMPLATE * @type {String} * @default &lt;span class="{railClass}">&lt;span class="{railMinCapClass}">&lt;/span>&lt;span class="{railMaxCapClass}">&lt;/span>&lt;/span> */ RAIL_TEMPLATE : '<span class="{railClass}">' + '<span class="{railMinCapClass}"></span>' + '<span class="{railMaxCapClass}"></span>' + '</span>', /** * Thumb template that will contain the thumb image and shadow. &lt;img> * tags are used instead of background images to avoid a flicker bug in IE. * {placeholder}s are used for template substitution at render time. * * @property THUMB_TEMPLATE * @type {String} * @default &lt;span class="{thumbClass}" tabindex="-1">&lt;img src="{thumbShadowUrl}" alt="Slider thumb shadow" class="{thumbShadowClass}">&lt;img src="{thumbImageUrl}" alt="Slider thumb" class="{thumbImageClass}">&lt;/span> */ THUMB_TEMPLATE : '<span class="{thumbClass}" aria-labelledby="{thumbAriaLabelId}" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0">' + // keyboard access jeff tabindex="-1" '<img src="{thumbShadowUrl}" ' + 'alt="Slider thumb shadow" ' + 'class="{thumbShadowClass}">' + '<img src="{thumbImageUrl}" ' + 'alt="Slider thumb" ' + 'class="{thumbImageClass}">' + '</span>' }, { // Y.SliderBase static properties /** * The identity of the widget. * * @property NAME * @type String * @default 'sliderBase' * @readOnly * @protected * @static */ NAME : 'sliderBase', /** * Static property used to define the default attribute configuration of * the Widget. * * @property ATTRS * @type {Object} * @protected * @static */ ATTRS : { /** * Axis upon which the Slider's thumb moves. &quot;x&quot; for * horizontal, &quot;y&quot; for vertical. * * @attribute axis * @type {String} * @default &quot;x&quot; * @writeOnce */ axis : { value : 'x', writeOnce : true, setter : '_setAxis', lazyAdd : false }, /** * The length of the rail (exclusive of the end caps if positioned by * CSS). This corresponds to the movable range of the thumb. * * @attribute length * @type {String | Number} e.g. "200px" or 200 * @default 150px */ length: { value: '150px', setter: '_setLength' }, /** * Path to the thumb image. This will be used as both the thumb and * shadow as a sprite. Defaults at render() to thumb-x.png or * thumb-y.png in the skin directory of the current skin. * * @attribute thumbUrl * @type {String} * @default thumb-x.png or thumb-y.png in the sam skin directory of the * current build path for Slider */ thumbUrl: { value: null, validator: Y.Lang.isString } } }); }, '3.7.2', {"requires": ["widget", "dd-constrain", "event-key"], "skinnable": true});
{ "content_hash": "f1b1c8f4c46d41afab2431027c89ec0d", "timestamp": "", "source": "github", "line_count": 761, "max_line_length": 232, "avg_line_length": 31.507227332457294, "alnum_prop": 0.5289235517370814, "repo_name": "spadin/coverphoto", "id": "710f2b7097f3817196175db9ac9f90281531cf25", "size": "24116", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "node_modules/grunt-contrib/node_modules/grunt-contrib-yuidoc/node_modules/yuidocjs/node_modules/yui/slider-base/slider-base.js", "mode": "33188", "license": "mit", "language": [ { "name": "CoffeeScript", "bytes": "5206" }, { "name": "JavaScript", "bytes": "69266" } ], "symlink_target": "" }
// ================================================================================================= // ADOBE SYSTEMS INCORPORATED // Copyright 2006 Adobe Systems Incorporated // All Rights Reserved // // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms // of the Adobe license agreement accompanying it. // ================================================================================================= package com.adobe.xmp.impl; import java.io.ByteArrayOutputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import com.adobe.xmp.XMPException; import com.adobe.xmp.options.SerializeOptions; /** * Serializes the <code>XMPMeta</code>-object to an <code>OutputStream</code> according to the * <code>SerializeOptions</code>. * * @since 11.07.2006 */ public class XMPSerializerHelper { /** * Static method to serialize the metadata object. For each serialisation, a new XMPSerializer * instance is created, either XMPSerializerRDF or XMPSerializerPlain so thats its possible to * serialialize the same XMPMeta objects in two threads. * * @param xmp a metadata implementation object * @param out the output stream to serialize to * @param options serialization options, can be <code>null</code> for default. * @throws XMPException */ public static void serialize(XMPMetaImpl xmp, OutputStream out, SerializeOptions options) throws XMPException { options = options != null ? options : new SerializeOptions(); // sort the internal data model on demand if (options.getSort()) { xmp.sort(); } new XMPSerializerRDF().serialize(xmp, out, options); } /** * Serializes an <code>XMPMeta</code>-object as RDF into a string. * <em>Note:</em> Encoding is forced to UTF-16 when serializing to a * string to ensure the correctness of &quot;exact packet size&quot;. * * @param xmp a metadata implementation object * @param options Options to control the serialization (see * {@link SerializeOptions}). * @return Returns a string containing the serialized RDF. * @throws XMPException on serializsation errors. */ public static String serializeToString(XMPMetaImpl xmp, SerializeOptions options) throws XMPException { // forces the encoding to be UTF-16 to get the correct string length options = options != null ? options : new SerializeOptions(); options.setEncodeUTF16BE(true); ByteArrayOutputStream out = new ByteArrayOutputStream(2048); serialize(xmp, out, options); try { return out.toString(options.getEncoding()); } catch (UnsupportedEncodingException e) { // cannot happen as UTF-8/16LE/BE is required to be implemented in // Java return out.toString(); } } /** * Serializes an <code>XMPMeta</code>-object as RDF into a byte buffer. * * @param xmp a metadata implementation object * @param options Options to control the serialization (see {@link SerializeOptions}). * @return Returns a byte buffer containing the serialized RDF. * @throws XMPException on serializsation errors. */ public static byte[] serializeToBuffer(XMPMetaImpl xmp, SerializeOptions options) throws XMPException { ByteArrayOutputStream out = new ByteArrayOutputStream(2048); serialize(xmp, out, options); return out.toByteArray(); } }
{ "content_hash": "a2d146901449186ac395cc24da0d01ee", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 100, "avg_line_length": 32.88235294117647, "alnum_prop": 0.6887298747763864, "repo_name": "Afrouper/playgound", "id": "ba43f017cc4aca8cc7353168ed5ede7ef1ed0182", "size": "3354", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "eclipse/XMPCore/src/com/adobe/xmp/impl/XMPSerializerHelper.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1391" }, { "name": "HTML", "bytes": "1301393" }, { "name": "Java", "bytes": "513513" }, { "name": "JavaScript", "bytes": "4999" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <resources> <string name="default_notification_channel_name">Upravo svira</string> <string name="media3_controls_play_description">Reproduciraj</string> <string name="media3_controls_pause_description">Pauziraj</string> <string name="media3_controls_seek_to_previous_description">Idi na prethodnu stavku</string> <string name="media3_controls_seek_to_next_description">Idi na sljedeću stavku</string> <string name="media3_controls_seek_back_description">Skok unatrag</string> <string name="media3_controls_seek_forward_description">Skok prema naprijed</string> <string name="authentication_required">Potrebna je autentifikacija</string> </resources>
{ "content_hash": "7e86eb3ec2754b1c08d1824d92c5cd3e", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 94, "avg_line_length": 53.44, "alnum_prop": 0.7514970059880239, "repo_name": "androidx/media", "id": "3fa32acbfbb27c5735c4a7bf7d49783392656c42", "size": "1337", "binary": false, "copies": "1", "ref": "refs/heads/release", "path": "libraries/session/src/main/res/values-hr/strings.xml", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "AIDL", "bytes": "27206" }, { "name": "C++", "bytes": "112467" }, { "name": "CMake", "bytes": "3728" }, { "name": "GLSL", "bytes": "24923" }, { "name": "Java", "bytes": "17624240" }, { "name": "Makefile", "bytes": "11496" }, { "name": "Shell", "bytes": "24988" } ], "symlink_target": "" }
ConvertFrom-StringData @' IncorrectOperatingSystemVersionError = Windows Server 2008 R2 is not supported. Windows Server 2012 or later required. NetworkAdapterIsDomainJoinedWarning = Network adapter '{0}' location is joined to a domain cannot be managed. Remove or adjust the cNetworkProfile resource configuration. NetworkAdapterNotFoundWarning = Network adapter '{0}' was not found. Remove or adjust the cNetworkProfile resource configuration. FoundNetworkAdapterWithProfile = Found network adapter '{0}' with profile '{1}'. SettingNetworkAdapterProfile = Setting network adapter '{0}' to profile '{1}'. ResourceInDesiredState = Network adapter '{0}' is in the desired state. ResourceNotInDesiredState = Network adapter '{0}' is NOT in the desired state. '@
{ "content_hash": "676c8e3a37b3f449ce31dd9e95926236", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 174, "avg_line_length": 87.88888888888889, "alnum_prop": 0.7749683944374209, "repo_name": "iainbrighton/cNetworkProfile", "id": "db3d88ad6b7f59a80efc1150d70f541da103de7e", "size": "791", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DSCResources/cNetworkAdapterProfile/Resources.psd1", "mode": "33188", "license": "mit", "language": [ { "name": "PowerShell", "bytes": "10301" } ], "symlink_target": "" }
<?php /** * Created by IntelliJ IDEA. * User: luis * Date: 28/03/2016 * Time: 03:27 PM */ /** * Class clientes_clientes * @package Gym\Administracion\Gym_admin\modulos\clientes\clientes */ class clientes_clientes{ /** * MODULO REGISTRAR CLIENTES */ function registrar() { ?> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Instructores <small>Del sistema</small> </h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i>Inic&iacute;o</a></li>s </ol> </section> <!-- Main content --> <section class="content"> <!-- Default box --> <div class="box"> <div class="box-header with-border"> <center> <h3 class="box-title"><i class="fa fa-users fa-2x"></i>REGISTRO DE INSTRUCTORES</h3></center> <div class="box-tools pull-right"> <button class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse"><i class="fa fa-minus"></i></button> </div> </div> <div class="box-body"> <div class="box-body"> <div class="col-md-12"> <!-- general form elements --> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title"></h3> </div><!-- /.box-header --> <!-- form start --> <form id="signupForm1" class="form-horizontal" method="post" autocomplete="off" action="<?php echo createrUrl("instructores", "instructores", "regi_instructores"); ?>" > <div class="box-body"> <div class="col-xs-12"> <h2 class="page-header"> <i class="fa fa-user"></i><font><font>Datos Personales </h2> </div> <div class="col-lg-6 form-group"> <label class="col-sm-3 control-label" for="identificacion">Identificaci&oacute;n</label> <div class="col-xs-9"> <input type="text" class="form-control" id="identificacion" name="identificacion" placeholder="Identificaci&oacute;n" onkeypress="return soloNumeros(event)"> </div> </div> <div class="col-lg-6 form-group"> <label class="col-sm-3 control-label" for="nombre">Nombre</label> <div class="col-xs-9"> <input type="text" class="form-control" id="nombre" name="nombre" placeholder="Nombre Usuario" onkeypress="return soloLetras(event)"> </div> </div> <div class="col-lg-6 form-group"> <label class="col-sm-3 control-label" for="identificacion">Apellido</label> <div class="col-xs-9"> <input type="text" class="form-control" id="identificacion" name="identificacion" placeholder="Identificaci&oacute;n" onkeypress="return soloNumeros(event)"> </div> </div> <div class="col-lg-6 form-group"> <label class="col-sm-3 control-label" for="nombre">Direccion</label> <div class="col-xs-9"> <input type="text" class="form-control" id="nombre" name="nombre" placeholder="Nombre Usuario" onkeypress="return soloLetras(event)"> </div> </div> <div class="col-xs-12"> <h2 class="page-header"> <i class="fa fa-globe"></i><font><font>AdminLTE, Inc. </h2> </div> <div class="col-lg-6 form-group"> <label class="col-sm-3 control-label" for="identificacion">Identificaci&oacute;n</label> <div class="col-xs-9"> <input type="text" class="form-control" id="identificacion" name="identificacion" placeholder="Identificaci&oacute;n" onkeypress="return soloNumeros(event)"> </div> </div> <div class="col-lg-6 form-group" > <label class="col-sm-3 control-label" for="nombre">Nombre</label> <div class="col-xs-9"> <input type="text" class="form-control" id="nombre" name="nombre" placeholder="Nombre Usuario" onkeypress="return soloLetras(event)"> </div> </div> <div class="col-lg-6 form-group"> <label class="col-sm-3 control-label" for="identificacion">Identificaci&oacute;n</label> <div class="col-xs-9"> <input type="text" class="form-control" id="identificacion" name="identificacion" placeholder="Identificaci&oacute;n" onkeypress="return soloNumeros(event)"> </div> </div> <div class="col-lg-6 form-group"> <label class="col-sm-3 control-label" for="nombre">Nombre</label> <div class="col-xs-9"> <input type="text" class="form-control" id="nombre" name="nombre" placeholder="Nombre Usuario" onkeypress="return soloLetras(event)"> </div> </div> <!-- <div class="form-group">--> <!-- <label class="control-label col-sm-2" for="apellido">Apellido</label>--> <!-- <div class="col-sm-4">--> <!-- <input type="text" class="form-control" id="apellido" name="apellido" placeholder="Apellido Usuario" onkeypress="return soloLetras(event)">--> <!-- </div>--> <!-- </div>--> <!----> <!-- <div class="form-group">--> <!-- <label class="control-label col-sm-2" for="usuarioDireccion">Direcci&oacute;n</label>--> <!-- <div class="col-sm-4">--> <!-- <input type="text" class="form-control" id="direccion" name="direccion" placeholder="Direccion">--> <!-- </div>--> <!-- </div>--> <!-- --><?php // // $dias = array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado"); // $meses = array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"); // $fecha = date('d')." de ".$meses[date('n')-1]. " del ".date('Y') ; // ?> <!-- <div class="form-group">--> <!-- <label class="control-label col-sm-2" for="fecha">Fecha de Ingreso</label>--> <!-- <div class="col-sm-4">--> <!-- <input type="text" class="form-control" id="fechaingreso" name="fechaingreso" value="--><?php //echo $fecha?><!--" readonly="readonly">--> <!-- </div>--> <!-- </div>--> <!----> <!-- <div class="form-group">--> <!-- <label class="control-label col-sm-2" for="contrasena">Telefono</label>--> <!-- <div class="col-sm-4">--> <!-- <input type="tel" class="form-control" id="telefono" name="telefono" placeholder="Telefono">--> <!-- </div>--> <!-- </div>--> <!----> <!-- <div class="form-group">--> <!-- <label class="control-label col-sm-2" for="confirmar_contrasena">Salario</label>--> <!-- <div class="col-sm-4">--> <!-- <input type="text" name="salario" id="salario" class="form-control" onkeypress="return soloNumeros(event)" placeholder="$ Salario" pattern="[0-9]" maxlength="15">--> <!-- </div>--> <!-- </div>--> </div> </div><!-- /.box-body --> <div class="box-footer"> <button type="submit" class="btn btn-primary">Registrar</button> </div> </form> </div><!-- /.box --> </div><!--/.col (left) --> </div><!-- /.box-body --> <div class="box-footer"> Instructores </div><!-- /.box-footer--> </div><!-- /.box --> </section><!-- /.content --> </div><!-- /.content-wrapper --> <?php } /** *@funcion INSERTAR CLIENTES */ function regi_instructores() { /** @var TYPE_NAME $identificacion */ /** @var TYPE_NAME $nombre */ /** @var TYPE_NAME $apellido */ /** @var TYPE_NAME $salario */ /** @var TYPE_NAME $direccion */ /** @var TYPE_NAME $fecha */ /** @var TYPE_NAME $telefono */ $a = new Conexion(); $modulo="instructores"; $archivo="instructores"; $accion="listar"; date_default_timezone_set('America/Bogota'); $fecha = date('y-m-d'); extract($_POST); $datos = (" $identificacion,'$nombre','$apellido','$direccion','$telefono','$fecha',$salario "); $datos1 = ("Ins_Identificacion, Ins_Nombre, Ins_Apellido, Ins_Direccion, Ins_Telefono, Ins_Fecha_Registro, Ins_Salario, Ins_Estado"); echo $sql = ("insert into nic_instructores($datos1) values ($datos,1)"); $a->execute($sql); $a->mensaje_registro($modulo,$archivo,$accion); } /* *@funcion MODULOS LISTAR CLIENTES */ function listar(){ ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Instructores <small>Del sistema</small> </h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i>Inic&iacute;o</a></li>s </ol> </section> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-xs-12"> <div class="box"> <div class="box-header"> <h3 class="box-title">Instructores</h3> </div><!-- /.box-header --> <div class="box-body"> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th>#</th> <th>IDENTIFICACI&Oacute;N</th> <th>NOMBRE</th> <th>APELLIDO</th> <th>DIRECCION</th> <th>TELEFONO</th> <th>FECHA DE REGISTRO</th> <th>SALARIO</th> <th>ESTADO</th> <th>EDITAR</th> </tr> </thead> <tbody> <?php $a= new Conexion(); $sql=("select * from nic_instructores"); $resul=$a->execute1($sql); while($rows=mysqli_fetch_array($resul)) { ?> <tr> <td><?php echo $rows['Ins_Id']; ?></td> <td><?php echo $rows['Ins_Identificacion']; ?></td> <td><?php echo $rows['Ins_Nombre']; ?></td> <td><?php echo $rows['Ins_Apellido']; ?></td> <td><?php echo $rows['Ins_Direccion']; ?></td> <td><?php echo $rows['Ins_Telefono']; ?></td> <td><?php echo $rows['Ins_Fecha_Registro']; ?></td> <td><?php echo $rows['Ins_Salario']; ?></td> <td><?php if($rows['Ins_Estado'] == 1) { echo "<span class='label label-success'> <font class='h5'>Activo</font>"; }else { echo "<span class='label label-danger'> <font class='h5'>Inactivo</font>"; } ?> </td> <td><a class="glyphicon glyphicon-edit" href="<?php echo createrUrl("instructores", "instructores", "modificar"); ?>&Ins_Id=<?php echo $rows['Ins_Id']; ?>"></a></td> </tr> <?php } ?> </tbody> </table> </div><!-- /.box-body --> </div><!-- /.box --> </div><!-- /.col --> </div><!-- /.row --> </section><!-- /.content --> </div><!-- /.content-wrapper --> <?php } /* *@funcion MODULO MODIFICAR CLIENE */ function modificar() { $ins_id=$_GET['Ins_Id']; $a = new Conexion(); $sql=("select * from nic_instructores WHERE Ins_Id= $ins_id"); $resul=$a->execute1($sql); ?> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Usuarios <small>Del sistema</small> </h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i>Inic&iacute;o</a></li>s </ol> </section> <!-- Main content --> <section class="content"> <!-- Default box --> <div class="box"> <div class="box-header with-border"> <a class="glyphicon glyphicon-arrow-left" href="<?php echo createrUrl("instructores", "instructores", "listar"); ?>"></a> <center> <h3 class="box-title"><i class="fa fa-users fa-2x"></i>MODIFICAR USUARIOS</h3></center> <div class="box-tools pull-right"> <button class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse"><i class="fa fa-minus"></i></button> </div> </div> <div class="box-body"> <div class="box-body"> <div class="col-md-12"> <!-- general form elements --> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title"></h3> </div><!-- /.box-header --> <!-- form start --> <form name="ejemplo5" role="form" class="form-horizontal fv-form fv-form-bootstrap" method="post" autocomplete="off" action="<?php echo createrUrl("instructores", "instructores", "actualizar"); ?>" > <div class="box-body"> <?php while($row=mysqli_fetch_array($resul)) { $id=$row['Ins_Id'] ?> <div class="form-group"> <label class="control-label col-sm-2" for="usuarioIdentificacion">Identificaci&oacute;n</label> <div class="col-sm-4"> <input type="text" value="<?php echo $row['Ins_Identificacion']?>" class="form-control" id="identificacion" name="identificacion" placeholder="Identificaci&oacute;n" required="required" readonly="readonly"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="usuarioNombre">Nombre</label> <div class="col-sm-4"> <input type="text" value="<?php echo $row['Ins_Nombre']?>" class="form-control" id="nombre" name="nombre" placeholder="Nombre Usuario"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="usuarioApellido">Apellido</label> <div class="col-sm-4"> <input type="text" value="<?php echo $row['Ins_Apellido']?>" class="form-control" id="apellido" name="apellido" placeholder="Apellido Usuario"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="usuarioDireccion">Direcci&oacute;n</label> <div class="col-sm-4"> <input type="text" value="<?php echo $row['Ins_Direccion']?>" class="form-control" id="direccion" name="direccion" placeholder="Direccion"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="contrasena">Telefono</label> <div class="col-sm-4"> <input type="tel" class="form-control" id="telefono" name="telefono" placeholder="Telefono" value="<?php echo $row['Ins_Telefono']?>"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="confirmar_contrasena">Salario</label> <div class="col-sm-4"> <input type="text" name="salario" id="salario" class="form-control" onkeypress="return soloNumeros(event)" placeholder="$ Salario" value="<?php echo $row['Ins_Salario']?>"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="usuarioEstado">Cambiar Estado</label> <div class="col-sm-4"> <?php if ($row['Ins_Estado']==1 ) { ?> <div class="input-group has-success"> <div class="input-group-btn"> <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><font><font>Acción</font></font><span class="fa fa-caret-down"></span></button> <ul class="dropdown-menu"> <li><input type="button" value="Inactivar" name="aqui" class="btn btn-block btn-flat btn-danger" id="ejemplo5"></li> </ul> </div><!-- /btn-group --> <input type="text" value="Activo" id="valor5" name="valor5" class="form-control" readonly="readonly"> </div> <?php } else { ?> <div class="input-group has-error"> <div class="input-group-btn"> <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><font><font>Acción</font></font><span class="fa fa-caret-down"></span></button> <ul class="dropdown-menu"> <li><input type="button" value="Activar" name="aqui" class="btn btn-block btn-flat btn-success" id="ejemplo6"></li> </ul> </div><!-- /btn-group --> <input type="text" value="Inactivo" name="valor6" id="valor6" class="form-control" readonly="readonly"> </div> <?php } ?> </div> </div> <?php } ?> </div> </div><!-- /.box-body --> <div class="box-footer"> <button type="submit" name="Ins_Id" value="<?php echo $id?>" class="btn btn-primary">Modificar</button> </div> </form> </div><!-- /.box --> </div><!--/.col (left) --> </div><!-- /.box-body --> <div class="box-footer"> Usuarios </div><!-- /.box-footer--> </div><!-- /.box --> </section><!-- /.content --> </div><!-- /.content-wrapper --> <?php } /* *@funcion ACTUALIZAR INSTRUCTORES */ function actualizar() { /** @var TYPE_NAME $identificacion */ /** @var TYPE_NAME $Ins_Id */ /** @var TYPE_NAME $nombre */ /** @var TYPE_NAME $apellido */ /** @var TYPE_NAME $salario */ /** @var TYPE_NAME $direccion */ /** @var TYPE_NAME $telefono */ /** @var TYPE_NAME $estado */ /** @var TYPE_NAME $valor5 */ /** @var TYPE_NAME $valor6 */ $a = new Conexion(); $modulo="instructores"; $archivo="instructores"; $accion="listar"; extract($_POST); $datos = ("$Ins_Id,$identificacion,'$nombre','$apellido','$direccion','$telefono',$salario "); if ($valor5=='Activo') { echo $sql1=("update nic_instructores set Ins_Identificacion=$identificacion, Ins_Nombre='$nombre', Ins_Apellido='$apellido',Ins_Direccion='$direccion',Ins_Telefono='$telefono', Ins_Salario=$salario WHERE Ins_Id=$Ins_Id"); $a->execute($sql1); $a->mensaje_actualizar($modulo,$archivo,$accion); } elseif ($valor5=="Inactivo") { $estadoInactivo5="2"; echo $sql=("update nic_instructores set Ins_Identificacion=$identificacion, Ins_Nombre='$nombre', Ins_Apellido='$apellido',Ins_Direccion='$direccion',Ins_Telefono='$telefono', Ins_Salario=$salario, Ins_Estado=$estadoInactivo5 WHERE Ins_Id=$Ins_Id"); $a->execute($sql); $a->mensaje_actualizar($modulo,$archivo,$accion); } elseif($valor6=="Inactivo") { echo $sql1=("update nic_instructores set Ins_Identificacion=$identificacion, Ins_Nombre='$nombre', Ins_Apellido='$apellido',Ins_Direccion='$direccion',Ins_Telefono='$telefono', Ins_Salario=$salario WHERE Ins_Id=$Ins_Id"); $a->execute($sql1); $a->mensaje_actualizar($modulo,$archivo,$accion); } elseif($valor6=="Activo"){ $estadoInactivo6="1"; echo $sql=("update nic_instructores set Ins_Identificacion=$identificacion, Ins_Nombre='$nombre', Ins_Apellido='$apellido',Ins_Direccion='$direccion',Ins_Telefono='$telefono', Ins_Salario=$salario, Ins_Estado=$estadoInactivo6 WHERE Ins_Id=$Ins_Id"); $a->execute($sql); $a->mensaje_actualizar($modulo,$archivo,$accion); } } }
{ "content_hash": "4de87df8419ac731c8bcaba2000d7aea", "timestamp": "", "source": "github", "line_count": 506, "max_line_length": 262, "avg_line_length": 60.883399209486164, "alnum_prop": 0.3436556626740676, "repo_name": "luispalacios2014/banco", "id": "cc4cbda95127c6d2b35fd445f84a28652ac1d565", "size": "30810", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Administracion/Ban_admin/modulos/clientes/clientes.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1226020" }, { "name": "HTML", "bytes": "3148833" }, { "name": "JavaScript", "bytes": "4197352" }, { "name": "PHP", "bytes": "268044" }, { "name": "Python", "bytes": "32324" } ], "symlink_target": "" }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="Window101.xaml.cs" company="PropertyTools"> // Copyright (c) 2014 PropertyTools contributors // </copyright> // <summary> // Interaction logic for Window101.xaml // </summary> // -------------------------------------------------------------------------------------------------------------------- namespace DataGridDemo { using System.Collections.Generic; using System.Windows; using PropertyTools; /// <summary> /// Interaction logic for Window101.xaml /// </summary> public partial class Window101 { private ViewModel vm; /// <summary> /// Initializes a new instance of the <see cref="Window101" /> class. /// </summary> public Window101() { this.InitializeComponent(); this.vm = new ViewModel(); this.DataContext = this.vm; this.vm.ItemsSource = Window1.StaticItemsSource; } private void ClearItemsSource(object sender, RoutedEventArgs e) { this.vm.ItemsSource = null; } private void ResetItemsSource(object sender, RoutedEventArgs e) { this.vm.ItemsSource = Window1.StaticItemsSource; } public class ViewModel : Observable { private IList<ExampleObject> itemsSource; public IList<ExampleObject> ItemsSource { get { return this.itemsSource; } set { this.SetValue(ref this.itemsSource, value, () => this.ItemsSource); } } } } }
{ "content_hash": "53c2a9e7b5f377e2515cef359af89c2e", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 120, "avg_line_length": 29.15625, "alnum_prop": 0.4555198285101822, "repo_name": "jogibear9988/PropertyTools", "id": "be838c0f1e3642e36827bc9e48159dcebd5e96fa", "size": "1868", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/Examples/DataGrid/DataGridDemo/Examples/Window101.xaml.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1239710" }, { "name": "Shell", "bytes": "236" }, { "name": "Smalltalk", "bytes": "98162" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DD.CBU.Compute.Api.Contracts { /// <summary> /// XML namespace constants for the CaaS API. /// </summary> public static class XmlNamespaceConstants { /// <summary> /// The CaaS server XML namespace. /// </summary> public const string Server = "http://oec.api.opsource.net/schemas/server"; /// <summary> /// The CaaS storage XML namespace. /// </summary> public const string Storage = "http://oec.api.opsource.net/schemas/storage"; /// <summary> /// The CaaS multiple-geographic-region XML namespace. /// </summary> public const string MultiGeo = "http://oec.api.opsource.net/schemas/multigeo"; /// <summary> /// The CaaS white-label XML namespace. /// </summary> public const string WhiteLabel = "http://oec.api.opsource.net/schemas/whitelabel"; /// <summary> /// The CaaS virtual-IP XML namespace. /// </summary> public const string VirtualIP = "http://oec.api.opsource.net/schemas/vip"; /// <summary> /// The CaaS reset XML namespace. /// </summary> public const string Reset = "http://oec.api.opsource.net/schemas/reset"; /// <summary> /// The CaaS general XML namespace. /// </summary> public const string General = "http://oec.api.opsource.net/schemas/general"; /// <summary> /// The CaaS support XML namespace. /// </summary> public const string Support = "http://oec.api.opsource.net/schemas/support"; /// <summary> /// The CaaS administration XML namespace. /// </summary> public const string Admin = "http://oec.api.opsource.net/schemas/admin"; /// <summary> /// The CaaS manual-import XML namespace. /// </summary> public const string ManualImport = "http://oec.api.opsource.net/schemas/manualimport"; /// <summary> /// The CaaS cloud backup XML namespace. /// </summary> public const string Backup = "http://oec.api.opsource.net/schemas/backup"; /// <summary> /// The CaaS data centre XML namespace. /// </summary> public const string Datacenter = "http://oec.api.opsource.net/schemas/datacenter"; /// <summary> /// The CaaS directory XML namespace. /// </summary> public const string Directory = "http://oec.api.opsource.net/schemas/directory"; /// <summary> /// The CaaS reset XML namespace. /// </summary> public const string Network = "http://oec.api.opsource.net/schemas/network"; /// <summary> /// The CaaS organisation XML namespace. /// </summary> public const string Organization = "http://oec.api.opsource.net/schemas/organization"; } }
{ "content_hash": "2c7444ac15dcacc31a422b4112d76a6a", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 88, "avg_line_length": 29.685393258426966, "alnum_prop": 0.668433005299016, "repo_name": "samuelchong/Compute.Api.Client", "id": "f7117e229cbe4204b438cb82854a6a305fc14536", "size": "2644", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "ComputeClient/Compute.Contracts/XmlNamespaceConstants.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1613165" }, { "name": "PowerShell", "bytes": "7096" }, { "name": "Smalltalk", "bytes": "2806" }, { "name": "XSLT", "bytes": "6020" } ], "symlink_target": "" }
<h2 mat-dialog-title>New change recommendation</h2> <mat-dialog-content> <form class="motion-content" [formGroup]='contentForm' (ngSubmit)='saveChangeRecommendation()'> <h3>Change from line {{ lineRange.from }} to {{ lineRange.to }}:</h3> <mat-radio-group #rGroup formControlName="diffType"> <mat-radio-button *ngFor="let radio of replacementTypes" [value]="radio.value">{{ radio.title }}</mat-radio-button> </mat-radio-group> <!-- The HTML Editor --> <h4 translate>Changed version</h4> <editor formControlName='text' [init]="tinyMceSettings" ></editor> <mat-checkbox formControlName="public">{{ 'Public' | translate }}</mat-checkbox> </form> </mat-dialog-content> <mat-dialog-actions> <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. --> <button mat-button (click)="saveChangeRecommendation()"> <span translate>Save</span> </button> <button mat-button mat-dialog-close> <span translate>Cancel</span> </button> </mat-dialog-actions>
{ "content_hash": "59819fa70a45389b3a06d8bcebdf5676", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 127, "avg_line_length": 40.07142857142857, "alnum_prop": 0.6354723707664884, "repo_name": "boehlke/OpenSlides", "id": "c1a0789a11b442c70b16972765e248254a22cf9c", "size": "1122", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "43810" }, { "name": "Dockerfile", "bytes": "855" }, { "name": "HTML", "bytes": "210347" }, { "name": "JavaScript", "bytes": "86897" }, { "name": "Python", "bytes": "894871" }, { "name": "Smarty", "bytes": "3818" }, { "name": "TypeScript", "bytes": "1230305" } ], "symlink_target": "" }
<?php namespace DbMockLibrary\Test\MockDataManipulation; use DbMockLibrary\MockDataManipulation; use DbMockLibrary\Test\TestCase; class SaveCollectionTest extends TestCase { /** * @dataProvider getData * * @param array $data * * @return void */ public function test_function(array $data) { // prepare MockDataManipulation::initDataContainer(['collection' => ['id' => ['field' => 'value']]]); $reflection = new \ReflectionClass('\DbMockLibrary\MockDataManipulation'); $dataProperty = $reflection->getProperty('data'); $dataProperty->setAccessible(true); // invoke logic MockDataManipulation::getInstance()->saveCollection($data['value'], $data['collection']); // test $this->assertEquals($data['expected'], $dataProperty->getValue(MockDataManipulation::getInstance())); } /** * @return array */ public function getData() { return [ // #0 overwrite collection [ [ 'value' => ['fooBar' => ['fooBar' => 'fooBar']], 'collection' => 'collection', 'expected' => ['collection' => ['fooBar' => ['fooBar' => 'fooBar']]] ] ], // #1 add new collection [ [ 'value' => ['fooBar' => ['fooBar' => 'fooBar']], 'collection' => 'fooBar', 'expected' => ['collection' => ['id' => ['field' => 'value']], 'fooBar' => ['fooBar' => ['fooBar' => 'fooBar']]] ] ] ]; } }
{ "content_hash": "5ab92989dff4b2ce51cd55c8a275ab8e", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 134, "avg_line_length": 30.527272727272727, "alnum_prop": 0.4949374627754616, "repo_name": "ajant/DbMockLibrary", "id": "5a466f9918a9a25afb76f81b7159de173dabfc83", "size": "1679", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/MockDataManipulation/SaveCollectionTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "162966" } ], "symlink_target": "" }
using System; using SD = System.Drawing; using SWF = System.Windows.Forms; using Eto.Forms; namespace Eto.WinForms.Forms.ToolBar { public class ButtonToolItemHandler : ToolItemHandler<SWF.ToolStripButton, ButtonToolItem>, ButtonToolItem.IHandler { public ButtonToolItemHandler() { Control = new SWF.ToolStripButton(); Control.Tag = this; Control.Click += control_Click; } void control_Click(object sender, EventArgs e) { Widget.OnClick(EventArgs.Empty); } public override bool Enabled { get { return Control.Enabled; } set { Control.Enabled = value; } } public override void CreateControl(ToolBarHandler handler, int index) { handler.Control.Items.Insert(index, Control); } } }
{ "content_hash": "9989c31650ad3f8418b8fa9290f8ce0d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 115, "avg_line_length": 22.12121212121212, "alnum_prop": 0.7232876712328767, "repo_name": "bbqchickenrobot/Eto-1", "id": "58d5460df329e38191f59c0a3dd2e56b2d8ccce5", "size": "730", "binary": false, "copies": "6", "ref": "refs/heads/develop", "path": "Source/Eto.WinForms/Forms/ToolBar/ButtonToolItemHandler.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "853" }, { "name": "C#", "bytes": "5043767" }, { "name": "F#", "bytes": "7500" }, { "name": "Pascal", "bytes": "1968" }, { "name": "Python", "bytes": "475" }, { "name": "Shell", "bytes": "1511" }, { "name": "Visual Basic", "bytes": "9367" } ], "symlink_target": "" }
package com.codebook.akka.route import akka.http.scaladsl.model.HttpResponse import akka.http.scaladsl.model.StatusCodes._ import akka.http.scaladsl.server.Directives._ import akka.http.scaladsl.server.{ExceptionHandler, Route} trait ErrorHandler { implicit def myExceptionHandler = ExceptionHandler { case e: NoSuchElementException => extractUri { uri => complete(HttpResponse(NotFound, entity = s"Invalid id: ${e.getMessage}")) } } } trait Routes extends ErrorHandler with SysRoute with UserRoute with UrlRoute with StocksRoute { val index = "public/index.html" val root = "" val sys = "sys" val api = "api" def routes: Route = logRequestResult("akka-services") { path(root)(getFromResource(index)) ~ pathPrefix(sys)(sysRoute) ~ pathPrefix(api)(userRoute ~ urlRoute ~ stocksRoute) } }
{ "content_hash": "8e60cd1cbbfa8fe1e3aca5236c296d94", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 95, "avg_line_length": 28.533333333333335, "alnum_prop": 0.7126168224299065, "repo_name": "flopezlasanta/akka-services", "id": "add0b8a9f15fe3723b9eb68842f3c7bf41156358", "size": "856", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/scala/com/codebook/akka/route/Routes.scala", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "3319" }, { "name": "Scala", "bytes": "12764" } ], "symlink_target": "" }