text
stringlengths
2
1.04M
meta
dict
package google import ( "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccDialogflowCXEntityType_update(t *testing.T) { t.Parallel() context := map[string]interface{}{ "org_id": getTestOrgFromEnv(t), "billing_account": getTestBillingAccountFromEnv(t), "random_suffix": randString(t, 10), } vcrTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDialogflowCXEntityType_basic(context), }, { ResourceName: "google_dialogflow_cx_entity_type.my_entity", ImportState: true, ImportStateVerify: true, }, { Config: testAccDialogflowCXEntityType_full(context), }, { ResourceName: "google_dialogflow_cx_entity_type.my_entity", ImportState: true, ImportStateVerify: true, }, }, }) } func testAccDialogflowCXEntityType_basic(context map[string]interface{}) string { return Nprintf(` data "google_project" "project" {} resource "google_service_account" "dialogflowcx_service_account" { account_id = "tf-test-dialogflow-%{random_suffix}" } resource "google_project_iam_member" "agent_create" { project = data.google_project.project.project_id role = "roles/dialogflow.admin" member = "serviceAccount:${google_service_account.dialogflowcx_service_account.email}" } resource "google_dialogflow_cx_agent" "agent_entity" { display_name = "tf-test-%{random_suffix}" location = "global" default_language_code = "en" supported_language_codes = ["fr","de","es"] time_zone = "America/New_York" description = "Description 1." avatar_uri = "https://storage.cloud.google.com/dialogflow-test-host-image/cloud-logo.png" depends_on = [google_project_iam_member.agent_create] } resource "google_dialogflow_cx_entity_type" "my_entity" { parent = google_dialogflow_cx_agent.agent_entity.id display_name = "MyEntity" kind = "KIND_MAP" entities { value = "value1" synonyms = ["synonym1","synonym2"] } entities { value = "value2" synonyms = ["synonym3","synonym4"] } enable_fuzzy_extraction = false } `, context) } func testAccDialogflowCXEntityType_full(context map[string]interface{}) string { return Nprintf(` data "google_project" "project" {} resource "google_service_account" "dialogflowcx_service_account" { account_id = "tf-test-dialogflow-%{random_suffix}" } resource "google_project_iam_member" "agent_create" { project = data.google_project.project.project_id role = "roles/dialogflow.admin" member = "serviceAccount:${google_service_account.dialogflowcx_service_account.email}" } resource "google_dialogflow_cx_agent" "agent_entity" { display_name = "tf-test-%{random_suffix}" location = "global" default_language_code = "en" supported_language_codes = ["fr","de","es"] time_zone = "America/New_York" description = "Description 1." avatar_uri = "https://storage.cloud.google.com/dialogflow-test-host-image/cloud-logo.png" depends_on = [google_project_iam_member.agent_create] } resource "google_dialogflow_cx_entity_type" "my_entity" { parent = google_dialogflow_cx_agent.agent_entity.id display_name = "MyEntity" kind = "KIND_MAP" entities { value = "value1" synonyms = ["synonym1","synonym2","synonym11","synonym22"] } entities { value = "value2" synonyms = ["synonym3","synonym4"] } enable_fuzzy_extraction = false redact = true auto_expansion_mode = "AUTO_EXPANSION_MODE_DEFAULT" excluded_phrases { value = "excluded1" } } `, context) }
{ "content_hash": "80d2c78c645c41a5340c649b359e3178", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 91, "avg_line_length": 29.946153846153845, "alnum_prop": 0.6434626252247624, "repo_name": "GoogleCloudPlatform/magic-modules", "id": "6e758f59637140e659e2351a32c45d570cd460b4", "size": "3893", "binary": false, "copies": "4", "ref": "refs/heads/main", "path": "mmv1/third_party/terraform/tests/resource_dialogflowcx_entity_type_test.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "7051" }, { "name": "Go", "bytes": "241066" }, { "name": "HCL", "bytes": "36827" }, { "name": "HTML", "bytes": "1600978" }, { "name": "Makefile", "bytes": "3041" }, { "name": "Python", "bytes": "53879" }, { "name": "Ruby", "bytes": "372358" }, { "name": "Shell", "bytes": "62187" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Threading.Tasks; using System.Windows; namespace QuickstartInteractiveDataDisplay { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { } }
{ "content_hash": "1534ba0dc71aa37036e7f8001c7e0ef5", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 42, "avg_line_length": 20.352941176470587, "alnum_prop": 0.7225433526011561, "repo_name": "swharden/Csharp-Data-Visualization", "id": "e4a9252c84660b768151281c406abb2d7b91a453", "size": "348", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "projects/plotting/interactive-data-display/App.xaml.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "880" }, { "name": "C#", "bytes": "809329" }, { "name": "CSS", "bytes": "3137" }, { "name": "HTML", "bytes": "57274" }, { "name": "JavaScript", "bytes": "8700" }, { "name": "Jupyter Notebook", "bytes": "19055" }, { "name": "Shell", "bytes": "62" } ], "symlink_target": "" }
angular.module('discman').directive('viewLink', function(){ return{ restrict: 'E', scope: { title: '@', image: '@', goto: '@' }, template: "<li><a href={{goto}}><span id='imageClass' class={{image}}></span><span class='navText'>{{title}}</span></a></li>" }; });
{ "content_hash": "d087b41206da8cc2d8c850e6a7de7e38", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 133, "avg_line_length": 30.636363636363637, "alnum_prop": 0.4629080118694362, "repo_name": "snthtech/discman-angulared", "id": "8155dc96ca6eadfda0f69831b01d4fa1435630af", "size": "337", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/components/viewlink/viewlinkdirective.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "18863" }, { "name": "HTML", "bytes": "69177" }, { "name": "JavaScript", "bytes": "82831" } ], "symlink_target": "" }
""" __graph_MT_pre__match_contains.py___________________________________________________________ Automatically generated LINK for entity MT_pre__match_contains DO NOT MODIFY DIRECTLY ____________________________________________________________________________________________ """ from graphLink import * from stickylink import * from widthXfillXdecoration import * class graph_MT_pre__match_contains(graphLink): def __init__(self, xc, yc, semObject = None ): self.semObject = semObject self.semanticObject = semObject from linkEditor import * self.le=linkEditor(self,self.semObject, "match_contains") self.le.FirstLink= stickylink() self.le.FirstLink.arrow=ATOM3Boolean() self.le.FirstLink.arrow.setValue((' ', 0)) self.le.FirstLink.arrow.config = 0 self.le.FirstLink.arrowShape1=ATOM3Integer(8) self.le.FirstLink.arrowShape2=ATOM3Integer(10) self.le.FirstLink.arrowShape3=ATOM3Integer(3) self.le.FirstLink.decoration=ATOM3Appearance() self.le.FirstLink.decoration.setValue( ('match_contains_1stLink', self.le.FirstLink)) self.le.FirstSegment= widthXfillXdecoration() self.le.FirstSegment.width=ATOM3Integer(2) self.le.FirstSegment.fill=ATOM3String('black', 20) self.le.FirstSegment.stipple=ATOM3String('', 20) self.le.FirstSegment.arrow=ATOM3Boolean() self.le.FirstSegment.arrow.setValue((' ', 0)) self.le.FirstSegment.arrow.config = 0 self.le.FirstSegment.arrowShape1=ATOM3Integer(8) self.le.FirstSegment.arrowShape2=ATOM3Integer(10) self.le.FirstSegment.arrowShape3=ATOM3Integer(3) self.le.FirstSegment.decoration=ATOM3Appearance() self.le.FirstSegment.decoration.setValue( ('match_contains_1stSegment', self.le.FirstSegment)) self.le.FirstSegment.decoration_Position=ATOM3Enum(['Up', 'Down', 'Middle', 'No decoration'],3,0) self.le.Center=ATOM3Appearance() self.le.Center.setValue( ('match_contains_Center', self.le)) self.le.SecondSegment= widthXfillXdecoration() self.le.SecondSegment.width=ATOM3Integer(2) self.le.SecondSegment.fill=ATOM3String('black', 20) self.le.SecondSegment.stipple=ATOM3String('', 20) self.le.SecondSegment.arrow=ATOM3Boolean() self.le.SecondSegment.arrow.setValue((' ', 0)) self.le.SecondSegment.arrow.config = 0 self.le.SecondSegment.arrowShape1=ATOM3Integer(8) self.le.SecondSegment.arrowShape2=ATOM3Integer(10) self.le.SecondSegment.arrowShape3=ATOM3Integer(3) self.le.SecondSegment.decoration=ATOM3Appearance() self.le.SecondSegment.decoration.setValue( ('match_contains_2ndSegment', self.le.SecondSegment)) self.le.SecondSegment.decoration_Position=ATOM3Enum(['Up', 'Down', 'Middle', 'No decoration'],3,0) self.le.SecondLink= stickylink() self.le.SecondLink.arrow=ATOM3Boolean() self.le.SecondLink.arrow.setValue((' ', 1)) self.le.SecondLink.arrow.config = 0 self.le.SecondLink.arrowShape1=ATOM3Integer(8) self.le.SecondLink.arrowShape2=ATOM3Integer(10) self.le.SecondLink.arrowShape3=ATOM3Integer(3) self.le.SecondLink.decoration=ATOM3Appearance() self.le.SecondLink.decoration.setValue( ('match_contains_2ndLink', self.le.SecondLink)) self.le.FirstLink.decoration.semObject=self.semObject self.le.FirstSegment.decoration.semObject=self.semObject self.le.Center.semObject=self.semObject self.le.SecondSegment.decoration.semObject=self.semObject self.le.SecondLink.decoration.semObject=self.semObject graphLink.__init__(self, xc, yc, self.le,semObject)
{ "content_hash": "b62de73b4ce06474663c743883919e07", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 104, "avg_line_length": 52.608695652173914, "alnum_prop": 0.6950413223140496, "repo_name": "levilucio/SyVOLT", "id": "d0f42dd8ea7537efd6de5869a7683a33d9d7232c", "size": "3630", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "GM2AUTOSAR_MM/graph_MT_pre__match_contains.py", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "166159" }, { "name": "Python", "bytes": "34207588" }, { "name": "Shell", "bytes": "1118" } ], "symlink_target": "" }
<!-- 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 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. --> <ivysettings> <typedef name="mock" classname="org.apache.ivy.plugins.resolver.MockResolver"/> <resolvers> <chain name="internal"> <mock name="mock1"/> <mock name="mock2"/> </chain> <mock name="mock3"/> </resolvers> </ivysettings>
{ "content_hash": "57be455073b0233deb8b3e3fbaed5d46", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 80, "avg_line_length": 37.714285714285715, "alnum_prop": 0.7310606060606061, "repo_name": "twogee/ant-ivy", "id": "8716946d848807b212e89b615812628539aac6cc", "size": "1056", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "test/java/org/apache/ivy/core/settings/ivysettings-typedef.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "19706" }, { "name": "HTML", "bytes": "124511" }, { "name": "Java", "bytes": "4411643" }, { "name": "JavaScript", "bytes": "7341" }, { "name": "Ruby", "bytes": "5994" }, { "name": "XSLT", "bytes": "81955" } ], "symlink_target": "" }
 using System; using System.Web.Mvc; using Utilities.DataTypes.ExtensionMethods; using Utilities.Web.ExtensionMethods; namespace Batman.MVC.ActionFilters { /// <summary> /// Compresses the data /// </summary> [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class Compress : ActionFilterAttribute { /// <summary> /// Constructor /// </summary> public Compress() { Type = MinificationType.HTML; Minify = true; } /// <summary> /// Should this be minified /// </summary> public virtual bool Minify { get; set; } /// <summary> /// Minification type /// </summary> public virtual MinificationType Type { get; set; } /// <summary> /// On Action Executing /// </summary> /// <param name="filterContext">filter context</param> public override void OnActionExecuting(ActionExecutingContext filterContext) { if (filterContext.ActionDescriptor.Attributes<DoNotCompress>().Length == 0) filterContext.HttpContext.HTTPCompress(Minify, Type); base.OnActionExecuting(filterContext); } } }
{ "content_hash": "31cc35b77900a9a60350820c03ed9788", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 111, "avg_line_length": 28.434782608695652, "alnum_prop": 0.5940366972477065, "repo_name": "JaCraig/Batman", "id": "abfca39b3bcd3fc266b72ee2dfc2eb19e2cbc9ae", "size": "2407", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Batman.MVC/ActionFilters/Compress.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2866" }, { "name": "C#", "bytes": "495062" }, { "name": "HTML", "bytes": "26700" } ], "symlink_target": "" }
#ifndef _KEYPAIR_H #define _KEYPAIR_H #include <stdio.h> #include <string.h> #include <sodium.h> // Struct to hold a Ed25519 public/private keypair for signing and verifying typedef struct _keypair { unsigned char pk[crypto_sign_PUBLICKEYBYTES]; unsigned char sk[crypto_sign_SECRETKEYBYTES]; } keypair; /** * @brief Generate a new keypair struct * * Allocates a new struct and generates a new edEd25519 public/private keypair. * Returns NULL if malloc fails * * @return pointer to the newly allocated struct */ keypair* keypair_generate(); /** * @brief Save keypair to file * * Saves a given keypair to file with given name. Extensions are automatically appended. * * @param name name of the file to be saved * @param kp pointer to keypair struct to be saved * @return integer, 0 if saved succesfully, 1 if encountered error */ int keypair_save(const char* name, keypair* kp); /** * @brief Load keypair from file * * Loads a keypair from file with given name. Extensions are automatically appended. * Returns NULL if malloc fails * * @param name name of the file to be loaded * @return pointer to allocated keypair struct */ keypair* keypair_load(const char* name); /** * @brief destroy the keypair * * Frees the memory used for the keypair * * @param kp pointer to keypair struct to be destroyed */ void keypair_destroy(keypair* kp); #endif
{ "content_hash": "5b1ae6e851cee8d5b72bb87221675a3c", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 87, "avg_line_length": 24.836363636363636, "alnum_prop": 0.7349926793557833, "repo_name": "fboerman/kolibriledger", "id": "a8c6a5c1fd05febd1f37e8c4dfb9b586d762668f", "size": "1366", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "keypair.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "35215" }, { "name": "Makefile", "bytes": "1732" }, { "name": "Shell", "bytes": "1108" } ], "symlink_target": "" }
/*global CSL: true */ CSL.Util.substituteStart = function (state, target) { var element_trace, display, bib_first, func, choose_start, if_start, nodetypes; func = function (state, Item, item) { for (var i = 0, ilen = this.decorations.length; i < ilen; i += 1) { if ("@strip-periods" === this.decorations[i][0] && "true" === this.decorations[i][1]) { state.tmp.strip_periods += 1; break; } } }; this.execs.push(func); if (this.decorations && state.opt.development_extensions.csl_reverse_lookup_support) { this.decorations.reverse(); this.decorations.push(["@showid","true", this.cslid]); this.decorations.reverse(); } // // Contains body code for both substitute and first-field/remaining-fields // formatting. // nodetypes = ["number", "date", "names"]; if (("text" === this.name && !this.postponed_macro) || nodetypes.indexOf(this.name) > -1) { element_trace = function (state, Item, item) { if (state.tmp.element_trace.value() === "author" || "names" === this.name) { if (!state.tmp.just_looking && item && item["author-only"] && state.tmp.area !== "intext") { if (!state.tmp.probably_rendered_something) { } else { state.tmp.element_trace.push("suppress-me"); } } if (!state.tmp.just_looking && item && item["suppress-author"]) { if (!state.tmp.probably_rendered_something) { state.tmp.element_trace.push("suppress-me"); } } } else if ("date" === this.name) { if (!state.tmp.just_looking && item && item["author-only"] && state.tmp.area !== "intext") { if (state.tmp.probably_rendered_something) { state.tmp.element_trace.push("suppress-me"); } } /* if (!state.tmp.just_looking && item && item["suppress-author"]) { if (state.tmp.probably_rendered_something) { //state.tmp.element_trace.push("suppress-me"); } } */ } else { if (!state.tmp.just_looking && item && item["author-only"] && state.tmp.area !== "intext") { // XXX can_block_substitute probably is doing nothing here. The value is always true. if (!state.tmp.probably_rendered_something && state.tmp.can_block_substitute) { } else { state.tmp.element_trace.push("suppress-me"); } } else if (item && item["suppress-author"]) { state.tmp.element_trace.push("do-not-suppress-me"); } } }; this.execs.push(element_trace); } display = this.strings.cls; this.strings.cls = false; if (state.build.render_nesting_level === 0) { // // The markup formerly known as @bibliography/first // // Separate second-field-align from the generic display logic. // There will be some code replication, but not in the // assembled style. // if (state.build.area === "bibliography" && state.bibliography.opt["second-field-align"]) { bib_first = new CSL.Token("group", CSL.START); bib_first.decorations = [["@display", "left-margin"]]; func = function (state, Item) { if (!state.tmp.render_seen) { bib_first.strings.first_blob = Item.id; state.output.startTag("bib_first", bib_first); } }; bib_first.execs.push(func); target.push(bib_first); } else if (CSL.DISPLAY_CLASSES.indexOf(display) > -1) { bib_first = new CSL.Token("group", CSL.START); bib_first.decorations = [["@display", display]]; func = function (state, Item) { bib_first.strings.first_blob = Item.id; state.output.startTag("bib_first", bib_first); }; bib_first.execs.push(func); target.push(bib_first); } state.build.cls = display; } state.build.render_nesting_level += 1; // Should this be render_nesting_level, with the increment // below? ... ? if (state.build.substitute_level.value() === 1) { // // All top-level elements in a substitute environment get // wrapped in conditionals. The substitute_level variable // is a stack, because spanned names elements (with their // own substitute environments) can be nested inside // a substitute environment. // // (okay, we use conditionals a lot more than that. // we slot them in for author-only as well...) choose_start = new CSL.Token("choose", CSL.START); CSL.Node.choose.build.call(choose_start, state, target); if_start = new CSL.Token("if", CSL.START); // // Set a test of the shadow if token to skip this // macro if we have acquired a name value. // check for variable func = function () { if (state.tmp.can_substitute.value()) { return true; } return false; }; if_start.tests ? {} : if_start.tests = []; if_start.tests.push(func); if_start.test = state.fun.match.any(this, state, if_start.tests); target.push(if_start); } if (state.sys.variableWrapper && this.variables_real && this.variables_real.length) { func = function (state, Item, item) { if (!state.tmp.just_looking && !state.tmp.suppress_decorations) { // Attach item data and variable names. // Do with them what you will. var variable_entry = new CSL.Token("text", CSL.START); variable_entry.decorations = [["@showid", "true"]]; state.output.startTag("variable_entry", variable_entry); var position = null; if (item) { position = item.position; } if (!position) { position = 0; } var positionMap = [ "first", "container-subsequent", "subsequent", "ibid", "ibid-with-locator" ]; var noteNumber = 0; if (item && item.noteIndex) { noteNumber = item.noteIndex; } var firstReferenceNoteNumber = 0; if (item && item['first-reference-note-number']) { firstReferenceNoteNumber = item['first-reference-note-number']; } var firstContainerReferenceNoteNumber = 0; if (item && item['first-container-reference-note-number']) { firstContainerReferenceNoteNumber = item['first-container-reference-note-number']; } var citationNumber = 0; // XXX Will this EVER happen? if (item && item['citation-number']) { citationNumber = item['citation-number']; } var index = 0; if (item && item.index) { index = item.index; } var params = { itemData: Item, variableNames: this.variables, context: state.tmp.area, xclass: state.opt.xclass, position: positionMap[position], "note-number": noteNumber, "first-reference-note-number": firstReferenceNoteNumber, "first-container-reference-note-number": firstContainerReferenceNoteNumber, "citation-number": citationNumber, "index": index, "mode": state.opt.mode }; state.output.current.value().params = params; } }; this.execs.push(func); } }; CSL.Util.substituteEnd = function (state, target) { var func, bib_first_end, bib_other, if_end, choose_end, author_substitute, str; if (state.sys.variableWrapper && (this.hasVariable || (this.variables_real && this.variables_real.length))) { func = function (state) { if (!state.tmp.just_looking && !state.tmp.suppress_decorations) { state.output.endTag("variable_entry"); } }; this.execs.push(func); } func = function (state) { for (var i = 0, ilen = this.decorations.length; i < ilen; i += 1) { if ("@strip-periods" === this.decorations[i][0] && "true" === this.decorations[i][1]) { state.tmp.strip_periods += -1; break; } } }; this.execs.push(func); state.build.render_nesting_level += -1; if (state.build.render_nesting_level === 0) { if (state.build.cls) { func = function (state) { state.output.endTag("bib_first"); }; this.execs.push(func); state.build.cls = false; } else if (state.build.area === "bibliography" && state.bibliography.opt["second-field-align"]) { bib_first_end = new CSL.Token("group", CSL.END); // first func end func = function (state) { if (!state.tmp.render_seen) { state.output.endTag("bib_first"); // closes bib_first } }; bib_first_end.execs.push(func); target.push(bib_first_end); bib_other = new CSL.Token("group", CSL.START); bib_other.decorations = [["@display", "right-inline"]]; func = function (state) { if (!state.tmp.render_seen) { state.tmp.render_seen = true; state.output.startTag("bib_other", bib_other); } }; bib_other.execs.push(func); target.push(bib_other); } } if (state.build.substitute_level.value() === 1) { if_end = new CSL.Token("if", CSL.END); target.push(if_end); choose_end = new CSL.Token("choose", CSL.END); CSL.Node.choose.build.call(choose_end, state, target); } if ("names" === this.name || ("text" === this.name && this.variables_real !== "title")) { author_substitute = new CSL.Token("text", CSL.SINGLETON); var substitution_name = this.name; func = function (state, Item) { if (state.tmp.area !== "bibliography") { return; } if ("string" !== typeof state.bibliography.opt["subsequent-author-substitute"]) { return; } if (this.variables_real && !Item[this.variables_real]) { return; } // The logic of these two is not obvious. The effect is to enable placeholder substitution // on a text macro name substitution, without printing both the text macro AND the placeholder. // See https://forums.zotero.org/discussion/comment/350407 if (this.variables_real && substitution_name === "names") { return; } var subrule = state.bibliography.opt["subsequent-author-substitute-rule"]; var i, ilen; //var text_esc = CSL.getSafeEscape(state); var printing = !state.tmp.suppress_decorations; if (printing && state.tmp.subsequent_author_substitute_ok) { if (state.tmp.rendered_name) { if ("partial-each" === subrule || "partial-first" === subrule) { var dosub = true; var rendered_name = []; // This is a wee bit risky, as we're assuming that the name // children and the list of stringified names are congruent. // That *should* always be true, but you never know. for (i = 0, ilen = state.tmp.name_node.children.length; i < ilen; i += 1) { var name = state.tmp.rendered_name[i]; if (dosub && state.tmp.last_rendered_name && state.tmp.last_rendered_name.length > (i - 1) && name && !name.localeCompare(state.tmp.last_rendered_name[i])) { str = new CSL.Blob(state[state.tmp.area].opt["subsequent-author-substitute"]); state.tmp.name_node.children[i].blobs = [str]; if ("partial-first" === subrule) { dosub = false; } } else { dosub = false; } rendered_name.push(name); } // might want to slice this? state.tmp.last_rendered_name = rendered_name; } else if ("complete-each" === subrule) { var rendered_name = state.tmp.rendered_name.join(","); if (rendered_name) { if (state.tmp.last_rendered_name && !rendered_name.localeCompare(state.tmp.last_rendered_name)) { for (i = 0, ilen = state.tmp.name_node.children.length; i < ilen; i += 1) { str = new CSL.Blob(state[state.tmp.area].opt["subsequent-author-substitute"]); state.tmp.name_node.children[i].blobs = [str]; } } state.tmp.last_rendered_name = rendered_name; } } else { var rendered_name = state.tmp.rendered_name.join(","); if (rendered_name) { if (state.tmp.last_rendered_name && !rendered_name.localeCompare(state.tmp.last_rendered_name)) { str = new CSL.Blob(state[state.tmp.area].opt["subsequent-author-substitute"]); if (state.tmp.label_blob) { state.tmp.name_node.top.blobs = [str,state.tmp.label_blob]; } else if (state.tmp.name_node.top.blobs.length) { state.tmp.name_node.top.blobs[0].blobs = [str]; } else { state.tmp.name_node.top.blobs = [str]; } state.tmp.substituted_variable = substitution_name; } state.tmp.last_rendered_name = rendered_name; } } state.tmp.subsequent_author_substitute_ok = false; } } }; this.execs.push(func); } if (("text" === this.name && !this.postponed_macro) || ["number", "date", "names"].indexOf(this.name) > -1) { // element trace func = function (state, Item) { // element_trace is a mess, but it's trying to do something simple. // A queue append is done, and element_trace.value() returns "suppress-me" // the append is aborted. That's it. // It seems only to be used on numeric elements of numeric styles ATM. // If used only for that purpose, it could be greatly simplified. // If cleaned up, it could do more interesting things, like control // the suppression of names set later than first position. if (state.tmp.element_trace.mystack.length>1) { state.tmp.element_trace.pop(); } }; this.execs.push(func); } };
{ "content_hash": "a3bb69cc75d7c11b0b10aaf446aeba08", "timestamp": "", "source": "github", "line_count": 361, "max_line_length": 125, "avg_line_length": 45.692520775623265, "alnum_prop": 0.4859654440739618, "repo_name": "crosscite/citeproc-doi-server", "id": "2686dc01a2339e1a65da0ee615c3606e46bba539", "size": "16495", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/citeproc-js/src/util_substitute.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "363" }, { "name": "CSS", "bytes": "4727" }, { "name": "Dockerfile", "bytes": "2334" }, { "name": "HTML", "bytes": "65412" }, { "name": "JavaScript", "bytes": "3827128" }, { "name": "Python", "bytes": "38544" }, { "name": "Shell", "bytes": "9943" } ], "symlink_target": "" }
Parse.initialize("mO5SuziTjoOwT28NdwfTaBkEvGaS1aMIZF0s6GPW", "6uTteekIXC1kbX3RYUgYjTqtgjJlWe4AjeNhG5Ps"); var Album = Parse.Object.extend("Album"); var query = new Parse.Query(Album); query.notEqualTo("isPlayed",true); query.ascending("createdAt"); var t=setInterval(printPlaylist,1000); function printPlaylist(){ query.find({ success: function(results){ var albumsString = "<ol>"; for(var i = 0; i < results.length; i++){ var album = results[i]; albumsString += '<li class="item">'; if(i == 0){ albumsString += "<b>"; $("div#footer").html('<button class="button button-block button-dark" onclick="nextAlbum();">Neste album</button>'); } albumsString += album.get("albumName") + " - " + album.get("artistName") + "</li>"; if(i == 0){ albumsString += '</b>'; } } if(results.length == 0){ albumsString += '<br><br>Ingen album i køen!'; $("div#footer").html('OBS! Legg til album!'); } $("div#nowplaying").html(albumsString); } , error: function(results, error){ localStorage.setItem('albumAndArtist', 'redwine'); localStorage.setItem('album', 'redwine'); if(localStorage.getItem('albumAndArtist' != 'redwine')){ location.reload(); } } } ); } function nextAlbum(){ query.find({ success: function(results){ var album = results[0]; album.save(null, { success: function(album) { album.set("isPlayed", true); album.save(); }}); } }); } function bohemian(){ var BohemianAlbum = Parse.Object.extend("Album"); var bohemianQuery = new Parse.Query(BohemianAlbum); bohemianQuery.equalTo("albumName","bohemian"); bohemianQuery.find({ success: function(results){ var album = results[0]; album.save(null, { success: function(album) { album.set("isPlayed", false); album.save(); }}); } }); }
{ "content_hash": "5c744e823a94164a9de034df6de053b1", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 136, "avg_line_length": 30.17721518987342, "alnum_prop": 0.48783557046979864, "repo_name": "sondresallaup/vinogvinyl", "id": "01c67ccc3ad3e82f64939fba8671cbe54e22b6b3", "size": "2385", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "www/js/admin.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "345740" }, { "name": "JavaScript", "bytes": "2063897" } ], "symlink_target": "" }
<?xml version="1.0" ?> <tei> <teiHeader> <fileDesc xml:id="55010590"/> </teiHeader> <text xml:lang="en"> <front> <lb/> <docTitle> <titlePart>The effect of wireless communication on the distance<lb/> control between vehicles<lb/></titlePart> </docTitle> <byline> <docAuthor>Mª Luisa Ruiz de Arbulo Gubía, Steven Gilijns, Marc Engels<lb/></docAuthor> </byline> <byline> <affiliation>Flander&apos;s Mechatronics Technology Centre (FMTC),<lb/></affiliation> </byline> <email>[email protected]<lb/></email> <div type="abstract">Abstract: This paper analyzes the effect of communication delays on a distance control<lb/> system. The analysis has been made by simulating a Bluetooth link in the control system.<lb/> First, the controller was designed for the ideal case of a hardwired communication link.<lb/> Then, an ideal and a real wireless link have been simulated on the system to analyze the<lb/> effect of retransmissions of a single packet and of multiples consecutive packets. The<lb/> results of the simulation allow us to state that the parameters that determine the<lb/> performance of the system are not only length but also time instant in which they happen.<lb/></div> <keyword>Keywords: wireless control, Bluetooth,<lb/></keyword> </front> </text> </tei>
{ "content_hash": "83cbea82b0a641e8569c5f45b7c54155", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 676, "avg_line_length": 45.06896551724138, "alnum_prop": 0.7452180566182096, "repo_name": "Aazhar/grobid", "id": "3597d8b36206b510e02b3a11f4225c7dbe54ed58", "size": "1309", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "grobid-trainer/resources/dataset/header/corpus/tei/55010590.header.tei.xml", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
/* global describe, it, expect */ describe('Describe the test', function(){ 'use strict'; it('Assert', function(){ expect(true).toBe(true); }); });
{ "content_hash": "fd71fff6e164c404d1b1bd70c421ea36", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 41, "avg_line_length": 15.6, "alnum_prop": 0.6153846153846154, "repo_name": "antonjb/Static-Site", "id": "c2ac36ab14dba5f13c31d9ceea7d21edb93a04b4", "size": "156", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/test_spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "201" }, { "name": "HTML", "bytes": "1116" }, { "name": "JavaScript", "bytes": "17256" } ], "symlink_target": "" }
<?php $docs_type = 'C'; $search_data = &cw_session_register('search_data'); $search_data['orders'][$docs_type]['basic']['customer_id'] = $customer_id; $smarty->assign('current_section_dir', 'doc'); if ($doc_id) include $app_main_dir.'/include/orders/order.php'; else include $app_main_dir.'/include/orders/orders.php';
{ "content_hash": "29c666e429b9c8059388d64c4813c8ed", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 74, "avg_line_length": 30, "alnum_prop": 0.6606060606060606, "repo_name": "Cartworks/Platform", "id": "e040aa91fdacee875faa83ce658810abe2477a21", "size": "330", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/customer/docs_C.php", "mode": "33261", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "4105" }, { "name": "CSS", "bytes": "1030520" }, { "name": "HTML", "bytes": "3347961" }, { "name": "JavaScript", "bytes": "2328159" }, { "name": "PHP", "bytes": "11383291" }, { "name": "PLpgSQL", "bytes": "41336" }, { "name": "PostScript", "bytes": "466581" }, { "name": "SQLPL", "bytes": "816" }, { "name": "Smarty", "bytes": "2561096" }, { "name": "XSLT", "bytes": "11238" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <billStatus> <bill> <relatedBills /> <latestAction> <actionDate>2017-06-15</actionDate> <links /> <text>Submitted in the Senate, considered, and agreed to without amendment and with a preamble by Unanimous Consent. (consideration: CR S3560; text: CR S3558)</text> </latestAction> <introducedDate>2017-06-15</introducedDate> <committeeReports /> <cosponsors> <item> <middleName>J.</middleName> <firstName>RICHARD</firstName> <fullName>Sen. Durbin, Richard J. [D-IL]</fullName> <bioguideId>D000563</bioguideId> <isOriginalCosponsor>True</isOriginalCosponsor> <sponsorshipDate>2017-06-15</sponsorshipDate> <party>D</party> <lastName>DURBIN</lastName> <state>IL</state> <sponsorshipWithdrawnDate /> <identifiers> <gpoId>8326</gpoId> <bioguideId>D000563</bioguideId> <lisID>326</lisID> </identifiers> </item> <item> <middleName /> <firstName>Bob</firstName> <fullName>Sen. Corker, Bob [R-TN]</fullName> <bioguideId>C001071</bioguideId> <isOriginalCosponsor>True</isOriginalCosponsor> <sponsorshipDate>2017-06-15</sponsorshipDate> <party>R</party> <lastName>Corker</lastName> <state>TN</state> <sponsorshipWithdrawnDate /> <identifiers> <bioguideId>C001071</bioguideId> <lisID>1825</lisID> <gpoId>8294</gpoId> </identifiers> </item> <item> <middleName /> <firstName>Joni</firstName> <fullName>Sen. Ernst, Joni [R-IA]</fullName> <bioguideId>E000295</bioguideId> <isOriginalCosponsor>True</isOriginalCosponsor> <sponsorshipDate>2017-06-15</sponsorshipDate> <party>R</party> <lastName>Ernst</lastName> <state>IA</state> <sponsorshipWithdrawnDate /> <identifiers> <gpoId /> <lisID>2283</lisID> <bioguideId>E000295</bioguideId> </identifiers> </item> <item> <middleName /> <firstName>DIANNE</firstName> <fullName>Sen. Feinstein, Dianne [D-CA]</fullName> <bioguideId>F000062</bioguideId> <isOriginalCosponsor>True</isOriginalCosponsor> <sponsorshipDate>2017-06-15</sponsorshipDate> <party>D</party> <lastName>FEINSTEIN</lastName> <state>CA</state> <sponsorshipWithdrawnDate /> <identifiers> <bioguideId>F000062</bioguideId> <lisID>1332</lisID> <gpoId>8338</gpoId> </identifiers> </item> <item> <middleName /> <firstName>Luther</firstName> <fullName>Sen. Strange, Luther [R-AL]</fullName> <bioguideId>S001202</bioguideId> <isOriginalCosponsor>True</isOriginalCosponsor> <sponsorshipDate>2017-06-15</sponsorshipDate> <party>R</party> <lastName>Strange</lastName> <state>AL</state> <sponsorshipWithdrawnDate /> <identifiers> <bioguideId>S001202</bioguideId> <lisID>2357</lisID> <gpoId /> </identifiers> </item> <item> <middleName>Alfred</middleName> <firstName>David</firstName> <fullName>Sen. Perdue, David [R-GA]</fullName> <bioguideId>P000612</bioguideId> <isOriginalCosponsor>True</isOriginalCosponsor> <sponsorshipDate>2017-06-15</sponsorshipDate> <party>R</party> <lastName>Perdue</lastName> <state>GA</state> <sponsorshipWithdrawnDate /> <identifiers> <lisID>2286</lisID> <gpoId /> <bioguideId>P000612</bioguideId> </identifiers> </item> </cosponsors> <calendarNumbers /> <subjects> <billSubjects> <policyArea> <name>Animals</name> </policyArea> <legislativeSubjects> <item> <name>Birds</name> </item> <item> <name>Currency</name> </item> <item> <name>Elementary and secondary education</name> </item> <item> <name>Endangered and threatened species</name> </item> <item> <name>National symbols</name> </item> <item> <name>Wildlife conservation and habitat protection</name> </item> </legislativeSubjects> </billSubjects> </subjects> <sponsors> <item> <firstName>Lamar</firstName> <identifiers> <lisID>1695</lisID> <bioguideId>A000360</bioguideId> <gpoId>8304</gpoId> </identifiers> <byRequestType /> <bioguideId>A000360</bioguideId> <middleName /> <lastName>Alexander</lastName> <fullName>Sen. Alexander, Lamar [R-TN]</fullName> <party>R</party> <state>TN</state> </item> </sponsors> <notes /> <createDate>2017-06-16T00:41:34Z</createDate> <billNumber>191</billNumber> <version>1.0.0</version> <laws /> <originChamber>Senate</originChamber> <summaries> <billSummaries> <item> <actionDate>2017-06-15</actionDate> <actionDesc>Introduced in Senate</actionDesc> <versionCode>00</versionCode> <name>Introduced in Senate</name> <text><![CDATA[<p>Designates June 20, 2017, as American Eagle Day. Applauds the issuance of bald eagle commemorative coins by the Department of the Treasury to generate funds for the protection of the bald eagle. Encourages entities with an interest in conserving endangered species to collaborate and develop educational tools for use in the public schools.</p>]]></text> <updateDate>2017-06-15T04:00:00Z</updateDate> <lastSummaryUpdateDate>2017-09-28T16:26:07Z</lastSummaryUpdateDate> </item> </billSummaries> </summaries> <titles> <item> <titleType>Official Title as Introduced</titleType> <parentTitleType /> <title>A resolution designating June 20, 2017, as "American Eagle Day" and celebrating the recovery and restoration of the bald eagle, the national symbol of the United States.</title> <chamberCode /> <chamberName /> </item> <item> <titleType>Display Title</titleType> <parentTitleType /> <title>A resolution designating June 20, 2017, as "American Eagle Day" and celebrating the recovery and restoration of the bald eagle, the national symbol of the United States.</title> <chamberCode /> <chamberName /> </item> </titles> <title>A resolution designating June 20, 2017, as "American Eagle Day" and celebrating the recovery and restoration of the bald eagle, the national symbol of the United States.</title> <actions> <actionByCounts> <senate>3</senate> </actionByCounts> <item> <actionDate>2017-06-15</actionDate> <committee /> <links> <link> <name>S3558</name> <url>https://www.congress.gov/congressional-record/volume-163/senate-section/page/S3558</url> </link> <link> <name>S3560</name> <url>https://www.congress.gov/congressional-record/volume-163/senate-section/page/S3560</url> </link> </links> <sourceSystem> <code>0</code> <name>Senate</name> </sourceSystem> <text>Submitted in the Senate, considered, and agreed to without amendment and with a preamble by Unanimous Consent. (consideration: CR S3560; text: CR S3558)</text> <type>Floor</type> </item> <item> <actionCode>17000</actionCode> <links> <link> <name>S3558</name> <url>https://www.congress.gov/congressional-record/volume-163/senate-section/page/S3558</url> </link> <link> <name>S3560</name> <url>https://www.congress.gov/congressional-record/volume-163/senate-section/page/S3560</url> </link> </links> <sourceSystem> <code>9</code> <name>Library of Congress</name> </sourceSystem> <type>Floor</type> <actionDate>2017-06-15</actionDate> <committee /> <text>Passed/agreed to in Senate: Submitted in the Senate, considered, and agreed to without amendment and with a preamble by Unanimous Consent.(consideration: CR S3560; text: CR S3558)</text> </item> <item> <actionCode>10000</actionCode> <links /> <sourceSystem> <code>9</code> <name>Library of Congress</name> </sourceSystem> <type>IntroReferral</type> <actionDate>2017-06-15</actionDate> <committee /> <text>Introduced in Senate</text> </item> <actionTypeCounts> <passedAgreedToInSenate>1</passedAgreedToInSenate> <passedOrAgreedToInSenateDayOf>1</passedOrAgreedToInSenateDayOf> <introducedInSenate>1</introducedInSenate> </actionTypeCounts> </actions> <billType>SRES</billType> <cboCostEstimates /> <amendments /> <updateDate>2017-10-04T04:47:37Z</updateDate> <committees> <billCommittees /> </committees> <congress>115</congress> <recordedVotes /> <policyArea> <name>Animals</name> </policyArea> </bill> <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:format>text/xml</dc:format> <dc:language>EN</dc:language> <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights> <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor> <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description> </dublinCore> </billStatus>
{ "content_hash": "51a7437500cf350072a9e188908decfe", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 676, "avg_line_length": 38.0355871886121, "alnum_prop": 0.6134917664670658, "repo_name": "peter765/power-polls", "id": "56fb07294cc0ee738eba80f0382a4b62c826509e", "size": "10688", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/bills/sres/sres191/fdsys_billstatus.xml", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "58567" }, { "name": "JavaScript", "bytes": "7370" }, { "name": "Python", "bytes": "22988" } ], "symlink_target": "" }
import React from 'react'; import Heading from '../styling/heading'; import CodeBlock from '../documentation/code-block'; import Example from '../examples/browserstack'; const dotenvExample = 'BROWSER_STACK_USERNAME={your browser stack username}\nBROWSER_STACK_ACCESS_KEY={your browser stack access key}'; function Documentation() { return ( <div> <Heading>Browser Stack</Heading> <p> Browser Stack is a cloud provider. It requires a monthly or yearly subscription, but offers free plans for open source projects. </p> <p> Start by signing up for an account at{' '}<a href="https://www.browserstack.com/">browserstack.com</a>, then set the following environment variables: </p> <dl> <dt>BROWSER_STACK_USERNAME</dt> <dd>Your browser stack username.</dd> <dt>BROWSER_STACK_ACCESS_KEY</dt> <dd>Your browser statck access key.</dd> </dl> <p> To do this locally, you can create a{' '}<a href="https://github.com/motdotla/dotenv"><code>.env</code></a>{' '}file in your project's root directory: </p> <CodeBlock>{dotenvExample}</CodeBlock> <p>Then you can test using code like:</p> <Example /> </div> ); } export default Documentation;
{ "content_hash": "44bd0b2f533f832d2ceb9b5e3f9d3e9a", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 135, "avg_line_length": 35.24324324324324, "alnum_prop": 0.6357361963190185, "repo_name": "ForbesLindesay/cabbie", "id": "017a798757d808ab6dc87f3a8f9b8ce2badcdac0", "size": "1304", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "www/ui/getting-started/browserstack.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "4351" }, { "name": "JavaScript", "bytes": "220439" } ], "symlink_target": "" }
import {Color} from 'ol/color'; import {ColorLike} from 'ol/colorlike'; import {SerializedImage} from './serialized-image.type'; export type SerializedStyle = { fill?: Color | ColorLike; stroke?: {color: Color | ColorLike; width: number}; image?: SerializedImage; };
{ "content_hash": "8d506438aedab9586127a3715b3fc3c9", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 56, "avg_line_length": 27.5, "alnum_prop": 0.7090909090909091, "repo_name": "hslayers/hslayers-ng", "id": "5ac7067a0662f06e00284a8170cfc807b8259032", "size": "275", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "projects/hslayers/src/components/save-map/types/serialized-style.type.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10001" }, { "name": "HTML", "bytes": "353069" }, { "name": "JavaScript", "bytes": "65287" }, { "name": "Makefile", "bytes": "754" }, { "name": "Pug", "bytes": "1115" }, { "name": "SCSS", "bytes": "62306" }, { "name": "Sass", "bytes": "400" }, { "name": "Shell", "bytes": "4406" }, { "name": "TypeScript", "bytes": "1837217" } ], "symlink_target": "" }
layout: resource title: "Mozilla" date: 2015-08-02 resourceURL: https://developer.mozilla.org/en-US/ titleImg: /assets/images/CanIUse.png categories : [resource, documentation] --- CanIUse provides information about which browsers support which HTML, CSS, and Javascript APIs. Additionally, certain browsers support apis, but with certain prefixes (like *-webkit* or *-moz*). It can even tell you its "relative" support by comparing general browser usage statistics to the compatability information. TLDR when you are thinking about using a new-ish browser technology, checkout this website for more information about how well it's supported.
{ "content_hash": "f1caa49514b1f92d9ef17bbe0869c590", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 318, "avg_line_length": 59, "alnum_prop": 0.7904468412942989, "repo_name": "nhahn/SSUI-Web-2015", "id": "8f9c5f1fe080fdecbc79b61ff7396b6fea289609", "size": "653", "binary": false, "copies": "2", "ref": "refs/heads/gh-pages", "path": "_posts/resources/2015-08-02-react.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "7263" }, { "name": "HTML", "bytes": "18406" }, { "name": "JavaScript", "bytes": "39199" }, { "name": "Ruby", "bytes": "3302" } ], "symlink_target": "" }
// SNMP end of MIB view exception type (v2 and above). // Copyright (C) 2008-2010 Malcolm Crowe, Lex Li, and other contributors. // // Permission is hereby granted, free of charge, to any person obtaining a copy of this // software and associated documentation files (the "Software"), to deal in the Software // without restriction, including without limitation the rights to use, copy, modify, merge, // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons // to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. using System; using System.Diagnostics.CodeAnalysis; using System.IO; namespace Snmp.Core { /// <summary> /// EndOfMibView exception. /// </summary> [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed. Suppression is OK here.")] [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Mib")] public sealed class EndOfMibView : ISnmpData, IEquatable<EndOfMibView> { private readonly byte[] _length; /// <summary> /// Initializes a new instance of the <see cref="EndOfMibView"/> class. /// </summary> /// <param name="length">The length data.</param> /// <param name="stream">The stream.</param> public EndOfMibView(Tuple<int, byte[]> length, Stream stream) { if (length == null) { throw new ArgumentNullException("length"); } if (stream == null) { throw new ArgumentNullException("stream"); } stream.IgnoreBytes(length.Item1); _length = length.Item2; } /// <summary> /// Initializes a new instance of the <see cref="EndOfMibView"/> class. /// </summary> public EndOfMibView() { } #region Equals and GetHashCode implementation /// <summary> /// Determines whether the specified <see cref="Object"/> is equal to the current <see cref="EndOfMibView"/>. /// </summary> /// <param name="obj">The <see cref="Object"/> to compare with the current <see cref="EndOfMibView"/>. </param> /// <returns><value>true</value> if the specified <see cref="Object"/> is equal to the current <see cref="EndOfMibView"/>; otherwise, <value>false</value>. /// </returns> public override bool Equals(object obj) { return Equals(this, obj as EndOfMibView); } /// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns>A hash code for the current <see cref="Null"/>.</returns> public override int GetHashCode() { return 0; } /// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <param name="other">An object to compare with this object.</param> /// <returns><value>true</value> if the current object is equal to the <paramref name="other"/> parameter; otherwise, <value>false</value>. /// </returns> public bool Equals(EndOfMibView other) { return Equals(this, other); } /// <summary> /// The equality operator. /// </summary> /// <param name="left">Left <see cref="EndOfMibView"/> object</param> /// <param name="right">Right <see cref="EndOfMibView"/> object</param> /// <returns> /// Returns <c>true</c> if the values of its operands are equal, <c>false</c> otherwise.</returns> public static bool operator ==(EndOfMibView left, EndOfMibView right) { return Equals(left, right); } /// <summary> /// The inequality operator. /// </summary> /// <param name="left">Left <see cref="EndOfMibView"/> object</param> /// <param name="right">Right <see cref="EndOfMibView"/> object</param> /// <returns> /// Returns <c>true</c> if the values of its operands are not equal, <c>false</c> otherwise.</returns> public static bool operator !=(EndOfMibView left, EndOfMibView right) { return !(left == right); // use operator == and negate result } #endregion /// <summary> /// Type code. /// </summary> public SnmpType TypeCode { get { return SnmpType.EndOfMibView; } } /// <summary> /// Appends the bytes to <see cref="Stream"/>. /// </summary> /// <param name="stream">The stream.</param> public void AppendBytesTo(Stream stream) { if (stream == null) { throw new ArgumentNullException("stream"); } stream.AppendBytes(TypeCode, _length, new byte[0]); } /// <summary> /// Returns a <see cref="String"/> that represents this <see cref="Null"/>. /// </summary> /// <returns></returns> public override string ToString() { return "EndOfMibView"; } /// <summary> /// The comparison. /// </summary> /// <param name="left">Left <see cref="EndOfMibView"/> object</param> /// <param name="right">Right <see cref="EndOfMibView"/> object</param> /// <returns> /// Returns <c>true</c> if the values of its operands are not equal, <c>false</c> otherwise.</returns> private static bool Equals(EndOfMibView left, EndOfMibView right) { object lo = left; object ro = right; if (lo == ro) { return true; } return lo != null && ro != null; } } }
{ "content_hash": "47b209af851de92b71d39849f3159232", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 165, "avg_line_length": 38.395348837209305, "alnum_prop": 0.5840399757722592, "repo_name": "RogerBai/Snmp.Core", "id": "006c6a350a32a1ab78832017eb93abd6b122aab6", "size": "6606", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Snmp.Core/EndOfMibView.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "636894" } ], "symlink_target": "" }
package org.springframework.jms.connection; import org.springframework.transaction.support.SmartTransactionObject; /** * JMS transaction object, representing a ConnectionHolder. * Used as transaction object by JmsTransactionManager. * * <p>Note: This is an SPI class, not intended to be used by applications. * * @author Juergen Hoeller * @since 1.1 * @see JmsTransactionManager */ public class JmsTransactionObject implements SmartTransactionObject { private ConnectionHolder connectionHolder; protected void setConnectionHolder(ConnectionHolder connectionHolder) { this.connectionHolder = connectionHolder; } public ConnectionHolder getConnectionHolder() { return connectionHolder; } public boolean isRollbackOnly() { return getConnectionHolder().isRollbackOnly(); } }
{ "content_hash": "3f903195a1e2838cae6c79ce97e5b9b9", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 74, "avg_line_length": 24.303030303030305, "alnum_prop": 0.7892768079800498, "repo_name": "dachengxi/spring1.1.1_source", "id": "5b115d1612b495111b1402eb63f819dc2c2b7e7d", "size": "1422", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/org/springframework/jms/connection/JmsTransactionObject.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "163" }, { "name": "FreeMarker", "bytes": "8024" }, { "name": "HTML", "bytes": "34675" }, { "name": "Java", "bytes": "5934573" } ], "symlink_target": "" }
package net.safedata.springboot.training.d01.s04.service; import net.safedata.springboot.training.d01.s04.repository.ProductRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Objects; /** * A simple product service, which uses a {@link ProductRepository} as a collaborator * * @author bogdan.solga */ @Service public class ProductService { private final ProductRepository productRepository; @Autowired // = 'I (the class) need to use a bean of type ProductRepository; please (-> Spring) wire an object here' public ProductService(final ProductRepository productRepository) { this.productRepository = productRepository; } public void displayProducts() { productRepository.displayProducts(); } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ProductService)) return false; ProductService that = (ProductService) o; return Objects.equals(productRepository, that.productRepository); } @Override public int hashCode() { return Objects.hash(productRepository); } }
{ "content_hash": "43fa65ac540e106a070392160e835469", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 120, "avg_line_length": 30.15, "alnum_prop": 0.7222222222222222, "repo_name": "bogdansolga/spring-boot-training", "id": "cb6b834ae398f439c457e555e2b8120b0a1f18b2", "size": "1206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "d01/d01s04-component-scanning-and-qualifying/d01s04e01-component-scan/src/main/java/net/safedata/springboot/training/d01/s04/service/ProductService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "1403" }, { "name": "Java", "bytes": "375139" } ], "symlink_target": "" }
import Test.Tasty import Test_6_WorkingWithLists -- -- The following command runs all the tests for part 6: -- -- stack test diy-lang-haskell:test-6 -- main :: IO () main = defaultMain $ testGroup "\nDIY Lang: Testing Part 6" [ workingWithListsTests ]
{ "content_hash": "8fb4c78da8bf0c6dcd777f77c86274be", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 55, "avg_line_length": 22, "alnum_prop": 0.6398601398601399, "repo_name": "joelchelliah/diy-lang-haskell", "id": "d44e0d61297e78e028e285951279a56417a83a52", "size": "286", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/Test_only_6.hs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Haskell", "bytes": "69752" } ], "symlink_target": "" }
// Copyright 2021 Proyectos y Sistemas de Mantenimiento SL (eProsima). // // 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. /** * @file FileProvider.hpp */ #ifndef _SECURITY_ARTIFACTPROVIDERS_FILEPROVIDER_HPP_ #define _SECURITY_ARTIFACTPROVIDERS_FILEPROVIDER_HPP_ #include <functional> #include <openssl/engine.h> #include <openssl/err.h> #include <openssl/ssl.h> #include <fastdds/rtps/security/exceptions/SecurityException.h> namespace eprosima { namespace fastrtps { namespace rtps { namespace security { namespace detail { class FileProvider { public: static X509_STORE* load_ca( const std::string& ca, bool& there_are_crls, std::string& ca_sn, std::string& ca_algo, std::function<bool(X509*, std::string&, SecurityException&)> get_signature_algorithm, SecurityException& exception); static EVP_PKEY* load_private_key( X509* certificate, const std::string& file, const std::string& password, SecurityException& exception); static X509* load_certificate( const std::string& identity_cert, SecurityException& exception); static X509_CRL* load_crl( const std::string& identity_crl, SecurityException& exception); }; } // namespace detail } //namespace security } //namespace rtps } //namespace fastrtps } //namespace eprosima #endif // _SECURITY_ARTIFACTPROVIDERS_FILEPROVIDER_HPP_
{ "content_hash": "b03987d30ca590c26e65e3c9001a0bb5", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 97, "avg_line_length": 27.65277777777778, "alnum_prop": 0.6860873932697137, "repo_name": "eProsima/Fast-DDS", "id": "ca3459fd66dbd06f21e0d132122bab0dfc87e428", "size": "1991", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/cpp/security/artifact_providers/FileProvider.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "874" }, { "name": "C", "bytes": "9035166" }, { "name": "C++", "bytes": "19044069" }, { "name": "CMake", "bytes": "450920" }, { "name": "CSS", "bytes": "28054" }, { "name": "HTML", "bytes": "2698" }, { "name": "M4", "bytes": "12825" }, { "name": "PowerShell", "bytes": "954" }, { "name": "Python", "bytes": "125888" }, { "name": "Shell", "bytes": "5639" } ], "symlink_target": "" }
package com.alibaba.json.bvt.util; import java.lang.reflect.Field; import java.lang.reflect.Method; import com.alibaba.fastjson.util.ThreadLocalCache; import org.junit.Assert; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.serializer.SerializeWriter; import com.alibaba.fastjson.util.IOUtils; import junit.framework.TestCase; public class ThreadLocalCacheTest extends TestCase { public void test() throws Exception { clearChars(); Assert.assertEquals(allocateChars(0).length, 1024 * 64); Assert.assertEquals(allocateChars(1024).length, 1024 * 64); Assert.assertEquals(allocateChars(2048).length, 1024 * 64); Assert.assertEquals(allocateChars(0).length, 1024 * 64); Assert.assertEquals(allocateChars(1024 * 128).length, 1024 * 128); Assert.assertEquals(allocateChars(0).length, 1024 * 64); clearChars(); Assert.assertEquals(allocateChars(2048).length, 1024 * 64); clearChars(); Assert.assertEquals(allocateChars(1024 * 256).length, 1024 * 256); Assert.assertEquals(allocateChars(0).length, 1024 * 64); clearChars(); } static char[] allocateChars(int length) throws Exception { Method method = JSON.class.getDeclaredMethod("allocateChars", int.class); method.setAccessible(true); return (char[]) method.invoke(null, length); } public static void clearChars() throws Exception { Field field = JSON.class.getDeclaredField("charsLocal"); field.setAccessible(true); ThreadLocal<char[]> charsLocal = (ThreadLocal<char[]>) field.get(null); charsLocal.set(null); } public void testBytes() throws Exception { clearBytes(); Assert.assertEquals(getBytes(0).length, 8192); Assert.assertEquals(getBytes(1024).length, 8192); Assert.assertEquals(getBytes(8192 * 2).length, 8192 * 2); Assert.assertEquals(getBytes(0).length, 8192); Assert.assertSame(getBytes(0), getBytes(1204)); Assert.assertNotSame(getBytes(9000), getBytes(9000)); clearBytes(); Assert.assertEquals(getBytes(2048).length, 8192); clearBytes(); Assert.assertEquals(getBytes(1024 * 256).length, 1024 * 256); Assert.assertEquals(getBytes(0).length, 8192); clearBytes(); } public static byte[] getBytes(int length) throws Exception { Field field = SerializeWriter.class.getDeclaredField("bytesBufLocal"); field.setAccessible(true); ThreadLocal<byte[]> bytesBufLocal = (ThreadLocal<byte[]>) field.get(null); byte[] bytes = bytesBufLocal.get(); if (bytes == null) { bytes = new byte[1024 * 8]; bytesBufLocal.set(bytes); } return bytes.length < length // ? new byte[length] // : bytes; } public static void clearBytes() throws Exception { Field field = SerializeWriter.class.getDeclaredField("bytesBufLocal"); field.setAccessible(true); ThreadLocal<byte[]> bytesBufLocal = (ThreadLocal<byte[]>) field.get(null); bytesBufLocal.set(null); } public void test_chars() throws Exception { ThreadLocalCache.getChars(10); ThreadLocalCache.getChars(10); ThreadLocalCache.getChars(20); ThreadLocalCache.getChars(30); clearChars(); ThreadLocalCache.getChars(10); ThreadLocalCache.getChars(10); ThreadLocalCache.getChars(20); ThreadLocalCache.getChars(30); ThreadLocalCache.clearChars(); ThreadLocalCache.getUTF8Decoder(); ThreadLocalCache.getUTF8Decoder(); } public void test_bytes() throws Exception { ThreadLocalCache.getBytes(10); ThreadLocalCache.getBytes(10); ThreadLocalCache.getBytes(20); ThreadLocalCache.getBytes(30); clearBytes(); ThreadLocalCache.getBytes(10); ThreadLocalCache.getBytes(10); ThreadLocalCache.getBytes(20); ThreadLocalCache.getBytes(30); } }
{ "content_hash": "ee83eb8bc5571036588a234df1569b8c", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 82, "avg_line_length": 33.20161290322581, "alnum_prop": 0.649987855234394, "repo_name": "alibaba/fastjson", "id": "bd0259ffdda63f78ddbfa1f7532f70ab22100b7f", "size": "4117", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/com/alibaba/json/bvt/util/ThreadLocalCacheTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "7489145" }, { "name": "JavaScript", "bytes": "3661" }, { "name": "Kotlin", "bytes": "5407" }, { "name": "Shell", "bytes": "414" } ], "symlink_target": "" }
package org.apache.xmlbeans; import org.apache.xmlbeans.impl.schema.XmlObjectFactory; /** * Corresponds to the XML Schema * <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#NMTOKEN">xs:NMTOKEN</a> type. * One of the derived types based on <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#string">xs:string</a>. * <p> * An NMTOKEN is XML's closest concept to an "identifier"; for example, * it does not permit spaces and only limited punctuation. So NMTOKEN is * commonly used to describe a single token or enumerated string value. * <p> * Convertible to {@link String}. */ public interface XmlNMTOKEN extends XmlToken { XmlObjectFactory<XmlNMTOKEN> Factory = new XmlObjectFactory<>("_BI_NMTOKEN"); /** * The constant {@link SchemaType} object representing this schema type. */ SchemaType type = Factory.getType(); }
{ "content_hash": "f64940b91e017b5dc369958228a62a19", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 118, "avg_line_length": 33.65384615384615, "alnum_prop": 0.7074285714285714, "repo_name": "apache/xmlbeans", "id": "712bfaee9cf514300db11987a6e8513b98de796d", "size": "1504", "binary": false, "copies": "2", "ref": "refs/heads/trunk", "path": "src/main/java/org/apache/xmlbeans/XmlNMTOKEN.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "60552" }, { "name": "CSS", "bytes": "1961" }, { "name": "HTML", "bytes": "2640" }, { "name": "Java", "bytes": "7628118" }, { "name": "Shell", "bytes": "37436" }, { "name": "XQuery", "bytes": "2172" }, { "name": "XS", "bytes": "6502" }, { "name": "XSLT", "bytes": "78459" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=fn.atomic_cxchg.html"> </head> <body> <p>Redirecting to <a href="fn.atomic_cxchg.html">fn.atomic_cxchg.html</a>...</p> <script>location.replace("fn.atomic_cxchg.html" + location.search + location.hash);</script> </body> </html>
{ "content_hash": "453fe45955b8724ade3733927ea818a1", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 96, "avg_line_length": 32.1, "alnum_prop": 0.6666666666666666, "repo_name": "liigo/liigo.github.io", "id": "d3f8527133cbf4bfb7fac6d019658b626ae25131", "size": "321", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tmp/rust/inline-sidebar-items/std/intrinsics/atomic_cxchg.v.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "11826" }, { "name": "HTML", "bytes": "3895" }, { "name": "JavaScript", "bytes": "48" } ], "symlink_target": "" }
<header class="page-header"> <div class="container"> <h1 class="project-name"> <a href="/">{{ site.title | default: site.github.repository_name }}</a> </h1> <h2 class="project-tagline">{{ site.description | default: site.github.project_tagline }}</h2> {% if site.github.is_project_page %} <a href="{{ site.github.repository_url }}" class="btn">View on GitHub</a> {% endif %} <section id="downloads"> {% if site.show_downloads %} <a href="{{ site.github.zip_url }}" class="btn">Download .zip</a> <a href="{{ site.github.tar_url }}" class="btn">Download .tar.gz</a> {% endif %} </div> </header>
{ "content_hash": "8ef705fd210f073ec7ad5b556e9d73b5", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 98, "avg_line_length": 36.833333333333336, "alnum_prop": 0.583710407239819, "repo_name": "defrank/defrank.github.io", "id": "535289dd54449607049964377b112b353d82530b", "size": "663", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "_includes/header.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "115" }, { "name": "HTML", "bytes": "30898" }, { "name": "JavaScript", "bytes": "798" }, { "name": "Makefile", "bytes": "58" }, { "name": "Ruby", "bytes": "7810" } ], "symlink_target": "" }
// Copyright (c) 2011-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_ADDRESSTABLEMODEL_H #define BITCOIN_QT_ADDRESSTABLEMODEL_H #include <QAbstractTableModel> #include <QStringList> enum class OutputType; class AddressTablePriv; class WalletModel; namespace interfaces { class Wallet; } /** Qt model of the address book in the core. This allows views to access and modify the address book. */ class AddressTableModel : public QAbstractTableModel { Q_OBJECT public: explicit AddressTableModel(WalletModel *parent = nullptr, bool pk_hash_only = false); ~AddressTableModel(); enum ColumnIndex { Label = 0, /**< User specified label */ Address = 1 /**< Bitcoin address */ }; enum RoleIndex { TypeRole = Qt::UserRole /**< Type of address (#Send or #Receive) */ }; /** Return status of edit/insert operation */ enum EditStatus { OK, /**< Everything ok */ NO_CHANGES, /**< No changes were made during edit operation */ INVALID_ADDRESS, /**< Unparseable address */ DUPLICATE_ADDRESS, /**< Address already in address book */ WALLET_UNLOCK_FAILURE, /**< Wallet could not be unlocked to create new receiving address */ KEY_GENERATION_FAILURE /**< Generating a new public key for a receiving address failed */ }; static const QString Send; /**< Specifies send address */ static const QString Receive; /**< Specifies receive address */ /** @name Methods overridden from QAbstractTableModel @{*/ int rowCount(const QModelIndex &parent) const override; int columnCount(const QModelIndex &parent) const override; QVariant data(const QModelIndex &index, int role) const override; bool setData(const QModelIndex &index, const QVariant &value, int role) override; QVariant headerData(int section, Qt::Orientation orientation, int role) const override; QModelIndex index(int row, int column, const QModelIndex &parent) const override; bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; Qt::ItemFlags flags(const QModelIndex &index) const override; /*@}*/ /* Add an address to the model. Returns the added address on success, and an empty string otherwise. */ QString addRow(const QString &type, const QString &label, const QString &address, const OutputType address_type); /** Look up label for address in address book, if not found return empty string. */ QString labelForAddress(const QString &address) const; /** Look up purpose for address in address book, if not found return empty string. */ QString purposeForAddress(const QString &address) const; /* Look up row index of an address in the model. Return -1 if not found. */ int lookupAddress(const QString &address) const; EditStatus getEditStatus() const { return editStatus; } OutputType GetDefaultAddressType() const; private: WalletModel* const walletModel; AddressTablePriv *priv = nullptr; QStringList columns; EditStatus editStatus = OK; /** Look up address book data given an address string. */ bool getAddressData(const QString &address, std::string* name, std::string* purpose) const; /** Notify listeners that data changed. */ void emitDataChanged(int index); public Q_SLOTS: /* Update address list from core. */ void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status); friend class AddressTablePriv; }; #endif // BITCOIN_QT_ADDRESSTABLEMODEL_H
{ "content_hash": "0ea652fcba7aa58ab17e96a3d8004c05", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 117, "avg_line_length": 36.15238095238095, "alnum_prop": 0.6917808219178082, "repo_name": "litecoin-project/litecoin", "id": "73316cadc4e155114650b4ed42bdf996d984ebc2", "size": "3796", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "src/qt/addresstablemodel.h", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "898000" }, { "name": "C", "bytes": "1594708" }, { "name": "C++", "bytes": "8860047" }, { "name": "CMake", "bytes": "29310" }, { "name": "HTML", "bytes": "21833" }, { "name": "Java", "bytes": "30291" }, { "name": "M4", "bytes": "226003" }, { "name": "Makefile", "bytes": "123607" }, { "name": "Objective-C++", "bytes": "5489" }, { "name": "Python", "bytes": "2267056" }, { "name": "QMake", "bytes": "798" }, { "name": "Sage", "bytes": "31382" }, { "name": "Scheme", "bytes": "7554" }, { "name": "Shell", "bytes": "150309" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <title>React App</title> <link rel="stylesheet" href="app/static/css/bootstrap.min.css"> <link rel="stylesheet" href="app/static/css/reactStyles.css"> </head> <body class="Site"> <div id='ReactApp'/> <script src="bundle.js"></script></body> </html>
{ "content_hash": "477a765927ed247892b16ac1be218020", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 72, "avg_line_length": 31.333333333333332, "alnum_prop": 0.6462765957446809, "repo_name": "nii236/speedy-quiz", "id": "80851c2325ea49388a4f34fe31dc10acadbf2423", "size": "376", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3302" }, { "name": "HTML", "bytes": "3002" }, { "name": "JavaScript", "bytes": "20506" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>HTML 4 Transitional Document Type Definition</title> <link rel="previous" href="dtd.html"> <link rel="next" href="framesetdtd.html"> <link rel="contents" href="../cover.html#toc"> <link rel="stylesheet" type="text/css" href= "http://www.w3.org/StyleSheets/TR/W3C-REC"> <link rel="STYLESHEET" href="../style/default.css" type="text/css"> </head> <body> <div class="navbar" align="center">&nbsp;<a href="dtd.html">previous</a> &nbsp; <a href="framesetdtd.html">next</a> &nbsp; <a href="../cover.html#minitoc"> contents</a> &nbsp; <a href="../index/elements.html">elements</a> &nbsp; <a href="../index/attributes.html">attributes</a> &nbsp; <a href= "../index/list.html">index</a> <hr></div> <h1 align="center"><a name="h-22">22</a> <span class="index-def" title= "transitional DTD::definition of|document type definition::transitional"><a name="loosedtd">Transitional Document Type Definition</a></span></h1> <div class="dtd-fragment"> <pre class="dtd"> &lt;!-- This is the HTML 4.01 Transitional DTD, which includes presentation attributes and elements that W3C expects to phase out as support for style sheets matures. Authors should use the Strict DTD when possible, but may use the Transitional DTD when support for presentation attribute and elements is required. HTML 4 includes mechanisms for style sheets, scripting, embedding objects, improved support for right to left and mixed direction text, and enhancements to forms for improved accessibility for people with disabilities. Draft: $Date: 1999/12/24 23:37:50 $ Authors: Dave Raggett &lt;[email protected]&gt; Arnaud Le Hors &lt;[email protected]&gt; Ian Jacobs &lt;[email protected]&gt; Further information about HTML 4.01 is available at: <a href= "http://www.w3.org/TR/1999/REC-html401-19991224">http://www.w3.org/TR/1999/REC-html401-19991224</a> The HTML 4.01 specification includes additional syntactic constraints that cannot be expressed within the DTDs. --&gt; &lt;!ENTITY % <a name= "HTML.Version">HTML.Version</a> "-//W3C//DTD HTML 4.01 Transitional//EN" -- Typical usage: &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; ... &lt;/head&gt; &lt;body&gt; ... &lt;/body&gt; &lt;/html&gt; The URI used as a system identifier with the public identifier allows the user agent to download the DTD and entity sets as needed. The FPI for the Strict HTML 4.01 DTD is: "-//W3C//DTD HTML 4.01//EN" This version of the strict DTD is: http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd Authors should use the Strict DTD unless they need the presentation control for user agents that don't (adequately) support style sheets. If you are writing a document that includes frames, use the following FPI: "-//W3C//DTD HTML 4.01 Frameset//EN" This version of the frameset DTD is: http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd Use the following (relative) URIs to refer to the DTDs and entity definitions of this specification: "<a href="../strict.dtd">strict.dtd</a>" "<a href="../loose.dtd">loose.dtd</a>" "<a href="../frameset.dtd">frameset.dtd</a>" "<a href="../HTMLlat1.ent">HTMLlat1.ent</a>" "<a href="../HTMLsymbol.ent">HTMLsymbol.ent</a>" "<a href="../HTMLspecial.ent">HTMLspecial.ent</a>" --&gt; &lt;!--================== Imported Names ====================================--&gt; &lt;!-- Feature Switch for frameset documents --&gt; &lt;!ENTITY % <a name="HTML.Frameset">HTML.Frameset</a> "IGNORE"&gt; &lt;!ENTITY % <a name="ContentType">ContentType</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- media type, as per <a rel="biblioentry" href= "../references.html#ref-RFC2045">[RFC2045]</a> --&gt; &lt;!ENTITY % <a name="ContentTypes">ContentTypes</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- comma-separated list of media types, as per <a rel="biblioentry" href= "../references.html#ref-RFC2045">[RFC2045]</a> --&gt; &lt;!ENTITY % <a name="Charset">Charset</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- a character encoding, as per <a rel="biblioentry" href= "../references.html#ref-RFC2045">[RFC2045]</a> --&gt; &lt;!ENTITY % <a name="Charsets">Charsets</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- a space-separated list of character encodings, as per <a rel= "biblioentry" href="../references.html#ref-RFC2045">[RFC2045]</a> --&gt; &lt;!ENTITY % <a name="LanguageCode">LanguageCode</a> "<a href= "../types.html#type-name">NAME</a>" -- a language code, as per <a rel="biblioentry" href= "../references.html#ref-RFC1766">[RFC1766]</a> --&gt; &lt;!ENTITY % <a name="Character">Character</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- a single character from <a rel="biblioentry" href= "../references.html#ref-ISO10646">[ISO10646]</a> --&gt; &lt;!ENTITY % <a name="LinkTypes">LinkTypes</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- space-separated list of link types --&gt; &lt;!ENTITY % <a name="MediaDesc">MediaDesc</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- single or comma-separated list of media descriptors --&gt; &lt;!ENTITY % <a name="URI">URI</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- a Uniform Resource Identifier, see <a rel="biblioentry" href="../references.html#ref-URI">[URI]</a> --&gt; &lt;!ENTITY % <a name="Datetime">Datetime</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- date and time information. ISO date format --&gt; &lt;!ENTITY % <a name="Script">Script</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- script expression --&gt; &lt;!ENTITY % <a name="StyleSheet">StyleSheet</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- style sheet data --&gt; &lt;!ENTITY % <a name="FrameTarget">FrameTarget</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- render in this frame --&gt; &lt;!ENTITY % <a name="Text">Text</a> "<a href= "../types.html#type-cdata">CDATA</a>"&gt; &lt;!-- Parameter Entities --&gt; &lt;!ENTITY % <a name="head.misc">head.misc</a> "<a href= "../interact/scripts.html#edef-SCRIPT" class="noxref"><samp class= "einst">SCRIPT</samp></a>|<a href="../present/styles.html#edef-STYLE" class= "noxref"><samp class="einst">STYLE</samp></a>|<a href= "../struct/global.html#edef-META" class="noxref"><samp class= "einst">META</samp></a>|<a href="../struct/links.html#edef-LINK" class= "noxref"><samp class="einst">LINK</samp></a>|<a href= "../struct/objects.html#edef-OBJECT" class="noxref"><samp class= "einst">OBJECT</samp></a>" -- repeatable head elements --&gt; &lt;!ENTITY % <a name="heading">heading</a> "<a href= "../struct/global.html#edef-H1" class="noxref"><samp class= "einst">H1</samp></a>|<a href="../struct/global.html#edef-H2" class= "noxref"><samp class="einst">H2</samp></a>|<a href= "../struct/global.html#edef-H3" class="noxref"><samp class= "einst">H3</samp></a>|<a href="../struct/global.html#edef-H4" class= "noxref"><samp class="einst">H4</samp></a>|<a href= "../struct/global.html#edef-H5" class="noxref"><samp class= "einst">H5</samp></a>|<a href="../struct/global.html#edef-H6" class= "noxref"><samp class="einst">H6</samp></a>"&gt; &lt;!ENTITY % <a name="list">list</a> "<a href="../struct/lists.html#edef-UL" class="noxref"><samp class="einst">UL</samp></a> | <a href= "../struct/lists.html#edef-OL" class="noxref"><samp class= "einst">OL</samp></a> | <a href="../struct/lists.html#edef-DIR" class= "noxref"><samp class="einst">DIR</samp></a> | <a href= "../struct/lists.html#edef-MENU" class="noxref"><samp class= "einst">MENU</samp></a>"&gt; &lt;!ENTITY % <a name="preformatted">preformatted</a> "<a href= "../struct/text.html#edef-PRE" class="noxref"><samp class= "einst">PRE</samp></a>"&gt; &lt;!ENTITY % <a name="Color">Color</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- a color using sRGB: #RRGGBB as Hex values --&gt; &lt;!-- There are also 16 widely known color names with their sRGB values: Black = #000000 Green = #008000 Silver = #C0C0C0 Lime = #00FF00 Gray = #808080 Olive = #808000 White = #FFFFFF Yellow = #FFFF00 Maroon = #800000 Navy = #000080 Red = #FF0000 Blue = #0000FF Purple = #800080 Teal = #008080 Fuchsia= #FF00FF Aqua = #00FFFF --&gt; &lt;!ENTITY % <a name="bodycolors">bodycolors</a> " bgcolor <a href= "#Color">%Color;</a> #IMPLIED -- document background color -- text <a href= "#Color">%Color;</a> #IMPLIED -- document text color -- link <a href= "#Color">%Color;</a> #IMPLIED -- color of links -- vlink <a href= "#Color">%Color;</a> #IMPLIED -- color of visited links -- alink <a href= "#Color">%Color;</a> #IMPLIED -- color of selected links -- "&gt; &lt;!--================ Character mnemonic entities =========================--&gt; &lt;!ENTITY % <a name="HTMLlat1">HTMLlat1</a> PUBLIC "-//W3C//ENTITIES Latin1//EN//HTML" "HTMLlat1.ent"&gt; <a href="#HTMLlat1">%HTMLlat1;</a> &lt;!ENTITY % <a name="HTMLsymbol">HTMLsymbol</a> PUBLIC "-//W3C//ENTITIES Symbols//EN//HTML" "HTMLsymbol.ent"&gt; <a href="#HTMLsymbol">%HTMLsymbol;</a> &lt;!ENTITY % <a name="HTMLspecial">HTMLspecial</a> PUBLIC "-//W3C//ENTITIES Special//EN//HTML" "HTMLspecial.ent"&gt; <a href="#HTMLspecial">%HTMLspecial;</a> &lt;!--=================== Generic Attributes ===============================--&gt; &lt;!ENTITY % <a name="coreattrs">coreattrs</a> "<a href="../struct/global.html#adef-id" class="noxref"><samp class= "ainst">id</samp></a> <a href= "../types.html#type-id">ID</a> #IMPLIED -- document-wide unique id -- <a href="../struct/global.html#adef-class" class="noxref"><samp class= "ainst">class</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- space-separated list of classes -- <a href="../present/styles.html#adef-style" class="noxref"><samp class= "ainst">style</samp></a> <a href= "#StyleSheet">%StyleSheet;</a> #IMPLIED -- associated style info -- <a href="../struct/global.html#adef-title" class="noxref"><samp class= "ainst">title</samp></a> <a href= "#Text">%Text;</a> #IMPLIED -- advisory title --" &gt; &lt;!ENTITY % <a name="i18n">i18n</a> "<a href="../struct/dirlang.html#adef-lang" class="noxref"><samp class= "ainst">lang</samp></a> <a href= "#LanguageCode">%LanguageCode;</a> #IMPLIED -- language code -- <a href="../struct/dirlang.html#adef-dir" class="noxref"><samp class= "ainst">dir</samp></a> (ltr|rtl) #IMPLIED -- direction for weak/neutral text --" &gt; &lt;!ENTITY % <a name="events">events</a> "<a href="../interact/scripts.html#adef-onclick" class="noxref"><samp class= "ainst">onclick</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- a pointer button was clicked -- <a href="../interact/scripts.html#adef-ondblclick" class="noxref"><samp class="ainst">ondblclick</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- a pointer button was double clicked-- <a href="../interact/scripts.html#adef-onmousedown" class="noxref"><samp class="ainst">onmousedown</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- a pointer button was pressed down -- <a href="../interact/scripts.html#adef-onmouseup" class="noxref"><samp class= "ainst">onmouseup</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- a pointer button was released -- <a href="../interact/scripts.html#adef-onmouseover" class="noxref"><samp class="ainst">onmouseover</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- a pointer was moved onto -- <a href="../interact/scripts.html#adef-onmousemove" class="noxref"><samp class="ainst">onmousemove</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- a pointer was moved within -- <a href="../interact/scripts.html#adef-onmouseout" class="noxref"><samp class="ainst">onmouseout</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- a pointer was moved away -- <a href="../interact/scripts.html#adef-onkeypress" class="noxref"><samp class="ainst">onkeypress</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- a key was pressed and released -- <a href="../interact/scripts.html#adef-onkeydown" class="noxref"><samp class= "ainst">onkeydown</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- a key was pressed down -- <a href="../interact/scripts.html#adef-onkeyup" class="noxref"><samp class= "ainst">onkeyup</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- a key was released --" &gt; &lt;!-- Reserved Feature Switch --&gt; &lt;!ENTITY % <a name="HTML.Reserved">HTML.Reserved</a> "IGNORE"&gt; &lt;!-- The following attributes are reserved for possible future use --&gt; &lt;![ <a href="#HTML.Reserved">%HTML.Reserved;</a> [ &lt;!ENTITY % <a name="reserved">reserved</a> "<samp class="ainst">datasrc</samp> <a href= "#URI">%URI;</a> #IMPLIED -- a single or tabular Data Source -- <samp class="ainst">datafld</samp> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- the property or column name -- <samp class= "ainst">dataformatas</samp> (plaintext|html) plaintext -- text or html --" &gt; ]]&gt; &lt;!ENTITY % reserved ""&gt; &lt;!ENTITY % <a name="attrs">attrs</a> "<a href= "#coreattrs">%coreattrs;</a> <a href="#i18n">%i18n;</a> <a href= "#events">%events;</a>"&gt; &lt;!ENTITY % <a name= "align">align</a> "align (left|center|right|justify) #IMPLIED" -- default is left for ltr paragraphs, right for rtl -- &gt; &lt;!--=================== Text Markup ======================================--&gt; &lt;!ENTITY % <a name="fontstyle">fontstyle</a> "<a href="../present/graphics.html#edef-TT" class="noxref"><samp class= "einst">TT</samp></a> | <a href="../present/graphics.html#edef-I" class= "noxref"><samp class="einst">I</samp></a> | <a href= "../present/graphics.html#edef-B" class="noxref"><samp class= "einst">B</samp></a> | <a href="../present/graphics.html#edef-U" class= "noxref"><samp class="einst">U</samp></a> | <a href= "../present/graphics.html#edef-S" class="noxref"><samp class= "einst">S</samp></a> | <a href="../present/graphics.html#edef-STRIKE" class= "noxref"><samp class="einst">STRIKE</samp></a> | <a href= "../present/graphics.html#edef-BIG" class="noxref"><samp class= "einst">BIG</samp></a> | <a href="../present/graphics.html#edef-SMALL" class= "noxref"><samp class="einst">SMALL</samp></a>"&gt; &lt;!ENTITY % <a name="phrase">phrase</a> "<a href= "../struct/text.html#edef-EM" class="noxref"><samp class= "einst">EM</samp></a> | <a href="../struct/text.html#edef-STRONG" class= "noxref"><samp class="einst">STRONG</samp></a> | <a href= "../struct/text.html#edef-DFN" class="noxref"><samp class= "einst">DFN</samp></a> | <a href="../struct/text.html#edef-CODE" class= "noxref"><samp class="einst">CODE</samp></a> | <a href="../struct/text.html#edef-SAMP" class="noxref"><samp class="einst">SAMP</samp></a> | <a href="../struct/text.html#edef-KBD" class= "noxref"><samp class="einst">KBD</samp></a> | <a href= "../struct/text.html#edef-VAR" class="noxref"><samp class= "einst">VAR</samp></a> | <a href="../struct/text.html#edef-CITE" class= "noxref"><samp class="einst">CITE</samp></a> | <a href= "../struct/text.html#edef-ABBR" class="noxref"><samp class= "einst">ABBR</samp></a> | <a href="../struct/text.html#edef-ACRONYM" class= "noxref"><samp class="einst">ACRONYM</samp></a>" &gt; &lt;!ENTITY % <a name="special">special</a> "A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO | IFRAME"&gt; &lt;!ENTITY % <a name= "formctrl">formctrl</a> "INPUT | SELECT | TEXTAREA | LABEL | BUTTON"&gt; &lt;!-- <a href= "#inline">%inline;</a> covers inline or "text-level" elements --&gt; &lt;!ENTITY % <a name="inline">inline</a> "#PCDATA | <a href= "#fontstyle">%fontstyle;</a> | <a href="#phrase">%phrase;</a> | <a href= "#special">%special;</a> | <a href="#formctrl">%formctrl;</a>"&gt; &lt;!ELEMENT (<a href="#fontstyle">%fontstyle;</a>|<a href= "#phrase">%phrase;</a>) - - (<a href="#inline">%inline;</a>)*&gt; &lt;!ATTLIST (<a href="#fontstyle">%fontstyle;</a>|<a href= "#phrase">%phrase;</a>) <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- &gt; &lt;!ELEMENT (<a href="../struct/text.html#edef-SUB" class="noxref"><samp class="einst">SUB</samp></a>|<a href="../struct/text.html#edef-SUP" class= "noxref"><samp class="einst">SUP</samp></a>) - - (<a href= "#inline">%inline;</a>)* -- subscript, superscript --&gt; &lt;!ATTLIST (SUB|SUP) <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- &gt; &lt;!ELEMENT <a href="../struct/global.html#edef-SPAN" class="noxref"><samp class="einst">SPAN</samp></a> - - (<a href= "#inline">%inline;</a>)* -- generic language/style container --&gt; &lt;!ATTLIST SPAN <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href= "#reserved">%reserved;</a> -- reserved for possible future use -- &gt; &lt;!ELEMENT <a href="../struct/dirlang.html#edef-BDO" class="noxref"><samp class="einst">BDO</samp></a> - - (<a href= "#inline">%inline;</a>)* -- I18N BiDi over-ride --&gt; &lt;!ATTLIST BDO <a href= "#coreattrs">%coreattrs;</a> -- id, class, style, title -- <a href="../struct/dirlang.html#adef-lang" class="noxref"><samp class= "ainst">lang</samp></a> <a href= "#LanguageCode">%LanguageCode;</a> #IMPLIED -- language code -- <a href="../struct/dirlang.html#adef-dir-BDO" class="noxref"><samp class= "ainst-BDO">dir</samp></a> (ltr|rtl) #REQUIRED -- directionality -- &gt; &lt;!<a name="basefont">ELEMENT</a> <a href= "../present/graphics.html#edef-BASEFONT" class="noxref"><samp class= "einst">BASEFONT</samp></a> - O EMPTY -- base font size --&gt; &lt;!ATTLIST BASEFONT <a href="../struct/global.html#adef-id" class="noxref"><samp class= "ainst">id</samp></a> <a href= "../types.html#type-id">ID</a> #IMPLIED -- document-wide unique id -- <a href="../present/graphics.html#adef-size-FONT" class="noxref"><samp class= "ainst-FONT">size</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #REQUIRED -- base font size for FONT elements -- <a href="../present/graphics.html#adef-color-FONT" class="noxref"><samp class="ainst-FONT">color</samp></a> <a href= "#Color">%Color;</a> #IMPLIED -- text color -- <a href="../present/graphics.html#adef-face-FONT" class="noxref"><samp class= "ainst-FONT">face</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- comma-separated list of font names -- &gt; &lt;!ELEMENT <a href="../present/graphics.html#edef-FONT" class="noxref"><samp class="einst">FONT</samp></a> - - (<a href= "#inline">%inline;</a>)* -- local change to font --&gt; &lt;!ATTLIST FONT <a href= "#coreattrs">%coreattrs;</a> -- id, class, style, title -- <a href="#i18n">%i18n;</a> -- lang, dir -- <a href="../present/graphics.html#adef-size-FONT" class="noxref"><samp class= "ainst-FONT">size</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- [+|-]nn e.g. size="+1", size="4" -- <a href="../present/graphics.html#adef-color-FONT" class="noxref"><samp class="ainst-FONT">color</samp></a> <a href= "#Color">%Color;</a> #IMPLIED -- text color -- <a href="../present/graphics.html#adef-face-FONT" class="noxref"><samp class= "ainst-FONT">face</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- comma-separated list of font names -- &gt; &lt;!ELEMENT <a href="../struct/text.html#edef-BR" class="noxref"><samp class= "einst">BR</samp></a> - O EMPTY -- forced line break --&gt; &lt;!ATTLIST BR <a href= "#coreattrs">%coreattrs;</a> -- id, class, style, title -- <a href="../present/graphics.html#adef-clear" class="noxref"><samp class= "ainst-BR">clear</samp></a> (left|all|right|none) none -- control of text flow -- &gt; &lt;!--================== HTML content models ===============================--&gt; &lt;!-- HTML has two basic content models: <a href= "#inline">%inline;</a> character level elements and text strings <a href= "#block">%block;</a> block-like elements e.g. paragraphs and lists --&gt; &lt;!ENTITY % <a name="block">block</a> "P | <a href="#heading">%heading;</a> | <a href="#list">%list;</a> | <a href="#preformatted">%preformatted;</a> | DL | DIV | CENTER | NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR | TABLE | FIELDSET | ADDRESS"&gt; &lt;!ENTITY % <a name="flow">flow</a> "<a href="#block">%block;</a> | <a href= "#inline">%inline;</a>"&gt; &lt;!--=================== Document Body ====================================--&gt; &lt;!ELEMENT <a href="../struct/global.html#edef-BODY" class="noxref"><samp class="einst">BODY</samp></a> O O (<a href= "#flow">%flow;</a>)* +(INS|DEL) -- document body --&gt; &lt;!ATTLIST BODY <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../interact/scripts.html#adef-onload" class="noxref"><samp class= "ainst-BODY">onload</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the document has been loaded -- <a href="../interact/scripts.html#adef-onunload" class="noxref"><samp class= "ainst-BODY">onunload</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the document has been removed -- <a href="../struct/global.html#adef-background" class="noxref"><samp class= "ainst-BODY">background</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- texture tile for document background -- <a href= "#bodycolors">%bodycolors;</a> -- bgcolor, text, link, vlink, alink -- &gt; &lt;!ELEMENT <a href="../struct/global.html#edef-ADDRESS" class="noxref"><samp class="einst">ADDRESS</samp></a> - - ((<a href= "#inline">%inline;</a>)|P)* -- information on author --&gt; &lt;!ATTLIST ADDRESS <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- &gt; &lt;!ELEMENT <a href="../struct/global.html#edef-DIV" class="noxref"><samp class="einst">DIV</samp></a> - - (<a href= "#flow">%flow;</a>)* -- generic language/style container --&gt; &lt;!ATTLIST DIV <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href= "#align">%align;</a> -- align, text alignment -- <a href= "#reserved">%reserved;</a> -- reserved for possible future use -- &gt; &lt;!ELEMENT <a href="../present/graphics.html#edef-CENTER" class= "noxref"><samp class="einst">CENTER</samp></a> - - (<a href= "#flow">%flow;</a>)* -- shorthand for DIV align=center --&gt; &lt;!ATTLIST CENTER <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- &gt; &lt;!--================== The Anchor Element ================================--&gt; &lt;!ENTITY % <a name="Shape">Shape</a> "(rect|circle|poly|default)"&gt; &lt;!ENTITY % <a name="Coords">Coords</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- comma-separated list of lengths --&gt; &lt;!ELEMENT <a href="../struct/links.html#edef-A" class="noxref"><samp class= "einst">A</samp></a> - - (<a href= "#inline">%inline;</a>)* -(A) -- anchor --&gt; &lt;!ATTLIST A <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/links.html#adef-charset" class="noxref"><samp class= "ainst-A">charset</samp></a> <a href= "#Charset">%Charset;</a> #IMPLIED -- char encoding of linked resource -- <a href="../struct/links.html#adef-type-A" class="noxref"><samp class= "ainst-A">type</samp></a> <a href= "#ContentType">%ContentType;</a> #IMPLIED -- advisory content type -- <a href="../struct/links.html#adef-name-A" class="noxref"><samp class= "ainst-A">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- named link end -- <a href="../struct/links.html#adef-href" class="noxref"><samp class= "ainst-A">href</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- URI for linked resource -- <a href="../struct/links.html#adef-hreflang" class="noxref"><samp class= "ainst-A">hreflang</samp></a> <a href= "#LanguageCode">%LanguageCode;</a> #IMPLIED -- language code -- <a href="../present/frames.html#adef-target" class="noxref"><samp class= "ainst-A">target</samp></a> <a href= "#FrameTarget">%FrameTarget;</a> #IMPLIED -- render in this frame -- <a href="../struct/links.html#adef-rel" class="noxref"><samp class= "ainst-A">rel</samp></a> <a href= "#LinkTypes">%LinkTypes;</a> #IMPLIED -- forward link types -- <a href="../struct/links.html#adef-rev" class="noxref"><samp class= "ainst-A">rev</samp></a> <a href= "#LinkTypes">%LinkTypes;</a> #IMPLIED -- reverse link types -- <a href="../interact/forms.html#adef-accesskey" class="noxref"><samp class= "ainst-A">accesskey</samp></a> <a href= "#Character">%Character;</a> #IMPLIED -- accessibility key character -- <a href="../struct/objects.html#adef-shape" class="noxref"><samp class= "ainst-A">shape</samp></a> <a href= "#Shape">%Shape;</a> rect -- for use with client-side image maps -- <a href="../struct/objects.html#adef-coords" class="noxref"><samp class= "ainst-A">coords</samp></a> <a href= "#Coords">%Coords;</a> #IMPLIED -- for use with client-side image maps -- <a href="../interact/forms.html#adef-tabindex" class="noxref"><samp class= "ainst-A">tabindex</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- position in tabbing order -- <a href="../interact/scripts.html#adef-onfocus" class="noxref"><samp class= "ainst-A">onfocus</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element got the focus -- <a href="../interact/scripts.html#adef-onblur" class="noxref"><samp class= "ainst-A">onblur</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element lost the focus -- &gt; &lt;!--================== Client-side image maps ============================--&gt; &lt;!-- These can be placed in the same document or grouped in a separate document although this isn't yet widely supported --&gt; &lt;!ELEMENT <a href="../struct/objects.html#edef-MAP" class="noxref"><samp class="einst">MAP</samp></a> - - ((<a href= "#block">%block;</a>) | AREA)+ -- client-side image map --&gt; &lt;!ATTLIST MAP <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/objects.html#adef-name-MAP" class="noxref"><samp class= "ainst-MAP">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #REQUIRED -- for reference by usemap -- &gt; &lt;!ELEMENT <a href="../struct/objects.html#edef-AREA" class="noxref"><samp class= "einst">AREA</samp></a> - O EMPTY -- client-side image map area --&gt; &lt;!ATTLIST AREA <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/objects.html#adef-shape" class="noxref"><samp class= "ainst-AREA">shape</samp></a> <a href= "#Shape">%Shape;</a> rect -- controls interpretation of coords -- <a href="../struct/objects.html#adef-coords" class="noxref"><samp class= "ainst-AREA">coords</samp></a> <a href= "#Coords">%Coords;</a> #IMPLIED -- comma-separated list of lengths -- <a href="../struct/links.html#adef-href" class="noxref"><samp class= "ainst-AREA">href</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- URI for linked resource -- <a href="../present/frames.html#adef-target" class="noxref"><samp class= "ainst-A">target</samp></a> <a href= "#FrameTarget">%FrameTarget;</a> #IMPLIED -- render in this frame -- <a href="../struct/objects.html#adef-nohref" class="noxref"><samp class= "ainst-AREA">nohref</samp></a> (nohref) #IMPLIED -- this region has no action -- <a href="../struct/objects.html#adef-alt" class="noxref"><samp class= "ainst-AREA">alt</samp></a> <a href= "#Text">%Text;</a> #REQUIRED -- short description -- <a href="../interact/forms.html#adef-tabindex" class="noxref"><samp class= "ainst-AREA">tabindex</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- position in tabbing order -- <a href="../interact/forms.html#adef-accesskey" class="noxref"><samp class= "ainst-AREA">accesskey</samp></a> <a href= "#Character">%Character;</a> #IMPLIED -- accessibility key character -- <a href="../interact/scripts.html#adef-onfocus" class="noxref"><samp class= "ainst-AREA">onfocus</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element got the focus -- <a href="../interact/scripts.html#adef-onblur" class="noxref"><samp class= "ainst-AREA">onblur</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element lost the focus -- &gt; &lt;!--================== The LINK Element ==================================--&gt; &lt;!-- Relationship values can be used in principle: a) for document specific toolbars/menus when used with the LINK element in document head e.g. start, contents, previous, next, index, end, help b) to link to a separate style sheet (rel=stylesheet) c) to make a link to a script (rel=script) d) by stylesheets to control how collections of html nodes are rendered into printed documents e) to make a link to a printable version of this document e.g. a postscript or pdf version (rel=alternate media=print) --&gt; &lt;!ELEMENT <a href="../struct/links.html#edef-LINK" class="noxref"><samp class= "einst">LINK</samp></a> - O EMPTY -- a media-independent link --&gt; &lt;!ATTLIST LINK <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/links.html#adef-charset" class="noxref"><samp class= "ainst-LINK">charset</samp></a> <a href= "#Charset">%Charset;</a> #IMPLIED -- char encoding of linked resource -- <a href="../struct/links.html#adef-href" class="noxref"><samp class= "ainst-LINK">href</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- URI for linked resource -- <a href="../struct/links.html#adef-hreflang" class="noxref"><samp class= "ainst-LINK">hreflang</samp></a> <a href= "#LanguageCode">%LanguageCode;</a> #IMPLIED -- language code -- <a href="../struct/links.html#adef-type-A" class="noxref"><samp class= "ainst-A">type</samp></a> <a href= "#ContentType">%ContentType;</a> #IMPLIED -- advisory content type -- <a href="../struct/links.html#adef-rel" class="noxref"><samp class= "ainst-LINK">rel</samp></a> <a href= "#LinkTypes">%LinkTypes;</a> #IMPLIED -- forward link types -- <a href="../struct/links.html#adef-rev" class="noxref"><samp class= "ainst-LINK">rev</samp></a> <a href= "#LinkTypes">%LinkTypes;</a> #IMPLIED -- reverse link types -- <a href="../present/styles.html#adef-media" class="noxref"><samp class= "ainst-LINK">media</samp></a> <a href= "#MediaDesc">%MediaDesc;</a> #IMPLIED -- for rendering on these media -- <a href="../present/frames.html#adef-target" class="noxref"><samp class= "ainst-A">target</samp></a> <a href= "#FrameTarget">%FrameTarget;</a> #IMPLIED -- render in this frame -- &gt; &lt;!--=================== Images ===========================================--&gt; &lt;!-- Length defined in strict DTD for cellpadding/cellspacing --&gt; &lt;!ENTITY % <a name="Length">Length</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- nn for pixels or nn% for percentage length --&gt; &lt;!ENTITY % <a name="MultiLength">MultiLength</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- pixel, percentage, or relative --&gt; &lt;![ <a href="#HTML.Frameset">%HTML.Frameset;</a> [ &lt;!ENTITY % <a name="MultiLengths">MultiLengths</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- comma-separated list of MultiLength --&gt; ]]&gt; &lt;!ENTITY % <a name="Pixels">Pixels</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- integer representing length in pixels --&gt; &lt;!ENTITY % <a name= "IAlign">IAlign</a> "(top|middle|bottom|left|right)" -- center? --&gt; &lt;!-- To avoid problems with text-only UAs as well as to make image content understandable and navigable to users of non-visual UAs, you need to provide a description with ALT, and avoid server-side image maps --&gt; &lt;!ELEMENT <a href="../struct/objects.html#edef-IMG" class="noxref"><samp class="einst">IMG</samp></a> - O EMPTY -- Embedded image --&gt; &lt;!ATTLIST IMG <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/objects.html#adef-src-IMG" class="noxref"><samp class= "ainst-IMG">src</samp></a> <a href= "#URI">%URI;</a> #REQUIRED -- URI of image to embed -- <a href="../struct/objects.html#adef-alt" class="noxref"><samp class= "ainst-IMG">alt</samp></a> <a href= "#Text">%Text;</a> #REQUIRED -- short description -- <a href="../struct/objects.html#adef-longdesc-IMG" class="noxref"><samp class="ainst-IMG">longdesc</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- link to long description (complements alt) -- <a href="../struct/objects.html#adef-name-IMG" class="noxref"><samp class= "ainst-IMG">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- name of image for scripting -- <a href="../struct/objects.html#adef-height-IMG" class="noxref"><samp class= "ainst-IMG">height</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- override height -- <a href="../struct/objects.html#adef-width-IMG" class="noxref"><samp class= "ainst-IMG">width</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- override width -- <a href="../struct/objects.html#adef-usemap" class="noxref"><samp class= "ainst-IMG">usemap</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- use client-side image map -- <a href="../struct/objects.html#adef-ismap" class="noxref"><samp class= "ainst-IMG">ismap</samp></a> (ismap) #IMPLIED -- use server-side image map -- <a href="../struct/objects.html#adef-align-IMG" class="noxref"><samp class= "ainst-IMG">align</samp></a> <a href= "#IAlign">%IAlign;</a> #IMPLIED -- vertical or horizontal alignment -- <a href="../struct/objects.html#adef-border-IMG" class="noxref"><samp class= "ainst-IMG">border</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- link border width -- <a href="../struct/objects.html#adef-hspace" class="noxref"><samp class= "ainst-IMG">hspace</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- horizontal gutter -- <a href="../struct/objects.html#adef-vspace" class="noxref"><samp class= "ainst-IMG">vspace</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- vertical gutter -- &gt; &lt;!-- USEMAP points to a MAP element which may be in this document or an external document, although the latter is not widely supported --&gt; &lt;!--==================== OBJECT ======================================--&gt; &lt;!-- OBJECT is used to embed objects as part of HTML pages PARAM elements should precede other content. SGML mixed content model technicality precludes specifying this formally ... --&gt; &lt;!ELEMENT <a href="../struct/objects.html#edef-OBJECT" class="noxref"><samp class="einst">OBJECT</samp></a> - - (PARAM | <a href="#flow">%flow;</a>)* -- generic embedded object --&gt; &lt;!ATTLIST OBJECT <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/objects.html#adef-declare" class="noxref"><samp class= "ainst-OBJECT">declare</samp></a> (declare) #IMPLIED -- declare but don't instantiate flag -- <a href="../struct/objects.html#adef-classid" class="noxref"><samp class= "ainst-OBJECT">classid</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- identifies an implementation -- <a href="../struct/objects.html#adef-codebase-OBJECT" class="noxref"><samp class="ainst-OBJECT">codebase</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- base URI for classid, data, archive-- <a href="../struct/objects.html#adef-data" class="noxref"><samp class= "ainst-OBJECT">data</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- reference to object's data -- <a href="../struct/objects.html#adef-type-OBJECT" class="noxref"><samp class= "ainst-OBJECT">type</samp></a> <a href= "#ContentType">%ContentType;</a> #IMPLIED -- content type for data -- <a href="../struct/objects.html#adef-codetype" class="noxref"><samp class= "ainst-OBJECT">codetype</samp></a> <a href= "#ContentType">%ContentType;</a> #IMPLIED -- content type for code -- <a href="../struct/objects.html#adef-archive-OBJECT" class="noxref"><samp class="ainst-OBJECT">archive</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- space-separated list of URIs -- <a href="../struct/objects.html#adef-standby" class="noxref"><samp class= "ainst-OBJECT">standby</samp></a> <a href= "#Text">%Text;</a> #IMPLIED -- message to show while loading -- <a href="../struct/objects.html#adef-height-IMG" class="noxref"><samp class= "ainst-IMG">height</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- override height -- <a href="../struct/objects.html#adef-width-IMG" class="noxref"><samp class= "ainst-IMG">width</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- override width -- <a href="../struct/objects.html#adef-usemap" class="noxref"><samp class= "ainst-OBJECT">usemap</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- use client-side image map -- <a href="../interact/forms.html#adef-name-INPUT" class="noxref"><samp class= "ainst-INPUT">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- submit as part of form -- <a href="../interact/forms.html#adef-tabindex" class="noxref"><samp class= "ainst-OBJECT">tabindex</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- position in tabbing order -- <a href="../struct/objects.html#adef-align-IMG" class="noxref"><samp class= "ainst-IMG">align</samp></a> <a href= "#IAlign">%IAlign;</a> #IMPLIED -- vertical or horizontal alignment -- <a href="../struct/objects.html#adef-border-IMG" class="noxref"><samp class= "ainst-IMG">border</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- link border width -- <a href="../struct/objects.html#adef-hspace" class="noxref"><samp class= "ainst-IMG">hspace</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- horizontal gutter -- <a href="../struct/objects.html#adef-vspace" class="noxref"><samp class= "ainst-IMG">vspace</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- vertical gutter -- <a href= "#reserved">%reserved;</a> -- reserved for possible future use -- &gt; &lt;!ELEMENT <a href="../struct/objects.html#edef-PARAM" class="noxref"><samp class= "einst">PARAM</samp></a> - O EMPTY -- named property value --&gt; &lt;!ATTLIST PARAM <a href="../struct/global.html#adef-id" class="noxref"><samp class= "ainst">id</samp></a> <a href= "../types.html#type-id">ID</a> #IMPLIED -- document-wide unique id -- <a href="../struct/objects.html#adef-name-PARAM" class="noxref"><samp class= "ainst-PARAM">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #REQUIRED -- property name -- <a href="../struct/objects.html#adef-value-PARAM" class="noxref"><samp class= "ainst-PARAM">value</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- property value -- <a href="../struct/objects.html#adef-valuetype" class="noxref"><samp class= "ainst-PARAM">valuetype</samp></a> (DATA|REF|OBJECT) DATA -- How to interpret value -- <a href="../struct/objects.html#adef-type-PARAM" class="noxref"><samp class= "ainst-PARAM">type</samp></a> <a href= "#ContentType">%ContentType;</a> #IMPLIED -- content type for value when valuetype=ref -- &gt; &lt;!--=================== Java APPLET ==================================--&gt; &lt;!-- One of code or object attributes must be present. Place PARAM elements before other content. --&gt; &lt;!<a name="applet">ELEMENT</a> <a href="../struct/objects.html#edef-APPLET" class="noxref"><samp class="einst">APPLET</samp></a> - - (PARAM | <a href= "#flow">%flow;</a>)* -- Java applet --&gt; &lt;!ATTLIST APPLET <a href= "#coreattrs">%coreattrs;</a> -- id, class, style, title -- <a href="../struct/objects.html#adef-codebase-APPLET" class="noxref"><samp class="ainst-APPLET">codebase</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- optional base URI for applet -- <a href="../struct/objects.html#adef-archive-APPLET" class="noxref"><samp class="ainst-APPLET">archive</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- comma-separated archive list -- <a href="../struct/objects.html#adef-code" class="noxref"><samp class= "ainst-APPLET">code</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- applet class file -- <a href="../struct/objects.html#adef-object" class="noxref"><samp class= "ainst-APPLET">object</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- serialized applet file -- <a href="../struct/objects.html#adef-alt" class="noxref"><samp class= "ainst-APPLET">alt</samp></a> <a href= "#Text">%Text;</a> #IMPLIED -- short description -- <a href="../struct/objects.html#adef-name-APPLET" class="noxref"><samp class= "ainst-APPLET">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- allows applets to find each other -- <a href="../struct/objects.html#adef-width-APPLET" class="noxref"><samp class="ainst-APPLET">width</samp></a> <a href= "#Length">%Length;</a> #REQUIRED -- initial width -- <a href="../struct/objects.html#adef-height-APPLET" class="noxref"><samp class="ainst-APPLET">height</samp></a> <a href= "#Length">%Length;</a> #REQUIRED -- initial height -- <a href="../present/graphics.html#adef-align" class="noxref"><samp class= "ainst-APPLET">align</samp></a> <a href= "#IAlign">%IAlign;</a> #IMPLIED -- vertical or horizontal alignment -- <a href="../struct/objects.html#adef-hspace" class="noxref"><samp class= "ainst-APPLET">hspace</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- horizontal gutter -- <a href="../struct/objects.html#adef-vspace" class="noxref"><samp class= "ainst-APPLET">vspace</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- vertical gutter -- &gt; &lt;!--=================== Horizontal Rule ==================================--&gt; &lt;!ELEMENT <a href="../present/graphics.html#edef-HR" class="noxref"><samp class="einst">HR</samp></a> - O EMPTY -- horizontal rule --&gt; &lt;!ATTLIST HR <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../present/graphics.html#adef-align-HR" class="noxref"><samp class= "ainst-HR">align</samp></a> (left|center|right) #IMPLIED <a href="../present/graphics.html#adef-noshade" class="noxref"><samp class= "ainst-HR">noshade</samp></a> (noshade) #IMPLIED <a href="../present/graphics.html#adef-size-HR" class="noxref"><samp class= "ainst-HR">size</samp></a> <a href="#Pixels">%Pixels;</a> #IMPLIED <a href="../present/graphics.html#adef-width-HR" class="noxref"><samp class= "ainst-HR">width</samp></a> <a href="#Length">%Length;</a> #IMPLIED &gt; &lt;!--=================== Paragraphs =======================================--&gt; &lt;!ELEMENT <a href="../struct/text.html#edef-P" class="noxref"><samp class= "einst">P</samp></a> - O (<a href= "#inline">%inline;</a>)* -- paragraph --&gt; &lt;!ATTLIST P <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href= "#align">%align;</a> -- align, text alignment -- &gt; &lt;!--=================== Headings =========================================--&gt; &lt;!-- There are six levels of headings from H1 (the most important) to H6 (the least important). --&gt; &lt;!ELEMENT (<a href="#heading">%heading;</a>) - - (<a href= "#inline">%inline;</a>)* -- heading --&gt; &lt;!ATTLIST (<a href="#heading">%heading;</a>) <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href= "#align">%align;</a> -- align, text alignment -- &gt; &lt;!--=================== Preformatted Text ================================--&gt; &lt;!-- excludes markup for images and changes in font size --&gt; &lt;!ENTITY % <a name= "pre.exclusion">pre.exclusion</a> "IMG|OBJECT|APPLET|BIG|SMALL|SUB|SUP|FONT|BASEFONT"&gt; &lt;!ELEMENT <a href="../struct/text.html#edef-PRE" class="noxref"><samp class= "einst">PRE</samp></a> - - (<a href="#inline">%inline;</a>)* -(<a href= "#pre.exclusion">%pre.exclusion;</a>) -- preformatted text --&gt; &lt;!ATTLIST PRE <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/text.html#adef-width-PRE" class="noxref"><samp class= "ainst-PRE">width</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED &gt; &lt;!--===================== Inline Quotes ==================================--&gt; &lt;!ELEMENT <a href="../struct/text.html#edef-Q" class="noxref"><samp class= "einst">Q</samp></a> - - (<a href= "#inline">%inline;</a>)* -- short inline quotation --&gt; &lt;!ATTLIST Q <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/text.html#adef-cite-Q" class="noxref"><samp class= "ainst-Q">cite</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- URI for source document or msg -- &gt; &lt;!--=================== Block-like Quotes ================================--&gt; &lt;!ELEMENT <a href="../struct/text.html#edef-BLOCKQUOTE" class="noxref"><samp class="einst">BLOCKQUOTE</samp></a> - - (<a href= "#flow">%flow;</a>)* -- long quotation --&gt; &lt;!ATTLIST BLOCKQUOTE <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/text.html#adef-cite-Q" class="noxref"><samp class= "ainst-Q">cite</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- URI for source document or msg -- &gt; &lt;!--=================== Inserted/Deleted Text ============================--&gt; &lt;!-- INS/DEL are handled by inclusion on BODY --&gt; &lt;!ELEMENT (<a href="../struct/text.html#edef-ins" class="noxref"><samp class="einst">INS</samp></a>|<a href="../struct/text.html#edef-del" class= "noxref"><samp class="einst">DEL</samp></a>) - - (<a href= "#flow">%flow;</a>)* -- inserted text, deleted text --&gt; &lt;!ATTLIST (INS|DEL) <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/text.html#adef-cite-INS" class="noxref"><samp class= "ainst-INS">cite</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- info on reason for change -- <a href="../struct/text.html#adef-datetime" class="noxref"><samp class= "ainst-INS">datetime</samp></a> <a href= "#Datetime">%Datetime;</a> #IMPLIED -- date and time of change -- &gt; &lt;!--=================== Lists ============================================--&gt; &lt;!-- definition lists - DT for term, DD for its definition --&gt; &lt;!ELEMENT <a href="../struct/lists.html#edef-DL" class="noxref"><samp class= "einst">DL</samp></a> - - (DT|DD)+ -- definition list --&gt; &lt;!ATTLIST DL <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/lists.html#adef-compact" class="noxref"><samp class= "ainst-DL">compact</samp></a> (compact) #IMPLIED -- reduced interitem spacing -- &gt; &lt;!ELEMENT <a href="../struct/lists.html#edef-DT" class="noxref"><samp class= "einst">DT</samp></a> - O (<a href= "#inline">%inline;</a>)* -- definition term --&gt; &lt;!ELEMENT <a href="../struct/lists.html#edef-DD" class="noxref"><samp class= "einst">DD</samp></a> - O (<a href= "#flow">%flow;</a>)* -- definition description --&gt; &lt;!ATTLIST (DT|DD) <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- &gt; &lt;!-- Ordered lists (OL) Numbering style 1 arablic numbers 1, 2, 3, ... a lower alpha a, b, c, ... A upper alpha A, B, C, ... i lower roman i, ii, iii, ... I upper roman I, II, III, ... The style is applied to the sequence number which by default is reset to 1 for the first list item in an ordered list. This can't be expressed directly in SGML due to case folding. --&gt; &lt;!ENTITY % <a name="OLStyle">OLStyle</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- constrained to: "(1|a|A|i|I)" --&gt; &lt;!ELEMENT <a href="../struct/lists.html#edef-OL" class="noxref"><samp class= "einst">OL</samp></a> - - (LI)+ -- ordered list --&gt; &lt;!ATTLIST OL <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/lists.html#adef-type-OL" class="noxref"><samp class= "ainst-OL">type</samp></a> <a href= "#OLStyle">%OLStyle;</a> #IMPLIED -- numbering style -- <a href="../struct/lists.html#adef-compact" class="noxref"><samp class= "ainst-OL">compact</samp></a> (compact) #IMPLIED -- reduced interitem spacing -- <a href="../struct/lists.html#adef-start" class="noxref"><samp class= "ainst-OL">start</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- starting sequence number -- &gt; &lt;!-- Unordered Lists (UL) bullet styles --&gt; &lt;!ENTITY % <a name="ULStyle">ULStyle</a> "(disc|square|circle)"&gt; &lt;!ELEMENT <a href="../struct/lists.html#edef-UL" class="noxref"><samp class= "einst">UL</samp></a> - - (LI)+ -- unordered list --&gt; &lt;!ATTLIST UL <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/lists.html#adef-type-UL" class="noxref"><samp class= "ainst-UL">type</samp></a> <a href= "#ULStyle">%ULStyle;</a> #IMPLIED -- bullet style -- <a href="../struct/lists.html#adef-compact" class="noxref"><samp class= "ainst-UL">compact</samp></a> (compact) #IMPLIED -- reduced interitem spacing -- &gt; &lt;!<a name="dir">ELEMENT</a> (<a href="../struct/lists.html#edef-DIR" class= "noxref"><samp class="einst">DIR</samp></a>|<a href= "../struct/lists.html#edef-MENU" class="noxref"><samp class= "einst">MENU</samp></a>) - - (LI)+ -(<a href= "#block">%block;</a>) -- directory list, menu list --&gt; &lt;!ATTLIST DIR <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/lists.html#adef-compact" class="noxref"><samp class= "ainst-DIR">compact</samp></a> (compact) #IMPLIED -- reduced interitem spacing -- &gt; &lt;!ATTLIST MENU <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/lists.html#adef-compact" class="noxref"><samp class= "ainst-MENU">compact</samp></a> (compact) #IMPLIED -- reduced interitem spacing -- &gt; &lt;!ENTITY % <a name="LIStyle">LIStyle</a> "<a href= "../types.html#type-cdata">CDATA</a>" -- constrained to: "(<a href= "#ULStyle">%ULStyle;</a>|<a href="#OLStyle">%OLStyle;</a>)" --&gt; &lt;!ELEMENT <a href="../struct/lists.html#edef-LI" class="noxref"><samp class= "einst">LI</samp></a> - O (<a href= "#flow">%flow;</a>)* -- list item --&gt; &lt;!ATTLIST LI <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/lists.html#adef-type-LI" class="noxref"><samp class= "ainst-LI">type</samp></a> <a href= "#LIStyle">%LIStyle;</a> #IMPLIED -- list item style -- <a href="../struct/lists.html#adef-value-LI" class="noxref"><samp class= "ainst-LI">value</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- reset sequence number -- &gt; &lt;!--================ Forms ===============================================--&gt; &lt;!ELEMENT <a href="../interact/forms.html#edef-FORM" class="noxref"><samp class="einst">FORM</samp></a> - - (<a href= "#flow">%flow;</a>)* -(FORM) -- interactive form --&gt; &lt;!ATTLIST FORM <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../interact/forms.html#adef-action" class="noxref"><samp class= "ainst-FORM">action</samp></a> <a href= "#URI">%URI;</a> #REQUIRED -- server-side form handler -- <a href="../interact/forms.html#adef-method" class="noxref"><samp class= "ainst-FORM">method</samp></a> (GET|POST) GET -- HTTP method used to submit the form-- <a href="../interact/forms.html#adef-enctype" class="noxref"><samp class= "ainst-FORM">enctype</samp></a> <a href= "#ContentType">%ContentType;</a> "application/x-www-form-urlencoded" <a href="../interact/forms.html#adef-accept" class="noxref"><samp class= "ainst">accept</samp></a> <a href= "#ContentTypes">%ContentTypes;</a> #IMPLIED -- list of MIME types for file upload -- <a href="../interact/forms.html#adef-name-FORM" class="noxref"><samp class= "ainst-FORM">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- name of form for scripting -- <a href="../interact/scripts.html#adef-onsubmit" class="noxref"><samp class= "ainst-FORM">onsubmit</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the form was submitted -- <a href="../interact/scripts.html#adef-onreset" class="noxref"><samp class= "ainst-FORM">onreset</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the form was reset -- <a href="../present/frames.html#adef-target" class="noxref"><samp class= "ainst-A">target</samp></a> <a href= "#FrameTarget">%FrameTarget;</a> #IMPLIED -- render in this frame -- <a href="../interact/forms.html#adef-accept-charset" class="noxref"><samp class="ainst-FORM">accept-charset</samp></a> <a href= "#Charsets">%Charsets;</a> #IMPLIED -- list of supported charsets -- &gt; &lt;!-- Each label must not contain more than ONE field --&gt; &lt;!ELEMENT <a href="../interact/forms.html#edef-LABEL" class="noxref"><samp class="einst">LABEL</samp></a> - - (<a href= "#inline">%inline;</a>)* -(LABEL) -- form field label text --&gt; &lt;!ATTLIST LABEL <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../interact/forms.html#adef-for" class="noxref"><samp class= "ainst-LABEL">for</samp></a> <a href= "../types.html#type-idref">IDREF</a> #IMPLIED -- matches field ID value -- <a href="../interact/forms.html#adef-accesskey" class="noxref"><samp class= "ainst-LABEL">accesskey</samp></a> <a href= "#Character">%Character;</a> #IMPLIED -- accessibility key character -- <a href="../interact/scripts.html#adef-onfocus" class="noxref"><samp class= "ainst-LABEL">onfocus</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element got the focus -- <a href="../interact/scripts.html#adef-onblur" class="noxref"><samp class= "ainst-LABEL">onblur</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element lost the focus -- &gt; &lt;!ENTITY % <a name="InputType">InputType</a> "(TEXT | PASSWORD | CHECKBOX | RADIO | SUBMIT | RESET | FILE | HIDDEN | IMAGE | BUTTON)" &gt; &lt;!-- attribute name required for all but submit and reset --&gt; &lt;!ELEMENT <a href="../interact/forms.html#edef-INPUT" class="noxref"><samp class="einst">INPUT</samp></a> - O EMPTY -- form control --&gt; &lt;!ATTLIST INPUT <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../interact/forms.html#adef-type-INPUT" class="noxref"><samp class= "ainst-INPUT">type</samp></a> <a href= "#InputType">%InputType;</a> TEXT -- what kind of widget is needed -- <a href="../interact/forms.html#adef-name-INPUT" class="noxref"><samp class= "ainst-INPUT">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- submit as part of form -- <a href="../interact/forms.html#adef-value-INPUT" class="noxref"><samp class= "ainst-INPUT">value</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- Specify for radio buttons and checkboxes -- <a href="../interact/forms.html#adef-checked" class="noxref"><samp class= "ainst-INPUT">checked</samp></a> (checked) #IMPLIED -- for radio buttons and check boxes -- <a href="../interact/forms.html#adef-disabled" class="noxref"><samp class= "ainst-INPUT">disabled</samp></a> (disabled) #IMPLIED -- unavailable in this context -- <a href="../interact/forms.html#adef-readonly" class="noxref"><samp class= "ainst-INPUT">readonly</samp></a> (readonly) #IMPLIED -- for text and passwd -- <a href="../interact/forms.html#adef-size-INPUT" class="noxref"><samp class= "ainst-INPUT">size</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- specific to each type of field -- <a href="../interact/forms.html#adef-maxlength" class="noxref"><samp class= "ainst-INPUT">maxlength</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- max chars for text fields -- <a href="../interact/forms.html#adef-src" class="noxref"><samp class= "ainst-INPUT">src</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- for fields with images -- <a href="../struct/objects.html#adef-alt" class="noxref"><samp class= "ainst-INPUT">alt</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- short description -- <a href="../struct/objects.html#adef-usemap" class="noxref"><samp class= "ainst-INPUT">usemap</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- use client-side image map -- <a href="../struct/objects.html#adef-ismap" class="noxref"><samp class= "ainst">ismap</samp></a> (ismap) #IMPLIED -- use server-side image map -- <a href="../interact/forms.html#adef-tabindex" class="noxref"><samp class= "ainst-INPUT">tabindex</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- position in tabbing order -- <a href="../interact/forms.html#adef-accesskey" class="noxref"><samp class= "ainst-INPUT">accesskey</samp></a> <a href= "#Character">%Character;</a> #IMPLIED -- accessibility key character -- <a href="../interact/scripts.html#adef-onfocus" class="noxref"><samp class= "ainst-INPUT">onfocus</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element got the focus -- <a href="../interact/scripts.html#adef-onblur" class="noxref"><samp class= "ainst-INPUT">onblur</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element lost the focus -- <a href="../interact/scripts.html#adef-onselect" class="noxref"><samp class= "ainst-INPUT">onselect</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- some text was selected -- <a href="../interact/scripts.html#adef-onchange" class="noxref"><samp class= "ainst-INPUT">onchange</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element value was changed -- <a href="../interact/forms.html#adef-accept" class="noxref"><samp class= "ainst">accept</samp></a> <a href= "#ContentTypes">%ContentTypes;</a> #IMPLIED -- list of MIME types for file upload -- <a href="../present/graphics.html#adef-align" class="noxref"><samp class= "ainst-INPUT">align</samp></a> <a href= "#IAlign">%IAlign;</a> #IMPLIED -- vertical or horizontal alignment -- <a href= "#reserved">%reserved;</a> -- reserved for possible future use -- &gt; &lt;!ELEMENT <a href="../interact/forms.html#edef-SELECT" class="noxref"><samp class= "einst">SELECT</samp></a> - - (OPTGROUP|OPTION)+ -- option selector --&gt; &lt;!ATTLIST SELECT <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../interact/forms.html#adef-name-SELECT" class="noxref"><samp class= "ainst-SELECT">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- field name -- <a href="../interact/forms.html#adef-size-SELECT" class="noxref"><samp class= "ainst-SELECT">size</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- rows visible -- <a href="../interact/forms.html#adef-multiple" class="noxref"><samp class= "ainst-SELECT">multiple</samp></a> (multiple) #IMPLIED -- default is single selection -- <a href="../interact/forms.html#adef-disabled" class="noxref"><samp class= "ainst-SELECT">disabled</samp></a> (disabled) #IMPLIED -- unavailable in this context -- <a href="../interact/forms.html#adef-tabindex" class="noxref"><samp class= "ainst-SELECT">tabindex</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- position in tabbing order -- <a href="../interact/scripts.html#adef-onfocus" class="noxref"><samp class= "ainst-SELECT">onfocus</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element got the focus -- <a href="../interact/scripts.html#adef-onblur" class="noxref"><samp class= "ainst-SELECT">onblur</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element lost the focus -- <a href="../interact/scripts.html#adef-onchange" class="noxref"><samp class= "ainst-SELECT">onchange</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element value was changed -- <a href= "#reserved">%reserved;</a> -- reserved for possible future use -- &gt; &lt;!ELEMENT <a href="../interact/forms.html#edef-OPTGROUP" class= "noxref"><samp class= "einst">OPTGROUP</samp></a> - - (OPTION)+ -- option group --&gt; &lt;!ATTLIST OPTGROUP <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../interact/forms.html#adef-disabled" class="noxref"><samp class= "ainst-OPTION">disabled</samp></a> (disabled) #IMPLIED -- unavailable in this context -- <a href="../interact/forms.html#adef-label-OPTGROUP" class="noxref"><samp class="ainst-OPTGROUP">label</samp></a> <a href= "#Text">%Text;</a> #REQUIRED -- for use in hierarchical menus -- &gt; &lt;!ELEMENT <a href="../interact/forms.html#edef-OPTION" class="noxref"><samp class= "einst">OPTION</samp></a> - O (#PCDATA) -- selectable choice --&gt; &lt;!ATTLIST OPTION <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../interact/forms.html#adef-selected" class="noxref"><samp class= "ainst-OPTION">selected</samp></a> (selected) #IMPLIED <a href="../interact/forms.html#adef-disabled" class="noxref"><samp class= "ainst-OPTION">disabled</samp></a> (disabled) #IMPLIED -- unavailable in this context -- <a href="../interact/forms.html#adef-label-OPTION" class="noxref"><samp class="ainst-OPTION">label</samp></a> <a href= "#Text">%Text;</a> #IMPLIED -- for use in hierarchical menus -- <a href="../interact/forms.html#adef-value-OPTION" class="noxref"><samp class="ainst-OPTION">value</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- defaults to element content -- &gt; &lt;!ELEMENT <a href="../interact/forms.html#edef-TEXTAREA" class= "noxref"><samp class= "einst">TEXTAREA</samp></a> - - (#PCDATA) -- multi-line text field --&gt; &lt;!ATTLIST TEXTAREA <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../interact/forms.html#adef-name-TEXTAREA" class="noxref"><samp class="ainst-TEXTAREA">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED <a href="../interact/forms.html#adef-rows-TEXTAREA" class="noxref"><samp class="ainst-TEXTAREA">rows</samp></a> <a href= "../types.html#type-number">NUMBER</a> #REQUIRED <a href="../interact/forms.html#adef-cols-TEXTAREA" class="noxref"><samp class="ainst-TEXTAREA">cols</samp></a> <a href= "../types.html#type-number">NUMBER</a> #REQUIRED <a href="../interact/forms.html#adef-disabled" class="noxref"><samp class= "ainst-TEXTAREA">disabled</samp></a> (disabled) #IMPLIED -- unavailable in this context -- <a href="../interact/forms.html#adef-readonly" class="noxref"><samp class= "ainst-TEXTAREA">readonly</samp></a> (readonly) #IMPLIED <a href="../interact/forms.html#adef-tabindex" class="noxref"><samp class= "ainst-TEXTAREA">tabindex</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- position in tabbing order -- <a href="../interact/forms.html#adef-accesskey" class="noxref"><samp class= "ainst-TEXTAREA">accesskey</samp></a> <a href= "#Character">%Character;</a> #IMPLIED -- accessibility key character -- <a href="../interact/scripts.html#adef-onfocus" class="noxref"><samp class= "ainst-TEXTAREA">onfocus</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element got the focus -- <a href="../interact/scripts.html#adef-onblur" class="noxref"><samp class= "ainst-TEXTAREA">onblur</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element lost the focus -- <a href="../interact/scripts.html#adef-onselect" class="noxref"><samp class= "ainst-TEXTAREA">onselect</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- some text was selected -- <a href="../interact/scripts.html#adef-onchange" class="noxref"><samp class= "ainst-TEXTAREA">onchange</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element value was changed -- <a href= "#reserved">%reserved;</a> -- reserved for possible future use -- &gt; &lt;!-- #PCDATA is to solve the mixed content problem, per specification only whitespace is allowed there! --&gt; &lt;!ELEMENT <a href="../interact/forms.html#edef-FIELDSET" class= "noxref"><samp class="einst">FIELDSET</samp></a> - - (#PCDATA,LEGEND,(<a href= "#flow">%flow;</a>)*) -- form control group --&gt; &lt;!ATTLIST FIELDSET <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- &gt; &lt;!ELEMENT <a href="../interact/forms.html#edef-LEGEND" class="noxref"><samp class="einst">LEGEND</samp></a> - - (<a href= "#inline">%inline;</a>)* -- fieldset legend --&gt; &lt;!ENTITY % <a name="LAlign">LAlign</a> "(top|bottom|left|right)"&gt; &lt;!ATTLIST LEGEND <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../interact/forms.html#adef-accesskey" class="noxref"><samp class= "ainst-LEGEND">accesskey</samp></a> <a href= "#Character">%Character;</a> #IMPLIED -- accessibility key character -- <a href="../interact/forms.html#adef-align-LEGEND" class="noxref"><samp class="ainst-LEGEND">align</samp></a> <a href= "#LAlign">%LAlign;</a> #IMPLIED -- relative to fieldset -- &gt; &lt;!ELEMENT <a href="../interact/forms.html#edef-BUTTON" class="noxref"><samp class="einst">BUTTON</samp></a> - - (<a href="#flow">%flow;</a>)* -(A|<a href= "#formctrl">%formctrl;</a>|FORM|ISINDEX|FIELDSET|IFRAME) -- push button --&gt; &lt;!ATTLIST BUTTON <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../interact/forms.html#adef-name-BUTTON" class="noxref"><samp class= "ainst-BUTTON">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED <a href="../interact/forms.html#adef-value-BUTTON" class="noxref"><samp class="ainst-BUTTON">value</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- sent to server when submitted -- <a href="../interact/forms.html#adef-type-BUTTON" class="noxref"><samp class= "ainst-BUTTON">type</samp></a> (button|submit|reset) submit -- for use as form button -- <a href="../interact/forms.html#adef-disabled" class="noxref"><samp class= "ainst-BUTTON">disabled</samp></a> (disabled) #IMPLIED -- unavailable in this context -- <a href="../interact/forms.html#adef-tabindex" class="noxref"><samp class= "ainst-BUTTON">tabindex</samp></a> <a href= "../types.html#type-number">NUMBER</a> #IMPLIED -- position in tabbing order -- <a href="../interact/forms.html#adef-accesskey" class="noxref"><samp class= "ainst-BUTTON">accesskey</samp></a> <a href= "#Character">%Character;</a> #IMPLIED -- accessibility key character -- <a href="../interact/scripts.html#adef-onfocus" class="noxref"><samp class= "ainst-BUTTON">onfocus</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element got the focus -- <a href="../interact/scripts.html#adef-onblur" class="noxref"><samp class= "ainst-BUTTON">onblur</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- the element lost the focus -- <a href= "#reserved">%reserved;</a> -- reserved for possible future use -- &gt; &lt;!--======================= Tables =======================================--&gt; &lt;!-- IETF HTML table standard, see <a rel="biblioentry" href= "../references.html#ref-RFC1942">[RFC1942]</a> --&gt; &lt;!-- The BORDER attribute sets the thickness of the frame around the table. The default units are screen pixels. The FRAME attribute specifies which parts of the frame around the table should be rendered. The values are not the same as CALS to avoid a name clash with the VALIGN attribute. The value "border" is included for backwards compatibility with &lt;TABLE BORDER&gt; which yields frame=border and border=implied For &lt;TABLE BORDER=1&gt; you get border=1 and frame=implied. In this case, it is appropriate to treat this as frame=border for backwards compatibility with deployed browsers. --&gt; &lt;!ENTITY % <a name= "TFrame">TFrame</a> "(void|above|below|hsides|lhs|rhs|vsides|box|border)"&gt; &lt;!-- The RULES attribute defines which rules to draw between cells: If RULES is absent then assume: "none" if BORDER is absent or BORDER=0 otherwise "all" --&gt; &lt;!ENTITY % <a name= "TRules">TRules</a> "(none | groups | rows | cols | all)"&gt; &lt;!-- horizontal placement of table relative to document --&gt; &lt;!ENTITY % <a name="TAlign">TAlign</a> "(left|center|right)"&gt; &lt;!-- horizontal alignment attributes for cell contents --&gt; &lt;!ENTITY % <a name="cellhalign">cellhalign</a> "<a href="../struct/tables.html#adef-align-TD" class="noxref"><samp class= "ainst-TD">align</samp></a> (left|center|right|justify|char) #IMPLIED <a href="../struct/tables.html#adef-char" class="noxref"><samp class= "ainst">char</samp></a> <a href= "#Character">%Character;</a> #IMPLIED -- alignment char, e.g. char=':' -- <a href="../struct/tables.html#adef-charoff" class="noxref"><samp class= "ainst">charoff</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- offset for alignment char --" &gt; &lt;!-- vertical alignment attributes for cell contents --&gt; &lt;!ENTITY % <a name="cellvalign">cellvalign</a> "<a href="../struct/tables.html#adef-valign" class="noxref"><samp class= "ainst">valign</samp></a> (top|middle|bottom|baseline) #IMPLIED" &gt; &lt;!ELEMENT <a href="../struct/tables.html#edef-TABLE" class="noxref"><samp class="einst">TABLE</samp></a> - - (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)&gt; &lt;!ELEMENT <a href="../struct/tables.html#edef-CAPTION" class="noxref"><samp class="einst">CAPTION</samp></a> - - (<a href= "#inline">%inline;</a>)* -- table caption --&gt; &lt;!ELEMENT <a href="../struct/tables.html#edef-THEAD" class="noxref"><samp class="einst">THEAD</samp></a> - O (TR)+ -- table header --&gt; &lt;!ELEMENT <a href="../struct/tables.html#edef-TFOOT" class="noxref"><samp class="einst">TFOOT</samp></a> - O (TR)+ -- table footer --&gt; &lt;!ELEMENT <a href="../struct/tables.html#edef-TBODY" class="noxref"><samp class="einst">TBODY</samp></a> O O (TR)+ -- table body --&gt; &lt;!ELEMENT <a href="../struct/tables.html#edef-COLGROUP" class="noxref"><samp class= "einst">COLGROUP</samp></a> - O (COL)* -- table column group --&gt; &lt;!ELEMENT <a href="../struct/tables.html#edef-COL" class="noxref"><samp class="einst">COL</samp></a> - O EMPTY -- table column --&gt; &lt;!ELEMENT <a href="../struct/tables.html#edef-TR" class="noxref"><samp class="einst">TR</samp></a> - O (TH|TD)+ -- table row --&gt; &lt;!ELEMENT (<a href="../struct/tables.html#edef-TH" class="noxref"><samp class="einst">TH</samp></a>|<a href="../struct/tables.html#edef-TD" class= "noxref"><samp class="einst">TD</samp></a>) - O (<a href= "#flow">%flow;</a>)* -- table header cell, table data cell--&gt; &lt;!ATTLIST TABLE -- table element -- <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/tables.html#adef-summary" class="noxref"><samp class= "ainst-TABLE">summary</samp></a> <a href= "#Text">%Text;</a> #IMPLIED -- purpose/structure for speech output-- <a href="../struct/tables.html#adef-width-TABLE" class="noxref"><samp class= "ainst-TABLE">width</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- table width -- <a href="../struct/tables.html#adef-border-TABLE" class="noxref"><samp class= "ainst-TABLE">border</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- controls frame width around table -- <a href="../struct/tables.html#adef-frame" class="noxref"><samp class= "ainst-TABLE">frame</samp></a> <a href= "#TFrame">%TFrame;</a> #IMPLIED -- which parts of frame to render -- <a href="../struct/tables.html#adef-rules" class="noxref"><samp class= "ainst-TABLE">rules</samp></a> <a href= "#TRules">%TRules;</a> #IMPLIED -- rulings between rows and cols -- <a href="../struct/tables.html#adef-cellspacing" class="noxref"><samp class= "ainst-TABLE">cellspacing</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- spacing between cells -- <a href="../struct/tables.html#adef-cellpadding" class="noxref"><samp class= "ainst-TABLE">cellpadding</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- spacing within cells -- <a href="../struct/tables.html#adef-align-TABLE" class="noxref"><samp class= "ainst-TABLE">align</samp></a> <a href= "#TAlign">%TAlign;</a> #IMPLIED -- table position relative to window -- <a href="../present/graphics.html#adef-bgcolor" class="noxref"><samp class= "ainst-TABLE">bgcolor</samp></a> <a href= "#Color">%Color;</a> #IMPLIED -- background color for cells -- <a href= "#reserved">%reserved;</a> -- reserved for possible future use -- <samp class="ainst">datapagesize</samp> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- reserved for possible future use -- &gt; &lt;!ENTITY % <a name="CAlign">CAlign</a> "(top|bottom|left|right)"&gt; &lt;!ATTLIST CAPTION <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/tables.html#adef-align-CAPTION" class="noxref"><samp class="ainst-CAPTION">align</samp></a> <a href= "#CAlign">%CAlign;</a> #IMPLIED -- relative to table -- &gt; &lt;!-- COLGROUP groups a set of COL elements. It allows you to group several semantically related columns together. --&gt; &lt;!ATTLIST COLGROUP <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/tables.html#adef-span-COLGROUP" class="noxref"><samp class="ainst-COLGROUP">span</samp></a> <a href= "../types.html#type-number">NUMBER</a> 1 -- default number of columns in group -- <a href="../struct/tables.html#adef-width-COLGROUP" class="noxref"><samp class="ainst-COLGROUP">width</samp></a> <a href= "#MultiLength">%MultiLength;</a> #IMPLIED -- default width for enclosed COLs -- <a href= "#cellhalign">%cellhalign;</a> -- horizontal alignment in cells -- <a href= "#cellvalign">%cellvalign;</a> -- vertical alignment in cells -- &gt; &lt;!-- COL elements define the alignment properties for cells in one or more columns. The WIDTH attribute specifies the width of the columns, e.g. width=64 width in screen pixels width=0.5* relative width of 0.5 The SPAN attribute causes the attributes of one COL element to apply to more than one column. --&gt; &lt;!ATTLIST COL -- column groups and properties -- <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/tables.html#adef-span-COL" class="noxref"><samp class= "ainst-COL">span</samp></a> <a href= "../types.html#type-number">NUMBER</a> 1 -- COL attributes affect N columns -- <a href="../struct/tables.html#adef-width-COL" class="noxref"><samp class= "ainst-COL">width</samp></a> <a href= "#MultiLength">%MultiLength;</a> #IMPLIED -- column width specification -- <a href= "#cellhalign">%cellhalign;</a> -- horizontal alignment in cells -- <a href= "#cellvalign">%cellvalign;</a> -- vertical alignment in cells -- &gt; &lt;!-- Use THEAD to duplicate headers when breaking table across page boundaries, or for static headers when TBODY sections are rendered in scrolling panel. Use TFOOT to duplicate footers when breaking table across page boundaries, or for static footers when TBODY sections are rendered in scrolling panel. Use multiple TBODY sections when rules are needed between groups of table rows. --&gt; &lt;!ATTLIST (THEAD|TBODY|TFOOT) -- table section -- <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href= "#cellhalign">%cellhalign;</a> -- horizontal alignment in cells -- <a href= "#cellvalign">%cellvalign;</a> -- vertical alignment in cells -- &gt; &lt;!ATTLIST TR -- table row -- <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href= "#cellhalign">%cellhalign;</a> -- horizontal alignment in cells -- <a href= "#cellvalign">%cellvalign;</a> -- vertical alignment in cells -- <a href="../present/graphics.html#adef-bgcolor" class="noxref"><samp class= "ainst-TR">bgcolor</samp></a> <a href= "#Color">%Color;</a> #IMPLIED -- background color for row -- &gt; &lt;!-- Scope is simpler than headers attribute for common tables --&gt; &lt;!ENTITY % <a name="Scope">Scope</a> "(row|col|rowgroup|colgroup)"&gt; &lt;!-- TH is for headers, TD for data, but for cells acting as both use TD --&gt; &lt;!ATTLIST (TH|TD) -- header or data cell -- <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- <a href="../struct/tables.html#adef-abbr" class="noxref"><samp class= "ainst-TH">abbr</samp></a> <a href= "#Text">%Text;</a> #IMPLIED -- abbreviation for header cell -- <a href="../struct/tables.html#adef-axis" class="noxref"><samp class= "ainst-TH">axis</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- comma-separated list of related headers-- <a href="../struct/tables.html#adef-headers" class="noxref"><samp class= "ainst-TH">headers</samp></a> <a href= "../types.html#type-idrefs">IDREFS</a> #IMPLIED -- list of id's for header cells -- <a href="../struct/tables.html#adef-scope" class="noxref"><samp class= "ainst-TH">scope</samp></a> <a href= "#Scope">%Scope;</a> #IMPLIED -- scope covered by header cells -- <a href="../struct/tables.html#adef-rowspan" class="noxref"><samp class= "ainst-TH">rowspan</samp></a> <a href= "../types.html#type-number">NUMBER</a> 1 -- number of rows spanned by cell -- <a href="../struct/tables.html#adef-colspan" class="noxref"><samp class= "ainst-TH">colspan</samp></a> <a href= "../types.html#type-number">NUMBER</a> 1 -- number of cols spanned by cell -- <a href= "#cellhalign">%cellhalign;</a> -- horizontal alignment in cells -- <a href= "#cellvalign">%cellvalign;</a> -- vertical alignment in cells -- <a href="../struct/tables.html#adef-nowrap" class="noxref"><samp class= "ainst-TH">nowrap</samp></a> (nowrap) #IMPLIED -- suppress word wrap -- <a href="../present/graphics.html#adef-bgcolor" class="noxref"><samp class= "ainst-TH">bgcolor</samp></a> <a href= "#Color">%Color;</a> #IMPLIED -- cell background color -- <a href="../struct/tables.html#adef-width-TH" class="noxref"><samp class= "ainst-TH">width</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- width for cell -- <a href="../struct/tables.html#adef-height-TH" class="noxref"><samp class= "ainst-TH">height</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- height for cell -- &gt; &lt;!--================== Document Frames ===================================--&gt; &lt;!-- The content model for HTML documents depends on whether the HEAD is followed by a FRAMESET or BODY element. The widespread omission of the BODY start tag makes it impractical to define the content model without the use of a marked section. --&gt; &lt;![ <a href="#HTML.Frameset">%HTML.Frameset;</a> [ &lt;!<a name="frameset">ELEMENT</a> <a href= "../present/frames.html#edef-FRAMESET" class="noxref"><samp class= "einst">FRAMESET</samp></a> - - ((FRAMESET|FRAME)+ &amp; NOFRAMES?) -- window subdivision--&gt; &lt;!ATTLIST FRAMESET <a href= "#coreattrs">%coreattrs;</a> -- id, class, style, title -- <a href="../present/frames.html#adef-rows-FRAMESET" class="noxref"><samp class="ainst-FRAMESET">rows</samp></a> <a href= "#MultiLengths">%MultiLengths;</a> #IMPLIED -- list of lengths, default: 100% (1 row) -- <a href="../present/frames.html#adef-cols-FRAMESET" class="noxref"><samp class="ainst-FRAMESET">cols</samp></a> <a href= "#MultiLengths">%MultiLengths;</a> #IMPLIED -- list of lengths, default: 100% (1 col) -- <a href="../interact/scripts.html#adef-onload" class="noxref"><samp class= "ainst-FRAMESET">onload</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- all the frames have been loaded -- <a href="../interact/scripts.html#adef-onunload" class="noxref"><samp class= "ainst-FRAMESET">onunload</samp></a> <a href= "#Script">%Script;</a> #IMPLIED -- all the frames have been removed -- &gt; ]]&gt; &lt;![ <a href="#HTML.Frameset">%HTML.Frameset;</a> [ &lt;!-- reserved frame names start with "_" otherwise starts with letter --&gt; &lt;!<a name="frame">ELEMENT</a> <a href="../present/frames.html#edef-FRAME" class="noxref"><samp class= "einst">FRAME</samp></a> - O EMPTY -- subwindow --&gt; &lt;!ATTLIST FRAME <a href= "#coreattrs">%coreattrs;</a> -- id, class, style, title -- <a href="../present/frames.html#adef-longdesc-FRAME" class="noxref"><samp class="ainst-FRAME">longdesc</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- link to long description (complements title) -- <a href="../present/frames.html#adef-name-FRAME" class="noxref"><samp class= "ainst-FRAME">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- name of frame for targetting -- <a href="../present/frames.html#adef-src-FRAME" class="noxref"><samp class= "ainst-FRAME">src</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- source of frame content -- <a href="../present/frames.html#adef-frameborder" class="noxref"><samp class= "ainst-FRAME">frameborder</samp></a> (1|0) 1 -- request frame borders? -- <a href="../present/frames.html#adef-marginwidth" class="noxref"><samp class= "ainst-FRAME">marginwidth</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- margin widths in pixels -- <a href="../present/frames.html#adef-marginheight" class="noxref"><samp class="ainst-FRAME">marginheight</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- margin height in pixels -- <a href="../present/frames.html#adef-noresize" class="noxref"><samp class= "ainst-FRAME">noresize</samp></a> (noresize) #IMPLIED -- allow users to resize frames? -- <a href="../present/frames.html#adef-scrolling" class="noxref"><samp class= "ainst-FRAME">scrolling</samp></a> (yes|no|auto) auto -- scrollbar or none -- &gt; ]]&gt; &lt;!<a name="iframe">ELEMENT</a> <a href="../present/frames.html#edef-IFRAME" class="noxref"><samp class="einst">IFRAME</samp></a> - - (<a href= "#flow">%flow;</a>)* -- inline subwindow --&gt; &lt;!ATTLIST IFRAME <a href= "#coreattrs">%coreattrs;</a> -- id, class, style, title -- <a href="../present/frames.html#adef-longdesc-FRAME" class="noxref"><samp class="ainst-FRAME">longdesc</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- link to long description (complements title) -- <a href="../present/frames.html#adef-name-IFRAME" class="noxref"><samp class= "ainst-IFRAME">name</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- name of frame for targetting -- <a href="../interact/forms.html#adef-src" class="noxref"><samp class= "ainst-IFRAME">src</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- source of frame content -- <a href="../present/frames.html#adef-frameborder" class="noxref"><samp class= "ainst-IFRAME">frameborder</samp></a> (1|0) 1 -- request frame borders? -- <a href="../present/frames.html#adef-marginwidth" class="noxref"><samp class= "ainst-IFRAME">marginwidth</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- margin widths in pixels -- <a href="../present/frames.html#adef-marginheight" class="noxref"><samp class="ainst-IFRAME">marginheight</samp></a> <a href= "#Pixels">%Pixels;</a> #IMPLIED -- margin height in pixels -- <a href="../present/frames.html#adef-scrolling" class="noxref"><samp class= "ainst-IFRAME">scrolling</samp></a> (yes|no|auto) auto -- scrollbar or none -- <a href="../present/graphics.html#adef-align" class="noxref"><samp class= "ainst-IFRAME">align</samp></a> <a href= "#IAlign">%IAlign;</a> #IMPLIED -- vertical or horizontal alignment -- <a href="../present/frames.html#adef-height-IFRAME" class="noxref"><samp class="ainst-IFRAME">height</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- frame height -- <a href="../present/frames.html#adef-width-IFRAME" class="noxref"><samp class="ainst-IFRAME">width</samp></a> <a href= "#Length">%Length;</a> #IMPLIED -- frame width -- &gt; &lt;![ <a href="#HTML.Frameset">%HTML.Frameset;</a> [ &lt;!ENTITY % <a name= "noframes.content">noframes.content</a> "(BODY) -(NOFRAMES)"&gt; ]]&gt; &lt;!ENTITY % noframes.content "(<a href="#flow">%flow;</a>)*"&gt; &lt;!<a name="noframes">ELEMENT</a> <a href= "../present/frames.html#edef-NOFRAMES" class="noxref"><samp class= "einst">NOFRAMES</samp></a> - - <a href= "#noframes.content">%noframes.content;</a> -- alternate content container for non frame-based rendering --&gt; &lt;!ATTLIST NOFRAMES <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- &gt; &lt;!--================ Document Head =======================================--&gt; &lt;!-- <a href= "#head.misc">%head.misc;</a> defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT" --&gt; &lt;!ENTITY % <a name= "head.content">head.content</a> "TITLE &amp; ISINDEX? &amp; BASE?"&gt; &lt;!ELEMENT <a href="../struct/global.html#edef-HEAD" class="noxref"><samp class="einst">HEAD</samp></a> O O (<a href= "#head.content">%head.content;</a>) +(<a href= "#head.misc">%head.misc;</a>) -- document head --&gt; &lt;!ATTLIST HEAD <a href="#i18n">%i18n;</a> -- lang, dir -- <a href="../struct/global.html#adef-profile" class="noxref"><samp class= "ainst-HEAD">profile</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- named dictionary of meta info -- &gt; &lt;!-- The TITLE element is not considered part of the flow of text. It should be displayed, for example as the page header or window title. Exactly one title is required per document. --&gt; &lt;!ELEMENT <a href="../struct/global.html#edef-TITLE" class="noxref"><samp class="einst">TITLE</samp></a> - - (#PCDATA) -(<a href= "#head.misc">%head.misc;</a>) -- document title --&gt; &lt;!ATTLIST TITLE <a href="#i18n">%i18n</a>&gt; &lt;!<a name="isindex">ELEMENT</a> <a href= "../interact/forms.html#edef-ISINDEX" class="noxref"><samp class= "einst">ISINDEX</samp></a> - O EMPTY -- single line prompt --&gt; &lt;!ATTLIST ISINDEX <a href= "#coreattrs">%coreattrs;</a> -- id, class, style, title -- <a href="#i18n">%i18n;</a> -- lang, dir -- <a href="../interact/forms.html#adef-prompt" class="noxref"><samp class= "ainst-ISINDEX">prompt</samp></a> <a href= "#Text">%Text;</a> #IMPLIED -- prompt message --&gt; &lt;!ELEMENT <a href="../struct/links.html#edef-BASE" class="noxref"><samp class= "einst">BASE</samp></a> - O EMPTY -- document base URI --&gt; &lt;!ATTLIST BASE <a href="../struct/links.html#adef-href-BASE" class="noxref"><samp class= "ainst-BASE">href</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- URI that acts as base URI -- <a href="../present/frames.html#adef-target" class="noxref"><samp class= "ainst-A">target</samp></a> <a href= "#FrameTarget">%FrameTarget;</a> #IMPLIED -- render in this frame -- &gt; &lt;!ELEMENT <a href="../struct/global.html#edef-META" class="noxref"><samp class= "einst">META</samp></a> - O EMPTY -- generic metainformation --&gt; &lt;!ATTLIST META <a href= "#i18n">%i18n;</a> -- lang, dir, for use with content -- <a href="../struct/global.html#adef-http-equiv" class="noxref"><samp class= "ainst-META">http-equiv</samp></a> <a href= "../types.html#type-name">NAME</a> #IMPLIED -- HTTP response header name -- <a href="../struct/global.html#adef-name-META" class="noxref"><samp class= "ainst-META">name</samp></a> <a href= "../types.html#type-name">NAME</a> #IMPLIED -- metainformation name -- <a href="../struct/global.html#adef-content" class="noxref"><samp class= "ainst-META">content</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #REQUIRED -- associated information -- <a href="../struct/global.html#adef-scheme" class="noxref"><samp class= "ainst-META">scheme</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- select form of content -- &gt; &lt;!ELEMENT <a href="../present/styles.html#edef-STYLE" class="noxref"><samp class="einst">STYLE</samp></a> - - <a href= "#StyleSheet">%StyleSheet</a> -- style info --&gt; &lt;!ATTLIST STYLE <a href= "#i18n">%i18n;</a> -- lang, dir, for use with title -- <a href="../present/styles.html#adef-type-STYLE" class="noxref"><samp class= "ainst-STYLE">type</samp></a> <a href= "#ContentType">%ContentType;</a> #REQUIRED -- content type of style language -- <a href="../present/styles.html#adef-media" class="noxref"><samp class= "ainst-STYLE">media</samp></a> <a href= "#MediaDesc">%MediaDesc;</a> #IMPLIED -- designed for use with these media -- <a href="../struct/global.html#adef-title" class="noxref"><samp class= "ainst-STYLE">title</samp></a> <a href= "#Text">%Text;</a> #IMPLIED -- advisory title -- &gt; &lt;!ELEMENT <a href="../interact/scripts.html#edef-SCRIPT" class= "noxref"><samp class="einst">SCRIPT</samp></a> - - <a href= "#Script">%Script;</a> -- script statements --&gt; &lt;!ATTLIST SCRIPT <a href="../struct/links.html#adef-charset" class="noxref"><samp class= "ainst-SCRIPT">charset</samp></a> <a href= "#Charset">%Charset;</a> #IMPLIED -- char encoding of linked resource -- <a href="../interact/scripts.html#adef-type-SCRIPT" class="noxref"><samp class="ainst-SCRIPT">type</samp></a> <a href= "#ContentType">%ContentType;</a> #REQUIRED -- content type of script language -- <a href="../interact/scripts.html#adef-language" class="noxref"><samp class= "ainst-SCRIPT">language</samp></a> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- predefined script language name -- <a href="../interact/scripts.html#adef-src-SCRIPT" class="noxref"><samp class="ainst-SCRIPT">src</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- URI for an external script -- <a href="../interact/scripts.html#adef-defer" class="noxref"><samp class= "ainst-SCRIPT">defer</samp></a> (defer) #IMPLIED -- UA may defer execution of script -- <samp class="ainst">event</samp> <a href= "../types.html#type-cdata">CDATA</a> #IMPLIED -- reserved for possible future use -- <a href="../interact/forms.html#adef-for" class="noxref"><samp class= "ainst">for</samp></a> <a href= "#URI">%URI;</a> #IMPLIED -- reserved for possible future use -- &gt; &lt;!ELEMENT <a href="../interact/scripts.html#edef-NOSCRIPT" class= "noxref"><samp class="einst">NOSCRIPT</samp></a> - - (<a href= "#flow">%flow;</a>)* -- alternate content container for non script-based rendering --&gt; &lt;!ATTLIST NOSCRIPT <a href="#attrs">%attrs;</a> -- <a href= "#coreattrs">%coreattrs</a>, <a href="#i18n">%i18n</a>, <a href= "#events">%events</a> -- &gt; &lt;!--================ Document Structure ==================================--&gt; &lt;!ENTITY % <a name="version">version</a> "version <a href= "../types.html#type-cdata">CDATA</a> #FIXED '<a href= "#HTML.Version">%HTML.Version;</a>'"&gt; &lt;![ <a href="#HTML.Frameset">%HTML.Frameset;</a> [ &lt;!ENTITY % <a name="html.content">html.content</a> "HEAD, FRAMESET"&gt; ]]&gt; &lt;!ENTITY % html.content "HEAD, BODY"&gt; &lt;!ELEMENT <a href="../struct/global.html#edef-HTML" class="noxref"><samp class="einst">HTML</samp></a> O O (<a href= "#html.content">%html.content;</a>) -- document root element --&gt; &lt;!ATTLIST HTML <a href="#i18n">%i18n;</a> -- lang, dir -- <a href="#version">%version;</a> &gt; </pre> </div> <div class="navbar" align="center"> <hr><a href="dtd.html">previous</a> &nbsp; <a href="framesetdtd.html">next</a> &nbsp; <a href="../cover.html#minitoc">contents</a> &nbsp; <a href= "../index/elements.html">elements</a> &nbsp; <a href= "../index/attributes.html">attributes</a> &nbsp; <a href="../index/list.html"> index</a></div> </body> </html>
{ "content_hash": "7167118047a745a9d721c9619fd47cb8", "timestamp": "", "source": "github", "line_count": 1976, "max_line_length": 103, "avg_line_length": 50.895242914979754, "alnum_prop": 0.5967942407700186, "repo_name": "nachocove/MobileHtmlAgilityPack", "id": "41b1ae62f5d967156a28eb9dc76c7e1aa2adcfaa", "size": "100569", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Test.Mac/TestVectors/www.w3.org/TR/html401/sgml/loosedtd.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "187776" }, { "name": "CSS", "bytes": "1384" }, { "name": "Makefile", "bytes": "363" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>zf: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / extra-dev</a></li> <li class="active"><a href="">dev / zf - 8.8.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> zf <small> 8.8.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-05-14 08:21:45 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-14 08:21:45 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq dev Formal proof management system dune 3.1.1 Fast, portable, and opinionated build system ocaml 4.12.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.12.1 Official release 4.12.1 ocaml-config 2 OCaml Switch Configuration ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled ocamlfind 1.9.3 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/zf&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/ZF&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.8&quot; &amp; &lt; &quot;8.9~&quot;} ] tags: [ &quot;keyword: set theory&quot; &quot;keyword: Zermelo-Fraenkel&quot; &quot;category: Mathematics/Logic/Set theory&quot; ] authors: [ &quot;Guillaume Alexandre&quot; ] bug-reports: &quot;https://github.com/coq-contribs/zf/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/zf.git&quot; synopsis: &quot;An axiomatisation of intuitionistic Zermelo-Fraenkel set theory&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/zf/archive/v8.8.0.tar.gz&quot; checksum: &quot;md5=49677b0f593394f498c4a2f9a5c8456c&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-zf.8.8.0 coq.dev</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is dev). The following dependencies couldn&#39;t be met: - coq-zf -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.10 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-zf.8.8.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "ce48919c2be7023d5148ff1699a8bceb", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 159, "avg_line_length": 40.79761904761905, "alnum_prop": 0.5350160490224686, "repo_name": "coq-bench/coq-bench.github.io", "id": "c76b1f5608da2ea2e2f3c986c183fd2a780e17d7", "size": "6879", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.12.1-2.0.8/extra-dev/dev/zf/8.8.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
namespace wtaf { namespace net { wtaf::base::ID_Allocator Connection::m_id_allocator; Connection::~Connection() { while(auto *message_chunk = m_recv_msg_queue.pop()) { delete message_chunk; } while(auto *message_chunk = m_send_msg_queue.pop()) { delete message_chunk; } } Connection::Connection(int32 fd, const Addr &peer_addr) { m_fd = fd; m_peer_addr = peer_addr; } uint64 Connection::id() { return m_id; } void Connection::send(rapidjson::Document &doc) { rapidjson::StringBuffer buffer; rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); doc.Accept(writer); send(buffer.GetString(), buffer.GetSize()); } void Connection::send(const void *data, uint32 size) { Message_Chunk *message_chunk = new Message_Chunk(size + sizeof(uint32)); uint32 *uint32_ptr = (uint32*)message_chunk->read_ptr(); *uint32_ptr = htonl(size); memcpy(message_chunk->read_ptr() + sizeof(uint32), data, size); message_chunk->write_ptr(size + sizeof(uint32)); m_send_msg_queue.push(message_chunk); m_poller_task->write_connection(shared_from_this()); } void Connection::close() { m_poller_task->close_connection(shared_from_this()); } const Addr& Connection::peer_addr() { return m_peer_addr; } void Connection::parse() { while(true) { char *msg_length_buf = (char*)(&m_cur_msg_length); uint32 remain_bytes = sizeof(uint32); if(m_cur_msg_length != 0) { goto after_parse_length; } if(m_recv_msg_queue.length() < sizeof(uint32)) { break; } while(auto *message_chunk = m_recv_msg_queue.pop()) { uint32 length = message_chunk->length(); if(length < remain_bytes) { memcpy(msg_length_buf + sizeof(uint32) - remain_bytes, message_chunk->read_ptr(), length); remain_bytes -= length; delete message_chunk; } else { memcpy(msg_length_buf + sizeof(uint32) - remain_bytes, message_chunk->read_ptr(), remain_bytes); if(length == remain_bytes) { delete message_chunk; } else { message_chunk->read_ptr(remain_bytes); m_recv_msg_queue.push_front(message_chunk); } break; } } m_cur_msg_length = ntohl(m_cur_msg_length); after_parse_length: if(m_recv_msg_queue.length() < m_cur_msg_length) { break; } const uint32 MAX_MSG_LEN = 102400; char msg_buf[MAX_MSG_LEN] = {0}; char *data = msg_buf; bool is_new_buf = false; remain_bytes = m_cur_msg_length; if(m_cur_msg_length > MAX_MSG_LEN) { LOG_ERROR("message length exceed MAX_MSG_LEN(%d)", MAX_MSG_LEN); data = new char[m_cur_msg_length]; is_new_buf = true; } else if(m_cur_msg_length > MAX_MSG_LEN / 2) { LOG_ERROR("message length exceed half of MAX_MSG_LEN(%d)", MAX_MSG_LEN); } while(auto *message_chunk = m_recv_msg_queue.pop()) { uint32 length = message_chunk->length(); if(length < remain_bytes) { memcpy(data + m_cur_msg_length - remain_bytes, message_chunk->read_ptr(), length); remain_bytes -= length; delete message_chunk; } else { memcpy(data + m_cur_msg_length - remain_bytes, message_chunk->read_ptr(), remain_bytes); if(length == remain_bytes) { delete message_chunk; } else { message_chunk->read_ptr(remain_bytes); m_recv_msg_queue.push_front(message_chunk); } std::unique_ptr<Message> message(new Message(shared_from_this())); message->m_raw_data.assign(data, m_cur_msg_length); m_cur_msg_length = 0; if(is_new_buf) { delete[] data; } rapidjson::Document &doc = message->doc(); doc.Parse(message->m_raw_data.c_str()); if(!doc.HasParseError()) { if(!doc.HasMember("msg_type")) { break; } const rapidjson::Value &msg_type = doc["msg_type"]; if(!msg_type.IsUint()) { break; } message->m_type = msg_type.GetUint(); if(!doc.HasMember("msg_cmd")) { break; } const rapidjson::Value &msg_cmd = doc["msg_cmd"]; if(!msg_cmd.IsUint()) { break; } message->m_cmd = msg_cmd.GetUint(); m_dispatch_cb(std::move(message)); } break; } } } } } }
{ "content_hash": "3fedc4c3a467ece13a2832c9e406d98e", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 112, "avg_line_length": 27.245098039215687, "alnum_prop": 0.4595178121626484, "repo_name": "wanchuanheng/wtaf", "id": "661e3235a5869306c492c20dfed38e6f9ed9fec3", "size": "5706", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "net/connection.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "44154" } ], "symlink_target": "" }
require "em-synchrony" shared_examples_for "standard_bus" do Given(:slow_service) do Module.new do def actions; [:sleep]; end def do_it(params) sleep params[:time] end end end Given(:boring_salutation_service) do Module.new do def actions; [:say_hello]; end def do_it(params) "Hello #{params[:who]}" end end end Given(:echo_service) do Module.new do def actions; [:echo_this]; end def do_it(params) params[:data] end end end Given(:broken_service) do Module.new do def actions; [:shout_error]; end def do_it(params) raise params[:message] end end end Given(:calculator_service) do Module.new do def actions; [:calculator]; end def incr(params) @counter += 1 end def initialize @counter = 0 end def counter @counter end end end Given(:finalize) do provider.stop! consumer.stop! end context 'fire and forget' do context 'can invoke services' do When(:service) { provider.add_service calculator_service } When(:params) { { who: 'world' } } When(:service_response) do srv_resp = "UNSET" em do prepare EM.synchrony do srv_resp = consumer.request(:calculator, :incr, {}, {fast: true}) spec_waiter = EM::DefaultDeferrable.new EM.add_periodic_timer 0.1 do spec_waiter.succeed service.counter if service.counter == 1 end EM::Synchrony.sync spec_waiter done finalize end end srv_resp end Then { service_response.should_not be_a EM::Deferrable } And { service_response.should be_nil } And { service.counter.should eq 1 } end context 'ignores service errors' do Given(:error_message) { 'service is broken' } When(:service) { provider.add_service broken_service } Then do em do prepare EM.synchrony do service_result = consumer.request(:shout_error, :do_it, {message: error_message}, { fast: true }) service_result.should be_nil done finalize end end end end context 'ignores unknown services' do Then do em do prepare EM.synchrony do service_result = consumer.request(:mssing_service, :do_it, {}, { fast: true }) service_result.should be_nil done finalize end end end end end context 'ignores service errors' do When(:service) { provider.add_service boring_salutation_service } Then do em do prepare EM.synchrony do service_result = consumer.request(:say_hello, :to_no_one, {}, { fast: true }) service_result.should be_nil done finalize end end end end context 'expecting response' do context 'can invoke services' do When(:service) { provider.add_service boring_salutation_service } When(:params) { { who: 'world' } } Then do em do prepare EM.synchrony do service_result = EM::Synchrony.sync consumer.request(:say_hello, :do_it, params, { timeout: 2 }) service_result.should eq "Hello world" done finalize end end end end context 'fails with error => Timeout::Error when the response is slow' do Given(:time_base) { 0.01 } When(:params) { { time: time_base*4 } } When(:service) { provider.add_service slow_service } Then do em do prepare EM.synchrony do service_result = EM::Synchrony.sync consumer.request(:sleep, :do_it, params, { timeout: time_base/2.0 }) service_result.should be_a Hash service_result.should have_key :error service_result[:error].should eq 'Timeout::Error' done(time_base) #timeout response must came before this timeout end finalize end end end context 'return the same data type returned by service' do Given(:result_container) { {} } Given(:params) { { data: data } } When(:service) { provider.add_service echo_service } When('service is called') do em do prepare EM.synchrony do result_container[:result] = EM::Synchrony.sync consumer.request(:echo_this, :do_it, params) done finalize end end end context 'for string' do Given(:data) { "a simple string" } Then { result_container[:result].should eq data} end context 'for numbers' do Given(:data) { 237.324 } Then { result_container[:result].should eq data} end context 'for arrays' do Given(:data) { [1, 2, 3.0, "4", "cinco"]} Then { result_container[:result].should eq data} end context 'for symbols always return a string' do Given(:data) { :some_symbol } Then { result_container[:result].should eq data.to_s} end context 'for maps' do context 'with string keys' do Given(:data) { {'a' => 1, 'b' => 'dos'} } Then { result_container[:result].keys.should eq data.keys.map(&:to_sym)} And { result_container[:result].values.should eq data.values } end context 'with symbol keys' do Given(:data) { {a: 1, b: 'dos'} } Then { result_container[:result].should eq data} end end context 'for objects returns their json version' do Given(:custom_json) { {val: 'value'} } Given(:custom_class) do Class.new do def initialize(custom_json) @custom_json = custom_json end def to_json @custom_json end end end Given(:data) { custom_class.new(custom_json).to_json} Then { result_container[:result].should eq custom_json} end end context 'return something when service raise an error' do Given(:error_message) { 'service is broken' } When(:service) { provider.add_service broken_service } Then do em do prepare EM.synchrony do service_result = EM::Synchrony.sync consumer.request(:shout_error, :do_it, {message: error_message}, { timeout: 0.1 }) service_result[:error].should be_a Hash service_result[:error][:message].should eq error_message service_result[:error][:backtrace].should_not be_nil service_result[:error][:backtrace].should be_an Array done finalize end end end end context 'return an error when requesting an unknown service' do Given(:error_message) { Combi::Bus::UnknownStop.name } When(:service) { provider.add_service broken_service } Then do em do prepare EM.synchrony do begin service_result = EM::Synchrony.sync consumer.request(:some_not_service, :do_it, {}, { timeout: 0.1 }) if defined?(Combi::Queue) and consumer.class == Combi::Queue service_result[:error].should eq "Timeout::Error" else service_result[:error][:klass].should eq error_message service_result[:error][:message].should eq 'some_not_service/do_it' end done finalize end end end end end context 'return an error when requesting an unknown action for the service' do Given(:error_message) { Combi::Bus::UnknownStop.name } When(:service) { provider.add_service echo_service } Then do em do prepare EM.synchrony do begin service_result = EM::Synchrony.sync consumer.request(:echo_this, :do_other, {}, { timeout: 0.1 }) service_result[:error][:klass].should eq error_message service_result[:error][:message].should eq 'echo_this/do_other' done finalize end end end end end end end
{ "content_hash": "205c936b72f47fe029e66e581000b7ac", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 130, "avg_line_length": 28.843537414965986, "alnum_prop": 0.5524764150943396, "repo_name": "1uptalent/combi", "id": "0cda960f7d9c050de92e66dbe09a8627b4e0e12a", "size": "8480", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/shared_examples/standard_bus.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "54514" } ], "symlink_target": "" }
v3.10.0 (2019-01-10) -------------------- POTENTIALLY BREAKING CHANGE: The jquery and moment packages have been moved to peerDependencies. If you are using NPM to install fullcalendar, you'll need to explicitly add jquery and moment as dependencies of your project. NPM will not install them automatically. (#4136, #4233) New Features: - events from a Google Calendar event source will receive extended props (#4123) - export more classes and util functions (#4124) - new locales: zh-hk (#4266), be (#4274) Bugfixes: - not accepting dayClicks/selects because of overflow-x:hidden on html/body (#3615) - event end time not displayed when duration is one slot, in agenda view (#3049) - switching views before event fetch resolves, JS error (#3689) - single-day allDay event not showing when time is specified (#3854) - prev button doesn't work when previous days are hidden by hiddenDays and dayCount is greater than dateIncrement (#4202) - calendar locale not used in all moments objects (#4174) - background event background color does not completely fill cells in Chrome (#4145) - provide a delta for eventResize when resizing from start (#4135) - IE11 memory leak from not removing handler correctly (#4311) - make touchstart handlers passive (#4087) - fixed typescript definition for: eventAllow (#4243), selectAllow (#4319) - fixed locales: de (#4197, #4371), hu (#4203), tr (#4312), ja (#4329) v3.9.0 (2018-03-04) ------------------- - Bootstrap 4 support (#4032, #4065, thx @GeekJosh) - add OptionsInput to the fullcalendar.d.ts exports (#4040, #4006) - columnHeaderFormat/columnHeaderHtml/columnHeaderText in .d.ts file (#4061, #4085) - list-view auto-height not working (#3346, #4071, thx @WhatTheBuild) - bump momentjs minimum version to 2.20.1, for locale fixes (#4014) - swedish week header translation fix (#4082) - dutch year translation (#4069) v3.8.2 (2018-01-30) ------------------- Bugfixes: - Fix TypeScript definitions file with strictNullChecks (#4035) v3.8.1 (2018-01-28) ------------------- Bugfixes: - TypeScript definition file not compatible with noImplicitAny (#4017) - ES6 classes are not supported for grid class (#3437) - day numbers in month view should be localized (#3339) - select helper is resizable, causes js error (#3764) - selecting over existing select helper causes js error (#4031) - eventOrder doesn't work on custom fields (#3950) - aria label on button icons (#4023) - dynamic option changes to select/overlap/allow doesn't cause rerender Locales: - added Georgian (#3994) - added Bosnian (#4029) v3.8.0 (2017-12-18) ------------------- - new settings for month/agenda/basic views (#3078): - `columnHeaderFormat` (renamed from `columnFormat`) - `columnHeaderText` - `columnHeaderHtml` - TypeScript definition file (fullcalendar.d.ts) included in npm package (#3889) - codebase using SASS, though not taking advantage of it yet (#3463) - codebase fully ported to TypeScript / Webpack - Afrikaans locale fix (#3862) v3.7.0 (2017-11-13) ------------------- Bugfixes: - `render` method does not re-adjust calendar dimension (#3893) - when custom view navigates completely into hidden weekends, JS error ([scheduler-375]) Other: - in themes.html demo, fixed broken Bootswatch themes (#3917) - moved JavaScript codebase over to TypeScript (same external API; embedded typedefs coming soon) [scheduler-375]: https://github.com/fullcalendar/fullcalendar-scheduler/issues/375 v3.6.2 (2017-10-23) ------------------- Bugfixes: - Google Calendar event sources not calling `loading` callback (#3884) - `eventDataTransform` w/ eventConstraint shouldn't be called during event resizing (#3859) - `navLinks` would go to the previously navigated date (#3869) - `nowIndicator` arrow would repeatedly render (#3872) - fc-content-skeleton DOM element would repeatedly render on navigation in agenda view v3.6.1 (2017-10-11) ------------------- Bugfixes: - JSON feed event sources always requesting current page (#3865) - multi-day events appearing multiple times in more+ popover (#3856) v3.6.0 (2017-10-10) ------------------- Features: - `agendaEventMinHeight` for guaranteeing height (#961, #3788) thx @Stafie - `columnHeader` can be set to `false` to hide headings (#3438, #3787) thx @caseyjhol - export all View classes (#2851, #3831) - `updateEvent`, update complex attributes (#2864) - Albanian locale (#3847) thx @alensaqe Bugfixes: - objects used as non-standard Event properties ignored by `updateEvent` (#3839) - listDay error if event goes over period (#3843) - `validDays` with `hiddenDays`, js error when no days active (#3846) - json feed Event Source object no longer has `url` property (#3845) - `updateEvent`, allDay to timed, when no end, wrong end date (#3144) - `removeEvents` by `_id` stopped working (#3828) - correct `this` context in FuncEventSource (#3848) thx @declspec - js event not received in unselect callback when selecting another cell (#3832) Incompatibilities: - The `viewRender` callback might now be fired AFTER events have been rendered to the DOM. However, the eventRender/eventAfterRender/eventAfterAllRender callbacks will always be fired after `viewRender`, just as before. - The internal `Grid` class (accessed via `$.fullCalendar.Grid`) has been removed. For monkeypatching, use DayGrid/TimeGrid directly. v3.5.1 (2017-09-06) ------------------- - fixed loading trigger not firing (#3810) - fixed overaggressively fetching events, on option changes (#3820) - fixed event object `date` property being discarded (tho still parsed) (#3819) - fixed event object `_id` property being discarded (#3811) v3.5.0 (2017-08-30) ------------------- Features: - Bootstrap 3 theme support (#2334, #3566) - via `themeSystem: 'bootstrap3'` (the `theme` option is deprecated) - new `bootstrapGlyphicons` option - jQuery UI "Cupertino" theme no longer included in zip archive - improved theme switcher on demo page (#1436) (big thanks to @joankaradimov) - 25% event rendering performance improvement across the board (#2524) - console message for unknown method/calendar (#3253) - Serbian cyrilic/latin (#3656) - available via Packagist (#2999, #3617) Bugfixes: - slot time label invisible when minTime starts out of alignment (#2786) - bug with inverse-background event rendering when out of range (#3652) - wrongly disabled prev/next when current date outside of validRange (#3686, #3651) - updateEvent, error when changing allDay from false to true (#3518) - updateEvent doesn't support ID changes (#2928) - Promise then method doesn't forward result (#3744) - Korean typo (#3693) - fixed switching from any view to listview, eventAfterRender isn't called (#3751) Incompatibilities: - Event Objects obtained from clientEvents or various callbacks are no longer references to internally used objects. Rather, they are static object copies. - `clientEvents` method no longer returns events in same order as received. Do not depend on order. v3.4.0 (2017-04-27) ------------------- - composer.json for Composer (PHP package manager) (#3617) - fix toISOString for locales with non-trivial postformatting (#3619) - fix for nested inverse-background events (#3609) - Estonian locale (#3600) - fixed Latvian localization (#3525) - internal refactor of async systems v3.3.1 (2017-04-01) ------------------- Bugfixes: - stale calendar title when navigate away from then back to the a view (#3604) - js error when gotoDate immediately after calendar initialization (#3598) - agenda view scrollbars causes misalignment in jquery 3.2.1 (#3612) - navigation bug when trying to navigate to a day of another week (#3610) - dateIncrement not working when duration and dateIncrement have different units v3.3.0 (2017-03-23) ------------------- Features: - `visibleRange` - complete control over view's date range (#2847, #3105, #3245) - `validRange` - restrict date range (#429) - `changeView` - pass in a date or visibleRange as second param (#3366) - `dateIncrement` - customize prev/next jump (#2710) - `dateAlignment` - custom view alignment, like start-of-week (#3113) - `dayCount` - force a fixed number-of-days, even with hiddenDays (#2753) - `showNonCurrentDates` - option to hide day cells for prev/next months (#437) - can define a defaultView with a duration/visibleRange/dayCount with needing to create a custom view in the `views` object. Known as a "Generic View". Behavior Changes: - when custom view is specified with duration `{days:7}`, it will no longer align with the start of the week. (#2847) - when `gotoDate` is called on a custom view with a duration of multiple days, the view will always shift to begin with the given date. (#3515) Bugfixes: - event rendering when excessive `minTime`/`maxTime` (#2530) - event dragging not shown when excessive `minTime`/`maxTime` (#3055) - excessive `minTime`/`maxTime` not reflected in event fetching (#3514) - when minTime is negative, or maxTime beyond 24 hours, when event data is requested via a function or a feed, the given data params will have time parts. - external event dragging via touchpunch broken (#3544) - can't make an immediate new selection after existing selection, with mouse. introduced in v3.2.0 (#3558) v3.2.0 (2017-02-14) ------------------- Features: - `selectMinDistance`, threshold before a mouse selection begins (#2428) Bugfixes: - iOS 10, unwanted scrolling while dragging events/selection (#3403) - dayClick triggered when swiping on touch devices (#3332) - dayClick not functioning on Firefix mobile (#3450) - title computed incorrectly for views with no weekends (#2884) - unwanted scrollbars in month-view when non-integer width (#3453, #3444) - incorrect date formatting for locales with non-standlone month/day names (#3478) - date formatting, incorrect omission of trailing period for certain locales (#2504, #3486) - formatRange should collapse same week numbers (#3467) - Taiwanese locale updated (#3426) - Finnish noEventsMessage updated (#3476) - Croatian (hr) buttonText is blank (#3270) - JSON feed PHP example, date range math bug (#3485) v3.1.0 (2016-12-05) ------------------- - experimental support for implicitly batched ("debounced") event rendering (#2938) - `eventRenderWait` (off by default) - new `footer` option, similar to header toolbar (#654, #3299) - event rendering batch methods (#3351): - `renderEvents` - `updateEvents` - more granular touch settings (#3377): - `eventLongPressDelay` - `selectLongPressDelay` - eventDestroy not called when removing the popover (#3416, #3419) - print stylesheet and gcal extension now offered as minified (#3415) - fc-today in agenda header cells (#3361, #3365) - height-related options in tandem with other options (#3327, #3384) - Kazakh locale (#3394) - Afrikaans locale (#3390) - internal refactor related to timing of rendering and firing handlers. calls to rerender the current date-range and events from within handlers might not execute immediately. instead, will execute after handler finishes. v3.0.1 (2016-09-26) ------------------- Bugfixes: - list view rendering event times incorrectly (#3334) - list view rendering events/days out of order (#3347) - events with no title rendering as "undefined" - add .fc scope to table print styles (#3343) - "display no events" text fix for German (#3354) v3.0.0 (2016-09-04) ------------------- Features: - List View (#560) - new views: `listDay`, `listWeek`, `listMonth`, `listYear`, and simply `list` - `listDayFormat` - `listDayAltFormat` - `noEventsMessage` - Clickable day/week numbers for easier navigation (#424) - `navLinks` - `navLinkDayClick` - `navLinkWeekClick` - Programmatically allow/disallow user interactions: - `eventAllow` (#2740) - `selectAllow` (#2511) - Option to display week numbers in cells (#3024) - `weekNumbersWithinDays` (set to `true` to activate) - When week calc is ISO, default first day-of-week to Monday (#3255) - Macedonian locale (#2739) - Malay locale Breaking Changes: - IE8 support dropped - jQuery: minimum support raised to v2.0.0 - MomentJS: minimum support raised to v2.9.0 - `lang` option renamed to `locale` - dist files have been renamed to be more consistent with MomentJS: - `lang/` -> `locale/` - `lang-all.js` -> `locale-all.js` - behavior of moment methods no longer affected by ambiguousness: - `isSame` - `isBefore` - `isAfter` - View-Option-Hashes no longer supported (deprecated in 2.2.4) - removed `weekMode` setting - removed `axisFormat` setting - DOM structure of month/basic-view day cell numbers changed Bugfixes: - `$.fullCalendar.version` incorrect (#3292) Build System: - using gulp instead of grunt (faster) - using npm internally for dependencies instead of bower - changed repo directory structure v2.9.1 (2016-07-31) ------------------- - multiple definitions for businessHours (#2686) - businessHours for single day doesn't display weekends (#2944) - height/contentHeight can accept a function or 'parent' for dynamic value (#3271) - fix +more popover clipped by overflow (#3232) - fix +more popover positioned incorrectly when scrolled (#3137) - Norwegian Nynorsk translation (#3246) - fix isAnimating JS error (#3285) v2.9.0 (2016-07-10) ------------------- - Setters for (almost) all options (#564). See [docs](http://fullcalendar.io/docs/utilities/dynamic_options/) for more info. - Travis CI improvements (#3266) v2.8.0 (2016-06-19) ------------------- - getEventSources method (#3103, #2433) - getEventSourceById method (#3223) - refetchEventSources method (#3103, #1328, #254) - removeEventSources method (#3165, #948) - prevent flicker when refetchEvents is called (#3123, #2558) - fix for removing event sources that share same URL (#3209) - jQuery 3 support (#3197, #3124) - Travis CI integration (#3218) - EditorConfig for promoting consistent code style (#141) - use en dash when formatting ranges (#3077) - height:auto always shows scrollbars in month view on FF (#3202) - new languages: - Basque (#2992) - Galician (#194) - Luxembourgish (#2979) v2.7.3 (2016-06-02) ------------------- internal enhancements that plugins can benefit from: - EventEmitter not correctly working with stopListeningTo - normalizeEvent hook for manipulating event data v2.7.2 (2016-05-20) ------------------- - fixed desktops/laptops with touch support not accepting mouse events for dayClick/dragging/resizing (#3154, #3149) - fixed dayClick incorrectly triggered on touch scroll (#3152) - fixed touch event dragging wrongfully beginning upon scrolling document (#3160) - fixed minified JS still contained comments - UI change: mouse users must hover over an event to reveal its resizers v2.7.1 (2016-05-01) ------------------- - dayClick not firing on touch devices (#3138) - icons for prev/next not working in MS Edge (#2852) - fix bad languages troubles with firewalls (#3133, #3132) - update all dev dependencies (#3145, #3010, #2901, #251) - git-ignore npm debug logs (#3011) - misc automated test updates (#3139, #3147) - Google Calendar htmlLink not always defined (#2844) v2.7.0 (2016-04-23) ------------------- touch device support (#994): - smoother scrolling - interactions initiated via "long press": - event drag-n-drop - event resize - time-range selecting - `longPressDelay` v2.6.1 (2016-02-17) ------------------- - make `nowIndicator` positioning refresh on window resize v2.6.0 (2016-01-07) ------------------- - current time indicator (#414) - bundled with most recent version of moment (2.11.0) - UMD wrapper around lang files now handles commonjs (#2918) - fix bug where external event dragging would not respect eventOverlap - fix bug where external event dropping would not render the whole-day highlight v2.5.0 (2015-11-30) ------------------- - internal timezone refactor. fixes #2396, #2900, #2945, #2711 - internal "grid" system refactor. improved API for plugins. v2.4.0 (2015-08-16) ------------------- - add new buttons to the header via `customButtons` ([225]) - control stacking order of events via `eventOrder` ([364]) - control frequency of slot text via `slotLabelInterval` ([946]) - `displayEventTime` ([1904]) - `on` and `off` methods ([1910]) - renamed `axisFormat` to `slotLabelFormat` [225]: https://code.google.com/p/fullcalendar/issues/detail?id=225 [364]: https://code.google.com/p/fullcalendar/issues/detail?id=364 [946]: https://code.google.com/p/fullcalendar/issues/detail?id=946 [1904]: https://code.google.com/p/fullcalendar/issues/detail?id=1904 [1910]: https://code.google.com/p/fullcalendar/issues/detail?id=1910 v2.3.2 (2015-06-14) ------------------- - minor code adjustment in preparation for plugins v2.3.1 (2015-03-08) ------------------- - Fix week view column title for en-gb ([PR220]) - Publish to NPM ([2447]) - Detangle bower from npm package ([PR179]) [PR220]: https://github.com/arshaw/fullcalendar/pull/220 [2447]: https://code.google.com/p/fullcalendar/issues/detail?id=2447 [PR179]: https://github.com/arshaw/fullcalendar/pull/179 v2.3.0 (2015-02-21) ------------------- - internal refactoring in preparation for other views - businessHours now renders on whole-days in addition to timed areas - events in "more" popover not sorted by time ([2385]) - avoid using moment's deprecated zone method ([2443]) - destroying the calendar sometimes causes all window resize handlers to be unbound ([2432]) - multiple calendars on one page, can't accept external elements after navigating ([2433]) - accept external events from jqui sortable ([1698]) - external jqui drop processed before reverting ([1661]) - IE8 fix: month view renders incorrectly ([2428]) - IE8 fix: eventLimit:true wouldn't activate "more" link ([2330]) - IE8 fix: dragging an event with an href - IE8 fix: invisible element while dragging agenda view events - IE8 fix: erratic external element dragging [2385]: https://code.google.com/p/fullcalendar/issues/detail?id=2385 [2443]: https://code.google.com/p/fullcalendar/issues/detail?id=2443 [2432]: https://code.google.com/p/fullcalendar/issues/detail?id=2432 [2433]: https://code.google.com/p/fullcalendar/issues/detail?id=2433 [1698]: https://code.google.com/p/fullcalendar/issues/detail?id=1698 [1661]: https://code.google.com/p/fullcalendar/issues/detail?id=1661 [2428]: https://code.google.com/p/fullcalendar/issues/detail?id=2428 [2330]: https://code.google.com/p/fullcalendar/issues/detail?id=2330 v2.2.7 (2015-02-10) ------------------- - view.title wasn't defined in viewRender callback ([2407]) - FullCalendar versions >= 2.2.5 brokenness with Moment versions <= 2.8.3 ([2417]) - Support Bokmal Norwegian language specifically ([2427]) [2407]: https://code.google.com/p/fullcalendar/issues/detail?id=2407 [2417]: https://code.google.com/p/fullcalendar/issues/detail?id=2417 [2427]: https://code.google.com/p/fullcalendar/issues/detail?id=2427 v2.2.6 (2015-01-11) ------------------- - Compatibility with Moment v2.9. Was breaking GCal plugin ([2408]) - View object's `title` property mistakenly omitted ([2407]) - Single-day views with hiddens days could cause prev/next misbehavior ([2406]) - Don't let the current date ever be a hidden day (solves [2395]) - Hebrew locale ([2157]) [2408]: https://code.google.com/p/fullcalendar/issues/detail?id=2408 [2407]: https://code.google.com/p/fullcalendar/issues/detail?id=2407 [2406]: https://code.google.com/p/fullcalendar/issues/detail?id=2406 [2395]: https://code.google.com/p/fullcalendar/issues/detail?id=2395 [2157]: https://code.google.com/p/fullcalendar/issues/detail?id=2157 v2.2.5 (2014-12-30) ------------------- - `buttonText` specified for custom views via the `views` option - bugfix: wrong default value, couldn't override default - feature: default value taken from locale v2.2.4 (2014-12-29) ------------------- - Arbitrary durations for basic/agenda views with the `views` option ([692]) - Specify view-specific options using the `views` option. fixes [2283] - Deprecate view-option-hashes - Formalize and expose View API ([1055]) - updateEvent method, more intuitive behavior. fixes [2194] [692]: https://code.google.com/p/fullcalendar/issues/detail?id=692 [2283]: https://code.google.com/p/fullcalendar/issues/detail?id=2283 [1055]: https://code.google.com/p/fullcalendar/issues/detail?id=1055 [2194]: https://code.google.com/p/fullcalendar/issues/detail?id=2194 v2.2.3 (2014-11-26) ------------------- - removeEventSource with Google Calendar object source, would not remove ([2368]) - Events with invalid end dates are still accepted and rendered ([2350], [2237], [2296]) - Bug when rendering business hours and navigating away from original view ([2365]) - Links to Google Calendar events will use current timezone ([2122]) - Google Calendar plugin works with timezone names that have spaces - Google Calendar plugin accepts person email addresses as calendar IDs - Internally use numeric sort instead of alphanumeric sort ([2370]) [2368]: https://code.google.com/p/fullcalendar/issues/detail?id=2368 [2350]: https://code.google.com/p/fullcalendar/issues/detail?id=2350 [2237]: https://code.google.com/p/fullcalendar/issues/detail?id=2237 [2296]: https://code.google.com/p/fullcalendar/issues/detail?id=2296 [2365]: https://code.google.com/p/fullcalendar/issues/detail?id=2365 [2122]: https://code.google.com/p/fullcalendar/issues/detail?id=2122 [2370]: https://code.google.com/p/fullcalendar/issues/detail?id=2370 v2.2.2 (2014-11-19) ------------------- - Fixes to Google Calendar API V3 code - wouldn't recognize a lone-string Google Calendar ID if periods before the @ symbol - removeEventSource wouldn't work when given a Google Calendar ID v2.2.1 (2014-11-19) ------------------- - Migrate Google Calendar plugin to use V3 of the API ([1526]) [1526]: https://code.google.com/p/fullcalendar/issues/detail?id=1526 v2.2.0 (2014-11-14) ------------------- - Background events. Event object's `rendering` property ([144], [1286]) - `businessHours` option ([144]) - Controlling where events can be dragged/resized and selections can go ([396], [1286], [2253]) - `eventOverlap`, `selectOverlap`, and similar - `eventConstraint`, `selectConstraint`, and similar - Improvements to dragging and dropping external events ([2004]) - Associating with real event data. used with `eventReceive` - Associating a `duration` - Performance boost for moment creation - Be aware, FullCalendar-specific methods now attached directly to global moment.fn - Helps with [issue 2259][2259] - Reintroduced forgotten `dropAccept` option ([2312]) [144]: https://code.google.com/p/fullcalendar/issues/detail?id=144 [396]: https://code.google.com/p/fullcalendar/issues/detail?id=396 [1286]: https://code.google.com/p/fullcalendar/issues/detail?id=1286 [2004]: https://code.google.com/p/fullcalendar/issues/detail?id=2004 [2253]: https://code.google.com/p/fullcalendar/issues/detail?id=2253 [2259]: https://code.google.com/p/fullcalendar/issues/detail?id=2259 [2312]: https://code.google.com/p/fullcalendar/issues/detail?id=2312 v2.1.1 (2014-08-29) ------------------- - removeEventSource not working with array ([2203]) - mouseout not triggered after mouseover+updateEvent ([829]) - agenda event's render with no <a> href, not clickable ([2263]) [2203]: https://code.google.com/p/fullcalendar/issues/detail?id=2203 [829]: https://code.google.com/p/fullcalendar/issues/detail?id=829 [2263]: https://code.google.com/p/fullcalendar/issues/detail?id=2263 v2.1.0 (2014-08-25) ------------------- Large code refactor with better OOP, better code reuse, and more comments. **No more reliance on jQuery UI** for event dragging, resizing, or anything else. Significant changes to HTML/CSS skeleton: - Leverages tables for liquid rendering of days and events. No costly manual repositioning ([809]) - **Backwards-incompatibilities**: - **Many classNames have changed. Custom CSS will likely need to be adjusted.** - IE7 definitely not supported anymore - In `eventRender` callback, `element` will not be attached to DOM yet - Events are styled to be one line by default ([1992]). Can be undone through custom CSS, but not recommended (might get gaps [like this][111] in certain situations). A "more..." link when there are too many events on a day ([304]). Works with month and basic views as well as the all-day section of the agenda views. New options: - `eventLimit`. a number or `true` - `eventLimitClick`. the `"popover`" value will reveal all events in a raised panel (the default) - `eventLimitText` - `dayPopoverFormat` Changes related to height and scrollbars: - `aspectRatio`/`height`/`contentHeight` values will be honored *no matter what* - If too many events causing too much vertical space, scrollbars will be used ([728]). This is default behavior for month view (**backwards-incompatibility**) - If too few slots in agenda view, view will stretch to be the correct height ([2196]) - `'auto'` value for `height`/`contentHeight` options. If content is too tall, the view will vertically stretch to accomodate and no scrollbars will be used ([521]). - Tall weeks in month view will borrow height from other weeks ([243]) - Automatically scroll the view then dragging/resizing an event ([1025], [2078]) - New `fixedWeekCount` option to determines the number of weeks in month view - Supersedes `weekMode` (**deprecated**). Instead, use a combination of `fixedWeekCount` and one of the height options, possibly with an `'auto'` value Much nicer, glitch-free rendering of calendar *for printers* ([35]). Things you might not expect: - Buttons will become hidden - Agenda views display a flat list of events where the time slots would be Other issues resolved along the way: - Space on right side of agenda events configurable through CSS ([204]) - Problem with window resize ([259]) - Events sorting stays consistent across weeks ([510]) - Agenda's columns misaligned on wide screens ([511]) - Run `selectHelper` through `eventRender` callbacks ([629]) - Keyboard access, tabbing ([637]) - Run resizing events through `eventRender` ([714]) - Resize an event to a different day in agenda views ([736]) - Allow selection across days in agenda views ([778]) - Mouseenter delegated event not working on event elements ([936]) - Agenda event dragging, snapping to different columns is erratic ([1101]) - Android browser cuts off Day view at 8 PM with no scroll bar ([1203]) - Don't fire `eventMouseover`/`eventMouseout` while dragging/resizing ([1297]) - Customize the resize handle text ("=") ([1326]) - If agenda event is too short, don't overwrite `.fc-event-time` ([1700]) - Zooming calendar causes events to misalign ([1996]) - Event destroy callback on event removal ([2017]) - Agenda views, when RTL, should have axis on right ([2132]) - Make header buttons more accessibile ([2151]) - daySelectionMousedown should interpret OSX ctrl+click as a right mouse click ([2169]) - Best way to display time text on multi-day events *with times* ([2172]) - Eliminate table use for header layout ([2186]) - Event delegation used for event-related callbacks (like `eventClick`). Speedier. [35]: https://code.google.com/p/fullcalendar/issues/detail?id=35 [204]: https://code.google.com/p/fullcalendar/issues/detail?id=204 [243]: https://code.google.com/p/fullcalendar/issues/detail?id=243 [259]: https://code.google.com/p/fullcalendar/issues/detail?id=259 [304]: https://code.google.com/p/fullcalendar/issues/detail?id=304 [510]: https://code.google.com/p/fullcalendar/issues/detail?id=510 [511]: https://code.google.com/p/fullcalendar/issues/detail?id=511 [521]: https://code.google.com/p/fullcalendar/issues/detail?id=521 [629]: https://code.google.com/p/fullcalendar/issues/detail?id=629 [637]: https://code.google.com/p/fullcalendar/issues/detail?id=637 [714]: https://code.google.com/p/fullcalendar/issues/detail?id=714 [728]: https://code.google.com/p/fullcalendar/issues/detail?id=728 [736]: https://code.google.com/p/fullcalendar/issues/detail?id=736 [778]: https://code.google.com/p/fullcalendar/issues/detail?id=778 [809]: https://code.google.com/p/fullcalendar/issues/detail?id=809 [936]: https://code.google.com/p/fullcalendar/issues/detail?id=936 [1025]: https://code.google.com/p/fullcalendar/issues/detail?id=1025 [1101]: https://code.google.com/p/fullcalendar/issues/detail?id=1101 [1203]: https://code.google.com/p/fullcalendar/issues/detail?id=1203 [1297]: https://code.google.com/p/fullcalendar/issues/detail?id=1297 [1326]: https://code.google.com/p/fullcalendar/issues/detail?id=1326 [1700]: https://code.google.com/p/fullcalendar/issues/detail?id=1700 [1992]: https://code.google.com/p/fullcalendar/issues/detail?id=1992 [1996]: https://code.google.com/p/fullcalendar/issues/detail?id=1996 [2017]: https://code.google.com/p/fullcalendar/issues/detail?id=2017 [2078]: https://code.google.com/p/fullcalendar/issues/detail?id=2078 [2132]: https://code.google.com/p/fullcalendar/issues/detail?id=2132 [2151]: https://code.google.com/p/fullcalendar/issues/detail?id=2151 [2169]: https://code.google.com/p/fullcalendar/issues/detail?id=2169 [2172]: https://code.google.com/p/fullcalendar/issues/detail?id=2172 [2186]: https://code.google.com/p/fullcalendar/issues/detail?id=2186 [2196]: https://code.google.com/p/fullcalendar/issues/detail?id=2196 [111]: https://code.google.com/p/fullcalendar/issues/detail?id=111 v2.0.3 (2014-08-15) ------------------- - moment-2.8.1 compatibility ([2221]) - relative path in bower.json ([PR 117]) - upgraded jquery-ui and misc dev dependencies [2221]: https://code.google.com/p/fullcalendar/issues/detail?id=2221 [PR 117]: https://github.com/arshaw/fullcalendar/pull/177 v2.0.2 (2014-06-24) ------------------- - bug with persisting addEventSource calls ([2191]) - bug with persisting removeEvents calls with an array source ([2187]) - bug with removeEvents method when called with 0 removes all events ([2082]) [2191]: https://code.google.com/p/fullcalendar/issues/detail?id=2191 [2187]: https://code.google.com/p/fullcalendar/issues/detail?id=2187 [2082]: https://code.google.com/p/fullcalendar/issues/detail?id=2082 v2.0.1 (2014-06-15) ------------------- - `delta` parameters reintroduced in `eventDrop` and `eventResize` handlers ([2156]) - **Note**: this changes the argument order for `revertFunc` - wrongfully triggering a windowResize when resizing an agenda view event ([1116]) - `this` values in event drag-n-drop/resize handlers consistently the DOM node ([1177]) - `displayEventEnd` - v2 workaround to force display of an end time ([2090]) - don't modify passed-in eventSource items ([954]) - destroy method now removes fc-ltr class ([2033]) - weeks of last/next month still visible when weekends are hidden ([2095]) - fixed memory leak when destroying calendar with selectable/droppable ([2137]) - Icelandic language ([2180]) - Bahasa Indonesia language ([PR 172]) [1116]: https://code.google.com/p/fullcalendar/issues/detail?id=1116 [1177]: https://code.google.com/p/fullcalendar/issues/detail?id=1177 [2090]: https://code.google.com/p/fullcalendar/issues/detail?id=2090 [954]: https://code.google.com/p/fullcalendar/issues/detail?id=954 [2033]: https://code.google.com/p/fullcalendar/issues/detail?id=2033 [2095]: https://code.google.com/p/fullcalendar/issues/detail?id=2095 [2137]: https://code.google.com/p/fullcalendar/issues/detail?id=2137 [2156]: https://code.google.com/p/fullcalendar/issues/detail?id=2156 [2180]: https://code.google.com/p/fullcalendar/issues/detail?id=2180 [PR 172]: https://github.com/arshaw/fullcalendar/pull/172 v2.0.0 (2014-06-01) ------------------- Internationalization support, timezone support, and [MomentJS] integration. Extensive changes, many of which are backwards incompatible. [Full list of changes][Upgrading-to-v2] | [Affected Issues][Date-Milestone] An automated testing framework has been set up ([Karma] + [Jasmine]) and tests have been written which cover about half of FullCalendar's functionality. Special thanks to @incre-d, @vidbina, and @sirrocco for the help. In addition, the main development repo has been repurposed to also include the built distributable JS/CSS for the project and will serve as the new [Bower] endpoint. [MomentJS]: http://momentjs.com/ [Upgrading-to-v2]: http://arshaw.com/fullcalendar/wiki/Upgrading-to-v2/ [Date-Milestone]: https://code.google.com/p/fullcalendar/issues/list?can=1&q=milestone%3Ddate [Karma]: http://karma-runner.github.io/ [Jasmine]: http://jasmine.github.io/ [Bower]: http://bower.io/ v1.6.4 (2013-09-01) ------------------- - better algorithm for positioning timed agenda events ([1115]) - `slotEventOverlap` option to tweak timed agenda event overlapping ([218]) - selection bug when slot height is customized ([1035]) - supply view argument in `loading` callback ([1018]) - fixed week number not displaying in agenda views ([1951]) - fixed fullCalendar not initializing with no options ([1356]) - NPM's `package.json`, no more warnings or errors ([1762]) - building the bower component should output `bower.json` instead of `component.json` ([PR 125]) - use bower internally for fetching new versions of jQuery and jQuery UI [1115]: https://code.google.com/p/fullcalendar/issues/detail?id=1115 [218]: https://code.google.com/p/fullcalendar/issues/detail?id=218 [1035]: https://code.google.com/p/fullcalendar/issues/detail?id=1035 [1018]: https://code.google.com/p/fullcalendar/issues/detail?id=1018 [1951]: https://code.google.com/p/fullcalendar/issues/detail?id=1951 [1356]: https://code.google.com/p/fullcalendar/issues/detail?id=1356 [1762]: https://code.google.com/p/fullcalendar/issues/detail?id=1762 [PR 125]: https://github.com/arshaw/fullcalendar/pull/125 v1.6.3 (2013-08-10) ------------------- - `viewRender` callback ([PR 15]) - `viewDestroy` callback ([PR 15]) - `eventDestroy` callback ([PR 111]) - `handleWindowResize` option ([PR 54]) - `eventStartEditable`/`startEditable` options ([PR 49]) - `eventDurationEditable`/`durationEditable` options ([PR 49]) - specify function for `$.ajax` `data` parameter for JSON event sources ([PR 59]) - fixed bug with agenda event dropping in wrong column ([PR 55]) - easier event element z-index customization ([PR 58]) - classNames on past/future days ([PR 88]) - allow `null`/`undefined` event titles ([PR 84]) - small optimize for agenda event rendering ([PR 56]) - deprecated: - `viewDisplay` - `disableDragging` - `disableResizing` - bundled with latest jQuery (1.10.2) and jQuery UI (1.10.3) [PR 15]: https://github.com/arshaw/fullcalendar/pull/15 [PR 111]: https://github.com/arshaw/fullcalendar/pull/111 [PR 54]: https://github.com/arshaw/fullcalendar/pull/54 [PR 49]: https://github.com/arshaw/fullcalendar/pull/49 [PR 59]: https://github.com/arshaw/fullcalendar/pull/59 [PR 55]: https://github.com/arshaw/fullcalendar/pull/55 [PR 58]: https://github.com/arshaw/fullcalendar/pull/58 [PR 88]: https://github.com/arshaw/fullcalendar/pull/88 [PR 84]: https://github.com/arshaw/fullcalendar/pull/84 [PR 56]: https://github.com/arshaw/fullcalendar/pull/56 v1.6.2 (2013-07-18) ------------------- - `hiddenDays` option ([686]) - bugfix: when `eventRender` returns `false`, incorrect stacking of events ([762]) - bugfix: couldn't change `event.backgroundImage` when calling `updateEvent` (thx @stephenharris) [686]: https://code.google.com/p/fullcalendar/issues/detail?id=686 [762]: https://code.google.com/p/fullcalendar/issues/detail?id=762 v1.6.1 (2013-04-14) ------------------- - fixed event inner content overflow bug ([1783]) - fixed table header className bug [1772] - removed text-shadow on events (better for general use, thx @tkrotoff) [1783]: https://code.google.com/p/fullcalendar/issues/detail?id=1783 [1772]: https://code.google.com/p/fullcalendar/issues/detail?id=1772 v1.6.0 (2013-03-18) ------------------- - visual facelift, with bootstrap-inspired buttons and colors - simplified HTML/CSS for events and buttons - `dayRender`, for modifying a day cell ([191], thx @althaus) - week numbers on side of calendar ([295]) - `weekNumber` - `weekNumberCalculation` - `weekNumberTitle` - `W` formatting variable - finer snapping granularity for agenda view events ([495], thx @ms-doodle-com) - `eventAfterAllRender` ([753], thx @pdrakeweb) - `eventDataTransform` (thx @joeyspo) - `data-date` attributes on cells (thx @Jae) - expose `$.fullCalendar.dateFormatters` - when clicking fast on buttons, prevent text selection - bundled with latest jQuery (1.9.1) and jQuery UI (1.10.2) - Grunt/Lumbar build system for internal development - build for Bower package manager - build for jQuery plugin site [191]: https://code.google.com/p/fullcalendar/issues/detail?id=191 [295]: https://code.google.com/p/fullcalendar/issues/detail?id=295 [495]: https://code.google.com/p/fullcalendar/issues/detail?id=495 [753]: https://code.google.com/p/fullcalendar/issues/detail?id=753 v1.5.4 (2012-09-05) ------------------- - made compatible with jQuery 1.8.* (thx @archaeron) - bundled with jQuery 1.8.1 and jQuery UI 1.8.23 v1.5.3 (2012-02-06) ------------------- - fixed dragging issue with jQuery UI 1.8.16 ([1168]) - bundled with jQuery 1.7.1 and jQuery UI 1.8.17 [1168]: https://code.google.com/p/fullcalendar/issues/detail?id=1168 v1.5.2 (2011-08-21) ------------------- - correctly process UTC "Z" ISO8601 date strings ([750]) [750]: https://code.google.com/p/fullcalendar/issues/detail?id=750 v1.5.1 (2011-04-09) ------------------- - more flexible ISO8601 date parsing ([814]) - more flexible parsing of UNIX timestamps ([826]) - FullCalendar now buildable from source on a Mac ([795]) - FullCalendar QA'd in FF4 ([883]) - upgraded to jQuery 1.5.2 (which supports IE9) and jQuery UI 1.8.11 [814]: https://code.google.com/p/fullcalendar/issues/detail?id=814 [826]: https://code.google.com/p/fullcalendar/issues/detail?id=826 [795]: https://code.google.com/p/fullcalendar/issues/detail?id=795 [883]: https://code.google.com/p/fullcalendar/issues/detail?id=883 v1.5 (2011-03-19) ----------------- - slicker default styling for buttons - reworked a lot of the calendar's HTML and accompanying CSS (solves [327] and [395]) - more printer-friendly (fullcalendar-print.css) - fullcalendar now inherits styles from jquery-ui themes differently. styles for buttons are distinct from styles for calendar cells. (solves [299]) - can now color events through FullCalendar options and Event-Object properties ([117]) THIS IS NOW THE PREFERRED METHOD OF COLORING EVENTS (as opposed to using className and CSS) - FullCalendar options: - eventColor (changes both background and border) - eventBackgroundColor - eventBorderColor - eventTextColor - Event-Object options: - color (changes both background and border) - backgroundColor - borderColor - textColor - can now specify an event source as an *object* with a `url` property (json feed) or an `events` property (function or array) with additional properties that will be applied to the entire event source: - color (changes both background and border) - backgroudColor - borderColor - textColor - className - editable - allDayDefault - ignoreTimezone - startParam (for a feed) - endParam (for a feed) - ANY OF THE JQUERY $.ajax OPTIONS allows for easily changing from GET to POST and sending additional parameters ([386]) allows for easily attaching ajax handlers such as `error` ([754]) allows for turning caching on ([355]) - Google Calendar feeds are now specified differently: - specify a simple string of your feed's URL - specify an *object* with a `url` property of your feed's URL. you can include any of the new Event-Source options in this object. - the old `$.fullCalendar.gcalFeed` method still works - no more IE7 SSL popup ([504]) - remove `cacheParam` - use json event source `cache` option instead - latest jquery/jquery-ui [327]: https://code.google.com/p/fullcalendar/issues/detail?id=327 [395]: https://code.google.com/p/fullcalendar/issues/detail?id=395 [299]: https://code.google.com/p/fullcalendar/issues/detail?id=299 [117]: https://code.google.com/p/fullcalendar/issues/detail?id=117 [386]: https://code.google.com/p/fullcalendar/issues/detail?id=386 [754]: https://code.google.com/p/fullcalendar/issues/detail?id=754 [355]: https://code.google.com/p/fullcalendar/issues/detail?id=355 [504]: https://code.google.com/p/fullcalendar/issues/detail?id=504 v1.4.11 (2011-02-22) -------------------- - fixed rerenderEvents bug ([790]) - fixed bug with faulty dragging of events from all-day slot in agenda views - bundled with jquery 1.5 and jquery-ui 1.8.9 [790]: https://code.google.com/p/fullcalendar/issues/detail?id=790 v1.4.10 (2011-01-02) -------------------- - fixed bug with resizing event to different week in 5-day month view ([740]) - fixed bug with events not sticking after a removeEvents call ([757]) - fixed bug with underlying parseTime method, and other uses of parseInt ([688]) [740]: https://code.google.com/p/fullcalendar/issues/detail?id=740 [757]: https://code.google.com/p/fullcalendar/issues/detail?id=757 [688]: https://code.google.com/p/fullcalendar/issues/detail?id=688 v1.4.9 (2010-11-16) ------------------- - new algorithm for vertically stacking events ([111]) - resizing an event to a different week ([306]) - bug: some events not rendered with consecutive calls to addEventSource ([679]) [111]: https://code.google.com/p/fullcalendar/issues/detail?id=111 [306]: https://code.google.com/p/fullcalendar/issues/detail?id=306 [679]: https://code.google.com/p/fullcalendar/issues/detail?id=679 v1.4.8 (2010-10-16) ------------------- - ignoreTimezone option (set to `false` to process UTC offsets in ISO8601 dates) - bugfixes - event refetching not being called under certain conditions ([417], [554]) - event refetching being called multiple times under certain conditions ([586], [616]) - selection cannot be triggered by right mouse button ([558]) - agenda view left axis sized incorrectly ([465]) - IE js error when calendar is too narrow ([517]) - agenda view looks strange when no scrollbars ([235]) - improved parsing of ISO8601 dates with UTC offsets - $.fullCalendar.version - an internal refactor of the code, for easier future development and modularity [417]: https://code.google.com/p/fullcalendar/issues/detail?id=417 [554]: https://code.google.com/p/fullcalendar/issues/detail?id=554 [586]: https://code.google.com/p/fullcalendar/issues/detail?id=586 [616]: https://code.google.com/p/fullcalendar/issues/detail?id=616 [558]: https://code.google.com/p/fullcalendar/issues/detail?id=558 [465]: https://code.google.com/p/fullcalendar/issues/detail?id=465 [517]: https://code.google.com/p/fullcalendar/issues/detail?id=517 [235]: https://code.google.com/p/fullcalendar/issues/detail?id=235 v1.4.7 (2010-07-05) ------------------- - "dropping" external objects onto the calendar - droppable (boolean, to turn on/off) - dropAccept (to filter which events the calendar will accept) - drop (trigger) - selectable options can now be specified with a View Option Hash - bugfixes - dragged & reverted events having wrong time text ([406]) - bug rendering events that have an endtime with seconds, but no hours/minutes ([477]) - gotoDate date overflow bug ([429]) - wrong date reported when clicking on edge of last column in agenda views [412] - support newlines in event titles - select/unselect callbacks now passes native js event [406]: https://code.google.com/p/fullcalendar/issues/detail?id=406 [477]: https://code.google.com/p/fullcalendar/issues/detail?id=477 [429]: https://code.google.com/p/fullcalendar/issues/detail?id=429 [412]: https://code.google.com/p/fullcalendar/issues/detail?id=412 v1.4.6 (2010-05-31) ------------------- - "selecting" days or timeslots - options: selectable, selectHelper, unselectAuto, unselectCancel - callbacks: select, unselect - methods: select, unselect - when dragging an event, the highlighting reflects the duration of the event - code compressing by Google Closure Compiler - bundled with jQuery 1.4.2 and jQuery UI 1.8.1 v1.4.5 (2010-02-21) ------------------- - lazyFetching option, which can force the calendar to fetch events on every view/date change - scroll state of agenda views are preserved when switching back to view - bugfixes - calling methods on an uninitialized fullcalendar throws error - IE6/7 bug where an entire view becomes invisible ([320]) - error when rendering a hidden calendar (in jquery ui tabs for example) in IE ([340]) - interconnected bugs related to calendar resizing and scrollbars - when switching views or clicking prev/next, calendar would "blink" ([333]) - liquid-width calendar's events shifted (depending on initial height of browser) ([341]) - more robust underlying algorithm for calendar resizing [320]: https://code.google.com/p/fullcalendar/issues/detail?id=320 [340]: https://code.google.com/p/fullcalendar/issues/detail?id=340 [333]: https://code.google.com/p/fullcalendar/issues/detail?id=333 [341]: https://code.google.com/p/fullcalendar/issues/detail?id=341 v1.4.4 (2010-02-03) ------------------- - optimized event rendering in all views (events render in 1/10 the time) - gotoDate() does not force the calendar to unnecessarily rerender - render() method now correctly readjusts height v1.4.3 (2009-12-22) ------------------- - added destroy method - Google Calendar event pages respect currentTimezone - caching now handled by jQuery's ajax - protection from setting aspectRatio to zero - bugfixes - parseISO8601 and DST caused certain events to display day before - button positioning problem in IE6 - ajax event source removed after recently being added, events still displayed - event not displayed when end is an empty string - dynamically setting calendar height when no events have been fetched, throws error v1.4.2 (2009-12-02) ------------------- - eventAfterRender trigger - getDate & getView methods - height & contentHeight options (explicitly sets the pixel height) - minTime & maxTime options (restricts shown hours in agenda view) - getters [for all options] and setters [for height, contentHeight, and aspectRatio ONLY! stay tuned..] - render method now readjusts calendar's size - bugfixes - lightbox scripts that use iframes (like fancybox) - day-of-week classNames were off when firstDay=1 - guaranteed space on right side of agenda events (even when stacked) - accepts ISO8601 dates with a space (instead of 'T') v1.4.1 (2009-10-31) ------------------- - can exclude weekends with new 'weekends' option - gcal feed 'currentTimezone' option - bugfixes - year/month/date option sometimes wouldn't set correctly (depending on current date) - daylight savings issue caused agenda views to start at 1am (for BST users) - cleanup of gcal.js code v1.4 (2009-10-19) ----------------- - agendaWeek and agendaDay views - added some options for agenda views: - allDaySlot - allDayText - firstHour - slotMinutes - defaultEventMinutes - axisFormat - modified some existing options/triggers to work with agenda views: - dragOpacity and timeFormat can now accept a "View Hash" (a new concept) - dayClick now has an allDay parameter - eventDrop now has an an allDay parameter (this will affect those who use revertFunc, adjust parameter list) - added 'prevYear' and 'nextYear' for buttons in header - minor change for theme users, ui-state-hover not applied to active/inactive buttons - added event-color-changing example in docs - better defaults for right-to-left themed button icons v1.3.2 (2009-10-13) ------------------- - Bugfixes (please upgrade from 1.3.1!) - squashed potential infinite loop when addMonths and addDays is called with an invalid date - $.fullCalendar.parseDate() now correctly parses IETF format - when switching views, the 'today' button sticks inactive, fixed - gotoDate now can accept a single Date argument - documentation for changes in 1.3.1 and 1.3.2 now on website v1.3.1 (2009-09-30) ------------------- - Important Bugfixes (please upgrade from 1.3!) - When current date was late in the month, for long months, and prev/next buttons were clicked in month-view, some months would be skipped/repeated - In certain time zones, daylight savings time would cause certain days to be misnumbered in month-view - Subtle change in way week interval is chosen when switching from month to basicWeek/basicDay view - Added 'allDayDefault' option - Added 'changeView' and 'render' methods v1.3 (2009-09-21) ----------------- - different 'views': month/basicWeek/basicDay - more flexible 'header' system for buttons - themable by jQuery UI themes - resizable events (require jQuery UI resizable plugin) - rescoped & rewritten CSS, enhanced default look - cleaner css & rendering techniques for right-to-left - reworked options & API to support multiple views / be consistent with jQuery UI - refactoring of entire codebase - broken into different JS & CSS files, assembled w/ build scripts - new test suite for new features, uses firebug-lite - refactored docs - Options - + date - + defaultView - + aspectRatio - + disableResizing - + monthNames (use instead of $.fullCalendar.monthNames) - + monthNamesShort (use instead of $.fullCalendar.monthAbbrevs) - + dayNames (use instead of $.fullCalendar.dayNames) - + dayNamesShort (use instead of $.fullCalendar.dayAbbrevs) - + theme - + buttonText - + buttonIcons - x draggable -> editable/disableDragging - x fixedWeeks -> weekMode - x abbrevDayHeadings -> columnFormat - x buttons/title -> header - x eventDragOpacity -> dragOpacity - x eventRevertDuration -> dragRevertDuration - x weekStart -> firstDay - x rightToLeft -> isRTL - x showTime (use 'allDay' CalEvent property instead) - Triggered Actions - + eventResizeStart - + eventResizeStop - + eventResize - x monthDisplay -> viewDisplay - x resize -> windowResize - 'eventDrop' params changed, can revert if ajax cuts out - CalEvent Properties - x showTime -> allDay - x draggable -> editable - 'end' is now INCLUSIVE when allDay=true - 'url' now produces a real <a> tag, more native clicking/tab behavior - Methods: - + renderEvent - x prevMonth -> prev - x nextMonth -> next - x prevYear/nextYear -> moveDate - x refresh -> rerenderEvents/refetchEvents - x removeEvent -> removeEvents - x getEventsByID -> clientEvents - Utilities: - 'formatDate' format string completely changed (inspired by jQuery UI datepicker + datejs) - 'formatDates' added to support date-ranges - Google Calendar Options: - x draggable -> editable - Bugfixes - gcal extension fetched 25 results max, now fetches all v1.2.1 (2009-06-29) ------------------- - bugfixes - allows and corrects invalid end dates for events - doesn't throw an error in IE while rendering when display:none - fixed 'loading' callback when used w/ multiple addEventSource calls - gcal className can now be an array v1.2 (2009-05-31) ----------------- - expanded API - 'className' CalEvent attribute - 'source' CalEvent attribute - dynamically get/add/remove/update events of current month - locale improvements: change month/day name text - better date formatting ($.fullCalendar.formatDate) - multiple 'event sources' allowed - dynamically add/remove event sources - options for prevYear and nextYear buttons - docs have been reworked (include addition of Google Calendar docs) - changed behavior of parseDate for number strings (now interpets as unix timestamp, not MS times) - bugfixes - rightToLeft month start bug - off-by-one errors with month formatting commands - events from previous months sticking when clicking prev/next quickly - Google Calendar API changed to work w/ multiple event sources - can also provide 'className' and 'draggable' options - date utilties moved from $ to $.fullCalendar - more documentation in source code - minified version of fullcalendar.js - test suit (available from svn) - top buttons now use `<button>` w/ an inner `<span>` for better css cusomization - thus CSS has changed. IF UPGRADING FROM PREVIOUS VERSIONS, UPGRADE YOUR FULLCALENDAR.CSS FILE v1.1 (2009-05-10) ----------------- - Added the following options: - weekStart - rightToLeft - titleFormat - timeFormat - cacheParam - resize - Fixed rendering bugs - Opera 9.25 (events placement & window resizing) - IE6 (window resizing) - Optimized window resizing for ALL browsers - Events on same day now sorted by start time (but first by timespan) - Correct z-index when dragging - Dragging contained in overflow DIV for IE6 - Modified fullcalendar.css - for right-to-left support - for variable start-of-week - for IE6 resizing bug - for THEAD and TBODY (in 1.0, just used TBODY, restructured in 1.1) - IF UPGRADING FROM FULLCALENDAR 1.0, YOU MUST UPGRADE FULLCALENDAR.CSS
{ "content_hash": "135e7b4e2580661d29658fe1900c1928", "timestamp": "", "source": "github", "line_count": 1341, "max_line_length": 103, "avg_line_length": 39.43847874720358, "alnum_prop": 0.7274566528636527, "repo_name": "hitscs/AdminLTE", "id": "930d450ba066db955fd9648a348d642fa06725ff", "size": "52888", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "bower_components/fullcalendar/CHANGELOG.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "248408" }, { "name": "HTML", "bytes": "1502449" }, { "name": "JavaScript", "bytes": "758153" } ], "symlink_target": "" }
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QIODevice.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:31 Warning : this file is machine generated - do not modify. --} ----------------------------------------------------------------------------- module Qtc.Core.QIODevice ( isOpen ,isTextModeEnabled ,openMode ,peek ,setTextModeEnabled ,Qwrite(..) ,qIODevice_delete ,qIODevice_deleteLater ) where import Foreign.C.Types import Qth.ClassTypes.Core import Qtc.Enums.Base import Qtc.Enums.Core.QIODevice import Qtc.Classes.Base import Qtc.Classes.Qccs import Qtc.Classes.Core import Qtc.ClassTypes.Core import Qth.ClassTypes.Core instance QuserMethod (QIODevice ()) (()) (IO ()) where userMethod qobj evid () = withObjectPtr qobj $ \cobj_qobj -> qtc_QIODevice_userMethod cobj_qobj (toCInt evid) foreign import ccall "qtc_QIODevice_userMethod" qtc_QIODevice_userMethod :: Ptr (TQIODevice a) -> CInt -> IO () instance QuserMethod (QIODeviceSc a) (()) (IO ()) where userMethod qobj evid () = withObjectPtr qobj $ \cobj_qobj -> qtc_QIODevice_userMethod cobj_qobj (toCInt evid) instance QuserMethod (QIODevice ()) (QVariant ()) (IO (QVariant ())) where userMethod qobj evid qvoj = withObjectRefResult $ withObjectPtr qobj $ \cobj_qobj -> withObjectPtr qvoj $ \cobj_qvoj -> qtc_QIODevice_userMethodVariant cobj_qobj (toCInt evid) cobj_qvoj foreign import ccall "qtc_QIODevice_userMethodVariant" qtc_QIODevice_userMethodVariant :: Ptr (TQIODevice a) -> CInt -> Ptr (TQVariant ()) -> IO (Ptr (TQVariant ())) instance QuserMethod (QIODeviceSc a) (QVariant ()) (IO (QVariant ())) where userMethod qobj evid qvoj = withObjectRefResult $ withObjectPtr qobj $ \cobj_qobj -> withObjectPtr qvoj $ \cobj_qvoj -> qtc_QIODevice_userMethodVariant cobj_qobj (toCInt evid) cobj_qvoj instance QatEnd (QIODevice ()) (()) where atEnd x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_atEnd_h cobj_x0 foreign import ccall "qtc_QIODevice_atEnd_h" qtc_QIODevice_atEnd_h :: Ptr (TQIODevice a) -> IO CBool instance QatEnd (QIODeviceSc a) (()) where atEnd x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_atEnd_h cobj_x0 instance QbytesAvailable (QIODevice ()) (()) where bytesAvailable x0 () = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_bytesAvailable_h cobj_x0 foreign import ccall "qtc_QIODevice_bytesAvailable_h" qtc_QIODevice_bytesAvailable_h :: Ptr (TQIODevice a) -> IO CLLong instance QbytesAvailable (QIODeviceSc a) (()) where bytesAvailable x0 () = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_bytesAvailable_h cobj_x0 instance QbytesToWrite (QIODevice ()) (()) where bytesToWrite x0 () = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_bytesToWrite_h cobj_x0 foreign import ccall "qtc_QIODevice_bytesToWrite_h" qtc_QIODevice_bytesToWrite_h :: Ptr (TQIODevice a) -> IO CLLong instance QbytesToWrite (QIODeviceSc a) (()) where bytesToWrite x0 () = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_bytesToWrite_h cobj_x0 instance QcanReadLine (QIODevice ()) (()) where canReadLine x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_canReadLine_h cobj_x0 foreign import ccall "qtc_QIODevice_canReadLine_h" qtc_QIODevice_canReadLine_h :: Ptr (TQIODevice a) -> IO CBool instance QcanReadLine (QIODeviceSc a) (()) where canReadLine x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_canReadLine_h cobj_x0 instance Qclose (QIODevice ()) (()) (IO ()) where close x0 () = withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_close_h cobj_x0 foreign import ccall "qtc_QIODevice_close_h" qtc_QIODevice_close_h :: Ptr (TQIODevice a) -> IO () instance Qclose (QIODeviceSc a) (()) (IO ()) where close x0 () = withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_close_h cobj_x0 instance QerrorString (QIODevice a) (()) where errorString x0 () = withStringResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_errorString cobj_x0 foreign import ccall "qtc_QIODevice_errorString" qtc_QIODevice_errorString :: Ptr (TQIODevice a) -> IO (Ptr (TQString ())) isOpen :: QIODevice a -> (()) -> IO (Bool) isOpen x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_isOpen cobj_x0 foreign import ccall "qtc_QIODevice_isOpen" qtc_QIODevice_isOpen :: Ptr (TQIODevice a) -> IO CBool instance QisReadable (QIODevice a) (()) where isReadable x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_isReadable cobj_x0 foreign import ccall "qtc_QIODevice_isReadable" qtc_QIODevice_isReadable :: Ptr (TQIODevice a) -> IO CBool instance QisSequential (QIODevice ()) (()) where isSequential x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_isSequential_h cobj_x0 foreign import ccall "qtc_QIODevice_isSequential_h" qtc_QIODevice_isSequential_h :: Ptr (TQIODevice a) -> IO CBool instance QisSequential (QIODeviceSc a) (()) where isSequential x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_isSequential_h cobj_x0 isTextModeEnabled :: QIODevice a -> (()) -> IO (Bool) isTextModeEnabled x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_isTextModeEnabled cobj_x0 foreign import ccall "qtc_QIODevice_isTextModeEnabled" qtc_QIODevice_isTextModeEnabled :: Ptr (TQIODevice a) -> IO CBool instance QisWritable (QIODevice a) (()) where isWritable x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_isWritable cobj_x0 foreign import ccall "qtc_QIODevice_isWritable" qtc_QIODevice_isWritable :: Ptr (TQIODevice a) -> IO CBool instance Qopen (QIODevice ()) ((OpenMode)) where open x0 (x1) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_open_h cobj_x0 (toCLong $ qFlags_toInt x1) foreign import ccall "qtc_QIODevice_open_h" qtc_QIODevice_open_h :: Ptr (TQIODevice a) -> CLong -> IO CBool instance Qopen (QIODeviceSc a) ((OpenMode)) where open x0 (x1) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_open_h cobj_x0 (toCLong $ qFlags_toInt x1) openMode :: QIODevice a -> (()) -> IO (OpenMode) openMode x0 () = withQFlagsResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_openMode cobj_x0 foreign import ccall "qtc_QIODevice_openMode" qtc_QIODevice_openMode :: Ptr (TQIODevice a) -> IO CLong peek :: QIODevice a -> ((Int)) -> IO (String) peek x0 (x1) = withStringResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_peek cobj_x0 (toCLLong x1) foreign import ccall "qtc_QIODevice_peek" qtc_QIODevice_peek :: Ptr (TQIODevice a) -> CLLong -> IO (Ptr (TQString ())) instance Qpos (QIODevice ()) (()) (IO (Int)) where pos x0 () = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_pos_h cobj_x0 foreign import ccall "qtc_QIODevice_pos_h" qtc_QIODevice_pos_h :: Ptr (TQIODevice a) -> IO CLLong instance Qpos (QIODeviceSc a) (()) (IO (Int)) where pos x0 () = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_pos_h cobj_x0 instance Qqread (QIODevice a) ((Int)) where qread x0 (x1) = withStringResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_read cobj_x0 (toCLLong x1) foreign import ccall "qtc_QIODevice_read" qtc_QIODevice_read :: Ptr (TQIODevice a) -> CLLong -> IO (Ptr (TQString ())) instance QreadAll (QIODevice a) (()) where readAll x0 () = withStringResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_readAll cobj_x0 foreign import ccall "qtc_QIODevice_readAll" qtc_QIODevice_readAll :: Ptr (TQIODevice a) -> IO (Ptr (TQString ())) instance QreadLine (QIODevice a) (()) where readLine x0 () = withStringResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_readLine cobj_x0 foreign import ccall "qtc_QIODevice_readLine" qtc_QIODevice_readLine :: Ptr (TQIODevice a) -> IO (Ptr (TQString ())) instance QreadLine (QIODevice a) ((Int)) where readLine x0 (x1) = withStringResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_readLine1 cobj_x0 (toCLLong x1) foreign import ccall "qtc_QIODevice_readLine1" qtc_QIODevice_readLine1 :: Ptr (TQIODevice a) -> CLLong -> IO (Ptr (TQString ())) instance Qreset (QIODevice ()) (()) (IO (Bool)) where reset x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_reset_h cobj_x0 foreign import ccall "qtc_QIODevice_reset_h" qtc_QIODevice_reset_h :: Ptr (TQIODevice a) -> IO CBool instance Qreset (QIODeviceSc a) (()) (IO (Bool)) where reset x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_reset_h cobj_x0 instance Qseek (QIODevice ()) ((Int)) where seek x0 (x1) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_seek_h cobj_x0 (toCLLong x1) foreign import ccall "qtc_QIODevice_seek_h" qtc_QIODevice_seek_h :: Ptr (TQIODevice a) -> CLLong -> IO CBool instance Qseek (QIODeviceSc a) ((Int)) where seek x0 (x1) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_seek_h cobj_x0 (toCLLong x1) instance QsetErrorString (QIODevice ()) ((String)) where setErrorString x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_setErrorString cobj_x0 cstr_x1 foreign import ccall "qtc_QIODevice_setErrorString" qtc_QIODevice_setErrorString :: Ptr (TQIODevice a) -> CWString -> IO () instance QsetErrorString (QIODeviceSc a) ((String)) where setErrorString x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_setErrorString cobj_x0 cstr_x1 instance QsetOpenMode (QIODevice ()) ((OpenMode)) where setOpenMode x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_setOpenMode cobj_x0 (toCLong $ qFlags_toInt x1) foreign import ccall "qtc_QIODevice_setOpenMode" qtc_QIODevice_setOpenMode :: Ptr (TQIODevice a) -> CLong -> IO () instance QsetOpenMode (QIODeviceSc a) ((OpenMode)) where setOpenMode x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_setOpenMode cobj_x0 (toCLong $ qFlags_toInt x1) setTextModeEnabled :: QIODevice a -> ((Bool)) -> IO () setTextModeEnabled x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_setTextModeEnabled cobj_x0 (toCBool x1) foreign import ccall "qtc_QIODevice_setTextModeEnabled" qtc_QIODevice_setTextModeEnabled :: Ptr (TQIODevice a) -> CBool -> IO () instance Qqsize (QIODevice ()) (()) (IO (Int)) where qsize x0 () = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_size_h cobj_x0 foreign import ccall "qtc_QIODevice_size_h" qtc_QIODevice_size_h :: Ptr (TQIODevice a) -> IO CLLong instance Qqsize (QIODeviceSc a) (()) (IO (Int)) where qsize x0 () = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_size_h cobj_x0 instance QwaitForBytesWritten (QIODevice ()) ((Int)) where waitForBytesWritten x0 (x1) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_waitForBytesWritten_h cobj_x0 (toCInt x1) foreign import ccall "qtc_QIODevice_waitForBytesWritten_h" qtc_QIODevice_waitForBytesWritten_h :: Ptr (TQIODevice a) -> CInt -> IO CBool instance QwaitForBytesWritten (QIODeviceSc a) ((Int)) where waitForBytesWritten x0 (x1) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_waitForBytesWritten_h cobj_x0 (toCInt x1) instance QwaitForReadyRead (QIODevice ()) ((Int)) where waitForReadyRead x0 (x1) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_waitForReadyRead_h cobj_x0 (toCInt x1) foreign import ccall "qtc_QIODevice_waitForReadyRead_h" qtc_QIODevice_waitForReadyRead_h :: Ptr (TQIODevice a) -> CInt -> IO CBool instance QwaitForReadyRead (QIODeviceSc a) ((Int)) where waitForReadyRead x0 (x1) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_waitForReadyRead_h cobj_x0 (toCInt x1) class Qwrite x1 where write :: QIODevice a -> x1 -> IO (Int) instance Qwrite ((String)) where write x0 (x1) = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_write cobj_x0 cstr_x1 foreign import ccall "qtc_QIODevice_write" qtc_QIODevice_write :: Ptr (TQIODevice a) -> CWString -> IO CLLong instance Qwrite ((String, Int)) where write x0 (x1, x2) = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_write1 cobj_x0 cstr_x1 (toCLLong x2) foreign import ccall "qtc_QIODevice_write1" qtc_QIODevice_write1 :: Ptr (TQIODevice a) -> CWString -> CLLong -> IO CLLong instance QwriteData (QIODevice ()) ((String, Int)) where writeData x0 (x1, x2) = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_writeData_h cobj_x0 cstr_x1 (toCLLong x2) foreign import ccall "qtc_QIODevice_writeData_h" qtc_QIODevice_writeData_h :: Ptr (TQIODevice a) -> CWString -> CLLong -> IO CLLong instance QwriteData (QIODeviceSc a) ((String, Int)) where writeData x0 (x1, x2) = withLongLongResult $ withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_writeData_h cobj_x0 cstr_x1 (toCLLong x2) qIODevice_delete :: QIODevice a -> IO () qIODevice_delete x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_delete cobj_x0 foreign import ccall "qtc_QIODevice_delete" qtc_QIODevice_delete :: Ptr (TQIODevice a) -> IO () qIODevice_deleteLater :: QIODevice a -> IO () qIODevice_deleteLater x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_deleteLater cobj_x0 foreign import ccall "qtc_QIODevice_deleteLater" qtc_QIODevice_deleteLater :: Ptr (TQIODevice a) -> IO () instance QchildEvent (QIODevice ()) ((QChildEvent t1)) where childEvent x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QIODevice_childEvent cobj_x0 cobj_x1 foreign import ccall "qtc_QIODevice_childEvent" qtc_QIODevice_childEvent :: Ptr (TQIODevice a) -> Ptr (TQChildEvent t1) -> IO () instance QchildEvent (QIODeviceSc a) ((QChildEvent t1)) where childEvent x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QIODevice_childEvent cobj_x0 cobj_x1 instance QconnectNotify (QIODevice ()) ((String)) where connectNotify x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_connectNotify cobj_x0 cstr_x1 foreign import ccall "qtc_QIODevice_connectNotify" qtc_QIODevice_connectNotify :: Ptr (TQIODevice a) -> CWString -> IO () instance QconnectNotify (QIODeviceSc a) ((String)) where connectNotify x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_connectNotify cobj_x0 cstr_x1 instance QcustomEvent (QIODevice ()) ((QEvent t1)) where customEvent x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QIODevice_customEvent cobj_x0 cobj_x1 foreign import ccall "qtc_QIODevice_customEvent" qtc_QIODevice_customEvent :: Ptr (TQIODevice a) -> Ptr (TQEvent t1) -> IO () instance QcustomEvent (QIODeviceSc a) ((QEvent t1)) where customEvent x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QIODevice_customEvent cobj_x0 cobj_x1 instance QdisconnectNotify (QIODevice ()) ((String)) where disconnectNotify x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_disconnectNotify cobj_x0 cstr_x1 foreign import ccall "qtc_QIODevice_disconnectNotify" qtc_QIODevice_disconnectNotify :: Ptr (TQIODevice a) -> CWString -> IO () instance QdisconnectNotify (QIODeviceSc a) ((String)) where disconnectNotify x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_disconnectNotify cobj_x0 cstr_x1 instance Qevent (QIODevice ()) ((QEvent t1)) where event x0 (x1) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QIODevice_event_h cobj_x0 cobj_x1 foreign import ccall "qtc_QIODevice_event_h" qtc_QIODevice_event_h :: Ptr (TQIODevice a) -> Ptr (TQEvent t1) -> IO CBool instance Qevent (QIODeviceSc a) ((QEvent t1)) where event x0 (x1) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QIODevice_event_h cobj_x0 cobj_x1 instance QeventFilter (QIODevice ()) ((QObject t1, QEvent t2)) where eventFilter x0 (x1, x2) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> withObjectPtr x2 $ \cobj_x2 -> qtc_QIODevice_eventFilter_h cobj_x0 cobj_x1 cobj_x2 foreign import ccall "qtc_QIODevice_eventFilter_h" qtc_QIODevice_eventFilter_h :: Ptr (TQIODevice a) -> Ptr (TQObject t1) -> Ptr (TQEvent t2) -> IO CBool instance QeventFilter (QIODeviceSc a) ((QObject t1, QEvent t2)) where eventFilter x0 (x1, x2) = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> withObjectPtr x2 $ \cobj_x2 -> qtc_QIODevice_eventFilter_h cobj_x0 cobj_x1 cobj_x2 instance Qreceivers (QIODevice ()) ((String)) where receivers x0 (x1) = withIntResult $ withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_receivers cobj_x0 cstr_x1 foreign import ccall "qtc_QIODevice_receivers" qtc_QIODevice_receivers :: Ptr (TQIODevice a) -> CWString -> IO CInt instance Qreceivers (QIODeviceSc a) ((String)) where receivers x0 (x1) = withIntResult $ withObjectPtr x0 $ \cobj_x0 -> withCWString x1 $ \cstr_x1 -> qtc_QIODevice_receivers cobj_x0 cstr_x1 instance Qsender (QIODevice ()) (()) where sender x0 () = withQObjectResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_sender cobj_x0 foreign import ccall "qtc_QIODevice_sender" qtc_QIODevice_sender :: Ptr (TQIODevice a) -> IO (Ptr (TQObject ())) instance Qsender (QIODeviceSc a) (()) where sender x0 () = withQObjectResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QIODevice_sender cobj_x0 instance QtimerEvent (QIODevice ()) ((QTimerEvent t1)) where timerEvent x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QIODevice_timerEvent cobj_x0 cobj_x1 foreign import ccall "qtc_QIODevice_timerEvent" qtc_QIODevice_timerEvent :: Ptr (TQIODevice a) -> Ptr (TQTimerEvent t1) -> IO () instance QtimerEvent (QIODeviceSc a) ((QTimerEvent t1)) where timerEvent x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QIODevice_timerEvent cobj_x0 cobj_x1
{ "content_hash": "1df04d33a3c1f287f7d97614aeadfc57", "timestamp": "", "source": "github", "line_count": 549, "max_line_length": 165, "avg_line_length": 34.13296903460838, "alnum_prop": 0.6941138801430172, "repo_name": "keera-studios/hsQt", "id": "9242dbd509a0eb8e72b23e1537f882b1c28a155b", "size": "18739", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Qtc/Core/QIODevice.hs", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "4327" }, { "name": "C", "bytes": "2769338" }, { "name": "C++", "bytes": "12337641" }, { "name": "Haskell", "bytes": "18998024" }, { "name": "Perl", "bytes": "28076" }, { "name": "Prolog", "bytes": "527" }, { "name": "QMake", "bytes": "4574" }, { "name": "Shell", "bytes": "3752" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>pts: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.11.2 / pts - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> pts <small> 8.7.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-04-03 22:58:34 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-04-03 22:58:34 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.11.2 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.1 Official release 4.09.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/pts&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/PTS&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword: pure type systems&quot; &quot;keyword: metatheory&quot; &quot;category: Computer Science/Lambda Calculi&quot; &quot;date: 2007-03&quot; ] authors: [ &quot;Bruno Barras&quot; ] bug-reports: &quot;https://github.com/coq-contribs/pts/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/pts.git&quot; synopsis: &quot;A formalisation of Pure Type Systems&quot; description: &quot;&quot;&quot; This contrib is a formalization of Pure Type Systems. It includes most of the basic metatheoretical properties: weakening, substitution, subject-reduction, decidability of type-checking (for strongly normalizing PTSs). Strengtheningis not proven here. The kernel of a very simple proof checker is automatically generated from the proofs. A small interface allows interacting with this kernel, making up a standalone proof system. The Makefile has a special target &quot;html&quot; that produces html files from the sources and main.html that gives a short overview.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/pts/archive/v8.7.0.tar.gz&quot; checksum: &quot;md5=ca1af1e28c05f1cc931b3c371a3d1c5a&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-pts.8.7.0 coq.8.11.2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.11.2). The following dependencies couldn&#39;t be met: - coq-pts -&gt; coq &lt; 8.8~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-pts.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "2787c36c6ba39ca77b6c96482e84bb77", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 159, "avg_line_length": 40.91477272727273, "alnum_prop": 0.5549229273711984, "repo_name": "coq-bench/coq-bench.github.io", "id": "1ebef9e6e6c33b4651ee0bfe3537bc7fc02ea54e", "size": "7226", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.11.2/pts/8.7.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading.Tasks; using Microsoft.CodeAnalysis.Testing; using Test.Utilities; using Xunit; using VerifyCS = Test.Utilities.CSharpSecurityCodeFixVerifier< Microsoft.NetCore.Analyzers.Security.DoNotSetSwitch, Microsoft.CodeAnalysis.Testing.EmptyCodeFixProvider>; using VerifyVB = Test.Utilities.VisualBasicSecurityCodeFixVerifier< Microsoft.NetCore.Analyzers.Security.DoNotSetSwitch, Microsoft.CodeAnalysis.Testing.EmptyCodeFixProvider>; namespace Microsoft.NetCore.Analyzers.Security.UnitTests { public class DoNotDisableUsingServicePointManagerSecurityProtocolsTests { [Fact] public async Task DocSample1_CSharp_Violation() { await VerifyCS.VerifyAnalyzerAsync(@" using System; public class ExampleClass { public void ExampleMethod() { // CA5378 violation AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", true); } }", GetCSharpResultAt(9, 9, "SetSwitch")); } [Fact] public async Task DocSample1_VB_Violation() { await VerifyVB.VerifyAnalyzerAsync(@" Imports System Public Class ExampleClass Public Sub ExampleMethod() ' CA5378 violation AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", true) End Sub End Class", GetBasicResultAt(7, 9, "SetSwitch")); } [Fact] public async Task DocSample1_CSharp_Solution() { await VerifyCS.VerifyAnalyzerAsync(@" using System; public class ExampleClass { public void ExampleMethod() { AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", false); } }"); } [Fact] public async Task DocSample1_VB_Solution() { await VerifyVB.VerifyAnalyzerAsync(@" Imports System Public Class ExampleClass Public Sub ExampleMethod() AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", false) End Sub End Class"); } [Fact] public async Task TestBoolDiagnostic() { await VerifyCS.VerifyAnalyzerAsync(@" using System; class TestClass { public void TestMethod() { AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", true); } }", GetCSharpResultAt(8, 9, "SetSwitch")); } [Fact] public async Task TestEquationDiagnostic() { await VerifyCS.VerifyAnalyzerAsync(@" using System; class TestClass { public void TestMethod() { AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", 1 + 2 == 3); } }", GetCSharpResultAt(8, 9, "SetSwitch")); } [Fact] public async Task TestConditionalOperatorDiagnostic() { await VerifyCS.VerifyAnalyzerAsync(@" using System; class TestClass { public void TestMethod() { AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", 1 == 1 ? true : false); } }", GetCSharpResultAt(8, 9, "SetSwitch")); } [Fact] public async Task TestWithConstantSwitchNameDiagnostic() { await VerifyCS.VerifyAnalyzerAsync(@" using System; class TestClass { public void TestMethod() { const string constSwitchName = ""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols""; AppContext.SetSwitch(constSwitchName, true); } }", GetCSharpResultAt(9, 9, "SetSwitch")); } [Fact] public async Task TestBoolNoDiagnostic() { await VerifyCS.VerifyAnalyzerAsync(@" using System; class TestClass { public void TestMethod() { AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", false); } }"); } [Fact] public async Task TestEquationNoDiagnostic() { await VerifyCS.VerifyAnalyzerAsync(@" using System; class TestClass { public void TestMethod() { AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", 1 + 2 != 3); } }"); } [Fact] public async Task TestConditionalOperatorNoDiagnostic() { await VerifyCS.VerifyAnalyzerAsync(@" using System; class TestClass { public void TestMethod() { AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", 1 == 1 ? false : true); } }"); } [Fact] public async Task TestSwitchNameNullNoDiagnostic() { await VerifyCS.VerifyAnalyzerAsync(@" using System; class TestClass { public void TestMethod() { AppContext.SetSwitch(null, true); } }"); } [Fact] [Trait(Traits.DataflowAnalysis, Traits.Dataflow.ValueContentAnalysis)] public async Task TestSwitchNameVariableNoDiagnostic() { await VerifyCS.VerifyAnalyzerAsync(@" using System; class TestClass { public void TestMethod() { string switchName = ""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols""; AppContext.SetSwitch(switchName, true); } }", GetCSharpResultAt(9, 9, "SetSwitch")); } //Ideally, we would generate a diagnostic in this case. [Fact] public async Task TestBoolParseNoDiagnostic() { await VerifyCS.VerifyAnalyzerAsync(@" using System; class TestClass { public void TestMethod() { AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", bool.Parse(""true"")); } }"); } [Theory] [InlineData("")] [InlineData("dotnet_code_quality.excluded_symbol_names = ExampleMethod")] [InlineData("dotnet_code_quality.CA5378.excluded_symbol_names = ExampleMethod")] [InlineData("dotnet_code_quality.CA5378.excluded_symbol_names = ExampleMet*")] [InlineData("dotnet_code_quality.dataflow.excluded_symbol_names = ExampleMethod")] public async Task EditorConfigConfiguration_ExcludedSymbolNamesWithValueOption(string editorConfigText) { var test = new VerifyCS.Test { TestState = { Sources = { @" using System; public class ExampleClass { public void ExampleMethod() { // CA5378 violation AppContext.SetSwitch(""Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols"", true); } }" }, AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true [*] {editorConfigText} ") } }, }; if (editorConfigText.Length == 0) { test.ExpectedDiagnostics.Add(GetCSharpResultAt(9, 9, "SetSwitch")); } await test.RunAsync(); } private static DiagnosticResult GetCSharpResultAt(int line, int column, params string[] arguments) #pragma warning disable RS0030 // Do not used banned APIs => VerifyCS.Diagnostic(DoNotSetSwitch.DoNotDisableSpmSecurityProtocolsRule) .WithLocation(line, column) #pragma warning restore RS0030 // Do not used banned APIs .WithArguments(arguments); private static DiagnosticResult GetBasicResultAt(int line, int column, params string[] arguments) #pragma warning disable RS0030 // Do not used banned APIs => VerifyVB.Diagnostic(DoNotSetSwitch.DoNotDisableSpmSecurityProtocolsRule) .WithLocation(line, column) #pragma warning restore RS0030 // Do not used banned APIs .WithArguments(arguments); } }
{ "content_hash": "8479fe722dec5ac9e0335a4583559b92", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 161, "avg_line_length": 28.324232081911262, "alnum_prop": 0.6501988191348356, "repo_name": "mavasani/roslyn-analyzers", "id": "9280a3a8cee483cd50ed2ce31b0b17bdd5bb0457", "size": "8301", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Security/DoNotDisableUsingServicePointManagerSecurityProtocolsTests.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5365" }, { "name": "C#", "bytes": "13544666" }, { "name": "CMake", "bytes": "9446" }, { "name": "PowerShell", "bytes": "160438" }, { "name": "Rich Text Format", "bytes": "123141" }, { "name": "Shell", "bytes": "107224" }, { "name": "Smalltalk", "bytes": "705" }, { "name": "Vim Snippet", "bytes": "2225" }, { "name": "Visual Basic .NET", "bytes": "195294" } ], "symlink_target": "" }
package ro.cs.products.util; import java.awt.geom.Path2D; import java.awt.geom.PathIterator; import java.awt.geom.Rectangle2D; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Wrapper for Path2D instance, to be able to retrieve the number of points in the Path2D object. * * @author Cosmin Cara */ public class Polygon2D { private static final Pattern polyPattern = Pattern.compile("POLYGON\\(\\(.*\\)\\)"); private static final Pattern coordPattern = Pattern.compile("((?:-?(?:\\d+\\.\\d+)) (?:-?(?:\\d+\\.\\d+)))"); private Path2D.Double polygon; private int numPoints; /** * Creates a polygon from a well-known text. * For now, only single POLYGONs are supported. * If multiple polygons are encountered, only the first one is taken into account. * * @param wkt The text to parse. * @return A closed polygon. */ public static Polygon2D fromWKT(String wkt) { Polygon2D polygon = new Polygon2D(); Matcher matcher = polyPattern.matcher(wkt); if (matcher.matches()) { String polyText = matcher.toMatchResult().group(0); if (polyText != null) { Matcher coordMatcher = coordPattern.matcher(polyText); while (coordMatcher.find()) { //for (int i = 0; i < coordMatcher.groupCount(); i++) { String[] coords = coordMatcher.group().split(" "); polygon.append(Double.parseDouble(coords[0]), Double.parseDouble(coords[1])); //} } } } else { // maybe we have only a list of coordinates, without being wrapped in a POLYGON((..)) Matcher coordMatcher = coordPattern.matcher(wkt); while (coordMatcher.find()) { //for (int i = 0; i < coordMatcher.groupCount(); i++) { String[] coords = coordMatcher.group().split(" "); polygon.append(Double.parseDouble(coords[0]), Double.parseDouble(coords[1])); //} } } return polygon; } public Polygon2D() { } /** * Adds a point to the current polygon. * If this is not the first point, then it also adds a line between the previous point and the new one. * * @param x The x coordinate * @param y The y coordinate */ public void append(double x, double y) { if (polygon == null) { polygon = new Path2D.Double(); polygon.moveTo(x, y); } else { polygon.lineTo(x, y); } numPoints++; } /** * Adds a list of points to the current polygon. * The list items are pairs of coordinates. * * @param points The points to be added */ public void append(List<double[]> points) { if (points != null) { for (double[] pair : points) { if (pair != null && pair.length == 2) { append(pair[0], pair[1]); } } } } /** * Returns the number of points of the current polygon. * */ public int getNumPoints() { return numPoints; } /** * Produces a WKT representation of this polygon. */ public String toWKT() { StringBuilder buffer = new StringBuilder(); buffer.append("POLYGON(("); PathIterator pathIterator = polygon.getPathIterator(null); while (!pathIterator.isDone()) { double[] segment = new double[6]; pathIterator.currentSegment(segment); buffer.append(String.valueOf(segment[0])).append(" ").append(String.valueOf(segment[1])).append(","); pathIterator.next(); } buffer.setLength(buffer.length() - 1); buffer.append("))"); return buffer.toString(); } public Rectangle2D getBounds2D() { return polygon.getBounds2D(); } public String toWKTBounds() { Rectangle2D bounds2D = polygon.getBounds2D(); return "POLYGON((" + bounds2D.getMinX() + " " + bounds2D.getMinY() + "," + bounds2D.getMaxX() + " " + bounds2D.getMinY() + "," + bounds2D.getMaxX() + " " + bounds2D.getMaxY() + "," + bounds2D.getMinX() + " " + bounds2D.getMaxY() + "," + bounds2D.getMinX() + " " + bounds2D.getMinY() + "))"; } }
{ "content_hash": "011426bede265f72298952672f4f04ed", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 113, "avg_line_length": 33.58955223880597, "alnum_prop": 0.5463230393245946, "repo_name": "kraftek/awsdownload", "id": "31a0ff5dc0b6e83c4f2f0b608181a78255814689", "size": "5308", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/ro/cs/products/util/Polygon2D.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "98" }, { "name": "HTML", "bytes": "22270" }, { "name": "Java", "bytes": "335477" }, { "name": "Shell", "bytes": "120" }, { "name": "XSLT", "bytes": "10331" } ], "symlink_target": "" }
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace BrowserLog.TinyServer { public class MulticastChannel : IEventChannel { private readonly IList<IEventChannel> _channels = new List<IEventChannel>(); private readonly object _syncRoot = new object(); private readonly int _replayBufferSize; private readonly IList<ServerSentEvent> _replayBuffer; private HttpServer _httpServer; public MulticastChannel(int replayBufferSize = 1) { _replayBufferSize = replayBufferSize; _replayBuffer = new List<ServerSentEvent>(replayBufferSize); } public void AddChannel(IEventChannel channel, CancellationToken token) { lock (_syncRoot) { _channels.Add(channel); foreach (var message in _replayBuffer) { channel.Send(message, token); } } } public void Send(ServerSentEvent message, CancellationToken token) { lock (_syncRoot) { var closeChannels = new List<IEventChannel>(); foreach (var channel in _channels) { try { channel.Send(message, token); } catch (Exception) { closeChannels.Add(channel); } } foreach (var channel in closeChannels) { _channels.Remove(channel); } while (_replayBuffer.Count >= _replayBufferSize) { _replayBuffer.RemoveAt(0); } _replayBuffer.Add(message); } } public void AttachServer(HttpServer httpServer) { _httpServer = httpServer; } public void Dispose() { if (_httpServer != null) { _httpServer.Dispose(); } foreach (var channel in _channels) { channel.Dispose(); } } } }
{ "content_hash": "9fcb1f971985814be418b72534c8e3ff", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 84, "avg_line_length": 28.72289156626506, "alnum_prop": 0.49328859060402686, "repo_name": "alexvictoor/BrowserLog", "id": "f952323e50ce39567acb33cf0f7e6dd4cf09f149", "size": "2386", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "BrowserLog/TinyServer/MulticastChannel.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "29" }, { "name": "C#", "bytes": "73626" }, { "name": "HTML", "bytes": "6173" }, { "name": "JavaScript", "bytes": "2836" } ], "symlink_target": "" }
var profileViewContainerView = Ti.UI.createView({ layout:'vertical', top:(isIOS) ? '22dp':'0dp', }); var profileViewHeaderView = Ti.UI.createView({ backgroundColor:defaultGreenColor, width:Ti.UI.FILL, height:'50dp' }); var yourProfileTextLabel = Ti.UI.createLabel({ text:'Your Profile', color:'#fff', font:{ fontSize:20 } }); profileViewHeaderView.add(yourProfileTextLabel); /* var whiteContainer = Ti.UI.createView({ backgroundColor:'#fff', height:'220dp', width:'220dp', borderRadius:110, top:'45dp' }); var transparentContainer = Ti.UI.createView({ backgroundImage:path+'images/profileviewicons/profile-backdrop.png', height:'200dp', width:'200dp', borderRadius:100, zIndex:2, }); var percentContainer = Ti.UI.createView({ height:'35dp', width:'80dp', backgroundColor:'#fff', zIndex:3, borderRadius:17.5, top:245 }); var percentLabel = Ti.UI.createLabel({ color:defaultGreenColor, font:{ fontSize:14, }, text:'0%' }); percentContainer.add(percentLabel); var greenPercentView = Ti.UI.createView({ height:0, width:Ti.UI.FILL, backgroundColor:defaultGreenColor, bottom:0 }); var profileImageContainer = Ti.UI.createView({ backgroundImage:path+'images/profileviewicons/profile-backdrop.png', height:'350dp', width:Ti.UI.FILL }); var profileNameLabel = Ti.UI.createLabel({ top:'10dp', text:'CrazyHoe1982', font:{ fontSize:16 }, color:'#fff' }); var profilePictureView = Ti.UI.createImageView({ image:path+'images/selfie.jpg', width:'180dp', borderRadius:90 }); var completeYourProfileButton = Ti.UI.createButton({ height:'35dp', borderColor:'#fff', borderRadius:5, borderWidth:1, title:'Complete Your Profile', width:'150dp', textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER, font:{fontSize:10}, color:'#fff', backgroundColor:'transparent', bottom:'15dp' }); whiteContainer.add(transparentContainer); whiteContainer.add(greenPercentView); transparentContainer.add(profilePictureView); profileImageContainer.add(profileNameLabel); profileImageContainer.add(whiteContainer); profileImageContainer.add(percentContainer); profileImageContainer.add(completeYourProfileButton); */ profileViewContainerView.add(profileViewHeaderView); //profileViewContainerView.add(profileImageContainer); var profileControlsContainer = Ti.UI.createView({ backgroundGradient:{ type:'linear', colors:[ {color: '#0c3d38', offset: 0.01}, {color: '#186962', offset: 0.05}, {color: '#186962', offset: 1.0} ] }, height:'60dp', width:Ti.UI.FILL, layout:'horizontal' }); var eachProfileButtonWidth = platformWidth/4; //Details label var detailsLabelContainer = Ti.UI.createView({ width:String(eachProfileButtonWidth+unit) }); var detailsIcon = Ti.UI.createImageView({ image:path+'images/profileviewicons/details-white.png', width:'25dp', top:'10dp' }); var detailsLabel = Ti.UI.createLabel({ text:'Details', color:'#fff', font:{ fontSize:11 }, bottom:'5dp' }); detailsLabelContainer.add(detailsIcon); detailsLabelContainer.add(detailsLabel); //Looking for label var lookingForLabelContainer = Ti.UI.createView({ width:String(eachProfileButtonWidth+unit) }); var lookingForIcon = Ti.UI.createImageView({ image:path+'images/profileviewicons/lookingfor-white.png', width:'25dp', top:'10dp' }); var lookingForLabel = Ti.UI.createLabel({ text:'Looking For', color:'#fff', font:{ fontSize:11 }, bottom:'5dp' }); lookingForLabelContainer.add(lookingForIcon); lookingForLabelContainer.add(lookingForLabel); //Photos label var photosLabelContainer = Ti.UI.createView({ width:String(eachProfileButtonWidth+unit) }); var photosIcon = Ti.UI.createImageView({ image:path+'images/profileviewicons/photos-white.png', width:'25dp', top:'10dp' }); var photosLabel = Ti.UI.createLabel({ text:'Photos', color:'#fff', font:{ fontSize:11 }, bottom:'5dp' }); photosLabelContainer.add(photosIcon); photosLabelContainer.add(photosLabel); //Faves label var favesLabelContainer = Ti.UI.createView({ width:String(eachProfileButtonWidth+unit) }); var favesIcon = Ti.UI.createImageView({ image:path+'images/profileviewicons/faves-white.png', width:'25dp', top:'10dp' }); var favesLabel = Ti.UI.createLabel({ text:'Faves', color:'#fff', font:{ fontSize:11 }, bottom:'5dp' }); favesLabelContainer.add(favesIcon); favesLabelContainer.add(favesLabel); //add control buttons to view profileControlsContainer.add(detailsLabelContainer); profileControlsContainer.add(lookingForLabelContainer); profileControlsContainer.add(photosLabelContainer); profileControlsContainer.add(favesLabelContainer); //add control container to view profileViewContainerView.add(profileControlsContainer); //create fake animate thingy var profileFakeAnimateContainer = Ti.UI.createView({ height:'3dp', width:Ti.UI.FILL, backgroundColor:'#186962' }); var profileFakeBar = Ti.UI.createView({ height:'3dp', backgroundColor:'#45c5b9', width:String(eachProfileButtonWidth+unit), left:0 }); profileFakeAnimateContainer.add(profileFakeBar); //add fake animate thingy to main view profileViewContainerView.add(profileFakeAnimateContainer); //create click events detailsLabelContainer.addEventListener('click',function(){ //emailMessagesScrollableView.setCurrentPage(0); profileFakeBar.animate({ left:0, duration:100 }); }); lookingForLabelContainer.addEventListener('click',function(){ //emailMessagesScrollableView.setCurrentPage(1); profileFakeBar.animate({ left:String((eachProfileButtonWidth*1)+unit), duration:100 }); }); photosLabelContainer.addEventListener('click',function(){ //emailMessagesScrollableView.setCurrentPage(2); profileFakeBar.animate({ left:String((eachProfileButtonWidth*2)+unit), duration:100 }); }); favesLabelContainer.addEventListener('click',function(){ //emailMessagesScrollableView.setCurrentPage(3); profileFakeBar.animate({ left:String((eachProfileButtonWidth*3)+unit), duration:100 }); }); //require all messages moduleviews var details = require('lib/tabbedGroupViews/profile/details'); var lookingfor = require('lib/tabbedGroupViews/profile/lookingfor'); var photos = require('lib/tabbedGroupViews/profile/photos'); var faves = require('lib/tabbedGroupViews/profile/fave'); var all2 = require('lib/tabbedGroupViews/mail/all'); //create scrollableview var profileScrollableView = Ti.UI.createScrollableView({ top:'0dp', height:Ti.UI.SIZE, backgroundColor:'red', views:[ all2.getTableView(), //notifications.getView(), //photos.getView(), //faves.getView(), ], disableBounce:true, showPagingControl:false }); profileViewContainerView.add(profileScrollableView); exports.getView = function(){ return profileViewContainerView; };
{ "content_hash": "6fe5a4c99eb62902113876d0e175a86f", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 69, "avg_line_length": 21.488745980707396, "alnum_prop": 0.7535537932066437, "repo_name": "tweeklabs-isaac/test", "id": "fff03e2042a29b0e770bd18ecb321d2564e222ee", "size": "6683", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Resources/lib/tabbedGroupViews/Copy of profileView.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "152497" }, { "name": "C++", "bytes": "51991" }, { "name": "D", "bytes": "904081" }, { "name": "Java", "bytes": "532188" }, { "name": "JavaScript", "bytes": "122706" }, { "name": "Objective-C", "bytes": "3313795" }, { "name": "Objective-C++", "bytes": "18015" }, { "name": "Shell", "bytes": "1272" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "a0bcd27042add24b46279cb5d55748c4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "ac90734df457f175bc74d79b4a10d9f84b4e3589", "size": "176", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Oxalidales/Elaeocarpaceae/Elaeocarpus/Elaeocarpus curranii/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
// ---------------------------------------------------------------------------- // Copyright 2007-2015, GeoTelematic Solutions, Inc. // All rights reserved // ---------------------------------------------------------------------------- // // 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. // // ---------------------------------------------------------------------------- // Change History: // 2007/03/11 Martin D. Flynn // -Initial release // ---------------------------------------------------------------------------- package org.opengts.war.report; import java.io.*; public interface DBDataIterator { // ------------------------------------------------------------------------ /* return true if there is another available data record */ public boolean hasNext(); /* return the next data record */ public DBDataRow next(); // ------------------------------------------------------------------------ }
{ "content_hash": "4110dbceda6f6775d1708535e07e20d9", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 79, "avg_line_length": 36.1, "alnum_prop": 0.48130193905817176, "repo_name": "shafqatali404/OpenGTS_2.6.0", "id": "bbf0ab8c42c280bdba7cbef423d999a3499c12e5", "size": "1444", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/org/opengts/war/report/DBDataIterator.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "17573" }, { "name": "CSS", "bytes": "125062" }, { "name": "Java", "bytes": "11912232" }, { "name": "JavaScript", "bytes": "1642398" }, { "name": "Perl", "bytes": "65030" }, { "name": "Shell", "bytes": "69213" } ], "symlink_target": "" }
/** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. 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. */ #ifndef _CORNERSTONE_HXX_ #define _CORNERSTONE_HXX_ #include <cstdio> #include <cstdlib> //#include <cinttypes> #include <cstring> #include <memory> #include <vector> #include <list> #include <string> #include <functional> #include <mutex> #include <condition_variable> #include <exception> #include <atomic> #include <algorithm> #include <unordered_map> #include <random> #include <chrono> #include <thread> #include <fstream> #ifdef max #undef max #endif #ifdef min #undef min #endif #include "cornerstone/cs_pp_util.h" #include "cornerstone/cs_strfmt.h" #include "cornerstone/cs_types.h" #include "cornerstone/cs_ptr.h" #include "cornerstone/cs_raft_params.h" #include "cornerstone/cs_msg_type.h" #include "cornerstone/cs_buffer.h" #include "cornerstone/cs_log_value_type.h" #include "cornerstone/cs_log_entry.h" #include "cornerstone/cs_msg_base.h" #include "cornerstone/cs_req_msg.h" #include "cornerstone/cs_resp_msg.h" #include "cornerstone/cs_rpc_exception.h" #include "cornerstone/cs_async_result.h" #include "cornerstone/cs_log.h" #include "cornerstone/cs_srv_config.h" #include "cornerstone/cs_cluster_config.h" #include "cornerstone/cs_srv_state.h" #include "cornerstone/cs_srv_role.h" #include "cornerstone/cs_log_store.h" #include "cornerstone/cs_state_mgr.h" #include "cornerstone/cs_rpc_listener.h" #include "cornerstone/cs_snapshot.h" #include "cornerstone/cs_state_machine.h" #include "cornerstone/cs_rpc_cli.h" #include "cornerstone/cs_rpc_cli_factory.h" #include "cornerstone/cs_delayed_task.h" #include "cornerstone/cs_timer_task.h" #include "cornerstone/cs_task_scheduler.h" #include "cornerstone/cs_context.h" #include "cornerstone/cs_snapshot_sync_ctx.h" #include "cornerstone/cs_snapshot_sync_req.h" #include "cornerstone/cs_peer.h" #include "cornerstone/cs_raft_server.h" #include "cornerstone/cs_fs_log_store.h" #endif // _CORNERSTONE_HXX_
{ "content_hash": "143a6fd305aa7a43844cace7006e00f5", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 74, "avg_line_length": 30.070588235294117, "alnum_prop": 0.7574334898278561, "repo_name": "BigJoe01/cornerstone_raknet", "id": "e994d14c1051406c0d309f7e4820cd2cd1dc346f", "size": "2556", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cornerstone.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "911" }, { "name": "C++", "bytes": "228449" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="ApiGen 2.8.0" /> <title>Tree | Apache log4php</title> <script type="text/javascript" src="resources/combined.js?238209907"></script> <script type="text/javascript" src="elementlist.js?4055067042"></script> <link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" /> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', "UA-26177991-1"]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body> <div id="left"> <div id="menu"> <a href="index.html" title="Overview"><span>Overview</span></a> <div id="groups"> <h3>Packages</h3> <ul> <li><a href="package-log4php.html">log4php<span></span></a> <ul> <li><a href="package-log4php.appenders.html">appenders</a> </li> <li><a href="package-log4php.configurators.html">configurators</a> </li> <li><a href="package-log4php.filters.html">filters</a> </li> <li><a href="package-log4php.helpers.html">helpers</a> </li> <li><a href="package-log4php.layouts.html">layouts</a> </li> <li><a href="package-log4php.pattern.html">pattern</a> </li> <li><a href="package-log4php.renderers.html">renderers</a> </li> </ul></li> </ul> </div> <hr /> <div id="elements"> <h3>Classes</h3> <ul> <li><a href="class-Logger.html">Logger</a></li> <li><a href="class-LoggerAppender.html">LoggerAppender</a></li> <li><a href="class-LoggerAppenderConsole.html">LoggerAppenderConsole</a></li> <li><a href="class-LoggerAppenderDailyFile.html">LoggerAppenderDailyFile</a></li> <li><a href="class-LoggerAppenderEcho.html">LoggerAppenderEcho</a></li> <li><a href="class-LoggerAppenderFile.html">LoggerAppenderFile</a></li> <li><a href="class-LoggerAppenderFirePHP.html">LoggerAppenderFirePHP</a></li> <li><a href="class-LoggerAppenderMail.html">LoggerAppenderMail</a></li> <li><a href="class-LoggerAppenderMailEvent.html">LoggerAppenderMailEvent</a></li> <li><a href="class-LoggerAppenderMongoDB.html">LoggerAppenderMongoDB</a></li> <li><a href="class-LoggerAppenderNull.html">LoggerAppenderNull</a></li> <li><a href="class-LoggerAppenderPDO.html">LoggerAppenderPDO</a></li> <li><a href="class-LoggerAppenderPhp.html">LoggerAppenderPhp</a></li> <li><a href="class-LoggerAppenderPool.html">LoggerAppenderPool</a></li> <li><a href="class-LoggerAppenderRollingFile.html">LoggerAppenderRollingFile</a></li> <li><a href="class-LoggerAppenderSocket.html">LoggerAppenderSocket</a></li> <li><a href="class-LoggerAppenderSyslog.html">LoggerAppenderSyslog</a></li> <li><a href="class-LoggerAutoloader.html">LoggerAutoloader</a></li> <li><a href="class-LoggerConfigurable.html">LoggerConfigurable</a></li> <li><a href="class-LoggerConfigurationAdapterINI.html">LoggerConfigurationAdapterINI</a></li> <li><a href="class-LoggerConfigurationAdapterPHP.html">LoggerConfigurationAdapterPHP</a></li> <li><a href="class-LoggerConfigurationAdapterXML.html">LoggerConfigurationAdapterXML</a></li> <li><a href="class-LoggerConfiguratorDefault.html">LoggerConfiguratorDefault</a></li> <li><a href="class-LoggerFilter.html">LoggerFilter</a></li> <li><a href="class-LoggerFilterDenyAll.html">LoggerFilterDenyAll</a></li> <li><a href="class-LoggerFilterLevelMatch.html">LoggerFilterLevelMatch</a></li> <li><a href="class-LoggerFilterLevelRange.html">LoggerFilterLevelRange</a></li> <li><a href="class-LoggerFilterStringMatch.html">LoggerFilterStringMatch</a></li> <li><a href="class-LoggerFormattingInfo.html">LoggerFormattingInfo</a></li> <li><a href="class-LoggerHierarchy.html">LoggerHierarchy</a></li> <li><a href="class-LoggerLayout.html">LoggerLayout</a></li> <li><a href="class-LoggerLayoutHtml.html">LoggerLayoutHtml</a></li> <li><a href="class-LoggerLayoutPattern.html">LoggerLayoutPattern</a></li> <li><a href="class-LoggerLayoutSerialized.html">LoggerLayoutSerialized</a></li> <li><a href="class-LoggerLayoutSimple.html">LoggerLayoutSimple</a></li> <li><a href="class-LoggerLayoutXml.html">LoggerLayoutXml</a></li> <li><a href="class-LoggerLevel.html">LoggerLevel</a></li> <li><a href="class-LoggerLocationInfo.html">LoggerLocationInfo</a></li> <li><a href="class-LoggerLoggingEvent.html">LoggerLoggingEvent</a></li> <li><a href="class-LoggerMDC.html">LoggerMDC</a></li> <li><a href="class-LoggerNDC.html">LoggerNDC</a></li> <li><a href="class-LoggerOptionConverter.html">LoggerOptionConverter</a></li> <li><a href="class-LoggerPatternConverter.html">LoggerPatternConverter</a></li> <li><a href="class-LoggerPatternConverterClass.html">LoggerPatternConverterClass</a></li> <li><a href="class-LoggerPatternConverterCookie.html">LoggerPatternConverterCookie</a></li> <li><a href="class-LoggerPatternConverterDate.html">LoggerPatternConverterDate</a></li> <li><a href="class-LoggerPatternConverterEnvironment.html">LoggerPatternConverterEnvironment</a></li> <li><a href="class-LoggerPatternConverterFile.html">LoggerPatternConverterFile</a></li> <li><a href="class-LoggerPatternConverterLevel.html">LoggerPatternConverterLevel</a></li> <li><a href="class-LoggerPatternConverterLine.html">LoggerPatternConverterLine</a></li> <li><a href="class-LoggerPatternConverterLiteral.html">LoggerPatternConverterLiteral</a></li> <li><a href="class-LoggerPatternConverterLocation.html">LoggerPatternConverterLocation</a></li> <li><a href="class-LoggerPatternConverterLogger.html">LoggerPatternConverterLogger</a></li> <li><a href="class-LoggerPatternConverterMDC.html">LoggerPatternConverterMDC</a></li> <li><a href="class-LoggerPatternConverterMessage.html">LoggerPatternConverterMessage</a></li> <li><a href="class-LoggerPatternConverterMethod.html">LoggerPatternConverterMethod</a></li> <li><a href="class-LoggerPatternConverterNDC.html">LoggerPatternConverterNDC</a></li> <li><a href="class-LoggerPatternConverterNewLine.html">LoggerPatternConverterNewLine</a></li> <li><a href="class-LoggerPatternConverterProcess.html">LoggerPatternConverterProcess</a></li> <li><a href="class-LoggerPatternConverterRelative.html">LoggerPatternConverterRelative</a></li> <li><a href="class-LoggerPatternConverterRequest.html">LoggerPatternConverterRequest</a></li> <li><a href="class-LoggerPatternConverterServer.html">LoggerPatternConverterServer</a></li> <li><a href="class-LoggerPatternConverterSession.html">LoggerPatternConverterSession</a></li> <li><a href="class-LoggerPatternConverterSessionID.html">LoggerPatternConverterSessionID</a></li> <li><a href="class-LoggerPatternConverterSuperglobal.html">LoggerPatternConverterSuperglobal</a></li> <li><a href="class-LoggerPatternConverterThrowable.html">LoggerPatternConverterThrowable</a></li> <li><a href="class-LoggerPatternParser.html">LoggerPatternParser</a></li> <li><a href="class-LoggerReflectionUtils.html">LoggerReflectionUtils</a></li> <li><a href="class-LoggerRendererDefault.html">LoggerRendererDefault</a></li> <li><a href="class-LoggerRendererException.html">LoggerRendererException</a></li> <li><a href="class-LoggerRendererMap.html">LoggerRendererMap</a></li> <li><a href="class-LoggerRoot.html">LoggerRoot</a></li> <li><a href="class-LoggerThrowableInformation.html">LoggerThrowableInformation</a></li> <li><a href="class-LoggerUtils.html">LoggerUtils</a></li> </ul> <h3>Interfaces</h3> <ul> <li><a href="class-LoggerConfigurationAdapter.html">LoggerConfigurationAdapter</a></li> <li><a href="class-LoggerConfigurator.html">LoggerConfigurator</a></li> <li><a href="class-LoggerRenderer.html">LoggerRenderer</a></li> </ul> <h3>Exceptions</h3> <ul> <li><a href="class-LoggerException.html">LoggerException</a></li> </ul> </div> </div> </div> <div id="splitter"></div> <div id="right"> <div id="rightInner"> <form id="search"> <input type="hidden" name="cx" value="" /> <input type="hidden" name="ie" value="UTF-8" /> <input type="text" name="q" class="text" /> <input type="submit" value="Search" /> </form> <div id="navigation"> <ul> <li> <a href="index.html" title="Overview"><span>Overview</span></a> </li> <li> <span>Package</span> </li> <li> <span>Class</span> </li> </ul> <ul> <li class="active"> <span>Tree</span> </li> </ul> <ul> </ul> </div> <div id="content"> <h1>Tree</h1> <h3>Classes</h3> <div class="tree"> <ul> <li><div class="notlast"><a href="class-Logger.html"><span>Logger</span></a> </div> <ul> <li class="last"><div class="last"><a href="class-LoggerRoot.html"><span>LoggerRoot</span></a> </div> </ul></li> <li><div class="notlast"><a href="class-LoggerAppenderPool.html"><span>LoggerAppenderPool</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerAutoloader.html"><span>LoggerAutoloader</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerConfigurable.html"><span>LoggerConfigurable</span></a> </div> <ul> <li><div class="notlast"><a href="class-LoggerAppender.html"><span>LoggerAppender</span></a> </div> <ul> <li><div class="notlast"><a href="class-LoggerAppenderConsole.html"><span>LoggerAppenderConsole</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerAppenderEcho.html"><span>LoggerAppenderEcho</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerAppenderFile.html"><span>LoggerAppenderFile</span></a> </div> <ul> <li><div class="notlast"><a href="class-LoggerAppenderDailyFile.html"><span>LoggerAppenderDailyFile</span></a> </div> </li> <li class="last"><div class="last"><a href="class-LoggerAppenderRollingFile.html"><span>LoggerAppenderRollingFile</span></a> </div> </ul></li> <li><div class="notlast"><a href="class-LoggerAppenderFirePHP.html"><span>LoggerAppenderFirePHP</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerAppenderMail.html"><span>LoggerAppenderMail</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerAppenderMailEvent.html"><span>LoggerAppenderMailEvent</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerAppenderMongoDB.html"><span>LoggerAppenderMongoDB</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerAppenderNull.html"><span>LoggerAppenderNull</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerAppenderPDO.html"><span>LoggerAppenderPDO</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerAppenderPhp.html"><span>LoggerAppenderPhp</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerAppenderSocket.html"><span>LoggerAppenderSocket</span></a> </div> </li> <li class="last"><div class="last"><a href="class-LoggerAppenderSyslog.html"><span>LoggerAppenderSyslog</span></a> </div> </ul></li> <li><div class="notlast"><a href="class-LoggerFilter.html"><span>LoggerFilter</span></a> </div> <ul> <li><div class="notlast"><a href="class-LoggerFilterDenyAll.html"><span>LoggerFilterDenyAll</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerFilterLevelMatch.html"><span>LoggerFilterLevelMatch</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerFilterLevelRange.html"><span>LoggerFilterLevelRange</span></a> </div> </li> <li class="last"><div class="last"><a href="class-LoggerFilterStringMatch.html"><span>LoggerFilterStringMatch</span></a> </div> </ul></li> <li class="last"><div class="last"><a href="class-LoggerLayout.html"><span>LoggerLayout</span></a> </div> <ul> <li><div class="notlast"><a href="class-LoggerLayoutHtml.html"><span>LoggerLayoutHtml</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerLayoutPattern.html"><span>LoggerLayoutPattern</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerLayoutSerialized.html"><span>LoggerLayoutSerialized</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerLayoutSimple.html"><span>LoggerLayoutSimple</span></a> </div> </li> <li class="last"><div class="last"><a href="class-LoggerLayoutXml.html"><span>LoggerLayoutXml</span></a> </div> </ul></li></ul></li> <li><div class="notlast"><a href="class-LoggerConfigurationAdapterINI.html"><span>LoggerConfigurationAdapterINI</span></a> implements <a href="class-LoggerConfigurationAdapter.html"><span>LoggerConfigurationAdapter</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerConfigurationAdapterPHP.html"><span>LoggerConfigurationAdapterPHP</span></a> implements <a href="class-LoggerConfigurationAdapter.html"><span>LoggerConfigurationAdapter</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerConfigurationAdapterXML.html"><span>LoggerConfigurationAdapterXML</span></a> implements <a href="class-LoggerConfigurationAdapter.html"><span>LoggerConfigurationAdapter</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerConfiguratorDefault.html"><span>LoggerConfiguratorDefault</span></a> implements <a href="class-LoggerConfigurator.html"><span>LoggerConfigurator</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerFormattingInfo.html"><span>LoggerFormattingInfo</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerHierarchy.html"><span>LoggerHierarchy</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerLevel.html"><span>LoggerLevel</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerLocationInfo.html"><span>LoggerLocationInfo</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerLoggingEvent.html"><span>LoggerLoggingEvent</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerMDC.html"><span>LoggerMDC</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerNDC.html"><span>LoggerNDC</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerOptionConverter.html"><span>LoggerOptionConverter</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverter.html"><span>LoggerPatternConverter</span></a> </div> <ul> <li><div class="notlast"><a href="class-LoggerPatternConverterClass.html"><span>LoggerPatternConverterClass</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterDate.html"><span>LoggerPatternConverterDate</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterFile.html"><span>LoggerPatternConverterFile</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterLevel.html"><span>LoggerPatternConverterLevel</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterLine.html"><span>LoggerPatternConverterLine</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterLiteral.html"><span>LoggerPatternConverterLiteral</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterLocation.html"><span>LoggerPatternConverterLocation</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterLogger.html"><span>LoggerPatternConverterLogger</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterMDC.html"><span>LoggerPatternConverterMDC</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterMessage.html"><span>LoggerPatternConverterMessage</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterMethod.html"><span>LoggerPatternConverterMethod</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterNDC.html"><span>LoggerPatternConverterNDC</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterNewLine.html"><span>LoggerPatternConverterNewLine</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterProcess.html"><span>LoggerPatternConverterProcess</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterRelative.html"><span>LoggerPatternConverterRelative</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterSessionID.html"><span>LoggerPatternConverterSessionID</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterSuperglobal.html"><span>LoggerPatternConverterSuperglobal</span></a> </div> <ul> <li><div class="notlast"><a href="class-LoggerPatternConverterCookie.html"><span>LoggerPatternConverterCookie</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterEnvironment.html"><span>LoggerPatternConverterEnvironment</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterRequest.html"><span>LoggerPatternConverterRequest</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerPatternConverterServer.html"><span>LoggerPatternConverterServer</span></a> </div> </li> <li class="last"><div class="last"><a href="class-LoggerPatternConverterSession.html"><span>LoggerPatternConverterSession</span></a> </div> </ul></li> <li class="last"><div class="last"><a href="class-LoggerPatternConverterThrowable.html"><span>LoggerPatternConverterThrowable</span></a> </div> </ul></li> <li><div class="notlast"><a href="class-LoggerPatternParser.html"><span>LoggerPatternParser</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerReflectionUtils.html"><span>LoggerReflectionUtils</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerRendererDefault.html"><span>LoggerRendererDefault</span></a> implements <a href="class-LoggerRenderer.html"><span>LoggerRenderer</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerRendererException.html"><span>LoggerRendererException</span></a> implements <a href="class-LoggerRenderer.html"><span>LoggerRenderer</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerRendererMap.html"><span>LoggerRendererMap</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerThrowableInformation.html"><span>LoggerThrowableInformation</span></a> </div> </li> <li class="last"><div class="last"><a href="class-LoggerUtils.html"><span>LoggerUtils</span></a> </div> </li> </ul> </div> <h3>Interfaces</h3> <div class="tree"> <ul> <li><div class="notlast"><a href="class-LoggerConfigurationAdapter.html"><span>LoggerConfigurationAdapter</span></a> </div> </li> <li><div class="notlast"><a href="class-LoggerConfigurator.html"><span>LoggerConfigurator</span></a> </div> </li> <li class="last"><div class="last"><a href="class-LoggerRenderer.html"><span>LoggerRenderer</span></a> </div> </li> </ul> </div> <h3>Exceptions</h3> <div class="tree"> <ul> <li class="last"><div class="last"><span>Exception</span> </div> <ul> <li class="last"><div class="last"><a href="class-LoggerException.html"><span>LoggerException</span></a> </div> </li> </ul></li> </ul> </div> </div> <div id="footer"> Apache log4php API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a> </div> </div> </div> </body> </html>
{ "content_hash": "00450864d674c1b0806f3344811402bf", "timestamp": "", "source": "github", "line_count": 780, "max_line_length": 139, "avg_line_length": 27.153846153846153, "alnum_prop": 0.6596789423984891, "repo_name": "nightmarehelen/typhon", "id": "fd276eb6cba40a696b4a115eca6c3a87831b4bb0", "size": "21180", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "application/helpers/apache-log4php-2.3.0/apidocs/tree.html", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "240" }, { "name": "CSS", "bytes": "40197" }, { "name": "HTML", "bytes": "16335187" }, { "name": "JavaScript", "bytes": "431691" }, { "name": "PHP", "bytes": "2309226" }, { "name": "XSLT", "bytes": "1549" } ], "symlink_target": "" }
<?php /* * This file is part of the Sami utility. * * (c) Fabien Potencier <[email protected]> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace Sami; use Pimple\Container; use Sami\Parser\ClassTraverser; use Sami\Parser\ClassVisitor; use Sami\Parser\CodeParser; use Sami\Parser\DocBlockParser; use Sami\Parser\Filter\DefaultFilter; use Sami\Parser\NodeVisitor; use Sami\Parser\Parser; use Sami\Parser\ParserContext; use Sami\Renderer\Renderer; use Sami\Renderer\ThemeSet; use Sami\Renderer\TwigExtension; use Sami\Store\JsonStore; use Sami\Version\SingleVersionCollection; use Sami\Version\Version; class Sami extends Container { const VERSION = '2.0.0'; public function __construct( $iterator = null, array $config = array() ) { $sc = $this; if (null !== $iterator) { $this['files'] = $iterator; } $this['_versions'] = function () use ( $sc ) { $versions = isset( $sc['versions'] ) ? $sc['versions'] : $sc['version']; if (is_string( $versions )) { $versions = new Version( $versions ); } if ($versions instanceof Version) { $versions = new SingleVersionCollection( $versions ); } return $versions; }; $this['project'] = function () use ( $sc ) { $project = new Project( $sc['store'], $sc['_versions'], array( 'build_dir' => $sc['build_dir'], 'cache_dir' => $sc['cache_dir'], 'simulate_namespaces' => $sc['simulate_namespaces'], 'include_parent_data' => $sc['include_parent_data'], 'default_opened_level' => $sc['default_opened_level'], 'theme' => $sc['theme'], 'title' => $sc['title'], ) ); $project->setRenderer( $sc['renderer'] ); $project->setParser( $sc['parser'] ); return $project; }; $this['parser'] = function () use ( $sc ) { return new Parser( $sc['files'], $sc['store'], $sc['code_parser'], $sc['traverser'] ); }; $this['indexer'] = function () use ( $sc ) { return new Indexer(); }; $this['tree'] = function () use ( $sc ) { return new Tree(); }; $this['parser_context'] = function () use ( $sc ) { return new ParserContext( $sc['filter'], $sc['docblock_parser'], $sc['pretty_printer'] ); }; $this['docblock_parser'] = function () use ( $sc ) { return new DocBlockParser(); }; $this['php_parser'] = function () { return new \PHPParser_Parser( new \PHPParser_Lexer() ); }; $this['php_traverser'] = function () use ( $sc ) { $traverser = new \PHPParser_NodeTraverser(); $traverser->addVisitor( new \PHPParser_NodeVisitor_NameResolver() ); $traverser->addVisitor( new NodeVisitor( $sc['parser_context'] ) ); return $traverser; }; $this['code_parser'] = function () use ( $sc ) { return new CodeParser( $sc['parser_context'], $sc['php_parser'], $sc['php_traverser'] ); }; $this['pretty_printer'] = function () use ( $sc ) { return new \PHPParser_PrettyPrinter_Zend(); }; $this['filter'] = function () use ( $sc ) { return new DefaultFilter(); }; $this['store'] = function () use ( $sc ) { return new JsonStore(); }; $this['renderer'] = function () use ( $sc ) { return new Renderer( $sc['twig'], $sc['themes'], $sc['tree'], $sc['indexer'] ); }; $this['traverser'] = function () use ( $sc ) { $visitors = array( new ClassVisitor\InheritdocClassVisitor(), new ClassVisitor\MethodClassVisitor(), new ClassVisitor\PropertyClassVisitor(), ); return new ClassTraverser( $visitors ); }; $this['themes'] = function () use ( $sc ) { $templates = $sc['template_dirs']; $templates[] = __DIR__.'/Resources/themes'; return new ThemeSet( $templates ); }; $this['twig'] = function () use ( $sc ) { $twig = new \Twig_Environment( new \Twig_Loader_Filesystem( array( '/' ) ), array( 'strict_variables' => true, 'debug' => true, 'auto_reload' => true, 'cache' => false, ) ); $twig->addExtension( new TwigExtension() ); return $twig; }; $this['theme'] = 'enhanced'; $this['title'] = 'API'; $this['version'] = 'master'; $this['template_dirs'] = array(); $this['build_dir'] = getcwd().'/build'; $this['cache_dir'] = getcwd().'/cache'; // simulate namespaces for projects based on the PEAR naming conventions $this['simulate_namespaces'] = false; // include parent properties and methods on class pages $this['include_parent_data'] = true; foreach ($config as $key => $value) { $this[$key] = $value; } } }
{ "content_hash": "70a7d0ce34e33de107632788406b130a", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 101, "avg_line_length": 28.74074074074074, "alnum_prop": 0.5064432989690721, "repo_name": "TheTypoMaster/SPHERE-Framework", "id": "f1cfb63b067312fb1ec102141f16604039dcd097", "size": "5432", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Library/MOC-V/Core/SecureKernel/Vendor/PhpSecLib/0.3.9/vendor/sami/sami/Sami/Sami.php", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "ApacheConf", "bytes": "2630" }, { "name": "Batchfile", "bytes": "7341" }, { "name": "CSS", "bytes": "1047983" }, { "name": "HTML", "bytes": "6258719" }, { "name": "JavaScript", "bytes": "15888113" }, { "name": "Makefile", "bytes": "6774" }, { "name": "PHP", "bytes": "9320934" }, { "name": "PowerShell", "bytes": "149" }, { "name": "Python", "bytes": "22027" }, { "name": "Ruby", "bytes": "2399" }, { "name": "Shell", "bytes": "6738" }, { "name": "Smarty", "bytes": "65319" } ], "symlink_target": "" }
<?php /************************************************************************* Allow Editors to edit the navigation menus *************************************************************************/ $role_object = get_role( 'editor' ); $role_object->add_cap( 'edit_theme_options' );
{ "content_hash": "edf449f4a7ca8ace65f0956c6e8b7f60", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 74, "avg_line_length": 47.5, "alnum_prop": 0.3298245614035088, "repo_name": "DigitalWorkboots/WordPress-Snippets", "id": "34d1e89b31adf730ab0271e7cca103186155d7da", "size": "285", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Roles & Capabilities.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "8053" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ContentModelStore"> <e p="$APPLICATION_CONFIG_DIR$/consoles/db" t="IncludeRecursive" /> <e p="$APPLICATION_CONFIG_DIR$/extensions" t="IncludeRecursive" /> <e p="$USER_HOME$/.Rider2019.2/system/extResources" t="IncludeRecursive" /> <e p="$USER_HOME$/.Rider2019.2/system/resharper-host/local/Transient/ReSharperHost/v192/SolutionCaches/_.19.00" t="ExcludeRecursive" /> <e p="$USER_HOME$/.nuget/packages/xunit.runner.visualstudio/2.4.1/build/netcoreapp1.0/xunit.runner.reporters.netcoreapp10.dll" t="Include" /> <e p="$USER_HOME$/.nuget/packages/xunit.runner.visualstudio/2.4.1/build/netcoreapp1.0/xunit.runner.utility.netcoreapp10.dll" t="Include" /> <e p="$USER_HOME$/.nuget/packages/xunit.runner.visualstudio/2.4.1/build/netcoreapp1.0/xunit.runner.visualstudio.dotnetcore.testadapter.dll" t="Include" /> <e p="$PROJECT_DIR$" t="IncludeRecursive"> <e p="Anagram.fs" t="Include" /> <e p="Anagram.fsproj" t="IncludeRecursive" /> <e p="AnagramTest.fs" t="Include" /> <e p="bin" t="ExcludeRecursive" /> <e p="obj" t="ExcludeRecursive" /> <e p="packages" t="ExcludeRecursive" /> </e> </component> </project>
{ "content_hash": "f42cd28b414e0007d31dc06876b84684", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 158, "avg_line_length": 62.75, "alnum_prop": 0.6812749003984063, "repo_name": "draptik/exersim", "id": "5c047a9786b3f73fc3cddc516081d912e99430c9", "size": "1255", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fsharp/anagram/.idea/.idea.Anagram.dir/.idea/contentModel.xml", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "17756" }, { "name": "F#", "bytes": "25450" } ], "symlink_target": "" }
class Foo def bar1 p "bar1" end def bar2 p "bar2" end end # Goto Line number # ================== # # 1. `Ctrl + G` gives you a goto line number palette # 2. Type the number `23` and press `Return` to reach this line # 3. Now change the quoted word to `bar_1` # 4. Type the number `27` and press `Return` to reach this line # 5. Now change the quoted word to `bar_2` # 6. When you are done with all the changes, press `Cmd + Z` multiple # times to get back to the original state. We plan to use them again # later in this tutorial. # Move to next chapter # --------------------- # # 1. Press `Cmd + P` to get the Goto Anything palette # 2. Type `c2.md` and press `Return` to reach the second chapter # in the series of this tutorial # Shortcuts under your belt # ------------------------- # 1. Goto Anywhere - `Cmd + T` # 2. Goto Anything - `Cmd + P` # 3. Goto Symbol - `Cmd + R` # 4. Goto Line number - `Ctrl + G`
{ "content_hash": "43975acaf7038bda3903f8eea828767d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 71, "avg_line_length": 26.25, "alnum_prop": 0.6084656084656085, "repo_name": "jaipandya/SublimeTutor", "id": "4b30537e84d9719360aedef91a2ee7ca658c11f3", "size": "1757", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tutorial/code/chapter_1.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "1108" }, { "name": "Ruby", "bytes": "1585" } ], "symlink_target": "" }
package com.sop4j.base.apache.io.filefilter; import java.io.File; import java.io.Serializable; /** * This filter accepts <code>File</code>s that can be written to. * <p> * Example, showing how to print out a list of the * current directory's <i>writable</i> files: * * <pre> * File dir = new File("."); * String[] files = dir.list( CanWriteFileFilter.CAN_WRITE ); * for ( int i = 0; i &lt; files.length; i++ ) { * System.out.println(files[i]); * } * </pre> * * <p> * Example, showing how to print out a list of the * current directory's <i>un-writable</i> files: * * <pre> * File dir = new File("."); * String[] files = dir.list( CanWriteFileFilter.CANNOT_WRITE ); * for ( int i = 0; i &lt; files.length; i++ ) { * System.out.println(files[i]); * } * </pre> * * <p> * <b>N.B.</b> For read-only files, use * <code>CanReadFileFilter.READ_ONLY</code>. * * @since 1.3 * @version $Id: CanWriteFileFilter.java 1307462 2012-03-30 15:13:11Z ggregory $ */ public class CanWriteFileFilter extends AbstractFileFilter implements Serializable { /** Singleton instance of <i>writable</i> filter */ public static final IOFileFilter CAN_WRITE = new CanWriteFileFilter(); /** Singleton instance of not <i>writable</i> filter */ public static final IOFileFilter CANNOT_WRITE = new NotFileFilter(CAN_WRITE); /** * Restrictive consructor. */ protected CanWriteFileFilter() { } /** * Checks to see if the file can be written to. * * @param file the File to check * @return {@code true} if the file can be * written to, otherwise {@code false}. */ @Override public boolean accept(File file) { return file.canWrite(); } }
{ "content_hash": "530f307d90c9894115837058d37e865f", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 84, "avg_line_length": 26.636363636363637, "alnum_prop": 0.624004550625711, "repo_name": "wspeirs/sop4j-base", "id": "509b33be1e77cc35289a4541370c68a270105788", "size": "2562", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/sop4j/base/apache/io/filefilter/CanWriteFileFilter.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "10731267" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "a6e42460aee26e2135cd46fcfed13026", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "d1bef8bf2bf9afd564307b8fada88933517bb0af", "size": "192", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Apiaceae/Levisticum/Levisticum officinale/ Syn. Levisticum levisticum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
""" Mathematical tools for dit. """ # Global random number generator import numpy as np prng = np.random.RandomState() # Set the error level to ignore...for example: log2(0). np.seterr(all='ignore') del np from .equal import close, allclose from .sampling import sample, _sample, _samples, ball, norm, sample_simplex from .ops import get_ops, LinearOperations, LogOperations from .fraction import approximate_fraction from .misc import * from .sigmaalgebra import sigma_algebra, is_sigma_algebra, atom_set from . import pmfops from .pmfops import perturb_support as perturb_support_pmf from . import aitchison from . import combinatorics
{ "content_hash": "7596a9d1c85de422ece2e489ef1d4da0", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 75, "avg_line_length": 27.91304347826087, "alnum_prop": 0.7725856697819314, "repo_name": "dit/dit", "id": "0a867072cadef14e39844bd5dd434d704a59c450", "size": "642", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dit/math/__init__.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "5938" }, { "name": "Cython", "bytes": "16890" }, { "name": "HTML", "bytes": "265" }, { "name": "PHP", "bytes": "614" }, { "name": "Python", "bytes": "1297093" }, { "name": "Shell", "bytes": "152" }, { "name": "TeX", "bytes": "6951" } ], "symlink_target": "" }
SELECT * FROM Keys WHERE asset = :asset;
{ "content_hash": "0bc904d132feb2e36a8d6d1a8a407eff", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 40, "avg_line_length": 41, "alnum_prop": 0.7073170731707317, "repo_name": "StorjRND/picopayments", "id": "c9fa39806875c0042c81cb46bd763633498f0e3d", "size": "41", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "picopayments_hub/sql/keys.sql", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "3946" }, { "name": "PLpgSQL", "bytes": "14584" }, { "name": "Python", "bytes": "116730" } ], "symlink_target": "" }
@import Foundation; @class NLDataAccessController; @class NLCommunicationController; @interface NLManager : NSObject - (instancetype)initWithDataAccessController:(NLDataAccessController *)dataAccessController communicationController:(NLCommunicationController *)communicationController; @end
{ "content_hash": "644cc371dc0169688244a276184f532b", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 169, "avg_line_length": 29.6, "alnum_prop": 0.8614864864864865, "repo_name": "neofoniemobile/NemoLogic", "id": "84e3c15bd805c7619b610ace7259b7b30860f62d", "size": "467", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Nemo Logic/Business Logic Layer/Objects/NLManager.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "22772" }, { "name": "Ruby", "bytes": "747" } ], "symlink_target": "" }
""" DataTable display. """ from .subframe import SubFrame from .plugin import plugins class DataTable(SubFrame): """Display a DataFrame as a DataTable.""" _plugins = [plugins.datatables] def _js(self, data): """Javascript callback body.""" data = data.to_records() data = self._json({ 'data': data.tolist(), 'columns': [ {'title': x} for x in self._map_columns(data.dtype.names) ] }) return "element.append('<table />').find('table').DataTable({});".format(data)
{ "content_hash": "681d41ca34f88068af84a912ebb74fd9", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 86, "avg_line_length": 22.96, "alnum_prop": 0.5522648083623694, "repo_name": "joshbode/subframe", "id": "f725309690ad014e3b8fcbe2e6561e01b841f7ec", "size": "574", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "subframe/datatables.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "15844" } ], "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_08.html">Class Test_AbaRouteValidator_08</a></li> </ol></div> <h1 class="aui-h2-clover"> Test testAbaNumberCheck_15670_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_08.html?line=16144#src-16144" >testAbaNumberCheck_15670_bad</a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:38:16 </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_15670_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=12703#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=12703#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=12703#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": "493e91faa56a03b57154dacdd53104a1", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 359, "avg_line_length": 46.753191489361704, "alnum_prop": 0.5303540547920269, "repo_name": "dcarda/aba.route.validator", "id": "be7d9ae9e44829dbac6e406b834fd16c34a4b1ec", "size": "10987", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_08_testAbaNumberCheck_15670_bad_9sv.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "18715254" } ], "symlink_target": "" }
#ifndef __IPTC_DATASET_H__ #define __IPTC_DATASET_H__ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct _IptcDataSet IptcDataSet; typedef struct _IptcDataSetPrivate IptcDataSetPrivate; typedef enum { IPTC_DONT_VALIDATE = 0, IPTC_VALIDATE = 1 } IptcValidate; #include <libiptcdata/iptc-data.h> #include <libiptcdata/iptc-mem.h> struct _IptcDataSet { IptcRecord record; IptcTag tag; const IptcTagInfo * info; unsigned char *data; unsigned int size; /* Data containing this dataset */ IptcData *parent; IptcDataSetPrivate *priv; }; /* Lifecycle */ IptcDataSet *iptc_dataset_new (void); IptcDataSet *iptc_dataset_new_mem (IptcMem * mem); IptcDataSet *iptc_dataset_copy (IptcDataSet *dataset); void iptc_dataset_ref (IptcDataSet *dataset); void iptc_dataset_unref (IptcDataSet *dataset); void iptc_dataset_free (IptcDataSet *dataset); void iptc_dataset_set_tag (IptcDataSet *dataset, IptcRecord record, IptcTag tag); IptcFormat iptc_dataset_get_format (IptcDataSet *dataset); int iptc_dataset_get_data (IptcDataSet *dataset, unsigned char * buf, unsigned int size); unsigned int iptc_dataset_get_value (IptcDataSet *dataset); int iptc_dataset_get_date (IptcDataSet *dataset, int *year, int *month, int *day); int iptc_dataset_get_time (IptcDataSet *dataset, int *hour, int *min, int *sec, int *tz); int iptc_dataset_set_data (IptcDataSet *dataset, const unsigned char * buf, unsigned int size, IptcValidate validate); int iptc_dataset_set_value (IptcDataSet *dataset, unsigned int value, IptcValidate validate); int iptc_dataset_set_date (IptcDataSet *dataset, int year, int month, int day, IptcValidate validate); int iptc_dataset_set_time (IptcDataSet *dataset, int hour, int min, int sec, int tz, IptcValidate validate); /* For your convenience */ const char *iptc_dataset_get_as_str (IptcDataSet *dataset, char *buf, unsigned int size); void iptc_dataset_dump (IptcDataSet *dataset, unsigned int indent); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __IPTC_DATASET_H__ */
{ "content_hash": "8b63ea2ee5bd4f9f598447df6e2b442a", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 88, "avg_line_length": 29.756756756756758, "alnum_prop": 0.6893732970027248, "repo_name": "OlehKulykov/JpegIptcReader", "id": "1ad8abbb61c3f4c7e0151025023f16334b19e660", "size": "3016", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "libiptcdata/libiptcdata/iptc-dataset.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "8314" }, { "name": "C", "bytes": "1798885" }, { "name": "C++", "bytes": "6640" }, { "name": "Objective-C", "bytes": "5121" }, { "name": "Python", "bytes": "2477" }, { "name": "Shell", "bytes": "801895" }, { "name": "Smalltalk", "bytes": "10092" } ], "symlink_target": "" }
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class AddStatusImmonile extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('keys', function (Blueprint $table) { $table->integer('keys_status_immobile'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('keys', function (Blueprint $table) { // }); } }
{ "content_hash": "d57d3e8c2ed2be7b249d45b073fd373f", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 59, "avg_line_length": 18.548387096774192, "alnum_prop": 0.5408695652173913, "repo_name": "Junior-Shyko/admin", "id": "9d0565bc60102759b6500bd2458d20d66c9888b3", "size": "575", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "database/2017_07_31_100845_add_status_immonile.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1014" }, { "name": "CSS", "bytes": "59351" }, { "name": "HTML", "bytes": "4115136" }, { "name": "JavaScript", "bytes": "2340956" }, { "name": "PHP", "bytes": "422291" } ], "symlink_target": "" }
use MinionsDB select Name from Towns where Name = @townName
{ "content_hash": "75e1907834c1b8ef1e9377be254ecd26", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 22, "avg_line_length": 15.25, "alnum_prop": 0.7868852459016393, "repo_name": "BlueDress/School", "id": "ab5c9584cd9efa46564de885ecbd8ec0e1e17546", "size": "63", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Databases Advanced Entity Framework/Introduction to DB Apps Exercises/Add Minion/CheckTown.sql", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "601" }, { "name": "Batchfile", "bytes": "1792" }, { "name": "C#", "bytes": "3240582" }, { "name": "CSS", "bytes": "533784" }, { "name": "HTML", "bytes": "134453" }, { "name": "Java", "bytes": "59647" }, { "name": "JavaScript", "bytes": "78257" }, { "name": "PHP", "bytes": "321319" }, { "name": "PLSQL", "bytes": "470" }, { "name": "PLpgSQL", "bytes": "4109" }, { "name": "SQLPL", "bytes": "3632" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in Novi Comment. Soc. Regiae Sci. Gott. 6: t. 6, fig. 31. 1775 #### Original name null ### Remarks null
{ "content_hash": "714ca956e1700b57de9eec934024b91e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 59, "avg_line_length": 14.461538461538462, "alnum_prop": 0.675531914893617, "repo_name": "mdoering/backbone", "id": "43846ba45972c65e23b47328b0a966a5f8650c49", "size": "235", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Avena/Avena sativa/ Syn. Avena sativa nigra/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const casual = require("casual"); exports.primitives = [ casual.integer(), casual.word, true, null ]; function GetRandomPrimitive() { return getRandom(...exports.primitives); } exports.GetRandomPrimitive = GetRandomPrimitive; function getRandom(...values) { const shuffledValues = values.slice().sort((a, b) => Math.random() - 0.5); return shuffledValues[0]; } //# sourceMappingURL=casual-util.js.map
{ "content_hash": "12bf67b425e26a93c49c142db0984c32", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 28.055555555555557, "alnum_prop": 0.691089108910891, "repo_name": "serge-jacquemin-busi/object-to-json-refs", "id": "fe136a91f0d19d8e071140345b96c23730aec8d8", "size": "505", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dist/spec/util/casual-util.js", "mode": "33188", "license": "mit", "language": [ { "name": "TypeScript", "bytes": "46039" } ], "symlink_target": "" }
<?php namespace ZendTest\Di\TestAsset\ConstructorInjection; class E extends A { }
{ "content_hash": "1ba1c976786365bdd06b532d4eaf04e6", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 53, "avg_line_length": 10.625, "alnum_prop": 0.7647058823529411, "repo_name": "MadCat34/zend-di", "id": "6594f6f836efa8ad6a76809e6fa0f709a9a7e9f1", "size": "387", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/TestAsset/ConstructorInjection/E.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "304545" } ], "symlink_target": "" }
from ..test_module import TestModule from mock import Mock, patch import git class TestGit(TestModule): def setUp(self): super(TestGit, self).setUp() self.git_obj = git.git(self.bot) def test_init(self): pass if __name__ == '__main__': unittest.main()
{ "content_hash": "6deb8d9409d43b78bf63fd02d4f5d300", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 40, "avg_line_length": 19.466666666666665, "alnum_prop": 0.6198630136986302, "repo_name": "johnmiked15/scrappy", "id": "73782117b32a7978b989bd9a6ccc9c9b99d2adf2", "size": "292", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "modules/git/test.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "243755" }, { "name": "Shell", "bytes": "31" } ], "symlink_target": "" }
var ssl = false; var express = require('express'); var app = express(); var fs = require('fs'); if(ssl === false){ var server = require('http').createServer(app); }else{ var privateKey = fs.readFileSync(__dirname + '/ssl/localhost.key').toString(); var certificate = fs.readFileSync(__dirname + '/ssl/localhost.pem').toString(); var options = { key : privateKey, cert : certificate }; var server = require('https').createServer(options,app); } var webRTC = require('webrtc.io').listen(server); var port = process.env.PORT || 8080; server.listen(port); var username = "username"; var password = "password"; var auth = express.basicAuth(function (user, pass) { return (user == username && pass == password); }, 'to use this application , please login first !'); app.get('/', auth, function (req, res) { res.sendfile(__dirname + '/index.html'); console.log(req.connection.remoteAddress + " has joined the chat !"); }); app.get('/css/style.css', auth, function (req, res) { res.sendfile(__dirname + '/css/style.css'); }); app.get('/js/jquery.min.js', auth, function (req, res) { res.sendfile(__dirname + '/js/jquery.min.js'); }); app.get('/js/script.js', auth, function (req, res) { res.sendfile(__dirname + '/js/script.js'); }); app.get('/js/webrtc.io.js', auth, function (req, res) { res.sendfile(__dirname + '/js/webrtc.io.js'); }); console.log("server running on 0.0.0.0:" + port);
{ "content_hash": "5f6137fe6a97e0ba8109791871e996be", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 83, "avg_line_length": 33.02272727272727, "alnum_prop": 0.635237439779766, "repo_name": "tawfekov/hangouts", "id": "c24bfceb48cafb7d081b4d1af46cf94bedad0d76", "size": "1453", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "site/server.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "19932" } ], "symlink_target": "" }
""" enable_mount_voluems - Creator and Configurator of MOUNT volumes Features: 1. Create GP2 SSD volumes for each private agent 2. Attaches volumes to each private agent 3. Formats volumes and configures fstab entires 4. Configures Mesos Agent and relaunches instances for changes to take effect. Note: Currently, enable_mount_volumes only works with AWS DC/OS clusters. """ import boto3 import botocore import logging import os import os.path #import pprint import sys import time import uuid from fabric.api import run, env from fabric.tasks import execute logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO, format="%(message)s") def tag_match(instance, key, value): tags = instance.get('Tags') if not tags: return False for tag in tags: if tag.get('Key') == key and tag.get('Value') == value: return True return False def filter_reservations_tags(reservations, filter_key, filter_value): filtered_reservations = [] logger.info('Values for {} (searching for "{}"):'.format(filter_key, filter_value)) for reservation in reservations: instances = reservation['Instances'] if tag_match(reservation['Instances'][0], filter_key, filter_value): filtered_reservations.append(reservation) return filtered_reservations def filter_gateway_instance(instances): for instance in instances: if tag_match(instance, 'role', 'mesos-master'): return instance def enumerate_instances(reservations): bucket = [] for reservation in reservations: instances = reservation['Instances'] for instance in instances: bucket.append(instance) return bucket # A private slave doesn't have a PublicDnsName def filter_instances_private(instances): return [instance for instance in instances if len(instance.get('PublicDnsName', '')) == 0] def create_volume(client, zone): response = client.create_volume( Size=24, AvailabilityZone=zone, VolumeType='gp2', Encrypted=False ) logger.info('Create volume response: {}'.format(response)) return response def attach_volume(client, volume_id, instance_id, device='/dev/xvdm'): response = client.attach_volume( VolumeId=volume_id, InstanceId=instance_id, Device=device) logger.info('Attach volume response: {}'.format(response)) return response def configure_delete_on_termination(client, volume_id, instance_id, device='/dev/xvdm'): response = client.modify_instance_attribute( InstanceId=instance_id, BlockDeviceMappings=[ { 'DeviceName': device, 'Ebs': { 'VolumeId': volume_id, 'DeleteOnTermination': True } }, ] ) logger.info('Instance attribute modification response: {}'.format(response)) return response def tag_volume(client, volume_id): response = client.create_tags( Resources=[volume_id], Tags=[ { 'Key': 'ccm_volume_name', 'Value': 'infinity-' + str(uuid.uuid1()) } ] ) return response def detach_volume(client, volume_id, instance_id, device='/dev/xvdm'): response = client.detach_volume( VolumeId=volume_id, InstanceId=instance_id, Device=device) logger.info('Volume detach response: {}'.format(response)) return response def configure_partition(device, partition_index, start, end, stdout): device_partition = '{}{}'.format(device, partition_index) # e.g. /dev/xvdm1 mount_location = '/dcos/volume{}'.format(partition_index - 1) # e.g. /dcos/volume0 run('sudo parted -s {} mkpart primary ext4 {} {}'.format(device, start, end), stdout=stdout) run('sudo mkfs -t ext4 {}'.format(device_partition), stdout=stdout) run('sudo mkdir -p {}'.format(mount_location), stdout=stdout) run('sudo mount {} {}'.format(device_partition, mount_location), stdout=stdout) run('sudo sh -c "echo \'{} {} ext4 defaults 0 2\' >> /etc/fstab"'.format(device_partition, mount_location), stdout=stdout) def configure_device(device='/dev/xvdm', stdout=sys.stdout): """ Format the attached EBS volume as two MOUNT volumes and adds entries into fstab. DC/OS will autodetect the '/dcos/volume#' volumes. """ device_name = os.path.basename(device) run('until [[ "$(lsblk -o NAME -r | grep {} | wc -l)" -gt "0" ]]; do echo "Waiting for {}"; sleep 2; done'.format(device_name, device_name)) run('sudo parted -s {} mklabel gpt'.format(device)) configure_partition(device, 1, "0%", "50%", stdout=stdout) configure_partition(device, 2, "50%", "100%", stdout=stdout) def configure_mesos(stdout): """ Configures the newly created EBS volume as a Mesos agent resource """ run("sudo systemctl stop dcos-mesos-slave", stdout=stdout) run("sudo rm -f /var/lib/mesos/slave/meta/slaves/latest", stdout=stdout) run("sudo rm -f /var/lib/dcos/mesos-resources", stdout=stdout) run("sudo systemctl start dcos-mesos-slave", stdout=stdout) def main(stack_id = '', stdout=sys.stdout): # Read inputs from environment aws_access_key = os.environ.get('AWS_ACCESS_KEY_ID', '') aws_secret_key = os.environ.get('AWS_SECRET_ACCESS_KEY', '') stack_id = str(os.environ.get('STACK_ID', stack_id)) if not aws_access_key or not aws_secret_key or not stack_id: logger.error('AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and STACK_ID envvars are required.') return 1 region_name = os.environ.get('AWS_DEFAULT_REGION', 'us-west-2') # Create EC2 client ec2 = boto3.client('ec2', aws_access_key_id=aws_access_key, aws_secret_access_key=aws_secret_key, region_name=region_name) # Get all provisioned instances instances = ec2.describe_instances() #logger.info('Instances: {}'.format(pprint.pformat(instances))) all_reservations = instances.get('Reservations') #logger.info('Reservations: {}'.format(pprint.pformat(all_reservations))) # Filter instances for the given stack-id stack_id_key = 'aws:cloudformation:stack-id' reservations = filter_reservations_tags(all_reservations, stack_id_key, stack_id) if not reservations: logger.error('Unable to find any reservations with {} = {}.'.format(stack_id_key, stack_id)) return 1 logger.info('Found {} reservations with {} = {}'.format(len(reservations), stack_id_key, stack_id)) # Extract all the instance objects instances = enumerate_instances(reservations) #logger.info('Reservation instances:\n{}'.format(pprint.pformat(instances))) # Extract the public host from our list of instances gateway_instance = filter_gateway_instance(instances) #logger.info('Gateway instance:\n{}'.format(pprint.pformat(gateway_instance))) # This gateway ip will be used as a jump host for SSH into private nodes gateway_ip = gateway_instance.get('PublicIpAddress') logger.info('Gateway IP: {}'.format(gateway_ip)) # Attach EBS volumes to private instances only private_instances = filter_instances_private(instances) for instance in private_instances: # If an instance is not running, ignore it. if instance.get('State').get('Name') != 'running': logger.info('Ignoring instance that is not running: {}'.format(instance)) continue instance_id = instance['InstanceId'] azone = instance['Placement']['AvailabilityZone'] # Create volume for the instance in the same AvailabilityZone volume = create_volume(ec2, azone) logger.info('Creating volume: {}'.format(volume)) volume_id = volume['VolumeId'] # Wait for volume to be available. volume_waiter = ec2.get_waiter('volume_available') attempts = 0 max_attempts = 16 wait_time = 1 while attempts < max_attempts: attempts += 1 try: volume_waiter.wait(VolumeIds=[volume_id]) logger.info('Volume: {} is now available'.format(volume_id)) break except botocore.exceptions.WaiterError as e: logger.error('Error occured: {}'.format(e)) raise e except botocore.exceptions.ClientError as e: logger.error('Error occured: {}'.format(e)) if e.response['Error']['Code'] == 'RequestLimitExceeded': curr_wait_time = 2**attempts * wait_time logger.error('Going to wait for: {} before retrying.'.format(curr_wait_time)) time.sleep(curr_wait_time) else: raise e # Attach the volume to our instance. att_res = attach_volume(ec2, volume_id=volume_id, instance_id=instance_id) logger.info('Attaching volume: {}'.format(att_res)) # Wait for volume to attach. volume_attach = ec2.get_waiter('volume_in_use') attempts = 0 max_attempts = 16 wait_time = 1 while attempts < max_attempts: attempts += 1 try: volume_attach.wait(VolumeIds=[volume_id]) logger.info('Volume: {} is now attached to instance: {}'.format(volume_id, instance_id)) break except botocore.exceptions.WaiterError as e: logger.error('Error occured: {}'.format(e)) raise e except botocore.exceptions.ClientError as e: logger.error('Error occured: {}'.format(e)) if e.response['Error']['Code'] == 'RequestLimitExceeded': curr_wait_time = 2**attempts * wait_time logger.error('Going to wait for: {} before retrying.'.format(curr_wait_time)) time.sleep(curr_wait_time) else: raise e conf_res = configure_delete_on_termination(ec2, volume_id=volume_id, instance_id=instance_id) logger.info('Delete on termination: {}'.format(conf_res)) tag_res = tag_volume(ec2, volume_id=volume_id) logger.info('Tag volume: {}'.format(tag_res)) private_ip = instance.get('PrivateIpAddress') env.hosts = [private_ip] env.gateway = gateway_ip env.user = 'core' logger.info('Creating partitions on agent: {}'.format(private_ip)) execute(configure_device, '/dev/xvdm', stdout) logger.info('Restarting agent so that it sees the partitions: {}'.format(private_ip)) execute(configure_mesos, stdout) logger.info('Mount volumes enabled. Exiting now...') return 0 if __name__ == '__main__': sys.exit(main())
{ "content_hash": "62bf7189de11932eacf8ed00ad25f8d4", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 144, "avg_line_length": 35.17363344051447, "alnum_prop": 0.6254685071761587, "repo_name": "vishnu2kmohan/dcos-commons", "id": "28cb9c3dca275db705360e8e642371ca68d4dc42", "size": "10962", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tools/enable_mount_volumes.py", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "168256" }, { "name": "HTML", "bytes": "99573" }, { "name": "Java", "bytes": "2770769" }, { "name": "Makefile", "bytes": "106" }, { "name": "Python", "bytes": "457961" }, { "name": "Shell", "bytes": "46736" } ], "symlink_target": "" }
package som.interpreter.nodes.specialized.whileloops; import com.oracle.truffle.api.CallTarget; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.Truffle; import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.instrumentation.Tag; import com.oracle.truffle.api.nodes.DirectCallNode; import som.interpreter.nodes.ExpressionNode; import som.interpreter.nodes.nary.BinaryComplexOperation; import som.interpreter.nodes.specialized.SomLoop; import som.interpreter.objectstorage.ObjectTransitionSafepoint; import som.vm.constants.Nil; import som.vmobjects.SBlock; import tools.dym.Tags.LoopNode; public abstract class AbstractWhileNode extends BinaryComplexOperation { @Child protected DirectCallNode conditionValueSend; @Child protected DirectCallNode bodyValueSend; protected final boolean predicateBool; public AbstractWhileNode(final SBlock rcvr, final SBlock arg, final boolean predicateBool) { CallTarget callTargetCondition = rcvr.getMethod().getCallTarget(); conditionValueSend = Truffle.getRuntime().createDirectCallNode( callTargetCondition); CallTarget callTargetBody = arg.getMethod().getCallTarget(); bodyValueSend = Truffle.getRuntime().createDirectCallNode( callTargetBody); this.predicateBool = predicateBool; } @Override protected boolean hasTagIgnoringEagerness(final Class<? extends Tag> tag) { if (tag == LoopNode.class) { return true; } else { return super.hasTagIgnoringEagerness(tag); } } @Override public final Object executeEvaluated(final VirtualFrame frame, final Object rcvr, final Object arg) { return doWhileConditionally((SBlock) rcvr, (SBlock) arg); } protected final Object doWhileUnconditionally(final SBlock loopCondition, final SBlock loopBody) { long iterationCount = 0; boolean loopConditionResult = (boolean) conditionValueSend.call( new Object[] {loopCondition}); try { // TODO: this is a simplification, we don't cover the case receiver isn't a boolean while (loopConditionResult == predicateBool) { bodyValueSend.call(new Object[] {loopBody}); loopConditionResult = (boolean) conditionValueSend.call( new Object[] {loopCondition}); if (CompilerDirectives.inInterpreter()) { iterationCount++; } ObjectTransitionSafepoint.INSTANCE.checkAndPerformSafepoint(); } } finally { if (CompilerDirectives.inInterpreter()) { SomLoop.reportLoopCount(iterationCount, this); } } return Nil.nilObject; } protected abstract Object doWhileConditionally(SBlock loopCondition, SBlock loopBody); @Override public boolean isResultUsed(final ExpressionNode child) { return false; } }
{ "content_hash": "45244b9e4b34d5821376aec39f7671b6", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 94, "avg_line_length": 32.7906976744186, "alnum_prop": 0.7429078014184397, "repo_name": "smarr/SOMns", "id": "5c05f5946b359a821853d3a39b4ac772ee7bcba7", "size": "2820", "binary": false, "copies": "1", "ref": "refs/heads/release", "path": "src/som/interpreter/nodes/specialized/whileloops/AbstractWhileNode.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "12231" }, { "name": "Java", "bytes": "1566294" }, { "name": "JavaScript", "bytes": "614" }, { "name": "Pascal", "bytes": "186" }, { "name": "Perl", "bytes": "33" }, { "name": "Python", "bytes": "18681" }, { "name": "Shell", "bytes": "10686" }, { "name": "TypeScript", "bytes": "181603" } ], "symlink_target": "" }
(function() { "use strict"; var ctrlName = 'CaseHistoryController'; var ctrl = [ '$scope', '$http', '$stateParams','viewModelHelper', '$window', function ($scope, $http, $stateParams, viewModelHelper, $window) { var patientProcHistoryUrl = '~/api/PatientProcedureHistory/list/'; var headerLoadUrl = '~/api/PatientProcedure/header/'; viewModelHelper.showPageHeader = !$window.opener; var self = $scope; self.print = function() { $window.print(); }; self.close = function () { if ($window.opener) { $window.close(); } else { //Go to case search page. $window.location.href = '/Case#/Search'; } }; var loadHeader = function() { self.header = {}; return $http.get(headerLoadUrl + $stateParams.ppId) .success(function(data) { self.header = data; }); }; var initialize = function() { return $http.get(patientProcHistoryUrl + $stateParams.ppId) .success(function(response) { self.history = response; }); }; loadHeader(); initialize(); } ]; angular .module('app') .controller(ctrlName, ctrl); })();
{ "content_hash": "58a64aadb4e004ac098450d24c1ac955", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 78, "avg_line_length": 28.35185185185185, "alnum_prop": 0.45003265839320705, "repo_name": "Hem/Bootstrap3x", "id": "dad8d13ebab236f02a3ab949ed1114c3859b66ee", "size": "1533", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "App/Case/History/Js/CaseHistoryController.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2111" }, { "name": "CSS", "bytes": "1129617" }, { "name": "HTML", "bytes": "1350482" }, { "name": "JavaScript", "bytes": "1273001" }, { "name": "PowerShell", "bytes": "468" }, { "name": "Python", "bytes": "5734" }, { "name": "Ruby", "bytes": "1185" }, { "name": "Shell", "bytes": "350" } ], "symlink_target": "" }
var RSVP = require('rsvp'); //console.log("RSVP",RSVP); var getURL=function(url){ var promise = new RSVP.Promise(function(resolve, reject) { // succeed var request=require("request"); request(url,function(err,res,body){ if(err) reject(err); else resolve(body); }) // or reject }); return promise; } getURL("http://m.nongfaidai.com").then(function(){ //前一个的输出作为下一项的输入 console.log("succ1"); return getURL("http://m.nongfaidai.com/project_list.html"); },function(err){ console.log("step1 fail"); }).then(function(){ console.log("succ2"); //var args=arguments; //console.log("0",args[0]); }).catch(function(err){ console.log(err); });
{ "content_hash": "2907553db6d0da8451905ce57acf1d5f", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 60, "avg_line_length": 21.677419354838708, "alnum_prop": 0.6517857142857143, "repo_name": "nongfadai/cordova", "id": "723d7fa9f5240af39cfb3dc6877a6e8bdc45fcda", "size": "700", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "backstage/test/promise/rsvp.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "3009" }, { "name": "C", "bytes": "3985" }, { "name": "CSS", "bytes": "778780" }, { "name": "HTML", "bytes": "852547" }, { "name": "Java", "bytes": "13941" }, { "name": "JavaScript", "bytes": "2393815" }, { "name": "Makefile", "bytes": "1763" }, { "name": "Objective-C", "bytes": "218205" }, { "name": "Shell", "bytes": "4592" }, { "name": "Smarty", "bytes": "101284" }, { "name": "Swift", "bytes": "4405" } ], "symlink_target": "" }
class MainController < ApplicationController def dashboard if current_user @recent_comments = DataCatalog::Comment.all(:user_id => current_user.api_id) @recent_comments.each do |c| source = DataCatalog::Source.get(c.source_id) c.source_title = source.title c.source_slug = source.slug end @all_ratings = DataCatalog::Rating.all(:user_id => current_user.api_id) @recent_ratings = [] @all_ratings.take(5).each do |rating| if rating.kind == "source" source = DataCatalog::Source.get(rating.source_id) rating.source_title = source.title rating.source_slug = source.slug @recent_ratings << rating end end render 'dashboard' and return else @source_count = DataCatalog::Source.all.length @importers = DataCatalog::Importer.all imports = DataCatalog::Import.all sorted_imports = imports.sort_by { |i| i.finished_at } @last_updated = if sorted_imports.empty? nil else sorted_imports.last.finished_at end render 'welcome' and return end end def about end def blog require 'feedzirra' url = "http://sunlightlabs.com/blog/feeds/tag/datacatalog/" #natdatcat or data.gov feed = Feedzirra::Feed.fetch_and_parse(url) @entries = feed.entries end def source @source = DataCatalog::Source.get(params[:slug]) end end
{ "content_hash": "ca5893eaf7320857eed2fc46c4796eb1", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 86, "avg_line_length": 25.875, "alnum_prop": 0.6300897170462388, "repo_name": "afomi/datacatalog-web", "id": "061b9bf3617ee3f18cd38dece204f205359afeec", "size": "1449", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/main_controller.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "46575" }, { "name": "Ruby", "bytes": "99634" } ], "symlink_target": "" }
"""Lite version of scipy.linalg. Notes ----- This module is a lite version of the linalg.py module in SciPy which contains high-level Python interface to the LAPACK library. The lite version only accesses the following LAPACK functions: dgesv, zgesv, dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetrf, zgetrf, dpotrf, zpotrf, dgeqrf, zgeqrf, zungqr, dorgqr. """ __all__ = ['matrix_power', 'solve', 'tensorsolve', 'tensorinv', 'inv', 'cholesky', 'eigvals', 'eigvalsh', 'pinv', 'slogdet', 'det', 'svd', 'eig', 'eigh','lstsq', 'norm', 'qr', 'cond', 'matrix_rank', 'LinAlgError'] from numpy.core import array, asarray, zeros, empty, transpose, \ intc, single, double, csingle, cdouble, inexact, complexfloating, \ newaxis, ravel, all, Inf, dot, add, multiply, identity, sqrt, \ maximum, flatnonzero, diagonal, arange, fastCopyAndTranspose, sum, \ isfinite, size, finfo, absolute, log, exp from numpy.lib import triu from numpy.linalg import lapack_lite from numpy.matrixlib.defmatrix import matrix_power from numpy.compat import asbytes # For Python2/3 compatibility _N = asbytes('N') _V = asbytes('V') _A = asbytes('A') _S = asbytes('S') _L = asbytes('L') fortran_int = intc # Error object class LinAlgError(Exception): """ Generic Python-exception-derived object raised by linalg functions. General purpose exception class, derived from Python's exception.Exception class, programmatically raised in linalg functions when a Linear Algebra-related condition would prevent further correct execution of the function. Parameters ---------- None Examples -------- >>> from numpy import linalg as LA >>> LA.inv(np.zeros((2,2))) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "...linalg.py", line 350, in inv return wrap(solve(a, identity(a.shape[0], dtype=a.dtype))) File "...linalg.py", line 249, in solve raise LinAlgError('Singular matrix') numpy.linalg.LinAlgError: Singular matrix """ pass def _makearray(a): new = asarray(a) wrap = getattr(a, "__array_prepare__", new.__array_wrap__) return new, wrap def isComplexType(t): return issubclass(t, complexfloating) _real_types_map = {single : single, double : double, csingle : single, cdouble : double} _complex_types_map = {single : csingle, double : cdouble, csingle : csingle, cdouble : cdouble} def _realType(t, default=double): return _real_types_map.get(t, default) def _complexType(t, default=cdouble): return _complex_types_map.get(t, default) def _linalgRealType(t): """Cast the type t to either double or cdouble.""" return double _complex_types_map = {single : csingle, double : cdouble, csingle : csingle, cdouble : cdouble} def _commonType(*arrays): # in lite version, use higher precision (always double or cdouble) result_type = single is_complex = False for a in arrays: if issubclass(a.dtype.type, inexact): if isComplexType(a.dtype.type): is_complex = True rt = _realType(a.dtype.type, default=None) if rt is None: # unsupported inexact scalar raise TypeError("array type %s is unsupported in linalg" % (a.dtype.name,)) else: rt = double if rt is double: result_type = double if is_complex: t = cdouble result_type = _complex_types_map[result_type] else: t = double return t, result_type # _fastCopyAndTranpose assumes the input is 2D (as all the calls in here are). _fastCT = fastCopyAndTranspose def _to_native_byte_order(*arrays): ret = [] for arr in arrays: if arr.dtype.byteorder not in ('=', '|'): ret.append(asarray(arr, dtype=arr.dtype.newbyteorder('='))) else: ret.append(arr) if len(ret) == 1: return ret[0] else: return ret def _fastCopyAndTranspose(type, *arrays): cast_arrays = () for a in arrays: if a.dtype.type is type: cast_arrays = cast_arrays + (_fastCT(a),) else: cast_arrays = cast_arrays + (_fastCT(a.astype(type)),) if len(cast_arrays) == 1: return cast_arrays[0] else: return cast_arrays def _assertRank2(*arrays): for a in arrays: if len(a.shape) != 2: raise LinAlgError('%d-dimensional array given. Array must be ' 'two-dimensional' % len(a.shape)) def _assertSquareness(*arrays): for a in arrays: if max(a.shape) != min(a.shape): raise LinAlgError('Array must be square') def _assertFinite(*arrays): for a in arrays: if not (isfinite(a).all()): raise LinAlgError("Array must not contain infs or NaNs") def _assertNonEmpty(*arrays): for a in arrays: if size(a) == 0: raise LinAlgError("Arrays cannot be empty") # Linear equations def tensorsolve(a, b, axes=None): """ Solve the tensor equation ``a x = b`` for x. It is assumed that all indices of `x` are summed over in the product, together with the rightmost indices of `a`, as is done in, for example, ``tensordot(a, x, axes=len(b.shape))``. Parameters ---------- a : array_like Coefficient tensor, of shape ``b.shape + Q``. `Q`, a tuple, equals the shape of that sub-tensor of `a` consisting of the appropriate number of its rightmost indices, and must be such that ``prod(Q) == prod(b.shape)`` (in which sense `a` is said to be 'square'). b : array_like Right-hand tensor, which can be of any shape. axes : tuple of ints, optional Axes in `a` to reorder to the right, before inversion. If None (default), no reordering is done. Returns ------- x : ndarray, shape Q Raises ------ LinAlgError If `a` is singular or not 'square' (in the above sense). See Also -------- tensordot, tensorinv, einsum Examples -------- >>> a = np.eye(2*3*4) >>> a.shape = (2*3, 4, 2, 3, 4) >>> b = np.random.randn(2*3, 4) >>> x = np.linalg.tensorsolve(a, b) >>> x.shape (2, 3, 4) >>> np.allclose(np.tensordot(a, x, axes=3), b) True """ a,wrap = _makearray(a) b = asarray(b) an = a.ndim if axes is not None: allaxes = range(0, an) for k in axes: allaxes.remove(k) allaxes.insert(an, k) a = a.transpose(allaxes) oldshape = a.shape[-(an-b.ndim):] prod = 1 for k in oldshape: prod *= k a = a.reshape(-1, prod) b = b.ravel() res = wrap(solve(a, b)) res.shape = oldshape return res def solve(a, b): """ Solve a linear matrix equation, or system of linear scalar equations. Computes the "exact" solution, `x`, of the well-determined, i.e., full rank, linear matrix equation `ax = b`. Parameters ---------- a : array_like, shape (M, M) Coefficient matrix. b : array_like, shape (M,) or (M, N) Ordinate or "dependent variable" values. Returns ------- x : ndarray, shape (M,) or (M, N) depending on b Solution to the system a x = b Raises ------ LinAlgError If `a` is singular or not square. Notes ----- `solve` is a wrapper for the LAPACK routines `dgesv`_ and `zgesv`_, the former being used if `a` is real-valued, the latter if it is complex-valued. The solution to the system of linear equations is computed using an LU decomposition [1]_ with partial pivoting and row interchanges. .. _dgesv: http://www.netlib.org/lapack/double/dgesv.f .. _zgesv: http://www.netlib.org/lapack/complex16/zgesv.f `a` must be square and of full-rank, i.e., all rows (or, equivalently, columns) must be linearly independent; if either is not true, use `lstsq` for the least-squares best "solution" of the system/equation. References ---------- .. [1] G. Strang, *Linear Algebra and Its Applications*, 2nd Ed., Orlando, FL, Academic Press, Inc., 1980, pg. 22. Examples -------- Solve the system of equations ``3 * x0 + x1 = 9`` and ``x0 + 2 * x1 = 8``: >>> a = np.array([[3,1], [1,2]]) >>> b = np.array([9,8]) >>> x = np.linalg.solve(a, b) >>> x array([ 2., 3.]) Check that the solution is correct: >>> (np.dot(a, x) == b).all() True """ a, _ = _makearray(a) b, wrap = _makearray(b) one_eq = len(b.shape) == 1 if one_eq: b = b[:, newaxis] _assertRank2(a, b) _assertSquareness(a) n_eq = a.shape[0] n_rhs = b.shape[1] if n_eq != b.shape[0]: raise LinAlgError('Incompatible dimensions') t, result_t = _commonType(a, b) # lapack_routine = _findLapackRoutine('gesv', t) if isComplexType(t): lapack_routine = lapack_lite.zgesv else: lapack_routine = lapack_lite.dgesv a, b = _fastCopyAndTranspose(t, a, b) a, b = _to_native_byte_order(a, b) pivots = zeros(n_eq, fortran_int) results = lapack_routine(n_eq, n_rhs, a, n_eq, pivots, b, n_eq, 0) if results['info'] > 0: raise LinAlgError('Singular matrix') if one_eq: return wrap(b.ravel().astype(result_t)) else: return wrap(b.transpose().astype(result_t)) def tensorinv(a, ind=2): """ Compute the 'inverse' of an N-dimensional array. The result is an inverse for `a` relative to the tensordot operation ``tensordot(a, b, ind)``, i. e., up to floating-point accuracy, ``tensordot(tensorinv(a), a, ind)`` is the "identity" tensor for the tensordot operation. Parameters ---------- a : array_like Tensor to 'invert'. Its shape must be 'square', i. e., ``prod(a.shape[:ind]) == prod(a.shape[ind:])``. ind : int, optional Number of first indices that are involved in the inverse sum. Must be a positive integer, default is 2. Returns ------- b : ndarray `a`'s tensordot inverse, shape ``a.shape[:ind] + a.shape[ind:]``. Raises ------ LinAlgError If `a` is singular or not 'square' (in the above sense). See Also -------- tensordot, tensorsolve Examples -------- >>> a = np.eye(4*6) >>> a.shape = (4, 6, 8, 3) >>> ainv = np.linalg.tensorinv(a, ind=2) >>> ainv.shape (8, 3, 4, 6) >>> b = np.random.randn(4, 6) >>> np.allclose(np.tensordot(ainv, b), np.linalg.tensorsolve(a, b)) True >>> a = np.eye(4*6) >>> a.shape = (24, 8, 3) >>> ainv = np.linalg.tensorinv(a, ind=1) >>> ainv.shape (8, 3, 24) >>> b = np.random.randn(24) >>> np.allclose(np.tensordot(ainv, b, 1), np.linalg.tensorsolve(a, b)) True """ a = asarray(a) oldshape = a.shape prod = 1 if ind > 0: invshape = oldshape[ind:] + oldshape[:ind] for k in oldshape[ind:]: prod *= k else: raise ValueError("Invalid ind argument.") a = a.reshape(prod, -1) ia = inv(a) return ia.reshape(*invshape) # Matrix inversion def inv(a): """ Compute the (multiplicative) inverse of a matrix. Given a square matrix `a`, return the matrix `ainv` satisfying ``dot(a, ainv) = dot(ainv, a) = eye(a.shape[0])``. Parameters ---------- a : array_like, shape (M, M) Matrix to be inverted. Returns ------- ainv : ndarray or matrix, shape (M, M) (Multiplicative) inverse of the matrix `a`. Raises ------ LinAlgError If `a` is singular or not square. Examples -------- >>> from numpy import linalg as LA >>> a = np.array([[1., 2.], [3., 4.]]) >>> ainv = LA.inv(a) >>> np.allclose(np.dot(a, ainv), np.eye(2)) True >>> np.allclose(np.dot(ainv, a), np.eye(2)) True If a is a matrix object, then the return value is a matrix as well: >>> ainv = LA.inv(np.matrix(a)) >>> ainv matrix([[-2. , 1. ], [ 1.5, -0.5]]) """ a, wrap = _makearray(a) return wrap(solve(a, identity(a.shape[0], dtype=a.dtype))) # Cholesky decomposition def cholesky(a): """ Cholesky decomposition. Return the Cholesky decomposition, `L * L.H`, of the square matrix `a`, where `L` is lower-triangular and .H is the conjugate transpose operator (which is the ordinary transpose if `a` is real-valued). `a` must be Hermitian (symmetric if real-valued) and positive-definite. Only `L` is actually returned. Parameters ---------- a : array_like, shape (M, M) Hermitian (symmetric if all elements are real), positive-definite input matrix. Returns ------- L : ndarray, or matrix object if `a` is, shape (M, M) Lower-triangular Cholesky factor of a. Raises ------ LinAlgError If the decomposition fails, for example, if `a` is not positive-definite. Notes ----- The Cholesky decomposition is often used as a fast way of solving .. math:: A \\mathbf{x} = \\mathbf{b} (when `A` is both Hermitian/symmetric and positive-definite). First, we solve for :math:`\\mathbf{y}` in .. math:: L \\mathbf{y} = \\mathbf{b}, and then for :math:`\\mathbf{x}` in .. math:: L.H \\mathbf{x} = \\mathbf{y}. Examples -------- >>> A = np.array([[1,-2j],[2j,5]]) >>> A array([[ 1.+0.j, 0.-2.j], [ 0.+2.j, 5.+0.j]]) >>> L = np.linalg.cholesky(A) >>> L array([[ 1.+0.j, 0.+0.j], [ 0.+2.j, 1.+0.j]]) >>> np.dot(L, L.T.conj()) # verify that L * L.H = A array([[ 1.+0.j, 0.-2.j], [ 0.+2.j, 5.+0.j]]) >>> A = [[1,-2j],[2j,5]] # what happens if A is only array_like? >>> np.linalg.cholesky(A) # an ndarray object is returned array([[ 1.+0.j, 0.+0.j], [ 0.+2.j, 1.+0.j]]) >>> # But a matrix object is returned if A is a matrix object >>> LA.cholesky(np.matrix(A)) matrix([[ 1.+0.j, 0.+0.j], [ 0.+2.j, 1.+0.j]]) """ a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) t, result_t = _commonType(a) a = _fastCopyAndTranspose(t, a) a = _to_native_byte_order(a) m = a.shape[0] n = a.shape[1] if isComplexType(t): lapack_routine = lapack_lite.zpotrf else: lapack_routine = lapack_lite.dpotrf results = lapack_routine(_L, n, a, m, 0) if results['info'] > 0: raise LinAlgError('Matrix is not positive definite - ' 'Cholesky decomposition cannot be computed') s = triu(a, k=0).transpose() if (s.dtype != result_t): s = s.astype(result_t) return wrap(s) # QR decompostion def qr(a, mode='full'): """ Compute the qr factorization of a matrix. Factor the matrix `a` as *qr*, where `q` is orthonormal and `r` is upper-triangular. Parameters ---------- a : array_like Matrix to be factored, of shape (M, N). mode : {'full', 'r', 'economic'}, optional Specifies the values to be returned. 'full' is the default. Economic mode is slightly faster then 'r' mode if only `r` is needed. Returns ------- q : ndarray of float or complex, optional The orthonormal matrix, of shape (M, K). Only returned if ``mode='full'``. r : ndarray of float or complex, optional The upper-triangular matrix, of shape (K, N) with K = min(M, N). Only returned when ``mode='full'`` or ``mode='r'``. a2 : ndarray of float or complex, optional Array of shape (M, N), only returned when ``mode='economic``'. The diagonal and the upper triangle of `a2` contains `r`, while the rest of the matrix is undefined. Raises ------ LinAlgError If factoring fails. Notes ----- This is an interface to the LAPACK routines dgeqrf, zgeqrf, dorgqr, and zungqr. For more information on the qr factorization, see for example: http://en.wikipedia.org/wiki/QR_factorization Subclasses of `ndarray` are preserved, so if `a` is of type `matrix`, all the return values will be matrices too. Examples -------- >>> a = np.random.randn(9, 6) >>> q, r = np.linalg.qr(a) >>> np.allclose(a, np.dot(q, r)) # a does equal qr True >>> r2 = np.linalg.qr(a, mode='r') >>> r3 = np.linalg.qr(a, mode='economic') >>> np.allclose(r, r2) # mode='r' returns the same r as mode='full' True >>> # But only triu parts are guaranteed equal when mode='economic' >>> np.allclose(r, np.triu(r3[:6,:6], k=0)) True Example illustrating a common use of `qr`: solving of least squares problems What are the least-squares-best `m` and `y0` in ``y = y0 + mx`` for the following data: {(0,1), (1,0), (1,2), (2,1)}. (Graph the points and you'll see that it should be y0 = 0, m = 1.) The answer is provided by solving the over-determined matrix equation ``Ax = b``, where:: A = array([[0, 1], [1, 1], [1, 1], [2, 1]]) x = array([[y0], [m]]) b = array([[1], [0], [2], [1]]) If A = qr such that q is orthonormal (which is always possible via Gram-Schmidt), then ``x = inv(r) * (q.T) * b``. (In numpy practice, however, we simply use `lstsq`.) >>> A = np.array([[0, 1], [1, 1], [1, 1], [2, 1]]) >>> A array([[0, 1], [1, 1], [1, 1], [2, 1]]) >>> b = np.array([1, 0, 2, 1]) >>> q, r = LA.qr(A) >>> p = np.dot(q.T, b) >>> np.dot(LA.inv(r), p) array([ 1.1e-16, 1.0e+00]) """ a, wrap = _makearray(a) _assertRank2(a) _assertNonEmpty(a) m, n = a.shape t, result_t = _commonType(a) a = _fastCopyAndTranspose(t, a) a = _to_native_byte_order(a) mn = min(m, n) tau = zeros((mn,), t) if isComplexType(t): lapack_routine = lapack_lite.zgeqrf routine_name = 'zgeqrf' else: lapack_routine = lapack_lite.dgeqrf routine_name = 'dgeqrf' # calculate optimal size of work data 'work' lwork = 1 work = zeros((lwork,), t) results = lapack_routine(m, n, a, m, tau, work, -1, 0) if results['info'] != 0: raise LinAlgError('%s returns %d' % (routine_name, results['info'])) # do qr decomposition lwork = int(abs(work[0])) work = zeros((lwork,), t) results = lapack_routine(m, n, a, m, tau, work, lwork, 0) if results['info'] != 0: raise LinAlgError('%s returns %d' % (routine_name, results['info'])) # economic mode. Isn't actually economic. if mode[0] == 'e': if t != result_t : a = a.astype(result_t) return a.T # generate r r = _fastCopyAndTranspose(result_t, a[:,:mn]) for i in range(mn): r[i,:i].fill(0.0) # 'r'-mode, that is, calculate only r if mode[0] == 'r': return r # from here on: build orthonormal matrix q from a if isComplexType(t): lapack_routine = lapack_lite.zungqr routine_name = 'zungqr' else: lapack_routine = lapack_lite.dorgqr routine_name = 'dorgqr' # determine optimal lwork lwork = 1 work = zeros((lwork,), t) results = lapack_routine(m, mn, mn, a, m, tau, work, -1, 0) if results['info'] != 0: raise LinAlgError('%s returns %d' % (routine_name, results['info'])) # compute q lwork = int(abs(work[0])) work = zeros((lwork,), t) results = lapack_routine(m, mn, mn, a, m, tau, work, lwork, 0) if results['info'] != 0: raise LinAlgError('%s returns %d' % (routine_name, results['info'])) q = _fastCopyAndTranspose(result_t, a[:mn,:]) return wrap(q), wrap(r) # Eigenvalues def eigvals(a): """ Compute the eigenvalues of a general matrix. Main difference between `eigvals` and `eig`: the eigenvectors aren't returned. Parameters ---------- a : array_like, shape (M, M) A complex- or real-valued matrix whose eigenvalues will be computed. Returns ------- w : ndarray, shape (M,) The eigenvalues, each repeated according to its multiplicity. They are not necessarily ordered, nor are they necessarily real for real matrices. Raises ------ LinAlgError If the eigenvalue computation does not converge. See Also -------- eig : eigenvalues and right eigenvectors of general arrays eigvalsh : eigenvalues of symmetric or Hermitian arrays. eigh : eigenvalues and eigenvectors of symmetric/Hermitian arrays. Notes ----- This is a simple interface to the LAPACK routines dgeev and zgeev that sets those routines' flags to return only the eigenvalues of general real and complex arrays, respectively. Examples -------- Illustration, using the fact that the eigenvalues of a diagonal matrix are its diagonal elements, that multiplying a matrix on the left by an orthogonal matrix, `Q`, and on the right by `Q.T` (the transpose of `Q`), preserves the eigenvalues of the "middle" matrix. In other words, if `Q` is orthogonal, then ``Q * A * Q.T`` has the same eigenvalues as ``A``: >>> from numpy import linalg as LA >>> x = np.random.random() >>> Q = np.array([[np.cos(x), -np.sin(x)], [np.sin(x), np.cos(x)]]) >>> LA.norm(Q[0, :]), LA.norm(Q[1, :]), np.dot(Q[0, :],Q[1, :]) (1.0, 1.0, 0.0) Now multiply a diagonal matrix by Q on one side and by Q.T on the other: >>> D = np.diag((-1,1)) >>> LA.eigvals(D) array([-1., 1.]) >>> A = np.dot(Q, D) >>> A = np.dot(A, Q.T) >>> LA.eigvals(A) array([ 1., -1.]) """ a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) _assertFinite(a) t, result_t = _commonType(a) real_t = _linalgRealType(t) a = _fastCopyAndTranspose(t, a) a = _to_native_byte_order(a) n = a.shape[0] dummy = zeros((1,), t) if isComplexType(t): lapack_routine = lapack_lite.zgeev w = zeros((n,), t) rwork = zeros((n,), real_t) lwork = 1 work = zeros((lwork,), t) results = lapack_routine(_N, _N, n, a, n, w, dummy, 1, dummy, 1, work, -1, rwork, 0) lwork = int(abs(work[0])) work = zeros((lwork,), t) results = lapack_routine(_N, _N, n, a, n, w, dummy, 1, dummy, 1, work, lwork, rwork, 0) else: lapack_routine = lapack_lite.dgeev wr = zeros((n,), t) wi = zeros((n,), t) lwork = 1 work = zeros((lwork,), t) results = lapack_routine(_N, _N, n, a, n, wr, wi, dummy, 1, dummy, 1, work, -1, 0) lwork = int(work[0]) work = zeros((lwork,), t) results = lapack_routine(_N, _N, n, a, n, wr, wi, dummy, 1, dummy, 1, work, lwork, 0) if all(wi == 0.): w = wr result_t = _realType(result_t) else: w = wr+1j*wi result_t = _complexType(result_t) if results['info'] > 0: raise LinAlgError('Eigenvalues did not converge') return w.astype(result_t) def eigvalsh(a, UPLO='L'): """ Compute the eigenvalues of a Hermitian or real symmetric matrix. Main difference from eigh: the eigenvectors are not computed. Parameters ---------- a : array_like, shape (M, M) A complex- or real-valued matrix whose eigenvalues are to be computed. UPLO : {'L', 'U'}, optional Specifies whether the calculation is done with the lower triangular part of `a` ('L', default) or the upper triangular part ('U'). Returns ------- w : ndarray, shape (M,) The eigenvalues, not necessarily ordered, each repeated according to its multiplicity. Raises ------ LinAlgError If the eigenvalue computation does not converge. See Also -------- eigh : eigenvalues and eigenvectors of symmetric/Hermitian arrays. eigvals : eigenvalues of general real or complex arrays. eig : eigenvalues and right eigenvectors of general real or complex arrays. Notes ----- This is a simple interface to the LAPACK routines dsyevd and zheevd that sets those routines' flags to return only the eigenvalues of real symmetric and complex Hermitian arrays, respectively. Examples -------- >>> from numpy import linalg as LA >>> a = np.array([[1, -2j], [2j, 5]]) >>> LA.eigvalsh(a) array([ 0.17157288+0.j, 5.82842712+0.j]) """ UPLO = asbytes(UPLO) a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) t, result_t = _commonType(a) real_t = _linalgRealType(t) a = _fastCopyAndTranspose(t, a) a = _to_native_byte_order(a) n = a.shape[0] liwork = 5*n+3 iwork = zeros((liwork,), fortran_int) if isComplexType(t): lapack_routine = lapack_lite.zheevd w = zeros((n,), real_t) lwork = 1 work = zeros((lwork,), t) lrwork = 1 rwork = zeros((lrwork,), real_t) results = lapack_routine(_N, UPLO, n, a, n, w, work, -1, rwork, -1, iwork, liwork, 0) lwork = int(abs(work[0])) work = zeros((lwork,), t) lrwork = int(rwork[0]) rwork = zeros((lrwork,), real_t) results = lapack_routine(_N, UPLO, n, a, n, w, work, lwork, rwork, lrwork, iwork, liwork, 0) else: lapack_routine = lapack_lite.dsyevd w = zeros((n,), t) lwork = 1 work = zeros((lwork,), t) results = lapack_routine(_N, UPLO, n, a, n, w, work, -1, iwork, liwork, 0) lwork = int(work[0]) work = zeros((lwork,), t) results = lapack_routine(_N, UPLO, n, a, n, w, work, lwork, iwork, liwork, 0) if results['info'] > 0: raise LinAlgError('Eigenvalues did not converge') return w.astype(result_t) def _convertarray(a): t, result_t = _commonType(a) a = _fastCT(a.astype(t)) return a, t, result_t # Eigenvectors def eig(a): """ Compute the eigenvalues and right eigenvectors of a square array. Parameters ---------- a : array_like, shape (M, M) A square array of real or complex elements. Returns ------- w : ndarray, shape (M,) The eigenvalues, each repeated according to its multiplicity. The eigenvalues are not necessarily ordered, nor are they necessarily real for real arrays (though for real arrays complex-valued eigenvalues should occur in conjugate pairs). v : ndarray, shape (M, M) The normalized (unit "length") eigenvectors, such that the column ``v[:,i]`` is the eigenvector corresponding to the eigenvalue ``w[i]``. Raises ------ LinAlgError If the eigenvalue computation does not converge. See Also -------- eigvalsh : eigenvalues of a symmetric or Hermitian (conjugate symmetric) array. eigvals : eigenvalues of a non-symmetric array. Notes ----- This is a simple interface to the LAPACK routines dgeev and zgeev which compute the eigenvalues and eigenvectors of, respectively, general real- and complex-valued square arrays. The number `w` is an eigenvalue of `a` if there exists a vector `v` such that ``dot(a,v) = w * v``. Thus, the arrays `a`, `w`, and `v` satisfy the equations ``dot(a[i,:], v[i]) = w[i] * v[:,i]`` for :math:`i \\in \\{0,...,M-1\\}`. The array `v` of eigenvectors may not be of maximum rank, that is, some of the columns may be linearly dependent, although round-off error may obscure that fact. If the eigenvalues are all different, then theoretically the eigenvectors are linearly independent. Likewise, the (complex-valued) matrix of eigenvectors `v` is unitary if the matrix `a` is normal, i.e., if ``dot(a, a.H) = dot(a.H, a)``, where `a.H` denotes the conjugate transpose of `a`. Finally, it is emphasized that `v` consists of the *right* (as in right-hand side) eigenvectors of `a`. A vector `y` satisfying ``dot(y.T, a) = z * y.T`` for some number `z` is called a *left* eigenvector of `a`, and, in general, the left and right eigenvectors of a matrix are not necessarily the (perhaps conjugate) transposes of each other. References ---------- G. Strang, *Linear Algebra and Its Applications*, 2nd Ed., Orlando, FL, Academic Press, Inc., 1980, Various pp. Examples -------- >>> from numpy import linalg as LA (Almost) trivial example with real e-values and e-vectors. >>> w, v = LA.eig(np.diag((1, 2, 3))) >>> w; v array([ 1., 2., 3.]) array([[ 1., 0., 0.], [ 0., 1., 0.], [ 0., 0., 1.]]) Real matrix possessing complex e-values and e-vectors; note that the e-values are complex conjugates of each other. >>> w, v = LA.eig(np.array([[1, -1], [1, 1]])) >>> w; v array([ 1. + 1.j, 1. - 1.j]) array([[ 0.70710678+0.j , 0.70710678+0.j ], [ 0.00000000-0.70710678j, 0.00000000+0.70710678j]]) Complex-valued matrix with real e-values (but complex-valued e-vectors); note that a.conj().T = a, i.e., a is Hermitian. >>> a = np.array([[1, 1j], [-1j, 1]]) >>> w, v = LA.eig(a) >>> w; v array([ 2.00000000e+00+0.j, 5.98651912e-36+0.j]) # i.e., {2, 0} array([[ 0.00000000+0.70710678j, 0.70710678+0.j ], [ 0.70710678+0.j , 0.00000000+0.70710678j]]) Be careful about round-off error! >>> a = np.array([[1 + 1e-9, 0], [0, 1 - 1e-9]]) >>> # Theor. e-values are 1 +/- 1e-9 >>> w, v = LA.eig(a) >>> w; v array([ 1., 1.]) array([[ 1., 0.], [ 0., 1.]]) """ a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) _assertFinite(a) a, t, result_t = _convertarray(a) # convert to double or cdouble type a = _to_native_byte_order(a) real_t = _linalgRealType(t) n = a.shape[0] dummy = zeros((1,), t) if isComplexType(t): # Complex routines take different arguments lapack_routine = lapack_lite.zgeev w = zeros((n,), t) v = zeros((n, n), t) lwork = 1 work = zeros((lwork,), t) rwork = zeros((2*n,), real_t) results = lapack_routine(_N, _V, n, a, n, w, dummy, 1, v, n, work, -1, rwork, 0) lwork = int(abs(work[0])) work = zeros((lwork,), t) results = lapack_routine(_N, _V, n, a, n, w, dummy, 1, v, n, work, lwork, rwork, 0) else: lapack_routine = lapack_lite.dgeev wr = zeros((n,), t) wi = zeros((n,), t) vr = zeros((n, n), t) lwork = 1 work = zeros((lwork,), t) results = lapack_routine(_N, _V, n, a, n, wr, wi, dummy, 1, vr, n, work, -1, 0) lwork = int(work[0]) work = zeros((lwork,), t) results = lapack_routine(_N, _V, n, a, n, wr, wi, dummy, 1, vr, n, work, lwork, 0) if all(wi == 0.0): w = wr v = vr result_t = _realType(result_t) else: w = wr+1j*wi v = array(vr, w.dtype) ind = flatnonzero(wi != 0.0) # indices of complex e-vals for i in range(len(ind)//2): v[ind[2*i]] = vr[ind[2*i]] + 1j*vr[ind[2*i+1]] v[ind[2*i+1]] = vr[ind[2*i]] - 1j*vr[ind[2*i+1]] result_t = _complexType(result_t) if results['info'] > 0: raise LinAlgError('Eigenvalues did not converge') vt = v.transpose().astype(result_t) return w.astype(result_t), wrap(vt) def eigh(a, UPLO='L'): """ Return the eigenvalues and eigenvectors of a Hermitian or symmetric matrix. Returns two objects, a 1-D array containing the eigenvalues of `a`, and a 2-D square array or matrix (depending on the input type) of the corresponding eigenvectors (in columns). Parameters ---------- a : array_like, shape (M, M) A complex Hermitian or real symmetric matrix. UPLO : {'L', 'U'}, optional Specifies whether the calculation is done with the lower triangular part of `a` ('L', default) or the upper triangular part ('U'). Returns ------- w : ndarray, shape (M,) The eigenvalues, not necessarily ordered. v : ndarray, or matrix object if `a` is, shape (M, M) The column ``v[:, i]`` is the normalized eigenvector corresponding to the eigenvalue ``w[i]``. Raises ------ LinAlgError If the eigenvalue computation does not converge. See Also -------- eigvalsh : eigenvalues of symmetric or Hermitian arrays. eig : eigenvalues and right eigenvectors for non-symmetric arrays. eigvals : eigenvalues of non-symmetric arrays. Notes ----- This is a simple interface to the LAPACK routines dsyevd and zheevd, which compute the eigenvalues and eigenvectors of real symmetric and complex Hermitian arrays, respectively. The eigenvalues of real symmetric or complex Hermitian matrices are always real. [1]_ The array `v` of (column) eigenvectors is unitary and `a`, `w`, and `v` satisfy the equations ``dot(a, v[:, i]) = w[i] * v[:, i]``. References ---------- .. [1] G. Strang, *Linear Algebra and Its Applications*, 2nd Ed., Orlando, FL, Academic Press, Inc., 1980, pg. 222. Examples -------- >>> from numpy import linalg as LA >>> a = np.array([[1, -2j], [2j, 5]]) >>> a array([[ 1.+0.j, 0.-2.j], [ 0.+2.j, 5.+0.j]]) >>> w, v = LA.eigh(a) >>> w; v array([ 0.17157288, 5.82842712]) array([[-0.92387953+0.j , -0.38268343+0.j ], [ 0.00000000+0.38268343j, 0.00000000-0.92387953j]]) >>> np.dot(a, v[:, 0]) - w[0] * v[:, 0] # verify 1st e-val/vec pair array([2.77555756e-17 + 0.j, 0. + 1.38777878e-16j]) >>> np.dot(a, v[:, 1]) - w[1] * v[:, 1] # verify 2nd e-val/vec pair array([ 0.+0.j, 0.+0.j]) >>> A = np.matrix(a) # what happens if input is a matrix object >>> A matrix([[ 1.+0.j, 0.-2.j], [ 0.+2.j, 5.+0.j]]) >>> w, v = LA.eigh(A) >>> w; v array([ 0.17157288, 5.82842712]) matrix([[-0.92387953+0.j , -0.38268343+0.j ], [ 0.00000000+0.38268343j, 0.00000000-0.92387953j]]) """ UPLO = asbytes(UPLO) a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) t, result_t = _commonType(a) real_t = _linalgRealType(t) a = _fastCopyAndTranspose(t, a) a = _to_native_byte_order(a) n = a.shape[0] liwork = 5*n+3 iwork = zeros((liwork,), fortran_int) if isComplexType(t): lapack_routine = lapack_lite.zheevd w = zeros((n,), real_t) lwork = 1 work = zeros((lwork,), t) lrwork = 1 rwork = zeros((lrwork,), real_t) results = lapack_routine(_V, UPLO, n, a, n, w, work, -1, rwork, -1, iwork, liwork, 0) lwork = int(abs(work[0])) work = zeros((lwork,), t) lrwork = int(rwork[0]) rwork = zeros((lrwork,), real_t) results = lapack_routine(_V, UPLO, n, a, n, w, work, lwork, rwork, lrwork, iwork, liwork, 0) else: lapack_routine = lapack_lite.dsyevd w = zeros((n,), t) lwork = 1 work = zeros((lwork,), t) results = lapack_routine(_V, UPLO, n, a, n, w, work, -1, iwork, liwork, 0) lwork = int(work[0]) work = zeros((lwork,), t) results = lapack_routine(_V, UPLO, n, a, n, w, work, lwork, iwork, liwork, 0) if results['info'] > 0: raise LinAlgError('Eigenvalues did not converge') at = a.transpose().astype(result_t) return w.astype(_realType(result_t)), wrap(at) # Singular value decomposition def svd(a, full_matrices=1, compute_uv=1): """ Singular Value Decomposition. Factors the matrix `a` as ``u * np.diag(s) * v``, where `u` and `v` are unitary and `s` is a 1-d array of `a`'s singular values. Parameters ---------- a : array_like A real or complex matrix of shape (`M`, `N`) . full_matrices : bool, optional If True (default), `u` and `v` have the shapes (`M`, `M`) and (`N`, `N`), respectively. Otherwise, the shapes are (`M`, `K`) and (`K`, `N`), respectively, where `K` = min(`M`, `N`). compute_uv : bool, optional Whether or not to compute `u` and `v` in addition to `s`. True by default. Returns ------- u : ndarray Unitary matrix. The shape of `u` is (`M`, `M`) or (`M`, `K`) depending on value of ``full_matrices``. s : ndarray The singular values, sorted so that ``s[i] >= s[i+1]``. `s` is a 1-d array of length min(`M`, `N`). v : ndarray Unitary matrix of shape (`N`, `N`) or (`K`, `N`), depending on ``full_matrices``. Raises ------ LinAlgError If SVD computation does not converge. Notes ----- The SVD is commonly written as ``a = U S V.H``. The `v` returned by this function is ``V.H`` and ``u = U``. If ``U`` is a unitary matrix, it means that it satisfies ``U.H = inv(U)``. The rows of `v` are the eigenvectors of ``a.H a``. The columns of `u` are the eigenvectors of ``a a.H``. For row ``i`` in `v` and column ``i`` in `u`, the corresponding eigenvalue is ``s[i]**2``. If `a` is a `matrix` object (as opposed to an `ndarray`), then so are all the return values. Examples -------- >>> a = np.random.randn(9, 6) + 1j*np.random.randn(9, 6) Reconstruction based on full SVD: >>> U, s, V = np.linalg.svd(a, full_matrices=True) >>> U.shape, V.shape, s.shape ((9, 6), (6, 6), (6,)) >>> S = np.zeros((9, 6), dtype=complex) >>> S[:6, :6] = np.diag(s) >>> np.allclose(a, np.dot(U, np.dot(S, V))) True Reconstruction based on reduced SVD: >>> U, s, V = np.linalg.svd(a, full_matrices=False) >>> U.shape, V.shape, s.shape ((9, 6), (6, 6), (6,)) >>> S = np.diag(s) >>> np.allclose(a, np.dot(U, np.dot(S, V))) True """ a, wrap = _makearray(a) _assertRank2(a) _assertNonEmpty(a) m, n = a.shape t, result_t = _commonType(a) real_t = _linalgRealType(t) a = _fastCopyAndTranspose(t, a) a = _to_native_byte_order(a) s = zeros((min(n, m),), real_t) if compute_uv: if full_matrices: nu = m nvt = n option = _A else: nu = min(n, m) nvt = min(n, m) option = _S u = zeros((nu, m), t) vt = zeros((n, nvt), t) else: option = _N nu = 1 nvt = 1 u = empty((1, 1), t) vt = empty((1, 1), t) iwork = zeros((8*min(m, n),), fortran_int) if isComplexType(t): lapack_routine = lapack_lite.zgesdd lrwork = min(m,n)*max(5*min(m,n)+7, 2*max(m,n)+2*min(m,n)+1) rwork = zeros((lrwork,), real_t) lwork = 1 work = zeros((lwork,), t) results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt, work, -1, rwork, iwork, 0) lwork = int(abs(work[0])) work = zeros((lwork,), t) results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt, work, lwork, rwork, iwork, 0) else: lapack_routine = lapack_lite.dgesdd lwork = 1 work = zeros((lwork,), t) results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt, work, -1, iwork, 0) lwork = int(work[0]) work = zeros((lwork,), t) results = lapack_routine(option, m, n, a, m, s, u, m, vt, nvt, work, lwork, iwork, 0) if results['info'] > 0: raise LinAlgError('SVD did not converge') s = s.astype(_realType(result_t)) if compute_uv: u = u.transpose().astype(result_t) vt = vt.transpose().astype(result_t) return wrap(u), s, wrap(vt) else: return s def cond(x, p=None): """ Compute the condition number of a matrix. This function is capable of returning the condition number using one of seven different norms, depending on the value of `p` (see Parameters below). Parameters ---------- x : array_like, shape (M, N) The matrix whose condition number is sought. p : {None, 1, -1, 2, -2, inf, -inf, 'fro'}, optional Order of the norm: ===== ============================ p norm for matrices ===== ============================ None 2-norm, computed directly using the ``SVD`` 'fro' Frobenius norm inf max(sum(abs(x), axis=1)) -inf min(sum(abs(x), axis=1)) 1 max(sum(abs(x), axis=0)) -1 min(sum(abs(x), axis=0)) 2 2-norm (largest sing. value) -2 smallest singular value ===== ============================ inf means the numpy.inf object, and the Frobenius norm is the root-of-sum-of-squares norm. Returns ------- c : {float, inf} The condition number of the matrix. May be infinite. See Also -------- numpy.linalg.norm Notes ----- The condition number of `x` is defined as the norm of `x` times the norm of the inverse of `x` [1]_; the norm can be the usual L2-norm (root-of-sum-of-squares) or one of a number of other matrix norms. References ---------- .. [1] G. Strang, *Linear Algebra and Its Applications*, Orlando, FL, Academic Press, Inc., 1980, pg. 285. Examples -------- >>> from numpy import linalg as LA >>> a = np.array([[1, 0, -1], [0, 1, 0], [1, 0, 1]]) >>> a array([[ 1, 0, -1], [ 0, 1, 0], [ 1, 0, 1]]) >>> LA.cond(a) 1.4142135623730951 >>> LA.cond(a, 'fro') 3.1622776601683795 >>> LA.cond(a, np.inf) 2.0 >>> LA.cond(a, -np.inf) 1.0 >>> LA.cond(a, 1) 2.0 >>> LA.cond(a, -1) 1.0 >>> LA.cond(a, 2) 1.4142135623730951 >>> LA.cond(a, -2) 0.70710678118654746 >>> min(LA.svd(a, compute_uv=0))*min(LA.svd(LA.inv(a), compute_uv=0)) 0.70710678118654746 """ x = asarray(x) # in case we have a matrix if p is None: s = svd(x,compute_uv=False) return s[0]/s[-1] else: return norm(x,p)*norm(inv(x),p) def matrix_rank(M, tol=None): """ Return matrix rank of array using SVD method Rank of the array is the number of SVD singular values of the array that are greater than `tol`. Parameters ---------- M : array_like array of <=2 dimensions tol : {None, float} threshold below which SVD values are considered zero. If `tol` is None, and ``S`` is an array with singular values for `M`, and ``eps`` is the epsilon value for datatype of ``S``, then `tol` is set to ``S.max() * eps``. Notes ----- Golub and van Loan [1]_ define "numerical rank deficiency" as using tol=eps*S[0] (where S[0] is the maximum singular value and thus the 2-norm of the matrix). This is one definition of rank deficiency, and the one we use here. When floating point roundoff is the main concern, then "numerical rank deficiency" is a reasonable choice. In some cases you may prefer other definitions. The most useful measure of the tolerance depends on the operations you intend to use on your matrix. For example, if your data come from uncertain measurements with uncertainties greater than floating point epsilon, choosing a tolerance near that uncertainty may be preferable. The tolerance may be absolute if the uncertainties are absolute rather than relative. References ---------- .. [1] G. H. Golub and C. F. Van Loan, *Matrix Computations*. Baltimore: Johns Hopkins University Press, 1996. Examples -------- >>> matrix_rank(np.eye(4)) # Full rank matrix 4 >>> I=np.eye(4); I[-1,-1] = 0. # rank deficient matrix >>> matrix_rank(I) 3 >>> matrix_rank(np.ones((4,))) # 1 dimension - rank 1 unless all 0 1 >>> matrix_rank(np.zeros((4,))) 0 """ M = asarray(M) if M.ndim > 2: raise TypeError('array should have 2 or fewer dimensions') if M.ndim < 2: return int(not all(M==0)) S = svd(M, compute_uv=False) if tol is None: tol = S.max() * finfo(S.dtype).eps return sum(S > tol) # Generalized inverse def pinv(a, rcond=1e-15 ): """ Compute the (Moore-Penrose) pseudo-inverse of a matrix. Calculate the generalized inverse of a matrix using its singular-value decomposition (SVD) and including all *large* singular values. Parameters ---------- a : array_like, shape (M, N) Matrix to be pseudo-inverted. rcond : float Cutoff for small singular values. Singular values smaller (in modulus) than `rcond` * largest_singular_value (again, in modulus) are set to zero. Returns ------- B : ndarray, shape (N, M) The pseudo-inverse of `a`. If `a` is a `matrix` instance, then so is `B`. Raises ------ LinAlgError If the SVD computation does not converge. Notes ----- The pseudo-inverse of a matrix A, denoted :math:`A^+`, is defined as: "the matrix that 'solves' [the least-squares problem] :math:`Ax = b`," i.e., if :math:`\\bar{x}` is said solution, then :math:`A^+` is that matrix such that :math:`\\bar{x} = A^+b`. It can be shown that if :math:`Q_1 \\Sigma Q_2^T = A` is the singular value decomposition of A, then :math:`A^+ = Q_2 \\Sigma^+ Q_1^T`, where :math:`Q_{1,2}` are orthogonal matrices, :math:`\\Sigma` is a diagonal matrix consisting of A's so-called singular values, (followed, typically, by zeros), and then :math:`\\Sigma^+` is simply the diagonal matrix consisting of the reciprocals of A's singular values (again, followed by zeros). [1]_ References ---------- .. [1] G. Strang, *Linear Algebra and Its Applications*, 2nd Ed., Orlando, FL, Academic Press, Inc., 1980, pp. 139-142. Examples -------- The following example checks that ``a * a+ * a == a`` and ``a+ * a * a+ == a+``: >>> a = np.random.randn(9, 6) >>> B = np.linalg.pinv(a) >>> np.allclose(a, np.dot(a, np.dot(B, a))) True >>> np.allclose(B, np.dot(B, np.dot(a, B))) True """ a, wrap = _makearray(a) _assertNonEmpty(a) a = a.conjugate() u, s, vt = svd(a, 0) m = u.shape[0] n = vt.shape[1] cutoff = rcond*maximum.reduce(s) for i in range(min(n, m)): if s[i] > cutoff: s[i] = 1./s[i] else: s[i] = 0.; res = dot(transpose(vt), multiply(s[:, newaxis],transpose(u))) return wrap(res) # Determinant def slogdet(a): """ Compute the sign and (natural) logarithm of the determinant of an array. If an array has a very small or very large determinant, than a call to `det` may overflow or underflow. This routine is more robust against such issues, because it computes the logarithm of the determinant rather than the determinant itself. Parameters ---------- a : array_like Input array, has to be a square 2-D array. Returns ------- sign : float or complex A number representing the sign of the determinant. For a real matrix, this is 1, 0, or -1. For a complex matrix, this is a complex number with absolute value 1 (i.e., it is on the unit circle), or else 0. logdet : float The natural log of the absolute value of the determinant. If the determinant is zero, then `sign` will be 0 and `logdet` will be -Inf. In all cases, the determinant is equal to ``sign * np.exp(logdet)``. See Also -------- det Notes ----- The determinant is computed via LU factorization using the LAPACK routine z/dgetrf. .. versionadded:: 1.6.0. Examples -------- The determinant of a 2-D array ``[[a, b], [c, d]]`` is ``ad - bc``: >>> a = np.array([[1, 2], [3, 4]]) >>> (sign, logdet) = np.linalg.slogdet(a) >>> (sign, logdet) (-1, 0.69314718055994529) >>> sign * np.exp(logdet) -2.0 This routine succeeds where ordinary `det` does not: >>> np.linalg.det(np.eye(500) * 0.1) 0.0 >>> np.linalg.slogdet(np.eye(500) * 0.1) (1, -1151.2925464970228) """ a = asarray(a) _assertRank2(a) _assertSquareness(a) t, result_t = _commonType(a) a = _fastCopyAndTranspose(t, a) a = _to_native_byte_order(a) n = a.shape[0] if isComplexType(t): lapack_routine = lapack_lite.zgetrf else: lapack_routine = lapack_lite.dgetrf pivots = zeros((n,), fortran_int) results = lapack_routine(n, n, a, n, pivots, 0) info = results['info'] if (info < 0): raise TypeError("Illegal input to Fortran routine") elif (info > 0): return (t(0.0), _realType(t)(-Inf)) sign = 1. - 2. * (add.reduce(pivots != arange(1, n + 1)) % 2) d = diagonal(a) absd = absolute(d) sign *= multiply.reduce(d / absd) log(absd, absd) logdet = add.reduce(absd, axis=-1) return sign, logdet def det(a): """ Compute the determinant of an array. Parameters ---------- a : array_like, shape (M, M) Input array. Returns ------- det : ndarray Determinant of `a`. Notes ----- The determinant is computed via LU factorization using the LAPACK routine z/dgetrf. Examples -------- The determinant of a 2-D array [[a, b], [c, d]] is ad - bc: >>> a = np.array([[1, 2], [3, 4]]) >>> np.linalg.det(a) -2.0 See Also -------- slogdet : Another way to representing the determinant, more suitable for large matrices where underflow/overflow may occur. """ sign, logdet = slogdet(a) return sign * exp(logdet) # Linear Least Squares def lstsq(a, b, rcond=-1): """ Return the least-squares solution to a linear matrix equation. Solves the equation `a x = b` by computing a vector `x` that minimizes the Euclidean 2-norm `|| b - a x ||^2`. The equation may be under-, well-, or over- determined (i.e., the number of linearly independent rows of `a` can be less than, equal to, or greater than its number of linearly independent columns). If `a` is square and of full rank, then `x` (but for round-off error) is the "exact" solution of the equation. Parameters ---------- a : array_like, shape (M, N) "Coefficient" matrix. b : array_like, shape (M,) or (M, K) Ordinate or "dependent variable" values. If `b` is two-dimensional, the least-squares solution is calculated for each of the `K` columns of `b`. rcond : float, optional Cut-off ratio for small singular values of `a`. Singular values are set to zero if they are smaller than `rcond` times the largest singular value of `a`. Returns ------- x : ndarray, shape (N,) or (N, K) Least-squares solution. The shape of `x` depends on the shape of `b`. residues : ndarray, shape (), (1,), or (K,) Sums of residues; squared Euclidean 2-norm for each column in ``b - a*x``. If the rank of `a` is < N or > M, this is an empty array. If `b` is 1-dimensional, this is a (1,) shape array. Otherwise the shape is (K,). rank : int Rank of matrix `a`. s : ndarray, shape (min(M,N),) Singular values of `a`. Raises ------ LinAlgError If computation does not converge. Notes ----- If `b` is a matrix, then all array results are returned as matrices. Examples -------- Fit a line, ``y = mx + c``, through some noisy data-points: >>> x = np.array([0, 1, 2, 3]) >>> y = np.array([-1, 0.2, 0.9, 2.1]) By examining the coefficients, we see that the line should have a gradient of roughly 1 and cut the y-axis at, more or less, -1. We can rewrite the line equation as ``y = Ap``, where ``A = [[x 1]]`` and ``p = [[m], [c]]``. Now use `lstsq` to solve for `p`: >>> A = np.vstack([x, np.ones(len(x))]).T >>> A array([[ 0., 1.], [ 1., 1.], [ 2., 1.], [ 3., 1.]]) >>> m, c = np.linalg.lstsq(A, y)[0] >>> print m, c 1.0 -0.95 Plot the data along with the fitted line: >>> import matplotlib.pyplot as plt >>> plt.plot(x, y, 'o', label='Original data', markersize=10) >>> plt.plot(x, m*x + c, 'r', label='Fitted line') >>> plt.legend() >>> plt.show() """ import math a, _ = _makearray(a) b, wrap = _makearray(b) is_1d = len(b.shape) == 1 if is_1d: b = b[:, newaxis] _assertRank2(a, b) m = a.shape[0] n = a.shape[1] n_rhs = b.shape[1] ldb = max(n, m) if m != b.shape[0]: raise LinAlgError('Incompatible dimensions') t, result_t = _commonType(a, b) result_real_t = _realType(result_t) real_t = _linalgRealType(t) bstar = zeros((ldb, n_rhs), t) bstar[:b.shape[0],:n_rhs] = b.copy() a, bstar = _fastCopyAndTranspose(t, a, bstar) a, bstar = _to_native_byte_order(a, bstar) s = zeros((min(m, n),), real_t) nlvl = max( 0, int( math.log( float(min(m, n))/2. ) ) + 1 ) iwork = zeros((3*min(m, n)*nlvl+11*min(m, n),), fortran_int) if isComplexType(t): lapack_routine = lapack_lite.zgelsd lwork = 1 rwork = zeros((lwork,), real_t) work = zeros((lwork,), t) results = lapack_routine(m, n, n_rhs, a, m, bstar, ldb, s, rcond, 0, work, -1, rwork, iwork, 0) lwork = int(abs(work[0])) rwork = zeros((lwork,), real_t) a_real = zeros((m, n), real_t) bstar_real = zeros((ldb, n_rhs,), real_t) results = lapack_lite.dgelsd(m, n, n_rhs, a_real, m, bstar_real, ldb, s, rcond, 0, rwork, -1, iwork, 0) lrwork = int(rwork[0]) work = zeros((lwork,), t) rwork = zeros((lrwork,), real_t) results = lapack_routine(m, n, n_rhs, a, m, bstar, ldb, s, rcond, 0, work, lwork, rwork, iwork, 0) else: lapack_routine = lapack_lite.dgelsd lwork = 1 work = zeros((lwork,), t) results = lapack_routine(m, n, n_rhs, a, m, bstar, ldb, s, rcond, 0, work, -1, iwork, 0) lwork = int(work[0]) work = zeros((lwork,), t) results = lapack_routine(m, n, n_rhs, a, m, bstar, ldb, s, rcond, 0, work, lwork, iwork, 0) if results['info'] > 0: raise LinAlgError('SVD did not converge in Linear Least Squares') resids = array([], result_real_t) if is_1d: x = array(ravel(bstar)[:n], dtype=result_t, copy=True) if results['rank'] == n and m > n: if isComplexType(t): resids = array([sum(abs(ravel(bstar)[n:])**2)], dtype=result_real_t) else: resids = array([sum((ravel(bstar)[n:])**2)], dtype=result_real_t) else: x = array(transpose(bstar)[:n,:], dtype=result_t, copy=True) if results['rank'] == n and m > n: if isComplexType(t): resids = sum(abs(transpose(bstar)[n:,:])**2, axis=0).astype( result_real_t) else: resids = sum((transpose(bstar)[n:,:])**2, axis=0).astype( result_real_t) st = s[:min(n, m)].copy().astype(result_real_t) return wrap(x), wrap(resids), results['rank'], st def norm(x, ord=None): """ Matrix or vector norm. This function is able to return one of seven different matrix norms, or one of an infinite number of vector norms (described below), depending on the value of the ``ord`` parameter. Parameters ---------- x : array_like, shape (M,) or (M, N) Input array. ord : {non-zero int, inf, -inf, 'fro'}, optional Order of the norm (see table under ``Notes``). inf means numpy's `inf` object. Returns ------- n : float Norm of the matrix or vector. Notes ----- For values of ``ord <= 0``, the result is, strictly speaking, not a mathematical 'norm', but it may still be useful for various numerical purposes. The following norms can be calculated: ===== ============================ ========================== ord norm for matrices norm for vectors ===== ============================ ========================== None Frobenius norm 2-norm 'fro' Frobenius norm -- inf max(sum(abs(x), axis=1)) max(abs(x)) -inf min(sum(abs(x), axis=1)) min(abs(x)) 0 -- sum(x != 0) 1 max(sum(abs(x), axis=0)) as below -1 min(sum(abs(x), axis=0)) as below 2 2-norm (largest sing. value) as below -2 smallest singular value as below other -- sum(abs(x)**ord)**(1./ord) ===== ============================ ========================== The Frobenius norm is given by [1]_: :math:`||A||_F = [\\sum_{i,j} abs(a_{i,j})^2]^{1/2}` References ---------- .. [1] G. H. Golub and C. F. Van Loan, *Matrix Computations*, Baltimore, MD, Johns Hopkins University Press, 1985, pg. 15 Examples -------- >>> from numpy import linalg as LA >>> a = np.arange(9) - 4 >>> a array([-4, -3, -2, -1, 0, 1, 2, 3, 4]) >>> b = a.reshape((3, 3)) >>> b array([[-4, -3, -2], [-1, 0, 1], [ 2, 3, 4]]) >>> LA.norm(a) 7.745966692414834 >>> LA.norm(b) 7.745966692414834 >>> LA.norm(b, 'fro') 7.745966692414834 >>> LA.norm(a, np.inf) 4 >>> LA.norm(b, np.inf) 9 >>> LA.norm(a, -np.inf) 0 >>> LA.norm(b, -np.inf) 2 >>> LA.norm(a, 1) 20 >>> LA.norm(b, 1) 7 >>> LA.norm(a, -1) -4.6566128774142013e-010 >>> LA.norm(b, -1) 6 >>> LA.norm(a, 2) 7.745966692414834 >>> LA.norm(b, 2) 7.3484692283495345 >>> LA.norm(a, -2) nan >>> LA.norm(b, -2) 1.8570331885190563e-016 >>> LA.norm(a, 3) 5.8480354764257312 >>> LA.norm(a, -3) nan """ x = asarray(x) if ord is None: # check the default case first and handle it immediately return sqrt(add.reduce((x.conj() * x).ravel().real)) nd = x.ndim if nd == 1: if ord == Inf: return abs(x).max() elif ord == -Inf: return abs(x).min() elif ord == 0: return (x != 0).sum() # Zero norm elif ord == 1: return abs(x).sum() # special case for speedup elif ord == 2: return sqrt(((x.conj()*x).real).sum()) # special case for speedup else: try: ord + 1 except TypeError: raise ValueError("Invalid norm order for vectors.") return ((abs(x)**ord).sum())**(1.0/ord) elif nd == 2: if ord == 2: return svd(x, compute_uv=0).max() elif ord == -2: return svd(x, compute_uv=0).min() elif ord == 1: return abs(x).sum(axis=0).max() elif ord == Inf: return abs(x).sum(axis=1).max() elif ord == -1: return abs(x).sum(axis=0).min() elif ord == -Inf: return abs(x).sum(axis=1).min() elif ord in ['fro','f']: return sqrt(add.reduce((x.conj() * x).real.ravel())) else: raise ValueError("Invalid norm order for matrices.") else: raise ValueError("Improper number of dimensions to norm.")
{ "content_hash": "2ff44567a32c6fec11563db1452b6ce4", "timestamp": "", "source": "github", "line_count": 1984, "max_line_length": 79, "avg_line_length": 30.840725806451612, "alnum_prop": 0.5462672419428646, "repo_name": "stefanv/numpy", "id": "4aaf260f8c4bd7439a6747f953fb806e272da01f", "size": "61188", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "numpy/linalg/linalg.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "6184633" }, { "name": "C++", "bytes": "297087" }, { "name": "CSS", "bytes": "8887" }, { "name": "Fortran", "bytes": "14157" }, { "name": "Objective-C", "bytes": "135" }, { "name": "Perl", "bytes": "458" }, { "name": "Python", "bytes": "5338917" }, { "name": "Shell", "bytes": "3545" } ], "symlink_target": "" }
#include "video_engine/vie_channel_group.h" #include "modules/bitrate_controller/include/bitrate_controller.h" #include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" #include "modules/rtp_rtcp/interface/rtp_rtcp.h" #include "modules/utility/interface/process_thread.h" #include "video_engine/call_stats.h" #include "video_engine/encoder_state_feedback.h" #include "video_engine/vie_channel.h" #include "video_engine/vie_encoder.h" #include "video_engine/vie_remb.h" namespace webrtc { ChannelGroup::ChannelGroup(ProcessThread* process_thread, const OverUseDetectorOptions& options, RemoteBitrateEstimator::EstimationMode mode) : remb_(new VieRemb()), bitrate_controller_(BitrateController::CreateBitrateController()), call_stats_(new CallStats()), remote_bitrate_estimator_(RemoteBitrateEstimator::Create( options, mode, remb_.get(), Clock::GetRealTimeClock())), encoder_state_feedback_(new EncoderStateFeedback()), process_thread_(process_thread) { call_stats_->RegisterStatsObserver(remote_bitrate_estimator_.get()); process_thread->RegisterModule(call_stats_.get()); process_thread->RegisterModule(remote_bitrate_estimator_.get()); } ChannelGroup::~ChannelGroup() { call_stats_->DeregisterStatsObserver(remote_bitrate_estimator_.get()); process_thread_->DeRegisterModule(call_stats_.get()); process_thread_->DeRegisterModule(remote_bitrate_estimator_.get()); assert(channels_.empty()); assert(!remb_->InUse()); } void ChannelGroup::AddChannel(int channel_id) { channels_.insert(channel_id); } void ChannelGroup::RemoveChannel(int channel_id, unsigned int ssrc) { channels_.erase(channel_id); remote_bitrate_estimator_->RemoveStream(ssrc); } bool ChannelGroup::HasChannel(int channel_id) { return channels_.find(channel_id) != channels_.end(); } bool ChannelGroup::Empty() { return channels_.empty(); } BitrateController* ChannelGroup::GetBitrateController() { return bitrate_controller_.get(); } RemoteBitrateEstimator* ChannelGroup::GetRemoteBitrateEstimator() { return remote_bitrate_estimator_.get(); } CallStats* ChannelGroup::GetCallStats() { return call_stats_.get(); } EncoderStateFeedback* ChannelGroup::GetEncoderStateFeedback() { return encoder_state_feedback_.get(); } bool ChannelGroup::SetChannelRembStatus(int channel_id, bool sender, bool receiver, ViEChannel* channel, ViEEncoder* encoder) { // Update the channel state. if (sender || receiver) { if (!channel->EnableRemb(true)) { return false; } } else if (channel) { channel->EnableRemb(false); } // Update the REMB instance with necessary RTP modules. RtpRtcp* rtp_module = channel->rtp_rtcp(); if (sender) { remb_->AddRembSender(rtp_module); } else { remb_->RemoveRembSender(rtp_module); } if (receiver) { remb_->AddReceiveChannel(rtp_module); } else { remb_->RemoveReceiveChannel(rtp_module); } return true; } } // namespace webrtc
{ "content_hash": "de1979ec7dbe5acc5de1f6b378e50520", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 78, "avg_line_length": 31.98, "alnum_prop": 0.6816760475297061, "repo_name": "unisontech/webrtc-core", "id": "4fa060ffd91fe02080bdca88277fbdd7493b7b6e", "size": "3610", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "video_engine/vie_channel_group.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "126639" }, { "name": "C", "bytes": "4616761" }, { "name": "C++", "bytes": "12234671" }, { "name": "Java", "bytes": "171956" }, { "name": "Matlab", "bytes": "78880" }, { "name": "Objective-C", "bytes": "151085" }, { "name": "Python", "bytes": "44762" }, { "name": "Shell", "bytes": "893" } ], "symlink_target": "" }
<!-- ROW --> <div class="index"> <div class="row-fluid"> <div class="span9"> <img data-original="/images/jdll/2a.jpg" class="imglazy s1 img-rounded"/> </div> <div class="span3 main-text"> <h4>Jardines de la Luz</h4> <p class="lead">El amor a las plantas y la curiosidad por los juegos que la luz produce sobre las hojas, las rocas y el agua son la base de todas mis creaciones. Los Jardines de la Luz son un conjunto de proyectos de jardiner&iacute;a en los que di&aacute;logo con la luz y expreso lo que para m&iacute; representa. </p> </div> </div> <br/> <div class="row-fluid"> <div class="span4"> <img data-original="/images/jdll/3a.jpg" class="imglazy s2 img-rounded"/> </div> <div class="span4"> <img data-original="/images/jdll/4a.jpg" class="imglazy s2 img-rounded"/> </div> <div class="span4"> <a href="/bio"> <img data-original="/images/jdll/geni.jpg" class="imglazy s2 img-rounded"/></a> </div> </div> <!-- ROW --> <div class="row-fluid"> <div class="span8 "> <br/> <p class="handwriting">Jard&iacute;n de transparencias, jard&iacute;n de contrastes, del contraste de los contraluces y los juegos de colores. La fina trama vegetal filtra la luz haci&eacute;ndola jugar de hoja en hoja, generando destellos y reflejos.</p> </div> <div class="span4 biosection"> <h4><a href="/bio">Eugenio Gonzalez Merino</a></h4> <p><a href="/bio">Dise&ntilde;ador de Jardines.</a></p> </div> </div> <br/> <br/> <!-- ROW --> <div class="row-fluid"> <div class="span6"> <img data-original="/images/jdll/6a.jpg" class="imglazy s3 img-rounded"/> </div> <div class="span6"> <br/><br/><br/> <p class="handwriting">Armon&iacute;a de luz, fogonazo de luz, cascada de intensidad luminosa que descansa a ras del suelo, despu&eacute;s de recrear en el aire las explosiones producidas al chocar las hojas con la luz creadora, venida del m&aacute;s all&aacute; .</p> </div> </div> <br/> <!-- ROW --> <div class="row-fluid"> <div class="span6"> <br/><br/><br/><br/><br/><br/> <p class="handwriting">Ni un &aacute;pice de luz debe dejarse escapar a la mortal e in&uacute;til absorci&oacute;n del suelo.</p> </div> <div class="span6"> <img data-original="/images/jdll/5a.jpg" class="imglazy s3 img-rounded"/> </div> </div> <br/> <!-- ROW --> <div class="row-fluid"> <div class="span4"> <img data-original="/images/jdll/8a.jpg" class="imglazy s2 img-rounded"/> </div> <div class="span4"> <img data-original="/images/jdll/7a.jpg" class="imglazy s2 img-rounded"/> </div> <div class="span4"> <img data-original="/images/jdll/9a.jpg" class="imglazy s2 img-rounded"/> </div> </div> <div class="row-fluid"> <div class="span12"> <br/><br/><br/><br/><br/> <p class="handwriting">Toda la energ&iacute;a a disposici&oacute;n de nuestros ojos, ocultos en la tranquilidad de la sombra, para dejarnos embriagar por los sentidos, para cegarnos y hacernos sentir en otro mundo, pero de un lugar cercano.</p> <br/><br/><br/><br/> </div> </div> <div class="row-fluid"> <div class="span4"> <img data-original="/images/jdll/10.jpg" class="imglazy s2 img-rounded"/> </div> <div class="span4"> <img data-original="/images/jdll/11.jpg" class="imglazy s2 img-rounded"/> </div> <div class="span4"> <img data-original="/images/jdll/12.jpg" class="imglazy s2 img-rounded"/> </div> </div> <br/> <br/> <br/> <br/><br/> <br/> <div class="row-fluid"> <div class="span5"> <p class="handwriting">Tenemos miedo de salir de este embrujo, de pasar a la vulgaridad, a lo corriente, de dejar escapar la armon&iacute;a, pero podemos seguir creando, imaginando, disfrutando de los oasis de paz, llen&aacute;ndonos de emociones y sensaciones. Esto ser&aacute; "La Belleza", la belleza de mi jard&iacute;n y a su conocimiento y estudio, pondr&eacute; a disposici&oacute;n de las personas sensibles la recreaci&oacute;n de mis mundos y de mi alegr&iacute;a profunda.</p> </div> <div class="span7"> <img data-original="/images/jdll/13.jpg" class="imglazy s3 img-rounded"/> </div> </div> <br/><br/><br/><br/> </div>
{ "content_hash": "259d6051fb749292be150f3348cc8ed8", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 126, "avg_line_length": 35.38028169014085, "alnum_prop": 0.5455812101910829, "repo_name": "igbopie/website-jardinesdelaluz", "id": "de37b35fda9b5dfc6a827ecd98f05f5ce19edf28", "size": "5024", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/views/home.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2616" }, { "name": "HTML", "bytes": "28620" }, { "name": "JavaScript", "bytes": "60411" } ], "symlink_target": "" }
@import SafariServices; // Storyboard identifiers (to enable programmatic storyboard instantiation) extern NSString *const kFoldersViewControllerIdentifier; // Segue identifiers (to enable programmatic triggering of segues) extern NSString *const kPushFoldersIdentifier; // Segue to be performed when app starts and user has previously logged in extern NSString *const kGoToInboxFolderAtStartupSegue; @interface POSFoldersViewController : SHCBaseTableViewController - (void)updateFolders; @property (strong, nonatomic) NSString *selectedMailBoxDigipostAdress; @property (strong, nonatomic) NSNumber *owner; @end
{ "content_hash": "2525bdaf988dd8f1a9b61e1b1266a0bc", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 75, "avg_line_length": 34.333333333333336, "alnum_prop": 0.8300970873786407, "repo_name": "digipost/ios", "id": "3aae4f9e671056a36f538edbf3cf739716479334", "size": "1306", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Digipost/POSFoldersViewController.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "2181" }, { "name": "CSS", "bytes": "216" }, { "name": "Objective-C", "bytes": "573540" }, { "name": "Ruby", "bytes": "1573" }, { "name": "Shell", "bytes": "771" }, { "name": "Swift", "bytes": "299129" } ], "symlink_target": "" }
<?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $method How to pass the update request data * @return UpdateMemberOptions Options builder */ public static function update($method = Values::NONE) { return new UpdateMemberOptions($method); } } class UpdateMemberOptions extends Options { /** * @param string $method How to pass the update request data */ public function __construct($method = Values::NONE) { $this->options['method'] = $method; } /** * How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. * * @param string $method How to pass the update request data * @return $this Fluent Builder */ public function setMethod($method) { $this->options['method'] = $method; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $options = array(); foreach ($this->options as $key => $value) { if ($value != Values::NONE) { $options[] = "$key=$value"; } } return '[Twilio.Api.V2010.UpdateMemberOptions ' . \implode(' ', $options) . ']'; } }
{ "content_hash": "1911b7665fcc575459896e0b678351e3", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 182, "avg_line_length": 27.25862068965517, "alnum_prop": 0.5762175838077166, "repo_name": "unaio/una", "id": "53a8b2d865a0792f38baf8c3627f44c28ee17e6b", "size": "1581", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "upgrade/files/12.1.0-13.0.0.A1/files/plugins/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberOptions.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "9522763" }, { "name": "Dockerfile", "bytes": "2367" }, { "name": "HTML", "bytes": "6194660" }, { "name": "JavaScript", "bytes": "24733694" }, { "name": "Less", "bytes": "3020615" }, { "name": "Makefile", "bytes": "1196" }, { "name": "PHP", "bytes": "158741504" }, { "name": "Ruby", "bytes": "210" }, { "name": "Shell", "bytes": "3327" }, { "name": "Smarty", "bytes": "3461" } ], "symlink_target": "" }
package diff.rednaga.blukit; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import diff.rednaga.superserial.R; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button b = (Button) findViewById(R.id.button1); b.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { BluSocket blu = new BluSocket(); if (blu.execute("sh /data/local/tmp/yay/shell.sh") == 0) { Log.v("blukit", "System commands executed"); } else { Log.e("blukit", "Error executing system commands"); } } }); } }
{ "content_hash": "5c11648de28be6f9cce0db31d9cba818", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 71, "avg_line_length": 28.757575757575758, "alnum_prop": 0.6269757639620653, "repo_name": "askk/adups-get-super-serial", "id": "f06cd13b71e5c85c8f2d1db6b4d54f829373e845", "size": "949", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "SuperSerial/src/diff/rednaga/blukit/MainActivity.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "7285" }, { "name": "Shell", "bytes": "1363" } ], "symlink_target": "" }
import * as chai from "chai"; import * as path from "path"; import * as indicators from "../../../src/indicators/"; import { TestDataFactory } from "../../testData"; const jsonfile = require("jsonfile"); chai.should(); describe("AROON Indicator", () => { let taResultFile: string; let sourceData: any; let taResultData: any; let indicator: indicators.AROON; let indicatorResults: Array<{ aroonUp: number, aroonDown: number }>; let indicatorOnDataRasied: boolean = false; const timePeriod = 14; beforeEach(() => { taResultFile = path.resolve("./test/talib-results/aroon.json"); sourceData = TestDataFactory.getInstance().sourceData; taResultData = jsonfile.readFileSync(taResultFile); indicatorResults = new Array<{ aroonUp: number, aroonDown: number }>(sourceData.close.length - taResultData.begIndex); }); describe("when constructing", () => { beforeEach(() => { indicator = new indicators.AROON(timePeriod); }); it("should set the indicator name", () => { indicator.name.should.equal(indicators.AROON.INDICATOR_NAME); }); it("should set the indicator description", () => { indicator.description.should.equal(indicators.AROON.INDICATOR_DESCR); }); it("should match the talib lookback", () => { taResultData.begIndex.should.equal(indicator.lookback); }); }); describe("when constructing with explicit non default arguments", () => { beforeEach(() => { indicator = new indicators.AROON(timePeriod + 1); }); it("should set the timePeriod", () => { indicator.timePeriod.should.equal(timePeriod + 1); }); }); describe("when constructing with default arguments", () => { beforeEach(() => { indicator = new indicators.AROON(); }); it("should set the timePeriod", () => { indicator.timePeriod.should.equal(indicators.AROON.TIMEPERIOD_DEFAULT); }); }); describe("when constructing with timePeriod less than the minimum", () => { let exception: Error; beforeEach(() => { try { indicator = new indicators.AROON(0); } catch (error) { exception = error; } }); it("should return a correctly formatted error", () => { const message = indicators.generateMinTimePeriodError(indicator.name, indicators.AROON.TIMEPERIOD_MIN, 0); exception.message.should.equal(message); }); }); describe("when receiving all tick data", () => { beforeEach(() => { indicator = new indicators.AROON(timePeriod); let idx = 0; sourceData.close.forEach((value: number, index: number) => { if (indicator.receiveData({ "high": sourceData.high[index], "low": sourceData.low[index], "open": sourceData.open[index], "close": sourceData.close[index], })) { indicatorResults[idx] = { "aroonUp": 0, "aroonDown": 0 }; indicatorResults[idx].aroonDown = indicator.aroonDown; indicatorResults[idx].aroonUp = indicator.aroonUp; idx++; } }); }); it("should match the talib aroonup results", () => { for (let i = 0; i < taResultData.result.outAroonUp.length; i++) { isNaN(indicatorResults[i].aroonUp).should.be.false; taResultData.result.outAroonUp[i].should.be.closeTo(indicatorResults[i].aroonUp, 0.001); } }); it("should match the talib aroondown results", () => { for (let i = 0; i < taResultData.result.outAroonDown.length; i++) { isNaN(indicatorResults[i].aroonDown).should.be.false; taResultData.result.outAroonDown[i].should.be.closeTo(indicatorResults[i].aroonDown, 0.001); } }); it("should match the talib lookback", () => { taResultData.begIndex.should.equal(indicator.lookback); }); }); describe("when receiving less tick data than the lookback period", () => { beforeEach(() => { indicator = new indicators.AROON(timePeriod); let idx = 0; indicatorOnDataRasied = false; indicator.on("data", () => { indicatorOnDataRasied = true; }); for (let index = 0; index < indicator.lookback; index++) { if (indicator.receiveData({ "high": sourceData.high[index], "low": sourceData.low[index], "open": sourceData.open[index], "close": sourceData.close[index], })) { indicatorResults[idx] = { "aroonUp": 0, "aroonDown": 0 }; indicatorResults[idx].aroonDown = indicator.aroonDown; indicatorResults[idx].aroonUp = indicator.aroonUp; idx++; } } }); it("the indicator should not indicate that it is ready to be consumed", () => { indicator.isReady.should.equal(false); }); it("should not have raised the ondata event", () => { indicatorOnDataRasied.should.equal(false); }); }); describe("when receiving tick data equal to the lookback period", () => { beforeEach(() => { indicator = new indicators.AROON(timePeriod); let idx = 0; indicatorOnDataRasied = false; indicator.on("data", () => { indicatorOnDataRasied = true; }); for (let index = 0; index <= indicator.lookback; index++) { if (indicator.receiveData({ "high": sourceData.high[index], "low": sourceData.low[index], "open": sourceData.open[index], "close": sourceData.close[index], })) { indicatorResults[idx] = { "aroonUp": 0, "aroonDown": 0 }; indicatorResults[idx].aroonDown = indicator.aroonDown; indicatorResults[idx].aroonUp = indicator.aroonUp; idx++; } } }); it("the indicator should indicate that it is ready to be consumed", () => { indicator.isReady.should.equal(true); }); it("should have raised the ondata event", () => { indicatorOnDataRasied.should.equal(true); }); }); });
{ "content_hash": "48b63f450bc51027f09109549033d754", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 126, "avg_line_length": 37.14207650273224, "alnum_prop": 0.5322936589671914, "repo_name": "thequantapprentice/quant-bench", "id": "d4364a979f71bb513b2155625eeb3519a3e044dc", "size": "6797", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/indicators/momentumindicators/aroon.spec.ts", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "739" }, { "name": "JavaScript", "bytes": "2402" }, { "name": "TypeScript", "bytes": "1220092" } ], "symlink_target": "" }
package vtk.web.decorating; import java.io.Reader; import java.io.StringReader; import java.io.StringWriter; import java.io.Writer; import java.util.Collection; import java.util.Map; import static org.junit.Assert.*; import org.jmock.Expectations; import org.jmock.Mockery; import org.jmock.integration.junit4.JUnit4Mockery; import org.junit.Test; public class DefaultTemplateParserTest { private static final String EMPTY_TEMPLATE = ""; private Mockery context = new JUnit4Mockery(); private final DecoratorRequest mockRequest = context.mock(DecoratorRequest.class); private final DecoratorResponse mockResponse = context.mock(DecoratorResponse.class); @Test public void empty() throws Exception { DollarSyntaxComponentParser parser = createParser(); Reader reader = new StringReader(EMPTY_TEMPLATE); ComponentInvocation[] parsedTemplate = parser.parse(reader); assertEquals(1, parsedTemplate.length); } private static final String SIMPLE_TEMPLATE_WITH_PARAMS = "<html>${namespace:name var1=[20] var2=[30]}</html>"; @Test public void simple() throws Exception { DollarSyntaxComponentParser parser = createParser(); Reader reader = new StringReader(SIMPLE_TEMPLATE_WITH_PARAMS); ComponentInvocation[] parsedTemplate = parser.parse(reader); assertEquals(3, parsedTemplate.length); String begin = renderComponent(parsedTemplate[0]); String end = renderComponent(parsedTemplate[2]); assertEquals("<html>", begin); assertEquals("</html>", end); ComponentInvocation c = parsedTemplate[1]; assertEquals("20", c.getParameters().get("var1")); assertEquals("30", c.getParameters().get("var2")); } private static final String MALFORMED_TEMPLATE = "<html>${namespace:name var1=[20}] var2=[30]]}</html>"; @Test public void malformed() throws Exception { DollarSyntaxComponentParser parser = createParser(); Reader reader = new StringReader(MALFORMED_TEMPLATE); ComponentInvocation[] parsedTemplate = parser.parse(reader); assertEquals(1, parsedTemplate.length); String result = renderComponent(parsedTemplate[0]); assertEquals(MALFORMED_TEMPLATE, result); } private static final String NESTED_DIRECTIVES = "${${component:ref}}"; @Test public void malformedNestedDirectives() throws Exception { DollarSyntaxComponentParser parser = createParser(); Reader reader = new StringReader(NESTED_DIRECTIVES); ComponentInvocation[] parsedTemplate = parser.parse(reader); assertEquals(3, parsedTemplate.length); String begin = renderComponent(parsedTemplate[0]); String end = renderComponent(parsedTemplate[2]); assertEquals("${", begin); assertEquals("}", end); } private static final String COMPLEX_TEMPLATE = "${<html>${namespace:name\nvar1 = [20] \r\nvar2=\r\n[30\\]] \rvar3=[400]}</html>}"; @Test public void testComplexTemplate() throws Exception { DollarSyntaxComponentParser parser = createParser(); Reader reader = new StringReader(COMPLEX_TEMPLATE); ComponentInvocation[] parsedTemplate = parser.parse(reader); assertEquals(3, parsedTemplate.length); ComponentInvocation c = parsedTemplate[1]; assertEquals("20", c.getParameters().get("var1")); assertEquals("30]", c.getParameters().get("var2")); assertEquals("400", c.getParameters().get("var3")); } private DollarSyntaxComponentParser createParser() { DollarSyntaxComponentParser parser = new DollarSyntaxComponentParser(); //parser.setComponentResolver(new DummyComponentResolver()); return parser; } private String renderComponent(ComponentInvocation inv) throws Exception { final Writer writer = new StringWriter(); context.checking(new Expectations() {{ oneOf(mockResponse).getWriter(); will(returnValue(writer)); }}); if (inv instanceof StaticTextFragment) { return ((StaticTextFragment) inv).buffer.toString(); } DecoratorComponent c = new DummyComponent(inv.getNamespace(), inv.getName()); c.render(mockRequest, mockResponse); return writer.toString(); } private class DummyComponent implements DecoratorComponent { private String namespace, name; public DummyComponent(String namespace, String name) { this.namespace = namespace; this.name = name; } @Override public String getNamespace() { return this.namespace; } @Override public String getName() { return this.name; } @Override public String getDescription() { return "Dummy component " + this.namespace + ":" + this.name; } @Override public Map<String, String> getParameterDescriptions() { return null; } @Override public Collection<UsageExample> getUsageExamples() { return null; } @Override public void render(DecoratorRequest request, DecoratorResponse response) throws Exception { response.getWriter().write("component: " + this.namespace + ":" + this.name); } } }
{ "content_hash": "c651d7ef74d0b4cf3f37cc2ba5899012", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 111, "avg_line_length": 34.1055900621118, "alnum_prop": 0.6510653797122564, "repo_name": "vtkio/vtk", "id": "5ebf61add35b322c561a596ea7a9ea58805792dc", "size": "7099", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/vtk/web/decorating/DefaultTemplateParserTest.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "44483" }, { "name": "AngelScript", "bytes": "2500" }, { "name": "CSS", "bytes": "465045" }, { "name": "ColdFusion", "bytes": "122452" }, { "name": "FreeMarker", "bytes": "586252" }, { "name": "GAP", "bytes": "7879" }, { "name": "Groovy", "bytes": "46265" }, { "name": "HTML", "bytes": "990738" }, { "name": "Java", "bytes": "8373918" }, { "name": "JavaScript", "bytes": "1573427" }, { "name": "Lasso", "bytes": "20160" }, { "name": "PHP", "bytes": "40605" }, { "name": "PLSQL", "bytes": "14143" }, { "name": "Perl", "bytes": "14524" }, { "name": "Perl 6", "bytes": "23211" }, { "name": "Python", "bytes": "39475" }, { "name": "SQLPL", "bytes": "27514" }, { "name": "Shell", "bytes": "4599" } ], "symlink_target": "" }
<?php namespace Composer\Util; use Composer\IO\IOInterface; use Composer\Config; use Composer\Downloader\TransportException; use Composer\Json\JsonFile; /** * @author Jordi Boggiano <[email protected]> */ class GitHub { protected $io; protected $config; protected $process; protected $remoteFilesystem; /** * Constructor. * * @param IOInterface $io The IO instance * @param Config $config The composer configuration * @param ProcessExecutor $process Process instance, injectable for mocking * @param RemoteFilesystem $remoteFilesystem Remote Filesystem, injectable for mocking */ public function __construct(IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null) { $this->io = $io; $this->config = $config; $this->process = $process ?: new ProcessExecutor; $this->remoteFilesystem = $remoteFilesystem ?: new RemoteFilesystem($io); } /** * Attempts to authorize a GitHub domain via OAuth * * @param string $originUrl The host this GitHub instance is located at * @return bool true on success */ public function authorizeOAuth($originUrl) { if ('github.com' !== $originUrl) { return false; } // if available use token from git config if (0 === $this->process->execute('git config github.accesstoken', $output)) { $this->io->setAuthentication($originUrl, trim($output), 'x-oauth-basic'); return true; } return false; } /** * Authorizes a GitHub domain interactively via OAuth * * @param string $originUrl The host this GitHub instance is located at * @param string $message The reason this authorization is required * @throws \RuntimeException * @throws TransportException|\Exception * @return bool true on success */ public function authorizeOAuthInteractively($originUrl, $message = null) { $attemptCounter = 0; if ($message) { $this->io->write($message); } $this->io->write('The credentials will be swapped for an OAuth token stored in '.$this->config->get('home').'/config.json, your password will not be stored'); $this->io->write('To revoke access to this token you can visit https://github.com/settings/applications'); while ($attemptCounter++ < 5) { try { $username = $this->io->ask('Username: '); $password = $this->io->askAndHideAnswer('Password: '); $this->io->setAuthentication($originUrl, $username, $password); // build up OAuth app name $appName = 'Composer'; if (0 === $this->process->execute('hostname', $output)) { $appName .= ' on ' . trim($output); } $contents = JsonFile::parseJson($this->remoteFilesystem->getContents($originUrl, 'https://api.github.com/authorizations', false, array( 'http' => array( 'method' => 'POST', 'follow_location' => false, 'header' => "Content-Type: application/json\r\n", 'content' => json_encode(array( 'scopes' => array('repo'), 'note' => $appName, 'note_url' => 'https://getcomposer.org/', )), ) ))); } catch (TransportException $e) { if (in_array($e->getCode(), array(403, 401))) { $this->io->write('Invalid credentials.'); continue; } throw $e; } $this->io->setAuthentication($originUrl, $contents['token'], 'x-oauth-basic'); // store value in user config $githubTokens = $this->config->get('github-oauth') ?: array(); $githubTokens[$originUrl] = $contents['token']; $this->config->getConfigSource()->addConfigSetting('github-oauth', $githubTokens); return true; } throw new \RuntimeException("Invalid GitHub credentials 5 times in a row, aborting."); } }
{ "content_hash": "a215c9037f61fc729963477a7d8ac7f9", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 166, "avg_line_length": 36.34959349593496, "alnum_prop": 0.5423842540818609, "repo_name": "GromNaN/composer", "id": "93894cc767eb5127ebac3632f75ad3358bcbd7a5", "size": "4731", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/Composer/Util/GitHub.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "3609083" } ], "symlink_target": "" }
import * as React from "react"; import { CarbonIconProps } from "../../"; declare const ScreenOff24: React.ForwardRefExoticComponent< CarbonIconProps & React.RefAttributes<SVGSVGElement> >; export default ScreenOff24;
{ "content_hash": "e0ad72b04a305a2ffeb2871cac60e1a1", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 59, "avg_line_length": 36.666666666666664, "alnum_prop": 0.7727272727272727, "repo_name": "mcliment/DefinitelyTyped", "id": "5b348c4dc36d555a8696801a1d215350697b9f1c", "size": "220", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "types/carbon__icons-react/lib/screen--off/24.d.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CoffeeScript", "bytes": "15" }, { "name": "Protocol Buffer", "bytes": "678" }, { "name": "TypeScript", "bytes": "17214021" } ], "symlink_target": "" }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Logs_controller extends Core_Controller { protected $logViewer; public function __construct() { parent::__construct(); $this->logViewer = new CILogViewer(); } public function index() { // https://stackoverflow.com/questions/35588699/response-to-preflight-request-doesnt-pass-access-control-check header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS'); header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token, X-Requested-With'); $this->output->set_output($this->logViewer->showLogs()); } }
{ "content_hash": "955506ed57c3387a020d7a9b87ec8513", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 118, "avg_line_length": 30.583333333333332, "alnum_prop": 0.662125340599455, "repo_name": "ivantcholakov/starter-public-edition-4", "id": "68dc807e1d02b8dbe302fdad0d9e261e419a1b69", "size": "734", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "platform/common/modules/logs/controllers/Logs_controller.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "539857" }, { "name": "HTML", "bytes": "347816" }, { "name": "Hack", "bytes": "398" }, { "name": "Handlebars", "bytes": "2353" }, { "name": "JavaScript", "bytes": "4972885" }, { "name": "Less", "bytes": "811973" }, { "name": "Makefile", "bytes": "546" }, { "name": "Mustache", "bytes": "410" }, { "name": "PHP", "bytes": "3051631" }, { "name": "SCSS", "bytes": "94" }, { "name": "Twig", "bytes": "505643" }, { "name": "TypeScript", "bytes": "596" } ], "symlink_target": "" }
from __future__ import unicode_literals from .. import grading from .. import sendmail from .. import sheet from .. import student from .NetsecHandler import NetsecHandler from .ProtectedPostHandler import ProtectedPostHandler def calc_data(db, student_id): fs = student.get_full_student(db, student_id) all_sheet_points = sheet.get_all_total_score(db) student_track = grading.get_student_track(db, all_sheet_points, student_id) total_decipoints = sum(st.get('decipoints', 0) for st in student_track) total_max_decipoints = sum(st['max_decipoints'] for st in student_track) return { 'fs': fs, 'student_track': student_track, 'total_decipoints': total_decipoints, 'total_max_decipoints': total_max_decipoints, } class ContactCraftHandler(NetsecHandler): def get(self, student_id_str): data = calc_data(self.db, int(student_id_str)) self.render('contact_craft', data) class ContactSendHandler(ProtectedPostHandler): def postPassedCSRF(self, student_id_str): data = calc_data(self.db, int(student_id_str)) data['message'] = self.get_argument('message') to = data['fs'].primary_alias subject = 'Netzwerksicherheit: Punktestand' body = self.render2string('contact_mail', data) with sendmail.Mailer(self.application.config) as mailer: mailer.send(to, subject, body) self.redirect('/student/%d?sent' % data['fs'].student.id) class ContactAllCraftHandler(NetsecHandler): def get(self): student_count = len(student.get_studentname_info(self.db)) self.render('contact_all_craft', { 'student_count': student_count, }) class ContactAllSendHandler(ProtectedPostHandler): def postPassedCSRF(self): student_infos = student.get_studentname_info(self.db) subject = self.get_argument('subject') data = { 'message': self.get_argument('message'), } body = self.render2string('contact_all_mail', data) with sendmail.Mailer(self.application.config) as mailer: for si in student_infos: to = si['primary_alias'] mailer.send(to, subject, body) self.redirect('/students?sent')
{ "content_hash": "63a92edff56beee1dfa57aa30453ba3a", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 79, "avg_line_length": 31.65277777777778, "alnum_prop": 0.6537955243527863, "repo_name": "hhucn/netsec-uebungssystem", "id": "08b1f1c5ff899640be491688d0505b0432534f06", "size": "2279", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "netsecus/webhandler/contact.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "638" }, { "name": "HTML", "bytes": "18299" }, { "name": "Makefile", "bytes": "770" }, { "name": "Python", "bytes": "92592" }, { "name": "Shell", "bytes": "1180" } ], "symlink_target": "" }
<a name="0x3_property_map"></a> # Module `0x3::property_map` PropertyMap is a specialization of SimpleMap for Tokens. It maps a String key to a PropertyValue that consists of type (string) and value (vector<u8>) It provides basic on-chain serialization of primitive and string to property value with type information It also supports deserializing property value to it original type. - [Struct `PropertyMap`](#0x3_property_map_PropertyMap) - [Struct `PropertyValue`](#0x3_property_map_PropertyValue) - [Constants](#@Constants_0) - [Function `new`](#0x3_property_map_new) - [Function `new_with_key_and_property_value`](#0x3_property_map_new_with_key_and_property_value) - [Function `empty`](#0x3_property_map_empty) - [Function `contains_key`](#0x3_property_map_contains_key) - [Function `add`](#0x3_property_map_add) - [Function `length`](#0x3_property_map_length) - [Function `borrow`](#0x3_property_map_borrow) - [Function `read_string`](#0x3_property_map_read_string) - [Function `read_u8`](#0x3_property_map_read_u8) - [Function `read_u64`](#0x3_property_map_read_u64) - [Function `read_address`](#0x3_property_map_read_address) - [Function `read_u128`](#0x3_property_map_read_u128) - [Function `read_bool`](#0x3_property_map_read_bool) - [Function `borrow_value`](#0x3_property_map_borrow_value) - [Function `borrow_type`](#0x3_property_map_borrow_type) - [Function `remove`](#0x3_property_map_remove) - [Function `update_property_map`](#0x3_property_map_update_property_map) - [Function `update_property_value`](#0x3_property_map_update_property_value) - [Function `create_property_value_raw`](#0x3_property_map_create_property_value_raw) - [Function `create_property_value`](#0x3_property_map_create_property_value) <pre><code><b>use</b> <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/bcs.md#0x1_bcs">0x1::bcs</a>; <b>use</b> <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error">0x1::error</a>; <b>use</b> <a href="../../aptos-framework/../aptos-stdlib/doc/from_bcs.md#0x1_from_bcs">0x1::from_bcs</a>; <b>use</b> <a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map">0x1::simple_map</a>; <b>use</b> <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string">0x1::string</a>; <b>use</b> <a href="../../aptos-framework/../aptos-stdlib/doc/type_info.md#0x1_type_info">0x1::type_info</a>; </code></pre> <a name="0x3_property_map_PropertyMap"></a> ## Struct `PropertyMap` <pre><code><b>struct</b> <a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a> <b>has</b> <b>copy</b>, drop, store </code></pre> <details> <summary>Fields</summary> <dl> <dt> <code>map: <a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_SimpleMap">simple_map::SimpleMap</a>&lt;<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>, <a href="property_map.md#0x3_property_map_PropertyValue">property_map::PropertyValue</a>&gt;</code> </dt> <dd> </dd> </dl> </details> <a name="0x3_property_map_PropertyValue"></a> ## Struct `PropertyValue` <pre><code><b>struct</b> <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a> <b>has</b> <b>copy</b>, drop, store </code></pre> <details> <summary>Fields</summary> <dl> <dt> <code>value: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;</code> </dt> <dd> </dd> <dt> <code>type: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a></code> </dt> <dd> </dd> </dl> </details> <a name="@Constants_0"></a> ## Constants <a name="0x3_property_map_EKEY_AREADY_EXIST_IN_PROPERTY_MAP"></a> The property key already exists <pre><code><b>const</b> <a href="property_map.md#0x3_property_map_EKEY_AREADY_EXIST_IN_PROPERTY_MAP">EKEY_AREADY_EXIST_IN_PROPERTY_MAP</a>: u64 = 1; </code></pre> <a name="0x3_property_map_EKEY_COUNT_NOT_MATCH_TYPE_COUNT"></a> Property key and type count don't match <pre><code><b>const</b> <a href="property_map.md#0x3_property_map_EKEY_COUNT_NOT_MATCH_TYPE_COUNT">EKEY_COUNT_NOT_MATCH_TYPE_COUNT</a>: u64 = 5; </code></pre> <a name="0x3_property_map_EKEY_COUNT_NOT_MATCH_VALUE_COUNT"></a> Property key and value count don't match <pre><code><b>const</b> <a href="property_map.md#0x3_property_map_EKEY_COUNT_NOT_MATCH_VALUE_COUNT">EKEY_COUNT_NOT_MATCH_VALUE_COUNT</a>: u64 = 4; </code></pre> <a name="0x3_property_map_EPROPERTY_MAP_NAME_TOO_LONG"></a> The name (key) of the property is too long <pre><code><b>const</b> <a href="property_map.md#0x3_property_map_EPROPERTY_MAP_NAME_TOO_LONG">EPROPERTY_MAP_NAME_TOO_LONG</a>: u64 = 7; </code></pre> <a name="0x3_property_map_EPROPERTY_NOT_EXIST"></a> The property doesn't exist <pre><code><b>const</b> <a href="property_map.md#0x3_property_map_EPROPERTY_NOT_EXIST">EPROPERTY_NOT_EXIST</a>: u64 = 3; </code></pre> <a name="0x3_property_map_EPROPERTY_NUMBER_EXCEED_LIMIT"></a> The number of property exceeds the limit <pre><code><b>const</b> <a href="property_map.md#0x3_property_map_EPROPERTY_NUMBER_EXCEED_LIMIT">EPROPERTY_NUMBER_EXCEED_LIMIT</a>: u64 = 2; </code></pre> <a name="0x3_property_map_ETYPE_NOT_MATCH"></a> Property type doesn't match <pre><code><b>const</b> <a href="property_map.md#0x3_property_map_ETYPE_NOT_MATCH">ETYPE_NOT_MATCH</a>: u64 = 6; </code></pre> <a name="0x3_property_map_MAX_PROPERTY_MAP_SIZE"></a> The maximal number of property that can be stored in property map <pre><code><b>const</b> <a href="property_map.md#0x3_property_map_MAX_PROPERTY_MAP_SIZE">MAX_PROPERTY_MAP_SIZE</a>: u64 = 1000; </code></pre> <a name="0x3_property_map_MAX_PROPERTY_NAME_LENGTH"></a> <pre><code><b>const</b> <a href="property_map.md#0x3_property_map_MAX_PROPERTY_NAME_LENGTH">MAX_PROPERTY_NAME_LENGTH</a>: u64 = 128; </code></pre> <a name="0x3_property_map_new"></a> ## Function `new` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_new">new</a>(keys: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>&gt;, values: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;&gt;, types: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>&gt;): <a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a> </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_new">new</a>( keys: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;String&gt;, values: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;&gt;, types: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;String&gt; ): <a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a> { <b>let</b> length = <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_length">vector::length</a>(&keys); <b>assert</b>!(<a href="property_map.md#0x3_property_map_length">length</a> &lt;= <a href="property_map.md#0x3_property_map_MAX_PROPERTY_MAP_SIZE">MAX_PROPERTY_MAP_SIZE</a>, <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="property_map.md#0x3_property_map_EPROPERTY_NUMBER_EXCEED_LIMIT">EPROPERTY_NUMBER_EXCEED_LIMIT</a>)); <b>assert</b>!(length == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_length">vector::length</a>(&values), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="property_map.md#0x3_property_map_EKEY_COUNT_NOT_MATCH_VALUE_COUNT">EKEY_COUNT_NOT_MATCH_VALUE_COUNT</a>)); <b>assert</b>!(length == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_length">vector::length</a>(&types), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="property_map.md#0x3_property_map_EKEY_COUNT_NOT_MATCH_TYPE_COUNT">EKEY_COUNT_NOT_MATCH_TYPE_COUNT</a>)); <b>let</b> properties = <a href="property_map.md#0x3_property_map_empty">empty</a>(); <b>let</b> i = 0; <b>while</b> (i &lt; length) { <b>let</b> key = *<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_borrow">vector::borrow</a>(&keys, i); <b>assert</b>!(<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_length">string::length</a>(&key) &lt;= <a href="property_map.md#0x3_property_map_MAX_PROPERTY_NAME_LENGTH">MAX_PROPERTY_NAME_LENGTH</a>, <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="property_map.md#0x3_property_map_EPROPERTY_MAP_NAME_TOO_LONG">EPROPERTY_MAP_NAME_TOO_LONG</a>)); <a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_add">simple_map::add</a>( &<b>mut</b> properties.map, key, <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a> { value: *<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_borrow">vector::borrow</a>(&values, i), type: *<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_borrow">vector::borrow</a>(&types, i) } ); i = i + 1; }; properties } </code></pre> </details> <a name="0x3_property_map_new_with_key_and_property_value"></a> ## Function `new_with_key_and_property_value` Create property map directly from key and property value <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_new_with_key_and_property_value">new_with_key_and_property_value</a>(keys: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>&gt;, values: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="property_map.md#0x3_property_map_PropertyValue">property_map::PropertyValue</a>&gt;): <a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a> </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_new_with_key_and_property_value">new_with_key_and_property_value</a>( keys: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;String&gt;, values: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a>&gt; ): <a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a> { <b>let</b> length = <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_length">vector::length</a>(&keys); <b>assert</b>!(<a href="property_map.md#0x3_property_map_length">length</a> &lt;= <a href="property_map.md#0x3_property_map_MAX_PROPERTY_MAP_SIZE">MAX_PROPERTY_MAP_SIZE</a>, <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="property_map.md#0x3_property_map_EPROPERTY_NUMBER_EXCEED_LIMIT">EPROPERTY_NUMBER_EXCEED_LIMIT</a>)); <b>assert</b>!(length == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_length">vector::length</a>(&values), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="property_map.md#0x3_property_map_EKEY_COUNT_NOT_MATCH_VALUE_COUNT">EKEY_COUNT_NOT_MATCH_VALUE_COUNT</a>)); <b>let</b> properties = <a href="property_map.md#0x3_property_map_empty">empty</a>(); <b>let</b> i = 0; <b>while</b> (i &lt; length) { <b>let</b> key = *<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_borrow">vector::borrow</a>(&keys, i); <b>let</b> val = *<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_borrow">vector::borrow</a>(&values, i); <b>assert</b>!(<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_length">string::length</a>(&key) &lt;= <a href="property_map.md#0x3_property_map_MAX_PROPERTY_NAME_LENGTH">MAX_PROPERTY_NAME_LENGTH</a>, <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="property_map.md#0x3_property_map_EPROPERTY_MAP_NAME_TOO_LONG">EPROPERTY_MAP_NAME_TOO_LONG</a>)); <a href="property_map.md#0x3_property_map_add">add</a>(&<b>mut</b> properties, key, val); i = i + 1; }; properties } </code></pre> </details> <a name="0x3_property_map_empty"></a> ## Function `empty` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_empty">empty</a>(): <a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a> </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_empty">empty</a>(): <a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a> { <a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a> { map: <a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_create">simple_map::create</a>&lt;String, <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a>&gt;(), } } </code></pre> </details> <a name="0x3_property_map_contains_key"></a> ## Function `contains_key` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_contains_key">contains_key</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: &<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>): bool </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_contains_key">contains_key</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: &String): bool { <a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_contains_key">simple_map::contains_key</a>(&map.map, key) } </code></pre> </details> <a name="0x3_property_map_add"></a> ## Function `add` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_add">add</a>(map: &<b>mut</b> <a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>, value: <a href="property_map.md#0x3_property_map_PropertyValue">property_map::PropertyValue</a>) </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_add">add</a>(map: &<b>mut</b> <a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: String, value: <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a>) { <b>assert</b>!(<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_length">string::length</a>(&key) &lt;= <a href="property_map.md#0x3_property_map_MAX_PROPERTY_NAME_LENGTH">MAX_PROPERTY_NAME_LENGTH</a>, <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="property_map.md#0x3_property_map_EPROPERTY_MAP_NAME_TOO_LONG">EPROPERTY_MAP_NAME_TOO_LONG</a>)); <b>assert</b>!(!<a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_contains_key">simple_map::contains_key</a>(&map.map, &key), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_already_exists">error::already_exists</a>(<a href="property_map.md#0x3_property_map_EKEY_AREADY_EXIST_IN_PROPERTY_MAP">EKEY_AREADY_EXIST_IN_PROPERTY_MAP</a>)); <b>assert</b>!(<a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_length">simple_map::length</a>&lt;String, <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a>&gt;(&map.map) &lt; <a href="property_map.md#0x3_property_map_MAX_PROPERTY_MAP_SIZE">MAX_PROPERTY_MAP_SIZE</a>, <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="property_map.md#0x3_property_map_EPROPERTY_NUMBER_EXCEED_LIMIT">EPROPERTY_NUMBER_EXCEED_LIMIT</a>)); <a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_add">simple_map::add</a>(&<b>mut</b> map.map, key, value); } </code></pre> </details> <a name="0x3_property_map_length"></a> ## Function `length` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_length">length</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>): u64 </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_length">length</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>): u64 { <a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_length">simple_map::length</a>(&map.map) } </code></pre> </details> <a name="0x3_property_map_borrow"></a> ## Function `borrow` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_borrow">borrow</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: &<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>): &<a href="property_map.md#0x3_property_map_PropertyValue">property_map::PropertyValue</a> </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_borrow">borrow</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: &String): &<a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a> { <b>let</b> found = <a href="property_map.md#0x3_property_map_contains_key">contains_key</a>(map, key); <b>assert</b>!(found, <a href="property_map.md#0x3_property_map_EPROPERTY_NOT_EXIST">EPROPERTY_NOT_EXIST</a>); <a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_borrow">simple_map::borrow</a>(&map.map, key) } </code></pre> </details> <a name="0x3_property_map_read_string"></a> ## Function `read_string` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_string">read_string</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: &<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>): <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a> </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_string">read_string</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: &String): String { <b>let</b> prop = <a href="property_map.md#0x3_property_map_borrow">borrow</a>(map, key); <b>assert</b>!(prop.type == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">0x1::string::String</a>"), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="property_map.md#0x3_property_map_ETYPE_NOT_MATCH">ETYPE_NOT_MATCH</a>)); <a href="../../aptos-framework/../aptos-stdlib/doc/from_bcs.md#0x1_from_bcs_to_string">from_bcs::to_string</a>(prop.value) } </code></pre> </details> <a name="0x3_property_map_read_u8"></a> ## Function `read_u8` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_u8">read_u8</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: &<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>): u8 </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_u8">read_u8</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: &String): u8 { <b>let</b> prop = <a href="property_map.md#0x3_property_map_borrow">borrow</a>(map, key); <b>assert</b>!(prop.type == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"u8"), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="property_map.md#0x3_property_map_ETYPE_NOT_MATCH">ETYPE_NOT_MATCH</a>)); <a href="../../aptos-framework/../aptos-stdlib/doc/from_bcs.md#0x1_from_bcs_to_u8">from_bcs::to_u8</a>(prop.value) } </code></pre> </details> <a name="0x3_property_map_read_u64"></a> ## Function `read_u64` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_u64">read_u64</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: &<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>): u64 </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_u64">read_u64</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: &String): u64 { <b>let</b> prop = <a href="property_map.md#0x3_property_map_borrow">borrow</a>(map, key); <b>assert</b>!(prop.type == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"u64"), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="property_map.md#0x3_property_map_ETYPE_NOT_MATCH">ETYPE_NOT_MATCH</a>)); <a href="../../aptos-framework/../aptos-stdlib/doc/from_bcs.md#0x1_from_bcs_to_u64">from_bcs::to_u64</a>(prop.value) } </code></pre> </details> <a name="0x3_property_map_read_address"></a> ## Function `read_address` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_address">read_address</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: &<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>): <b>address</b> </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_address">read_address</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: &String): <b>address</b> { <b>let</b> prop = <a href="property_map.md#0x3_property_map_borrow">borrow</a>(map, key); <b>assert</b>!(prop.type == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"<b>address</b>"), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="property_map.md#0x3_property_map_ETYPE_NOT_MATCH">ETYPE_NOT_MATCH</a>)); <a href="../../aptos-framework/../aptos-stdlib/doc/from_bcs.md#0x1_from_bcs_to_address">from_bcs::to_address</a>(prop.value) } </code></pre> </details> <a name="0x3_property_map_read_u128"></a> ## Function `read_u128` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_u128">read_u128</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: &<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>): u128 </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_u128">read_u128</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: &String): u128 { <b>let</b> prop = <a href="property_map.md#0x3_property_map_borrow">borrow</a>(map, key); <b>assert</b>!(prop.type == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"u128"), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="property_map.md#0x3_property_map_ETYPE_NOT_MATCH">ETYPE_NOT_MATCH</a>)); <a href="../../aptos-framework/../aptos-stdlib/doc/from_bcs.md#0x1_from_bcs_to_u128">from_bcs::to_u128</a>(prop.value) } </code></pre> </details> <a name="0x3_property_map_read_bool"></a> ## Function `read_bool` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_bool">read_bool</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: &<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>): bool </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_read_bool">read_bool</a>(map: &<a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: &String): bool { <b>let</b> prop = <a href="property_map.md#0x3_property_map_borrow">borrow</a>(map, key); <b>assert</b>!(prop.type == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"bool"), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="property_map.md#0x3_property_map_ETYPE_NOT_MATCH">ETYPE_NOT_MATCH</a>)); <a href="../../aptos-framework/../aptos-stdlib/doc/from_bcs.md#0x1_from_bcs_to_bool">from_bcs::to_bool</a>(prop.value) } </code></pre> </details> <a name="0x3_property_map_borrow_value"></a> ## Function `borrow_value` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_borrow_value">borrow_value</a>(property: &<a href="property_map.md#0x3_property_map_PropertyValue">property_map::PropertyValue</a>): <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt; </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_borrow_value">borrow_value</a>(property: &<a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a>): <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt; { *&property.value } </code></pre> </details> <a name="0x3_property_map_borrow_type"></a> ## Function `borrow_type` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_borrow_type">borrow_type</a>(property: &<a href="property_map.md#0x3_property_map_PropertyValue">property_map::PropertyValue</a>): <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a> </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_borrow_type">borrow_type</a>(property: &<a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a>): String { *&property.type } </code></pre> </details> <a name="0x3_property_map_remove"></a> ## Function `remove` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_remove">remove</a>(map: &<b>mut</b> <a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: &<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>): (<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>, <a href="property_map.md#0x3_property_map_PropertyValue">property_map::PropertyValue</a>) </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_remove">remove</a>( map: &<b>mut</b> <a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: &String ): (String, <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a>) { <b>let</b> found = <a href="property_map.md#0x3_property_map_contains_key">contains_key</a>(map, key); <b>assert</b>!(found, <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_not_found">error::not_found</a>(<a href="property_map.md#0x3_property_map_EPROPERTY_NOT_EXIST">EPROPERTY_NOT_EXIST</a>)); <a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_remove">simple_map::remove</a>(&<b>mut</b> map.map, key) } </code></pre> </details> <a name="0x3_property_map_update_property_map"></a> ## Function `update_property_map` Update the property in the existing property map Allow updating existing keys' value and add new key-value pairs <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_update_property_map">update_property_map</a>(map: &<b>mut</b> <a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, keys: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>&gt;, values: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;&gt;, types: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>&gt;) </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_update_property_map">update_property_map</a>( map: &<b>mut</b> <a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, keys: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;String&gt;, values: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;&gt;, types: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;String&gt;, ) { <b>let</b> key_len = <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_length">vector::length</a>(&keys); <b>let</b> val_len = <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_length">vector::length</a>(&values); <b>let</b> typ_len = <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_length">vector::length</a>(&types); <b>assert</b>!(key_len == val_len, <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="property_map.md#0x3_property_map_EKEY_COUNT_NOT_MATCH_VALUE_COUNT">EKEY_COUNT_NOT_MATCH_VALUE_COUNT</a>)); <b>assert</b>!(key_len == typ_len, <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="property_map.md#0x3_property_map_EKEY_COUNT_NOT_MATCH_TYPE_COUNT">EKEY_COUNT_NOT_MATCH_TYPE_COUNT</a>)); <b>let</b> i = 0; <b>while</b> (i &lt; <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_length">vector::length</a>(&keys)) { <b>let</b> key = <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_borrow">vector::borrow</a>(&keys, i); <b>let</b> prop_val = <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a> { value: *<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_borrow">vector::borrow</a>(&values, i), type: *<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_borrow">vector::borrow</a>(&types, i), }; <b>if</b> (<a href="property_map.md#0x3_property_map_contains_key">contains_key</a>(map, key)) { <a href="property_map.md#0x3_property_map_update_property_value">update_property_value</a>(map, key, prop_val); } <b>else</b> { <a href="property_map.md#0x3_property_map_add">add</a>(map, *key, prop_val); }; i = i + 1; } } </code></pre> </details> <a name="0x3_property_map_update_property_value"></a> ## Function `update_property_value` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_update_property_value">update_property_value</a>(map: &<b>mut</b> <a href="property_map.md#0x3_property_map_PropertyMap">property_map::PropertyMap</a>, key: &<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>, value: <a href="property_map.md#0x3_property_map_PropertyValue">property_map::PropertyValue</a>) </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_update_property_value">update_property_value</a>( map: &<b>mut</b> <a href="property_map.md#0x3_property_map_PropertyMap">PropertyMap</a>, key: &String, value: <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a> ) { <b>let</b> found = <a href="property_map.md#0x3_property_map_contains_key">contains_key</a>(map, key); <b>assert</b>!(found, <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_not_found">error::not_found</a>(<a href="property_map.md#0x3_property_map_EPROPERTY_NOT_EXIST">EPROPERTY_NOT_EXIST</a>)); <b>let</b> property_val = <a href="../../aptos-framework/../aptos-stdlib/doc/simple_map.md#0x1_simple_map_borrow_mut">simple_map::borrow_mut</a>(&<b>mut</b> map.map, key); *property_val = value; } </code></pre> </details> <a name="0x3_property_map_create_property_value_raw"></a> ## Function `create_property_value_raw` <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_create_property_value_raw">create_property_value_raw</a>(value: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;, type: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">string::String</a>): <a href="property_map.md#0x3_property_map_PropertyValue">property_map::PropertyValue</a> </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_create_property_value_raw">create_property_value_raw</a>( value: <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;, type: String ): <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a> { <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a> { value, type, } } </code></pre> </details> <a name="0x3_property_map_create_property_value"></a> ## Function `create_property_value` create a property value from generic type data <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_create_property_value">create_property_value</a>&lt;T: <b>copy</b>&gt;(data: &T): <a href="property_map.md#0x3_property_map_PropertyValue">property_map::PropertyValue</a> </code></pre> <details> <summary>Implementation</summary> <pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x3_property_map_create_property_value">create_property_value</a>&lt;T: <b>copy</b>&gt;(data: &T): <a href="property_map.md#0x3_property_map_PropertyValue">PropertyValue</a> { <b>let</b> name = type_name&lt;T&gt;(); <b>if</b> ( name == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"bool") || name == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"u8") || name == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"u64") || name == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"u128") || name == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"<b>address</b>") || name == <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_String">0x1::string::String</a>") ) { <a href="property_map.md#0x3_property_map_create_property_value_raw">create_property_value_raw</a>(<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/bcs.md#0x1_bcs_to_bytes">bcs::to_bytes</a>&lt;T&gt;(data), name) } <b>else</b> { <a href="property_map.md#0x3_property_map_create_property_value_raw">create_property_value_raw</a>(<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/bcs.md#0x1_bcs_to_bytes">bcs::to_bytes</a>&lt;T&gt;(data), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8">string::utf8</a>(b"<a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;")) } } </code></pre> </details> [move-book]: https://move-language.github.io/move/introduction.html
{ "content_hash": "d4f3871e8e2635d7defcdc7515b35685", "timestamp": "", "source": "github", "line_count": 797, "max_line_length": 904, "avg_line_length": 49.993726474278546, "alnum_prop": 0.6745137407453884, "repo_name": "aptos-labs/aptos-core", "id": "691a851a6c489ecf890b763c3e712d207053b70e", "size": "39846", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "aptos-move/framework/aptos-token/doc/property_map.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Boogie", "bytes": "62" }, { "name": "CSS", "bytes": "31355" }, { "name": "Dockerfile", "bytes": "10300" }, { "name": "Go", "bytes": "1308" }, { "name": "HCL", "bytes": "190756" }, { "name": "HTML", "bytes": "2168" }, { "name": "JavaScript", "bytes": "48386" }, { "name": "Makefile", "bytes": "2632" }, { "name": "Move", "bytes": "1354163" }, { "name": "Mustache", "bytes": "21042" }, { "name": "PLpgSQL", "bytes": "1145" }, { "name": "PowerShell", "bytes": "842" }, { "name": "Python", "bytes": "240445" }, { "name": "Rust", "bytes": "10592521" }, { "name": "Shell", "bytes": "69203" }, { "name": "Smarty", "bytes": "1224" }, { "name": "TypeScript", "bytes": "513895" } ], "symlink_target": "" }
/** * * @file sg_vv2__stamp.c * * @details Routines to handle the STAMP command and its sub-commands. * */ ////////////////////////////////////////////////////////////////// #include <sg.h> #include <sg_wc__public_typedefs.h> #include <sg_wc__public_prototypes.h> #include "sg_vv2__public_typedefs.h" #include "sg_vv2__public_prototypes.h" #include "sg_vv2__private.h" ////////////////////////////////////////////////////////////////// void SG_vv2__stamp__add(SG_context * pCtx, const char * pszRepoName, const SG_rev_spec * pRevSpec, const char * pszStampName, SG_varray ** ppvaInfo) { SG_repo * pRepo = NULL; SG_stringarray * psaHidChangesets = NULL; SG_varray * pvaInfo = NULL; SG_uint32 countRevSpecs = 0; SG_uint32 countChangesets = 0; SG_uint32 k; SG_audit q; SG_bool bRepoNamed = SG_FALSE; // pszRepoName is optional (defaults to WD if present) // pRevSpec is optional (defaults to parents of WD if present) SG_NONEMPTYCHECK_RETURN( pszStampName ); // open either the named repo or the repo of the WD. SG_ERR_CHECK( sg_vv2__util__get_repo(pCtx, pszRepoName, &pRepo, &bRepoNamed) ); SG_ERR_CHECK( SG_audit__init(pCtx,&q,pRepo,SG_AUDIT__WHEN__NOW,SG_AUDIT__WHO__FROM_SETTINGS) ); // determine the list of CSETs referenced by rev-spec or // default to the current parent(s). if (pRevSpec) SG_ERR_CHECK( SG_rev_spec__count(pCtx, pRevSpec, &countRevSpecs) ); if (countRevSpecs > 0) { SG_ERR_CHECK( SG_rev_spec__get_all__repo(pCtx, pRepo, pRevSpec, SG_TRUE, &psaHidChangesets, NULL) ); } else if (bRepoNamed) { // normally the (count==0) case means to use // the parents of the current WD, but we have to disallow it here // because when they give us a named repo, we do not want to assume // anything about the current WD (if present). SG_ERR_THROW2( SG_ERR_USAGE, (pCtx, "Must specify which changeset(s) to stamp in repo '%s'.", pszRepoName) ); } else { SG_ERR_CHECK( SG_wc__get_wc_parents__stringarray(pCtx, NULL, &psaHidChangesets) ); } // associate the given stamp with each identified CSET. if (ppvaInfo) SG_ERR_CHECK( SG_VARRAY__ALLOC(pCtx, &pvaInfo) ); if (psaHidChangesets) SG_ERR_CHECK( SG_stringarray__count(pCtx, psaHidChangesets, &countChangesets) ); for (k=0; k<countChangesets; k++) { SG_vhash * pvhInfo_k; // we do not own this const char * pszHid_k; // we do not own this SG_bool bRedundant; SG_ERR_CHECK( SG_stringarray__get_nth(pCtx, psaHidChangesets, k, &pszHid_k) ); SG_ERR_CHECK( SG_vc_stamps__add(pCtx, pRepo, pszHid_k, pszStampName, &q, &bRedundant) ); if (ppvaInfo) { SG_ERR_CHECK( SG_varray__appendnew__vhash(pCtx, pvaInfo, &pvhInfo_k) ); SG_ERR_CHECK( SG_vhash__add__string__sz(pCtx, pvhInfo_k, "hid", pszHid_k) ); SG_ERR_CHECK( SG_vhash__add__bool(pCtx, pvhInfo_k, "redundant", bRedundant) ); } } if (ppvaInfo) { *ppvaInfo = pvaInfo; pvaInfo = NULL; } fail: SG_REPO_NULLFREE(pCtx, pRepo); SG_STRINGARRAY_NULLFREE(pCtx, psaHidChangesets); SG_VARRAY_NULLFREE(pCtx, pvaInfo); } ////////////////////////////////////////////////////////////////// /** * Remove the named STAMP from the requested CSET(s). * It is an error if the stamp is not present in all * of the csets. * */ void SG_vv2__stamp__remove_stamp_from_cset(SG_context * pCtx, const char * pszRepoName, const SG_rev_spec * pRevSpec, const char * pszStampName, SG_varray ** ppvaInfo) { SG_repo * pRepo = NULL; SG_stringarray * psaHidChangesets = NULL; SG_varray * pvaInfo = NULL; SG_uint32 countRevSpecs = 0; SG_uint32 countChangesets = 0; SG_uint32 k; SG_audit q; SG_bool bRepoNamed = SG_FALSE; // pszRepoName is optional (defaults to WD if present) // pRevSpec is optional (defaults to parents of WD if present) SG_NONEMPTYCHECK_RETURN( pszStampName ); // open either the named repo or the repo of the WD. SG_ERR_CHECK( sg_vv2__util__get_repo(pCtx, pszRepoName, &pRepo, &bRepoNamed) ); SG_ERR_CHECK( SG_audit__init(pCtx,&q,pRepo,SG_AUDIT__WHEN__NOW,SG_AUDIT__WHO__FROM_SETTINGS) ); // determine the list of CSETs referenced by rev-spec or // default to the current parents(s). if (pRevSpec) SG_ERR_CHECK( SG_rev_spec__count(pCtx, pRevSpec, &countRevSpecs) ); if (countRevSpecs > 0) { SG_ERR_CHECK( SG_rev_spec__get_all__repo(pCtx, pRepo, pRevSpec, SG_TRUE, &psaHidChangesets, NULL) ); } else if (bRepoNamed) { // normally the (count==0) case means to use // the parents of the current WD, but we have to disallow it here // because when they give us a named repo, we do not want to assume // anything about the current WD (if present). SG_ERR_THROW2( SG_ERR_USAGE, (pCtx, "Must specify which changeset(s) to unstamp in repo '%s'.", pszRepoName) ); } else { SG_ERR_CHECK( SG_wc__get_wc_parents__stringarray(pCtx, NULL, &psaHidChangesets) ); } // ensure that the named STAMP is present in EACH CSET. SG_ERR_CHECK( SG_stringarray__count(pCtx, psaHidChangesets, &countChangesets) ); for (k=0; k<countChangesets; k++) { const char* pszHid_k; SG_bool bStampIsThere_k = SG_FALSE; SG_ERR_CHECK( SG_stringarray__get_nth(pCtx, psaHidChangesets, k, &pszHid_k) ); SG_ERR_CHECK( SG_vc_stamps__is_stamp_already_applied(pCtx, pRepo, pszHid_k, pszStampName, &bStampIsThere_k) ); if(!bStampIsThere_k) SG_ERR_THROW2( SG_ERR_STAMP_NOT_FOUND, (pCtx, "%s in changeset %s", pszStampName, pszHid_k) ); } // remove the stamp from EACH CSET and optionally return info // to the caller for each cset that we touched. if (ppvaInfo) SG_ERR_CHECK( SG_VARRAY__ALLOC(pCtx, &pvaInfo) ); for (k=0; k<countChangesets; k++) { SG_vhash * pvhInfo_k; // we do not own this const char * pszHid_k; // we do not own this SG_ERR_CHECK( SG_stringarray__get_nth(pCtx, psaHidChangesets, k, &pszHid_k) ); SG_ERR_CHECK( SG_vc_stamps__remove(pCtx, pRepo, &q, pszHid_k, 1, &pszStampName) ); if (ppvaInfo) { SG_ERR_CHECK( SG_varray__appendnew__vhash(pCtx, pvaInfo, &pvhInfo_k) ); SG_ERR_CHECK( SG_vhash__add__string__sz(pCtx, pvhInfo_k, "hid", pszHid_k) ); } } if (ppvaInfo) { *ppvaInfo = pvaInfo; pvaInfo = NULL; } fail: SG_REPO_NULLFREE(pCtx, pRepo); SG_STRINGARRAY_NULLFREE(pCtx, psaHidChangesets); SG_VARRAY_NULLFREE(pCtx, pvaInfo); } /** * Remove the named STAMP from *ALL* CSETS where it occurs. * We DO NOT take a rev-spec. It is an error if the stamp * is not present in any cset. * */ void SG_vv2__stamp__remove_stamp_from_all_csets(SG_context * pCtx, const char * pszRepoName, const char * pszStampName, SG_varray ** ppvaInfo) { SG_repo * pRepo = NULL; SG_stringarray * psaHidChangesets = NULL; SG_varray * pvaInfo = NULL; SG_uint32 countChangesets = 0; SG_uint32 k; SG_audit q; SG_bool bRepoNamed = SG_FALSE; // pszRepoName is optional (defaults to WD if present) if (!pszStampName || !*pszStampName) SG_ERR_THROW2( SG_ERR_INVALIDARG, (pCtx, "Must specify a stamp name with 'all' option.") ); // open either the named repo or the repo of the WD. SG_ERR_CHECK( sg_vv2__util__get_repo(pCtx, pszRepoName, &pRepo, &bRepoNamed) ); SG_ERR_CHECK( SG_audit__init(pCtx,&q,pRepo,SG_AUDIT__WHEN__NOW,SG_AUDIT__WHO__FROM_SETTINGS) ); // find all csets where this stamp occurs. SG_ERR_CHECK( SG_vc_stamps__lookup_by_stamp(pCtx, pRepo, &q, pszStampName, &psaHidChangesets) ); if (psaHidChangesets) SG_ERR_CHECK( SG_stringarray__count(pCtx, psaHidChangesets, &countChangesets) ); if (countChangesets == 0) SG_ERR_THROW2( SG_ERR_STAMP_NOT_FOUND, (pCtx, "%s", pszStampName) ); // since we got the list of CSETs using a query-by-stamp, // we don't need to verify that they each have the stamp. // we already know that. // remove the stamp from EACH CSET and optionally return info // to the caller for each cset that we touched. if (ppvaInfo) SG_ERR_CHECK( SG_VARRAY__ALLOC(pCtx, &pvaInfo) ); for (k=0; k<countChangesets; k++) { SG_vhash * pvhInfo_k; // we do not own this const char * pszHid_k; // we do not own this SG_ERR_CHECK( SG_stringarray__get_nth(pCtx, psaHidChangesets, k, &pszHid_k) ); SG_ERR_CHECK( SG_vc_stamps__remove(pCtx, pRepo, &q, pszHid_k, 1, &pszStampName) ); if (ppvaInfo) { SG_ERR_CHECK( SG_varray__appendnew__vhash(pCtx, pvaInfo, &pvhInfo_k) ); SG_ERR_CHECK( SG_vhash__add__string__sz(pCtx, pvhInfo_k, "hid", pszHid_k) ); } } if (ppvaInfo) { *ppvaInfo = pvaInfo; pvaInfo = NULL; } fail: SG_REPO_NULLFREE(pCtx, pRepo); SG_STRINGARRAY_NULLFREE(pCtx, psaHidChangesets); SG_VARRAY_NULLFREE(pCtx, pvaInfo); } /** * Remove *ALL* STAMPS from a CSET. * */ void SG_vv2__stamp__remove_all_stamps_from_cset(SG_context * pCtx, const char * pszRepoName, const SG_rev_spec * pRevSpec, SG_varray ** ppvaInfo) { SG_repo * pRepo = NULL; SG_stringarray * psaHidChangesets = NULL; SG_varray * pvaInfo = NULL; SG_uint32 countRevSpecs = 0; SG_uint32 countChangesets = 0; SG_uint32 k; SG_audit q; SG_bool bRepoNamed = SG_FALSE; // pszRepoName is optional (defaults to WD if present) // pRevSpec is optional (defaults to parents of WD if present) // open either the named repo or the repo of the WD. SG_ERR_CHECK( sg_vv2__util__get_repo(pCtx, pszRepoName, &pRepo, &bRepoNamed) ); SG_ERR_CHECK( SG_audit__init(pCtx,&q,pRepo,SG_AUDIT__WHEN__NOW,SG_AUDIT__WHO__FROM_SETTINGS) ); // determine the list of CSETs referenced by rev-spec or // default to the current parent(s). if (pRevSpec) SG_ERR_CHECK( SG_rev_spec__count(pCtx, pRevSpec, &countRevSpecs) ); if (countRevSpecs > 0) { SG_ERR_CHECK( SG_rev_spec__get_all__repo(pCtx, pRepo, pRevSpec, SG_TRUE, &psaHidChangesets, NULL) ); } else if (bRepoNamed) { // normally the (count==0) case means to use // the parents of the current WD, but we have to disallow it here // because when they give us a named repo, we do not want to assume // anything about the current WD (if present). SG_ERR_THROW2( SG_ERR_USAGE, (pCtx, "Must specify which changeset(s) to unstamp in repo '%s'.", pszRepoName) ); } else { SG_ERR_CHECK( SG_wc__get_wc_parents__stringarray(pCtx, NULL, &psaHidChangesets) ); } // We are not given a named STAMP. We just iterate on each of // the identified CSETs and for each remove any stamps we find // (if any). So we don't need to verify that a specific stamp // is present first. // remove the stamps on each identified CSET and optionally return // info to the caller for each cset that we touched. if (ppvaInfo) SG_ERR_CHECK( SG_VARRAY__ALLOC(pCtx, &pvaInfo) ); if (psaHidChangesets) SG_ERR_CHECK( SG_stringarray__count(pCtx, psaHidChangesets, &countChangesets) ); for (k=0; k<countChangesets; k++) { SG_vhash * pvhInfo_k; // we do not own this const char * pszHid_k; // we do not own this SG_ERR_CHECK( SG_stringarray__get_nth(pCtx, psaHidChangesets, k, &pszHid_k) ); SG_ERR_CHECK( SG_vc_stamps__remove(pCtx, pRepo, &q, pszHid_k, 0, NULL) ); if (ppvaInfo) { SG_ERR_CHECK( SG_varray__appendnew__vhash(pCtx, pvaInfo, &pvhInfo_k) ); SG_ERR_CHECK( SG_vhash__add__string__sz(pCtx, pvhInfo_k, "hid", pszHid_k) ); } } if (ppvaInfo) { *ppvaInfo = pvaInfo; pvaInfo = NULL; } fail: SG_REPO_NULLFREE(pCtx, pRepo); SG_STRINGARRAY_NULLFREE(pCtx, psaHidChangesets); SG_VARRAY_NULLFREE(pCtx, pvaInfo); } /** * Main interface for 'vv stamp remove' which handles the * various default/override cases. * */ void SG_vv2__stamp__remove(SG_context * pCtx, const char * pszRepoName, const SG_rev_spec * pRevSpec, const char * pszStampName, SG_bool bAll, SG_varray ** ppvaInfo) { if (bAll) { if (pRevSpec) { SG_uint32 countRevSpecs = 0; SG_ERR_CHECK( SG_rev_spec__count(pCtx, pRevSpec, &countRevSpecs) ); if (countRevSpecs > 0) SG_ERR_THROW2( SG_ERR_USAGE, (pCtx, "Cannot mix 'rev-spec' and 'all' options.") ); } SG_ERR_CHECK( SG_vv2__stamp__remove_stamp_from_all_csets(pCtx, pszRepoName, pszStampName, ppvaInfo) ); } else { if (pszStampName && *pszStampName) { SG_ERR_CHECK( SG_vv2__stamp__remove_stamp_from_cset(pCtx, pszRepoName, pRevSpec, pszStampName, ppvaInfo) ); } else { SG_ERR_CHECK( SG_vv2__stamp__remove_all_stamps_from_cset(pCtx, pszRepoName, pRevSpec, ppvaInfo) ); } } fail: return; } ////////////////////////////////////////////////////////////////// /** * Return a list of the CSets having this stamp. * */ void SG_vv2__stamp__list(SG_context * pCtx, const char * pszRepoName, const char * pszStampName, SG_stringarray ** ppsaHidChangesets) { SG_repo * pRepo = NULL; SG_audit q; SG_bool bRepoNamed = SG_FALSE; // pszRepoName is optional SG_NONEMPTYCHECK_RETURN( pszStampName ); SG_NULLARGCHECK_RETURN( ppsaHidChangesets ); // open either the named repo or the repo of the WD. SG_ERR_CHECK( sg_vv2__util__get_repo(pCtx, pszRepoName, &pRepo, &bRepoNamed) ); SG_ERR_CHECK( SG_audit__init(pCtx,&q,pRepo,SG_AUDIT__WHEN__NOW,SG_AUDIT__WHO__FROM_SETTINGS) ); SG_ERR_CHECK( SG_vc_stamps__lookup_by_stamp(pCtx, pRepo, &q, pszStampName, ppsaHidChangesets) ); fail: SG_REPO_NULLFREE(pCtx, pRepo); } ////////////////////////////////////////////////////////////////// /** * Return a list of all stamps and their frequency. * */ void SG_vv2__stamps(SG_context * pCtx, const char * pszRepoName, SG_varray ** ppva_results) { SG_repo * pRepo = NULL; SG_bool bRepoNamed = SG_FALSE; // pszRepoName is optional SG_NULLARGCHECK_RETURN( ppva_results ); // open either the named repo or the repo of the WD. SG_ERR_CHECK( sg_vv2__util__get_repo(pCtx, pszRepoName, &pRepo, &bRepoNamed) ); SG_ERR_CHECK( SG_vc_stamps__list_all_stamps(pCtx, pRepo, ppva_results) ); fail: SG_REPO_NULLFREE(pCtx, pRepo); }
{ "content_hash": "ec17ea0152dbd837722167bcb505a17f", "timestamp": "", "source": "github", "line_count": 472, "max_line_length": 114, "avg_line_length": 29.616525423728813, "alnum_prop": 0.6493311395664926, "repo_name": "glycerine/vj", "id": "c2b01b01d22a0d5b2a0dc7069df4728d02c3121a", "size": "14541", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/veracity/src/libraries/vv2/vv8api/sg_vv2__stamp.c", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "305113" }, { "name": "C", "bytes": "16794809" }, { "name": "C++", "bytes": "23785718" }, { "name": "CMake", "bytes": "95243" }, { "name": "CSS", "bytes": "149452" }, { "name": "Gnuplot", "bytes": "691" }, { "name": "Groff", "bytes": "19029" }, { "name": "HTML", "bytes": "199269" }, { "name": "Java", "bytes": "849244" }, { "name": "JavaScript", "bytes": "8559068" }, { "name": "Makefile", "bytes": "274053" }, { "name": "Objective-C", "bytes": "91611" }, { "name": "Perl", "bytes": "170709" }, { "name": "Python", "bytes": "128973" }, { "name": "QMake", "bytes": "274" }, { "name": "Shell", "bytes": "424637" }, { "name": "TeX", "bytes": "230259" } ], "symlink_target": "" }
/* -------------------------------------------------------------------------- */ /* Copyright 2002-2019, OpenNebula Project, OpenNebula Systems */ /* */ /* 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. */ /* -------------------------------------------------------------------------- */ #include "AuthManagerDriver.h" #include "AuthManager.h" #include "NebulaLog.h" #include "Nebula.h" #include <sstream> /* ************************************************************************** */ /* Driver ASCII Protocol Implementation */ /* ************************************************************************** */ void AuthManagerDriver::authorize(int oid, int uid, const string& reqs, bool acl) const { ostringstream os; os << "AUTHORIZE " << oid << " " << uid << " " << reqs << " " << acl <<endl; write(os); } void AuthManagerDriver::authenticate(int oid, int uid, const string& driver, const string& username, const string& password, const string& session) const { ostringstream os; os << "AUTHENTICATE " << oid << " " << uid << " " << driver << " " << username << " " << password << " " << session << endl; write(os); } /* ************************************************************************** */ /* MAD Interface */ /* ************************************************************************** */ void AuthManagerDriver::protocol(const string& message) const { istringstream is(message); ostringstream os; string action; string result; string info=""; int id; os << "Message received: " << message; NebulaLog::log("AuM", Log::DEBUG, os); // Parse the driver message if ( is.good() ) is >> action >> ws; else return; if ( is.good() ) is >> result >> ws; else return; if ( is.good() ) { is >> id >> ws; if ( is.fail() ) { if ( action == "LOG" ) { is.clear(); getline(is,info); NebulaLog::log("AuM", log_type(result[0]), info.c_str()); } return; } } else return; getline(is,info); if (action == "LOG") { NebulaLog::log("AuM",Log::INFO,info.c_str()); } else if (result == "SUCCESS") { authm->notify_request(id,true,info); } else { authm->notify_request(id,false,info); } return; } /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ void AuthManagerDriver::recover() { NebulaLog::log("AuM",Log::INFO,"Recovering Authorization drivers"); }
{ "content_hash": "6d8ccb95bd327224672efa3a94d25f64", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 80, "avg_line_length": 32.29770992366412, "alnum_prop": 0.3540534152682581, "repo_name": "atodorov-storpool/one", "id": "4727b158166a1a1fcc17d182be032ab59f17919d", "size": "4231", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/authm/AuthManagerDriver.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Augeas", "bytes": "1970" }, { "name": "C", "bytes": "1576927" }, { "name": "C++", "bytes": "4598065" }, { "name": "CSS", "bytes": "55171" }, { "name": "Go", "bytes": "376286" }, { "name": "HTML", "bytes": "759302" }, { "name": "Java", "bytes": "494484" }, { "name": "JavaScript", "bytes": "2720172" }, { "name": "Lex", "bytes": "11041" }, { "name": "Makefile", "bytes": "3066" }, { "name": "Python", "bytes": "180292" }, { "name": "Ruby", "bytes": "3980063" }, { "name": "Shell", "bytes": "891518" }, { "name": "TSQL", "bytes": "24079" }, { "name": "Yacc", "bytes": "36176" } ], "symlink_target": "" }
/* * Shared string macros. * * Using shared macros helps minimize strings data size because it's easy * to check if an existing string could be used. String constants don't * need to be all defined here; defining a string here makes sense if there's * a high chance the string could be reused. Also, using macros allows * a call site express the exact string needed, but the macro may map to an * approximate string to reduce unique string count. Macros can also be * more easily tuned for low memory targets than #if defined()s throughout * the code base. * * Because format strings behave differently in the call site (they need to * be followed by format arguments), they use a special prefix DUK_STR_FMT_. * * On some compilers using explicit shared strings is preferable; on others * it may be better to use straight literals because the compiler will combine * them anyway, and such strings won't end up unnecessarily in a symbol table. */ #if !defined(DUK_ERRMSG_H_INCLUDED) #define DUK_ERRMSG_H_INCLUDED /* Mostly API and built-in method related */ #define DUK_STR_INTERNAL_ERROR "internal error" #define DUK_STR_UNSUPPORTED "unsupported" #define DUK_STR_INVALID_COUNT "invalid count" #define DUK_STR_INVALID_ARGS "invalid args" #define DUK_STR_INVALID_STATE "invalid state" #define DUK_STR_INVALID_INPUT "invalid input" #define DUK_STR_INVALID_LENGTH "invalid length" #define DUK_STR_NOT_CONSTRUCTABLE "not constructable" #define DUK_STR_CONSTRUCT_ONLY "constructor requires 'new'" #define DUK_STR_NOT_CALLABLE "not callable" #define DUK_STR_NOT_EXTENSIBLE "not extensible" #define DUK_STR_NOT_WRITABLE "not writable" #define DUK_STR_NOT_CONFIGURABLE "not configurable" #define DUK_STR_INVALID_CONTEXT "invalid context" #define DUK_STR_INVALID_INDEX "invalid args" #define DUK_STR_PUSH_BEYOND_ALLOC_STACK "cannot push beyond allocated stack" #define DUK_STR_NOT_UNDEFINED "unexpected type" #define DUK_STR_NOT_NULL "unexpected type" #define DUK_STR_NOT_BOOLEAN "unexpected type" #define DUK_STR_NOT_NUMBER "unexpected type" #define DUK_STR_NOT_STRING "unexpected type" #define DUK_STR_NOT_OBJECT "unexpected type" #define DUK_STR_NOT_POINTER "unexpected type" #define DUK_STR_NOT_BUFFER "not buffer" /* still in use with verbose messages */ #define DUK_STR_UNEXPECTED_TYPE "unexpected type" #define DUK_STR_NOT_THREAD "unexpected type" #define DUK_STR_NOT_COMPFUNC "unexpected type" #define DUK_STR_NOT_NATFUNC "unexpected type" #define DUK_STR_NOT_C_FUNCTION "unexpected type" #define DUK_STR_NOT_FUNCTION "unexpected type" #define DUK_STR_NOT_REGEXP "unexpected type" #define DUK_STR_TOPRIMITIVE_FAILED "coercion to primitive failed" #define DUK_STR_NUMBER_OUTSIDE_RANGE "number outside range" #define DUK_STR_NOT_OBJECT_COERCIBLE "not object coercible" #define DUK_STR_CANNOT_NUMBER_COERCE_SYMBOL "cannot number coerce Symbol" #define DUK_STR_CANNOT_STRING_COERCE_SYMBOL "cannot string coerce Symbol" #define DUK_STR_STRING_TOO_LONG "string too long" #define DUK_STR_BUFFER_TOO_LONG "buffer too long" #define DUK_STR_ALLOC_FAILED "alloc failed" #define DUK_STR_WRONG_BUFFER_TYPE "wrong buffer type" #define DUK_STR_ENCODE_FAILED "encode failed" #define DUK_STR_DECODE_FAILED "decode failed" #define DUK_STR_NO_SOURCECODE "no sourcecode" #define DUK_STR_RESULT_TOO_LONG "result too long" /* JSON */ #define DUK_STR_FMT_PTR "%p" #define DUK_STR_FMT_INVALID_JSON "invalid json (at offset %ld)" #define DUK_STR_JSONDEC_RECLIMIT "json decode recursion limit" #define DUK_STR_JSONENC_RECLIMIT "json encode recursion limit" #define DUK_STR_CYCLIC_INPUT "cyclic input" /* Object property access */ #define DUK_STR_PROXY_REVOKED "proxy revoked" #define DUK_STR_INVALID_BASE "invalid base value" #define DUK_STR_STRICT_CALLER_READ "cannot read strict 'caller'" #define DUK_STR_PROXY_REJECTED "proxy rejected" #define DUK_STR_INVALID_ARRAY_LENGTH "invalid array length" #define DUK_STR_SETTER_UNDEFINED "setter undefined" #define DUK_STR_INVALID_DESCRIPTOR "invalid descriptor" /* Proxy */ #define DUK_STR_INVALID_TRAP_RESULT "invalid trap result" /* Variables */ /* Lexer */ #define DUK_STR_INVALID_ESCAPE "invalid escape" #define DUK_STR_UNTERMINATED_STRING "unterminated string" #define DUK_STR_UNTERMINATED_COMMENT "unterminated comment" #define DUK_STR_UNTERMINATED_REGEXP "unterminated regexp" #define DUK_STR_TOKEN_LIMIT "token limit" #define DUK_STR_REGEXP_SUPPORT_DISABLED "regexp support disabled" #define DUK_STR_INVALID_NUMBER_LITERAL "invalid number literal" #define DUK_STR_INVALID_TOKEN "invalid token" /* Compiler */ #define DUK_STR_PARSE_ERROR "parse error" #define DUK_STR_DUPLICATE_LABEL "duplicate label" #define DUK_STR_INVALID_LABEL "invalid label" #define DUK_STR_INVALID_ARRAY_LITERAL "invalid array literal" #define DUK_STR_INVALID_OBJECT_LITERAL "invalid object literal" #define DUK_STR_INVALID_VAR_DECLARATION "invalid variable declaration" #define DUK_STR_CANNOT_DELETE_IDENTIFIER "cannot delete identifier" #define DUK_STR_INVALID_EXPRESSION "invalid expression" #define DUK_STR_INVALID_LVALUE "invalid lvalue" #define DUK_STR_EXPECTED_IDENTIFIER "expected identifier" #define DUK_STR_EMPTY_EXPR_NOT_ALLOWED "empty expression not allowed" #define DUK_STR_INVALID_FOR "invalid for statement" #define DUK_STR_INVALID_SWITCH "invalid switch statement" #define DUK_STR_INVALID_BREAK_CONT_LABEL "invalid break/continue label" #define DUK_STR_INVALID_RETURN "invalid return" #define DUK_STR_INVALID_TRY "invalid try" #define DUK_STR_INVALID_THROW "invalid throw" #define DUK_STR_WITH_IN_STRICT_MODE "with in strict mode" #define DUK_STR_FUNC_STMT_NOT_ALLOWED "function statement not allowed" #define DUK_STR_UNTERMINATED_STMT "unterminated statement" #define DUK_STR_INVALID_ARG_NAME "invalid argument name" #define DUK_STR_INVALID_FUNC_NAME "invalid function name" #define DUK_STR_INVALID_GETSET_NAME "invalid getter/setter name" #define DUK_STR_FUNC_NAME_REQUIRED "function name required" /* Regexp */ #define DUK_STR_INVALID_QUANTIFIER "invalid regexp quantifier" #define DUK_STR_INVALID_QUANTIFIER_NO_ATOM "quantifier without preceding atom" #define DUK_STR_INVALID_QUANTIFIER_VALUES "quantifier values invalid (qmin > qmax)" #define DUK_STR_QUANTIFIER_TOO_MANY_COPIES "quantifier requires too many atom copies" #define DUK_STR_UNEXPECTED_CLOSING_PAREN "unexpected closing parenthesis" #define DUK_STR_UNEXPECTED_END_OF_PATTERN "unexpected end of pattern" #define DUK_STR_UNEXPECTED_REGEXP_TOKEN "unexpected token in regexp" #define DUK_STR_INVALID_REGEXP_FLAGS "invalid regexp flags" #define DUK_STR_INVALID_REGEXP_ESCAPE "invalid regexp escape" #define DUK_STR_INVALID_BACKREFS "invalid backreference(s)" #define DUK_STR_INVALID_REGEXP_CHARACTER "invalid regexp character" #define DUK_STR_UNTERMINATED_CHARCLASS "unterminated character class" #define DUK_STR_INVALID_RANGE "invalid range" /* Limits */ #define DUK_STR_VALSTACK_LIMIT "valstack limit" #define DUK_STR_CALLSTACK_LIMIT "callstack limit" #define DUK_STR_CATCHSTACK_LIMIT "catchstack limit" #define DUK_STR_PROTOTYPE_CHAIN_LIMIT "prototype chain limit" #define DUK_STR_BOUND_CHAIN_LIMIT "function call bound chain limit" #define DUK_STR_C_CALLSTACK_LIMIT "C call stack depth limit" #define DUK_STR_COMPILER_RECURSION_LIMIT "compiler recursion limit" #define DUK_STR_BYTECODE_LIMIT "bytecode limit" #define DUK_STR_REG_LIMIT "register limit" #define DUK_STR_TEMP_LIMIT "temp limit" #define DUK_STR_CONST_LIMIT "const limit" #define DUK_STR_FUNC_LIMIT "function limit" #define DUK_STR_REGEXP_COMPILER_RECURSION_LIMIT "regexp compiler recursion limit" #define DUK_STR_REGEXP_EXECUTOR_RECURSION_LIMIT "regexp executor recursion limit" #define DUK_STR_REGEXP_EXECUTOR_STEP_LIMIT "regexp step limit" #endif /* DUK_ERRMSG_H_INCLUDED */
{ "content_hash": "98f9c3e136fb564ae84f3c64b4279d7d", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 103, "avg_line_length": 60.320754716981135, "alnum_prop": 0.6333020540089668, "repo_name": "harold-b/duktape", "id": "e25907985f66f6d31ecdbc463263a1b402f1eb74", "size": "9591", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src-input/duk_strings.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "3648567" }, { "name": "C++", "bytes": "35955" }, { "name": "CSS", "bytes": "32873" }, { "name": "CoffeeScript", "bytes": "130" }, { "name": "HTML", "bytes": "4384224" }, { "name": "Java", "bytes": "3043" }, { "name": "JavaScript", "bytes": "10116953" }, { "name": "Lua", "bytes": "34905" }, { "name": "Makefile", "bytes": "62975" }, { "name": "Perl", "bytes": "177" }, { "name": "Perl6", "bytes": "33007" }, { "name": "Python", "bytes": "226061" }, { "name": "Ruby", "bytes": "28928" }, { "name": "Shell", "bytes": "11275" } ], "symlink_target": "" }
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".SharedPreferences"> <item android:id="@+id/action_settings" android:title="@string/action_settings" android:orderInCategory="100" android:showAsAction="never" /> </menu>
{ "content_hash": "592328ad6b5a017062e7c9e1d2910c48", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 86, "avg_line_length": 62.8, "alnum_prop": 0.7292993630573248, "repo_name": "claudiordgz/android_playground", "id": "79a8e55dafefa595630a73f2fa5ff4365c15cb23", "size": "314", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SharedPreferences/app/src/main/res/menu/menu_shared_preferences.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "19430" } ], "symlink_target": "" }
<?php namespace Feft\AddressBundle\Tests; use Feft\AddressBundle\Entity\Address; use Feft\AddressBundle\Entity\Country; use Feft\AddressBundle\Entity\Locality; use Feft\AddressBundle\Entity\PostalCode; use Feft\AddressBundle\Entity\Region; use Feft\AddressBundle\Entity\Street; use Feft\AddressBundle\Helper\EnvelopeAddressFormatter; use Feft\AddressBundle\Model\PostalValidator\Factory; class EnvelopeAddressFormatterTest extends \PHPUnit_Framework_TestCase { private $address; function setUp() { $this->address = new Address(); $country = new Country("Poland", "PL"); $country->setLocalShortName("Polska"); $locality = new Locality(); $locality->setName("Tychy"); $region = new Region(); $region->setName("śląskie"); $locality->setRegion($region); $country->addRegion($locality->getRegion()); $locality->getRegion()->setCountry($country); $street = new Street(); $street->setName("Wolności"); $code = new PostalCode(); $code->setCode("43-100"); $code->setValidator(Factory::getInstance($code, $country->getCode())); $this->address->setCountry($country); $this->address->setRegion($region); $this->address->setLocality($locality); $this->address->setStreet($street); $this->address->setNumber("20 m. 21"); $this->address->setPostalCode($code); } public function testGetFormattedAddress() { $helper = new EnvelopeAddressFormatter(); $string = $helper->getFormattedAddress($this->address, array()); # method use nl2br function $this->assertContains("<br />", $string); } }
{ "content_hash": "ea28e6cac36c76c36a9a1b5dab3308f1", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 78, "avg_line_length": 30.553571428571427, "alnum_prop": 0.6493278784336646, "repo_name": "Feft/AddressBundle", "id": "f256a123306f52079f306657d4dac025777cef95", "size": "1714", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Tests/Helper/EnvelopeAddressFormatterTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "15829" }, { "name": "Makefile", "bytes": "376" }, { "name": "PHP", "bytes": "125903" } ], "symlink_target": "" }
package org.jboss.hal.client.deployment.wizard; import org.jboss.hal.client.shared.uploadwizard.UploadContext; public class DeploymentContext extends UploadContext { public String name; public String runtimeName; public boolean enabled; }
{ "content_hash": "4b59307dee6c08a4bf17c468b59e8b0f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 62, "avg_line_length": 23.181818181818183, "alnum_prop": 0.788235294117647, "repo_name": "michpetrov/hal.next", "id": "e5255c32a8f6ccd9c46f82081600ef42ea38b9bb", "size": "856", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "app/src/main/java/org/jboss/hal/client/deployment/wizard/DeploymentContext.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "38443" }, { "name": "HTML", "bytes": "218186" }, { "name": "Java", "bytes": "6810395" }, { "name": "JavaScript", "bytes": "45507" }, { "name": "Less", "bytes": "72087" }, { "name": "Shell", "bytes": "15270" } ], "symlink_target": "" }
<AssignMessage name='AM-NoSessionResponse'> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> <Set> <Payload contentType='application/json'>{ "message" : "Session not found" }</Payload> <StatusCode>404</StatusCode> <ReasonPhrase>Not Found</ReasonPhrase> </Set> </AssignMessage>
{ "content_hash": "b542a105d6c37bf3acddb3f7b9f5c580", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 61, "avg_line_length": 30.8, "alnum_prop": 0.7337662337662337, "repo_name": "DinoChiesa/devjam3-20170405", "id": "9cba41ea28ccb15e73608f6e4c865b0312aded5e", "size": "308", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Resources/oauth2-oidc/apiproxy/policies/AM-NoSessionResponse.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "4868" }, { "name": "HTML", "bytes": "9605" }, { "name": "JavaScript", "bytes": "76177" } ], "symlink_target": "" }
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using Squidex.Infrastructure; using Squidex.Infrastructure.Collections; namespace Squidex.Domain.Apps.Core.Apps.Json; public sealed class LanguageConfigSurrogate : ISurrogate<LanguageConfig> { public Language[]? Fallback { get; set; } public bool IsOptional { get; set; } public void FromSource(LanguageConfig source) { IsOptional = source.IsOptional; Fallback = source.Fallbacks.ToArray(); } public LanguageConfig ToSource() { if (!IsOptional && (Fallback == null || Fallback.Length == 0)) { return LanguageConfig.Default; } else { return new LanguageConfig(IsOptional, ReadonlyList.Create(Fallback)); } } }
{ "content_hash": "65fe24cfaebe8638da1cb616ea67ae75", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 81, "avg_line_length": 29.83783783783784, "alnum_prop": 0.5172101449275363, "repo_name": "Squidex/squidex", "id": "0112e26366df49f3c85a819ee51c23f3ebe172c6", "size": "1106", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "backend/src/Squidex.Domain.Apps.Core.Model/Apps/Json/LanguageConfigSurrogate.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "598" }, { "name": "C#", "bytes": "6497411" }, { "name": "CSS", "bytes": "11107" }, { "name": "Dockerfile", "bytes": "2599" }, { "name": "HTML", "bytes": "829638" }, { "name": "JavaScript", "bytes": "32540" }, { "name": "Mustache", "bytes": "4810" }, { "name": "PowerShell", "bytes": "5434" }, { "name": "SCSS", "bytes": "158966" }, { "name": "Shell", "bytes": "1663" }, { "name": "TypeScript", "bytes": "2124543" } ], "symlink_target": "" }
#pragma once // MESSAGE RALLY_FETCH_POINT PACKING #define MAVLINK_MSG_ID_RALLY_FETCH_POINT 176 MAVPACKED( typedef struct __mavlink_rally_fetch_point_t { uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ uint8_t idx; /*< point index (first point is 0)*/ }) mavlink_rally_fetch_point_t; #define MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN 3 #define MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN 3 #define MAVLINK_MSG_ID_176_LEN 3 #define MAVLINK_MSG_ID_176_MIN_LEN 3 #define MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC 234 #define MAVLINK_MSG_ID_176_CRC 234 #if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_RALLY_FETCH_POINT { \ 176, \ "RALLY_FETCH_POINT", \ 3, \ { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_rally_fetch_point_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_rally_fetch_point_t, target_component) }, \ { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_rally_fetch_point_t, idx) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_RALLY_FETCH_POINT { \ "RALLY_FETCH_POINT", \ 3, \ { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_rally_fetch_point_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_rally_fetch_point_t, target_component) }, \ { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_rally_fetch_point_t, idx) }, \ } \ } #endif /** * @brief Pack a rally_fetch_point message * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * * @param target_system System ID * @param target_component Component ID * @param idx point index (first point is 0) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rally_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t target_system, uint8_t target_component, uint8_t idx) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN); #else mavlink_rally_fetch_point_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.idx = idx; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT; return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC); } /** * @brief Pack a rally_fetch_point message on a channel * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into * @param target_system System ID * @param target_component Component ID * @param idx point index (first point is 0) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rally_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint8_t target_system,uint8_t target_component,uint8_t idx) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN); #else mavlink_rally_fetch_point_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.idx = idx; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN); #endif msg->msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT; return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC); } /** * @brief Encode a rally_fetch_point struct * * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * @param rally_fetch_point C-struct to read the message contents from */ static inline uint16_t mavlink_msg_rally_fetch_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rally_fetch_point_t* rally_fetch_point) { return mavlink_msg_rally_fetch_point_pack(system_id, component_id, msg, rally_fetch_point->target_system, rally_fetch_point->target_component, rally_fetch_point->idx); } /** * @brief Encode a rally_fetch_point struct on a channel * * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into * @param rally_fetch_point C-struct to read the message contents from */ static inline uint16_t mavlink_msg_rally_fetch_point_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rally_fetch_point_t* rally_fetch_point) { return mavlink_msg_rally_fetch_point_pack_chan(system_id, component_id, chan, msg, rally_fetch_point->target_system, rally_fetch_point->target_component, rally_fetch_point->idx); } /** * @brief Send a rally_fetch_point message * @param chan MAVLink channel to send the message * * @param target_system System ID * @param target_component Component ID * @param idx point index (first point is 0) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS static inline void mavlink_msg_rally_fetch_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN]; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC); #else mavlink_rally_fetch_point_t packet; packet.target_system = target_system; packet.target_component = target_component; packet.idx = idx; _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, (const char *)&packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC); #endif } /** * @brief Send a rally_fetch_point message * @param chan MAVLink channel to send the message * @param struct The MAVLink struct to serialize */ static inline void mavlink_msg_rally_fetch_point_send_struct(mavlink_channel_t chan, const mavlink_rally_fetch_point_t* rally_fetch_point) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS mavlink_msg_rally_fetch_point_send(chan, rally_fetch_point->target_system, rally_fetch_point->target_component, rally_fetch_point->idx); #else _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, (const char *)rally_fetch_point, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC); #endif } #if MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN /* This varient of _send() can be used to save stack space by re-using memory from the receive buffer. The caller provides a mavlink_message_t which is the size of a full mavlink message. This is usually the receive buffer for the channel, and allows a reply to an incoming message with minimum stack space usage. */ static inline void mavlink_msg_rally_fetch_point_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char *buf = (char *)msgbuf; _mav_put_uint8_t(buf, 0, target_system); _mav_put_uint8_t(buf, 1, target_component); _mav_put_uint8_t(buf, 2, idx); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC); #else mavlink_rally_fetch_point_t *packet = (mavlink_rally_fetch_point_t *)msgbuf; packet->target_system = target_system; packet->target_component = target_component; packet->idx = idx; _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, (const char *)packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC); #endif } #endif #endif // MESSAGE RALLY_FETCH_POINT UNPACKING /** * @brief Get field target_system from rally_fetch_point message * * @return System ID */ static inline uint8_t mavlink_msg_rally_fetch_point_get_target_system(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 0); } /** * @brief Get field target_component from rally_fetch_point message * * @return Component ID */ static inline uint8_t mavlink_msg_rally_fetch_point_get_target_component(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 1); } /** * @brief Get field idx from rally_fetch_point message * * @return point index (first point is 0) */ static inline uint8_t mavlink_msg_rally_fetch_point_get_idx(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 2); } /** * @brief Decode a rally_fetch_point message into a struct * * @param msg The message to decode * @param rally_fetch_point C-struct to decode the message contents into */ static inline void mavlink_msg_rally_fetch_point_decode(const mavlink_message_t* msg, mavlink_rally_fetch_point_t* rally_fetch_point) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS rally_fetch_point->target_system = mavlink_msg_rally_fetch_point_get_target_system(msg); rally_fetch_point->target_component = mavlink_msg_rally_fetch_point_get_target_component(msg); rally_fetch_point->idx = mavlink_msg_rally_fetch_point_get_idx(msg); #else uint8_t len = msg->len < MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN? msg->len : MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN; memset(rally_fetch_point, 0, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN); memcpy(rally_fetch_point, _MAV_PAYLOAD(msg), len); #endif }
{ "content_hash": "a8943eb4a35847f4fa6aadb07b2dbd57", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 227, "avg_line_length": 41.954372623574145, "alnum_prop": 0.7129780677904658, "repo_name": "seeul8er/DroneBridge", "id": "42b195b27faa1724a43cf5259c22634f01299a43", "size": "11034", "binary": false, "copies": "13", "ref": "refs/heads/master", "path": "video/legacy/mavlink/ardupilotmega/mavlink_msg_rally_fetch_point.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "294162" }, { "name": "C++", "bytes": "1304" }, { "name": "CMake", "bytes": "13614" }, { "name": "HTML", "bytes": "3727" }, { "name": "Makefile", "bytes": "4951" }, { "name": "Python", "bytes": "77228" }, { "name": "Shell", "bytes": "95928" } ], "symlink_target": "" }
from __future__ import (unicode_literals, absolute_import, division, print_function) from snisi_malaria.indicators.common import gen_shortcut from snisi_core.indicators import IndicatorTable, is_ref, ref_is class CasPaludismeSimpleTraitesCTA(IndicatorTable): """ Tableau: Cas de paludisme simple traités par CTA """ name = "Tableau 7" title = " " caption = "Cas de paludisme simple traités par CTA" add_percentage = True add_total = True INDICATORS = [ is_ref(gen_shortcut('u5_total_simple_malaria_cases', "Nbre de cas simple moins de 5ans")), ref_is(0)(gen_shortcut('u5_total_treated_malaria_cases', "Nbre de cas traités par CTA moins de 5ans")), is_ref(gen_shortcut('o5_total_simple_malaria_cases', "Nbre de cas simple 5ans et plus")), ref_is(2)(gen_shortcut('o5_total_treated_malaria_cases', "Nbre de cas traités par CTA 5ans et plus")), gen_shortcut('total_confirmed_malaria_cases', "Nbre de cas confirmés"), is_ref(gen_shortcut('total_simple_malaria_cases', "Nbre de cas simple")), ref_is(2)(gen_shortcut('total_treated_malaria_cases', "Nbre de cas traités par CTA")), ] class CasPaludismeConfirmesTraitesCTA(IndicatorTable): """ Graphe: Nombre de cas de paludisme confirmés et nombre de cas traités par CTA """ name = "Figure 17" title = " " caption = ("Nombre de cas de paludisme confirmés et " "nombre de cas traités par CTA") rendering_type = 'graph' graph_type = 'column' INDICATORS = [ gen_shortcut('total_confirmed_malaria_cases', "Nbre de cas confirmés"), gen_shortcut('total_treated_malaria_cases', "Nbre de cas traités par CTA"), ] class EvolutionProportionCasPaludismeSimpleTraitesU5O5(IndicatorTable): """ Graphe: Évolution des proportions de cas de paludisme simple traités par CTA Chez les moins de 5 ans et les 5 ans et plus """ name = "Figure 18" title = " " caption = ("Évolution des cas de paludisme " "simple traités par CTA Chez les moins de 5 ans " "et les 5 ans et plus") rendering_type = 'graph' graph_type = 'column' INDICATORS = [ gen_shortcut('u5_total_treated_malaria_cases', "Nbre de cas traités par CTA chez les moins de 5 ans"), gen_shortcut('o5_total_treated_malaria_cases', "Nbre de cas traités par CTA chez les 5 ans et plus") ] class EvolutionProportionCasPaludismeSimpleTraitesu5O51(IndicatorTable): """ Graphe: Évolution des proportions de cas de paludisme simple traités par CTA Chez les moins de 5 ans et les 5 ans et plus """ name = "Figure 19" title = " " caption = ("Évolution des cas de paludisme " "simple traités par CTA Chez les moins de 5 ans " "et les 5 ans et plus") rendering_type = 'graph' graph_type = 'spline' INDICATORS = [ gen_shortcut('u5_total_treated_malaria_cases', "Nbre de cas traités par CTA chez les moins de 5 ans"), gen_shortcut('o5_total_treated_malaria_cases', "Nbre de cas traités par CTA chez les 5 ans et plus") ] WIDGETS = [CasPaludismeSimpleTraitesCTA, CasPaludismeConfirmesTraitesCTA, EvolutionProportionCasPaludismeSimpleTraitesU5O5, EvolutionProportionCasPaludismeSimpleTraitesu5O51] TITLE = "Traitement par CTA"
{ "content_hash": "95deedafe7d0481da9efc95dabb101e9", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 79, "avg_line_length": 37.43434343434343, "alnum_prop": 0.6111710739341608, "repo_name": "yeleman/snisi", "id": "a2b6f014316e97806067483867fdda5a91a7c911", "size": "3809", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "snisi_malaria/indicators/section2b.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "410022" }, { "name": "HTML", "bytes": "1007275" }, { "name": "Java", "bytes": "7211" }, { "name": "JavaScript", "bytes": "292583" }, { "name": "Python", "bytes": "2237855" }, { "name": "Shell", "bytes": "111" } ], "symlink_target": "" }
#include "tensorflow/core/lib/io/buffered_inputstream.h" #include "tensorflow/core/lib/io/random_inputstream.h" namespace tensorflow { namespace io { BufferedInputStream::BufferedInputStream(InputStreamInterface* input_stream, size_t buffer_bytes, bool owns_input_stream) : input_stream_(input_stream), size_(buffer_bytes), owns_input_stream_(owns_input_stream) { buf_.reserve(size_); } BufferedInputStream::BufferedInputStream(RandomAccessFile* file, size_t buffer_bytes) : BufferedInputStream(new RandomAccessInputStream(file), buffer_bytes, true) {} BufferedInputStream::~BufferedInputStream() { if (owns_input_stream_) { delete input_stream_; } } Status BufferedInputStream::FillBuffer() { if (!file_status_.ok()) { pos_ = 0; limit_ = 0; return file_status_; } Status s = input_stream_->ReadNBytes(size_, &buf_); pos_ = 0; limit_ = buf_.size(); if (!s.ok()) { file_status_ = s; } return s; } template <typename StringType> Status BufferedInputStream::ReadLineHelper(StringType* result, bool include_eol) { result->clear(); Status s; size_t start_pos = pos_; while (true) { if (pos_ == limit_) { result->append(buf_.data() + start_pos, pos_ - start_pos); // Get more data into buffer s = FillBuffer(); if (limit_ == 0) { break; } start_pos = pos_; } char c = buf_[pos_]; if (c == '\n') { result->append(buf_.data() + start_pos, pos_ - start_pos); if (include_eol) { result->append(1, c); } pos_++; return Status::OK(); } // We don't append '\r' to *result if (c == '\r') { result->append(buf_.data() + start_pos, pos_ - start_pos); start_pos = pos_ + 1; } pos_++; } if (errors::IsOutOfRange(s) && !result->empty()) { return Status::OK(); } return s; } Status BufferedInputStream::ReadNBytes(int64 bytes_to_read, tstring* result) { if (bytes_to_read < 0) { return errors::InvalidArgument("Can't read a negative number of bytes: ", bytes_to_read); } result->clear(); if (pos_ == limit_ && !file_status_.ok() && bytes_to_read > 0) { return file_status_; } result->reserve(bytes_to_read); Status s; while (result->size() < static_cast<size_t>(bytes_to_read)) { // Check whether the buffer is fully read or not. if (pos_ == limit_) { s = FillBuffer(); // If we didn't read any bytes, we're at the end of the file; break out. if (limit_ == 0) { DCHECK(!s.ok()); file_status_ = s; break; } } const int64 bytes_to_copy = std::min<int64>(limit_ - pos_, bytes_to_read - result->size()); result->insert(result->size(), buf_, pos_, bytes_to_copy); pos_ += bytes_to_copy; } // Filling the buffer might lead to a situation when we go past the end of // the file leading to an OutOfRange() status return. But we might have // obtained enough data to satisfy the function call. Returning OK then. if (errors::IsOutOfRange(s) && (result->size() == static_cast<size_t>(bytes_to_read))) { return Status::OK(); } return s; } Status BufferedInputStream::SkipNBytes(int64 bytes_to_skip) { if (bytes_to_skip < 0) { return errors::InvalidArgument("Can only skip forward, not ", bytes_to_skip); } if (pos_ + bytes_to_skip < limit_) { // If we aren't skipping too much, then we can just move pos_; pos_ += bytes_to_skip; } else { // Otherwise, we already have read limit_ - pos_, so skip the rest. At this // point we need to get fresh data into the buffer, so reset pos_ and // limit_. Status s = input_stream_->SkipNBytes(bytes_to_skip - (limit_ - pos_)); pos_ = 0; limit_ = 0; if (errors::IsOutOfRange(s)) { file_status_ = s; } return s; } return Status::OK(); } int64 BufferedInputStream::Tell() const { return input_stream_->Tell() - (limit_ - pos_); } Status BufferedInputStream::Seek(int64 position) { if (position < 0) { return errors::InvalidArgument("Seeking to a negative position: ", position); } // Position of the buffer's lower limit within file. const int64 buf_lower_limit = input_stream_->Tell() - limit_; if (position < buf_lower_limit) { // Seek before buffer, reset input stream and skip 'position' bytes. TF_RETURN_IF_ERROR(Reset()); return SkipNBytes(position); } if (position < Tell()) { // Seek within buffer before 'pos_' pos_ -= Tell() - position; return Status::OK(); } // Seek after 'pos_' return SkipNBytes(position - Tell()); } template <typename T> Status BufferedInputStream::ReadAll(T* result) { result->clear(); Status status; while (status.ok()) { status = FillBuffer(); if (limit_ == 0) { break; } result->append(buf_); pos_ = limit_; } if (errors::IsOutOfRange(status)) { file_status_ = status; return Status::OK(); } return status; } template Status BufferedInputStream::ReadAll<std::string>(std::string* result); template Status BufferedInputStream::ReadAll<tstring>(tstring* result); Status BufferedInputStream::Reset() { TF_RETURN_IF_ERROR(input_stream_->Reset()); pos_ = 0; limit_ = 0; file_status_ = Status::OK(); return Status::OK(); } Status BufferedInputStream::ReadLine(std::string* result) { return ReadLineHelper(result, false); } Status BufferedInputStream::ReadLine(tstring* result) { return ReadLineHelper(result, false); } std::string BufferedInputStream::ReadLineAsString() { std::string result; ReadLineHelper(&result, true).IgnoreError(); return result; } Status BufferedInputStream::SkipLine() { Status s; bool skipped = false; while (true) { if (pos_ == limit_) { // Get more data into buffer s = FillBuffer(); if (limit_ == 0) { break; } } char c = buf_[pos_++]; skipped = true; if (c == '\n') { return Status::OK(); } } if (errors::IsOutOfRange(s) && skipped) { return Status::OK(); } return s; } } // namespace io } // namespace tensorflow
{ "content_hash": "b7f5200b4319e6304854a9e16b315172", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 79, "avg_line_length": 26.589211618257263, "alnum_prop": 0.5875468164794008, "repo_name": "sarvex/tensorflow", "id": "a2fb4dc382a5d4c4d0fb3ebd232ce0417f206a2c", "size": "7076", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "tensorflow/core/lib/io/buffered_inputstream.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "148184" }, { "name": "C++", "bytes": "6224499" }, { "name": "CSS", "bytes": "107" }, { "name": "HTML", "bytes": "650478" }, { "name": "Java", "bytes": "53519" }, { "name": "JavaScript", "bytes": "6659" }, { "name": "Jupyter Notebook", "bytes": "777935" }, { "name": "Objective-C", "bytes": "1288" }, { "name": "Protocol Buffer", "bytes": "61743" }, { "name": "Python", "bytes": "3474762" }, { "name": "Shell", "bytes": "45640" }, { "name": "TypeScript", "bytes": "283668" } ], "symlink_target": "" }
#include "gdal_pam.h" #include "cpl_string.h" #include "regex.h" #include <string> #include <memory> #include <map> #define __EXECUTABLE__ #define EARLY_TEMPLATE #include "raslib/template_inst.hh" #include "raslib/structuretype.hh" #include "raslib/type.hh" #include "rasodmg/database.hh" CPL_CVSID("$Id: rasdamandataset.cpp 27044 2014-03-16 23:41:27Z rouault $"); CPL_C_START void GDALRegister_RASDAMAN(void); CPL_C_END class Subset { public: Subset(int x_lo, int x_hi, int y_lo, int y_hi) : m_x_lo(x_lo), m_x_hi(x_hi), m_y_lo(y_lo), m_y_hi(y_hi) {} bool operator < (const Subset& rhs) const { if (m_x_lo < rhs.m_x_lo || m_x_hi < rhs.m_x_hi || m_y_lo < rhs.m_y_lo || m_y_hi < rhs.m_y_hi) { return true; } return false; } bool contains(const Subset& other) const { return m_x_lo <= other.m_x_lo && m_x_hi >= other.m_x_hi && m_y_lo <= other.m_y_lo && m_y_hi >= other.m_y_hi; } bool within(const Subset& other) const { return other.contains(*this); } void operator = (const Subset& rhs) { m_x_lo = rhs.m_x_lo; m_x_hi = rhs.m_x_hi; m_y_lo = rhs.m_y_lo; m_y_hi = rhs.m_y_hi; } int x_lo() const { return m_x_lo; } int x_hi() const { return m_x_hi; } int y_lo() const { return m_y_lo; } int y_hi() const { return m_y_hi; } private: int m_x_lo; int m_x_hi; int m_y_lo; int m_y_hi; }; /************************************************************************/ /* ==================================================================== */ /* RasdamanDataset */ /* ==================================================================== */ /************************************************************************/ typedef std::map<Subset, r_Ref<r_GMarray> > ArrayCache; class RasdamanRasterBand; static CPLString getQuery(const char *templateString, const char* x_lo, const char* x_hi, const char* y_lo, const char* y_hi); class RasdamanDataset : public GDALPamDataset { friend class RasdamanRasterBand; public: RasdamanDataset(const char*, int, const char*, const char*, const char*); ~RasdamanDataset(); static GDALDataset *Open( GDALOpenInfo * ); protected: virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, int, int *, int, int, int ); private: ArrayCache m_array_cache; r_Ref<r_GMarray>& request_array(int x_lo, int x_hi, int y_lo, int y_hi, int& offsetX, int& offsetY); r_Ref<r_GMarray>& request_array(const Subset&, int& offsetX, int& offsetY); void clear_array_cache(); r_Set<r_Ref_Any> execute(const char* string); void getTypes(const r_Base_Type* baseType, int &counter, int pos); void createBands(const char* queryString); r_Database database; r_Transaction transaction; CPLString queryParam; CPLString host; int port; CPLString username; CPLString userpassword; CPLString databasename; int xPos; int yPos; int tileXSize; int tileYSize; }; /************************************************************************/ /* RasdamanDataset() */ /************************************************************************/ RasdamanDataset::RasdamanDataset(const char* _host, int _port, const char* _username, const char* _userpassword, const char* _databasename) : host(_host), port(_port), username(_username), userpassword(_userpassword), databasename(_databasename) { database.set_servername(host, port); database.set_useridentification(username, userpassword); database.open(databasename); } /************************************************************************/ /* ~RasdamanDataset() */ /************************************************************************/ RasdamanDataset::~RasdamanDataset() { if (transaction.get_status() == r_Transaction::active) { transaction.commit(); } database.close(); FlushCache(); } CPLErr RasdamanDataset::IRasterIO( GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, void * pData, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nBandCount, int *panBandMap, int nPixelSpace, int nLineSpace, int nBandSpace) { if (eRWFlag != GF_Read) { CPLError(CE_Failure, CPLE_NoWriteAccess, "Write support is not implemented."); return CE_Failure; } transaction.begin(r_Transaction::read_only); /* TODO: Setup database access/transaction */ int dummyX, dummyY; /* Cache the whole image region */ CPLDebug("rasdaman", "Pre-caching region (%d, %d, %d, %d).", nXOff, nXOff + nXSize, nYOff, nYOff + nYSize); request_array(nXOff, nXOff + nXSize, nYOff, nYOff + nYSize, dummyX, dummyY); CPLErr ret = GDALDataset::IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize, nBufYSize, eBufType, nBandCount, panBandMap, nPixelSpace, nLineSpace, nBandSpace); transaction.commit(); /* Clear the cache */ clear_array_cache(); return ret; } r_Ref<r_GMarray>& RasdamanDataset::request_array(int x_lo, int x_hi, int y_lo, int y_hi, int& offsetX, int& offsetY) { return request_array(Subset(x_lo, x_hi, y_lo, y_hi), offsetX, offsetY); }; r_Ref<r_GMarray>& RasdamanDataset::request_array(const Subset& subset, int& offsetX, int& offsetY) { // set the offsets to 0 offsetX = 0; offsetY = 0; // check whether or not the subset was already requested ArrayCache::iterator it = m_array_cache.find(subset); if (it != m_array_cache.end()) { CPLDebug("rasdaman", "Fetching tile (%d, %d, %d, %d) from cache.", subset.x_lo(), subset.x_hi(), subset.y_lo(), subset.y_hi()); return it->second; } // check if any tile contains the requested one for(it = m_array_cache.begin(); it != m_array_cache.end(); ++it) { if (it->first.contains(subset)) { const Subset& existing = it->first; // TODO: check if offsets are correct offsetX = subset.x_lo() - existing.x_lo(); offsetY = subset.y_lo() - existing.y_lo(); CPLDebug("rasdaman", "Found matching tile (%d, %d, %d, %d) for requested tile (%d, %d, %d, %d). Offests are (%d, %d).", existing.x_lo(), existing.x_hi(), existing.y_lo(), existing.y_hi(), subset.x_lo(), subset.x_hi(), subset.y_lo(), subset.y_hi(), offsetX, offsetY); return it->second; } } if (transaction.get_status() != r_Transaction::active) { transaction.begin(r_Transaction::read_only); } CPLDebug("rasdaman", "Tile (%d, %d, %d, %d) not found in cache, requesting it.", subset.x_lo(), subset.x_hi(), subset.y_lo(), subset.y_hi()); char x_lo[11], x_hi[11], y_lo[11], y_hi[11]; snprintf(x_lo, sizeof(x_lo), "%d", subset.x_lo()); snprintf(x_hi, sizeof(x_hi), "%d", subset.x_hi()); snprintf(y_lo, sizeof(y_lo), "%d", subset.y_lo()); snprintf(y_hi, sizeof(y_hi), "%d", subset.y_hi()); CPLString queryString = getQuery(queryParam, x_lo, x_hi, y_lo, y_hi); r_Set<r_Ref_Any> result_set = execute(queryString); if (result_set.get_element_type_schema()->type_id() == r_Type::MARRAYTYPE) { // TODO: throw exception } if (result_set.cardinality() != 1) { // TODO: throw exception } r_Ref<r_GMarray> result_array = r_Ref<r_GMarray>(*result_set.create_iterator()); //std::auto_ptr<r_GMarray> ptr(new r_GMarray); //r_GMarray* ptr_ = ptr.get(); //(*ptr) = *result_array; //std::pair<ArrayCache::iterator, bool> inserted = m_array_cache.insert(ArrayCache::value_type(subset, ptr)); std::pair<ArrayCache::iterator, bool> inserted = m_array_cache.insert(ArrayCache::value_type(subset, result_array)); return inserted.first->second;//*(ptr); }; void RasdamanDataset::clear_array_cache() { m_array_cache.clear(); }; /************************************************************************/ /* ==================================================================== */ /* RasdamanRasterBand */ /* ==================================================================== */ /************************************************************************/ class RasdamanRasterBand : public GDALPamRasterBand { friend class RasdamanDataset; int nRecordSize; int typeOffset; int typeSize; public: RasdamanRasterBand( RasdamanDataset *, int, GDALDataType type, int offset, int size, int nBlockXSize, int nBlockYSize ); ~RasdamanRasterBand(); virtual CPLErr IReadBlock( int, int, void * ); }; /************************************************************************/ /* RasdamanParams */ /************************************************************************/ /*struct RasdamanParams { RasdamanParams(const char* dataset_info); void connect(const r_Database&); const char *query; const char *host; const int port; const char *username; const char *password; };*/ /************************************************************************/ /* RasdamanRasterBand() */ /************************************************************************/ RasdamanRasterBand::RasdamanRasterBand( RasdamanDataset *poDS, int nBand, GDALDataType type, int offset, int size, int nBlockXSize, int nBlockYSize ) { this->poDS = poDS; this->nBand = nBand; eDataType = type; typeSize = size; typeOffset = offset; this->nBlockXSize = nBlockXSize; this->nBlockYSize = nBlockYSize; nRecordSize = nBlockXSize * nBlockYSize * typeSize; } /************************************************************************/ /* ~RasdamanRasterBand() */ /************************************************************************/ RasdamanRasterBand::~RasdamanRasterBand() {} /************************************************************************/ /* IReadBlock() */ /************************************************************************/ CPLErr RasdamanRasterBand::IReadBlock( int nBlockXOff, int nBlockYOff, void * pImage ) { RasdamanDataset *poGDS = (RasdamanDataset *) poDS; memset(pImage, 0, nRecordSize); try { int x_lo = nBlockXOff * nBlockXSize, x_hi = MIN(poGDS->nRasterXSize, (nBlockXOff + 1) * nBlockXSize), y_lo = nBlockYOff * nBlockYSize, y_hi = MIN(poGDS->nRasterYSize, (nBlockYOff + 1) * nBlockYSize), offsetX = 0, offsetY = 0; r_Ref<r_GMarray>& gmdd = poGDS->request_array(x_lo, x_hi, y_lo, y_hi, offsetX, offsetY); int xPos = poGDS->xPos; int yPos = poGDS->yPos; r_Minterval sp = gmdd->spatial_domain(); r_Point extent = sp.get_extent(); r_Point base = sp.get_origin(); int extentX = extent[xPos]; int extentY = extent[yPos]; CPLDebug("rasdaman", "Extents (%d, %d).", extentX, extentY); r_Point access = base; char *resultPtr; for(int y = y_lo; y < y_hi; ++y) { for(int x = x_lo; x < x_hi; ++x) { resultPtr = (char*)pImage + ((y - y_lo) * nBlockXSize + x - x_lo) * typeSize; //resultPtr = (char*) pImage access[xPos] = x;// base[xPos] + offsetX; TODO: check if required access[yPos] = y;// base[yPos] + offsetY; const char *data = (*gmdd)[access] + typeOffset; memcpy(resultPtr, data, typeSize); } } } catch (r_Error error) { CPLError(CE_Failure, CPLE_AppDefined, "%s", error.what()); return CPLGetLastErrorType(); } return CE_None; } /************************************************************************/ /* ==================================================================== */ /* RasdamanDataset */ /* ==================================================================== */ /************************************************************************/ static CPLString getOption(const char *string, regmatch_t cMatch, const char* defaultValue) { if (cMatch.rm_eo == -1 || cMatch.rm_so == -1) return defaultValue; char *result = new char[cMatch.rm_eo-cMatch.rm_so+1]; strncpy(result, string + cMatch.rm_so, cMatch.rm_eo - cMatch.rm_so); result[cMatch.rm_eo-cMatch.rm_so] = 0; CPLString osResult = result; delete[] result; return osResult; } static int getOption(const char *string, regmatch_t cMatch, int defaultValue) { if (cMatch.rm_eo == -1 || cMatch.rm_so == -1) return defaultValue; char *result = new char[cMatch.rm_eo-cMatch.rm_so+1]; strncpy(result, string + cMatch.rm_so, cMatch.rm_eo - cMatch.rm_so); result[cMatch.rm_eo-cMatch.rm_so] = 0; int nRet = atoi(result); delete[] result; return nRet; } void replace(CPLString& str, const char *from, const char *to) { if(strlen(from) == 0) return; size_t start_pos = 0; while((start_pos = str.find(from, start_pos)) != std::string::npos) { str.replace(start_pos, strlen(from), to); start_pos += strlen(to); // In case 'to' contains 'from', like replacing 'x' with 'yx' } } static CPLString getQuery(const char *templateString, const char* x_lo, const char* x_hi, const char* y_lo, const char* y_hi) { CPLString result(templateString); replace(result, "$x_lo", x_lo); replace(result, "$x_hi", x_hi); replace(result, "$y_lo", y_lo); replace(result, "$y_hi", y_hi); return result; } GDALDataType mapRasdamanTypesToGDAL(r_Type::r_Type_Id typeId) { switch (typeId) { case r_Type::ULONG: return GDT_UInt32; case r_Type::LONG: return GDT_Int32; case r_Type::SHORT: return GDT_Int16; case r_Type::USHORT: return GDT_UInt16; case r_Type::BOOL: case r_Type::CHAR: return GDT_Byte; case r_Type::DOUBLE: return GDT_Float64; case r_Type::FLOAT: return GDT_Float32; case r_Type::COMPLEXTYPE1: return GDT_CFloat32; case r_Type::COMPLEXTYPE2: return GDT_CFloat64; default: return GDT_Unknown; } } void RasdamanDataset::getTypes(const r_Base_Type* baseType, int &counter, int pos) { if (baseType->isStructType()) { r_Structure_Type* tp = (r_Structure_Type*) baseType; int elem = tp->count_elements(); for (int i = 0; i < elem; ++i) { r_Attribute attr = (*tp)[i]; getTypes(&attr.type_of(), counter, attr.global_offset()); } } if (baseType->isPrimitiveType()) { r_Primitive_Type *primType = (r_Primitive_Type*)baseType; r_Type::r_Type_Id typeId = primType->type_id(); SetBand(counter, new RasdamanRasterBand(this, counter, mapRasdamanTypesToGDAL(typeId), pos, primType->size(), this->tileXSize, this->tileYSize)); counter ++; } } void RasdamanDataset::createBands(const char* queryString) { r_Set<r_Ref_Any> result_set; r_OQL_Query query (queryString); r_oql_execute (query, result_set); if (result_set.get_element_type_schema()->type_id() == r_Type::MARRAYTYPE) { r_Iterator<r_Ref_Any> iter = result_set.create_iterator(); r_Ref<r_GMarray> gmdd = r_Ref<r_GMarray>(*iter); const r_Base_Type* baseType = gmdd->get_base_type_schema(); int counter = 1; getTypes(baseType, counter, 0); } } r_Set<r_Ref_Any> RasdamanDataset::execute(const char* string) { CPLDebug("rasdaman", "Executing query '%s'.", string); r_Set<r_Ref_Any> result_set; r_OQL_Query query(string); r_oql_execute(query, result_set); return result_set; } static int getExtent(const char *queryString, int &pos) { r_Set<r_Ref_Any> result_set; r_OQL_Query query (queryString); r_oql_execute (query, result_set); if (result_set.get_element_type_schema()->type_id() == r_Type::MINTERVALTYPE) { r_Iterator<r_Ref_Any> iter = result_set.create_iterator(); r_Ref<r_Minterval> interv = r_Ref<r_Minterval>(*iter); r_Point extent = interv->get_extent(); int dim = extent.dimension(); int result = -1; for (int i = 0; i < dim; ++i) { if (extent[i] == 1) continue; if (result != -1) return -1; result = extent[i]; pos = i; } if (result == -1) return 1; else return result; } else return -1; } /************************************************************************/ /* Open() */ /************************************************************************/ GDALDataset *RasdamanDataset::Open( GDALOpenInfo * poOpenInfo ) { // buffer to communicate errors char errbuffer[4096]; // fast checks if current module should handle the request // check 1: the request is not on a existing file in the file system if (poOpenInfo->fp != NULL) { return NULL; } // check 2: the request contains --collection char* connString = poOpenInfo->pszFilename; if (!EQUALN(connString, "rasdaman", 8)) { return NULL; } // regex for parsing options regex_t optionRegEx; // regex for parsing query regex_t queryRegEx; // array to store matching subexpressions regmatch_t matches[10]; #define QUERY_POSITION 2 #define SERVER_POSITION 3 #define PORT_POSITION 4 #define USERNAME_POSITION 5 #define USERPASSWORD_POSITION 6 #define DATABASE_POSITION 7 #define TILEXSIZE_POSITION 8 #define TILEYSIZE_POSITION 9 int result = regcomp(&optionRegEx, "^rasdaman:(query='([[:alnum:][:punct:] ]+)'|host='([[:alnum:][:punct:]]+)'|port=([0-9]+)|user='([[:alnum:]]+)'|password='([[:alnum:]]+)'|database='([[:alnum:]]+)'|tileXSize=([0-9]+)|tileYSize=([0-9]+)| )*", REG_EXTENDED); // should never happen if (result != 0) { regerror(result, &optionRegEx, errbuffer, 4096); CPLError(CE_Failure, CPLE_AppDefined, "Internal error at compiling option parsing regex: %s", errbuffer); return NULL; } result = regcomp(&queryRegEx, "^select ([[:alnum:][:punct:] ]*) from ([[:alnum:][:punct:] ]*)$", REG_EXTENDED); // should never happen if (result != 0) { regerror(result, &queryRegEx, errbuffer, 4096); CPLError(CE_Failure, CPLE_AppDefined, "Internal error at compiling option parsing regex: %s", errbuffer); return NULL; } // executing option parsing regex on the connection string and checking if it succeeds result = regexec(&optionRegEx, connString, 10, matches, 0); if (result != 0) { regerror(result, &optionRegEx, errbuffer, 4096); CPLError(CE_Failure, CPLE_AppDefined, "Parsing opening parameters failed with error: %s", errbuffer); regfree(&optionRegEx); regfree(&queryRegEx); return NULL; } regfree(&optionRegEx); // checking if the whole expressions was matches, if not give an error where // the matching stopped and exit if (size_t(matches[0].rm_eo) < strlen(connString)) { CPLError(CE_Failure, CPLE_AppDefined, "Parsing opening parameters failed with error: %s", connString + matches[0].rm_eo); regfree(&queryRegEx); return NULL; } CPLString queryParam = getOption(connString, matches[QUERY_POSITION], (const char*)NULL); CPLString host = getOption(connString, matches[SERVER_POSITION], "localhost"); int port = getOption(connString, matches[PORT_POSITION], 7001); CPLString username = getOption(connString, matches[USERNAME_POSITION], "rasguest"); CPLString userpassword = getOption(connString, matches[USERPASSWORD_POSITION], "rasguest"); CPLString databasename = getOption(connString, matches[DATABASE_POSITION], "RASBASE"); int tileXSize = getOption(connString, matches[TILEXSIZE_POSITION], 1024); int tileYSize = getOption(connString, matches[TILEYSIZE_POSITION], 1024); result = regexec(&queryRegEx, queryParam, 10, matches, 0); if (result != 0) { regerror(result, &queryRegEx, errbuffer, 4096); CPLError(CE_Failure, CPLE_AppDefined, "Parsing query parameter failed with error: %s", errbuffer); regfree(&queryRegEx); return NULL; } regfree(&queryRegEx); CPLString osQueryString = "select sdom("; osQueryString += getOption(queryParam, matches[1], ""); osQueryString += ") from "; osQueryString += getOption(queryParam, matches[2], ""); CPLDebug("rasdaman", "osQueryString: %s", osQueryString.c_str()); CPLString queryX = getQuery(osQueryString, "*", "*", "0", "0"); CPLString queryY = getQuery(osQueryString, "0", "0", "*", "*"); CPLString queryUnit = getQuery(queryParam, "0", "0", "0", "0"); CPLDebug("rasdaman", "queryX: %s", queryX.c_str()); CPLDebug("rasdaman", "queryY: %s", queryY.c_str()); CPLDebug("rasdaman", "queryUnit: %s", queryUnit.c_str()); RasdamanDataset *rasDataset = NULL; try { rasDataset = new RasdamanDataset(host, port, username, userpassword, databasename); //getMyExtent(osQueryString, posX, sizeX, posY, sizeY); r_Transaction transaction; transaction.begin(r_Transaction::read_only); int dimX = getExtent(queryX, rasDataset->xPos); int dimY = getExtent(queryY, rasDataset->yPos); rasDataset->nRasterXSize = dimX; rasDataset->nRasterYSize = dimY; rasDataset->tileXSize = tileXSize; rasDataset->tileYSize = tileYSize; rasDataset->createBands(queryUnit); transaction.commit(); rasDataset->queryParam = queryParam; rasDataset->host = host; rasDataset->port = port; rasDataset->username = username; rasDataset->userpassword = userpassword; rasDataset->databasename = databasename; return rasDataset; } catch (r_Error error) { CPLError(CE_Failure, CPLE_AppDefined, "%s", error.what()); delete rasDataset; return NULL; } return rasDataset; } /************************************************************************/ /* GDALRegister_RASDAMAN() */ /************************************************************************/ extern void GDALRegister_RASDAMAN() { GDALDriver *poDriver; if( GDALGetDriverByName( "RASDAMAN" ) == NULL ) { poDriver = new GDALDriver(); poDriver->SetDescription( "RASDAMAN" ); poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "RASDAMAN" ); poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "frmt_rasdaman.html" ); poDriver->pfnOpen = RasdamanDataset::Open; GetGDALDriverManager()->RegisterDriver( poDriver ); } }
{ "content_hash": "43be0da85278017d702c85c515587e60", "timestamp": "", "source": "github", "line_count": 700, "max_line_length": 259, "avg_line_length": 32.261428571428574, "alnum_prop": 0.567506531461719, "repo_name": "tilemapjp/OSGeo.GDAL.Xamarin", "id": "96abd7c93c5ada4aa2505cc6e8997962007ad730", "size": "24216", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "gdal-1.11.0/frmts/rasdaman/rasdamandataset.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Bison", "bytes": "43427" }, { "name": "C", "bytes": "9827430" }, { "name": "C#", "bytes": "1363593" }, { "name": "C++", "bytes": "37431441" }, { "name": "Java", "bytes": "745423" }, { "name": "JavaScript", "bytes": "77251" }, { "name": "Makefile", "bytes": "134911" }, { "name": "Objective-C", "bytes": "42595" }, { "name": "OpenEdge ABL", "bytes": "28024" }, { "name": "PHP", "bytes": "106999" }, { "name": "Perl", "bytes": "17266" }, { "name": "Perl6", "bytes": "37287" }, { "name": "Prolog", "bytes": "68" }, { "name": "Python", "bytes": "975080" }, { "name": "Ruby", "bytes": "2563" }, { "name": "Shell", "bytes": "749856" }, { "name": "Smalltalk", "bytes": "422" }, { "name": "TeX", "bytes": "344" }, { "name": "Visual Basic", "bytes": "49037" } ], "symlink_target": "" }
const bcrypt = require('bcrypt-nodejs'); const crypto = require('crypto'); const mongoose = require('mongoose'); const userSchema = new mongoose.Schema({ email: { type: String, required: true }, username: { type: String, unique: true }, password: String, description: { type: String }, roles: { type: Array, default: ['standart'] }, ratings: [{ sport: String, rating: Number }], userDescription: String, name: String, plays: [{ sport: String, rating: { type: Number, default: 0 }, count: { type: Number, default: 0 } }], requests: [{ user: String, eventId: String }] }, { timestamps: true }); /** * Password hash middleware. */ userSchema.pre('save', function save(next) { const user = this; if (!user.isModified('password')) { return next(); } bcrypt.genSalt(10, (err, salt) => { if (err) { return next(err); } bcrypt.hash(user.password, salt, null, (err, hash) => { if (err) { return next(err); } user.password = hash; next(); }) }) }) /** * Helper method for validating user's password. */ userSchema.methods.comparePassword = function comparePassword(candidatePassword, cb) { bcrypt.compare(candidatePassword, this.password, (err, isMatch) => { cb(err, isMatch); }) } const User = mongoose.model('User', userSchema); module.exports = User;
{ "content_hash": "e9ae5d3d9dba9dff825554334e95d59f", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 86, "avg_line_length": 19.93975903614458, "alnum_prop": 0.5123867069486405, "repo_name": "ng2-slavs/Sportsemblr", "id": "ee0586f4bb711ad7582434572c5442e9568025ef", "size": "1655", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/models/user.model.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "46443" }, { "name": "HTML", "bytes": "21357" }, { "name": "JavaScript", "bytes": "30084" }, { "name": "TypeScript", "bytes": "30698" } ], "symlink_target": "" }
static NEPWorkDay *currentWorkDay; static NSMutableArray *history; //const int allowanceSeconds = 60; const int allowanceSeconds = 900; //const int maximumOvertime = 60; const int maximumOvertime = 7200; @interface NEPWorkDay () @property (strong, nonatomic) NSDateFormatter *dateFormatter; @property (strong, nonatomic) NSDateFormatter *timerFormatter; @end @implementation NEPWorkDay #pragma mark Class methods + (NEPWorkDay *)current { NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"currentWorkDay"]; currentWorkDay = [NSKeyedUnarchiver unarchiveObjectWithData:data]; if (!currentWorkDay) currentWorkDay = [[NEPWorkDay alloc] init]; return currentWorkDay; } + (void)saveCurrent { NSData *data = [NSKeyedArchiver archivedDataWithRootObject:currentWorkDay]; [[NSUserDefaults standardUserDefaults] setObject:data forKey:@"currentWorkDay"]; } + (void)resetCurrent { [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"currentWorkDay"]; currentWorkDay = [[NEPWorkDay alloc] init]; } + (NSMutableArray *)history { NSArray *userDirs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDir = [userDirs objectAtIndex:0]; NSString *fileName = [NSString stringWithFormat:@"%@/History", documentDir]; history = [NSKeyedUnarchiver unarchiveObjectWithFile:fileName]; if (!history) history = [[NSMutableArray alloc] init]; return history; } + (void)addToHistory:(NEPWorkDay *)workday { [[self history] addObject:workday]; [self saveHistory]; } + (void)saveHistory { NSArray *userDirs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDir = [userDirs objectAtIndex:0]; NSString *fileName = [NSString stringWithFormat:@"%@/History", documentDir]; [NSKeyedArchiver archiveRootObject:history toFile:fileName]; } #pragma mark getters override - (NSDateFormatter *) dateFormatter { if (!_dateFormatter) _dateFormatter = [[NSDateFormatter alloc] init]; return _dateFormatter; } - (NSDateFormatter *)timerFormatter { if (!_timerFormatter) { _timerFormatter = [[NSDateFormatter alloc] init]; [_timerFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"GMT"]]; } return _timerFormatter; } - (NSDate *)beginning { return [self roundedDate:_beginning]; } - (NSDate *)ending { return [self roundedDate:_ending]; } #pragma mark Public methods - (NSDate *)plannedEnding { return [self.beginning dateByAddingTimeInterval:NEPUserSettings.settings.workTime]; } - (int)beginningMonth { NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSCalendarUnit units = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit; NSDateComponents *components = [calendar components:units fromDate:self.beginning]; return (int) [components month]; } - (int)beginningYear { NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSCalendarUnit units = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit; NSDateComponents *components = [calendar components:units fromDate:self.beginning]; return (int) [components year]; } - (NSTimeInterval)worktime { NSTimeInterval interval; if (!_ending) { interval = [self.beginning timeIntervalSinceNow]; } else { interval = [self.beginning timeIntervalSinceDate:self.ending]; } return interval; } - (NSString *)beginningLongDate { [self.dateFormatter setDateFormat:@"dd/MM/yyy HH:mm"]; return [self.dateFormatter stringFromDate:self.beginning]; } - (NSString *)endingLongDate { [self.dateFormatter setDateFormat:@"dd/MM/yyy HH:mm"]; NSDate *endDate; if (_ending) { endDate = self.ending; } else { endDate = [self plannedEnding]; } return [self.dateFormatter stringFromDate:endDate]; } - (NSString *)beginningVerboseDate { [self.dateFormatter setDateFormat:@"EEEE, dd 'de' MMMM"]; return [self.dateFormatter stringFromDate:self.beginning]; } - (NSString *)endingVerboseDate { [self.dateFormatter setDateFormat:@"EEEE, dd 'de' MMMM"]; NSDate *endDate; if (_ending) { endDate = self.ending; } else { endDate = [self plannedEnding]; } return [self.dateFormatter stringFromDate:endDate]; } - (NSString *)beginningHour { [self.dateFormatter setDateFormat:@"HH:mm"]; return [self.dateFormatter stringFromDate:self.beginning]; } - (NSString *)endingHour { [self.dateFormatter setDateFormat:@"HH:mm"]; NSDate *endDate; if (_ending) { endDate = self.ending; } else { endDate = [self plannedEnding]; } return [self.dateFormatter stringFromDate:endDate]; } - (NSString *)workCountdown { int interval = self.workDuration - self.secondsInWork; NSDate *date = [NSDate dateWithTimeIntervalSince1970:interval]; [self.timerFormatter setDateFormat:@"HH:mm:ss"]; return [self.timerFormatter stringFromDate:date]; } - (NSString *)allowanceCountdow { int interval = self.allowanceDuration - self.secondsInAllowance; NSDate *date = [NSDate dateWithTimeIntervalSince1970:interval]; [self.timerFormatter setDateFormat:@"HH:mm:ss"]; return [self.timerFormatter stringFromDate:date]; } - (NSString *)overtimeCountdown { NSDate *date = [NSDate dateWithTimeIntervalSince1970:self.secondsInOvertime]; [self.timerFormatter setDateFormat:@"HH:mm:ss"]; return [self.timerFormatter stringFromDate:date]; } - (BOOL)started { return _beginning != nil; } - (BOOL)onWork { NSDate *workLimit = [self.beginning dateByAddingTimeInterval:NEPUserSettings.settings.workTime - allowanceSeconds]; int workSeconds = (int) [workLimit timeIntervalSince1970]; int current = (int) [[NSDate date] timeIntervalSince1970]; return workSeconds > current; } - (BOOL)onAllowance { NSDate *workLimit = [self.beginning dateByAddingTimeInterval:NEPUserSettings.settings.workTime - allowanceSeconds]; NSDate *allowanceLimit = [self.beginning dateByAddingTimeInterval:NEPUserSettings.settings.workTime + allowanceSeconds]; int workSeconds = (int) [workLimit timeIntervalSince1970]; int allowanceSeconds = (int) [allowanceLimit timeIntervalSince1970]; int current = (int) [[NSDate date] timeIntervalSince1970]; return (current >= workSeconds) && (current <= allowanceSeconds); } - (BOOL)onOvertime { NSDate *workLimit = [self.beginning dateByAddingTimeInterval:NEPUserSettings.settings.workTime + allowanceSeconds]; int workSeconds = (int) [workLimit timeIntervalSince1970]; int current = (int) [[NSDate date] timeIntervalSince1970]; return workSeconds > current; } - (int)workDuration { return NEPUserSettings.settings.workTime - allowanceSeconds; } - (int)allowanceDuration { return allowanceSeconds * 2; } - (int)overtimeDuration { return maximumOvertime; } - (int)secondsInWork { return (int) [[NSDate date] timeIntervalSinceDate:self.beginning]; } - (int)secondsInAllowance { int worktime = NEPUserSettings.settings.workTime; return self.secondsInWork - (worktime - allowanceSeconds); } - (int)secondsInOvertime { int worktime = NEPUserSettings.settings.workTime; return self.secondsInWork - (worktime + allowanceSeconds); } - (int)secondsToAllowance { return self.workDuration - self.secondsInWork; } - (int)secondsToEnding { return self.workDuration + allowanceSeconds - self.secondsInWork; } - (int)secondsToOvertime { return self.workDuration + (allowanceSeconds * 2) - self.secondsInWork; } - (int)secondsToOvertimeLimit { return self.workDuration + (allowanceSeconds * 2) + maximumOvertime - self.secondsInWork; } #pragma mark Private methods - (NSDate *)minimumToAllowance { int interval = NEPUserSettings.settings.workTime - allowanceSeconds; return [self.beginning dateByAddingTimeInterval:interval]; } - (NSDate *)overtimeBeginning { int interval = NEPUserSettings.settings.workTime + allowanceSeconds; return [self.beginning dateByAddingTimeInterval:interval]; } - (NSDate *)overtimeMax { int interval = NEPUserSettings.settings.workTime + maximumOvertime; return [self.beginning dateByAddingTimeInterval:interval]; } - (NSDate *)roundedDate:(NSDate *)date { NSTimeInterval time = floor([date timeIntervalSinceReferenceDate] / 60.0) * 60.0; return [NSDate dateWithTimeIntervalSinceReferenceDate:time]; } #pragma mark NSCoding delegate - (id)initWithCoder:(NSCoder *)aDecoder { self = [super init]; if (self) { _beginning = [aDecoder decodeObjectForKey:@"beginning"]; _ending = [aDecoder decodeObjectForKey:@"ending"]; } return self; } - (void)encodeWithCoder:(NSCoder *)aCoder { [aCoder encodeObject:_beginning forKey:@"beginning"]; [aCoder encodeObject:_ending forKey:@"ending"]; } @end
{ "content_hash": "e0ee406d0d85bf74f938ee3db2baad93", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 124, "avg_line_length": 30.64625850340136, "alnum_prop": 0.7244173140954495, "repo_name": "alexandreprates/dahora", "id": "85018d10da576019129ba12ba7821dd9b88e0c79", "size": "9172", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Da Hora/Models/NEPWorkDay.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "100536" }, { "name": "Ruby", "bytes": "72" } ], "symlink_target": "" }
require 'spec_helper' describe UserSessionsController do include Authlogic::TestCase before(:each) do activate_authlogic end describe "new" do it "should show a login form" do get 'new' response.should render_template(:new) end it "should build a new user_session and assign it to the view" do get 'new' assigns[:user_session].should be_new_record end end describe "create" do def do_post(new_params={}) @user = Factory.create(:user, :username => "Login", :password => "Login", :password_confirmation => "Login") post 'create', :user_session => { :username => "Login", :password => "Login", :remember_me => ""}.merge(new_params) end it "should build a new user_session and assign it to the view" do do_post assigns[:user_session].should be_an_instance_of(UserSession) end it "should set the flash and render on failure" do do_post :password => "wrong" flash[:error].should == I18n.t('login.flash.login_unsuccessful') response.should render_template(:new) end it "should set the flash and redirect on success" do do_post flash[:notice].should == I18n.t('login.flash.you_are_logged_in') response.should redirect_to(account_path) end end end
{ "content_hash": "db69f3d34b1eb9dd7fffdbdb8a6f46ab", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 77, "avg_line_length": 27.125, "alnum_prop": 0.6482334869431644, "repo_name": "cthree/sda-1-client", "id": "3b9c95170f2aee22f3b9ce093491f3cc2c73b70b", "size": "1302", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/controllers/user_sessions_controller_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "12862" }, { "name": "JavaScript", "bytes": "7380" }, { "name": "Ruby", "bytes": "133162" }, { "name": "Shell", "bytes": "84" } ], "symlink_target": "" }
<?php namespace Mivir\Pupil\Entities; interface FuncEntityInterface extends EntityInterface { public function setName($name); public function getName(); public function setArgs($args); public function addArg($arg); public function getArgs(); }
{ "content_hash": "393113beebbc7abb38906b5bf27cb6d6", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 32, "avg_line_length": 19.23076923076923, "alnum_prop": 0.78, "repo_name": "Dragory/Pupil.php", "id": "539d319f6e05c2a1352befc3e8fdd871d5862ce7", "size": "250", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Mivir/Pupil/Entities/FuncEntityInterface.php", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "PHP", "bytes": "29908" } ], "symlink_target": "" }
require 'active_model' module CrazyValidators class AlphaNumericalityValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) return if value.nil? unless value.to_s.match(/^\w+$/) record.errors.add(attribute, :not_alpha_numeric, options) end end end end
{ "content_hash": "9e5a7ffed2cf119cac1671d5d629fb7f", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 65, "avg_line_length": 23.714285714285715, "alnum_prop": 0.6716867469879518, "repo_name": "cyrilpic/crazy_validators", "id": "bdbd871e631bec2be00180155eb13fa3043b501a", "size": "332", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/crazy_validators/alpha_numericality_validator.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "16795" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "b8ef6c121376c344e89c067aba5f6644", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "7e0a30e2f3152f4b26ebd058e3065bb7d41c5f12", "size": "195", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Boraginales/Boraginaceae/Cynoglossum/Cynoglossum hispidum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
"""Performs requests to the Google Maps Distance Matrix API.""" from googlemaps import convert from googlemaps.convert import as_list def distance_matrix(client, origins, destinations, mode=None, language=None, avoid=None, units=None, departure_time=None, arrival_time=None, transit_mode=None, transit_routing_preference=None, traffic_model=None): """ Gets travel distance and time for a matrix of origins and destinations. :param origins: One or more locations and/or latitude/longitude values, from which to calculate distance and time. If you pass an address as a string, the service will geocode the string and convert it to a latitude/longitude coordinate to calculate directions. :type origins: a single location, or a list of locations, where a location is a string, dict, list, or tuple :param destinations: One or more addresses and/or lat/lng values, to which to calculate distance and time. If you pass an address as a string, the service will geocode the string and convert it to a latitude/longitude coordinate to calculate directions. :type destinations: a single location, or a list of locations, where a location is a string, dict, list, or tuple :param mode: Specifies the mode of transport to use when calculating directions. Valid values are "driving", "walking", "transit" or "bicycling". :type mode: string :param language: The language in which to return results. :type language: string :param avoid: Indicates that the calculated route(s) should avoid the indicated features. Valid values are "tolls", "highways" or "ferries". :type avoid: string :param units: Specifies the unit system to use when displaying results. Valid values are "metric" or "imperial". :type units: string :param departure_time: Specifies the desired time of departure. :type departure_time: int or datetime.datetime :param arrival_time: Specifies the desired time of arrival for transit directions. Note: you can't specify both departure_time and arrival_time. :type arrival_time: int or datetime.datetime :param transit_mode: Specifies one or more preferred modes of transit. This parameter may only be specified for requests where the mode is transit. Valid values are "bus", "subway", "train", "tram", "rail". "rail" is equivalent to ["train", "tram", "subway"]. :type transit_mode: string or list of strings :param transit_routing_preference: Specifies preferences for transit requests. Valid values are "less_walking" or "fewer_transfers". :type transit_routing_preference: string :param traffic_model: Specifies the predictive travel time model to use. Valid values are "best_guess" or "optimistic" or "pessimistic". The traffic_model parameter may only be specified for requests where the travel mode is driving, and where the request includes a departure_time. :rtype: matrix of distances. Results are returned in rows, each row containing one origin paired with each destination. """ params = { "origins": convert.location_list(origins), "destinations": convert.location_list(destinations) } if mode: # NOTE(broady): the mode parameter is not validated by the Maps API # server. Check here to prevent silent failures. if mode not in ["driving", "walking", "bicycling", "transit"]: raise ValueError("Invalid travel mode.") params["mode"] = mode if language: params["language"] = language if avoid: if avoid not in ["tolls", "highways", "ferries"]: raise ValueError("Invalid route restriction.") params["avoid"] = avoid if units: params["units"] = units if departure_time: params["departure_time"] = convert.time(departure_time) if arrival_time: params["arrival_time"] = convert.time(arrival_time) if departure_time and arrival_time: raise ValueError("Should not specify both departure_time and" "arrival_time.") if transit_mode: params["transit_mode"] = convert.join_list("|", transit_mode) if transit_routing_preference: params["transit_routing_preference"] = transit_routing_preference if traffic_model: params["traffic_model"] = traffic_model return client._get("/maps/api/distancematrix/json", params)
{ "content_hash": "91e910113da3e5965c792bbb9c01faa0", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 79, "avg_line_length": 40.7787610619469, "alnum_prop": 0.6762152777777778, "repo_name": "stephenmcd/google-maps-services-python", "id": "89fb23a1629fce2b1ce307725c9d3584bd3b10e8", "size": "5211", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "googlemaps/distance_matrix.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "134567" } ], "symlink_target": "" }
package org.danwoodward.sqlite.crud; import java.util.List; public interface SqliteCrudRepository { <T> List<T> retrieveAll(Class<T> type); <T> T retrieve(int id, Class<T> type); <T> T save(T obj); void delete(int id, Class<?> type); }
{ "content_hash": "d7c3e0b7fa0b2cd9f42e7857ea0c8592", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 40, "avg_line_length": 24.2, "alnum_prop": 0.7024793388429752, "repo_name": "djwoodward/sqlite-crud-repository", "id": "6d88ff7f6a95a2e5eeaa8f2bcd6e75e0b1749a89", "size": "242", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/danwoodward/sqlite/crud/SqliteCrudRepository.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "36902" } ], "symlink_target": "" }
title: Break page_title: Break | RadWordsProcessing for ASP.NET AJAX Documentation description: Break slug: radwordsprocessing-model-break tags: break published: True position: 12 --- # Break __Break__ element is an inline-level flow content element which specifies that a break should be placed at the current location. There are three types of breaks: * __Line Break__: The break restarts the document content on the next line in the document. * __Page Break__: The break restarts the document content on the next page of the document. * __Column Break__: The break restarts the document content on the next column available on the current page of the document. ## Inserting a Break All inline-level elements in a __RadFlowDocument__ need to be placed within another element. __Example 1__ shows how to create a __Break__ element and add it to a [Paragraph]({%slug radwordsprocessing-model-paragraph%}). #### __[C#] Example 1: Create Break__ {{region radwordsprocessing-model-break_0}} Break br = new Break(document); paragraph.Inlines.Add(br); {{endregion}} Note, that the paragraph should belong to the same document that is passed to the constructor of the __Break__ element. The code in __Example 1__ inserts a Break element of the default break type – Line break. You can change the type of a Break through its __BreakType__ property. __Example 2__ shows how you can change the type of the break created in __Example 1__. #### __[C#] Example 2: Change BreakType__ {{region radwordsprocessing-model-break_1}} br.BreakType = BreakType.PageBreak; {{endregion}} Inserting a break in the document can also be done with the __InsertBreak()__ method of the [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}) class. __Example 3__ shows how you can insert a break through __RadFlowDocumentEditor__. #### __[C#] Example 3: Insert break using RadFlowDocumentEditor__ {{region radwordsprocessing-model-break_2}} RadFlowDocumentEditor editor = new RadFlowDocumentEditor(new RadFlowDocument()); Break br = editor.InsertBreak(BreakType.PageBreak); {{endregion}} ## Modifying a Break The __Break__ element exposes several properties that allow you to customize it. * __BreakType__: Specifies the type of the break. * __TextWrappingRestartLocation__: Specifies the text wrapping restart location. This property affects the restart location only if __BreakType__ is set to __LineBreak__, otherwise it is ignored. The possible values are: * __NextLine__: Specifies that the line break advances the text to the next line in the document. * __NextFullLine__: Specifies that the line break advances the text to the next line in the document which is not interrupted by any floating objects. * __NextTextRegionUnblockedOnLeft__: Specifies that the line break advances the text to the next line in the document which is not interrupted by any floating objects on the left. * __NextTextRegionUnblockedOnRight__: Specifies that the line break advances the text to the next line in the document which is not interrupted by any floating objects on the right. __Example 4__ shows how you can insert a Break through __RadFlowDocumentEditor__ and modify it later. #### __[C#] Example 4: Customize a break__ {{region radwordsprocessing-model-break_3}} RadFlowDocumentEditor editor = new RadFlowDocumentEditor(new RadFlowDocument()); Break br = editor.InsertBreak(BreakType.PageBreak); br.BreakType = BreakType.LineBreak; br.TextWrappingRestartLocation = TextWrappingRestartLocation.NextFullLine; {{endregion}} # See Also * [Model]({%slug radwordsprocessing-model%}) * [Paragraph]({%slug radwordsprocessing-model-paragraph%}) * [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%})
{ "content_hash": "15562a9ab71e7a1f738038f91674d9cc", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 280, "avg_line_length": 35.45454545454545, "alnum_prop": 0.7294871794871794, "repo_name": "HemenRohani/ajax-docs", "id": "e652c682936a8f222eddaf865a905248d85ad965", "size": "3906", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "controls/wordsprocessing/model/break.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "16473" }, { "name": "HTML", "bytes": "5677" }, { "name": "JavaScript", "bytes": "96453" }, { "name": "Ruby", "bytes": "24913" } ], "symlink_target": "" }