text
stringlengths
2
1.04M
meta
dict
/** * Tutorial: Custom iPhone tabbar using Appcelerator Titanium * http://www.samjordan.co.uk/2011/02/tutorial-custom-iphone-tabbar-using-appcelerator-titanium/ * * https://github.com/netsells/customTabBar */ CustomTabBar = function(settings) { var tabBarItems = []; var tabCurrent = 0; var resetTabs = function() { for(var i = 0; i < tabBarItems.length; i++) { // Clear all the images to make sure only one is shown as selected tabBarItems[i].image = settings.imagePath+"clear.png"; } }; var assignClick = function(tabItem) { tabItem.addEventListener('click', function(e) { // Just fetching the 'i' variable from the loop var pos = e.source.pos; if (tabCurrent == pos) { // TODO // Change back to root window, like the native tab action. return false; } // Switch to the tab associated with the image pressed settings.tabBar.tabs[pos].active = true; tabCurrent = pos; // Reset all the tab images resetTabs(); // Set the current tab as selected tabBarItems[pos].image = settings.imagePath + settings.items[pos].selected; }); }; // Create the container for our tab items var customTabBar = Ti.UI.createWindow({ height: settings.height, top: 0 }); for(var i = 0; i < settings.items.length; i++) { // Go through each item and create an imageView tabBarItems[i] = Titanium.UI.createImageView({ // background is the default image backgroundImage: settings.imagePath + settings.items[i].image, // image is the selected image image: settings.imagePath + settings.items[i].selected, width: settings.width, height: settings.height, left: settings.width * i }); // Pass the item number (used later for changing tabs) tabBarItems[i].pos = i; assignClick(tabBarItems[i]); // Add to the container window customTabBar.add(tabBarItems[i]); } // Display the container and it's items settings.tabBar.add(customTabBar); customTabBar.open(); // Set the first item as current :) resetTabs(); tabBarItems[0].image = settings.imagePath + settings.items[0].selected; return { hide: function() { customTabBar.hide(); }, show: function() { customTabBar.show(); } }; };
{ "content_hash": "ad0c7c6dae39a265f8bf104a277c3f59", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 96, "avg_line_length": 26.759036144578314, "alnum_prop": 0.6744709590274651, "repo_name": "sofie/depot", "id": "7b07ad142dbb1972f7748b0c5745dac2a7210288", "size": "2221", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Resources/config/customTabBarAndroid.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "45719" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>qcert: 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="">8.11.dev / qcert - 1.4.1</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> qcert <small> 1.4.1 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-07-24 01:10:59 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-24 01:10:59 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.11.dev Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Jerome Simeon &lt;jeromesimeon@me.com&gt;&quot; homepage: &quot;https://querycert.github.io&quot; bug-reports: &quot;https://github.com/querycert/qcert/issues&quot; dev-repo: &quot;git+https://github.com/querycert/qcert&quot; license: &quot;Apache-2.0&quot; build: [ [make &quot;-j%{jobs}%&quot; &quot;qcert-coq&quot;] ] install: [ [make &quot;install-coq&quot;] ] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.8.2&quot; &amp; &lt; &quot;8.9~&quot;} &quot;coq-flocq&quot; {&gt;= &quot;2.6.1&quot; &amp; &lt; &quot;3.0~&quot;} &quot;coq-jsast&quot; {&gt;= &quot;1.0.8&quot;} ] tags: [ &quot;keyword:databases&quot; &quot;keyword:queries&quot; &quot;keyword:relational&quot; &quot;keyword:compiler&quot; &quot;date:2019-05-29&quot; &quot;logpath:Qcert&quot; ] authors: [ &quot;Josh Auerbach &lt;&gt;&quot; &quot;Martin Hirzel &lt;&gt;&quot; &quot;Louis Mandel &lt;&gt;&quot; &quot;Avi Shinnar &lt;&gt;&quot; &quot;Jerome Simeon &lt;&gt;&quot; ] synopsis: &quot;Verified compiler for data-centric languages&quot; description: &quot;&quot;&quot; This is the Coq library for Q*cert, a platform for implementing and verifying query compilers. It includes abstract syntax and semantics for several source query languages (OQL, SQL), for intermediate database representations (nested relational algebra and calculus), and correctness proofs for part of the compilation pipeline to JavaScript and Java. &quot;&quot;&quot; url { src: &quot;https://github.com/querycert/qcert/archive/v1.4.1.tar.gz&quot; checksum: &quot;d1534c7a20a749a2fedd81fc30bf0f0b&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-qcert.1.4.1 coq.8.11.dev</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.dev). The following dependencies couldn&#39;t be met: - coq-qcert -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.05.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-qcert.1.4.1</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "a0cfc8b41238a2b93a547c536f9aab0d", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 351, "avg_line_length": 43.40588235294118, "alnum_prop": 0.5522428513348693, "repo_name": "coq-bench/coq-bench.github.io", "id": "eaaca75ca7400b8be38b0b8edd3a3b162346f7f1", "size": "7381", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.6/extra-dev/8.11.dev/qcert/1.4.1.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
FROM nfnty/arch-mini:latest MAINTAINER "nfnty <docker@nfnty.se>" ENV UGID="250000" UGNAME="exim" PRIMPATH="/exim" RUN groupadd --gid "${UGID}" "${UGNAME}" && \ useradd --uid "${UGID}" --gid "${UGID}" --shell /usr/bin/false "${UGNAME}" RUN install --directory --owner=root --group="${UGNAME}" --mode=750 \ "${PRIMPATH}"{,/config} && \ install --directory --owner="${UGNAME}" --group="${UGNAME}" --mode=700 \ "${PRIMPATH}/"{log,spool,spool/db} VOLUME ["${PRIMPATH}/log", "${PRIMPATH}/spool"] ENV EXIM_VERSION="4.85-2" RUN pacman --sync --noconfirm --refresh --sysupgrade && \ pacman --sync --noconfirm "exim=${EXIM_VERSION}" && \ find /var/cache/pacman/pkg -mindepth 1 -delete && \ rm --recursive /var/spool/exim && \ ln --symbolic "${PRIMPATH}/spool" /var/spool/exim && \ rmdir /var/log/exim && \ ln --symbolic "${PRIMPATH}/log" /var/log/exim USER root EXPOSE 25 587 ENTRYPOINT ["/usr/bin/exim", "-bdf", "-q30m", "-C", "/exim/config/exim.conf"]
{ "content_hash": "91506d9542fc39e3a49dfe5a454d23e2", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 78, "avg_line_length": 36.96296296296296, "alnum_prop": 0.6082164328657315, "repo_name": "bfritz/nfnty-dockerfiles", "id": "910a26c3e5f63b2a87f5b1726d39b107abdb0a40", "size": "998", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "images/arch-exim/latest/Dockerfile", "mode": "33188", "license": "mit", "language": [ { "name": "Nginx", "bytes": "2687" }, { "name": "Python", "bytes": "20330" }, { "name": "Shell", "bytes": "33833" }, { "name": "XSLT", "bytes": "2204" } ], "symlink_target": "" }
package org.jetbrains.jps.gradle.model; import org.jdom.Element; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jps.builders.storage.BuildDataPaths; import org.jetbrains.jps.gradle.model.artifacts.JpsGradleArtifactExtension; import org.jetbrains.jps.gradle.model.impl.GradleProjectConfiguration; import org.jetbrains.jps.gradle.model.impl.artifacts.JpsGradleArtifactExtensionImpl; import org.jetbrains.jps.model.artifact.JpsArtifact; import org.jetbrains.jps.model.module.JpsDependencyElement; import org.jetbrains.jps.model.module.JpsModule; import org.jetbrains.jps.service.JpsServiceManager; /** * @author Vladislav.Soroka */ public abstract class JpsGradleExtensionService { @Nullable public static JpsGradleArtifactExtension getArtifactExtension(@NotNull JpsArtifact artifact) { return artifact.getContainer().getChild(JpsGradleArtifactExtensionImpl.ROLE); } public static JpsGradleExtensionService getInstance() { return JpsServiceManager.getInstance().getService(JpsGradleExtensionService.class); } @Nullable public abstract JpsGradleModuleExtension getExtension(@NotNull JpsModule module); /** * @deprecated use {@link #getOrCreateExtension(JpsModule, String)} instead */ @Deprecated @NotNull public abstract JpsGradleModuleExtension getOrCreateExtension(@NotNull JpsModule module, Element rootElement); @NotNull public abstract JpsGradleModuleExtension getOrCreateExtension(@NotNull JpsModule module, @Nullable String moduleType); public abstract void setProductionOnTestDependency(@NotNull JpsDependencyElement dependency, boolean value); public abstract boolean isProductionOnTestDependency(@NotNull JpsDependencyElement dependency); public abstract boolean hasGradleProjectConfiguration(@NotNull BuildDataPaths paths); @NotNull public abstract GradleProjectConfiguration getGradleProjectConfiguration(BuildDataPaths paths); }
{ "content_hash": "8e0a757af48447dcb338f41770543d73", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 120, "avg_line_length": 39.2, "alnum_prop": 0.8306122448979592, "repo_name": "paplorinc/intellij-community", "id": "f9ee0fd1386fb9641c6fe0e52195564074c44aab", "size": "2560", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "plugins/gradle/jps-plugin/src/org/jetbrains/jps/gradle/model/JpsGradleExtensionService.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
UNIX_DNSProtocolEndpointProvider::UNIX_DNSProtocolEndpointProvider() { } UNIX_DNSProtocolEndpointProvider::~UNIX_DNSProtocolEndpointProvider() { } CIMInstance UNIX_DNSProtocolEndpointProvider::constructInstance( const CIMName &className, const CIMNamespaceName &nameSpace, const UNIX_DNSProtocolEndpoint &_p) const { CIMProperty p; CIMInstance inst(className); // Set path inst.setPath(CIMObjectPath(String(""), // hostname nameSpace, CIMName("UNIX_DNSProtocolEndpoint"), constructKeyBindings(_p))); //CIM_ManagedElement Properties if (_p.getInstanceID(p)) inst.addProperty(p); if (_p.getCaption(p)) inst.addProperty(p); if (_p.getDescription(p)) inst.addProperty(p); if (_p.getElementName(p)) inst.addProperty(p); //CIM_ManagedSystemElement Properties if (_p.getInstallDate(p)) inst.addProperty(p); if (_p.getName(p)) inst.addProperty(p); if (_p.getOperationalStatus(p)) inst.addProperty(p); if (_p.getStatusDescriptions(p)) inst.addProperty(p); if (_p.getStatus(p)) inst.addProperty(p); if (_p.getHealthState(p)) inst.addProperty(p); if (_p.getCommunicationStatus(p)) inst.addProperty(p); if (_p.getDetailedStatus(p)) inst.addProperty(p); if (_p.getOperatingStatus(p)) inst.addProperty(p); if (_p.getPrimaryStatus(p)) inst.addProperty(p); //CIM_LogicalElement Properties //CIM_EnabledLogicalElement Properties if (_p.getEnabledState(p)) inst.addProperty(p); if (_p.getOtherEnabledState(p)) inst.addProperty(p); if (_p.getRequestedState(p)) inst.addProperty(p); if (_p.getEnabledDefault(p)) inst.addProperty(p); if (_p.getTimeOfLastStateChange(p)) inst.addProperty(p); if (_p.getAvailableRequestedStates(p)) inst.addProperty(p); if (_p.getTransitioningToState(p)) inst.addProperty(p); //CIM_ServiceAccessPoint Properties if (_p.getSystemCreationClassName(p)) inst.addProperty(p); if (_p.getSystemName(p)) inst.addProperty(p); if (_p.getCreationClassName(p)) inst.addProperty(p); //CIM_ProtocolEndpoint Properties if (_p.getNameFormat(p)) inst.addProperty(p); if (_p.getProtocolType(p)) inst.addProperty(p); if (_p.getProtocolIFType(p)) inst.addProperty(p); if (_p.getOtherTypeDescription(p)) inst.addProperty(p); //CIM_DNSProtocolEndpoint Properties if (_p.getHostname(p)) inst.addProperty(p); if (_p.getDHCPOptionsToUse(p)) inst.addProperty(p); if (_p.getAppendParentSuffixes(p)) inst.addProperty(p); if (_p.getAppendPrimarySuffixes(p)) inst.addProperty(p); if (_p.getDNSSuffixesToAppend(p)) inst.addProperty(p); if (_p.getDomainName(p)) inst.addProperty(p); if (_p.getRegisterThisConnectionsAddress(p)) inst.addProperty(p); if (_p.getUseSuffixWhenRegistering(p)) inst.addProperty(p); return inst; } Array<CIMKeyBinding> UNIX_DNSProtocolEndpointProvider::constructKeyBindings(const UNIX_DNSProtocolEndpoint& _p) const { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_SYSTEM_CREATION_CLASS_NAME, _p.getSystemCreationClassName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_SYSTEM_NAME, _p.getSystemName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_CREATION_CLASS_NAME, _p.getCreationClassName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_NAME, _p.getName(), CIMKeyBinding::STRING)); return keys; } #define UNIX_PROVIDER UNIX_DNSProtocolEndpointProvider #define UNIX_PROVIDER_NAME "UNIX_DNSProtocolEndpointProvider" #define CLASS_IMPLEMENTATION UNIX_DNSProtocolEndpoint #define CLASS_IMPLEMENTATION_NAME "UNIX_DNSProtocolEndpoint" #define BASE_CLASS_NAME "CIM_DNSProtocolEndpoint" #define NUMKEYS_CLASS_IMPLEMENTATION 4 #include "UNIXProviderBase.hpp"
{ "content_hash": "b2ba811c6dce35b85b7314d90b947156", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 117, "avg_line_length": 31.362068965517242, "alnum_prop": 0.759758108851017, "repo_name": "brunolauze/openpegasus-providers-old", "id": "93fcc68d5a734f692100ef9edf8577eb9b5e70d3", "size": "5376", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Providers/UNIXProviders/DNSProtocolEndpoint/UNIX_DNSProtocolEndpointProvider.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2631164" }, { "name": "C++", "bytes": "120884401" }, { "name": "Objective-C", "bytes": "64" }, { "name": "Shell", "bytes": "17094" } ], "symlink_target": "" }
import os from subprocess import Popen, PIPE from datetime import datetime import argparse import MySQLdb import json # Parse command-line options ########################################### def options(): """Parse command-line options """ parser = argparse.ArgumentParser(description="HTCondor job statistics monitor.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("-c", "--config", help="MySQL database configuration JSON file.", required=True) args = parser.parse_args() return args # Main ########################################### def main(): """Main program. """ # Parse arguments args = options() # Job universe IDs uni = { 1: "standard", 5: "vanilla", 7: "scheduler", 8: "MPI", 9: "grid", 10: "java", 11: "parallel", 12: "local", 13: "vm" } # Read the database connection configuration file config = open(args.config, "rU") # Load the JSON configuration data conf = json.load(config) # Connect to the MySQL database db = MySQLdb.connect(host=conf["hostname"], db=conf["database"], user=conf["username"], passwd=conf["password"]) # Create a database cursor c = db.cursor(MySQLdb.cursors.DictCursor) # condor_q parameters cmd = ["condor_q", "-allusers", "-autoformat:t", "ClusterId", "ProcId", "Owner", "RemoteHost", "RequestCpus", "RequestMemory", "MemoryUsage", "RequestDisk", "DiskUsage", "JobStartDate", "ServerTime", "Cmd", "JobUniverse", "WantDocker", "ShouldTransferFiles", "AcctGroup", "GlobalJobId"] machine = ["condor_status", "-autoformat:t", "JobId", "LoadAvg"] # Run condor_status to get load averages per job loads = {} ps = Popen(machine, stdout=PIPE) stdout = ps.communicate() # Process condor_q output raw = stdout[0] raw = raw.decode() table = raw.split("\n") # For each row in the output for row in table: # Remove the newline if any row = row.rstrip("\n") # Split up the columns on tab characters cols = row.split("\t") # Ignore blank lines and machines that have no job if len(cols) > 1 and cols[0] != "undefined": job_id = cols[0] loadave = cols[1] loads[job_id] = loadave # Run condor_q ps = Popen(cmd, stdout=PIPE) stdout = ps.communicate() # Process condor_q output raw = stdout[0] raw = raw.decode() # Split output into rows table = raw.split("\n") # For each row in the output for row in table: # Remove the newline if any row = row.rstrip("\n") # Split up the columns on tab characters cols = row.split("\t") # Ignore blank lines and jobs that have no host (queued jobs) if len(cols) > 1 and cols[3] != "undefined": stats = {} # If any of the request/usage values are undefined, set them to zero for i, value in enumerate(cols): if value == "undefined": cols[i] = 0 # Cluster ID stats["cluster"] = int(cols[0]) # Process/Job ID stats["process"] = int(cols[1]) # Global Job ID stats["global"] = cols[16] # Job ID job_id = str(stats["cluster"]) + "." + str(stats["process"]) # Username stats["username"] = cols[2] # Host stats["host"] = cols[3].replace("slot1@", "") # CPU # CPUs requested stats["cpu"] = int(cols[4]) # Load average stats["cpu_load"] = 0 if job_id in loads: stats["cpu_load"] = float(loads[job_id]) # Memory # Requested memory in MiB stats["memory"] = int(cols[5]) # Actual current memory usage in MiB stats["memory_usage"] = int(cols[6]) # Disk # Requested disk (usually scratch) in KiB stats["disk"] = int(cols[7]) # Actual disk usage in KiB stats["disk_usage"] = int(cols[8]) # Runtime # Job start date in epoch seconds stats["start_date"] = datetime.fromtimestamp(int(cols[9])).strftime("%Y-%m-%d %H:%M:%S") # Current time in epoch seconds stats["datetime"] = datetime.fromtimestamp(int(cols[10])).strftime("%Y-%m-%d %H:%M:%S") # Get the command name, excluding path stats["exe"] = os.path.basename(cols[11]) # Rename interactive jobs if stats["exe"] == "sleep": stats["exe"] = "(interactive)" # Get the job universe if int(cols[12]) in uni: # If this is not a Docker job, look up the universe if cols[13] == "true": stats["universe"] = "docker" else: stats["universe"] = uni[int(cols[12])] else: stats["universe"] = "unknown:" + str(cols[12]) # Does this job use file transfers? if cols[14] == "YES": stats["transfer"] = 1 else: stats["transfer"] = 0 # Groupname stats["groupname"] = cols[15].replace("group_", "") # Is this job already in the database? c.execute("""SELECT id FROM jobs WHERE global_id = %s""", [stats["global"]]) stats["id"] = c.fetchone() # This is a new job if stats["id"] is None: c.execute( """INSERT INTO jobs (cluster, process, global_id, username, groupname, start_date, cpu, memory, disk, host, universe, exe, transfer) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""", [stats["cluster"], stats["process"], stats["global"], stats["username"], stats["groupname"], stats["start_date"], stats["cpu"], stats["memory"], stats["disk"], stats["host"], stats["universe"], stats["exe"], stats["transfer"]]) c.execute("""SELECT id FROM jobs WHERE global_id = %s""", [stats["global"]]) stats["id"] = c.fetchone() # Insert the job statistics c.execute( """INSERT INTO job_stats (id, datetime, cpu_load, memory_usage, disk_usage) VALUES (%s, %s, %s, %s, %s)""", [stats["id"]["id"], stats["datetime"], stats["cpu_load"], stats["memory_usage"], stats["disk_usage"]]) if __name__ == '__main__': main()
{ "content_hash": "e0472148b73bf0a3f8b919ecb677eb0b", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 133, "avg_line_length": 35.02590673575129, "alnum_prop": 0.5140532544378699, "repo_name": "danforthcenter/htcondor-tools", "id": "181317bd61ccf661fdfdd0a1591042a1cc209c6d", "size": "6782", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "monitor/htcondor_job_monitor.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "57703" }, { "name": "Shell", "bytes": "7260" }, { "name": "TSQL", "bytes": "2338" } ], "symlink_target": "" }
package hu.vmiklos.addr_osmify; import com.google.gson.annotations.SerializedName; /** * TurboTags contains various tags about one Overpass element. */ class TurboTags { @SerializedName("addr:city") public String city; @SerializedName("addr:housenumber") public String houseNumber; @SerializedName("addr:postcode") public String postCode; @SerializedName("addr:street") public String street; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
{ "content_hash": "1267ad7aec999798107fe7bfff32ca48", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 66, "avg_line_length": 26.055555555555557, "alnum_prop": 0.7484008528784648, "repo_name": "vmiklos/vmexam", "id": "dc554bc2555f0cfeebac569efa0e14c3532f5232", "size": "632", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "osm/addr-osmify-java/src/main/java/hu/vmiklos/addr_osmify/TurboTags.java", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "1356" }, { "name": "C", "bytes": "207141" }, { "name": "C#", "bytes": "6115" }, { "name": "C++", "bytes": "174284" }, { "name": "CMake", "bytes": "90430" }, { "name": "Go", "bytes": "13344" }, { "name": "HTML", "bytes": "7421" }, { "name": "Java", "bytes": "33479" }, { "name": "JavaScript", "bytes": "15830" }, { "name": "JetBrains MPS", "bytes": "93" }, { "name": "Kotlin", "bytes": "12619" }, { "name": "M4", "bytes": "4410" }, { "name": "Makefile", "bytes": "133045" }, { "name": "Objective-C", "bytes": "6102" }, { "name": "PDDL", "bytes": "2562" }, { "name": "PHP", "bytes": "10859" }, { "name": "Perl", "bytes": "566936" }, { "name": "PowerShell", "bytes": "618" }, { "name": "Python", "bytes": "185940" }, { "name": "Rust", "bytes": "40567" }, { "name": "Shell", "bytes": "74062" }, { "name": "TypeScript", "bytes": "45072" }, { "name": "VBA", "bytes": "3117" }, { "name": "Vim Script", "bytes": "1105" }, { "name": "XSLT", "bytes": "281" } ], "symlink_target": "" }
--+ holdcas on; set system parameters 'dont_reuse_heap_file=yes'; create table tb (id int primary key, a int, b varchar(10)); insert into tb values (4,4,'4'), (1,1,'1'); create index i_tb_a on tb(a) with online; insert into tb values (2,2,'2'),(3,3,'3'); insert into tb values (5,5,'4'),(6,6,'3'); --TEST select /*+ recompile use_desc_idx */ * from tb where a > 0 and rownum<10 using index i_tb_a; drop table tb; set system parameters 'dont_reuse_heap_file=no'; commit; --+ holdcas off;
{ "content_hash": "2b8b2c726e673540de7a4781f55c7498", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 92, "avg_line_length": 30.625, "alnum_prop": 0.6612244897959184, "repo_name": "CUBRID/cubrid-testcases", "id": "3b39c81898cd14a80518a82999b028b5847d0308", "size": "490", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "sql/_31_cherry/issue_21506_more_online_index/_007_desc_index_scan/cases/_21_hint.sql", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PLSQL", "bytes": "682246" }, { "name": "Roff", "bytes": "23262735" }, { "name": "TSQL", "bytes": "5619" }, { "name": "eC", "bytes": "710" } ], "symlink_target": "" }
<?xml version="1.0"?> <!-- --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="adminhtml"> <module name="Magento_Captcha" /> </route> </router> </config>
{ "content_hash": "2d785e55fcc8d768dfd7cda84b024d8e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 135, "avg_line_length": 28.181818181818183, "alnum_prop": 0.6161290322580645, "repo_name": "tarikgwa/test", "id": "7fcddacd3ed66d8ccc172b8c33f90396172ed393", "size": "408", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "html/app/code/Magento/Captcha/etc/adminhtml/routes.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "26588" }, { "name": "CSS", "bytes": "4874492" }, { "name": "HTML", "bytes": "8635167" }, { "name": "JavaScript", "bytes": "6810903" }, { "name": "PHP", "bytes": "55645559" }, { "name": "Perl", "bytes": "7938" }, { "name": "Shell", "bytes": "4505" }, { "name": "XSLT", "bytes": "19889" } ], "symlink_target": "" }
namespace BTDB.KVDBLayer { enum KVFileType : byte { TransactionLog, KeyIndex, PureValues, PureValuesWithId, HashKeyIndex, Unknown, } }
{ "content_hash": "698df87588d5bc93063ba0b835247429", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 26, "avg_line_length": 16.166666666666668, "alnum_prop": 0.5515463917525774, "repo_name": "yonglehou/BTDB", "id": "62ba9d2d5aa54d393ca12aabff64411efe31a697", "size": "194", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "BTDB/KVDBLayer/Implementation/KVFileType.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "80" }, { "name": "C#", "bytes": "1406809" } ], "symlink_target": "" }
/** * Javascript Class Helper * @author Tom Flidr | tomflidr(at)gmail(dot)com * @version 1.1 * @date 2016-07-15 * @usage var ClassName = Class({ Extend: ParentClassName, Static: { staticMethod: function () { // call parent static method with same name this.parent(param1, param2, ...); // call any other parent static method this.parent.otherParentStaticMethod(param1, param2, ...); } }, Constructor: function () { // call parent Constructor this.parent(param1, param2); // call any other parent dynamic method this.parent.otherParentDynamicMethod(param1, param2, ...); }, dynamicMethod: function () { // call parent dynamic method with same name this.parent(param1, param2); // call any other parent dynamic method this.parent.otherParentDynamicMethod(param1, param2, ...); } }); */ Class = (function (_globalScope) { // function.prototype.bind Polyfill for Object.create('ClassName, [/* arguments*/]): // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind Function.prototype.bind||(Function.prototype.bind=function(a){if(typeof this!=='function'){throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');}var b=[].slice,c='prototype',d=b.call(arguments,1),e=this,f=function(){},g=function(){return e.apply(this instanceof f?this:a,d.concat(b.call(arguments)))};if(this[c]){f[c]=this[c]}g[c]=new f();return g}); // Class helper definition var $class = function () { var _args = [].slice.apply(arguments), _constants = $class['Constants'], _defaultClassName = 'Class', _result; if (typeof (_args[0]) == 'string') { return $class._defineNamedClass(_args[0], _args.length > 1 ? _args[1] : {}); } else { _result = $class._defineClass(_args[0], _defaultClassName); _result[_constants['Namespace']] = ''; _result[_constants['Fullname']] = _defaultClassName; return _result; } }; $class['Constants'] = { 'ClassImprint' : '$classImprint', 'InstanceImprint' : '$instanceImprint', 'Extend' : 'Extend', 'Static' : 'Static', 'Constructor' : 'Constructor', 'Name' : 'Name', 'Namespace' : 'Namespace', 'Fullname' : 'Fullname', 'self' : 'self', 'parent' : 'parent' }; $class._keywords = {}; $class['ClassImprintBaseName'] = 'class{0}'; $class['InstanceImprintBaseName'] = 'instance{0}'; $class._classImprintCounter = 0; $class._instanceImprintCounter = 0; $class._actualLevels = [ {},// dynamic methods parent calls actual level under instanceImprint key {} // static methods parent calls actual level under classImprint key ]; $class._classParents = {}; $class['CustomizeSyntax'] = function (constants) { var value = ''; for (var key in constants) { value = constants[key]; $class._keywords[value] = true; $class['Constants'][key] = value; }; }; $class['CustomizeSyntax']($class['Constants']); $class['Create'] = function (fullName, args) { var _explodedName = fullName.split('.'), _namePart = '', _currentScope = _globalScope; for (var i = 0, l = _explodedName.length; i < l; i += 1) { _namePart = _explodedName[i]; if (!(_namePart in _currentScope)) { throw new Error("Class '" + fullName + "' doesn't exist!"); } _currentScope = _currentScope[_namePart]; } args.unshift(_currentScope); return new (_currentScope.bind.apply(_currentScope, args))(); }; $class['Define'] = function (fullName, cfg) { return $class._defineNamedClass(fullName, cfg || {}); }; $class._defineNamedClass = function (fullName, cfg) { var _explodedName = fullName.split('.'), _name = _explodedName.pop(), _namePart = '', _constants = $class['Constants'], _currentScope = _globalScope, _result; for (var i = 0, l = _explodedName.length; i < l; i += 1) { _namePart = _explodedName[i]; if (!(_namePart in _currentScope)) { _currentScope[_namePart] = {}; } _currentScope = _currentScope[_namePart]; } if (cfg.toString === {}.toString) { cfg['toString'] = function () { return '[object ' + fullName + ']'; } } _result = $class._defineClass(cfg, _name); _result[_constants['Namespace']] = _explodedName.join('.'); _result[_constants['Fullname']] = fullName; _currentScope[_name] = _result; return _result; }; $class._defineClass = function (cfg, _name) { var _constants = $class['Constants'], _extend = _constants['Extend'], _nameStr = _constants['Name'], _classImprint = _constants['ClassImprint'], _self = _constants['self'], _currentClassImprint = '', _parentClassImprint = ''; // create internal class constructor from basic javascript function var Class = function () { return $class._constructor(cfg, this, [].slice.apply(arguments)); }; var _classDefinition = Class; // imprints for parent calls if (cfg[_extend]) { if (typeof (cfg[_extend][_classImprint]) == 'function') { _parentClassImprint = cfg[_extend][_classImprint](); } else { _parentClassImprint = $class._completeClassImprint(); cfg[_extend][_classImprint] = function () { return _parentClassImprint }; } } _currentClassImprint = $class._completeClassImprint(); _classDefinition[_classImprint] = function () { return _currentClassImprint }; // extend parent and current dynamic and static elements (including constructor) $class._extendParentPrototype(_classDefinition, cfg); $class._extendParentStatic(_classDefinition, cfg); $class._declareCurrentPrototype(_classDefinition, cfg); $class._declareCurrentStatic(_classDefinition, cfg); // store current Class object in local property for later use _classDefinition[_self] = _classDefinition; // to find parent definition by imprint traversing - parent calls - store parent class definition in static place if (cfg[_extend]) { _classDefinition[_self][_extend] = cfg[_extend]; $class._classParents[_currentClassImprint] = _parentClassImprint; } // to get anytime inside instance class definition without naming it: _classDefinition['prototype'][_self] = _classDefinition; // define parent calls helper in static methods $class._declareParentStaticCalls(_classDefinition); // return function with prototype - ready to use like: var instance = new ClassName(); _classDefinition[_nameStr] = _name; return _classDefinition; }; $class._constructor = function (_cfg, _context, _args) { var _constants = $class['Constants'], _constructorStr = _constants['Constructor'], _instanceImprint = ''; if (_context === _globalScope) { if (typeof (_cfg[_constructorStr]) == 'function') { _cfg[_constructorStr].apply(_context, _args); } else { throw new Error("Class definition is not possible to call as function, it's necessary to create instance with 'new' keyword before class definition."); } } else { // fingerprint for dynamic parent calls _instanceImprint = $class._completeInstanceImprint(); _context[_constants['InstanceImprint']] = function () { return _instanceImprint }; // define parent calls helper in dynamic methods in later binding here after instance is created - to work with 'this' context properly $class._declareParentDynamicCalls(_context); // call defined constructor return _context[_constructorStr].apply(_context, _args); } }; $class._completeClassImprint = function () { var _result = $class['ClassImprintBaseName'].replace('{0}', $class._classImprintCounter); $class._classImprintCounter += 1; return _result; }; $class._completeInstanceImprint = function () { var _result = $class['InstanceImprintBaseName'].replace('{0}', $class._instanceImprintCounter); $class._instanceImprintCounter += 1; return _result; }; $class._extendParentPrototype = function (classDefinition, cfg) { var _constants = $class['Constants'], _nameStr = _constants['Name'], _prototype = 'prototype', _dynamicName = '', _cfgExtend = cfg[_constants['Extend']]; var Prototype = function () { }, _currentProto; if (_cfgExtend) { /*if (Object['create']) { classDefinition[_prototype] = Object['create'](_cfgExtend[_prototype]); } else {*/ if (_cfgExtend) Prototype[_prototype] = _cfgExtend[_prototype]; classDefinition[_prototype] = new Prototype(); //} } _currentProto = classDefinition[_prototype]; for (_dynamicName in _currentProto) { if (typeof (_currentProto[_dynamicName][_nameStr]) != 'string') _currentProto[_dynamicName][_nameStr] = _dynamicName; } }; $class._extendParentStatic = function (classDefinition, cfg) { var _staticName = '', _constants = $class['Constants'], _nameStr = _constants['Name'], _cfgExtend = cfg[_constants['Extend']]; if (_cfgExtend) { for (_staticName in _cfgExtend) { if (!($class._keywords[_staticName] === true)) { classDefinition[_staticName] = _cfgExtend[_staticName]; classDefinition[_staticName][_nameStr] = _staticName; } } } }; $class._declareCurrentPrototype = function (classDefinition, cfg) { var _classPrototype = classDefinition['prototype'], _constants = $class['Constants'], _nameStr = _constants['Name'], _constructor = _constants['Constructor'], _dynamicName = ''; for (_dynamicName in cfg) { if (!($class._keywords[_dynamicName] === true)) { _classPrototype[_dynamicName] = cfg[_dynamicName]; _classPrototype[_dynamicName][_nameStr] = _dynamicName; } } if (cfg[_constructor]) { _classPrototype[_constructor] = cfg[_constructor]; _classPrototype[_constructor][_nameStr] = _constructor; } _classPrototype[_constants['InstanceImprint']] = function () { return '' }; }; $class._declareCurrentStatic = function (classDefinition, cfg) { var _staticName = '', _constants = $class['Constants'], _nameStr = _constants['Name'], _cfgStatic = cfg[_constants['Static']]; if (_cfgStatic) { for (_staticName in _cfgStatic) { if (!($class._keywords[_staticName] === true)) { classDefinition[_staticName] = _cfgStatic[_staticName]; classDefinition[_staticName][_nameStr] = _staticName; } } } }; $class._declareParentDynamicCalls = function (_context) { var _constants = $class['Constants'], _nameStr = _constants['Name'], _parent = _constants['parent'], _self = _constants['self'], _prototypeStr = 'prototype', _dynamicName = '', _currentDefinition = _context[_self], _parentDefinition = _currentDefinition[_self][_constants['Extend']], _parentDefinitionPrototype, _clsProtoParent; _currentDefinition[_prototypeStr][_parent] = function () { return $class._parentCall(this, arguments.callee.caller[_nameStr], [].slice.apply(arguments), 0); }; _clsProtoParent = _currentDefinition[_prototypeStr][_parent]; if (_parentDefinition) { _parentDefinitionPrototype = _parentDefinition[_prototypeStr]; for (_dynamicName in _parentDefinitionPrototype) { if (typeof(_parentDefinitionPrototype[_dynamicName]) == 'function' && !($class._keywords[_dynamicName] === true)) { _clsProtoParent[_dynamicName] = $class._declareParentDynamicCallsProvider(_context, _dynamicName); } } } }; $class._declareParentDynamicCallsProvider = function (_context, _dynamicName) { return function () { return $class._parentCall(_context, _dynamicName, [].slice.apply(arguments), 0); }; }; $class._declareParentStaticCalls = function (_currentDefinition) { var _constants = $class['Constants'], _nameStr = _constants['Name'], _parent = _constants['parent'], _staticName = '', _parentDefinition = _currentDefinition[_constants['Extend']], _clsParent; _currentDefinition[_parent] = function () { return $class._parentCall(this, arguments.callee.caller[_nameStr], [].slice.apply(arguments), 1); }; _clsParent = _currentDefinition[_parent]; if (_parentDefinition) { for (_staticName in _parentDefinition) { if (typeof(_parentDefinition[_staticName]) == 'function' && !Boolean($class._keywords[_staticName])) { _clsParent[_staticName] = $class._declareParentStaticCallsProvider(_currentDefinition, _staticName); } } } }; $class._declareParentStaticCallsProvider = function (_context, _staticName) { return function () { return $class._parentCall(_context, _staticName, [].slice.apply(arguments), 1); }; }; $class._parentCall = function (_context, _methodName, _args, _imprintsIndex) { var _result, _constants = $class['Constants'], _classImprintStr = _constants['ClassImprint'], _instanceImprintStr = _constants['InstanceImprint'], _selfStr = _constants['self'], _instanceImprintValue = _context[_imprintsIndex ? _classImprintStr : _instanceImprintStr](), _contextClassDefinition = _context[_selfStr], _contextClassImprintValue = _contextClassDefinition[_classImprintStr](), _parentClassImprint = $class._getParentClassImprint( _contextClassImprintValue, _instanceImprintValue, _imprintsIndex ), _parentClassDefinition = $class._getParentClassDefinition( _contextClassDefinition, _parentClassImprint ), _parentMethod = _imprintsIndex ? _parentClassDefinition[_methodName] : _parentClassDefinition['prototype'][_methodName], _parentMethodType = typeof (_parentMethod); if (_parentMethodType == 'undefined') { try { throw "No parent method named: '" + _methodName + "'."; } catch (e) { console.log(e.stack); } } else if (_parentMethodType != 'function') { throw "Parent method '" + _methodName + "' is not a function."; }; _result = _parentMethod.apply(_context, _args); delete $class._actualLevels[_imprintsIndex][_instanceImprintValue]; return _result; }; $class._getParentClassImprint = function (_contextClassImprint, _instanceImprint, _imprintsIndex) { var _levels = $class._actualLevels[_imprintsIndex], _currentImprint = '', _parentImprint = ''; if (typeof (_levels[_instanceImprint]) == 'undefined') { _levels[_instanceImprint] = _contextClassImprint; } _currentImprint = _levels[_instanceImprint]; _parentImprint = $class._classParents[_currentImprint]; if (!_parentImprint) { // no parent class definition throw new Error("No parent class defined."); } _levels[_instanceImprint] = _parentImprint; return _parentImprint; }; $class._getParentClassDefinition = function (_currentClassDefinition, _parentClassImprint) { var _constants = $class['Constants'], _extendStr = _constants['Extend'], _classImprintStr = _constants['ClassImprint'], _success = false, _parentClassDefinition; while (true) { if (typeof (_currentClassDefinition[_extendStr]) == 'undefined') break; _parentClassDefinition = _currentClassDefinition[_extendStr]; if (_parentClassDefinition[_classImprintStr]() == _parentClassImprint) { _success = true; break; } _currentClassDefinition = _parentClassDefinition; } if (!_success) { throw new Error("No parent class definition found for class imprint: '" + _parentClassImprint + "'."); } return _parentClassDefinition; }; _globalScope['Class'] = $class; return $class; })(Boolean(typeof (module) !== 'undefined' && module['exports']) ? global : this);
{ "content_hash": "795e93edbfc4634338b9f43d1dbae55e", "timestamp": "", "source": "github", "line_count": 388, "max_line_length": 390, "avg_line_length": 38.97938144329897, "alnum_prop": 0.6750198360222164, "repo_name": "tomFlidr/class.js", "id": "5a28a63a691986480124fce89300d228f93d7853", "size": "15124", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "builds/1.1.0/class.src.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "44566" }, { "name": "JavaScript", "bytes": "935335" } ], "symlink_target": "" }
mycovex = require('./index');
{ "content_hash": "4b447d01d6dfe8135bc974c6550d4b15", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 29, "avg_line_length": 30, "alnum_prop": 0.6333333333333333, "repo_name": "emepyc/biojs-testcov", "id": "c8532c7a5dc9f3fe06aefbfa99890e3ee47c48d3", "size": "30", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "browser.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "3813" } ], "symlink_target": "" }
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.cdlflex.ui.markup.html.repeater.data.table; import org.apache.wicket.markup.html.link.AbstractLink; import org.apache.wicket.markup.html.panel.GenericPanel; import org.apache.wicket.model.IModel; /** * A DataTableColumn that adds a link to the cell item. * * @param <T> The model object type * @param <S> the type of the sorting parameter */ public abstract class AbstractLinkColumn<T, S> extends DataTableColumn<T, S> { private static final long serialVersionUID = 1L; public AbstractLinkColumn(IModel<String> displayModel) { super(displayModel); } public AbstractLinkColumn(IModel<String> displayModel, S sortProperty) { super(displayModel, sortProperty); } @Override protected void populateItem(DataTableCell<T, S> cellItem, String componentId) { cellItem.add(new LinkPanel(componentId, cellItem.getRowModel(), cellItem)); } /** * Executed after the link was crated. Can be used to add additional behavior to the link by subclasses. * * @param link the created link * @param rowModel the row model */ protected void onAfterCreateLink(AbstractLink link, IModel<T> rowModel) { // hook } /** * Template method to create the link. * * @param id the component id * @param cell the cell item * @return a new action */ public abstract AbstractLink newLink(String id, DataTableCell<T, S> cell); /** * Panel that holds the link. */ public class LinkPanel extends GenericPanel<T> { private static final long serialVersionUID = 1L; public LinkPanel(String id, IModel<T> model, DataTableCell<T, S> cell) { super(id, model); setOutputMarkupId(true); AbstractLink link = AbstractLinkColumn.this.newLink("link", cell); onAfterCreateLink(link, model); add(link); } } }
{ "content_hash": "7bce1e9770942a2387998756eb62bd5e", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 108, "avg_line_length": 32.34615384615385, "alnum_prop": 0.6718192627824019, "repo_name": "flex-oss/flex-ui", "id": "07253e8129348ffef0e4d06d69d48b3bea4af61f", "size": "2523", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "flex-ui-core/src/main/java/org/cdlflex/ui/markup/html/repeater/data/table/AbstractLinkColumn.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2252" }, { "name": "HTML", "bytes": "69197" }, { "name": "Java", "bytes": "745147" }, { "name": "JavaScript", "bytes": "3270" } ], "symlink_target": "" }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.load_ipython_extension = load_ipython_extension; function filterRows(filterText) { var rows = Array.prototype.concat.apply([], document.querySelectorAll('.list_item.row')); rows.forEach(function (row) { if (!filterText || row.querySelector('.item_name').innerText.indexOf(filterText) !== -1) { row.style.display = ''; } else { row.style.display = 'none'; } }); } function load_ipython_extension() { var input = document.createElement('input'); input.setAttribute('type', 'text'); document.querySelector('#notebook_list_header').appendChild(input); input.onkeyup = function () { filterRows(input.value); }; }
{ "content_hash": "aa317cb14dbd6d99aaab2440b6364516", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 98, "avg_line_length": 30.26923076923077, "alnum_prop": 0.6353240152477764, "repo_name": "jdfreder/jupyter-tree-filter", "id": "4c4be808edc8c2cfbe7d9306224181a0e498c19a", "size": "787", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/index.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "2366" }, { "name": "Python", "bytes": "626" } ], "symlink_target": "" }
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file is autogenerated by: // mojo/public/tools/bindings/mojom_bindings_generator.py // For: // media/mojo/interfaces/media_types.mojom // package org.chromium.media.mojom; import org.chromium.base.annotations.SuppressFBWarnings; import org.chromium.mojo.bindings.DeserializationException; public final class AudioDecoderConfig extends org.chromium.mojo.bindings.Struct { private static final int STRUCT_SIZE = 56; private static final org.chromium.mojo.bindings.DataHeader[] VERSION_ARRAY = new org.chromium.mojo.bindings.DataHeader[] {new org.chromium.mojo.bindings.DataHeader(56, 0)}; private static final org.chromium.mojo.bindings.DataHeader DEFAULT_STRUCT_INFO = VERSION_ARRAY[0]; public int codec; public int sampleFormat; public int channelLayout; public int samplesPerSecond; public byte[] extraData; public org.chromium.mojo.common.mojom.TimeDelta seekPreroll; public int codecDelay; public EncryptionScheme encryptionScheme; private AudioDecoderConfig(int version) { super(STRUCT_SIZE, version); } public AudioDecoderConfig() { this(0); } public static AudioDecoderConfig deserialize(org.chromium.mojo.bindings.Message message) { return decode(new org.chromium.mojo.bindings.Decoder(message)); } /** * Similar to the method above, but deserializes from a |ByteBuffer| instance. * * @throws org.chromium.mojo.bindings.DeserializationException on deserialization failure. */ public static AudioDecoderConfig deserialize(java.nio.ByteBuffer data) { if (data == null) return null; return deserialize(new org.chromium.mojo.bindings.Message( data, new java.util.ArrayList<org.chromium.mojo.system.Handle>())); } @SuppressWarnings("unchecked") public static AudioDecoderConfig decode(org.chromium.mojo.bindings.Decoder decoder0) { if (decoder0 == null) { return null; } decoder0.increaseStackDepth(); AudioDecoderConfig result; try { org.chromium.mojo.bindings.DataHeader mainDataHeader = decoder0.readAndValidateDataHeader(VERSION_ARRAY); result = new AudioDecoderConfig(mainDataHeader.elementsOrVersion); if (mainDataHeader.elementsOrVersion >= 0) { result.codec = decoder0.readInt(8); AudioCodec.validate(result.codec); } if (mainDataHeader.elementsOrVersion >= 0) { result.sampleFormat = decoder0.readInt(12); SampleFormat.validate(result.sampleFormat); } if (mainDataHeader.elementsOrVersion >= 0) { result.channelLayout = decoder0.readInt(16); ChannelLayout.validate(result.channelLayout); } if (mainDataHeader.elementsOrVersion >= 0) { result.samplesPerSecond = decoder0.readInt(20); } if (mainDataHeader.elementsOrVersion >= 0) { result.extraData = decoder0.readBytes(24, org.chromium.mojo.bindings.BindingsHelper.NOTHING_NULLABLE, org.chromium.mojo.bindings.BindingsHelper.UNSPECIFIED_ARRAY_LENGTH); } if (mainDataHeader.elementsOrVersion >= 0) { org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(32, false); result.seekPreroll = org.chromium.mojo.common.mojom.TimeDelta.decode(decoder1); } if (mainDataHeader.elementsOrVersion >= 0) { result.codecDelay = decoder0.readInt(40); } if (mainDataHeader.elementsOrVersion >= 0) { org.chromium.mojo.bindings.Decoder decoder1 = decoder0.readPointer(48, false); result.encryptionScheme = EncryptionScheme.decode(decoder1); } } finally { decoder0.decreaseStackDepth(); } return result; } @SuppressWarnings("unchecked") @Override protected final void encode(org.chromium.mojo.bindings.Encoder encoder) { org.chromium.mojo.bindings.Encoder encoder0 = encoder.getEncoderAtDataOffset(DEFAULT_STRUCT_INFO); encoder0.encode(codec, 8); encoder0.encode(sampleFormat, 12); encoder0.encode(channelLayout, 16); encoder0.encode(samplesPerSecond, 20); encoder0.encode(extraData, 24, org.chromium.mojo.bindings.BindingsHelper.NOTHING_NULLABLE, org.chromium.mojo.bindings.BindingsHelper.UNSPECIFIED_ARRAY_LENGTH); encoder0.encode(seekPreroll, 32, false); encoder0.encode(codecDelay, 40); encoder0.encode(encryptionScheme, 48, false); } /** * @see Object#equals(Object) */ @Override public boolean equals(Object object) { if (object == this) return true; if (object == null) return false; if (getClass() != object.getClass()) return false; AudioDecoderConfig other = (AudioDecoderConfig) object; if (this.codec!= other.codec) return false; if (this.sampleFormat!= other.sampleFormat) return false; if (this.channelLayout!= other.channelLayout) return false; if (this.samplesPerSecond!= other.samplesPerSecond) return false; if (!java.util.Arrays.equals(this.extraData, other.extraData)) return false; if (!org.chromium.mojo.bindings.BindingsHelper.equals(this.seekPreroll, other.seekPreroll)) return false; if (this.codecDelay!= other.codecDelay) return false; if (!org.chromium.mojo.bindings.BindingsHelper.equals(this.encryptionScheme, other.encryptionScheme)) return false; return true; } /** * @see Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = prime + getClass().hashCode(); result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(codec); result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(sampleFormat); result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(channelLayout); result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(samplesPerSecond); result = prime * result + java.util.Arrays.hashCode(extraData); result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(seekPreroll); result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(codecDelay); result = prime * result + org.chromium.mojo.bindings.BindingsHelper.hashCode(encryptionScheme); return result; } }
{ "content_hash": "2c34431cf64f7bc70e6ac475867cc894", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 186, "avg_line_length": 39.86666666666667, "alnum_prop": 0.6396321070234113, "repo_name": "mogoweb/365browser", "id": "5354e548f7d0a6ddcdaccf5312339792620a57ee", "size": "7176", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/org/chromium/media/mojom/AudioDecoderConfig.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "18549237" }, { "name": "Makefile", "bytes": "10559" }, { "name": "Python", "bytes": "44749" } ], "symlink_target": "" }
package org.apache.ignite.internal.processors.cache; import org.apache.ignite.cache.*; import static org.apache.ignite.cache.CacheDistributionMode.*; /** * */ public class IgniteCacheAtomicNearEnabledInvokeTest extends IgniteCacheAtomicInvokeTest { /** {@inheritDoc} */ @Override protected CacheDistributionMode distributionMode() { return NEAR_PARTITIONED; } }
{ "content_hash": "779c01bfc068eb27d1dbe98872e26d68", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 89, "avg_line_length": 22.88235294117647, "alnum_prop": 0.7506426735218509, "repo_name": "gridgain/apache-ignite", "id": "3a23e49867ae6e0e447bba29b223a1b7cd0984a7", "size": "1191", "binary": false, "copies": "1", "ref": "refs/heads/sprint-2", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicNearEnabledInvokeTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "4522" }, { "name": "C++", "bytes": "28098" }, { "name": "CSS", "bytes": "17209" }, { "name": "HTML", "bytes": "260837" }, { "name": "Java", "bytes": "17999177" }, { "name": "JavaScript", "bytes": "1085" }, { "name": "PHP", "bytes": "18446" }, { "name": "Scala", "bytes": "732170" }, { "name": "Scilab", "bytes": "3923545" }, { "name": "Shell", "bytes": "407266" } ], "symlink_target": "" }
<?php class RokNavMenuFusionTheme extends AbstractRokMenuTheme { protected $defaults = array( 'roknavmenu_fusion_load_css' => 1, 'roknavmenu_fusion_enable_js' => 1, 'roknavmenu_fusion_opacity' => 1, 'roknavmenu_fusion_effect' => 'slidefade', 'roknavmenu_fusion_hidedelay' => 500, 'roknavmenu_fusion_menu_animation' => 'Sine.easeOut', 'roknavmenu_fusion_menu_duration' => 700, 'roknavmenu_fusion_pill' => 0, 'roknavmenu_fusion_pill_animation' => 'Sine.easeOut', 'roknavmenu_fusion_pill_duration' => 700, 'roknavmenu_fusion_centeredOffset' => 0, 'roknavmenu_fusion_tweakInitial_x' => -3, 'roknavmenu_fusion_tweakInitial_y' => 0, 'roknavmenu_fusion_tweakSubsequent_x' => 0, 'roknavmenu_fusion_tweakSubsequent_y' => 1, 'roknavmenu_fusion_tweak-width' => 0, 'roknavmenu_fusion_tweak-height' => 0, 'roknavmenu_fusion_enable_current_id' => 0 ); public function getFormatter($args){ require_once(dirname(__FILE__) . '/formatter.php'); return new RokNavMenuFusionFormatter($args); } public function getLayout($args){ require_once(dirname(__FILE__) . '/layout.php'); return new RokMavMenuFusionLayout($args); } }
{ "content_hash": "c2a9ac6c2a61b83facacfd4fe33d6ca1", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 61, "avg_line_length": 36.333333333333336, "alnum_prop": 0.6207951070336392, "repo_name": "creative2020/f4u", "id": "f52b3efc4a4edd8c1d75e47d4fd5d91c47a516d2", "size": "1560", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "modules/mod_roknavmenu/themes/fusion/theme.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3575" }, { "name": "CSS", "bytes": "1833367" }, { "name": "HTML", "bytes": "437498" }, { "name": "JavaScript", "bytes": "1933348" }, { "name": "PHP", "bytes": "19706784" } ], "symlink_target": "" }
ACCEPTED #### According to World Register of Marine Species #### Published in null #### Original name null ### Remarks null
{ "content_hash": "1d8ec09c5aa790b78cb5f0d99f0116af", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 32, "avg_line_length": 9.76923076923077, "alnum_prop": 0.7007874015748031, "repo_name": "mdoering/backbone", "id": "30ba12dc19bfa76ab50d31db1250715ad3473388", "size": "184", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Chromista/Ochrophyta/Craspedophyceae/Craspedomonadales/Salpingoecaceae/Salpingoeca/Salpingoeca infusionum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace GodaddyWrapper.Responses { public class SubjectAlternativeNameDetailsResponse { public string SubjectAlternativeName { get; set; } public string Status { get; set; } } }
{ "content_hash": "e1b6daee4f009cfff69f34d12cbb2faa", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 58, "avg_line_length": 23.571428571428573, "alnum_prop": 0.7363636363636363, "repo_name": "vip30/GodaddyWrapper.Net", "id": "f5bd318d6daf015318c98bdfe5131712f682b511", "size": "332", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/GodaddyWrapper/Responses/SubjectAlternativeNameDetailsResponse.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "198287" } ], "symlink_target": "" }
'use strict'; let chai = require('chai'); let assert = chai.assert; let expect = chai.expect; let sinon = require('sinon'); let request = require('supertest'); let express = require('express'); let app = require('../app'); let ejs = require('ejs'); let getCookies = require('./test_tool').getCookies; describe('Views', function() { let spy = sinon.spy(ejs, '__express'); it('Should return lost page when incorrect route is called', function(done) { request(app) .get('/derp') .end(function(err, res) { if (err) done(err); assert.isNotNull(res.body, 'got lost page'); expect(spy.calledWithMatch(/\/views\/lost\.ejs$/)).to.be.true; done(); }); }); it('Should return home page when home route is called', function(done) { request(app) .get('/') .end(function(err, res) { if (err) done(err); assert.isNotNull(res.body, 'got home page'); expect(spy.calledWithMatch(/\/views\/home\.ejs$/)).to.be.true; done(); }); }); let cookies; it('Getting Cookies', function(done) { getCookies(function(err, freshCookies) { if (err) { done(err); } else { cookies = freshCookies; done(); } }); }); it('Should return submit page when submit route is called', function(done) { let req = request(app); req.cookies = cookies; req.get('/submit') .end(function(err, res) { if (err) done(err); assert.isNotNull(res.body, 'got submit page'); expect(spy.calledWithMatch(/\/views\/submit\.ejs$/)).to.be.true; done(); }); }); });
{ "content_hash": "3d664c71f3b3c2ae24604be0c17ed284", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 79, "avg_line_length": 27.603448275862068, "alnum_prop": 0.5890068707058088, "repo_name": "developerDemetri/mosquitodb", "id": "eb92ce0157c629660690c9a80e5de1c5dbf96933", "size": "1601", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/views.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "862" }, { "name": "HTML", "bytes": "19312" }, { "name": "JavaScript", "bytes": "89959" } ], "symlink_target": "" }
package com.taobao.weex.ui.component; import android.content.Context; import android.support.annotation.NonNull; import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.text.TextUtils; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.widget.FrameLayout; import com.taobao.weex.WXEnvironment; import com.taobao.weex.WXSDKInstance; import com.taobao.weex.WXSDKManager; import com.taobao.weex.annotation.Component; import com.taobao.weex.common.Constants; import com.taobao.weex.dom.WXDomObject; import com.taobao.weex.dom.WXEvent; import com.taobao.weex.ui.ComponentCreator; import com.taobao.weex.ui.view.WXCircleIndicator; import com.taobao.weex.ui.view.WXCirclePageAdapter; import com.taobao.weex.ui.view.WXCircleViewPager; import com.taobao.weex.ui.view.gesture.WXGestureType; import com.taobao.weex.utils.WXLogUtils; import com.taobao.weex.utils.WXUtils; import com.taobao.weex.utils.WXViewUtils; import java.lang.ref.WeakReference; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; @Component(lazyload = false) public class WXSlider extends WXVContainer<FrameLayout> { public static final String INDEX = "index"; public static final String INFINITE = "infinite"; private boolean isInfinite = true; Map<String, Object> params = new HashMap<>(); private float offsetXAccuracy = 0.1f; public static class Creator implements ComponentCreator { public WXComponent createInstance(WXSDKInstance instance, WXDomObject node, WXVContainer parent) throws IllegalAccessException, InvocationTargetException, InstantiationException { return new WXSlider(instance, node, parent); } } /** * Scrollable sliderview */ /** * package **/ WXCircleViewPager mViewPager; /** * Circle indicator */ protected WXIndicator mIndicator; /** * Adapter for sliderview */ protected WXCirclePageAdapter mAdapter; protected boolean mShowIndicators; protected OnPageChangeListener mPageChangeListener = new SliderPageChangeListener(); @Deprecated public WXSlider(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, String instanceId, boolean isLazy) { this(instance, dom, parent); } public WXSlider(WXSDKInstance instance, WXDomObject node, WXVContainer parent) { super(instance, node, parent); } @Override protected FrameLayout initComponentHostView(@NonNull Context context) { FrameLayout view = new FrameLayout(context); // init view pager if (getDomObject() != null && getDomObject().getAttrs() != null) { Object obj = getDomObject().getAttrs().get(INFINITE); isInfinite = WXUtils.getBoolean(obj, true); } FrameLayout.LayoutParams pagerParams = new FrameLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); mViewPager = new WXCircleViewPager(context); mViewPager.setCircle(isInfinite); mViewPager.setLayoutParams(pagerParams); // init adapter mAdapter = new WXCirclePageAdapter(isInfinite); mViewPager.setAdapter(mAdapter); // add to parent view.addView(mViewPager); mViewPager.addOnPageChangeListener(mPageChangeListener); registerActivityStateListener(); return view; } /** * Slider is not a regular container,top/left/right/bottom not apply to view,expect indicator. */ @Override public LayoutParams getChildLayoutParams(WXComponent child,View childView, int width, int height, int left, int right, int top, int bottom) { ViewGroup.LayoutParams lp = childView.getLayoutParams(); if (lp == null) { lp = new FrameLayout.LayoutParams(width, height); } else { lp.width = width; lp.height = height; } if (lp instanceof ViewGroup.MarginLayoutParams) { //expect indicator . if (child instanceof WXIndicator) { ((ViewGroup.MarginLayoutParams) lp).setMargins(left, top, right, bottom); } else { ((ViewGroup.MarginLayoutParams) lp).setMargins(0, 0, 0, 0); } } return lp; } @Override public void addEvent(String type) { super.addEvent(type); if (Constants.Event.SCROLL.equals(type)) { if (mViewPager == null) { return; } mViewPager.addOnPageChangeListener(new SliderOnScrollListener(this)); } } @Override public boolean containsGesture(WXGestureType WXGestureType) { //TODO Slider don't support any gesture for now. return false; } @Override public ViewGroup getRealView() { return mViewPager; } @Override protected void addSubView(View view, int index) { if (view == null || mAdapter == null) { return; } if (view instanceof WXCircleIndicator) { return; } mAdapter.addPageView(view); hackTwoItemsInfiniteScroll(); mViewPager.setCurrentItem(0); if (mIndicator != null) { mIndicator.getHostView().forceLayout(); mIndicator.getHostView().requestLayout(); } } @Override public void remove(WXComponent child, boolean destroy) { if (child == null || child.getHostView() == null || mAdapter == null) { return; } mAdapter.removePageView(child.getHostView()); hackTwoItemsInfiniteScroll(); super.remove(child,destroy); } @Override public void destroy() { super.destroy(); if (mViewPager != null) { mViewPager.stopAutoScroll(); mViewPager.removeAllViews(); mViewPager.destory(); } } @Override public void onActivityResume() { if (mViewPager != null && mViewPager.isAutoScroll()) { mViewPager.startAutoScroll(); } } @Override public void onActivityStop() { if (mViewPager != null) { mViewPager.pauseAutoScroll(); } } public void addIndicator(WXIndicator indicator) { FrameLayout root = getHostView(); if (root == null) { return; } mIndicator = indicator; WXCircleIndicator indicatorView = indicator.getHostView(); if (indicatorView != null) { indicatorView.setCircleViewPager(mViewPager); // indicatorView.setOnPageChangeListener(mPageChangeListener); // commented for twice onChange() called when do slide. root.addView(indicatorView); } } @Override protected boolean setProperty(String key, Object param) { switch (key) { case Constants.Name.VALUE: String value = WXUtils.getString(param, null); if (value != null) { setValue(value); } return true; case Constants.Name.AUTO_PLAY: String aotu_play = WXUtils.getString(param, null); if (aotu_play != null) { setAutoPlay(aotu_play); } return true; case Constants.Name.SHOW_INDICATORS: String indicators = WXUtils.getString(param, null); if (indicators != null) { setShowIndicators(indicators); } return true; case Constants.Name.INTERVAL: Integer interval = WXUtils.getInteger(param, null); if (interval != null) { setInterval(interval); } return true; case Constants.Name.INDEX: Integer index = WXUtils.getInteger(param, null); if (index != null) { setIndex(index); } return true; case Constants.Name.OFFSET_X_ACCURACY: Float accuracy = WXUtils.getFloat(param, 0.1f); if (accuracy != 0) { setOffsetXAccuracy(accuracy); } return true; case Constants.Name.SCROLLABLE: boolean scrollable = WXUtils.getBoolean(param, true); setScrollable(scrollable); return true; } return super.setProperty(key, param); } @Deprecated @WXComponentProp(name = Constants.Name.VALUE) public void setValue(String value) { if (value == null || getHostView() == null) { return; } int i; try { i = Integer.parseInt(value); } catch (NumberFormatException e) { WXLogUtils.e("", e); return; } setIndex(i); } @WXComponentProp(name = Constants.Name.AUTO_PLAY) public void setAutoPlay(String autoPlay) { if (TextUtils.isEmpty(autoPlay) || autoPlay.equals("false")) { mViewPager.stopAutoScroll(); } else { mViewPager.stopAutoScroll(); mViewPager.startAutoScroll(); } } @WXComponentProp(name = Constants.Name.SHOW_INDICATORS) public void setShowIndicators(String show) { if (TextUtils.isEmpty(show) || show.equals("false")) { mShowIndicators = false; } else { mShowIndicators = true; } if (mIndicator == null) { return; } mIndicator.setShowIndicators(mShowIndicators); } @WXComponentProp(name = Constants.Name.INTERVAL) public void setInterval(int intervalMS) { if (mViewPager != null && intervalMS > 0) { mViewPager.setIntervalTime(intervalMS); } } @WXComponentProp(name = Constants.Name.INDEX) public void setIndex(int index) { if (mViewPager != null && mAdapter != null) { if (index >= mAdapter.getRealCount() || index < 0) { return; } mViewPager.setCurrentItem(index); if (mIndicator != null && mIndicator.getHostView() != null && mIndicator.getHostView().getRealCurrentItem() != index) { //OnPageChangeListener not triggered WXLogUtils.d("setIndex >>>> correction indicator to " + index); mIndicator.getHostView().setRealCurrentItem(index); mIndicator.getHostView().invalidate(); if (mPageChangeListener != null && mAdapter != null) { mPageChangeListener.onPageSelected(mAdapter.getFirst() + index); } } } } @WXComponentProp(name = Constants.Name.SCROLLABLE) public void setScrollable(boolean scrollable) { if (mViewPager != null && mAdapter != null) { if(mAdapter.getRealCount() > 0){ mViewPager.setScrollable(scrollable); } } } @WXComponentProp(name = Constants.Name.OFFSET_X_ACCURACY) public void setOffsetXAccuracy(float accuracy) { this.offsetXAccuracy = accuracy; } protected class SliderPageChangeListener implements OnPageChangeListener { private int lastPos = -1; @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int pos) { if (mAdapter.getRealPosition(pos) == lastPos) { return; } if (WXEnvironment.isApkDebugable()) { WXLogUtils.d("onPageSelected >>>>" + mAdapter.getRealPosition(pos) + " lastPos: " + lastPos); } if (mAdapter == null || mAdapter.getRealCount() == 0) { return; } int realPosition = mAdapter.getRealPosition(pos); if (mChildren == null || realPosition >= mChildren.size()) { return; } if (getDomObject().getEvents().size() == 0) { return; } WXEvent event = getDomObject().getEvents(); String ref = getDomObject().getRef(); if (event.contains(Constants.Event.CHANGE) && WXViewUtils.onScreenArea(getHostView())) { params.put(INDEX, realPosition); Map<String, Object> domChanges = new HashMap<>(); Map<String, Object> attrsChanges = new HashMap<>(); attrsChanges.put(INDEX, realPosition); domChanges.put("attrs", attrsChanges); WXSDKManager.getInstance().fireEvent(getInstanceId(), ref, Constants.Event.CHANGE, params, domChanges); } mViewPager.requestLayout(); getHostView().invalidate(); lastPos = mAdapter.getRealPosition(pos); } @Override public void onPageScrollStateChanged(int arg0) { FrameLayout root = getHostView(); if (null != root) { root.invalidate(); } } } protected static class SliderOnScrollListener implements OnPageChangeListener { private float lastPositionOffset = 99f; private int selectedPosition; private WXSlider target; public SliderOnScrollListener(WXSlider target) { this.target = target; this.selectedPosition = target.mViewPager.superGetCurrentItem(); } @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { if (lastPositionOffset == 99f) { lastPositionOffset = positionOffset; return; } float offset = positionOffset - lastPositionOffset; if (Math.abs(offset) >= target.offsetXAccuracy) { if (position == selectedPosition) { //slide to left. positionOffset[0 -> 1] Map<String,Object> event = new HashMap<>(1); event.put(Constants.Name.OFFSET_X_RATIO, -positionOffset); target.fireEvent(Constants.Event.SCROLL, event); } else if (position < selectedPosition) { //slide to right. positionOffset[1 -> 0] Map<String,Object> event = new HashMap<>(1); event.put(Constants.Name.OFFSET_X_RATIO, (1f - positionOffset)); target.fireEvent(Constants.Event.SCROLL, event); } lastPositionOffset = positionOffset; } } @Override public void onPageSelected(int position) { selectedPosition = position; } @Override public void onPageScrollStateChanged(int state) { /** * @homeblog@vip.qq.com * * add scrollstart & scrollend event * */ switch (state) { case ViewPager.SCROLL_STATE_IDLE: lastPositionOffset = 99f; target.fireEvent("scrollend"); break; case ViewPager.SCROLL_STATE_DRAGGING: target.fireEvent("scrollstart"); break; case ViewPager.SCROLL_STATE_SETTLING: break; } } } private void hackTwoItemsInfiniteScroll() { if (mViewPager == null || mAdapter == null) { return; } if (isInfinite) { if (mAdapter.getRealCount() == 2) { final GestureDetector gestureDetector = new GestureDetector(getContext(), new FlingGestureListener(mViewPager)); mViewPager.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return gestureDetector.onTouchEvent(event); } }); } else { mViewPager.setOnTouchListener(null); } } } private static class FlingGestureListener extends GestureDetector.SimpleOnGestureListener { private static final int SWIPE_MIN_DISTANCE = WXViewUtils.dip2px(50); private static final int SWIPE_MAX_OFF_PATH = WXViewUtils.dip2px(250); private static final int SWIPE_THRESHOLD_VELOCITY = WXViewUtils.dip2px(200); private WeakReference<WXCircleViewPager> pagerRef; FlingGestureListener(WXCircleViewPager pager) { this.pagerRef = new WeakReference<>(pager); } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { WXCircleViewPager mViewPager = pagerRef.get(); if (mViewPager == null) { return false; } try { if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) { return false; } if(e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY && mViewPager.superGetCurrentItem() == 1) { // right to left swipe mViewPager.setCurrentItem(0, false); return true; } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY && mViewPager.superGetCurrentItem() == 0) { // left to right swipe mViewPager.setCurrentItem(1, false); return true; } } catch (Exception e) { // ignore } return false; } } }
{ "content_hash": "fda40fda96579f1f62d49ab08143508e", "timestamp": "", "source": "github", "line_count": 536, "max_line_length": 183, "avg_line_length": 29.82276119402985, "alnum_prop": 0.6565530184548014, "repo_name": "evildoerX/weex-ouikit", "id": "db20ef2e9312b8065d9219472ce90c2bbf5c546b", "size": "16794", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "platforms/android/sdk/src/main/java/com/taobao/weex/ui/component/WXSlider.java", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "91967" }, { "name": "CSS", "bytes": "24463" }, { "name": "Java", "bytes": "3097591" }, { "name": "JavaScript", "bytes": "579608" }, { "name": "Objective-C", "bytes": "4219630" }, { "name": "Objective-C++", "bytes": "3296" }, { "name": "Ruby", "bytes": "5421" }, { "name": "Shell", "bytes": "13602" }, { "name": "Vue", "bytes": "51955" } ], "symlink_target": "" }
package com.beecavegames.bjc.handlers; import java.util.Date; import com.beecavegames.common.Response; import com.beecavegames.common.Response.Status; import com.beecavegames.dispatch.Param; import com.beecavegames.dispatch.RequestContext; import com.beecavegames.dispatch.RequiresAuthentication; import com.beecavegames.stats.Counter; import com.beecavegames.stats.GlobalCounter; import com.beecavegames.stats.StatsManager; import com.beecavegames.util.Config; import com.google.inject.Inject; @RequiresAuthentication(false) public class TapstreamPostbackHandler{ @Inject StatsManager stats; private static final Counter COUNTER_PAID_INSTALL = Counter.create(GlobalCounter.Category.Install, GlobalCounter.Install.paid); private static final Counter COUNTER_REFERRAL_INSTALL = Counter.create(GlobalCounter.Category.Install, GlobalCounter.Install.referral); public Response handle(RequestContext rc, @Param("campaign_id") final String campaignId, @Param("referring_beeid") final String referringBeeId, @Param("event") final String event, @Param("beeid") final String beeid, @Param("ts") final long timestamp, @Param("secret") final String secret ) { Response response; if(secret.equals(Config.getString("tapstream.postback.secret", ""))) { if(referringBeeId.isEmpty()) { stats.count(COUNTER_PAID_INSTALL.withLabel(campaignId), new Date(timestamp * 1000)); } else { stats.count(COUNTER_REFERRAL_INSTALL.withLabel(referringBeeId), new Date(timestamp * 1000)); } response = new Response(); response.status = Status.OK; } else { response = new Response("These are not the droids you're looking for"); response.status = Status.FAIL; } return response; } }
{ "content_hash": "001025d3dca26c83ee21c5079a94e3e7", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 136, "avg_line_length": 37.391304347826086, "alnum_prop": 0.7715116279069767, "repo_name": "sgmiller/hiveelements", "id": "eaf9f28937692fe1fe72830b1bf3f69e9a547e25", "size": "1720", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "gameelements/src/main/java/bjc/handlers/TapstreamPostbackHandler.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "3918651" }, { "name": "Shell", "bytes": "5349" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TinyWorkflow")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TinyWorkflow")] [assembly: AssemblyCopyright("Copyright © 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("845067ac-dc96-4012-804f-841be1b5d89a")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "7e5bb50b013f23bada0df99f3ee72afc", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 38.80555555555556, "alnum_prop": 0.7451682176091625, "repo_name": "alphamax/TinyWorkflow", "id": "c8707d5702e1396f79803caef8e1c344cab783e1", "size": "1400", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Sources/TinyWorkflow/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "38" }, { "name": "C#", "bytes": "71783" }, { "name": "Pascal", "bytes": "2720" } ], "symlink_target": "" }
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document.predicate; import com.yahoo.document.predicate.parser.PredicateLexer; import com.yahoo.document.predicate.parser.PredicateParser; import com.yahoo.text.Ascii; import org.antlr.runtime.ANTLRStringStream; import org.antlr.runtime.CommonTokenStream; import org.antlr.runtime.RecognitionException; import java.nio.charset.StandardCharsets; /** * @author Simon Thoresen Hult */ public abstract class Predicate implements Cloneable { private final static char QUOTE_CHAR = '\''; private final static Ascii.Encoder ASCII_ENCODER = Ascii.newEncoder(StandardCharsets.UTF_8, QUOTE_CHAR); private final static Ascii.Decoder ASCII_DECODER = Ascii.newDecoder(StandardCharsets.UTF_8); @Override public Predicate clone() throws CloneNotSupportedException { return (Predicate)super.clone(); } @Override public final String toString() { StringBuilder out = new StringBuilder(); appendTo(out); return out.toString(); } protected abstract void appendTo(StringBuilder out); protected static void appendQuotedTo(String str, StringBuilder out) { String encoded = asciiEncode(str); if (requiresQuote(encoded)) { out.append(QUOTE_CHAR).append(encoded).append(QUOTE_CHAR); } else { out.append(str); } } private static boolean requiresQuote(String str) { for (int i = 0, len = str.length(); i < len; i = str.offsetByCodePoints(i, 1)) { int c = str.codePointAt(i); if (c == Ascii.ESCAPE_CHAR || !Character.isLetterOrDigit(c)) { return true; } } return false; } public static String asciiEncode(String str) { return ASCII_ENCODER.encode(str); } public static String asciiDecode(String str) { return ASCII_DECODER.decode(str); } public static Predicate fromBinary(byte[] buf) { return BinaryFormat.decode(buf); } public static Predicate fromString(String str) { ANTLRStringStream input = new ANTLRStringStream(str); PredicateLexer lexer = new PredicateLexer(input); CommonTokenStream tokens = new CommonTokenStream(lexer); PredicateParser parser = new PredicateParser(tokens); try { return parser.predicate(); } catch (RecognitionException e) { throw new IllegalArgumentException(e); } } }
{ "content_hash": "82b6464ee098a954b78cef0b7b2f3f4c", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 108, "avg_line_length": 32.46835443037975, "alnum_prop": 0.6697855750487329, "repo_name": "vespa-engine/vespa", "id": "c15e5415abf0049d391f9b08966a70c0b7a3cefc", "size": "2565", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "predicate-search-core/src/main/java/com/yahoo/document/predicate/Predicate.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "8130" }, { "name": "C", "bytes": "60315" }, { "name": "C++", "bytes": "29580035" }, { "name": "CMake", "bytes": "593981" }, { "name": "Emacs Lisp", "bytes": "91" }, { "name": "GAP", "bytes": "3312" }, { "name": "Go", "bytes": "560664" }, { "name": "HTML", "bytes": "54520" }, { "name": "Java", "bytes": "40814190" }, { "name": "JavaScript", "bytes": "73436" }, { "name": "LLVM", "bytes": "6152" }, { "name": "Lex", "bytes": "11499" }, { "name": "Makefile", "bytes": "5553" }, { "name": "Objective-C", "bytes": "12369" }, { "name": "Perl", "bytes": "23134" }, { "name": "Python", "bytes": "52392" }, { "name": "Roff", "bytes": "17506" }, { "name": "Ruby", "bytes": "10690" }, { "name": "Shell", "bytes": "268737" }, { "name": "Yacc", "bytes": "14735" } ], "symlink_target": "" }
using System; namespace AnimalHierarchy { class Cat : Animal { public Cat(int age, string name, Sex sex) : base(age, name, sex) { } public override void MakeSound() { Console.WriteLine("Meow-meow"); } } }
{ "content_hash": "07ff3d1cffc8742f6222148ddedd5d45", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 72, "avg_line_length": 17.5, "alnum_prop": 0.5178571428571429, "repo_name": "ndvalkov/TelerikAcademy2016", "id": "1d43dd54c834dbc87854cb03452e4c001ac085a9", "size": "282", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Homework/Object-Oriented-Programming/04. OOP-Principles-Part-1/AnimalHierarchy/Cat.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "897733" }, { "name": "CSS", "bytes": "29115" }, { "name": "HTML", "bytes": "79139" }, { "name": "JavaScript", "bytes": "48692" }, { "name": "SQLPL", "bytes": "4414" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2003 - 2016 The eFaps Team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <datamodel-type xmlns="http://www.efaps.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd"> <uuid>f67dd041-e09f-4ff6-93f3-a2ac219b8684</uuid> <file-application>eFaps-Kernel</file-application> <definition> <version-expression>(version==4) || (version==latest)</version-expression> <name>Admin_Program_Compiled</name> <!-- To be able to use a store General instance is necessary --> <purpose GeneralInstance="true" abstract="true"/> <!-- attributes --> <attribute> <name>Type</name> <type>Type</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>TYPEID</sqlcolumn> </attribute> <attribute> <name>OID</name> <type>OID</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>ID</sqlcolumn> </attribute> <attribute> <name>ID</name> <type>Long</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>ID</sqlcolumn> </attribute> <attribute> <name>Name</name> <type>String</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>NAME</sqlcolumn> </attribute> <attribute> <name>Creator</name> <type>CreatorLink</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>CREATOR</sqlcolumn> </attribute> <attribute> <name>Created</name> <type>Created</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>CREATED</sqlcolumn> </attribute> <attribute> <name>Modifier</name> <type>ModifierLink</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>MODIFIER</sqlcolumn> </attribute> <attribute> <name>Modified</name> <type>Modified</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>MODIFIED</sqlcolumn> </attribute> <store name="Admin_Program_Compiled_JDBCStore" /> </definition> <definition> <version-expression>(version==3)</version-expression> <name>Admin_Program_Compiled</name> <!-- To be able to use a store General instance is necessary --> <purpose GeneralInstance="true" /> <!-- attributes --> <attribute> <name>Type</name> <type>Type</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>TYPEID</sqlcolumn> </attribute> <attribute> <name>OID</name> <type>OID</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>ID</sqlcolumn> </attribute> <attribute> <name>ID</name> <type>Long</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>ID</sqlcolumn> </attribute> <attribute> <name>Name</name> <type>String</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>NAME</sqlcolumn> </attribute> <attribute> <name>Creator</name> <type>CreatorLink</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>CREATOR</sqlcolumn> </attribute> <attribute> <name>Created</name> <type>Created</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>CREATED</sqlcolumn> </attribute> <attribute> <name>Modifier</name> <type>ModifierLink</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>MODIFIER</sqlcolumn> </attribute> <attribute> <name>Modified</name> <type>Modified</type> <sqltable>Admin_Program_CompiledSQLTable</sqltable> <sqlcolumn>MODIFIED</sqlcolumn> </attribute> </definition> </datamodel-type>
{ "content_hash": "059d4afcdc02127c102d48cf3f36a76e", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 101, "avg_line_length": 35.857142857142854, "alnum_prop": 0.5832669322709163, "repo_name": "eFaps/eFaps-Kernel-Install", "id": "871efbf62812e43ef7106617b3aea4cc35430679", "size": "5020", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/efaps/Admin/Program/Abstract/DataModels/Admin_Program_Compiled.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1478988" }, { "name": "JavaScript", "bytes": "39333" } ], "symlink_target": "" }
import expresso.visitor as visitor from expresso.printer import Printer from mpmath import mp import functions as f import expression as e class CodePrinter(Printer): def __init__(self): super(CodePrinter,self).__init__(e.expression_converter) @visitor.on('expr',parent = Printer) def visit(self,expr): raise ValueError('cannot compile expression %s' % expr) def print_wildcard_symbol(self,expr): raise ValueError('cannot compile wildcard %s' % expr) def print_wildcard_function(self,expr): raise ValueError('cannot compile wildcard %s' % expr) @visitor.function(f.CustomFunction) def visit(self,expr): raise ValueError('cannot compile custom function %s' % expr) @visitor.function(f.ArrayAccess) def visit(self,expr): raise ValueError('cannot compile expression %s' % expr) @visitor.function(f.Tuple) def visit(self,expr): raise ValueError('cannot compile expression %s' % expr)
{ "content_hash": "03391a4491ad028f23f3bedde08bc0a8", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 68, "avg_line_length": 30.09090909090909, "alnum_prop": 0.6878147029204431, "repo_name": "TheLartians/Expresso", "id": "258b4a12cc9505fc2e14523f502608ec97360c47", "size": "994", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "expresso/pycas/codeprinter.py", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "133473" }, { "name": "CMake", "bytes": "2310" }, { "name": "Python", "bytes": "142681" } ], "symlink_target": "" }
package org.wso2.siddhi.extension.math; import org.wso2.siddhi.core.config.ExecutionPlanContext; import org.wso2.siddhi.core.exception.ExecutionPlanRuntimeException; import org.wso2.siddhi.core.executor.ExpressionExecutor; import org.wso2.siddhi.core.executor.function.FunctionExecutor; import org.wso2.siddhi.query.api.definition.Attribute; import org.wso2.siddhi.query.api.exception.ExecutionPlanValidationException; /* * max(a,b); * Returns the greater of 'a' and 'b'. * Accept Type(s): INT,LONG,FLOAT,DOUBLE * Return Type(s): DOUBLE */ public class MaxFunctionExtension extends FunctionExecutor{ @Override protected void init(ExpressionExecutor[] attributeExpressionExecutors, ExecutionPlanContext executionPlanContext) { if (attributeExpressionExecutors.length != 2) { throw new ExecutionPlanValidationException("Invalid no of arguments passed to math:max() function, " + "required 2, but found " + attributeExpressionExecutors.length); } Attribute.Type attributeType = attributeExpressionExecutors[0].getReturnType(); if (!((attributeType == Attribute.Type.DOUBLE) || (attributeType == Attribute.Type.INT) || (attributeType == Attribute.Type.FLOAT) || (attributeType == Attribute.Type.LONG))) { throw new ExecutionPlanValidationException("Invalid parameter type found for the first argument of math:max() function, " + "required " + Attribute.Type.INT + " or " + Attribute.Type.LONG + " or " + Attribute.Type.FLOAT + " or " + Attribute.Type.DOUBLE + ", but found " + attributeType.toString()); } attributeType = attributeExpressionExecutors[1].getReturnType(); if (!((attributeType == Attribute.Type.DOUBLE) || (attributeType == Attribute.Type.INT) || (attributeType == Attribute.Type.FLOAT) || (attributeType == Attribute.Type.LONG))) { throw new ExecutionPlanValidationException("Invalid parameter type found for the second argument of math:max() function, " + "required " + Attribute.Type.INT + " or " + Attribute.Type.LONG + " or " + Attribute.Type.FLOAT + " or " + Attribute.Type.DOUBLE + ", but found " + attributeType.toString()); } } @Override protected Object execute(Object[] data) { double inputVal1 = 0d; double inputVal2 = 0d; if (data[0] != null) { //type-conversion if (data[0] instanceof Integer) { int inputInt = (Integer) data[0]; inputVal1 = (double) inputInt; } else if (data[0] instanceof Long) { long inputLong = (Long) data[0]; inputVal1 = (double) inputLong; } else if (data[0] instanceof Float) { float inputLong = (Float) data[0]; inputVal1 = (double) inputLong; } else if (data[0] instanceof Double) { inputVal1 = (Double) data[0]; } } else { throw new ExecutionPlanRuntimeException("Input to the math:max() function cannot be null"); } if (data[1] != null) { //type-conversion if (data[1] instanceof Integer) { int inputInt = (Integer) data[1]; inputVal2 = (double) inputInt; } else if (data[1] instanceof Long) { long inputLong = (Long) data[1]; inputVal2 = (double) inputLong; } else if (data[1] instanceof Float) { float inputLong = (Float) data[1]; inputVal2 = (double) inputLong; } else if (data[1] instanceof Double) { inputVal2 = (Double) data[1]; } } else { throw new ExecutionPlanRuntimeException("Input to the math:max() function cannot be null"); } return Math.max(inputVal1,inputVal2); } @Override protected Object execute(Object data) { return null; //Since the max function takes in 2 parameters, this method does not get called. Hence, not implemented. } @Override public void start() { //Nothing to start. } @Override public void stop() { //Nothing to stop. } @Override public Attribute.Type getReturnType() { return Attribute.Type.DOUBLE; } @Override public Object[] currentState() { return null; //No need to maintain state. } @Override public void restoreState(Object[] state) { //Since there's no need to maintain a state, nothing needs to be done here. } }
{ "content_hash": "af9f51c5d1159391fd8efac060c5e702", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 136, "avg_line_length": 40.77777777777778, "alnum_prop": 0.5946342485852023, "repo_name": "charwliu/siddhi", "id": "026d7115d2410f59f2ce2c60169a0ff853f1a541", "size": "5411", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "modules/siddhi-extensions/math/src/main/java/org/wso2/siddhi/extension/math/MaxFunctionExtension.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "15263" }, { "name": "Java", "bytes": "3460731" }, { "name": "Scala", "bytes": "923" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name Lonchocarpus apricus Lundell ### Remarks null
{ "content_hash": "71541bee15d2745b456ee71a1c1d1922", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 12.153846153846153, "alnum_prop": 0.7278481012658228, "repo_name": "mdoering/backbone", "id": "9d5ba9edb8f37fe64456d751081054070b9fd00b", "size": "238", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Lonchocarpus/Lonchocarpus rugosus/Lonchocarpus rugosus apricus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
@interface ChildEventView : UIView @end
{ "content_hash": "5e2bad5050a2599e0a2f68e1983d4e61", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 34, "avg_line_length": 13.666666666666666, "alnum_prop": 0.7804878048780488, "repo_name": "CreazyShadow/SimpleDemo", "id": "26c271de05bf934fcc91197dd98ba539a04ba978", "size": "196", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SimpleApp/SimpleApp/机制/event/ChildEventView.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "12264" }, { "name": "C++", "bytes": "54687" }, { "name": "JavaScript", "bytes": "1065" }, { "name": "Objective-C", "bytes": "2039773" }, { "name": "Objective-C++", "bytes": "193080" }, { "name": "Ruby", "bytes": "420" }, { "name": "Shell", "bytes": "8741" }, { "name": "Swift", "bytes": "2922" } ], "symlink_target": "" }
package com.puzzletimer.gui; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.geom.Rectangle2D; import javax.swing.JComponent; @SuppressWarnings("serial") public class TimeLabel extends JComponent { private String text; public TimeLabel(String text) { this.text = text; } public void setText(String text) { this.text = text; repaint(); } @Override public void paint(Graphics g) { super.paint(g); Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); int textWidth = g2.getFontMetrics().stringWidth("00:00.00"); int fontSize = getFont().getSize() * getWidth() / textWidth; g2.setFont(getFont().deriveFont((float) Math.min(fontSize, getHeight()))); Rectangle2D bounds = g2.getFontMetrics().getStringBounds(this.text, g2); g2.drawString( this.text, (int) ((getWidth() - bounds.getWidth()) / 2 - bounds.getX()), (int) ((getHeight() - bounds.getHeight()) / 2 - bounds.getY())); } }
{ "content_hash": "0b8942aa0df653809e4a0b5564475aa9", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 96, "avg_line_length": 31.682926829268293, "alnum_prop": 0.6320246343341032, "repo_name": "an-OK-squirrel/prisma-fork", "id": "a8d8814a1df2b7593c4d8cdefe16d0a287e5f5ff", "size": "1299", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/com/puzzletimer/gui/TimeLabel.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "674655" }, { "name": "PLpgSQL", "bytes": "10142" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Text; using NUnit.Framework; using NUnit.Framework.Internal; namespace Tests.Entities { public static class AppveyorHelper { public static bool IsRunning() { return System.Environment.GetEnvironmentVariable("APPVEYOR") != null; } } public class GroupleAttribute : Attribute, NUnit.Framework.Interfaces.IApplyToTest { private static IgnoreAttribute Ignore = new IgnoreAttribute("Требуется СНГ прокся"); public void ApplyToTest(Test test) { if (AppveyorHelper.IsRunning()) { Ignore.ApplyToTest(test); } } } public class ReadMangaAttribute : GroupleAttribute { } public class MintMangaAttribute : GroupleAttribute { } public class IssueAttribute : IgnoreAttribute { public IssueAttribute(ushort issue) : base($"Детали в https://github.com/MonkAlex/MangaReader/issues/{issue}") { } } }
{ "content_hash": "63ae3861c39607eeac6cfa949057378b", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 114, "avg_line_length": 23.6, "alnum_prop": 0.7086864406779662, "repo_name": "MonkAlex/MangaReader", "id": "26950fafe8a2e15653a707ae679be12fbda23c5d", "size": "971", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Tests/Tests.Entities/IgnoreAttributes.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "830991" } ], "symlink_target": "" }
ACCEPTED #### According to Interim Register of Marine and Nonmarine Genera #### Published in null #### Original name null ### Remarks null
{ "content_hash": "2e0693e2f66421af18a202ec44552fa0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 47, "avg_line_length": 10.923076923076923, "alnum_prop": 0.7183098591549296, "repo_name": "mdoering/backbone", "id": "a981d7d5d4582662f94c8356f1e78ecf767cff91", "size": "221", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Chromista/Haptophyta/Prymnesiophyceae/Arkhangelskiellaceae/Aspidolithus/Aspidolithus furtivus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php namespace libraries\utils; use Symfony\Component\Yaml\Yaml; use Monolog\Logger; class YAMLParser { protected $ymlFilePath = null; protected $logger = null; public function __construct(Logger $logger) { $this->logger = $logger; } public function findNodeByURI( $uri, $searchFor) { $this->logger->addDebug('YAMLParser opening ' . $this->ymlFilePath); $config = $this->loadConfig(); if(!is_array($config)) { return null; } if(array_key_exists($uri, $config) && array_key_exists($searchFor, $config[$this->getSectionKey($uri)])) { return $config[$this->getSectionKey($uri)][$searchFor]; } return null; } public function findNodeByURIPattern($uri, $searchfor) { $this->logger->addDebug('YAMLParser opening ' . $this->ymlFilePath); $config = $this->loadConfig(); if(!is_array($config)) { return null; } if(array_key_exists($uri, $config) && array_key_exists($searchFor, $config[$this->getSectionKey($uri)])) { return $config[$this->getSectionKey($uri)][$searchFor]; } return null; } public function loadConfig() { return Yaml::parse($this->ymlFilePath); } private function getSectionKey($uri) { $pieces = explode('/',strtolower($uri)); $pieces = array_filter($pieces); return implode('_', $pieces); } public function setFilePath($ymlFilePath) { $this->ymlFilePath = $ymlFilePath; } }
{ "content_hash": "962fba177b74d3f8ada2bad343a1aecc", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 114, "avg_line_length": 25.417910447761194, "alnum_prop": 0.53904873752202, "repo_name": "dmeikle/sc-dev", "id": "2f25bac633c943662bb47209884fb302827be361", "size": "1703", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/libraries/utils/YAMLParser.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "33981" }, { "name": "JavaScript", "bytes": "158" }, { "name": "PHP", "bytes": "240361" } ], "symlink_target": "" }
using System.Collections.Generic; using System.Windows.Forms; using Editor.Selections; using GameEngine.Data.Common; using GameEngine.Data.Tiles.Behaviors; using General.Common; using General.Extensions; using General.States; using MapEditor.Data; using MapEditor.Data.Actions.Tile; using MapEditor.Data.Actions.Tile.Logic; using MapEditor.Forms.Form_Selectors; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace MapEditor.States.TileEditor.Logic { public class LogicPathTool : State, IState { private int size = 3; public static LogicPathTool Instance { get { return Static<LogicPathTool>.Value; } } public string Name { get { return "Logic Path"; } } public void Enter(IFiniteStateMachine stateMachine, IState oldState) { FrmLogicTileSelector.Instance.btnPath.Checked = true; FrmLogicTileSelector.Instance.lbSizeIndicator.Visible = true; FrmLogicTileSelector.Instance.btnSizeDecrease.Visible = true; FrmLogicTileSelector.Instance.lbSize.Visible = true; FrmLogicTileSelector.Instance.btnSizeIncrease.Visible = true; FrmLogicTileSelector.Instance.btnTools.Text = "Tool: Path"; EditorForm.editorcontrol.MouseDown += new MouseEventHandler(onMouseDown); EditorForm.editorcontrol.MouseMove += new MouseEventHandler(onMouseMove); EditorForm.editorcontrol.MouseUp += new MouseEventHandler(onMouseUp); FrmLogicTileSelector.Instance.size = size; } public void Leave(IFiniteStateMachine stateMachine, IState newState) { FrmLogicTileSelector.Instance.btnPath.Checked = false; FrmLogicTileSelector.Instance.lbSizeIndicator.Visible = false; FrmLogicTileSelector.Instance.btnSizeDecrease.Visible = false; FrmLogicTileSelector.Instance.lbSize.Visible = false; FrmLogicTileSelector.Instance.btnSizeIncrease.Visible = false; EditorForm.editorcontrol.MouseDown -= new MouseEventHandler(onMouseDown); EditorForm.editorcontrol.MouseMove -= new MouseEventHandler(onMouseMove); EditorForm.editorcontrol.MouseUp -= new MouseEventHandler(onMouseUp); size = FrmLogicTileSelector.Instance.size = size; } private void onMouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { xt = (int) ((e.X - EditorEngine.Instance.xCam) / EditorEngine.Instance.World.Camera.Scale / 16); yt = (int) ((e.Y - EditorEngine.Instance.yCam) / EditorEngine.Instance.World.Camera.Scale / 16); } } private int xt = -1, yt = -1; private List<LogicPathSquare> path = new List<LogicPathSquare>(); private List<Vector2> points = new List<Vector2>(); private void onMouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { int rxt = (int) ((e.X - EditorEngine.Instance.xCam) / EditorEngine.Instance.World.Camera.Scale / 16); int ryt = (int) ((e.Y - EditorEngine.Instance.yCam) / EditorEngine.Instance.World.Camera.Scale / 16); if (rxt != xt) { int dir = 0; if (rxt - xt == -1) dir = 2; if (rxt - xt == 1) dir = 3; if (!points.Contains(new Vector2(rxt, ryt))) path.Add(new LogicPathSquare(rxt, ryt, dir)); } else if (ryt != yt) { int dir = 0; if (ryt - yt == -1) dir = 0; if (ryt - yt == 1) dir = 1; if (!points.Contains(new Vector2(rxt, ryt))) path.Add(new LogicPathSquare(rxt, ryt, dir)); } xt = rxt; yt = ryt; } } private void onMouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { int l_index = FrmLogicTileSelector.Instance.logicViewerSelectorControl1.SelectedLogicIndex; for (int i = 0; i < path.Count; i++) { LogicPathSquare sq = path[i]; LogicPathSquare sqm1 = null; if (i != 0) sqm1 = path[i - 1]; if (sqm1 != null) { if ((sq.dir == 0 || sq.dir == 1) && (sqm1.dir != 0 || sqm1.dir != 1) || (sq.dir == 2 || sq.dir == 3) && (sqm1.dir != 2 || sqm1.dir != 3)) { path.Insert(i, new LogicPathSquare((sqm1.dir == 2 ? sqm1.x - 1 : sqm1.dir == 3 ? sqm1.x + 1 : sqm1.x), (sqm1.dir == 0 ? sqm1.y - 1 : sqm1.dir == 1 ? sqm1.y + 1 : sqm1.y), sqm1.dir)); i++; } } } int _size = FrmLogicTileSelector.Instance.size; LogicPathAction action = new LogicPathAction(path, l_index, _size); foreach (SetTileAction a in action.Actions) { Map map = EditorEngine.Instance.CurrentMap; MockupTileBehavior b = map.GetBehavior(a.X, a.Y); b.BehaviorId = map.Tilesets[a.TilesetIndex].Tileset.Tiles[a.TileIndex].DefaultBehavior.BehaviorId; } EditorEngine.Instance.GetActionManager().Execute(action); path.Clear(); } } public void Draw(Microsoft.Xna.Framework.GameTime gameTime) { SpriteBatch batch = EditorEngine.Instance.World.ViewData.SpriteBatch; if (batch != null) { foreach (LogicPathSquare sq in path) { float scale = EditorEngine.Instance.World.Camera.Scale; Vector2 scroll = EditorEngine.Instance.World.Camera.Location; Rectangle target = new Rectangle((int) (sq.x * 16 * scale), (int) (sq.y * 16 * scale), (int) (16 * scale), (int) (16 * scale)).Add(scroll); SelectionUtil.DrawRectangle(batch, Color.CornflowerBlue * .7f, target); SelectionUtil.DrawRectangle(batch, Color.Black * .8f, target.Add(new Vector2(1, 1))); } } } public void Update(Microsoft.Xna.Framework.GameTime gameTime) { } } }
{ "content_hash": "717ea96788dc485a136dd77f81d5ef3a", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 189, "avg_line_length": 38.201438848920866, "alnum_prop": 0.6943502824858757, "repo_name": "oxysoft/PokeSharp", "id": "d7df934917f999e628108b3ca326fc5478fc2864", "size": "5310", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/MapEditor/States/TileEditor/Logic/LogicPathTool.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1601586" }, { "name": "JavaScript", "bytes": "1975" }, { "name": "Lua", "bytes": "36922" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0) on Mon Jan 13 19:53:39 EST 2014 --> <title>Uses of Class org.drip.product.definition.CalibratableComponent</title> <meta name="date" content="2014-01-13"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.drip.product.definition.CalibratableComponent"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/drip/product/definition/\class-useCalibratableComponent.html" target="_top">Frames</a></li> <li><a href="CalibratableComponent.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.drip.product.definition.CalibratableComponent" class="title">Uses of Class<br>org.drip.product.definition.CalibratableComponent</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.drip.analytics.definition">org.drip.analytics.definition</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.drip.analytics.rates">org.drip.analytics.rates</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.drip.param.creator">org.drip.param.creator</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.drip.param.market">org.drip.param.market</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.drip.product.credit">org.drip.product.credit</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.drip.product.definition">org.drip.product.definition</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.drip.product.rates">org.drip.product.rates</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.drip.state.curve">org.drip.state.curve</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.drip.state.estimator">org.drip.state.estimator</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.drip.analytics.definition"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/analytics/definition/package-summary.html">org.drip.analytics.definition</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/drip/analytics/definition/package-summary.html">org.drip.analytics.definition</a> that return <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">Curve.</span><code><strong><a href="../../../../../org/drip/analytics/definition/Curve.html#calibComp()">calibComp</a></strong>()</code> <div class="block">Retrieve the Calibration Components</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">CreditCurve.</span><code><strong><a href="../../../../../org/drip/analytics/definition/CreditCurve.html#calibComp()">calibComp</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">CurveSpanConstructionInput.</span><code><strong><a href="../../../../../org/drip/analytics/definition/CurveSpanConstructionInput.html#getComponent()">getComponent</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">CurveConstructionInputSet.</span><code><strong><a href="../../../../../org/drip/analytics/definition/CurveConstructionInputSet.html#getComponent()">getComponent</a></strong>()</code> <div class="block">Retrieve the Array of the Calibration Components</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">BootCurveConstructionInput.</span><code><strong><a href="../../../../../org/drip/analytics/definition/BootCurveConstructionInput.html#getComponent()">getComponent</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/drip/analytics/definition/package-summary.html">org.drip.analytics.definition</a> with parameters of type <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/definition/BootCurveConstructionInput.html" title="class in org.drip.analytics.definition">BootCurveConstructionInput</a></code></td> <td class="colLast"><span class="strong">BootCurveConstructionInput.</span><code><strong><a href="../../../../../org/drip/analytics/definition/BootCurveConstructionInput.html#Create(org.drip.param.valuation.ValuationParams, org.drip.param.valuation.QuotingParams, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String[], java.util.Map)">Create</a></strong>(<a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParam, <a href="../../../../../org/drip/param/valuation/QuotingParams.html" title="class in org.drip.param.valuation">QuotingParams</a>&nbsp;quotingParam, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibInst, double[]&nbsp;adblCalibQuote, java.lang.String[]&nbsp;astrCalibMeasure, java.util.Map&lt;<a href="../../../../../org/drip/analytics/date/JulianDate.html" title="class in org.drip.analytics.date">JulianDate</a>,<a href="../../../../../org/drip/analytics/support/CaseInsensitiveTreeMap.html" title="class in org.drip.analytics.support">CaseInsensitiveTreeMap</a>&lt;java.lang.Double&gt;&gt;&nbsp;mmFixing)</code> <div class="block">Create an Instance of BootCurveConstructionInput from the given Calibration Inputs</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">CreditCurve.</span><code><strong><a href="../../../../../org/drip/analytics/definition/CreditCurve.html#setInstrCalibInputs(org.drip.param.valuation.ValuationParams, boolean, org.drip.analytics.rates.DiscountCurve, org.drip.analytics.rates.DiscountCurve, org.drip.analytics.rates.DiscountCurve, org.drip.param.pricer.PricerParams, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String[], java.util.Map, org.drip.param.valuation.QuotingParams)">setInstrCalibInputs</a></strong>(<a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParam, boolean&nbsp;bFlat, <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a>&nbsp;dc, <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a>&nbsp;dcTSY, <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a>&nbsp;dcEDSF, <a href="../../../../../org/drip/param/pricer/PricerParams.html" title="class in org.drip.param.pricer">PricerParams</a>&nbsp;pricerParam, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibInst, double[]&nbsp;adblCalibQuote, java.lang.String[]&nbsp;astrCalibMeasure, java.util.Map&lt;<a href="../../../../../org/drip/analytics/date/JulianDate.html" title="class in org.drip.analytics.date">JulianDate</a>,<a href="../../../../../org/drip/analytics/support/CaseInsensitiveTreeMap.html" title="class in org.drip.analytics.support">CaseInsensitiveTreeMap</a>&lt;java.lang.Double&gt;&gt;&nbsp;mmFixing, <a href="../../../../../org/drip/param/valuation/QuotingParams.html" title="class in org.drip.param.valuation">QuotingParams</a>&nbsp;quotingParams)</code> <div class="block">Set the calibration inputs for the CreditCurve</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../org/drip/analytics/definition/package-summary.html">org.drip.analytics.definition</a> with parameters of type <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><strong><a href="../../../../../org/drip/analytics/definition/BootCurveConstructionInput.html#BootCurveConstructionInput(org.drip.param.valuation.ValuationParams, org.drip.param.valuation.QuotingParams, org.drip.product.definition.CalibratableComponent[], org.drip.analytics.support.CaseInsensitiveTreeMap, org.drip.analytics.support.CaseInsensitiveTreeMap, java.util.Map)">BootCurveConstructionInput</a></strong>(<a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParam, <a href="../../../../../org/drip/param/valuation/QuotingParams.html" title="class in org.drip.param.valuation">QuotingParams</a>&nbsp;quotingParam, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibInst, <a href="../../../../../org/drip/analytics/support/CaseInsensitiveTreeMap.html" title="class in org.drip.analytics.support">CaseInsensitiveTreeMap</a>&lt;java.lang.Double&gt;&nbsp;mapQuote, <a href="../../../../../org/drip/analytics/support/CaseInsensitiveTreeMap.html" title="class in org.drip.analytics.support">CaseInsensitiveTreeMap</a>&lt;java.lang.String&gt;&nbsp;mapMeasure, java.util.Map&lt;<a href="../../../../../org/drip/analytics/date/JulianDate.html" title="class in org.drip.analytics.date">JulianDate</a>,<a href="../../../../../org/drip/analytics/support/CaseInsensitiveTreeMap.html" title="class in org.drip.analytics.support">CaseInsensitiveTreeMap</a>&lt;java.lang.Double&gt;&gt;&nbsp;mmFixing)</code> <div class="block">BootCurveConstructionInput constructor</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.drip.analytics.rates"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/analytics/rates/package-summary.html">org.drip.analytics.rates</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/drip/analytics/rates/package-summary.html">org.drip.analytics.rates</a> that return <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">ForwardCurve.</span><code><strong><a href="../../../../../org/drip/analytics/rates/ForwardCurve.html#calibComp()">calibComp</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">ExplicitBootDiscountCurve.</span><code><strong><a href="../../../../../org/drip/analytics/rates/ExplicitBootDiscountCurve.html#calibComp()">calibComp</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.drip.param.creator"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/param/creator/package-summary.html">org.drip.param.creator</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/drip/param/creator/package-summary.html">org.drip.param.creator</a> with parameters of type <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/param/definition/ScenarioCreditCurve.html" title="class in org.drip.param.definition">ScenarioCreditCurve</a></code></td> <td class="colLast"><span class="strong">CreditScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/CreditScenarioCurveBuilder.html#CreateCCSC(org.drip.product.definition.CalibratableComponent[])">CreateCCSC</a></strong>(<a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibInst)</code> <div class="block">Create CreditScenarioCurve from the array of calibration instruments</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/definition/CreditCurve.html" title="class in org.drip.analytics.definition">CreditCurve</a></code></td> <td class="colLast"><span class="strong">CreditScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/CreditScenarioCurveBuilder.html#CreateCreditCurve(java.lang.String, org.drip.analytics.date.JulianDate, org.drip.product.definition.CalibratableComponent[], org.drip.analytics.rates.DiscountCurve, double[], java.lang.String[], double, boolean)">CreateCreditCurve</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/analytics/date/JulianDate.html" title="class in org.drip.analytics.date">JulianDate</a>&nbsp;dt, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibInst, <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a>&nbsp;dc, double[]&nbsp;adblQuotes, java.lang.String[]&nbsp;astrCalibMeasure, double&nbsp;dblRecovery, boolean&nbsp;bFlat)</code> <div class="block">Calibrate the base credit curve from the input credit instruments, measures, and the quotes</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#CubicKLKHyperbolicDFRateShapePreserver(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.product.definition.CalibratableComponent[], double[], org.drip.product.definition.CalibratableComponent[], double[], boolean)">CubicKLKHyperbolicDFRateShapePreserver</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, boolean&nbsp;bZeroSmooth)</code> <div class="block">Construct an instance of the Shape Preserver of the KLK Hyperbolic Tension Type, using the specified basis set builder parameters.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#CubicKLKHyperbolicDFRateShapePreserver(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.product.definition.CalibratableComponent[], double[], org.drip.product.definition.CalibratableComponent[], double[], boolean)">CubicKLKHyperbolicDFRateShapePreserver</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, boolean&nbsp;bZeroSmooth)</code> <div class="block">Construct an instance of the Shape Preserver of the KLK Hyperbolic Tension Type, using the specified basis set builder parameters.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#CubicPolyDFRateShapePreserver(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.product.definition.CalibratableComponent[], double[], org.drip.product.definition.CalibratableComponent[], double[], boolean)">CubicPolyDFRateShapePreserver</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, boolean&nbsp;bZeroSmooth)</code> <div class="block">Construct an instance of the Shape Preserver of the Cubic Polynomial Type, using the specified basis set builder parameters.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#CubicPolyDFRateShapePreserver(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.product.definition.CalibratableComponent[], double[], org.drip.product.definition.CalibratableComponent[], double[], boolean)">CubicPolyDFRateShapePreserver</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, boolean&nbsp;bZeroSmooth)</code> <div class="block">Construct an instance of the Shape Preserver of the Cubic Polynomial Type, using the specified basis set builder parameters.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#CustomDENSE(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String, org.drip.analytics.rates.TurnListDiscountFactor)">CustomDENSE</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, java.lang.String&nbsp;strTenor1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, java.lang.String&nbsp;strTenor2, <a href="../../../../../org/drip/analytics/rates/TurnListDiscountFactor.html" title="class in org.drip.analytics.rates">TurnListDiscountFactor</a>&nbsp;tldf)</code> <div class="block">Customizable DENSE Curve Creation Methodology - the references are: - Sankar, L.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#CustomDENSE(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String, org.drip.analytics.rates.TurnListDiscountFactor)">CustomDENSE</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, java.lang.String&nbsp;strTenor1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, java.lang.String&nbsp;strTenor2, <a href="../../../../../org/drip/analytics/rates/TurnListDiscountFactor.html" title="class in org.drip.analytics.rates">TurnListDiscountFactor</a>&nbsp;tldf)</code> <div class="block">Customizable DENSE Curve Creation Methodology - the references are: - Sankar, L.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#DENSE(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.product.definition.CalibratableComponent[], double[], org.drip.product.definition.CalibratableComponent[], double[], org.drip.analytics.rates.TurnListDiscountFactor)">DENSE</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, <a href="../../../../../org/drip/analytics/rates/TurnListDiscountFactor.html" title="class in org.drip.analytics.rates">TurnListDiscountFactor</a>&nbsp;tldf)</code> <div class="block">The Standard DENSE Curve Creation Methodology - this uses no re-construction set for the short term, and uses 3M dense re-construction for the Swap Set.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#DENSE(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.product.definition.CalibratableComponent[], double[], org.drip.product.definition.CalibratableComponent[], double[], org.drip.analytics.rates.TurnListDiscountFactor)">DENSE</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, <a href="../../../../../org/drip/analytics/rates/TurnListDiscountFactor.html" title="class in org.drip.analytics.rates">TurnListDiscountFactor</a>&nbsp;tldf)</code> <div class="block">The Standard DENSE Curve Creation Methodology - this uses no re-construction set for the short term, and uses 3M dense re-construction for the Swap Set.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#DFRateShapePreserver(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.param.pricer.PricerParams, org.drip.param.definition.ComponentMarketParams, org.drip.param.valuation.QuotingParams, java.lang.String, org.drip.spline.basis.FunctionSetBuilderParams, org.drip.product.definition.CalibratableComponent[], double[], org.drip.product.definition.CalibratableComponent[], double[], double, boolean)">DFRateShapePreserver</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/param/pricer/PricerParams.html" title="class in org.drip.param.pricer">PricerParams</a>&nbsp;pricerParam, <a href="../../../../../org/drip/param/definition/ComponentMarketParams.html" title="class in org.drip.param.definition">ComponentMarketParams</a>&nbsp;cmp, <a href="../../../../../org/drip/param/valuation/QuotingParams.html" title="class in org.drip.param.valuation">QuotingParams</a>&nbsp;quotingParam, java.lang.String&nbsp;strBasisType, <a href="../../../../../org/drip/spline/basis/FunctionSetBuilderParams.html" title="interface in org.drip.spline.basis">FunctionSetBuilderParams</a>&nbsp;fsbp, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, double&nbsp;dblEpochResponse, boolean&nbsp;bZeroSmooth)</code> <div class="block">Construct an instance of the Shape Preserver of the desired basis type, using the specified basis set builder parameters.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#DFRateShapePreserver(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.param.pricer.PricerParams, org.drip.param.definition.ComponentMarketParams, org.drip.param.valuation.QuotingParams, java.lang.String, org.drip.spline.basis.FunctionSetBuilderParams, org.drip.product.definition.CalibratableComponent[], double[], org.drip.product.definition.CalibratableComponent[], double[], double, boolean)">DFRateShapePreserver</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/param/pricer/PricerParams.html" title="class in org.drip.param.pricer">PricerParams</a>&nbsp;pricerParam, <a href="../../../../../org/drip/param/definition/ComponentMarketParams.html" title="class in org.drip.param.definition">ComponentMarketParams</a>&nbsp;cmp, <a href="../../../../../org/drip/param/valuation/QuotingParams.html" title="class in org.drip.param.valuation">QuotingParams</a>&nbsp;quotingParam, java.lang.String&nbsp;strBasisType, <a href="../../../../../org/drip/spline/basis/FunctionSetBuilderParams.html" title="interface in org.drip.spline.basis">FunctionSetBuilderParams</a>&nbsp;fsbp, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, double&nbsp;dblEpochResponse, boolean&nbsp;bZeroSmooth)</code> <div class="block">Construct an instance of the Shape Preserver of the desired basis type, using the specified basis set builder parameters.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#DUALDENSE(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String, org.drip.analytics.rates.TurnListDiscountFactor)">DUALDENSE</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, java.lang.String&nbsp;strTenor1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, java.lang.String&nbsp;strTenor2, <a href="../../../../../org/drip/analytics/rates/TurnListDiscountFactor.html" title="class in org.drip.analytics.rates">TurnListDiscountFactor</a>&nbsp;tldf)</code> <div class="block">The DUAL DENSE Curve Creation Methodology - this uses configurable re-construction set for the short term, and another configurable re-construction for the Swap Set.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#DUALDENSE(java.lang.String, org.drip.param.valuation.ValuationParams, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String, org.drip.analytics.rates.TurnListDiscountFactor)">DUALDENSE</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp1, double[]&nbsp;adblQuote1, java.lang.String&nbsp;strTenor1, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp2, double[]&nbsp;adblQuote2, java.lang.String&nbsp;strTenor2, <a href="../../../../../org/drip/analytics/rates/TurnListDiscountFactor.html" title="class in org.drip.analytics.rates">TurnListDiscountFactor</a>&nbsp;tldf)</code> <div class="block">The DUAL DENSE Curve Creation Methodology - this uses configurable re-construction set for the short term, and another configurable re-construction for the Swap Set.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#ForwardRateShapePreserver(java.lang.String, org.drip.param.valuation.ValuationParams, java.lang.String, org.drip.spline.basis.FunctionSetBuilderParams, org.drip.product.definition.CalibratableComponent[], double[])">ForwardRateShapePreserver</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, java.lang.String&nbsp;strBasisType, <a href="../../../../../org/drip/spline/basis/FunctionSetBuilderParams.html" title="interface in org.drip.spline.basis">FunctionSetBuilderParams</a>&nbsp;fsbp, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp, double[]&nbsp;adblQuote)</code> <div class="block">Construct an instance of the Shape Preserver of the desired basis type, using the specified basis set builder parameters.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/param/definition/ScenarioDiscountCurve.html" title="class in org.drip.param.definition">ScenarioDiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#FromIRCSG(java.lang.String, java.lang.String, org.drip.product.definition.CalibratableComponent[])">FromIRCSG</a></strong>(java.lang.String&nbsp;strCurrency, java.lang.String&nbsp;strBootstrapMode, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibInst)</code> <div class="block">Create an RatesScenarioCurve Instance from the currency and the array of the calibration instruments</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/DiscountCurve.html" title="class in org.drip.analytics.rates">DiscountCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#NonlinearBuild(org.drip.analytics.date.JulianDate, java.lang.String, java.lang.String, org.drip.product.definition.CalibratableComponent[], double[], java.lang.String[], java.util.Map)">NonlinearBuild</a></strong>(<a href="../../../../../org/drip/analytics/date/JulianDate.html" title="class in org.drip.analytics.date">JulianDate</a>&nbsp;dt, java.lang.String&nbsp;strCurrency, java.lang.String&nbsp;strBootstrapMode, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibInst, double[]&nbsp;adblQuotes, java.lang.String[]&nbsp;astrCalibMeasure, java.util.Map&lt;<a href="../../../../../org/drip/analytics/date/JulianDate.html" title="class in org.drip.analytics.date">JulianDate</a>,<a href="../../../../../org/drip/analytics/support/CaseInsensitiveTreeMap.html" title="class in org.drip.analytics.support">CaseInsensitiveTreeMap</a>&lt;java.lang.Double&gt;&gt;&nbsp;mmFixings)</code> <div class="block">Create Discount Curve from the Rates Calibration Instruments</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/analytics/rates/ForwardCurve.html" title="class in org.drip.analytics.rates">ForwardCurve</a></code></td> <td class="colLast"><span class="strong">RatesScenarioCurveBuilder.</span><code><strong><a href="../../../../../org/drip/param/creator/RatesScenarioCurveBuilder.html#ShapePreservingForwardCurve(java.lang.String, org.drip.product.params.FloatingRateIndex, org.drip.param.valuation.ValuationParams, org.drip.param.pricer.PricerParams, org.drip.param.definition.ComponentMarketParams, org.drip.param.valuation.QuotingParams, java.lang.String, org.drip.spline.basis.FunctionSetBuilderParams, org.drip.product.definition.CalibratableComponent[], double[], double)">ShapePreservingForwardCurve</a></strong>(java.lang.String&nbsp;strName, <a href="../../../../../org/drip/product/params/FloatingRateIndex.html" title="class in org.drip.product.params">FloatingRateIndex</a>&nbsp;fri, <a href="../../../../../org/drip/param/valuation/ValuationParams.html" title="class in org.drip.param.valuation">ValuationParams</a>&nbsp;valParams, <a href="../../../../../org/drip/param/pricer/PricerParams.html" title="class in org.drip.param.pricer">PricerParams</a>&nbsp;pricerParam, <a href="../../../../../org/drip/param/definition/ComponentMarketParams.html" title="class in org.drip.param.definition">ComponentMarketParams</a>&nbsp;cmp, <a href="../../../../../org/drip/param/valuation/QuotingParams.html" title="class in org.drip.param.valuation">QuotingParams</a>&nbsp;quotingParam, java.lang.String&nbsp;strBasisType, <a href="../../../../../org/drip/spline/basis/FunctionSetBuilderParams.html" title="interface in org.drip.spline.basis">FunctionSetBuilderParams</a>&nbsp;fsbp, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp, double[]&nbsp;adblQuote, double&nbsp;dblEpochResponse)</code> <div class="block">Construct an instance of the Shape Preserver of the desired basis type, using the specified basis set builder parameters.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.drip.param.market"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/param/market/package-summary.html">org.drip.param.market</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../org/drip/param/market/package-summary.html">org.drip.param.market</a> with parameters of type <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><strong><a href="../../../../../org/drip/param/market/CreditCurveScenarioContainer.html#CreditCurveScenarioContainer(org.drip.product.definition.CalibratableComponent[], double, double)">CreditCurveScenarioContainer</a></strong>(<a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibInst, double&nbsp;dblCouponBump, double&nbsp;dblRecoveryBump)</code> <div class="block">Construct CreditCurveScenarioContainer from the array of calibration instruments, the coupon bump parameter, and the recovery bump parameter</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.drip.product.credit"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/product/credit/package-summary.html">org.drip.product.credit</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation"> <caption><span>Subclasses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/product/credit/package-summary.html">org.drip.product.credit</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/credit/BondComponent.html" title="class in org.drip.product.credit">BondComponent</a></strong></code> <div class="block">BondComponent is the base class that extends CreditComponent abstract class and implements the functionality behind bonds of all kinds.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/credit/CDSComponent.html" title="class in org.drip.product.credit">CDSComponent</a></strong></code> <div class="block">CDSComponent implements the credit default swap product contract details.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.drip.product.definition"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/product/definition/package-summary.html">org.drip.product.definition</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation"> <caption><span>Subclasses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/product/definition/package-summary.html">org.drip.product.definition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/definition/Bond.html" title="class in org.drip.product.definition">Bond</a></strong></code> <div class="block">Bond abstract class implements the pricing, the valuation, and the RV analytics functionality for the bond product.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/definition/CreditComponent.html" title="class in org.drip.product.definition">CreditComponent</a></strong></code> <div class="block">CreditComponent is the base abstract class on top of which all credit components are implemented.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/definition/CreditDefaultSwap.html" title="class in org.drip.product.definition">CreditDefaultSwap</a></strong></code> <div class="block">CreditDefaultSwap is the base abstract class implements the pricing, the valuation, and the RV analytics functionality for the CDS product.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/definition/RatesComponent.html" title="class in org.drip.product.definition">RatesComponent</a></strong></code> <div class="block">RatesComponent is the abstract class that extends CalibratableComponent on top of which all rates components are implemented.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.drip.product.rates"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/product/rates/package-summary.html">org.drip.product.rates</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation"> <caption><span>Subclasses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/product/rates/package-summary.html">org.drip.product.rates</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/rates/CashComponent.html" title="class in org.drip.product.rates">CashComponent</a></strong></code> <div class="block">CashComponent contains the implementation of the Cash IR product and its contract/valuation details.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/rates/EDFComponent.html" title="class in org.drip.product.rates">EDFComponent</a></strong></code> <div class="block">EDFComponent contains the implementation of the Euro-dollar future contract/valuation (EDF).</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/rates/FixedStream.html" title="class in org.drip.product.rates">FixedStream</a></strong></code> <div class="block">FixedStream contains an implementation of the Fixed leg cash flow stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/rates/FloatFloatComponent.html" title="class in org.drip.product.rates">FloatFloatComponent</a></strong></code> <div class="block">FloatFloatComponent contains the implementation of the Float-Float Index Basis Swap product contract/valuation details.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/rates/FloatingStream.html" title="class in org.drip.product.rates">FloatingStream</a></strong></code> <div class="block">FloatingStream contains an implementation of the Floating leg cash flow stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../org/drip/product/rates/IRSComponent.html" title="class in org.drip.product.rates">IRSComponent</a></strong></code> <div class="block">IRSComponent contains the implementation of the Interest Rate Swap product contract/valuation details.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.drip.state.curve"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/state/curve/package-summary.html">org.drip.state.curve</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/drip/state/curve/package-summary.html">org.drip.state.curve</a> that return <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">ZeroRateDiscountCurve.</span><code><strong><a href="../../../../../org/drip/state/curve/ZeroRateDiscountCurve.html#calibComp()">calibComp</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">DiscountFactorDiscountCurve.</span><code><strong><a href="../../../../../org/drip/state/curve/DiscountFactorDiscountCurve.html#calibComp()">calibComp</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">DerivedZeroRate.</span><code><strong><a href="../../../../../org/drip/state/curve/DerivedZeroRate.html#calibComp()">calibComp</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">DerivedFXForward.</span><code><strong><a href="../../../../../org/drip/state/curve/DerivedFXForward.html#calibComp()">calibComp</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">DerivedFXBasis.</span><code><strong><a href="../../../../../org/drip/state/curve/DerivedFXBasis.html#calibComp()">calibComp</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.drip.state.estimator"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a> in <a href="../../../../../org/drip/state/estimator/package-summary.html">org.drip.state.estimator</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/drip/state/estimator/package-summary.html">org.drip.state.estimator</a> that return <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]</code></td> <td class="colLast"><span class="strong">StretchRepresentationSpec.</span><code><strong><a href="../../../../../org/drip/state/estimator/StretchRepresentationSpec.html#getCalibComp()">getCalibComp</a></strong>()</code> <div class="block">Retrieve the Array of the Calibratable Components</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></code></td> <td class="colLast"><span class="strong">StretchRepresentationSpec.</span><code><strong><a href="../../../../../org/drip/state/estimator/StretchRepresentationSpec.html#getCalibComp(int)">getCalibComp</a></strong>(int&nbsp;iIndex)</code> <div class="block">Retrieve the Calibration Component corresponding to the given Instrument index</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/drip/state/estimator/package-summary.html">org.drip.state.estimator</a> with parameters of type <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/drip/state/estimator/StretchRepresentationSpec.html" title="class in org.drip.state.estimator">StretchRepresentationSpec</a></code></td> <td class="colLast"><span class="strong">StretchRepresentationSpec.</span><code><strong><a href="../../../../../org/drip/state/estimator/StretchRepresentationSpec.html#CreateStretchBuilderSet(java.lang.String, java.lang.String, java.lang.String, org.drip.product.definition.CalibratableComponent[], java.lang.String, double[], org.drip.analytics.rates.TurnListDiscountFactor)">CreateStretchBuilderSet</a></strong>(java.lang.String&nbsp;strName, java.lang.String&nbsp;strLatentStateID, java.lang.String&nbsp;strLatentStateQuantificationMetric, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp, java.lang.String&nbsp;strManifestMeasure, double[]&nbsp;adblQuote, <a href="../../../../../org/drip/analytics/rates/TurnListDiscountFactor.html" title="class in org.drip.analytics.rates">TurnListDiscountFactor</a>&nbsp;tldf)</code> <div class="block">Make a StretchRepresentationSpec instance from the given components, quotes, and the measure.</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../org/drip/state/estimator/package-summary.html">org.drip.state.estimator</a> with parameters of type <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><strong><a href="../../../../../org/drip/state/estimator/CreditCurveScenarioGenerator.html#CreditCurveScenarioGenerator(org.drip.product.definition.CalibratableComponent[])">CreditCurveScenarioGenerator</a></strong>(<a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibInst)</code> <div class="block">Construct a CreditCurveScenarioGenerator instance from the calibratable instrument array</div> </td> </tr> <tr class="rowColor"> <td class="colLast"><code><strong><a href="../../../../../org/drip/state/estimator/RatesCurveScenarioGenerator.html#RatesCurveScenarioGenerator(java.lang.String, java.lang.String, org.drip.product.definition.CalibratableComponent[])">RatesCurveScenarioGenerator</a></strong>(java.lang.String&nbsp;strCurrency, java.lang.String&nbsp;strBootstrapMode, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibInst)</code> <div class="block">Construct a RatesCurveScenarioGenerator instance from the calibratable instrument array</div> </td> </tr> <tr class="altColor"> <td class="colLast"><code><strong><a href="../../../../../org/drip/state/estimator/StretchRepresentationSpec.html#StretchRepresentationSpec(java.lang.String, java.lang.String, java.lang.String, org.drip.product.definition.CalibratableComponent[], java.lang.String[], double[], org.drip.analytics.rates.TurnListDiscountFactor)">StretchRepresentationSpec</a></strong>(java.lang.String&nbsp;strName, java.lang.String&nbsp;strLatentStateID, java.lang.String&nbsp;strLatentStateQuantificationMetric, <a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">CalibratableComponent</a>[]&nbsp;aCalibComp, java.lang.String[]&nbsp;astrManifestMeasure, double[]&nbsp;adblQuote, <a href="../../../../../org/drip/analytics/rates/TurnListDiscountFactor.html" title="class in org.drip.analytics.rates">TurnListDiscountFactor</a>&nbsp;tldf)</code> <div class="block">StretchRepresentationSpec constructor</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/drip/product/definition/CalibratableComponent.html" title="class in org.drip.product.definition">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/drip/product/definition/\class-useCalibratableComponent.html" target="_top">Frames</a></li> <li><a href="CalibratableComponent.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "feed017aa356cf2e730078e8d59e0ffe", "timestamp": "", "source": "github", "line_count": 796, "max_line_length": 691, "avg_line_length": 87.39321608040201, "alnum_prop": 0.6844390138719183, "repo_name": "tectronics/rootfinder", "id": "be5d0cdf19a9c00438e1d968e9d846ed6deeffbb", "size": "69565", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "2.3/docs/Javadoc/org/drip/product/definition/class-use/CalibratableComponent.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "34839" }, { "name": "HTML", "bytes": "77000232" }, { "name": "Java", "bytes": "10842587" } ], "symlink_target": "" }
package dialogflow import ( "encoding/json" "io/ioutil" "os" "path" "testing" ) func Test_ParseRequest(t *testing.T) { wd , err := os.Getwd() if err != nil { t.Fatalf("Could not get working directory; %v", err) } testFile := path.Join(wd, "test_data", "request.json") b, err := ioutil.ReadFile(testFile) if err != nil { t.Fatalf("Could not read request from %v; error: %v", testFile, err) } request := &WebhookRequest{} if err := json.Unmarshal(b, request); err != nil { t.Fatalf("Could not unmarshal the request; error %v", err) } if request.OriginalDetectIntentRequest.Source != "slack" { t.Fatalf("For source Got %v; want slack", request.OriginalDetectIntentRequest.Source) } }
{ "content_hash": "492c7d976b30952d378d50abe917ae6c", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 88, "avg_line_length": 21, "alnum_prop": 0.6638655462184874, "repo_name": "kubeflow/code-intelligence", "id": "57a8ec94db1c171c46596842452b262724103fc6", "size": "714", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chatbot/pkg/dialogflow/webhook_test.go", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "150684" }, { "name": "Dockerfile", "bytes": "4745" }, { "name": "Go", "bytes": "74600" }, { "name": "HTML", "bytes": "4237" }, { "name": "JavaScript", "bytes": "75524" }, { "name": "Jinja", "bytes": "21547" }, { "name": "Jupyter Notebook", "bytes": "1876429" }, { "name": "Less", "bytes": "262592" }, { "name": "Makefile", "bytes": "14819" }, { "name": "Python", "bytes": "189927" }, { "name": "SCSS", "bytes": "289359" }, { "name": "Shell", "bytes": "22273" }, { "name": "Smarty", "bytes": "113" } ], "symlink_target": "" }
The Web Settings of the Provisioning Template **Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Model](OfficeDevPnP.Core.Framework.Provisioning.Model.md) **Assembly:** OfficeDevPnP.Core.dll ## Syntax ```C# public WebSettings WebSettings { get; set; } ``` ### Property Value Type: [OfficeDevPnP.Core.Framework.Provisioning.Model.WebSettings](OfficeDevPnP.Core.Framework.Provisioning.Model.WebSettings.md) ## See also - [ProvisioningTemplate](OfficeDevPnP.Core.Framework.Provisioning.Model.ProvisioningTemplate.md) - [OfficeDevPnP.Core.Framework.Provisioning.Model](OfficeDevPnP.Core.Framework.Provisioning.Model.md)
{ "content_hash": "04df396d37da3d3a29472b8c95bf92a5", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 131, "avg_line_length": 42.46666666666667, "alnum_prop": 0.7912087912087912, "repo_name": "PaoloPia/PnP-Guidance", "id": "da075d5e21bdbddf0f4737480e42f07385a763d5", "size": "683", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "sitescore/OfficeDevPnP.Core.Framework.Provisioning.Model.ProvisioningTemplate.WebSettings.md", "mode": "33188", "license": "mit", "language": [ { "name": "PowerShell", "bytes": "783" } ], "symlink_target": "" }
The ID3 algorithm begins with the original set S as the root node. On each iteration of the algorithm, it iterates through every unused attribute of the set S and calculates the entropy H(S) (or information gain IG(A)) of that attribute. It then selects the attribute which has the smallest entropy (or largest information gain) value. The set S is then split by the selected attribute (e.g. age is less than 50, age is between 50 and 100, age is greater than 100) to produce subsets of the data. The algorithm continues to recur on each subset, considering only attributes never selected before. [Read More...](https://en.wikipedia.org/wiki/ID3_algorithm) ## Data Set The weather problem is a toy data set which we will use to understand how a decision tree is built. It comes from Quinlan (1986), a paper which discusses the ID3 algorithm introduced in Quinlan (1979). It is reproduced with slight modifications in Witten and Frank (1999), and concerns the conditions under which some hypothetical outdoor game may be played. The data is shown below: | Outlook | Temperature | Humidity | Wind | Play Ball? | |:-------:|:-----------:|:--------:|:------:|:----------:| |Sunny | Hot | High | Weak | No | |Sunny | Hot | High | Strong | No | |Overcast | Hot | High | Weak | Yes | |Rain | Mild | High | Weak | Yes | |Rain | Cool | Normal | Weak | Yes | |Rain | Cool | Normal | Strong | No | |Overcast | Cool | Normal | Strong | Yes | |Sunny | Mild | High | Weak | No | |Sunny | Cool | Normal | Weak | Yes | |Rain | Mild | Normal | Weak | Yes | |Sunny | Mild | Normal | Strong | Yes | |Overcast | Mild | High | Strong | Yes | |Overcast | Hot | Normal | Weak | Yes | |Rain | Mild | High | Strong | No | ## How to Use it ### Compile Source Code Run following command in terminal: ``` javac ID3Test.java -encoding UTF-8 ``` ### Run Run following command in terminal: ``` java ID3Test ``` You'll get an output as following: ``` Input Outlook: (Sunny/Overcast/Rain) Sunny Input Temperature: (Hot/Mild/Cool) Mild Input Humidity: (Normal/High) Normal Input Wind: (Strong/Weak) Weak Decision: Attribute: [AttrName = PlayBall, AttrValue = YES] ```
{ "content_hash": "c826c8bbceffca6d4bb17ab583f597ab", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 596, "avg_line_length": 42.189655172413794, "alnum_prop": 0.6080915406620352, "repo_name": "zjhzxhz/Algorithm", "id": "d99c4a2f7e13d3df388c2360ab0aeb7a9a5d8a49", "size": "2471", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ID3/README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "174220" } ], "symlink_target": "" }
function HtmlLoader(){ if(typeof(window) == 'undefined' || window == null) throw 'Window cannot load!'; if(typeof(document) == 'undefined' || document == null) throw 'Document cannot load'; this.xmlhttp = null; this.html = null; this.w = window; this.d = document; this.c = console; } HtmlLoader.prototype.initLoader = function(){ if(this.w.XMLHttpRequest){ try{ this.xmlhttp = new XMLHttpRequest(); }catch(e){} }else{ try{ this.xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); }catch(e){ try{ this.xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); }catch(e){ throw 'Browser has problem init loader!'; return false; } } } return true; } HtmlLoader.prototype.requestHtml = function(uri, async, onloading, onloaded){ if(typeof(onloading) != 'function')throw 'onloading needs to be a function!'; onloading.call(); var xmlhttp = this.xmlhttp; var htmldata = null; this.xmlhttp.onreadystatechange = function(){ if(xmlhttp.readyState == 4 && xmlhttp.status < 400){ htmldata = xmlhttp.responseText; } } this.xmlhttp.open('GET', uri, async); this.xmlhttp.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8'); this.xmlhttp.send(null); this.html = htmldata; if(typeof(onloaded) != 'function')throw 'onloaded needs to be a function!'; onloaded.call(); } HtmlLoader.prototype.loadHtml = function(id){ var ele = null; if((ele = this.d.getElementById(id)) != null){ if(this.html != null){ ele.innerHTML = this.html; } } }
{ "content_hash": "dda90614cf1c6f99254b4212e6b325a3", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 78, "avg_line_length": 25.810344827586206, "alnum_prop": 0.6773547094188377, "repo_name": "encreddesign/PocketMoneyManager", "id": "b3d9dc3bc814a0379019a0132501949a81b96cfa", "size": "1497", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "PocketMoneyManager(PMM)/static/script/html-loader.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2265" }, { "name": "JavaScript", "bytes": "1497" }, { "name": "Python", "bytes": "737" } ], "symlink_target": "" }
from dvc.exceptions import InvalidArgumentError from . import locked @locked def update( self, targets=None, rev=None, recursive=False, to_remote=False, remote=None, jobs=None, ): from ..dvcfile import Dvcfile if not targets: targets = [None] if isinstance(targets, str): targets = [targets] if not to_remote and remote: raise InvalidArgumentError( "--remote can't be used without --to-remote" ) stages = set() for target in targets: stages.update(self.stage.collect(target, recursive=recursive)) for stage in stages: stage.update(rev, to_remote=to_remote, remote=remote, jobs=jobs) dvcfile = Dvcfile(self, stage.path) dvcfile.dump(stage) stages.add(stage) return list(stages)
{ "content_hash": "df1e89742603ddbdcf84cdf601a8509d", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 72, "avg_line_length": 21.28205128205128, "alnum_prop": 0.6265060240963856, "repo_name": "efiop/dvc", "id": "42c9d7d961c324858181dbe002adb74c3835b041", "size": "830", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dvc/repo/update.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "53" }, { "name": "Inno Setup", "bytes": "10158" }, { "name": "PowerShell", "bytes": "2686" }, { "name": "Python", "bytes": "2231040" }, { "name": "Shell", "bytes": "695" } ], "symlink_target": "" }
// Type definitions for bootstrap-datepicker // Project: https://github.com/eternicode/bootstrap-datepicker // Definitions by: Boris Yankov <https://github.com/borisyankov/> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// <reference types="jquery"/> /** * All options that take a “Date” can handle a Date object; a String * formatted according to the given format; or a timedelta relative * to today, eg “-1d”, “+6m +1y”, etc, where valid units are “d” (day), * “w” (week), “m” (month), and “y” (year). * * See online docs for more info: * https://bootstrap-datepicker.readthedocs.io/en/latest/options.html */ interface DatepickerOptions { format?: string | DatepickerCustomFormatOptions; weekStart?: number; startDate?: Date|string; endDate?: Date|string; autoclose?: boolean; startView?: number; todayBtn?: boolean|"linked"; todayHighlight?: boolean; keyboardNavigation?: boolean; language?: string; beforeShowDay?: (date: Date) => undefined|string|boolean|DatepickerBeforeShowDayResponse; beforeShowYear?: (date: Date) => undefined|string|boolean|DatepickerBeforeShowResponse; beforeShowDecade?: (date: Date) => undefined|string|boolean|DatepickerBeforeShowResponse; beforeShowCentury?: (date: Date) => undefined|string|boolean|DatepickerBeforeShowResponse; calendarWeeks?: boolean; clearBtn?: boolean; daysOfWeekDisabled?: number[]; forceParse?: boolean; inputs?: any[]; minViewMode?: 0|"days"|1|"months"|2|"years"|3|"decades"|4|"centuries"|"millenium"; multidate?: boolean|number; multidateSeparator?: string; orientation?: "auto"|"left top"|"left bottom"|"right top"|"right bottom"; assumeNearbyYear?: boolean|number; viewMode?: string; templates?: any; zIndexOffset?: number; showOnFocus?: boolean; immediateUpdates?: boolean; title?: string; container?: string; datesDisabled?:string|string[]; daysOfWeekHighlighted?:string|number[]; defaultViewDate?:Date|string|DatepickerViewDate; updateViewDate?:boolean; } interface DatepickerViewDate { year:number; /** Month starting with 0 */ month:number; /** Day of the month starting with 1 */ day:number; } interface DatepickerBeforeShowResponse { enabled?:boolean; classes?: string; tooltip?: string; } interface DatepickerBeforeShowDayResponse extends DatepickerBeforeShowResponse { content?: string; } interface DatepickerCustomFormatOptions { toDisplay?(date: string, format: any, language: any): string; toValue?(date: string, format: any, language: any): Date; } interface DatepickerEventObject extends JQueryEventObject { date: Date; dates: Date[]; format(ix?:number): string; format(format?: string): string; format(ix?:number, format?: string): string; } interface JQuery { datepicker(): JQuery; datepicker(methodName: string): any; datepicker(methodName: string, params: any): any; datepicker(options: DatepickerOptions): JQuery; off(events: "changeDate", selector?: string, handler?: (eventObject: DatepickerEventObject) => any): JQuery; off(events: "changeDate", handler: (eventObject: DatepickerEventObject) => any): JQuery; on(events: "changeDate", selector: string, data: any, handler?: (eventObject: DatepickerEventObject) => any): JQuery; on(events: "changeDate", selector: string, handler: (eventObject: DatepickerEventObject) => any): JQuery; on(events: 'changeDate', handler: (eventObject: DatepickerEventObject) => any): JQuery; }
{ "content_hash": "3d8c1265e8e93c0bccf710ab436d7aae", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 121, "avg_line_length": 36.505050505050505, "alnum_prop": 0.7066961815163254, "repo_name": "isman-usoh/DefinitelyTyped", "id": "9287ee1ba3e5b515186209368439a02845a51c5d", "size": "3642", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "types/bootstrap-datepicker/index.d.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CoffeeScript", "bytes": "15" }, { "name": "HTML", "bytes": "308" }, { "name": "Protocol Buffer", "bytes": "678" }, { "name": "TypeScript", "bytes": "21544576" } ], "symlink_target": "" }
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.ConsoleDebug.My.MySettings Get Return Global.ConsoleDebug.My.MySettings.Default End Get End Property End Module End Namespace
{ "content_hash": "f74e141eee97326dcbf2b6bb54a4e802", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 183, "avg_line_length": 39.89041095890411, "alnum_prop": 0.6493818681318682, "repo_name": "CompuMasterGmbH/CompuMaster.Console", "id": "6b2627667947f0a4dcc897d5a4bd2b7141af25cc", "size": "2914", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ConsoleDebug/My Project/Settings.Designer.vb", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2202" }, { "name": "Shell", "bytes": "35" }, { "name": "Visual Basic .NET", "bytes": "149927" } ], "symlink_target": "" }
/** * Listens for the app launching then creates the window * * @see http://developer.chrome.com/apps/app.runtime.html * @see http://developer.chrome.com/apps/app.window.html */ chrome.app.runtime.onLaunched.addListener(function() { runApp(); }); /** * Listens for the app restarting then re-creates the window. * * @see http://developer.chrome.com/apps/app.runtime.html */ chrome.app.runtime.onRestarted.addListener(function() { runApp(); }); /** * Creates the window for the application. * * @see http://developer.chrome.com/apps/app.window.html */ function runApp() { chrome.app.window.create('scan.html', { id: "scan-web-window", innerBounds: { 'width': 1000, 'height': 680 }, frame: { 'color': '#e6e6e6' } }); }
{ "content_hash": "bd3d6098df3a55e37f28a298fa733a72", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 61, "avg_line_length": 21.38888888888889, "alnum_prop": 0.6519480519480519, "repo_name": "rwatts3/chrome-apps", "id": "3499b2fbd08429e8409ccab6a8619bb98e18fa90", "size": "770", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Gitbook/main.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "14237" }, { "name": "HTML", "bytes": "6581" }, { "name": "JavaScript", "bytes": "133737" } ], "symlink_target": "" }
package io.crate.metadata.sys; import io.crate.metadata.IndexParts; import javax.annotation.Nullable; class TableHealth { enum Health { GREEN, YELLOW, RED; public short severity() { return (short) (ordinal() + 1); } } private final String tableName; private final String tableSchema; @Nullable private final String partitionIdent; private final Health health; private final long missingShards; private final long underreplicatedShards; private final String fqn; TableHealth(String tableName, String tableSchema, @Nullable String partitionIdent, Health health, long missingShards, long underreplicatedShards) { this.tableName = tableName; this.tableSchema = tableSchema; this.partitionIdent = partitionIdent; this.health = health; this.missingShards = missingShards; this.underreplicatedShards = underreplicatedShards; fqn = IndexParts.toIndexName(tableSchema, tableName, null); } public String getTableName() { return tableName; } public String getTableSchema() { return tableSchema; } @Nullable public String getPartitionIdent() { return partitionIdent; } public String getHealth() { return health.toString(); } public short getSeverity() { return health.severity(); } public long getMissingShards() { return missingShards; } public long getUnderreplicatedShards() { return underreplicatedShards; } public String fqn() { return fqn; } @Override public String toString() { return "TableHealth{" + "name='" + tableName + '\'' + ", schema='" + tableSchema + '\'' + ", partitionIdent='" + partitionIdent + '\'' + ", health=" + health + ", missingShards=" + missingShards + ", underreplicatedShards=" + underreplicatedShards + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TableHealth that = (TableHealth) o; if (missingShards != that.missingShards) return false; if (underreplicatedShards != that.underreplicatedShards) return false; if (!tableName.equals(that.tableName)) return false; if (!tableSchema.equals(that.tableSchema)) return false; if (partitionIdent != null ? !partitionIdent.equals(that.partitionIdent) : that.partitionIdent != null) return false; return health == that.health; } @Override public int hashCode() { int result = tableName.hashCode(); result = 31 * result + tableSchema.hashCode(); result = 31 * result + (partitionIdent != null ? partitionIdent.hashCode() : 0); result = 31 * result + health.hashCode(); result = 31 * result + (int) (missingShards ^ (missingShards >>> 32)); result = 31 * result + (int) (underreplicatedShards ^ (underreplicatedShards >>> 32)); return result; } }
{ "content_hash": "36177adfb040611ef50359d0017ea451", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 111, "avg_line_length": 28.25862068965517, "alnum_prop": 0.5945698596705308, "repo_name": "EvilMcJerkface/crate", "id": "3d387853826c3bc07e73f6a7b1ca179e79273325", "size": "4275", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/src/main/java/io/crate/metadata/sys/TableHealth.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "29877" }, { "name": "Batchfile", "bytes": "4123" }, { "name": "Java", "bytes": "24908818" }, { "name": "Python", "bytes": "64030" }, { "name": "Shell", "bytes": "9028" } ], "symlink_target": "" }
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the Places Command Controller. * * The Initial Developer of the Original Code is Google Inc. * Portions created by the Initial Developer are Copyright (C) 2005 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Ben Goodger <beng@google.com> * Myk Melez <myk@mozilla.org> * Asaf Romano <mano@mozilla.com> * Sungjoon Steve Won <stevewon@gmail.com> * Dietrich Ayala <dietrich@mozilla.com> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ function LOG(str) { dump("*** " + str + "\n"); } var EXPORTED_SYMBOLS = ["PlacesUtils"]; var Ci = Components.interfaces; var Cc = Components.classes; var Cr = Components.results; const POST_DATA_ANNO = "bookmarkProperties/POSTData"; const READ_ONLY_ANNO = "placesInternal/READ_ONLY"; const LMANNO_FEEDURI = "livemark/feedURI"; const LMANNO_SITEURI = "livemark/siteURI"; //@line 62 "e:\builds\tinderbox\XR-Trunk\WINNT_5.2_Depend\mozilla\toolkit\components\places\src\utils.js" // On other platforms, the transferable system converts "\r\n" to "\n". const NEWLINE = "\r\n"; //@line 65 "e:\builds\tinderbox\XR-Trunk\WINNT_5.2_Depend\mozilla\toolkit\components\places\src\utils.js" function QI_node(aNode, aIID) { var result = null; try { result = aNode.QueryInterface(aIID); } catch (e) { } return result; } function asVisit(aNode) { return QI_node(aNode, Ci.nsINavHistoryVisitResultNode); } function asFullVisit(aNode){ return QI_node(aNode, Ci.nsINavHistoryFullVisitResultNode);} function asContainer(aNode){ return QI_node(aNode, Ci.nsINavHistoryContainerResultNode);} function asQuery(aNode) { return QI_node(aNode, Ci.nsINavHistoryQueryResultNode); } var PlacesUtils = { // Place entries that are containers, e.g. bookmark folders or queries. TYPE_X_MOZ_PLACE_CONTAINER: "text/x-moz-place-container", // Place entries that are bookmark separators. TYPE_X_MOZ_PLACE_SEPARATOR: "text/x-moz-place-separator", // Place entries that are not containers or separators TYPE_X_MOZ_PLACE: "text/x-moz-place", // Place entries in shortcut url format (url\ntitle) TYPE_X_MOZ_URL: "text/x-moz-url", // Place entries formatted as HTML anchors TYPE_HTML: "text/html", // Place entries as raw URL text TYPE_UNICODE: "text/unicode", /** * The Bookmarks Service. */ get bookmarks() { delete this.bookmarks; return this.bookmarks = Cc["@mozilla.org/browser/nav-bookmarks-service;1"]. getService(Ci.nsINavBookmarksService); }, /** * The Nav History Service. */ get history() { delete this.history; return this.history = Cc["@mozilla.org/browser/nav-history-service;1"]. getService(Ci.nsINavHistoryService); }, /** * The Live Bookmark Service. */ get livemarks() { delete this.livemarks; return this.livemarks = Cc["@mozilla.org/browser/livemark-service;2"]. getService(Ci.nsILivemarkService); }, /** * The Annotations Service. */ get annotations() { delete this.annotations; return this.annotations = Cc["@mozilla.org/browser/annotation-service;1"]. getService(Ci.nsIAnnotationService); }, /** * The Favicons Service */ get favicons() { delete this.favicons; return this.favicons = Cc["@mozilla.org/browser/favicon-service;1"]. getService(Ci.nsIFaviconService); }, /** * The Places Tagging Service */ get tagging() { delete this.tagging; return this.tagging = Cc["@mozilla.org/browser/tagging-service;1"]. getService(Ci.nsITaggingService); }, /** * Makes a URI from a spec. * @param aSpec * The string spec of the URI * @returns A URI object for the spec. */ _uri: function PU__uri(aSpec) { return Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService). newURI(aSpec, null, null); }, /** * String bundle helpers */ get _bundle() { const PLACES_STRING_BUNDLE_URI = "chrome://places/locale/places.properties"; delete this._bundle; return this._bundle = Cc["@mozilla.org/intl/stringbundle;1"]. getService(Ci.nsIStringBundleService). createBundle(PLACES_STRING_BUNDLE_URI); }, getFormattedString: function PU_getFormattedString(key, params) { return this._bundle.formatStringFromName(key, params, params.length); }, getString: function PU_getString(key) { return this._bundle.GetStringFromName(key); }, /** * Determines whether or not a ResultNode is a Bookmark folder. * @param aNode * A result node * @returns true if the node is a Bookmark folder, false otherwise */ nodeIsFolder: function PU_nodeIsFolder(aNode) { return (aNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER || aNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT); }, /** * Determines whether or not a ResultNode represents a bookmarked URI. * @param aNode * A result node * @returns true if the node represents a bookmarked URI, false otherwise */ nodeIsBookmark: function PU_nodeIsBookmark(aNode) { return aNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_URI && aNode.itemId != -1; }, /** * Determines whether or not a ResultNode is a Bookmark separator. * @param aNode * A result node * @returns true if the node is a Bookmark separator, false otherwise */ nodeIsSeparator: function PU_nodeIsSeparator(aNode) { return (aNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR); }, /** * Determines whether or not a ResultNode is a visit item. * @param aNode * A result node * @returns true if the node is a visit item, false otherwise */ nodeIsVisit: function PU_nodeIsVisit(aNode) { const NHRN = Ci.nsINavHistoryResultNode; var type = aNode.type; return type == NHRN.RESULT_TYPE_VISIT || type == NHRN.RESULT_TYPE_FULL_VISIT; }, /** * Determines whether or not a ResultNode is a URL item. * @param aNode * A result node * @returns true if the node is a URL item, false otherwise */ uriTypes: [Ci.nsINavHistoryResultNode.RESULT_TYPE_URI, Ci.nsINavHistoryResultNode.RESULT_TYPE_VISIT, Ci.nsINavHistoryResultNode.RESULT_TYPE_FULL_VISIT], nodeIsURI: function PU_nodeIsURI(aNode) { return this.uriTypes.indexOf(aNode.type) != -1; }, /** * Determines whether or not a ResultNode is a Query item. * @param aNode * A result node * @returns true if the node is a Query item, false otherwise */ nodeIsQuery: function PU_nodeIsQuery(aNode) { return aNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY; }, /** * Determines if a node is read only (children cannot be inserted, sometimes * they cannot be removed depending on the circumstance) * @param aNode * A result node * @returns true if the node is readonly, false otherwise */ nodeIsReadOnly: function PU_nodeIsReadOnly(aNode) { if (this.nodeIsFolder(aNode)) return this.bookmarks.getFolderReadonly(asQuery(aNode).folderItemId); if (this.nodeIsQuery(aNode) && asQuery(aNode).queryOptions.resultType != Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_CONTENTS) return aNode.childrenReadOnly; return false; }, /** * Determines whether or not a ResultNode is a host container. * @param aNode * A result node * @returns true if the node is a host container, false otherwise */ nodeIsHost: function PU_nodeIsHost(aNode) { return aNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY && aNode.parent && asQuery(aNode.parent).queryOptions.resultType == Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY; }, /** * Determines whether or not a ResultNode is a day container. * @param node * A NavHistoryResultNode * @returns true if the node is a day container, false otherwise */ nodeIsDay: function PU_nodeIsDay(aNode) { var resultType; return aNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY && aNode.parent && ((resultType = asQuery(aNode.parent).queryOptions.resultType) == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY || resultType == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY); }, /** * Determines whether or not a result-node is a tag container. * @param aNode * A result-node * @returns true if the node is a tag container, false otherwise */ nodeIsTagQuery: function PU_nodeIsTagQuery(aNode) { return aNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY && asQuery(aNode).queryOptions.resultType == Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_CONTENTS; }, /** * Determines whether or not a ResultNode is a container. * @param aNode * A result node * @returns true if the node is a container item, false otherwise */ containerTypes: [Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER, Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT, Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY, Ci.nsINavHistoryResultNode.RESULT_TYPE_DYNAMIC_CONTAINER], nodeIsContainer: function PU_nodeIsContainer(aNode) { return this.containerTypes.indexOf(aNode.type) != -1; }, /** * Determines whether or not a ResultNode is an history related container. * @param node * A result node * @returns true if the node is an history related container, false otherwise */ nodeIsHistoryContainer: function PU_nodeIsHistoryContainer(aNode) { var resultType; return this.nodeIsQuery(aNode) && ((resultType = asQuery(aNode).queryOptions.resultType) == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY || resultType == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY || resultType == Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY || this.nodeIsDay(aNode) || this.nodeIsHost(aNode)); }, /** * Determines whether or not a result-node is a dynamic-container item. * The dynamic container result node type is for dynamically created * containers (e.g. for the file browser service where you get your folders * in bookmark menus). * @param aNode * A result node * @returns true if the node is a dynamic container item, false otherwise */ nodeIsDynamicContainer: function PU_nodeIsDynamicContainer(aNode) { if (aNode.type == NHRN.RESULT_TYPE_DYNAMIC_CONTAINER) return true; return false; }, /** * Determines whether a result node is a remote container registered by the * livemark service. * @param aNode * A result Node * @returns true if the node is a livemark container item */ nodeIsLivemarkContainer: function PU_nodeIsLivemarkContainer(aNode) { // Use the annotations service directly to avoid instantiating // the Livemark service on startup. (bug 398300) return this.nodeIsFolder(aNode) && this.annotations.itemHasAnnotation(aNode.itemId, LMANNO_FEEDURI); }, /** * Determines whether a result node is a live-bookmark item * @param aNode * A result node * @returns true if the node is a livemark container item */ nodeIsLivemarkItem: function PU_nodeIsLivemarkItem(aNode) { return aNode.parent && this.nodeIsLivemarkContainer(aNode.parent); }, /** * Determines whether or not a node is a readonly folder. * @param aNode * The node to test. * @returns true if the node is a readonly folder. */ isReadonlyFolder: function(aNode) { return this.nodeIsFolder(aNode) && this.bookmarks.getFolderReadonly(asQuery(aNode).folderItemId); }, /** * Gets the concrete item-id for the given node. Generally, this is just * node.itemId, but for folder-shortcuts that's node.folderItemId. */ getConcreteItemId: function PU_getConcreteItemId(aNode) { if (aNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT) return asQuery(aNode).folderItemId; else if (PlacesUtils.nodeIsTagQuery(aNode)) { // RESULTS_AS_TAG_CONTENTS queries are similar to folder shortcuts // so we can still get the concrete itemId for them. var queries = aNode.getQueries({}); var folders = queries[0].getFolders({}); return folders[0]; } return aNode.itemId; }, /** * Gets the index of a node within its parent container * @param aNode * The node to look up * @returns The index of the node within its parent container, or -1 if the * node was not found or the node specified has no parent. */ getIndexOfNode: function PU_getIndexOfNode(aNode) { var parent = aNode.parent; if (!parent) return -1; var wasOpen = parent.containerOpen; var result, oldViewer; if (!wasOpen) { result = parent.parentResult; oldViewer = result.viewer; result.viewer = null; parent.containerOpen = true; } var cc = parent.childCount; for (var i = 0; i < cc && parent.getChild(i) != aNode; ++i); if (!wasOpen) { parent.containerOpen = false; result.viewer = oldViewer; } return i < cc ? i : -1; }, /** * String-wraps a result node according to the rules of the specified * content type. * @param aNode * The Result node to wrap (serialize) * @param aType * The content type to serialize as * @param [optional] aOverrideURI * Used instead of the node's URI if provided. * This is useful for wrapping a container as TYPE_X_MOZ_URL, * TYPE_HTML or TYPE_UNICODE. * @param aForceCopy * Does a full copy, resolving folder shortcuts. * @returns A string serialization of the node */ wrapNode: function PU_wrapNode(aNode, aType, aOverrideURI, aForceCopy) { var self = this; // when wrapping a node, we want all the items, even if the original // query options are excluding them. // this can happen when copying from the left hand pane of the bookmarks // organizer function convertNode(cNode) { if (self.nodeIsFolder(cNode) && asQuery(cNode).queryOptions.excludeItems) { var concreteId = self.getConcreteItemId(cNode); return self.getFolderContents(concreteId, false, true).root; } return cNode; } switch (aType) { case this.TYPE_X_MOZ_PLACE: case this.TYPE_X_MOZ_PLACE_SEPARATOR: case this.TYPE_X_MOZ_PLACE_CONTAINER: var writer = { value: "", write: function PU_wrapNode__write(aStr, aLen) { this.value += aStr; } }; self.serializeNodeAsJSONToOutputStream(convertNode(aNode), writer, true, aForceCopy); return writer.value; case this.TYPE_X_MOZ_URL: function gatherDataUrl(bNode) { if (self.nodeIsLivemarkContainer(bNode)) { var siteURI = self.livemarks.getSiteURI(bNode.itemId).spec; return siteURI + NEWLINE + bNode.title; } if (self.nodeIsURI(bNode)) return (aOverrideURI || bNode.uri) + NEWLINE + bNode.title; // ignore containers and separators - items without valid URIs return ""; } return gatherDataUrl(convertNode(aNode)); case this.TYPE_HTML: function gatherDataHtml(bNode) { function htmlEscape(s) { s = s.replace(/&/g, "&amp;"); s = s.replace(/>/g, "&gt;"); s = s.replace(/</g, "&lt;"); s = s.replace(/"/g, "&quot;"); s = s.replace(/'/g, "&apos;"); return s; } // escape out potential HTML in the title var escapedTitle = bNode.title ? htmlEscape(bNode.title) : ""; if (self.nodeIsLivemarkContainer(bNode)) { var siteURI = self.livemarks.getSiteURI(bNode.itemId).spec; return "<A HREF=\"" + siteURI + "\">" + escapedTitle + "</A>" + NEWLINE; } if (self.nodeIsContainer(bNode)) { asContainer(bNode); var wasOpen = bNode.containerOpen; if (!wasOpen) bNode.containerOpen = true; var childString = "<DL><DT>" + escapedTitle + "</DT>" + NEWLINE; var cc = bNode.childCount; for (var i = 0; i < cc; ++i) childString += "<DD>" + NEWLINE + gatherDataHtml(bNode.getChild(i)) + "</DD>" + NEWLINE; bNode.containerOpen = wasOpen; return childString + "</DL>" + NEWLINE; } if (self.nodeIsURI(bNode)) return "<A HREF=\"" + bNode.uri + "\">" + escapedTitle + "</A>" + NEWLINE; if (self.nodeIsSeparator(bNode)) return "<HR>" + NEWLINE; return ""; } return gatherDataHtml(convertNode(aNode)); } // case this.TYPE_UNICODE: function gatherDataText(bNode) { if (self.nodeIsLivemarkContainer(bNode)) return self.livemarks.getSiteURI(bNode.itemId).spec; if (self.nodeIsContainer(bNode)) { asContainer(bNode); var wasOpen = bNode.containerOpen; if (!wasOpen) bNode.containerOpen = true; var childString = bNode.title + NEWLINE; var cc = bNode.childCount; for (var i = 0; i < cc; ++i) { var child = bNode.getChild(i); var suffix = i < (cc - 1) ? NEWLINE : ""; childString += gatherDataText(child) + suffix; } bNode.containerOpen = wasOpen; return childString; } if (self.nodeIsURI(bNode)) return (aOverrideURI || bNode.uri); if (self.nodeIsSeparator(bNode)) return "--------------------"; return ""; } return gatherDataText(convertNode(aNode)); }, /** * Unwraps data from the Clipboard or the current Drag Session. * @param blob * A blob (string) of data, in some format we potentially know how * to parse. * @param type * The content type of the blob. * @returns An array of objects representing each item contained by the source. */ unwrapNodes: function PU_unwrapNodes(blob, type) { // We split on "\n" because the transferable system converts "\r\n" to "\n" var nodes = []; switch(type) { case this.TYPE_X_MOZ_PLACE: case this.TYPE_X_MOZ_PLACE_SEPARATOR: case this.TYPE_X_MOZ_PLACE_CONTAINER: var JSON = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON); nodes = JSON.decode("[" + blob + "]"); break; case this.TYPE_X_MOZ_URL: var parts = blob.split("\n"); // data in this type has 2 parts per entry, so if there are fewer // than 2 parts left, the blob is malformed and we should stop // but drag and drop of files from the shell has parts.length = 1 if (parts.length != 1 && parts.length % 2) break; for (var i = 0; i < parts.length; i=i+2) { var uriString = parts[i]; var titleString = ""; if (parts.length > i+1) titleString = parts[i+1]; else { // for drag and drop of files, try to use the leafName as title try { titleString = this._uri(uriString).QueryInterface(Ci.nsIURL) .fileName; } catch (e) {} } // note: this._uri() will throw if uriString is not a valid URI if (this._uri(uriString)) { nodes.push({ uri: uriString, title: titleString ? titleString : uriString , type: this.TYPE_X_MOZ_URL }); } } break; case this.TYPE_UNICODE: var parts = blob.split("\n"); for (var i = 0; i < parts.length; i++) { var uriString = parts[i]; // note: this._uri() will throw if uriString is not a valid URI if (uriString != "" && this._uri(uriString)) nodes.push({ uri: uriString, title: uriString, type: this.TYPE_X_MOZ_URL }); } break; default: LOG("Cannot unwrap data of type " + type); throw Cr.NS_ERROR_INVALID_ARG; } return nodes; }, /** * Generates a nsINavHistoryResult for the contents of a folder. * @param folderId * The folder to open * @param [optional] excludeItems * True to hide all items (individual bookmarks). This is used on * the left places pane so you just get a folder hierarchy. * @param [optional] expandQueries * True to make query items expand as new containers. For managing, * you want this to be false, for menus and such, you want this to * be true. * @returns A nsINavHistoryResult containing the contents of the * folder. The result.root is guaranteed to be open. */ getFolderContents: function PU_getFolderContents(aFolderId, aExcludeItems, aExpandQueries) { var query = this.history.getNewQuery(); query.setFolders([aFolderId], 1); var options = this.history.getNewQueryOptions(); options.excludeItems = aExcludeItems; options.expandQueries = aExpandQueries; var result = this.history.executeQuery(query, options); result.root.containerOpen = true; return result; }, /** * Fetch all annotations for a URI, including all properties of each * annotation which would be required to recreate it. * @param aURI * The URI for which annotations are to be retrieved. * @return Array of objects, each containing the following properties: * name, flags, expires, mimeType, type, value */ getAnnotationsForURI: function PU_getAnnotationsForURI(aURI) { var annosvc = this.annotations; var annos = [], val = null; var annoNames = annosvc.getPageAnnotationNames(aURI, {}); for (var i = 0; i < annoNames.length; i++) { var flags = {}, exp = {}, mimeType = {}, storageType = {}; annosvc.getPageAnnotationInfo(aURI, annoNames[i], flags, exp, mimeType, storageType); if (storageType.value == annosvc.TYPE_BINARY) { var data = {}, length = {}, mimeType = {}; annosvc.getPageAnnotationBinary(aURI, annoNames[i], data, length, mimeType); val = data.value; } else val = annosvc.getPageAnnotation(aURI, annoNames[i]); annos.push({name: annoNames[i], flags: flags.value, expires: exp.value, mimeType: mimeType.value, type: storageType.value, value: val}); } return annos; }, /** * Fetch all annotations for an item, including all properties of each * annotation which would be required to recreate it. * @param aItemId * The identifier of the itme for which annotations are to be * retrieved. * @return Array of objects, each containing the following properties: * name, flags, expires, mimeType, type, value */ getAnnotationsForItem: function PU_getAnnotationsForItem(aItemId) { var annosvc = this.annotations; var annos = [], val = null; var annoNames = annosvc.getItemAnnotationNames(aItemId, {}); for (var i = 0; i < annoNames.length; i++) { var flags = {}, exp = {}, mimeType = {}, storageType = {}; annosvc.getItemAnnotationInfo(aItemId, annoNames[i], flags, exp, mimeType, storageType); if (storageType.value == annosvc.TYPE_BINARY) { var data = {}, length = {}, mimeType = {}; annosvc.geItemAnnotationBinary(aItemId, annoNames[i], data, length, mimeType); val = data.value; } else val = annosvc.getItemAnnotation(aItemId, annoNames[i]); annos.push({name: annoNames[i], flags: flags.value, expires: exp.value, mimeType: mimeType.value, type: storageType.value, value: val}); } return annos; }, /** * Annotate a URI with a batch of annotations. * @param aURI * The URI for which annotations are to be set. * @param aAnnotations * Array of objects, each containing the following properties: * name, flags, expires, type, mimeType (only used for binary * annotations) value. */ setAnnotationsForURI: function PU_setAnnotationsForURI(aURI, aAnnos) { var annosvc = this.annotations; aAnnos.forEach(function(anno) { var flags = ("flags" in anno) ? anno.flags : 0; var expires = ("expires" in anno) ? anno.expires : Ci.nsIAnnotationService.EXPIRE_NEVER; if (anno.type == annosvc.TYPE_BINARY) { annosvc.setPageAnnotationBinary(aURI, anno.name, anno.value, anno.value.length, anno.mimeType, flags, expires); } else annosvc.setPageAnnotation(aURI, anno.name, anno.value, flags, expires); }); }, /** * Annotate an item with a batch of annotations. * @param aItemId * The identifier of the item for which annotations are to be set * @param aAnnotations * Array of objects, each containing the following properties: * name, flags, expires, type, mimeType (only used for binary * annotations) value. */ setAnnotationsForItem: function PU_setAnnotationsForItem(aItemId, aAnnos) { var annosvc = this.annotations; aAnnos.forEach(function(anno) { var flags = ("flags" in anno) ? anno.flags : 0; var expires = ("expires" in anno) ? anno.expires : Ci.nsIAnnotationService.EXPIRE_NEVER; if (anno.type == annosvc.TYPE_BINARY) { annosvc.setItemAnnotationBinary(aItemId, anno.name, anno.value, anno.value.length, anno.mimeType, flags, expires); } else { annosvc.setItemAnnotation(aItemId, anno.name, anno.value, flags, expires); } }); }, /** * Helper for getting a serialized Places query for a particular folder. * @param aFolderId The folder id to get a query for. * @return string serialized place URI */ getQueryStringForFolder: function PU_getQueryStringForFolder(aFolderId) { var options = this.history.getNewQueryOptions(); var query = this.history.getNewQuery(); query.setFolders([aFolderId], 1); return this.history.queriesToQueryString([query], 1, options); }, // identifier getters for special folders get placesRootId() { delete this.placesRootId; return this.placesRootId = this.bookmarks.placesRoot; }, get bookmarksMenuFolderId() { delete this.bookmarksMenuFolderId; return this.bookmarksMenuFolderId = this.bookmarks.bookmarksMenuFolder; }, get toolbarFolderId() { delete this.toolbarFolderId; return this.toolbarFolderId = this.bookmarks.toolbarFolder; }, get tagsFolderId() { delete this.tagsFolderId; return this.tagsFolderId = this.bookmarks.tagsFolder; }, get unfiledBookmarksFolderId() { delete this.unfiledBookmarksFolderId; return this.unfiledBookmarksFolderId = this.bookmarks.unfiledBookmarksFolder; }, /** * Set the POST data associated with a bookmark, if any. * Used by POST keywords. * @param aBookmarkId * @returns string of POST data */ setPostDataForBookmark: function PU_setPostDataForBookmark(aBookmarkId, aPostData) { const annos = this.annotations; if (aPostData) annos.setItemAnnotation(aBookmarkId, POST_DATA_ANNO, aPostData, 0, Ci.nsIAnnotationService.EXPIRE_NEVER); else if (annos.itemHasAnnotation(aBookmarkId, POST_DATA_ANNO)) annos.removeItemAnnotation(aBookmarkId, POST_DATA_ANNO); }, /** * Get the POST data associated with a bookmark, if any. * @param aBookmarkId * @returns string of POST data if set for aBookmarkId. null otherwise. */ getPostDataForBookmark: function PU_getPostDataForBookmark(aBookmarkId) { const annos = this.annotations; if (annos.itemHasAnnotation(aBookmarkId, POST_DATA_ANNO)) return annos.getItemAnnotation(aBookmarkId, POST_DATA_ANNO); return null; }, /** * Get the URI (and any associated POST data) for a given keyword. * @param aKeyword string keyword * @returns an array containing a string URL and a string of POST data */ getURLAndPostDataForKeyword: function PU_getURLAndPostDataForKeyword(aKeyword) { var url = null, postdata = null; try { var uri = this.bookmarks.getURIForKeyword(aKeyword); if (uri) { url = uri.spec; var bookmarks = this.bookmarks.getBookmarkIdsForURI(uri, {}); for (let i = 0; i < bookmarks.length; i++) { var bookmark = bookmarks[i]; var kw = this.bookmarks.getKeywordForBookmark(bookmark); if (kw == aKeyword) { postdata = this.getPostDataForBookmark(bookmark); break; } } } } catch(ex) {} return [url, postdata]; }, /** * Get all bookmarks for a URL, excluding items under tag or livemark * containers. */ getBookmarksForURI: function PU_getBookmarksForURI(aURI) { var bmkIds = this.bookmarks.getBookmarkIdsForURI(aURI, {}); // filter the ids list return bmkIds.filter(function(aID) { var parent = this.bookmarks.getFolderIdForItem(aID); // Livemark child if (this.annotations.itemHasAnnotation(parent, LMANNO_FEEDURI)) return false; var grandparent = this.bookmarks.getFolderIdForItem(parent); // item under a tag container if (grandparent == this.tagsFolderId) return false; return true; }, this); }, /** * Get the most recently added/modified bookmark for a URL, excluding items * under tag or livemark containers. -1 is returned if no item is found. */ getMostRecentBookmarkForURI: function PU_getMostRecentBookmarkForURI(aURI) { var bmkIds = this.bookmarks.getBookmarkIdsForURI(aURI, {}); for (var i = 0; i < bmkIds.length; i++) { // Find the first folder which isn't a tag container var bk = bmkIds[i]; var parent = this.bookmarks.getFolderIdForItem(bk); if (parent == this.unfiledBookmarksFolderId) return bk; var grandparent = this.bookmarks.getFolderIdForItem(parent); if (grandparent != this.tagsFolderId && !this.annotations.itemHasAnnotation(parent, LMANNO_FEEDURI)) return bk; } return -1; }, getMostRecentFolderForFeedURI: function PU_getMostRecentFolderForFeedURI(aURI) { var feedSpec = aURI.spec var annosvc = this.annotations; var livemarks = annosvc.getItemsWithAnnotation(LMANNO_FEEDURI, {}); for (var i = 0; i < livemarks.length; i++) { if (annosvc.getItemAnnotation(livemarks[i], LMANNO_FEEDURI) == feedSpec) return livemarks[i]; } return -1; }, // Returns true if a container has uris in its first level // Has better performances than checking getURLsForContainerNode(node).length hasChildURIs: function PU_hasChildURIs(aNode) { if (!this.nodeIsContainer(aNode)) return false; // in the Library left pane we use excludeItems if (this.nodeIsFolder(aNode) && asQuery(aNode).queryOptions.excludeItems) { var itemId = PlacesUtils.getConcreteItemId(aNode); var contents = this.getFolderContents(itemId, false, false).root; for (var i = 0; i < contents.childCount; ++i) { var child = contents.getChild(i); if (this.nodeIsURI(child)) return true; } return false; } var wasOpen = aNode.containerOpen; if (!wasOpen) aNode.containerOpen = true; var found = false; for (var i = 0; i < aNode.childCount && !found; i++) { var child = aNode.getChild(i); if (this.nodeIsURI(child)) found = true; } if (!wasOpen) aNode.containerOpen = false; return found; }, getURLsForContainerNode: function PU_getURLsForContainerNode(aNode) { let urls = []; if (this.nodeIsFolder(aNode) && asQuery(aNode).queryOptions.excludeItems) { // grab manually var itemId = this.getConcreteItemId(aNode); let contents = this.getFolderContents(itemId, false, false).root; for (let i = 0; i < contents.childCount; ++i) { let child = contents.getChild(i); if (this.nodeIsURI(child)) urls.push({uri: child.uri, isBookmark: this.nodeIsBookmark(child)}); } } else { let result, oldViewer, wasOpen; try { let wasOpen = aNode.containerOpen; result = aNode.parentResult; oldViewer = result.viewer; if (!wasOpen) { result.viewer = null; aNode.containerOpen = true; } for (let i = 0; i < aNode.childCount; ++i) { // Include visible url nodes only let child = aNode.getChild(i); if (this.nodeIsURI(child)) { // If the node contents is visible, add the uri only if its node is // visible. Otherwise follow viewer's collapseDuplicates property, // default to true if ((wasOpen && oldViewer && child.viewIndex != -1) || (oldViewer && !oldViewer.collapseDuplicates) || urls.indexOf(child.uri) == -1) { urls.push({ uri: child.uri, isBookmark: this.nodeIsBookmark(child) }); } } } if (!wasOpen) aNode.containerOpen = false; } finally { if (!wasOpen) result.viewer = oldViewer; } } return urls; }, /** * Restores bookmarks/tags from a JSON file. * WARNING: This method *removes* any bookmarks in the collection before * restoring from the file. * * @param aFile * nsIFile of bookmarks in JSON format to be restored. * @param aExcludeItems * Array of root item ids (ie: children of the places root) * to not delete when restoring. */ restoreBookmarksFromJSONFile: function PU_restoreBookmarksFromJSONFile(aFile, aExcludeItems) { // open file stream var stream = Cc["@mozilla.org/network/file-input-stream;1"]. createInstance(Ci.nsIFileInputStream); stream.init(aFile, 0x01, 0, 0); var converted = Cc["@mozilla.org/intl/converter-input-stream;1"]. createInstance(Ci.nsIConverterInputStream); converted.init(stream, "UTF-8", 1024, Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); // read in contents var str = {}; var jsonStr = ""; while (converted.readString(4096, str) != 0) jsonStr += str.value; converted.close(); if (jsonStr.length == 0) return; // empty file this.restoreBookmarksFromJSONString(jsonStr, true, aExcludeItems); }, /** * Import bookmarks from a JSON string. * * @param aString * JSON string of serialized bookmark data. * @param aReplace * Boolean if true, replace existing bookmarks, else merge. * @param aExcludeItems * Array of root item ids (ie: children of the places root) * to not delete when restoring. */ restoreBookmarksFromJSONString: function PU_restoreBookmarksFromJSONString(aString, aReplace, aExcludeItems) { // convert string to JSON var nodes = this.unwrapNodes(aString, this.TYPE_X_MOZ_PLACE_CONTAINER); if (nodes.length == 0 || !nodes[0].children || nodes[0].children.length == 0) return; // nothing to restore // ensure tag folder gets processed last nodes[0].children.sort(function sortRoots(aNode, bNode) { return (aNode.root && aNode.root == "tagsFolder") ? 1 : (bNode.root && bNode.root == "tagsFolder") ? -1 : 0; }); var batch = { _utils: this, nodes: nodes[0].children, runBatched: function restore_runBatched() { if (aReplace) { var excludeItems = aExcludeItems || []; // delete existing children of the root node, excepting: // 1. special folders: delete the child nodes // 2. tags folder: untag via the tagging api var query = this._utils.history.getNewQuery(); query.setFolders([this._utils.placesRootId], 1); var options = this._utils.history.getNewQueryOptions(); options.expandQueries = false; var root = this._utils.history.executeQuery(query, options).root; root.containerOpen = true; var childIds = []; for (var i = 0; i < root.childCount; i++) { var childId = root.getChild(i).itemId; if (excludeItems.indexOf(childId) == -1) childIds.push(childId); } root.containerOpen = false; for (var i = 0; i < childIds.length; i++) { var rootItemId = childIds[i]; if (rootItemId == this._utils.tagsFolderId) { // remove tags via the tagging service var tags = this._utils.tagging.allTags; var uris = []; var bogusTagContainer = false; for (let i in tags) { var tagURIs = []; // skip empty tags since getURIsForTag would throw if (tags[i]) tagURIs = this._utils.tagging.getURIsForTag(tags[i]); if (!tagURIs.length) { // This is a bogus tag container, empty tags should be removed // automatically, but this does not work if they contain some // not-uri node, so we remove them manually. // XXX this is a temporary workaround until we implement // preventive database maintainance in bug 431558. bogusTagContainer = true; } for (let j in tagURIs) this._utils.tagging.untagURI(tagURIs[j], [tags[i]]); } if (bogusTagContainer) this._utils.bookmarks.removeFolderChildren(rootItemId); } else if ([this._utils.toolbarFolderId, this._utils.unfiledBookmarksFolderId, this._utils.bookmarksMenuFolderId].indexOf(rootItemId) != -1) this._utils.bookmarks.removeFolderChildren(rootItemId); else this._utils.bookmarks.removeItem(rootItemId); } } var searchIds = []; var folderIdMap = []; this.nodes.forEach(function(node) { if (!node.children || node.children.length == 0) return; // nothing to restore for this root if (node.root) { var container = this.placesRootId; // default to places root switch (node.root) { case "bookmarksMenuFolder": container = this.bookmarksMenuFolderId; break; case "tagsFolder": container = this.tagsFolderId; break; case "unfiledBookmarksFolder": container = this.unfiledBookmarksFolderId; break; case "toolbarFolder": container = this.toolbarFolderId; break; } // insert the data into the db node.children.forEach(function(child) { var index = child.index; var [folders, searches] = this.importJSONNode(child, container, index); folderIdMap = folderIdMap.concat(folders); searchIds = searchIds.concat(searches); }, this); } else this.importJSONNode(node, this.placesRootId, node.index); }, this._utils); // fixup imported place: uris that contain folders searchIds.forEach(function(aId) { var oldURI = this.bookmarks.getBookmarkURI(aId); var uri = this._fixupQuery(this.bookmarks.getBookmarkURI(aId), folderIdMap); if (!uri.equals(oldURI)) this.bookmarks.changeBookmarkURI(aId, uri); }, this._utils); } }; this.bookmarks.runInBatchMode(batch, null); }, /** * Takes a JSON-serialized node and inserts it into the db. * * @param aData * The unwrapped data blob of dropped or pasted data. * @param aContainer * The container the data was dropped or pasted into * @param aIndex * The index within the container the item was dropped or pasted at * @returns an array containing of maps of old folder ids to new folder ids, * and an array of saved search ids that need to be fixed up. * eg: [[[oldFolder1, newFolder1]], [search1]] */ importJSONNode: function PU_importJSONNode(aData, aContainer, aIndex) { var folderIdMap = []; var searchIds = []; var id = -1; switch (aData.type) { case this.TYPE_X_MOZ_PLACE_CONTAINER: if (aContainer == PlacesUtils.bookmarks.tagsFolder) { if (aData.children) { aData.children.forEach(function(aChild) { try { this.tagging.tagURI(this._uri(aChild.uri), [aData.title]); } catch (ex) { // invalid tag child, skip it } }, this); return [folderIdMap, searchIds]; } } else if (aData.livemark && aData.annos) { // node is a livemark var feedURI = null; var siteURI = null; aData.annos = aData.annos.filter(function(aAnno) { if (aAnno.name == LMANNO_FEEDURI) { feedURI = this._uri(aAnno.value); return false; } else if (aAnno.name == LMANNO_SITEURI) { siteURI = this._uri(aAnno.value); return false; } return true; }, this); if (feedURI) id = this.livemarks.createLivemark(aContainer, aData.title, siteURI, feedURI, aIndex); } else { id = this.bookmarks.createFolder(aContainer, aData.title, aIndex); folderIdMap.push([aData.id, id]); // process children if (aData.children) { aData.children.every(function(aChild, aIndex) { var [folderIds, searches] = this.importJSONNode(aChild, id, aIndex); folderIdMap = folderIdMap.concat(folderIds); searchIds = searchIds.concat(searches); return true; }, this); } } break; case this.TYPE_X_MOZ_PLACE: id = this.bookmarks.insertBookmark(aContainer, this._uri(aData.uri), aIndex, aData.title); if (aData.keyword) this.bookmarks.setKeywordForBookmark(id, aData.keyword); if (aData.tags) { var tags = aData.tags.split(", "); if (tags.length) this.tagging.tagURI(this._uri(aData.uri), tags); } if (aData.charset) this.history.setCharsetForURI(this._uri(aData.uri), aData.charset); if (aData.uri.match(/^place:/)) searchIds.push(id); break; case this.TYPE_X_MOZ_PLACE_SEPARATOR: id = this.bookmarks.insertSeparator(aContainer, aIndex); break; default: } // set generic properties if (id != -1) { this.bookmarks.setItemDateAdded(id, aData.dateAdded); this.bookmarks.setItemLastModified(id, aData.lastModified); if (aData.annos) this.setAnnotationsForItem(id, aData.annos); } return [folderIdMap, searchIds]; }, /** * Replaces imported folder ids with their local counterparts in a place: URI. * * @param aURI * A place: URI with folder ids. * @param aFolderIdMap * An array mapping old folder id to new folder ids. * @returns the fixed up URI if all matched. If some matched, it returns * the URI with only the matching folders included. If none matched it * returns the input URI unchanged. */ _fixupQuery: function PU__fixupQuery(aQueryURI, aFolderIdMap) { var queries = {}; var options = {}; this.history.queryStringToQueries(aQueryURI.spec, queries, {}, options); var fixedQueries = []; queries.value.forEach(function(aQuery) { var folders = aQuery.getFolders({}); var newFolders = []; aFolderIdMap.forEach(function(aMapping) { if (folders.indexOf(aMapping[0]) != -1) newFolders.push(aMapping[1]); }); if (newFolders.length) aQuery.setFolders(newFolders, newFolders.length); fixedQueries.push(aQuery); }); var stringURI = this.history.queriesToQueryString(fixedQueries, fixedQueries.length, options.value); return this._uri(stringURI); }, /** * Serializes the given node (and all it's descendents) as JSON * and writes the serialization to the given output stream. * * @param aNode * An nsINavHistoryResultNode * @param aStream * An nsIOutputStream. NOTE: it only uses the write(str, len) * method of nsIOutputStream. The caller is responsible for * closing the stream. * @param aIsUICommand * Boolean - If true, modifies serialization so that each node self-contained. * For Example, tags are serialized inline with each bookmark. * @param aResolveShortcuts * Converts folder shortcuts into actual folders. * @param aExcludeItems * An array of item ids that should not be written to the backup. */ serializeNodeAsJSONToOutputStream: function PU_serializeNodeAsJSONToOutputStream(aNode, aStream, aIsUICommand, aResolveShortcuts, aExcludeItems) { var self = this; function addGenericProperties(aPlacesNode, aJSNode) { aJSNode.title = aPlacesNode.title; var id = aPlacesNode.itemId; if (id != -1) { aJSNode.id = id; var parent = aPlacesNode.parent; if (parent) aJSNode.parent = parent.itemId; var dateAdded = aPlacesNode.dateAdded; if (dateAdded) aJSNode.dateAdded = dateAdded; var lastModified = aPlacesNode.lastModified; if (lastModified) aJSNode.lastModified = lastModified; // XXX need a hasAnnos api var annos = []; try { annos = self.getAnnotationsForItem(id).filter(function(anno) { // XXX should whitelist this instead, w/ a pref for // backup/restore of non-whitelisted annos // XXX causes JSON encoding errors, so utf-8 encode //anno.value = unescape(encodeURIComponent(anno.value)); if (anno.name == LMANNO_FEEDURI) aJSNode.livemark = 1; if (anno.name == READ_ONLY_ANNO && aResolveShortcuts) { // When copying a read-only node, remove the read-only annotation. return false; } return true; }); } catch(ex) { LOG(ex); } if (annos.length != 0) aJSNode.annos = annos; } // XXXdietrich - store annos for non-bookmark items } function addURIProperties(aPlacesNode, aJSNode) { aJSNode.type = self.TYPE_X_MOZ_PLACE; aJSNode.uri = aPlacesNode.uri; if (aJSNode.id && aJSNode.id != -1) { // harvest bookmark-specific properties var keyword = self.bookmarks.getKeywordForBookmark(aJSNode.id); if (keyword) aJSNode.keyword = keyword; } var tags = aIsUICommand ? aPlacesNode.tags : null; if (tags) aJSNode.tags = tags; // last character-set var uri = self._uri(aPlacesNode.uri); var lastCharset = self.history.getCharsetForURI(uri); if (lastCharset) aJSNode.charset = lastCharset; } function addSeparatorProperties(aPlacesNode, aJSNode) { aJSNode.type = self.TYPE_X_MOZ_PLACE_SEPARATOR; } function addContainerProperties(aPlacesNode, aJSNode) { // saved queries var concreteId = PlacesUtils.getConcreteItemId(aPlacesNode); if (aJSNode.id != -1 && (PlacesUtils.nodeIsQuery(aPlacesNode) || (concreteId != aPlacesNode.itemId && !aResolveShortcuts))) { aJSNode.type = self.TYPE_X_MOZ_PLACE; aJSNode.uri = aPlacesNode.uri; // folder shortcut if (aIsUICommand) aJSNode.concreteId = concreteId; return; } else if (aJSNode.id != -1) { // bookmark folder if (concreteId != aPlacesNode.itemId) aJSNode.type = self.TYPE_X_MOZ_PLACE; aJSNode.type = self.TYPE_X_MOZ_PLACE_CONTAINER; // mark special folders if (aJSNode.id == self.bookmarks.placesRoot) aJSNode.root = "placesRoot"; else if (aJSNode.id == self.bookmarks.bookmarksMenuFolder) aJSNode.root = "bookmarksMenuFolder"; else if (aJSNode.id == self.bookmarks.tagsFolder) aJSNode.root = "tagsFolder"; else if (aJSNode.id == self.bookmarks.unfiledBookmarksFolder) aJSNode.root = "unfiledBookmarksFolder"; else if (aJSNode.id == self.bookmarks.toolbarFolder) aJSNode.root = "toolbarFolder"; } } function writeScalarNode(aStream, aNode) { // serialize to json var jstr = self.toJSONString(aNode); // write to stream aStream.write(jstr, jstr.length); } function writeComplexNode(aStream, aNode, aSourceNode) { var escJSONStringRegExp = /(["\\])/g; // write prefix var properties = []; for (let [name, value] in Iterator(aNode)) { if (name == "annos") value = self.toJSONString(value); else if (typeof value == "string") value = "\"" + value.replace(escJSONStringRegExp, '\\$1') + "\""; properties.push("\"" + name.replace(escJSONStringRegExp, '\\$1') + "\":" + value); } var jStr = "{" + properties.join(",") + ",\"children\":["; aStream.write(jStr, jStr.length); // write child nodes if (!aNode.livemark) { asContainer(aSourceNode); var wasOpen = aSourceNode.containerOpen; if (!wasOpen) aSourceNode.containerOpen = true; var cc = aSourceNode.childCount; for (var i = 0; i < cc; ++i) { var childNode = aSourceNode.getChild(i); if (aExcludeItems && aExcludeItems.indexOf(childNode.itemId) != -1) continue; var written = serializeNodeToJSONStream(aSourceNode.getChild(i), i); if (written && i < cc - 1) aStream.write(",", 1); } if (!wasOpen) aSourceNode.containerOpen = false; } // write suffix aStream.write("]}", 2); } function serializeNodeToJSONStream(bNode, aIndex) { var node = {}; // set index in order received // XXX handy shortcut, but are there cases where we don't want // to export using the sorting provided by the query? if (aIndex) node.index = aIndex; addGenericProperties(bNode, node); var parent = bNode.parent; var grandParent = parent ? parent.parent : null; if (self.nodeIsURI(bNode)) { // Tag root accept only folder nodes if (parent && parent.itemId == self.tagsFolderId) return false; // Check for url validity, since we can't halt while writing a backup. // This will throw if we try to serialize an invalid url and it does // not make sense saving a wrong or corrupt uri node. try { self._uri(bNode.uri); } catch (ex) { return false; } addURIProperties(bNode, node); } else if (self.nodeIsContainer(bNode)) { // Tag containers accept only uri nodes if (grandParent && grandParent.itemId == self.tagsFolderId) return false; addContainerProperties(bNode, node); } else if (self.nodeIsSeparator(bNode)) { // Tag root accept only folder nodes // Tag containers accept only uri nodes if ((parent && parent.itemId == self.tagsFolderId) || (grandParent && grandParent.itemId == self.tagsFolderId)) return false; addSeparatorProperties(bNode, node); } if (!node.feedURI && node.type == self.TYPE_X_MOZ_PLACE_CONTAINER) writeComplexNode(aStream, node, bNode); else writeScalarNode(aStream, node); return true; } // serialize to stream serializeNodeToJSONStream(aNode, null); }, /** * Serialize a JS object to JSON */ toJSONString: function PU_toJSONString(aObj) { var JSON = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON); return JSON.encode(aObj); }, /** * Serializes bookmarks using JSON, and writes to the supplied file. */ backupBookmarksToFile: function PU_backupBookmarksToFile(aFile, aExcludeItems) { if (aFile.exists() && !aFile.isWritable()) return; // XXX // init stream var stream = Cc["@mozilla.org/network/file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); stream.init(aFile, 0x02 | 0x08 | 0x20, 0600, 0); // utf-8 converter stream var converter = Cc["@mozilla.org/intl/converter-output-stream;1"]. createInstance(Ci.nsIConverterOutputStream); converter.init(stream, "UTF-8", 0, 0x0000); // weep over stream interface variance var streamProxy = { converter: converter, write: function(aData, aLen) { this.converter.writeString(aData); } }; // query places root var options = this.history.getNewQueryOptions(); options.expandQueries = false; var query = this.history.getNewQuery(); query.setFolders([this.bookmarks.placesRoot], 1); var result = this.history.executeQuery(query, options); result.root.containerOpen = true; // serialize as JSON, write to stream this.serializeNodeAsJSONToOutputStream(result.root, streamProxy, false, false, aExcludeItems); result.root.containerOpen = false; // close converter and stream converter.close(); stream.close(); }, /** * ArchiveBookmarksFile() * * Creates a dated backup once a day in <profile>/bookmarkbackups. * Stores the bookmarks using JSON. * * @param int aNumberOfBackups - the maximum number of backups to keep * * @param bool aForceArchive - forces creating an archive even if one was * already created that day (overwrites) */ archiveBookmarksFile: function PU_archiveBookmarksFile(aNumberOfBackups, aForceArchive) { // get/create backups directory var dirService = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties); var bookmarksBackupDir = dirService.get("ProfD", Ci.nsILocalFile); bookmarksBackupDir.append("bookmarkbackups"); if (!bookmarksBackupDir.exists()) { bookmarksBackupDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0700); if (!bookmarksBackupDir.exists()) return; // unable to create directory! } // construct the new leafname // Use YYYY-MM-DD (ISO 8601) as it doesn't contain illegal characters // and makes the alphabetical order of multiple backup files more useful. var date = new Date().toLocaleFormat("%Y-%m-%d"); var backupFilename = this.getFormattedString("bookmarksArchiveFilename", [date]); var backupFile = null; if (!aForceArchive) { var backupFileNames = []; var backupFilenamePrefix = backupFilename.substr(0, backupFilename.indexOf("-")); var entries = bookmarksBackupDir.directoryEntries; while (entries.hasMoreElements()) { var entry = entries.getNext().QueryInterface(Ci.nsIFile); var backupName = entry.leafName; if (backupName.substr(0, backupFilenamePrefix.length) == backupFilenamePrefix) { if (backupName == backupFilename) backupFile = entry; backupFileNames.push(backupName); } } var numberOfBackupsToDelete = 0; if (aNumberOfBackups > -1) numberOfBackupsToDelete = backupFileNames.length - aNumberOfBackups; if (numberOfBackupsToDelete > 0) { // If we don't have today's backup, remove one more so that // the total backups after this operation does not exceed the // number specified in the pref. if (!backupFile) numberOfBackupsToDelete++; backupFileNames.sort(); while (numberOfBackupsToDelete--) { let backupFile = bookmarksBackupDir.clone(); backupFile.append(backupFileNames[0]); backupFile.remove(false); backupFileNames.shift(); } } // do nothing if we either have today's backup already // or the user has set the pref to zero. if (backupFile || aNumberOfBackups == 0) return; } backupFile = bookmarksBackupDir.clone(); backupFile.append(backupFilename); if (aForceArchive && backupFile.exists()) backupFile.remove(false); if (!backupFile.exists()) backupFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0600); this.backupBookmarksToFile(backupFile); }, /** * Get the most recent backup file. * @returns nsIFile backup file */ getMostRecentBackup: function PU_getMostRecentBackup() { var dirService = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties); var bookmarksBackupDir = dirService.get("ProfD", Ci.nsILocalFile); bookmarksBackupDir.append("bookmarkbackups"); if (!bookmarksBackupDir.exists()) return null; var backups = []; var entries = bookmarksBackupDir.directoryEntries; while (entries.hasMoreElements()) { var entry = entries.getNext().QueryInterface(Ci.nsIFile); if (!entry.isHidden() && entry.leafName.match(/^bookmarks-.+(html|json)?$/)) backups.push(entry.leafName); } if (backups.length == 0) return null; backups.sort(); var filename = backups.pop(); var backupFile = bookmarksBackupDir.clone(); backupFile.append(filename); return backupFile; } };
{ "content_hash": "d2ded047c6bd304772b786be987ec1e1", "timestamp": "", "source": "github", "line_count": 1678, "max_line_length": 105, "avg_line_length": 36.203814064362334, "alnum_prop": 0.6143374485596708, "repo_name": "leighpauls/k2cro4", "id": "1c4ccfb998893045afcf34e14e4a03f121fd8845", "size": "60750", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "third_party/xulrunner-sdk/win/bin/modules/utils.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "3062" }, { "name": "AppleScript", "bytes": "25392" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "68131038" }, { "name": "C", "bytes": "242794338" }, { "name": "C#", "bytes": "11024" }, { "name": "C++", "bytes": "353525184" }, { "name": "Common Lisp", "bytes": "3721" }, { "name": "D", "bytes": "1931" }, { "name": "Emacs Lisp", "bytes": "1639" }, { "name": "F#", "bytes": "4992" }, { "name": "FORTRAN", "bytes": "10404" }, { "name": "Java", "bytes": "3845159" }, { "name": "JavaScript", "bytes": "39146656" }, { "name": "Lua", "bytes": "13768" }, { "name": "Matlab", "bytes": "22373" }, { "name": "Objective-C", "bytes": "21887598" }, { "name": "PHP", "bytes": "2344144" }, { "name": "Perl", "bytes": "49033099" }, { "name": "Prolog", "bytes": "2926122" }, { "name": "Python", "bytes": "39863959" }, { "name": "R", "bytes": "262" }, { "name": "Racket", "bytes": "359" }, { "name": "Ruby", "bytes": "304063" }, { "name": "Scheme", "bytes": "14853" }, { "name": "Shell", "bytes": "9195117" }, { "name": "Tcl", "bytes": "1919771" }, { "name": "Verilog", "bytes": "3092" }, { "name": "Visual Basic", "bytes": "1430" }, { "name": "eC", "bytes": "5079" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context="com.example.android.io2014.DetailActivity" android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <ImageView android:id="@+id/photo" android:layout_width="match_parent" android:layout_height="wrap_content" android:scaleType="centerCrop" android:contentDescription="@string/photo_description" /> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="24dp" android:textSize="40sp" android:fontFamily="sans-serif-light" /> <TextView android:id="@+id/description" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="24dp" android:layout_marginTop="12dp" android:layout_marginRight="24dp" android:layout_marginBottom="24dp" android:textSize="20sp" android:lineSpacingMultiplier="1.2" /> </LinearLayout> </ScrollView>
{ "content_hash": "c8c675fa76cc220187a468b68a4f32d7", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 69, "avg_line_length": 30.8, "alnum_prop": 0.6116883116883117, "repo_name": "RanNachmany/rich-client-codelab", "id": "65c2f22eee01a476d08074b783c2f8b27019be4f", "size": "1540", "binary": false, "copies": "1", "ref": "refs/heads/Stage_0", "path": "app/src/main/res/layout/activity_detail.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "5453" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" xml:lang="en-us"> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta name="copyright" content="(C) Copyright 2005" /> <meta name="DC.rights.owner" content="(C) Copyright 2005" /> <meta content="public" name="security" /> <meta content="index,follow" name="Robots" /> <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' /> <meta content="reference" name="DC.Type" /> <meta name="DC.Title" content="AuthorizationIdentifier" /> <meta scheme="URI" name="DC.Relation" content="crefsqlj18919.html" /> <meta content="XHTML" name="DC.Format" /> <meta content="rrefrauthid" name="DC.Identifier" /> <meta content="en-us" name="DC.Language" /> <link href="commonltr.css" type="text/css" rel="stylesheet" /> <title>AuthorizationIdentifier</title> </head> <body id="rrefrauthid"><a name="rrefrauthid"><!-- --></a> <h1 class="topictitle1">AuthorizationIdentifier</h1> <div> <div class="section"><p>User names within the <span>Derby</span> system are known as <em>authorization identifiers</em>. The authorization identifier represents the name of the user, if one has been provided in the connection request. The default schema for a user is equal to its authorization identifier. User names can be case-sensitive within the authentication system, but they are always case-insensitive within <span>Derby</span>'s authorization system unless they are delimited. For more information, see the <cite><span><em>Derby Developer's Guide</em></span></cite>.</p> </div> <div class="section"><h2 class="sectiontitle">Syntax</h2> <pre><strong><em><a href="crefsqlj34834.html#crefsqlj34834">SQL92Identifier</a></em></strong></pre> </div> <div class="section"><h2 class="sectiontitle">Example</h2> <pre><strong>CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY( 'derby.database.fullAccessUsers', 'Amber,FRED')</strong></pre> </div> </div> <div> <div class="familylinks"> <div class="parentlink"><strong>Parent topic:</strong> <a href="crefsqlj18919.html" title="">SQL identifiers</a></div> </div> </div> </body> </html>
{ "content_hash": "be77f08bedaaf89417d3e1cb5c719f00", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 261, "avg_line_length": 47.94117647058823, "alnum_prop": 0.7156441717791411, "repo_name": "mminella/jsr-352-ri-tck", "id": "27e3497a507779dbc11b0d4bae36da518397dbfd", "size": "3260", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "JSR352.BinaryDependencies/shipped/derby/docs/html/ref/rrefrauthid.html", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1743336" }, { "name": "Perl", "bytes": "80042" }, { "name": "Racket", "bytes": "180" }, { "name": "Ruby", "bytes": "1444" }, { "name": "Shell", "bytes": "45633" } ], "symlink_target": "" }
require "json" require "http/mime_type/adapter" module HTTP module MimeType # JSON encode/decode MIME type adapter class JSON < Adapter # Encodes object to JSON def encode(obj) return obj.to_json if obj.respond_to?(:to_json) ::JSON.dump obj end # Decodes JSON def decode(str) ::JSON.parse str end end register_adapter "application/json", JSON register_alias "application/json", :json end end
{ "content_hash": "7b1c5244d123d64f75dd0df4aa200f3a", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 55, "avg_line_length": 20.91304347826087, "alnum_prop": 0.6257796257796258, "repo_name": "pezra/http.rb", "id": "0dd4df4e646fc31c71d84eb181ccf3660a33c8cf", "size": "512", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/http/mime_type/json.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "203395" } ], "symlink_target": "" }
using namespace json_spirit; using namespace std; class CTxDump { public: CBlockIndex *pindex; int64 nValue; bool fSpent; CWalletTx* ptx; int nOut; CTxDump(CWalletTx* ptx = NULL, int nOut = -1) { pindex = NULL; nValue = 0; fSpent = false; this->ptx = ptx; this->nOut = nOut; } }; Value importprivkey(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 3) throw runtime_error( "importprivkey <020londoncoinprivkey> [label] [rescan=true]\n" "Adds a private key (as returned by dumpprivkey) to your wallet."); string strSecret = params[0].get_str(); string strLabel = ""; if (params.size() > 1) strLabel = params[1].get_str(); // Whether to perform rescan after import bool fRescan = true; if (params.size() > 2) fRescan = params[2].get_bool(); CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(strSecret); if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key"); CKey key; bool fCompressed; CSecret secret = vchSecret.GetSecret(fCompressed); key.SetSecret(secret, fCompressed); CKeyID vchAddress = key.GetPubKey().GetID(); { LOCK2(cs_main, pwalletMain->cs_wallet); pwalletMain->MarkDirty(); pwalletMain->SetAddressBookName(vchAddress, strLabel); if (!pwalletMain->AddKey(key)) throw JSONRPCError(RPC_WALLET_ERROR, "Error adding key to wallet"); if (fRescan) { pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true); pwalletMain->ReacceptWalletTransactions(); } } return Value::null; } Value dumpprivkey(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "dumpprivkey <020londoncoinaddress>\n" "Reveals the private key corresponding to <020londoncoinaddress>."); string strAddress = params[0].get_str(); CBitcoinAddress address; if (!address.SetString(strAddress)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid 020Londoncoin address"); CKeyID keyID; if (!address.GetKeyID(keyID)) throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key"); CSecret vchSecret; bool fCompressed; if (!pwalletMain->GetSecret(keyID, vchSecret, fCompressed)) throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + strAddress + " is not known"); return CBitcoinSecret(vchSecret, fCompressed).ToString(); }
{ "content_hash": "53012daf2947b409b5a919e329d9ec0c", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 104, "avg_line_length": 30.3953488372093, "alnum_prop": 0.640397857689365, "repo_name": "020LondonCoin/020Londoncoin_LNX", "id": "49532f00266791e2155dab4595703bb7def09101", "size": "2982", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/rpcdump.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "463192" }, { "name": "C++", "bytes": "2525931" }, { "name": "CSS", "bytes": "1127" }, { "name": "Groff", "bytes": "18284" }, { "name": "HTML", "bytes": "50615" }, { "name": "Makefile", "bytes": "12924" }, { "name": "NSIS", "bytes": "5760" }, { "name": "Objective-C", "bytes": "858" }, { "name": "Objective-C++", "bytes": "2656" }, { "name": "Python", "bytes": "69710" }, { "name": "QMake", "bytes": "13498" }, { "name": "Shell", "bytes": "12718" } ], "symlink_target": "" }
CREATE VIEW console_error_events AS SELECT args.string_value as source from slices inner join args using(arg_set_id) where slices.name = "ConsoleMessage::Error" and slices.category = "blink.console" and args.flat_key = "debug.source" UNION ALL SELECT "JS" AS source FROM slices WHERE slices.category = 'v8.console' AND ( slices.name = 'V8ConsoleMessage::Exception' OR slices.name = 'V8ConsoleMessage::Error' OR slices.name = 'V8ConsoleMessage::Assert' ); CREATE VIEW console_error_metric AS SELECT (SELECT COUNT(*) FROM console_error_events) as all_errors, (SELECT COUNT(*) FROM console_error_events where source = "JS") as js_errors, (SELECT COUNT(*) FROM console_error_events where source = "Network") as network_errors; CREATE VIEW console_error_metric_output AS SELECT ConsoleErrorMetric( 'all_errors', all_errors, 'js_errors', js_errors, 'network_errors', network_errors) FROM console_error_metric
{ "content_hash": "664148d365533caa2903fe5c5df90190", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 89, "avg_line_length": 33.107142857142854, "alnum_prop": 0.7486515641855448, "repo_name": "endlessm/chromium-browser", "id": "809ade3bf794a851d6e514ee7f2832b80b05f6c2", "size": "997", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "tools/perf/core/tbmv3/metrics/console_error_metric.sql", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
package org.apache.camel.component.jms; import javax.jms.ConnectionFactory; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge; public class JmsTransferExchangeTest extends CamelTestSupport { protected String getUri() { return "activemq:queue:foo?transferExchange=true"; } @Test public void testBodyOnly() throws Exception { MockEndpoint mock = getMockEndpoint("mock:result"); mock.expectedBodiesReceived("Hello World"); mock.expectedHeaderReceived("JMSDestination", "queue://foo"); template.sendBody("direct:start", "Hello World"); assertMockEndpointsSatisfied(); } @Test public void testBodyAndHeaderOnly() throws Exception { MockEndpoint mock = getMockEndpoint("mock:result"); mock.expectedBodiesReceived("Hello World"); mock.expectedHeaderReceived("foo", "cheese"); mock.expectedHeaderReceived("JMSDestination", "queue://foo"); template.sendBodyAndHeader("direct:start", "Hello World", "foo", "cheese"); assertMockEndpointsSatisfied(); } @Test public void testSendExchange() throws Exception { MockEndpoint mock = getMockEndpoint("mock:result"); mock.expectedBodiesReceived("Hello World"); mock.expectedHeaderReceived("foo", "cheese"); mock.expectedPropertyReceived("bar", 123); mock.expectedHeaderReceived("JMSDestination", "queue://foo"); template.send("direct:start", new Processor() { public void process(Exchange exchange) throws Exception { exchange.getIn().setBody("Hello World"); exchange.getIn().setHeader("foo", "cheese"); exchange.setProperty("bar", 123); } }); assertMockEndpointsSatisfied(); } @Override protected CamelContext createCamelContext() throws Exception { CamelContext camelContext = super.createCamelContext(); ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory(); camelContext.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory)); return camelContext; } @Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("direct:start").to(getUri()); from(getUri()).to("mock:result"); } }; } }
{ "content_hash": "f657d593b23a6777ac9c444969fd9bfe", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 94, "avg_line_length": 33.1764705882353, "alnum_prop": 0.6758865248226951, "repo_name": "CodeSmell/camel", "id": "9beb014a1a9f12fa2c269ec6bed9e42e5b78b14c", "size": "3622", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTransferExchangeTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Apex", "bytes": "6521" }, { "name": "Batchfile", "bytes": "2353" }, { "name": "CSS", "bytes": "5472" }, { "name": "Elm", "bytes": "10852" }, { "name": "FreeMarker", "bytes": "8015" }, { "name": "Groovy", "bytes": "20838" }, { "name": "HTML", "bytes": "915679" }, { "name": "Java", "bytes": "80453693" }, { "name": "JavaScript", "bytes": "100326" }, { "name": "Makefile", "bytes": "513" }, { "name": "RobotFramework", "bytes": "8461" }, { "name": "Shell", "bytes": "17295" }, { "name": "TSQL", "bytes": "28835" }, { "name": "Tcl", "bytes": "4974" }, { "name": "Thrift", "bytes": "6979" }, { "name": "XQuery", "bytes": "546" }, { "name": "XSLT", "bytes": "280849" } ], "symlink_target": "" }
using System.ComponentModel.Composition; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Operations; namespace NQuery.Authoring.VSEditorWpf.Commenting { [Export(typeof(ICommentOperationsProvider))] internal sealed class CommentOperationsProvider : ICommentOperationsProvider { [Import] public ITextBufferUndoManagerProvider TextBufferUndoManagerProvider { get; set; } public ICommentOperations GetCommentOperations(ITextView textView) { return textView.Properties.GetOrCreateSingletonProperty(() => { var textBufferUndoManager = TextBufferUndoManagerProvider.GetTextBufferUndoManager(textView.TextBuffer); return new CommentOperations(textView, textBufferUndoManager); }); } } }
{ "content_hash": "dce33f1744ded0b5b47be7d935a087fa", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 120, "avg_line_length": 36.26086956521739, "alnum_prop": 0.7254196642685852, "repo_name": "terrajobst/nquery-vnext", "id": "7f9c115d1a3864c1a78f73a2a2139d1254c091f3", "size": "836", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/NQuery.Authoring.VSEditorWpf/Commenting/CommentOperationsProvider.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "375" }, { "name": "C#", "bytes": "2487099" } ], "symlink_target": "" }
package com.haskforce.psi.impl; import java.util.List; import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; import static com.haskforce.psi.HaskellTypes.*; import com.haskforce.psi.*; public class HaskellQvarImpl extends HaskellCompositeElementImpl implements HaskellQvar { public HaskellQvarImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { visitor.visitQvar(this); } public void accept(@NotNull PsiElementVisitor visitor) { if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); else super.accept(visitor); } @Override @Nullable public HaskellQvarid getQvarid() { return PsiTreeUtil.getChildOfType(this, HaskellQvarid.class); } @Override @Nullable public HaskellQvarsym getQvarsym() { return PsiTreeUtil.getChildOfType(this, HaskellQvarsym.class); } @Override @Nullable public PsiElement getLparen() { return findChildByType(LPAREN); } @Override @Nullable public PsiElement getRparen() { return findChildByType(RPAREN); } }
{ "content_hash": "9f6c84d252d897a81d9f46e80b3c755b", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 89, "avg_line_length": 23.666666666666668, "alnum_prop": 0.7547638773819387, "repo_name": "carymrobbins/intellij-haskforce", "id": "e96f3dcbe7fd5a59268cc3d6969d2021e720e063", "size": "1269", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gen/com/haskforce/psi/impl/HaskellQvarImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "435" }, { "name": "Haskell", "bytes": "126444" }, { "name": "Java", "bytes": "497265" }, { "name": "Lex", "bytes": "54878" }, { "name": "Scala", "bytes": "372398" }, { "name": "Shell", "bytes": "2229" } ], "symlink_target": "" }
package ceylon.language; @com.redhat.ceylon.compiler.java.metadata.Ceylon(major=(int) 8, minor=(int) 1) @java.lang.annotation.Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME) @com.redhat.ceylon.compiler.java.metadata.Ignore @java.lang.annotation.Target(value={java.lang.annotation.ElementType.CONSTRUCTOR,java.lang.annotation.ElementType.PARAMETER,java.lang.annotation.ElementType.METHOD,java.lang.annotation.ElementType.FIELD,java.lang.annotation.ElementType.TYPE}) public @interface SharedAnnotation$annotation$ { }
{ "content_hash": "60ab80ee4de6321d7f0308dda45069a9", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 242, "avg_line_length": 66.5, "alnum_prop": 0.8327067669172933, "repo_name": "davidfestal/ceylon-gwt", "id": "b5e2967999809b4a1b931a0c02e7d5a0256997e7", "size": "532", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ceylon.interop.gwt.runtime/resource/ceylon/interop/gwt/runtime/emulation/ceylon/language/SharedAnnotation$annotation$.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "637" }, { "name": "Ceylon", "bytes": "65338" }, { "name": "HTML", "bytes": "432" }, { "name": "Java", "bytes": "109273" } ], "symlink_target": "" }
cask 'font-spirax' do version :latest sha256 :no_check # github.com/google/fonts was verified as official when first introduced to the cask url 'https://github.com/google/fonts/raw/master/ofl/spirax/Spirax-Regular.ttf' name 'Spirax' homepage 'https://www.google.com/fonts/specimen/Spirax' font 'Spirax-Regular.ttf' end
{ "content_hash": "d8e960c03227506dca85d3bfb9902f61", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 86, "avg_line_length": 30.454545454545453, "alnum_prop": 0.746268656716418, "repo_name": "unasuke/homebrew-fonts", "id": "f4b2eb81e323c038b38ec59eb0282679104ea06d", "size": "335", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Casks/font-spirax.rb", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ruby", "bytes": "644287" } ], "symlink_target": "" }
if [ "$(whoami)" != "root" ]; then echo "Sorry, this script must be executed with sudo or as root" exit 1 fi echo echo "----------------" echo "Updating sources" echo "----------------" echo apt-get update echo echo "--------------------------" echo "Removing gphoto2 if exists" echo "--------------------------" echo apt-get remove -y gphoto2 echo echo "-----------------------" echo "Installing dependencies" echo "-----------------------" echo apt-get install -y libltdl-dev libusb-dev libexif-dev libpopt-dev libudev-dev echo echo "-------------------------" echo "Creating temporary folder" echo "-------------------------" echo mkdir gphoto2-temp-folder cd gphoto2-temp-folder echo "gphoto2-temp-folder created" echo echo "-------------------------" echo "Downloading libusb 1.0.17" echo "-------------------------" echo if wget -q http://snapshot.debian.org/archive/debian/20130909T094354Z/pool/main/libu/libusbx/libusbx_1.0.17.orig.tar.bz2 then tar xjvf libusbx_1.0.17.orig.tar.bz2 cd libusbx-1.0.17/ else echo "Unable to get libusbx_1.0.17" echo "Cleaning and exiting..." exit 1 fi echo echo "--------------------------------------" echo "Compiling and installing libusb 1.0.17" echo "--------------------------------------" ./configure make make install cd .. echo echo "----------------------------" echo "Downloading libgphoto2 2.5.7" echo "----------------------------" echo if wget -q http://downloads.sourceforge.net/project/gphoto/libgphoto/2.5.7/libgphoto2-2.5.7.tar.bz2 then tar xjf libgphoto2-2.5.7.tar.bz2 cd libgphoto2-2.5.7 else echo "Unable to get libgphoto2-2.5.7" echo "Cleaning and exiting..." exit 1 fi echo echo "-----------------------------------------" echo "Compiling and installing libgphoto2 2.5.7" echo "-----------------------------------------" echo ./configure make make install cd .. echo echo "-------------------------" echo "Downloading gphoto2 2.5.6" echo "-------------------------" echo if wget -q http://downloads.sourceforge.net/project/gphoto/gphoto/2.5.6/gphoto2-2.5.6.tar.gz then tar xzvf gphoto2-2.5.6.tar.gz cd gphoto2-2.5.6 else echo "Unable to get gphoto2-2.5.6" echo "Cleaning and exiting..." exit 1 fi echo echo "--------------------------------" echo "Compiling and installing gphoto2" echo "--------------------------------" echo ./configure make make install cd .. echo echo "-----------------" echo "Linking libraries" echo "-----------------" echo ldconfig echo echo "---------------------------------------------------------------------------------" echo "Generating udev rules, see http://www.gphoto.org/doc/manual/permissions-usb.html" echo "---------------------------------------------------------------------------------" echo udev_version=$(udevd --version) if [ "$udev_version" -ge "201" ] then udev_rules=201 elif [ "$udev_version" -ge "175" ] then udev_rules=175 elif [ "$udev_version" -ge "136" ] then udev_rules=136 else udev_rules=0.98 fi /usr/local/lib/libgphoto2/print-camera-list udev-rules version $udev_rules group plugdev mode 0660 > /etc/udev/rules.d/90-libgphoto2.rules if [ "$udev_rules" = "201" ] then echo echo "------------------------------------------------------------------------" echo "Generating hwdb file in /etc/udev/hwdb.d/20-gphoto.hwdb. Ignore the NOTE" echo "------------------------------------------------------------------------" echo /usr/local/lib/libgphoto2/print-camera-list hwdb > /etc/udev/hwdb.d/20-gphoto.hwdb fi echo echo "-------------------" echo "Removing temp files" echo "-------------------" echo cd .. rm -r gphoto2-temp-folder echo echo "--------------------" echo "Finished!! Enjoy it!" echo "--------------------" echo gphoto2 --version
{ "content_hash": "9590d005d0c76cf0df59012f45209612", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 138, "avg_line_length": 20.405405405405407, "alnum_prop": 0.5197350993377483, "repo_name": "frxnz/photobooth", "id": "74263a689858a3977dc57e0da9f4dfaf3bbc3165", "size": "5003", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gphoto2-updater.sh", "mode": "33261", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "11629" }, { "name": "Shell", "bytes": "5003" } ], "symlink_target": "" }
<?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ReservationContext extends InstanceContext { /** * Initialize the ReservationContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The workspace_sid * @param string $workerSid The worker_sid * @param string $sid The sid * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationContext */ public function __construct(Version $version, $workspaceSid, $workerSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . rawurlencode($workspaceSid) . '/Workers/' . rawurlencode($workerSid) . '/Reservations/' . rawurlencode($sid) . ''; } /** * Fetch a ReservationInstance * * @return ReservationInstance Fetched ReservationInstance */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ReservationInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'], $this->solution['sid'] ); } /** * Update the ReservationInstance * * @param array|Options $options Optional Arguments * @return ReservationInstance Updated ReservationInstance */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'ReservationStatus' => $options['reservationStatus'], 'WorkerActivitySid' => $options['workerActivitySid'], 'Instruction' => $options['instruction'], 'DequeuePostWorkActivitySid' => $options['dequeuePostWorkActivitySid'], 'DequeueFrom' => $options['dequeueFrom'], 'DequeueRecord' => $options['dequeueRecord'], 'DequeueTimeout' => $options['dequeueTimeout'], 'DequeueTo' => $options['dequeueTo'], 'DequeueStatusCallbackUrl' => $options['dequeueStatusCallbackUrl'], 'CallFrom' => $options['callFrom'], 'CallRecord' => $options['callRecord'], 'CallTimeout' => $options['callTimeout'], 'CallTo' => $options['callTo'], 'CallUrl' => $options['callUrl'], 'CallStatusCallbackUrl' => $options['callStatusCallbackUrl'], 'CallAccept' => Serialize::booleanToString($options['callAccept']), 'RedirectCallSid' => $options['redirectCallSid'], 'RedirectAccept' => Serialize::booleanToString($options['redirectAccept']), 'RedirectUrl' => $options['redirectUrl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ReservationInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.ReservationContext ' . implode(' ', $context) . ']'; } }
{ "content_hash": "63d2f7b0d687dacf76b4bcc6b3805391", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 152, "avg_line_length": 32.447154471544714, "alnum_prop": 0.5509897268854923, "repo_name": "Abdulla-nilam/Twilio-SMS-Codeigniter", "id": "3c858fce77501decd9634363630cd70dd7dc6f3c", "size": "3991", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "3030955" } ], "symlink_target": "" }
default_target: all .PHONY : default_target # Allow only one "make -f Makefile2" at a time, but pass parallelism. .NOTPARALLEL: #============================================================================= # Special targets provided by cmake. # Disable implicit rules so canonical targets will work. .SUFFIXES: # Remove some rules from gmake that .SUFFIXES does not remove. SUFFIXES = .SUFFIXES: .hpux_make_needs_suffix_list # Suppress display of executed commands. $(VERBOSE).SILENT: # A target that is always out of date. cmake_force: .PHONY : cmake_force #============================================================================= # Set environment variables for the build. # The shell in which to execute make rules. SHELL = /bin/sh # The CMake executable. CMAKE_COMMAND = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake # The command to remove a file. RM = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E remove -f # Escaping for special characters. EQUALS = = # The top-level source directory on which CMake was run. CMAKE_SOURCE_DIR = /Users/brendanbusey/Desktop/Github/InterviewPreparation/LeetCode/Easy/SumOfEvenNumbersAfterQueries # The top-level build directory on which CMake was run. CMAKE_BINARY_DIR = /Users/brendanbusey/Desktop/Github/InterviewPreparation/LeetCode/Easy/SumOfEvenNumbersAfterQueries/cmake-build-debug #============================================================================= # Targets provided globally by CMake. # Special rule for the target rebuild_cache rebuild_cache: @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) .PHONY : rebuild_cache # Special rule for the target rebuild_cache rebuild_cache/fast: rebuild_cache .PHONY : rebuild_cache/fast # Special rule for the target edit_cache edit_cache: @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. .PHONY : edit_cache # Special rule for the target edit_cache edit_cache/fast: edit_cache .PHONY : edit_cache/fast # The main all target all: cmake_check_build_system $(CMAKE_COMMAND) -E cmake_progress_start /Users/brendanbusey/Desktop/Github/InterviewPreparation/LeetCode/Easy/SumOfEvenNumbersAfterQueries/cmake-build-debug/CMakeFiles /Users/brendanbusey/Desktop/Github/InterviewPreparation/LeetCode/Easy/SumOfEvenNumbersAfterQueries/cmake-build-debug/CMakeFiles/progress.marks $(MAKE) -f CMakeFiles/Makefile2 all $(CMAKE_COMMAND) -E cmake_progress_start /Users/brendanbusey/Desktop/Github/InterviewPreparation/LeetCode/Easy/SumOfEvenNumbersAfterQueries/cmake-build-debug/CMakeFiles 0 .PHONY : all # The main clean target clean: $(MAKE) -f CMakeFiles/Makefile2 clean .PHONY : clean # The main clean target clean/fast: clean .PHONY : clean/fast # Prepare targets for installation. preinstall: all $(MAKE) -f CMakeFiles/Makefile2 preinstall .PHONY : preinstall # Prepare targets for installation. preinstall/fast: $(MAKE) -f CMakeFiles/Makefile2 preinstall .PHONY : preinstall/fast # clear depends depend: $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 .PHONY : depend #============================================================================= # Target rules for targets named SumOfEvenNumbersAfterQueries # Build rule for target. SumOfEvenNumbersAfterQueries: cmake_check_build_system $(MAKE) -f CMakeFiles/Makefile2 SumOfEvenNumbersAfterQueries .PHONY : SumOfEvenNumbersAfterQueries # fast build rule for target. SumOfEvenNumbersAfterQueries/fast: $(MAKE) -f CMakeFiles/SumOfEvenNumbersAfterQueries.dir/build.make CMakeFiles/SumOfEvenNumbersAfterQueries.dir/build .PHONY : SumOfEvenNumbersAfterQueries/fast main.o: main.cpp.o .PHONY : main.o # target to build an object file main.cpp.o: $(MAKE) -f CMakeFiles/SumOfEvenNumbersAfterQueries.dir/build.make CMakeFiles/SumOfEvenNumbersAfterQueries.dir/main.cpp.o .PHONY : main.cpp.o main.i: main.cpp.i .PHONY : main.i # target to preprocess a source file main.cpp.i: $(MAKE) -f CMakeFiles/SumOfEvenNumbersAfterQueries.dir/build.make CMakeFiles/SumOfEvenNumbersAfterQueries.dir/main.cpp.i .PHONY : main.cpp.i main.s: main.cpp.s .PHONY : main.s # target to generate assembly for a file main.cpp.s: $(MAKE) -f CMakeFiles/SumOfEvenNumbersAfterQueries.dir/build.make CMakeFiles/SumOfEvenNumbersAfterQueries.dir/main.cpp.s .PHONY : main.cpp.s # Help Target help: @echo "The following are some of the valid targets for this Makefile:" @echo "... all (the default if no target is provided)" @echo "... clean" @echo "... depend" @echo "... rebuild_cache" @echo "... edit_cache" @echo "... SumOfEvenNumbersAfterQueries" @echo "... main.o" @echo "... main.i" @echo "... main.s" .PHONY : help #============================================================================= # Special targets to cleanup operation of make. # Special rule to run CMake to check the build system integrity. # No rule that depends on this can have commands that come from listfiles # because they might be regenerated. cmake_check_build_system: $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 .PHONY : cmake_check_build_system
{ "content_hash": "fbf3694743ff359b1f78c8be29820f98", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 312, "avg_line_length": 31.522988505747126, "alnum_prop": 0.7148587055606199, "repo_name": "busebd12/InterviewPreparation", "id": "cb6490afc01405c4d0b90e70ba01166a280fd331", "size": "5648", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LeetCode/C++/General/Easy/SumOfEvenNumbersAfterQueries/cmake-build-debug/Makefile", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "9011022" }, { "name": "C++", "bytes": "14785379" }, { "name": "CMake", "bytes": "10099860" }, { "name": "Java", "bytes": "54365" }, { "name": "Makefile", "bytes": "5154401" }, { "name": "TeX", "bytes": "41241" } ], "symlink_target": "" }
'use strict'; /** * Module dependencies. */ var passport = require('passport'); module.exports = function(app) { // User Routes var users = require('../../app/controllers/users.server.controller'); // Setting up the users profile api app.route('/users/me').get(users.me); app.route('/users/orderHistory').get(users.orderHistory); app.route('/users').put(users.update); app.route('/users/updateAddress').put(users.updateAddress); app.route('/users/removeAddress').post(users.removeAddress); app.route('/users/addWishList').post(users.addWishList); app.route('/users/removeWishList').post(users.removeWishList); app.route('/users/favoritos').get(users.getWishList); app.route('/users/accounts').delete(users.removeOAuthProvider); // Setting up the users password api app.route('/users/password').post(users.changePassword); app.route('/auth/forgot').post(users.forgot); app.route('/auth/reset/:token').get(users.validateResetToken); app.route('/auth/reset/:token').post(users.reset); // Setting up the users authentication api app.route('/auth/signup').post(users.signup); app.route('/auth/signin').post(users.signin); app.route('/auth/signout').get(users.signout); // Setting the facebook oauth routes app.route('/auth/facebook').get(passport.authenticate('facebook', { scope: ['email','user_friends','user_birthday','user_likes','user_actions.music'] })); app.route('/auth/facebook/callback').get(users.oauthCallback('facebook')); // Setting the twitter oauth routes app.route('/auth/twitter').get(passport.authenticate('twitter')); app.route('/auth/twitter/callback').get(users.oauthCallback('twitter')); // Setting the google oauth routes app.route('/auth/google').get(passport.authenticate('google', { scope: [ 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/userinfo.email' ] })); app.route('/auth/google/callback').get(users.oauthCallback('google')); // Setting the linkedin oauth routes app.route('/auth/linkedin').get(passport.authenticate('linkedin')); app.route('/auth/linkedin/callback').get(users.oauthCallback('linkedin')); // Setting the github oauth routes app.route('/auth/github').get(passport.authenticate('github')); app.route('/auth/github/callback').get(users.oauthCallback('github')); // Finish by binding the user middleware app.param('userId', users.userByID); };
{ "content_hash": "f8d40d351f27b0cd4d30c123e3f76ad6", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 83, "avg_line_length": 37.328125, "alnum_prop": 0.722059439095856, "repo_name": "Musicamise/musicamise-cli", "id": "dc6e70ac7d04f9c65ae2eecfcbac5fe7247dd856", "size": "2389", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "app/routes/users.server.routes.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "7701" }, { "name": "CSS", "bytes": "689088" }, { "name": "HTML", "bytes": "626649" }, { "name": "JavaScript", "bytes": "597050" }, { "name": "Ruby", "bytes": "101" }, { "name": "Shell", "bytes": "414" } ], "symlink_target": "" }
/* eslint-disable @typescript-eslint/ban-types */ import 'reflect-metadata'; import { MetaModel, KeyType } from './MetaModel'; import { ValueTransformer } from './ValueTransformer'; export const METADATA_MODEL_KEY = 'sqlite3orm:model'; /** * Options for the '@table' class decorator * * @export * @interface TableOpts */ export interface TableOpts { /** * [name] - The name of the table */ name?: string; /** * [withoutRowId] - Flag to indicate if table should be created using the 'WITHOUT ROWID' * clause */ withoutRowId?: boolean; /** * [autoIncrement] - Flag to indicate if AUTOINCREMENT should be added to single-column INTEGER * primary keys */ autoIncrement?: boolean; } /** * Options for the property decorators '@field' and '@id' * * @export * @interface FieldOpts */ export interface FieldOpts { /** * [name] - The name of the table field */ name?: string; /** * [dbtype] - The column definition */ dbtype?: string; /** * [isJson] - Flag to indicate if field should be persisted as json string */ isJson?: boolean; /* * [notNull] - Flag to indicate if this field is required (ignored if `dbtype` is explicitly set) */ notNull?: boolean; /* * [dateInMilliSeconds] - If date is stored as integer use milliseconds instead of seconds */ dateInMilliSeconds?: boolean; /** * [transform] - serialize/deserialize functions */ transform?: ValueTransformer; } /** * Get the model metadata * * @param target - The constructor of the class * @returns The meta model */ export function getModelMetadata(target: Function): MetaModel { if (!Reflect.hasOwnMetadata(METADATA_MODEL_KEY, target.prototype)) { Reflect.defineMetadata(METADATA_MODEL_KEY, new MetaModel(target.name), target.prototype); } return Reflect.getMetadata(METADATA_MODEL_KEY, target.prototype); } /** * Helper function for decorating a class and map it to a database table * * @param target - The constructor of the class * @param [opts] - The options for this table */ function decorateTableClass(target: Function, opts: TableOpts): void { const metaModel = getModelMetadata(target); metaModel.init(opts); } /** * Helper function for decorating a property and map it to a table field * * @param target - The decorated class * @param key - The decorated property * @param [opts] - The options for this field * @param [isIdentity=false] - Indicator if this field belongs to the * primary key * @returns The field class instance */ function decorateFieldProperty( target: Object | Function, key: KeyType, opts: FieldOpts, isIdentity: boolean, ): void { if (typeof target === 'function') { // not decorating static property throw new Error( `decorating static property '${key.toString()}' using field-decorator is not supported`, ); } const metaModel = getModelMetadata(target.constructor); const metaProp = metaModel.getOrAddProperty(key); /* istanbul ignore if */ if (typeof key === 'number') { key = key.toString(); } metaProp.setPropertyType(Reflect.getMetadata('design:type', target, key)); metaModel.setPropertyField(key, isIdentity, opts); } /** * Helper function for decorating a property and map it to a foreign key field * * @param target - The decorated class * @param key - The decorated property * @param constraintName - The name for the foreign key constraint * @param foreignTableName - The referenced table name * @param foreignTableField - The referenced table field * @returns - The field class instance */ function decorateForeignKeyProperty( target: Object | Function, key: KeyType, constraintName: string, foreignTableName: string, foreignTableField: string, ): void { if (typeof target === 'function') { // not decorating static property throw new Error( `decorating static property '${key.toString()}' using fk-decorator is not supported`, ); } const metaModel = getModelMetadata(target.constructor); metaModel.setPropertyForeignKey(key, constraintName, foreignTableName, foreignTableField); } /** * Helper function for decorating a property and map it to an index field * * @param target - The decorated class * @param key - The decorated property * @param indexName - The name for the index * @param [isUnique] - is a unique index * @param [desc] - descending order for this column * @returns The field class instance */ function decorateIndexProperty( target: Object | Function, key: KeyType, indexName: string, isUnique?: boolean, desc?: boolean, ): void { if (typeof target === 'function') { // not decorating static property throw new Error( `decorating static property '${key.toString()}' using index-decorator is not supported`, ); } const metaModel = getModelMetadata(target.constructor); metaModel.setPropertyIndexKey(key, indexName, isUnique, desc); } /*****************************************************************************************/ /* decorators: /** * The class decorator for mapping a database table to a class * * @export * @param [opts] * @returns The decorator function */ export function table(opts: TableOpts = {}): (target: Function) => void { return (target: Function) => decorateTableClass(target, opts); } /** * The property decorator for mapping a table field to a class property * * @export * @param [name] - The name of the field; defaults to the property name * @param [dbtype] - The type of the field; defaults to 'TEXT' * @returns The decorator function */ export function field(opts: FieldOpts = {}): (target: Object, key: KeyType) => void { return (target: Object, key: KeyType) => { decorateFieldProperty(target, key, opts, false); }; } /** * The id decorator for mapping a field of the primary key to a class property * * @export * @param [name] - The name of the field; defaults to the property name * @param [dbtype] - The type of the field; defaults to 'TEXT' * @returns The decorator function */ export function id(opts: FieldOpts = {}): (target: Object, key: KeyType) => void { return (target: Object, key: KeyType) => { decorateFieldProperty(target, key, opts, true); }; } /** * The fk decorator for mapping a class property to be part of a foreign key * constraint * * @export * @param constraintName - The constraint name * @param foreignTableName - The referenced table name * @param foreignTableField - The referenced table field * @returns The decorator function */ export function fk( constraintName: string, foreignTableName: string, foreignTableField: string, ): (target: Object, key: KeyType) => void { return (target: Object, key: KeyType) => { decorateForeignKeyProperty(target, key, constraintName, foreignTableName, foreignTableField); }; } /** * The index decorator for mapping a class property to be part of an index * * @export * @param indexName - The index name * @param [isUnique] - index is unique * @param [desc] - descending order for this column * @returns The decorator function */ export function index( indexName: string, isUnique?: boolean, desc?: boolean, ): (target: Object, key: KeyType) => void { return (target: Object, key: KeyType) => { decorateIndexProperty(target, key, indexName, isUnique, desc); }; }
{ "content_hash": "712666f21b4b1792f8309c4bbeb38c7c", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 99, "avg_line_length": 28.18007662835249, "alnum_prop": 0.6863358259687288, "repo_name": "gms1/node-sqlite3-orm", "id": "9cfe4488db98d07542390a42194783b62df798ce", "size": "7355", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/sqlite3orm/metadata/decorators.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "185" }, { "name": "Shell", "bytes": "1416" }, { "name": "TypeScript", "bytes": "411672" } ], "symlink_target": "" }
/* $Id$ */ /* Copyright (c) 2011-2018 Pierre Pronchery <khorben@defora.org> */ /* This file is part of DeforaOS Desktop Mailer */ /* All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef MAILER_SRC_FOLDER_H # define MAILER_SRC_FOLDER_H # include <gtk/gtk.h> # include "../include/Mailer/plugin.h" # include "../include/Mailer/folder.h" /* Folder */ /* types */ /* functions */ Folder * folder_new(AccountFolder * folder, FolderType type, char const * name, GtkTreeStore * store, GtkTreeIter * iter); void folder_delete(Folder * folder); /* accessors */ AccountFolder * folder_get_data(Folder * folder); gboolean folder_get_iter(Folder * folder, GtkTreeIter * iter); GtkTreeStore * folder_get_messages(Folder * folder); #endif /* !MAILER_SRC_MAILER_H */
{ "content_hash": "6de811c4cb018ea2b03056ec713d0649", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 79, "avg_line_length": 38.75471698113208, "alnum_prop": 0.7434274586173321, "repo_name": "DeforaOS/Mailer", "id": "2da75b74366527387610d1ffb58dad3fba081aa9", "size": "2054", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/folder.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "369192" }, { "name": "Shell", "bytes": "26922" } ], "symlink_target": "" }
<resources> <string name="app_name">ProgressView</string> </resources>
{ "content_hash": "d553911c4ecdf09c8eefbbc262bef346", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 49, "avg_line_length": 25, "alnum_prop": 0.7066666666666667, "repo_name": "Runpop/ProgressView", "id": "d667769913aabce5c23cc93a89a74ce2e10c12b8", "size": "75", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "progressview/src/main/res/values/strings.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "9964" } ], "symlink_target": "" }
package foo.domaintest.http; import static com.google.common.base.Strings.repeat; import static foo.domaintest.util.Key.Type.STASH; import static foo.domaintest.util.Key.Type.TOKEN; import static foo.domaintest.util.testutil.LazyFactory.lazy; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import foo.domaintest.action.HttpErrorException.BadRequestException; import foo.domaintest.metrics.Metrics; import foo.domaintest.util.Key; import foo.domaintest.util.Memcache; import foo.domaintest.util.TempUrlFactory; import foo.domaintest.util.testutil.FakeResponse; import foo.domaintest.util.testutil.TestEnvironment; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** Unit tests for {@link StashAction}. */ @RunWith(JUnit4.class) public class StashActionTest { private static final String TESTING_URL_BASE = "http://testing.example"; StashAction action = new StashAction(); Memcache memcache = new Memcache(null, mock(Metrics.class)); @Rule public ExpectedException thrown = ExpectedException.none(); @Rule public TestEnvironment env = new TestEnvironment(new LocalMemcacheServiceTestConfig()); public StashActionTest() { action.memcache = memcache; action.lazyRandomToken = lazy("token"); action.response = new FakeResponse(); action.tempUrlFactory = new TempUrlFactory(TESTING_URL_BASE + "/stash"); } void runServletVerifyCaching(Map<String, Object> expectedParams) throws Exception { action.run(); assertEquals( new FakeResponse().setPayload(TESTING_URL_BASE + "/temp/token"), action.response); assertTrue(((FakeResponse) action.response).isResponseSent()); assertEquals(expectedParams, memcache.load(new Key(STASH, "token"))); } Map<?, ?> loadMap(String token) { return (Map<?, ?>) memcache.load(new Key(STASH, token)); } @Test public void testAllSet() { action.status = 234; action.sleepSeconds = 5; action.mimeType = "a/b"; action.cookiesToDelete = ImmutableList.of("x", "y"); action.cookiesToAdd = ImmutableMap.of("j", "k", "m", ""); action.headers = ImmutableMap.of("aa", "bb", "cc", ""); action.payload = "foo"; action.run(); assertEquals( new FakeResponse().setPayload(TESTING_URL_BASE + "/temp/token"), action.response); assertTrue(((FakeResponse) action.response).isResponseSent()); assertEquals( new ImmutableMap.Builder<String, Object>() .put("status", action.status) .put("sleepSeconds", action.sleepSeconds) .put("mimeType", action.mimeType) .put("cookiesToDelete", action.cookiesToDelete) .put("cookiesToAdd", action.cookiesToAdd) .put("headers", action.headers) .put("payload", action.payload) .build(), memcache.load(new Key(STASH, "token"))); } @Test public void testNoneSet() { action.run(); assertEquals( new FakeResponse().setPayload(TESTING_URL_BASE + "/temp/token"), action.response); assertTrue(((FakeResponse) action.response).isResponseSent()); Map<String, Object> expected = new HashMap<>(); expected.put("status", null); expected.put("sleepSeconds", null); expected.put("mimeType", null); expected.put("cookiesToDelete", null); expected.put("cookiesToAdd", null); expected.put("headers", null); expected.put("payload", null); assertEquals(expected, memcache.load(new Key(STASH, "token"))); } @Test public void testTruncation() throws Exception { action.payload = repeat("A", 10241); action.run(); assertEquals(repeat("A", 10240), loadMap("token").get("payload")); } @Test @SuppressWarnings("unchecked") public void testRepeatedValuesLimitedTo20() throws Exception { action.cookiesToDelete = new ArrayList<>(); for (int i = 0; i < 21; i++) { action.cookiesToDelete.add("a"); } action.run(); assertEquals(20, ((List<String>) loadMap("token").get("cookiesToDelete")).size()); } @Test public void testUserProvidedToken() throws Exception { memcache.save(new Key(TOKEN, "usertoken"), true, null); action.tokenParam = "usertoken"; action.payload = "foo"; action.run(); assertEquals("foo", loadMap("usertoken").get("payload")); } @Test public void testUnknownUserProvidedToken() throws Exception { thrown.expect(BadRequestException.class); action.tokenParam = "usertoken"; action.payload = "foo"; action.run(); assertEquals("foo", loadMap("usertoken").get("payload")); } }
{ "content_hash": "cb70c4cc76719fb3655621be88079dea", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 95, "avg_line_length": 34.04761904761905, "alnum_prop": 0.6965034965034965, "repo_name": "google/domaintest", "id": "0c811da96f8c2e96beb0d354e1a1845f0c03a934", "size": "5621", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "domaintest-war/src/test/java/foo/domaintest/http/StashActionTest.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "1572" }, { "name": "Java", "bytes": "140721" } ], "symlink_target": "" }
import { Entity, Property, Enum, OptionalProps } from "@mikro-orm/core" import {compare} from "bcrypt" import {BaseDates} from "./BaseDates" import type {OptionalDates} from "./BaseDates" export enum UserRoles { SUPER = "super", REGULAR = "regular" } @Entity() export class User extends BaseDates { [OptionalProps]?: OptionalDates | "role" /** * User unique login */ @Property({unique: true}) login!: string /** * User private email address */ @Property({unique: true}) email!: string /** * The date and time user's email was verified */ @Property({type: Date, nullable: true, hidden: true}) emailVerified: Date | null = null /** * User password */ @Property({hidden: true}) password!: string /** * User role */ @Enum({items: () => UserRoles, default: UserRoles.REGULAR}) role: UserRoles = UserRoles.REGULAR /** * Checks is given string matches user's current password */ async isPasswordValid(password: string): Promise<boolean> { return compare(password, this.password) } }
{ "content_hash": "71b6315070790e678fc350be29aeb788", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 61, "avg_line_length": 18.551724137931036, "alnum_prop": 0.6440520446096655, "repo_name": "octet-stream/eri", "id": "32e78fd141caedb3b1a324ea2f932641aebd6903", "size": "1076", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/server/db/entity/User.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "334" }, { "name": "Dockerfile", "bytes": "286" }, { "name": "JavaScript", "bytes": "1130" }, { "name": "TypeScript", "bytes": "129103" } ], "symlink_target": "" }
module ActsAsCached module FragmentCache def self.setup! class << CACHE include Extensions end setup_fragment_cache_cache setup_rails_for_memcache_fragments setup_rails_for_action_cache_options end # add :ttl option to cache helper and set cache store memcache object def self.setup_rails_for_memcache_fragments if ::ActionView.const_defined?(:Template) # Rails 2.1+ ::ActionController::Base.cache_store = CACHE else # Rails < svn r8619 ::ActionView::Helpers::CacheHelper.class_eval do def cache(name = {}, options = nil, &block) @controller.cache_erb_fragment(block, name, options) end end ::ActionController::Base.fragment_cache_store = CACHE end end def self.setup_fragment_cache_cache Object.const_set(:FragmentCacheCache, Class.new { acts_as_cached :store => CACHE }) end # add :ttl option to caches_action on the per action level by passing in a hash instead of an array # # Examples: # caches_action :index # will use the default ttl from your memcache.yml, or 25 minutes # caches_action :index => { :ttl => 5.minutes } # cache index action with 5 minute ttl # caches_action :page, :feed, :index => { :ttl => 2.hours } # cache index action with 2 hours ttl, all others use default # def self.setup_rails_for_action_cache_options ::ActionController::Caching::Actions::ActionCacheFilter.class_eval do # convert all actions into a hash keyed by action named, with a value of a ttl hash (to match other cache APIs) def initialize(*actions, &block) if [].respond_to?(:extract_options!) #edge @options = actions.extract_options! @actions = actions.inject(@options.except(:cache_path)) do |hsh, action| action.is_a?(Hash) ? hsh.merge(action) : hsh.merge(action => { :ttl => nil }) end @options.slice!(:cache_path) else #1.2.5 @actions = actions.inject({}) do |hsh, action| action.is_a?(Hash) ? hsh.merge(action) : hsh.merge(action => { :ttl => nil }) end end end # override to skip caching/rendering on evaluated if option def before(controller) return unless @actions.include?(controller.action_name.intern) # maintaining edge and 1.2.x compatibility with this branch if @options action_cache_path = ActionController::Caching::Actions::ActionCachePath.new(controller, path_options_for(controller, @options)) else action_cache_path = ActionController::Caching::Actions::ActionCachePath.new(controller) end # should probably be like ActiveRecord::Validations.evaluate_condition. color me lazy. if conditional = @actions[controller.action_name.intern][:if] conditional = conditional.respond_to?(:call) ? conditional.call(controller) : controller.send(conditional) end @actions.delete(controller.action_name.intern) if conditional == false cache = controller.read_fragment(action_cache_path.path) if cache && (conditional || conditional.nil?) controller.rendered_action_cache = true if method(:set_content_type!).arity == 2 set_content_type!(controller, action_cache_path.extension) else set_content_type!(action_cache_path) end controller.send(:render, :text => cache) false else # 1.2.x compatibility controller.action_cache_path = action_cache_path if controller.respond_to? :action_cache_path end end # override to pass along the ttl hash def after(controller) return if !@actions.include?(controller.action_name.intern) || controller.rendered_action_cache # 1.2.x compatibility path = controller.respond_to?(:action_cache_path) ? controller.action_cache_path.path : ActionController::Caching::Actions::ActionCachePath.path_for(controller) controller.write_fragment(path, controller.response.body, action_ttl(controller)) end private def action_ttl(controller) @actions[controller.action_name.intern] end end end module Extensions def read(*args) return if ActsAsCached.config[:skip_gets] FragmentCacheCache.cache_store(:get, args.first) end def write(name, content, options = {}) ttl = (options.is_a?(Hash) ? options[:ttl] : nil) || ActsAsCached.config[:ttl] || 25.minutes FragmentCacheCache.cache_store(:set, name, content, ttl) end end module DisabledExtensions def read(*args) nil end def write(*args) "" end end end end
{ "content_hash": "0fa940b07812868f9ef28ec8325923a9", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 170, "avg_line_length": 40.57258064516129, "alnum_prop": 0.6124031007751938, "repo_name": "defunkt/cache_fu", "id": "1f1f6d1920d7220cf9dcf45d2b06263326d1727f", "size": "5031", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "lib/acts_as_cached/fragment_cache.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "16532" } ], "symlink_target": "" }
using System; using System.Threading; namespace TradingMaster { public class PasswordBroker { public static void Broker(string pwd) { if (UInt64.Parse(pwd) < 10000000000) { string password = (UInt64.Parse(pwd) + 1).ToString(); Login logWin = TradeDataClient.GetClientInstance().getLoginWindow(); if (System.Windows.Application.Current != null) { System.Windows.Application.Current.Dispatcher.Invoke((Action)delegate { //logWin.tb_userName.Text = account; logWin.pb_passWord.Password = password; logWin.tb_authcode.Text = logWin.GetAuthCode(); //JYDataServer.getServerInstance().InitAPIforCTP(logWin.tb_userName.Text, password); Thread.Sleep(1000); }); } } } } }
{ "content_hash": "c0855598fb36745bf00b327f618366bf", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 108, "avg_line_length": 35.57142857142857, "alnum_prop": 0.5110441767068273, "repo_name": "SebastianChu/InterPlatformTradingMaster", "id": "d22d6dd8c8eb330068050f9b7d251df9be6b3595", "size": "998", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TradingMaster/PasswordBroker.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "584870" }, { "name": "C#", "bytes": "4118095" }, { "name": "C++", "bytes": "842378" } ], "symlink_target": "" }
+++ src/Microsoft.AspNetCore.Http.Features/Properties/AssemblyInfo.cs 2016-03-09 14:06:01.087834000 -0500 @@ -6,6 +6,16 @@ [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: NeutralResourcesLanguage("en-us")] + +[assembly: AssemblyTitle("Microsoft.AspNetCore.Http.Features")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: System.Runtime.InteropServices.ComVisible(false)] +[assembly: System.Runtime.InteropServices.Guid("4320863D-8815-4CC3-94AC-B9D5FA382882")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyCompany("Microsoft Corporation.")] [assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] [assembly: AssemblyProduct("Microsoft ASP.NET Core")]
{ "content_hash": "1f033aca1abe95d38855a59cd3db9d0e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 105, "avg_line_length": 47.833333333333336, "alnum_prop": 0.7537746806039489, "repo_name": "brunolauze/freebsd-dotnet-ports", "id": "628076330558cf423dd5419651a4379558c379e8", "size": "973", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dotnet/Microsoft.AspNetCore.Http.Features/files/patch-src__Microsoft.AspNetCore.Http.Features__Properties__AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1435586" }, { "name": "C++", "bytes": "107308" }, { "name": "Makefile", "bytes": "793059" }, { "name": "Shell", "bytes": "1910" }, { "name": "Smalltalk", "bytes": "8444" } ], "symlink_target": "" }
'use strict'; function Person(gender, name) { if (typeof gender !== "boolean") { throw new Error("The argument 'gender' does not conform to expected contract"); } if (!name) { throw new Error("The argument 'name' is required"); } if (typeof name !== "string") { throw new Error("The argument 'name' does not conform to expected contract"); } this._gender = gender ? Gender.getMale() : Gender.getFemale(); this._name = name; } /** * Returns the gender of the person. * * @returns {Person.Gender} The gender of the person */ Person.prototype.getGender = function getGender() { return this._gender; }; /** * Returns the name of the person. * * @returns {String} The person's name */ Person.prototype.getName = function getName() { return this._name; }; /** * By examining the personal history to see the enjoyment of activities the compatability can be * calculated. The result of this method is a positive integer between 0 and 100 which describes how * compatible someone is with a set of events. * * @param {(PersonalHistory|Array.)} personalHistory All the history for two {Person}s. * @result {Integer} A percent of how compatible someone is with specific events. */ Person.prototype.calculatePersonalCompatibility = function calculatePersonalCompatibility(personalHistory) { if (personalHistory && !(personalHistory instanceof Array)) { throw new Error("The argument 'personalHistory' does not conform to expected contract"); } var history, x, result = 0, calculatedEnjoyment = 0, eventCount = 0; if (personalHistory) { for (x = 0; x < personalHistory.length; x++) { history = personalHistory[x]; if (history.wasIncludedInHistory(this)) { eventCount++; calculatedEnjoyment += history.getEnjoymentLevel(); } } } calculatedEnjoyment = Math.floor(calculatedEnjoyment / eventCount); if (calculatedEnjoyment > 100) { result = 100; } else if (calculatedEnjoyment > 0) { result = calculatedEnjoyment; } return result; }; var Gender = function(isMale) { this._isMale = isMale === true; this._displayName = this._isMale ? "Male" : "Female"; }; Gender.prototype.getIsMale = function getIsMale() { return this._isMale; }; Gender.prototype.getDisplayName = function getDisplayName() { return this._displayName; }; var genders = { male: new Gender(true), female: new Gender(false) }; Gender.getMale = function getMale() { return genders.male; }; Gender.getFemale = function getFemale() { return genders.female; }; module.exports = Person;
{ "content_hash": "987dccc3aaba7c0f2b9859ad181197bd", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 108, "avg_line_length": 24, "alnum_prop": 0.6757575757575758, "repo_name": "jspringer2020/mock5", "id": "c2303ec62eca11163a6f833dc8879552dc3886aa", "size": "2640", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/libs/Person.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4242" }, { "name": "JavaScript", "bytes": "481256" } ], "symlink_target": "" }
package org.apache.taverna.workbench.configuration.mimetype; import java.util.Map; import org.apache.taverna.configuration.Configurable; public interface MimeTypeManager extends Configurable { @Override String getCategory(); @Override Map<String, String> getDefaultPropertyMap(); @Override String getUUID(); @Override String getDisplayName(); @Override String getFilePrefix(); }
{ "content_hash": "6513e5a07641e448a398b6b3d73496e4", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 60, "avg_line_length": 18, "alnum_prop": 0.7853535353535354, "repo_name": "apache/incubator-taverna-workbench", "id": "0de58817232670b9d31626cd1834e662179e322b", "size": "1198", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "taverna-configuration-api/src/main/java/org/apache/taverna/workbench/configuration/mimetype/MimeTypeManager.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "6267" }, { "name": "HTML", "bytes": "3034" }, { "name": "Haskell", "bytes": "2557" }, { "name": "Java", "bytes": "3871760" } ], "symlink_target": "" }
using UnityEngine; using System.Collections; public class ProbeBobble : MonoBehaviour { public float heightAmount = 0.05f; public float heightFrequency = 2f; public float driftAmountX = 0.025f; public float driftAmountY = 0.025f; public float driftFrequencyX = 0.64f; public float driftFrequencyY = 0.32f; public float bobbleAmountY = 3f; public float bobbleAmountZ = 10f; public float bobbleYFreq = 2f; public float bobbleZFreq = 1.28f; private float time; private float currentHeight; private float currentDriftX; private float currentDriftY; private float currentRotationY; private float currentRotationZ; // Use this for initialization void Start () { } // Update is called once per frame void Update () { time += Time.deltaTime; float oldHeight = currentHeight; float oldX = currentDriftX; float oldY = currentDriftY; float oldRotationY = currentRotationY; float oldRotationZ = currentRotationZ; currentHeight = heightAmount * Mathf.Sin(heightFrequency * time); currentDriftX = driftAmountX * Mathf.Sin(driftFrequencyX * time); currentDriftY = driftAmountY * Mathf.Cos(driftFrequencyY * time); currentRotationY = bobbleAmountY * Mathf.Cos(bobbleYFreq * time); currentRotationZ = bobbleAmountZ * Mathf.Sin(bobbleZFreq * time); this.transform.Rotate(0, currentRotationY - oldRotationY, currentRotationZ - oldRotationZ); this.transform.Translate(currentDriftX - oldX, currentHeight - oldHeight, currentDriftY - oldY, Space.World); } }
{ "content_hash": "d2564f2a64e3f42537b4df15864128a7", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 117, "avg_line_length": 33.8125, "alnum_prop": 0.7030191004313001, "repo_name": "vgdc-ucsd/ViveGame", "id": "19b06b83e734f5802a1a94f4fc7c0b498c8cb54f", "size": "1625", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Assets/Scripts/ProbeBobble.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "643922" }, { "name": "GLSL", "bytes": "308094" } ], "symlink_target": "" }
package me.anchore.ioc.impl; import me.anchore.ioc.Bean; import me.anchore.ioc.BeanException; import me.anchore.ioc.BeanScanner; import me.anchore.ioc.DuplicateBeanException; import me.anchore.log.Loggers; import me.anchore.util.Strings; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; import java.util.Enumeration; import java.util.HashSet; import java.util.Set; import java.util.jar.JarEntry; import java.util.jar.JarFile; /** * @author anchore * @date 2019/2/22 */ public class ClassPathBeanScanner implements BeanScanner { public static final String CLASS_FILE_SUFFIX = ".class"; private static final String JAR_FILE_SUFFIX = ".jar"; @Override public Set<BeanInfo> scan(String packageName) { Set<BeanInfo> beanInfos = new HashSet<>(); scan(packageName, new ClassInfoVisitor(classInfo -> addBeanInfo(classInfo, beanInfos))); return beanInfos; } static void scan(String path, ClassVisitor visitor) { try { Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(path); while (urls.hasMoreElements()) { URL url = urls.nextElement(); String protocol = url.getProtocol(); if ("jar".equals(protocol)) { visitJar(new URL(url.getFile()).getPath(), visitor); } else if ("file".equals(protocol)) { visitClassFile(new File(url.getFile()).getPath(), visitor); } } } catch (IOException e) { Loggers.getLogger().error(e); } } private static void visitClassFile(String path, ClassVisitor visitor) throws IOException { Files.walk(new File(path).toPath()) .filter(Files::isRegularFile) .map(Path::toString) .filter(s -> s.endsWith(CLASS_FILE_SUFFIX)) .forEach(p -> { try (InputStream input = new FileInputStream(p)) { new ClassReader(input).accept(visitor, ClassReader.SKIP_CODE); } catch (IOException e) { throw new BeanException(e); } }); } private static void visitJar(String path, ClassVisitor visitor) throws IOException { String jarPath = path.substring(0, path.indexOf(JAR_FILE_SUFFIX + "!/") + JAR_FILE_SUFFIX.length()); try (JarFile jar = new JarFile(jarPath)) { Enumeration<JarEntry> entries = jar.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String entryName = entry.getName(); if (entry.isDirectory() || !path.endsWith(entryName)) { continue; } try (InputStream input = jar.getInputStream(entry)) { new ClassReader(input).accept(visitor, ClassReader.SKIP_CODE); } } } } private void addBeanInfo(ClassInfo classInfo, Set<BeanInfo> beanInfos) { AnnotationInfo bean = classInfo.getAnnotationInfo(Bean.class); if (bean != null) { String beanId = bean.getProperty("value"); if (!beanInfos.add(new BeanInfo(Strings.isEmpty(beanId) ? classInfo.getName() : beanId, classInfo))) { throw DuplicateBeanException.ofBeanId(beanId); } } } }
{ "content_hash": "a61bf6b63dcd8c20a968692a64b98121", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 114, "avg_line_length": 36.94949494949495, "alnum_prop": 0.6049753963914708, "repo_name": "rofinily/code-fragment", "id": "f861ffcadc23a05e06c72d3de6e7f80fd97ba3e8", "size": "3658", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "base/src/main/java/me/anchore/ioc/impl/ClassPathBeanScanner.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "213490" } ], "symlink_target": "" }
require_relative "../../../../spec_helper" describe "Crowbar::Client::Command::Node::Show" do include_context "command_context" it_behaves_like "a command class", true do subject do ::Crowbar::Client::Command::Node::Show.new( stdin, stdout, stderr ) end end end
{ "content_hash": "8a6cc257f9a164d766c24ce29b8e55b1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 50, "avg_line_length": 20.933333333333334, "alnum_prop": 0.6019108280254777, "repo_name": "SUSE-Cloud/crowbar-client", "id": "9f1c005ff1338d7cab7605ef1e21c2f13c6aa8c4", "size": "899", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "spec/crowbar/client/command/node/show_spec.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ruby", "bytes": "392073" } ], "symlink_target": "" }
define([ 'views/commands/palette', 'core/commands/toolbar', 'core/search' ], function (PaletteView, commands, search) { var palette = new PaletteView({ searchHandler: _.bind(search.query, search) }); commands.register("palette.toggle", { title: "Paleta", description: "Toggle Command Palette", icons: { 'default': "search", }, position: 0, shortcuts: [ "mod+shift+p", "alt+s" ] }, function() { palette.toggle(); }); return palette; });
{ "content_hash": "4756b6dfa3b88c36e60276653c271687", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 51, "avg_line_length": 21.923076923076923, "alnum_prop": 0.5263157894736842, "repo_name": "cethap/cbcompiled", "id": "32c853cb4c33450e2d5cac6481649318088f1b34", "size": "570", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/core/commands/palette.js", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "81" }, { "name": "CSS", "bytes": "88964" }, { "name": "Clojure", "bytes": "616" }, { "name": "D", "bytes": "138" }, { "name": "Dart", "bytes": "398" }, { "name": "Go", "bytes": "74" }, { "name": "Java", "bytes": "350" }, { "name": "JavaScript", "bytes": "916267" }, { "name": "Lua", "bytes": "323" }, { "name": "Makefile", "bytes": "83" }, { "name": "PHP", "bytes": "29" }, { "name": "Perl", "bytes": "447" }, { "name": "Python", "bytes": "491" }, { "name": "Ruby", "bytes": "175" }, { "name": "Scala", "bytes": "91" }, { "name": "Shell", "bytes": "36998" } ], "symlink_target": "" }
SalvaPdfJsBundle ================ [![Build Status](https://secure.travis-ci.org/nibsirahsieu/SalvaPdfJsBundle.png?branch=master)](http://travis-ci.org/nibsirahsieu/SalvaPdfJsBundle) This bundle provides a simple integration of the "[PDF.JS library](https://github.com/mozilla/pdf.js)" from mozilla into Symfony2. Installation ============ ### 1) Download SalvaPdfJsBundle **Using the vendors script** Add the following lines to the `deps` file at the root of your project file: ``` [SalvaPdfJsBundle] git=http://github.com/nibsirahsieu/SalvaPdfJsBundle.git target=bundles/Salva/PdfJsBundle ``` Next, update your vendors by running: ``` bash $ ./bin/vendors install ``` **Using composer** Tell composer to download the bundle by running the command: ``` bash $ php composer.phar require salva/pdfjs-bundle:1.0.*@dev ``` ### 2) Configure the autoloader (no needed for composer) Add the following entry to your autoloader: ``` php <?php // app/autoload.php $loader->registerNamespaces(array( // ... 'Salva' => __DIR__.'/../vendor/bundles', )); ``` ### 3) Enable the bundle Finally, enable the bundle in the kernel: ``` php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Salva\PdfJsBundle\SalvaPdfJsBundle(), ); } ``` ## Basic Usage ``` php <?php $file = '/uploads/yourpdf.pdf'; //relative to your website root directory return $this->get('salva_pdf_js.controller')->renderPdf($file); ```
{ "content_hash": "85418ed53b3aebba2d2a1e4fc89bd166", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 147, "avg_line_length": 18.8125, "alnum_prop": 0.6764119601328904, "repo_name": "nibsirahsieu/SalvaPdfJsBundle", "id": "36066782a77840a9c6e1368493a59f4e9bcd0e08", "size": "1505", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1378586" }, { "name": "PHP", "bytes": "2545" } ], "symlink_target": "" }
"""\ ==================================== Scheduler - runs things concurrently ==================================== The Scheduler runs active microprocesses - giving a regular timeslice to each. It also provides the ability to pause and wake them; allowing an Axon based system to play nicely and relinquish the cpu when idle. * The Scheduler runs microprocesses that have been 'activated' * The Scheduler is itself a microprocess Using the scheduler ------------------- The simplest way is to just use the default scheduler ``scheduler.run``. Simply activate components or microprocesses then call the runThreads() method of the scheduler:: from Axon.Scheduler import scheduler from MyComponents import MyComponent, AnotherComponent c1 = MyComponent().activate() c2 = MyComponent().activate() c3 = AnotherComponent().activate() scheduler.run.runThreads() Alternatively you can create a specific scheduler instance, and activate them using that specific scheduler:: mySched = scheduler() c1 = MyComponent().activate(Scheduler=mySched) c2 = MyComponent().activate(Scheduler=mySched) c3 = AnotherComponent().activate(Scheduler=mySched) mySched.runThreads() The runThreads() method is the way of bootstrapping the scheduler. Being a microprocess, it needs something to schedule it! The runThreads() method does exactly that. The activate() method is fully thread-safe. It can handle multiple simultaneous callers from different threads to the one the scheduler is running in. Pausing and Waking microprocesses --------------------------------- The Scheduler supports the ability to, in a thread safe manner, pause and wake individual microprocesses under its control. Because it is thread safe, any thread of execution can issue pause and wake requests for any scheduled microprocess. The pauseThread() and wakeThread() methods submit requests to pause or wake microprocesses. The scheduler will process these when it is next able to - the requests are queued rather than processed immediately. This is done to ensure thread safety. It can handle multiple simultaneous callers from different threads to the one the scheduler is running in. Pausing a microprocess means the scheduler removes it from its 'run queue'. This means that it no longer executes that microprocess. Waking it puts it back into the 'run queue'. If no microprocesses are awake then the scheduler relinquishes cpu usage by blocking. If however this scheduler is itself being scheduled by another microprocess then it does not block. Ideally it should ask its scheduler to pause it, but instead it busy-waits - self pausing functionality is not yet implemented. 'yielding' new components for activation and replacement generators ------------------------------------------------------------------- In general, the main() generator in a microprocess (its thread of execution) can return any values it likes when it uses the ``yield`` statement. It is recommended to not yield zeros or other kinds of 'false' value as these are reserved for possible future special meaning. However, this scheduler does understand certain values that can be yielded: * **Axon.Ipc.newComponent** - a microprocess can yield this to ask the scheduler to activate a new component or microprocess:: def main(self): ... x=MyComponent() yield Axon.Ipc.newComponent(x) ... This is simply an alternative to calling x.activate(). * **Axon.Ipc.WaitComplete** - this is a way for a microprocess to substitute itself (temporarily) with another one that uses a new generator. For example:: def main(self): ... yield Axon.Ipc.WaitComplete(self.waitOneSecond()) ... def waitOneSecond(self): t=time.time() while time.time() < t+1.0: yield 1 This is a convenient way to modularise parts of your main() code. But there is an important limitation with the current implementation: * self.pause() will not cause the replacement generator to pause. (Where 'self' is the original microprocess - as in the example code above) What happens when a microprocess finishes? ------------------------------------------ The scheduler will stop running it! It will call the microprocess's stop() method. It will also call the _closeDownMicroprocess() method and will act on the return value if it is one of the following: * **Axon.Ipc.shutdownMicroprocess** - the specified microprocess will also be stopped. Use with caution as the implementation is currently untested and likely to fail, possibly even crash the scheduler! * **Axon.Ipc.reactivate** - the specified microprocess will be (re)activated. The scheduler uses this internally to pick up where it left off when a Axon.Ipc.WaitComplete instigated detour finishes (see above). Querying the scheduler (Introspection) -------------------------------------- The listAllThreads() method returns a list of all activated microprocesses - both paused and awake. The isThreadPaused() method lets you determine if an individual microprocess is paused. Note that the result returned by this method is conservative (the default assumption is that a thread is probably awake). the result will vary depending on the exact moment it is called! Both these methods are thread safe. Slowing down execution (for debugging) -------------------------------------- It also has a slow motion mode designed to help with debugging & testing. Call runThreads() with the slowmo argument set to the number of seconds the scheduler should pause after each cycle of executing all microprocesses. For example, to wait half a second after each cycle of execution:: scheduler.run.runThreads(slowmo=0.5) How does it work internally? ---------------------------- The scheduler keeps the following internal state: * **time** - updated to time.time() every execution cycle - can be inspected by microprocesses instead of having to call time.time() themselves. * **threads** - a dictionary containing the state of activated microprocesses (whether they are awake or not) * **wakeRequests** and **pauseRequests** - the thread safe queues of requests to wake and pause individual microprocesses * Internal to the main() generator: * **runqueue** - the list of active and awake microprocesses being run * **nextrunqueue** - the list of microprocesses to be run next time round The scheduler uses a simple round robin approach - it walks through its run queue and calls the next() method of each microprocess in turn. As it goes, it builds a new run queue, ready for the next cycle. If a microprocess terminates (raises a StopIteration exception) then it is not included in the next cycle's run queue. After it has gone through all microprocesses, the scheduler then processes messages in its wakeRequests and sleepRequests queues. Sleep requests are processed first; then wake requests second. Suppose there is a sleep and wake request queued for the same microprocess; should it be left awake or put to sleep? By processing wake requests last, the scheduler can err on the side of caution and prefer to leave it awake. Microprocesses are all in one of three possible states (recorded in the ``threads`` dictionary): * **ACTIVE** - the microprocess is awake. It should be in the run queue being prepared for the next execution cycle. * **SLEEPING** - the microprocess is asleep/paused. It should *not* be in the run queue for the next cycle. * **GOINGTOSLEEP** - the microprocess has been requested to be put to sleep. A request to put a microprocess to sleep is handled as follows: * If the microprocess is already *sleeping*, then nothing needs to happen. * If the microprocess is *active*, then it is changed to "going to sleep". It is not removed from the run queue immediately. Instead, what happens is: * on the next cycle of execution, as the scheduler goes through items in the run queue, it doesn't execute any that are "going to sleep" and doesn't include them in the next run queue it is building. It also sets them to the "sleeping" state, Wake requests are used to both wake up sleeping microprocesses and also to activate new ones. A request to wake a microprocess is handled like this: * If the microprocess is already *active*, then nothing needs to happen. * If the microprocess is *sleeping* then it is added to the next run queue and changed to be *active*. * If the microprocess is *going to sleep* then it is only changed to be *active* (it will already be in the run queue, so doesn't need to be added) If the request contains a flag indicating that this is actually an activation request, then this also happens: * If the microprocess is not in the ``threads`` dictionary then it is added to both the run queue and ``threads``. It is set to be *active*. This three state system is a performance optimisation: it means that the scheduler does not need to waste time searching through the next run queue to remove items - they simply get removed on the next cycle of execution. Wake requests and sleep requests are handled through thread-safe queues. This enables other threads of execution (eg. threaded components) to safely make requests to wake or pause components. """ import time import gc as _gc import os from Axon.util import removeAll from Axon.idGen import strId, numId from Axon.debug import debug from Axon.Microprocess import microprocess from Axon.Base import AxonObject as _AxonObject from Axon.Ipc import * try: import Queue as queue vrange = xrange except ImportError: import queue vrange = range from Axon.util import next def _sort(somelist): a=[ x for x in somelist] a.sort() return a _ACTIVE = object() # microprocess is active (is in the runqueue) _SLEEPING = object() # microprocess is paused (is not in the runqueue) _GOINGTOSLEEP = object() # microprocess to be paused (should be removed from the runqueue) class scheduler(microprocess): """Scheduler - runs microthreads of control.""" run = None wait_for_one = False def __init__(self, **argd): """Creates a scheduler object. If scheduler.run has not been set, sets it. Class initialisation ensures that this object/class attribute is initialised - client modules always have access to a standalone scheduler. Internal attributes: * time = time when this object was last active. * threads = set of threads to be run, including their state - whether active or sleeping(paused) Whilst there can be more than one scheduler active in the general case you will NOT want to create a custom scheduler. """ super(scheduler, self).__init__(**argd) if not scheduler.run: # If no scheduler already allocated... scheduler.run = self # Make this scheduler the singleton scheduler. self.time = time.time() self.threads = {} # current set of threads and their states (whether sleeping, or running) self.stopRequests = queue.Queue() self.wakeRequests = queue.Queue() self.pauseRequests = queue.Queue() self.exception_caught = StopIteration self.debuggingon = False if self.wait_for_one: self.extra = 1 else: self.extra = 0 def waitForOne(self): self.extra = 1 def _addThread(self, mprocess): """A Microprocess adds itself to the runqueue using this method, using the mannerism scheduler.run._addThread(). Generally component writers should *not* use this method to activate a component - use the component's own activate() method instead. """ self.wakeThread(mprocess, True) def wakeThread(self, mprocess, canActivate=False): """\ Request to wake a sleeping mprocess, or activate a new one. If sleeping or already active, the specified microprocess will be ensured to be active on the next cycle through the scheduler. If the microprocess is not running yet then it will be woken if (and only if) canActivate is set to True (the default is False). """ self.wakeRequests.put( (mprocess, canActivate) ) def pauseThread(self, mprocess): """\ pauseThread(mprocess) - request to put a mprocess to sleep. If active, or already sleeping, the specified microprocess will be put to leep on the next cycle through the scheduler. """ self.pauseRequests.put( mprocess ) def isThreadPaused(self, mprocess): """\ Returns True if the specified microprocess is sleeping, or the scheduler does not know about it. """ return self.threads.get(mprocess, _SLEEPING) == _SLEEPING # doesn't include _GOINGTOSLEEP (inference is the thread isn't asleep yet!) def listAllThreads(self): """Returns a list of all microprocesses (both active and sleeping)""" self.debuggingon = True return list(self.threads.keys()) def handleMicroprocessShutdownKnockon(self, knockon): if isinstance(knockon, shutdownMicroprocess): # XXX probably doesnt work! # as the scheduler goes through the run queue it will expect to find a # corresponding entry in self.threads - but its being deleted here! # also what about calling stop() and _closeDownMicroprocess() for this # one too??? (Matt, 22 March 2007) for i in vrange(len(self.threads)): if self.threads[i] in knockon.microprocesses(): self.threads[i] = None if isinstance(knockon, reactivate): self._addThread(knockon.original) def immortalise(cls): """\ immortalise() - Class method to make the default scheduler immune to components that crash unexpectedly immortalise() is a feature you'll want to call when running a production system. In short it actively catches rogue components that will take out your server during normal development. (Taking out the server in normal development is a useful feature since it assists with debugging, but a pain for unusual/exceptional scenarios in a production system) It must be called *before* the scheduler starts running. Calling it afterwards will have no effect. Usage: Axon.Scheduler.scheduler.immortalise() """ cls.run.exception_caught = Exception immortalise = classmethod(immortalise) def mortalise(cls): """\ mortalise() - Class method to make the default scheduler use the default behaviour - to die if components crash unexpectedly mortalise undoes a call to immortalise. NOTE: It must be called *before* the scheduler starts running. Calling it afterwards will have no effect. Usage: Axon.Scheduler.scheduler.mortalise() """ cls.run.exception_caught = StopIteration mortalise = classmethod(mortalise) def main(self,slowmo=0,canblock=False): """\ main([slowmo][,canblock]) - Scheduler main loop generator Each cycle through this generator does two things: * one pass through all active microprocesses, giving executing them. * processing of wake/sleep requests You can optionally slow down execution to aid debugging. You can also allow the scheduler to block if there are no active, awake microprocesses. Keyword arguments: - slowmo -- slow down execution by waiting this number of seconds each cycle (default=0) - canblock -- if True, then will block (waiting for wake requests) if all microprocesses are sleeping (default=False) slowmo specifies a delay (in seconds) before the main loop is run. slowmo defaults to 0. If canblock is True, this generator will briefly) block if there are no active microprocesses, otherwise it will return immediately (default). This generator terminates when there are no microprocesses left (either sleeping or awake) because they've all terminated. (or because there were none to begin with!) """ nextrunqueue = [] running = True exception_caught = self.exception_caught while running: # slowmo now = time.time() until = now + slowmo if canblock: time.sleep(until-now) else: while now < until: yield 1 now = time.time() self.time = now # set "time" attribute for benefit for microprocesses runqueue = nextrunqueue nextrunqueue = [] # run microprocesses in the runqueue # if self.debuggingon: # print("-->", [ x.name for x in self.threads], [ x.name for x in runqueue]) for mprocess in runqueue: # if self.debuggingon: # print("Before Run", mprocess) yield 1 if self.threads[mprocess] == _ACTIVE: try: # result = mprocess.next() result = next(mprocess) if isinstance(result, newComponent): for c in result.components(): c.activate() if isinstance(result, WaitComplete): tag = result.argd.get("tag","") if tag == "": tag = "__" + mprocess.name[-10:] # So we have a clue of parentage(!) newThread = microprocess(result.args[0], reactivate(mprocess), tag = tag ) newThread.activate() del self.threads[mprocess] mprocess = None # if self.debuggingon: # print("After Run", mprocess) if mprocess: nextrunqueue.append(mprocess) except exception_caught: del self.threads[mprocess] mprocess.stop() knockon = mprocess._closeDownMicroprocess() self.handleMicroprocessShutdownKnockon(knockon) else: # state is _GOINGTOSLEEP or _SLEEPING # so should *not* execute this one and leave it out of the # next run queue self.threads[mprocess] = _SLEEPING # make sure, even if there weren't any micprocesses active, we yield # control at least once yield 1 # process pause requests first - to prevent deadlock, we do # wakeup requests second - safer to leave a thread awake than asleep while not self.pauseRequests.empty(): mprocess = self.pauseRequests.get() # only sleep if we're actually in the set of threads(!) # otherwise it inadvertently gets added! # if self.threads.has_key(mprocess): if mprocess in self.threads: self.threads[mprocess] = _GOINGTOSLEEP # marked as going to sleep, rather than asleep since mprocess # is still in runqueue (more efficient to leave it to be # removed when we iterate through the runqueue) allsleeping = len(self.threads) > 0 and len(nextrunqueue) == 0 while (allsleeping and canblock) or not self.wakeRequests.empty(): # process requests to wake threads try: # wait for wakeup requests, blocks but with a # modest timeout so we still regularly yield (in case this # is a microprocess running in another scheduler) mprocess, canActivate = self.wakeRequests.get(True,0.01) self.extra = 0 # Fix for race hazard regarding wait_for_one, esp problem with threaded components try: currentstate = self.threads[mprocess] if currentstate == _SLEEPING: nextrunqueue.append(mprocess) allsleeping = False self.threads[mprocess] = _ACTIVE except KeyError: # not activated, can we? if canActivate: nextrunqueue.append(mprocess) self.threads[mprocess] = _ACTIVE allsleeping = False except queue.Empty: # catch timeout pass if not self.stopRequests.empty(): # print("Do we get here? 1") break if not self.stopRequests.empty(): # print("Do we get here? 2") break # print("len(self.threads), wakeRequests" , len(self.threads), self.wakeRequests) running = len(self.threads) + self.extra if not self.stopRequests.empty(): # print("WE GOT HERE! :-)") for X in self.threads: # print("We now call .stop() on ", X.name, type(X)) X.stop() # print("All microprocesses now stopped. Halting") def stop(self): # print("ADDING STOP REQUEST") self.stopRequests.put( self ) super(scheduler, self).stop() def runThreads(self,slowmo=0): """\ Runs the scheduler until there are no activated microprocesses left (they've all terminated). Think of this as bootstrapping the scheduler - after all it is a microprocess like any other, so needs something to run it! Keyword arguments: - slowmo -- Optional. Number of seconds to wait between each cycle of executing microprocesses. (default=0 - no wait) """ for i in self.main(slowmo,canblock=True): pass microprocess.setSchedulerClass(scheduler) scheduler() # Initialise the class. if __name__ == '__main__': print("This code current has no test code") class foo(microprocess): def main(self): while 1: yield 1 a=foo() a.activate() print(a) scheduler.run.runThreads()
{ "content_hash": "c0b814abf30c00b41421925b3cdd837c", "timestamp": "", "source": "github", "line_count": 585, "max_line_length": 131, "avg_line_length": 38.899145299145296, "alnum_prop": 0.644577254350501, "repo_name": "bbc/kamaelia", "id": "e749644c5c2e8305f824cb4239a55b9dc817b908", "size": "23615", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "Code/Python/Axon/Axon/Scheduler.py", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "62985" }, { "name": "C", "bytes": "212854" }, { "name": "C++", "bytes": "327546" }, { "name": "CSS", "bytes": "114434" }, { "name": "ChucK", "bytes": "422" }, { "name": "Diff", "bytes": "483" }, { "name": "Gettext Catalog", "bytes": "3919909" }, { "name": "HTML", "bytes": "1288960" }, { "name": "Java", "bytes": "31832" }, { "name": "JavaScript", "bytes": "829491" }, { "name": "Makefile", "bytes": "5768" }, { "name": "NSIS", "bytes": "18867" }, { "name": "PHP", "bytes": "49059" }, { "name": "Perl", "bytes": "31234" }, { "name": "Processing", "bytes": "2885" }, { "name": "Pure Data", "bytes": "7485482" }, { "name": "Python", "bytes": "18896320" }, { "name": "Ruby", "bytes": "4165" }, { "name": "Shell", "bytes": "711244" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2013 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" android:fromYDelta="0" android:toYDelta="50%p" android:duration="@android:integer/config_mediumAnimTime"/><!-- From: file:/E:/WWWWWWWWW/Trying/aware-core/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/res/anim/abc_slide_out_bottom.xml -->
{ "content_hash": "b398f12b84951f19890d983b0c9cb1c6", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 228, "avg_line_length": 57.78947368421053, "alnum_prop": 0.7231329690346083, "repo_name": "cluo29/com.aware.plugin.trying", "id": "d2535739d5084e4352abf5b9f36ce3b4d58f4bd2", "size": "1098", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "aware-core/build/intermediates/res/phone/release/anim/abc_slide_out_bottom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1895325" } ], "symlink_target": "" }
<?php namespace SocialiteProviders\Shopify; use SocialiteProviders\Manager\SocialiteWasCalled; class ShopifyExtendSocialite { /** * Register the provider. * * @param \SocialiteProviders\Manager\SocialiteWasCalled $socialiteWasCalled */ public function handle(SocialiteWasCalled $socialiteWasCalled) { $socialiteWasCalled->extendSocialite('shopify', Provider::class); } }
{ "content_hash": "26aca46554ea5085b710527195353d0d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 80, "avg_line_length": 23.22222222222222, "alnum_prop": 0.7272727272727273, "repo_name": "SocialiteProviders/Providers", "id": "0cb65808e53a7776bd838bd4255069297f82645c", "size": "418", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Shopify/ShopifyExtendSocialite.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "640132" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace PHPUnit\TestRunner\TestResult; use PHPUnit\Event\Test\BeforeFirstTestMethodErrored; use PHPUnit\Event\Test\BeforeFirstTestMethodErroredSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class BeforeTestClassMethodErroredSubscriber extends Subscriber implements BeforeFirstTestMethodErroredSubscriber { public function notify(BeforeFirstTestMethodErrored $event): void { $this->collector()->beforeTestClassMethodErrored($event); } }
{ "content_hash": "86d38152f10b4cc72bcea07225d41775", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 119, "avg_line_length": 32.94117647058823, "alnum_prop": 0.8035714285714286, "repo_name": "sebastianbergmann/phpunit", "id": "cfa5e9d5d771aea6458704eca5dd7a51eaa46473", "size": "781", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "src/Runner/TestResult/Subscriber/BeforeTestClassMethodErroredSubscriber.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "3243994" }, { "name": "Smarty", "bytes": "12553" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="CompilerConfiguration"> <annotationProcessing> <profile name="Maven default annotation processors profile" enabled="true"> <sourceOutputDir name="target/generated-sources/annotations" /> <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <outputRelativeToContentRoot value="true" /> <module name="solr4j-all" /> <module name="solr4j-core" /> <module name="solr4j-demo" /> <module name="solr4j-distrib" /> </profile> </annotationProcessing> <bytecodeTargetLevel> <module name="solr4j-all" target="1.8" /> <module name="solr4j-core" target="1.8" /> <module name="solr4j-demo" target="1.8" /> <module name="solr4j-distrib" target="1.8" /> <module name="solr4j-pom" target="1.8" /> </bytecodeTargetLevel> </component> </project>
{ "content_hash": "f33ff0aaec0cbfbd1d03c6d4a88bef82", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 85, "avg_line_length": 41.17391304347826, "alnum_prop": 0.6441393875395988, "repo_name": "lanouettea/solr4j", "id": "7a532b3f0e31f14b635f65131dfa4cdbed2caccb", "size": "947", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": ".idea/compiler.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "84096" } ], "symlink_target": "" }
package net.fortuna.ical4j.model.component; import java.io.FileInputStream; import java.io.IOException; import java.net.URISyntaxException; import java.text.ParseException; import junit.framework.TestSuite; import net.fortuna.ical4j.data.CalendarBuilder; import net.fortuna.ical4j.model.Calendar; import net.fortuna.ical4j.model.ComponentList; import net.fortuna.ical4j.model.Date; import net.fortuna.ical4j.model.DateTime; import net.fortuna.ical4j.model.Dur; import net.fortuna.ical4j.model.Parameter; import net.fortuna.ical4j.model.Period; import net.fortuna.ical4j.model.PeriodList; import net.fortuna.ical4j.model.Property; import net.fortuna.ical4j.model.Recur; import net.fortuna.ical4j.model.TimeZoneRegistry; import net.fortuna.ical4j.model.TimeZoneRegistryFactory; import net.fortuna.ical4j.model.parameter.FbType; import net.fortuna.ical4j.model.parameter.TzId; import net.fortuna.ical4j.model.property.Attendee; import net.fortuna.ical4j.model.property.DtEnd; import net.fortuna.ical4j.model.property.DtStart; import net.fortuna.ical4j.model.property.Duration; import net.fortuna.ical4j.model.property.FreeBusy; import net.fortuna.ical4j.model.property.Organizer; import net.fortuna.ical4j.model.property.RRule; import net.fortuna.ical4j.model.property.Sequence; import net.fortuna.ical4j.model.property.Uid; import net.fortuna.ical4j.util.CompatibilityHints; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Created on 10/02/2005 * * @author Ben Fortuna */ public class VFreeBusyTest extends CalendarComponentTest { private static Log log = LogFactory.getLog(VFreeBusyTest.class); private TimeZoneRegistry registry; private VTimeZone tz; private TzId tzParam; private ComponentList components; private VFreeBusy request; private FbType expectedFbType; private int expectedPeriodCount; private PeriodList expectedPeriods; /** * @param testMethod */ public VFreeBusyTest(String testMethod) { this(testMethod, null); } /** * @param testMethod * @param component */ public VFreeBusyTest(String testMethod, VFreeBusy component) { super(testMethod, component); } /** * @param testMethod * @param component * @param expectedPeriodCount */ public VFreeBusyTest(String testMethod, VFreeBusy component, ComponentList components, int expectedPeriodCount) { super(testMethod, component); this.request = component; this.components = components; this.expectedPeriodCount = expectedPeriodCount; } /** * @param testMethod * @param component * @param components * @param expectedFbType */ public VFreeBusyTest(String testMethod, VFreeBusy component, ComponentList components, FbType expectedFbType) { super(testMethod, component); this.request = component; this.components = components; this.expectedFbType = expectedFbType; } /** * @param testMethod * @param component * @param components * @param expectedPeriods */ public VFreeBusyTest(String testMethod, VFreeBusy component, ComponentList components, PeriodList expectedPeriods) { super(testMethod, component); this.request = component; this.components = components; this.expectedPeriods = expectedPeriods; } /* * (non-Javadoc) * * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { super.setUp(); // relax validation to avoid UID requirement.. CompatibilityHints.setHintEnabled( CompatibilityHints.KEY_RELAXED_VALIDATION, true); registry = TimeZoneRegistryFactory.getInstance().createRegistry(); // create timezone property.. tz = registry.getTimeZone("Australia/Melbourne").getVTimeZone(); // create tzid parameter.. tzParam = new TzId(tz.getProperty(Property.TZID) .getValue()); } /* (non-Javadoc) * @see junit.framework.TestCase#tearDown() */ protected void tearDown() throws Exception { CompatibilityHints.clearHintEnabled(CompatibilityHints.KEY_RELAXED_VALIDATION); super.tearDown(); } /* * Class under test for void VFreeBusy(ComponentList) */ public final void testVFreeBusyComponentList() throws Exception { ComponentList components = new ComponentList(); DateTime startDate = new DateTime(0); DateTime endDate = new DateTime(); VEvent event = new VEvent(); event.getProperties().add(new DtStart(startDate)); // event.getProperties().add(new DtEnd(new Date())); event.getProperties().add(new Duration(new Dur(0, 1, 0, 0))); components.add(event); VEvent event2 = new VEvent(); event2.getProperties().add(new DtStart(startDate)); event2.getProperties().add(new DtEnd(endDate)); components.add(event2); VFreeBusy request = new VFreeBusy(startDate, endDate); VFreeBusy fb = new VFreeBusy(request, components); if (log.isDebugEnabled()) { log.debug("\n==\n" + fb.toString()); } } /* * Class under test for void VFreeBusy(ComponentList) */ public final void testVFreeBusyComponentList2() throws Exception { FileInputStream fin = new FileInputStream("etc/samples/invalid/core.ics"); CalendarBuilder builder = new CalendarBuilder(); Calendar calendar = builder.build(fin); DateTime startDate = new DateTime(0); DateTime endDate = new DateTime(); // request all busy time between 1970 and now.. VFreeBusy requestBusy = new VFreeBusy(startDate, endDate); VFreeBusy fb = new VFreeBusy(requestBusy, calendar.getComponents()); if (log.isDebugEnabled()) { log.debug("\n==\n" + fb.toString()); } // request all free time between 1970 and now of duration 2 hours or // more.. VFreeBusy requestFree = new VFreeBusy(startDate, endDate, new Dur(0, 2, 0, 0)); VFreeBusy fb2 = new VFreeBusy(requestFree, calendar.getComponents()); if (log.isDebugEnabled()) { log.debug("\n==\n" + fb2.toString()); } } public final void testVFreeBusyComponentList3() throws Exception { ComponentList components = new ComponentList(); DateTime eventStart = new DateTime(0); // java.util.Calendar cal = java.util.Calendar.getInstance(); // cal.setTime(eventStart); // cal.add(java.util.Calendar.HOUR_OF_DAY, 1); VEvent event = new VEvent(eventStart, new Dur(0, 1, 0, 0), "Progress Meeting"); // VEvent event = new VEvent(startDate, cal.getTime(), "Progress // Meeting"); // add timezone information.. event.getProperty(Property.DTSTART).getParameters() .add(tzParam); components.add(event); // add recurrence.. Recur recur = new Recur(Recur.YEARLY, 20); recur.getMonthList().add(new Integer(1)); recur.getMonthDayList().add(new Integer(26)); recur.getHourList().add(new Integer(9)); recur.getMinuteList().add(new Integer(30)); event.getProperties().add(new RRule(recur)); if (log.isDebugEnabled()) { log.debug("\n==\n" + event.toString()); } DateTime requestStart = new DateTime(eventStart); DateTime requestEnd = new DateTime(); VFreeBusy request = new VFreeBusy(requestStart, requestEnd); VFreeBusy fb = new VFreeBusy(request, components); if (log.isDebugEnabled()) { log.debug("\n==\n" + fb.toString()); } } public final void testVFreeBusyComponentList4() throws Exception { ComponentList components = new ComponentList(); java.util.Calendar cal = java.util.Calendar.getInstance(); DateTime startDate = new DateTime(cal.getTime()); cal.add(java.util.Calendar.DATE, 3); DateTime endDate = new DateTime(cal.getTime()); VEvent event = new VEvent(); event.getProperties().add(new DtStart(startDate)); // event.getProperties().add(new DtEnd(new Date())); event.getProperties().add(new Duration(new Dur(0, 1, 0, 0))); components.add(event); VEvent event2 = new VEvent(); event2.getProperties().add(new DtStart(startDate)); event2.getProperties().add(new DtEnd(endDate)); components.add(event2); VFreeBusy request = new VFreeBusy(startDate, endDate, new Dur(0, 1, 0, 0)); VFreeBusy fb = new VFreeBusy(request, components); log.debug("\n==\n" + fb.toString()); } public final void testAngelites() { log.info("angelites test:\n================"); Calendar freeBusyTest = new Calendar(); // add an event java.util.Calendar start = java.util.Calendar.getInstance(); java.util.Calendar end = java.util.Calendar.getInstance(); start.add(java.util.Calendar.DATE, -1); VEvent dteEnd = new VEvent(new Date(start.getTime().getTime()), new Date(end.getTime().getTime()), "DATE END INCLUDED"); VEvent duration = new VEvent(new Date(start.getTime().getTime()), new Dur(0, 1, 0, 0), "DURATION"); freeBusyTest.getComponents().add(dteEnd); freeBusyTest.getComponents().add(duration); java.util.Calendar dtstart = java.util.Calendar.getInstance(); java.util.Calendar dtend = java.util.Calendar.getInstance(); dtstart.add(java.util.Calendar.DATE, -2); VFreeBusy getBusy = new VFreeBusy(new DateTime(dtstart.getTime()), new DateTime(dtend.getTime())); VFreeBusy requestFree = new VFreeBusy(new DateTime(dtstart.getTime()), new DateTime(dtend.getTime()), new Dur(0, 0, 30, 0)); log.debug("GET BUSY: \n" + getBusy.toString()); log.debug("REQUEST FREE: \n" + requestFree.toString()); Calendar FreeBusyTest2 = new Calendar(); VFreeBusy replyBusy = new VFreeBusy(getBusy, freeBusyTest .getComponents()); VFreeBusy replyFree = new VFreeBusy(requestFree, freeBusyTest .getComponents()); log.debug("REPLY BUSY: \n" + replyBusy.toString()); log.debug("REPLY FREE: \n" + replyFree.toString()); FreeBusyTest2.getComponents().add(replyBusy); VFreeBusy replyBusy2 = new VFreeBusy(getBusy, FreeBusyTest2 .getComponents()); VFreeBusy replyFree2 = new VFreeBusy(requestFree, FreeBusyTest2 .getComponents()); log.debug("REPLY BUSY2: \n" + replyBusy2.toString()); log.debug("REPLY FREE2: \n" + replyFree2.toString()); } /** * */ public void testFbType() { VFreeBusy result = new VFreeBusy(request, components); FreeBusy fb = (FreeBusy) result.getProperty(Property.FREEBUSY); assertEquals(expectedFbType, fb.getParameter(Parameter.FBTYPE)); } /** * */ public void testPeriodCount() { VFreeBusy result = new VFreeBusy(request, components); FreeBusy fb = (FreeBusy) result.getProperty(Property.FREEBUSY); if (expectedPeriodCount > 0) { assertEquals(expectedPeriodCount, fb.getPeriods().size()); } else { assertNull(fb); } } /** * */ public void testFreeBusyPeriods() { VFreeBusy result = new VFreeBusy(request, components); FreeBusy fb = (FreeBusy) result.getProperty(Property.FREEBUSY); assertEquals(expectedPeriods, fb.getPeriods()); } /** * @return */ public static TestSuite suite() throws ParseException, URISyntaxException, IOException { TestSuite suite = new TestSuite(); suite.addTest(new VFreeBusyTest("testVFreeBusyComponentList")); suite.addTest(new VFreeBusyTest("testVFreeBusyComponentList2")); suite.addTest(new VFreeBusyTest("testVFreeBusyComponentList3")); suite.addTest(new VFreeBusyTest("testVFreeBusyComponentList4")); suite.addTest(new VFreeBusyTest("testAngelites")); // icalendar validation VFreeBusy fb = new VFreeBusy(); suite.addTest(new VFreeBusyTest("testIsCalendarComponent", fb)); suite.addTest(new VFreeBusyTest("testValidation", fb)); // iTIP PUBLISH validation suite.addTest(new VFreeBusyTest("testPublishValidationException", new VFreeBusy())); VFreeBusy publishFb = new VFreeBusy(); publishFb.getProperties().add(new DtStart("20091212T000000Z")); publishFb.getProperties().add(new DtEnd("20091212T235959Z")); publishFb.getProperties().add(new FreeBusy("20091212T140000Z/PT3H")); publishFb.getProperties().add(new Organizer("mailto:joe@example.com")); publishFb.getProperties().add(new Uid("12")); suite.addTest(new VFreeBusyTest("testPublishValidation", publishFb)); // iTIP REPLY validation suite.addTest(new VFreeBusyTest("testReplyValidationException", new VFreeBusy())); VFreeBusy replyFb = new VFreeBusy(); replyFb.getProperties().add(new DtStart("20091212T000000Z")); replyFb.getProperties().add(new DtEnd("20091212T235959Z")); replyFb.getProperties().add(new Organizer("mailto:joe@example.com")); replyFb.getProperties().add(new Attendee("mailto:joe@example.com")); replyFb.getProperties().add(new Uid("12")); suite.addTest(new VFreeBusyTest("testReplyValidation", replyFb)); VFreeBusy invalDurFb = (VFreeBusy)replyFb.copy(); invalDurFb.getProperties().add(new Duration(new Dur("PT1H"))); suite.addTest(new VFreeBusyTest("testReplyValidationException", invalDurFb)); VFreeBusy invalSeqFb = (VFreeBusy)replyFb.copy(); invalSeqFb.getProperties().add(new Sequence("12")); suite.addTest(new VFreeBusyTest("testReplyValidationException", invalSeqFb)); // A test for a request for free time where the VFreeBusy instance doesn't // consume any time in the specified range. Correct behaviour should see the // return of a VFreeBusy specifying the entire range as free. ComponentList components = new ComponentList(); VEvent event1 = new VEvent(new DateTime("20050101T080000"), new Dur(0, 0, 15, 0), "Consultation 1"); components.add(event1); DateTime start = new DateTime("20050103T000000"); DateTime end = new DateTime("20050104T000000"); VFreeBusy requestFree = new VFreeBusy(start, end, new Dur(0, 0, 5, 0)); // free/busy type should be FREE.. suite.addTest(new VFreeBusyTest("testFbType", requestFree, components, FbType.FREE)); // should be only one period.. suite.addTest(new VFreeBusyTest("testPeriodCount", requestFree, components, 1)); // period should be from the start to the end date.. PeriodList periods = new PeriodList(); periods.add(new Period(start, end)); suite.addTest(new VFreeBusyTest("testFreeBusyPeriods", requestFree, components, periods)); //testBusyTime.. components = new ComponentList(); event1 = new VEvent(new DateTime("20050103T080000Z"), new Dur(0, 5, 0, 0), "Event 1"); Recur rRuleRecur = new Recur("FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR"); RRule rRule = new RRule(rRuleRecur); event1.getProperties().add(rRule); components.add(event1); start = new DateTime("20050104T1100000Z"); Period period = new Period(start, new Dur(0, 0, 30, 0)); VFreeBusy request = new VFreeBusy(period.getStart(), period.getEnd()); // FBTYPE is optional - defaults to BUSY.. // suite.addTest(new VFreeBusyTest("testFbType", request, components, FbType.BUSY)); suite.addTest(new VFreeBusyTest("testPeriodCount", request, components, 1)); periods = new PeriodList(); periods.add(new Period(new DateTime("20050104T0800000Z"), new Dur("PT5H"))); suite.addTest(new VFreeBusyTest("testFreeBusyPeriods", request, components, periods)); // TODO: further work needed to "splice" events based on the amount // of time that intersects a free-busy request.. // assertEquals(new DateTime("20050104T1100000Z"), busy1.getStart()); // assertEquals("PT30M", busy1.getDuration().toString()); request = new VFreeBusy(period.getStart(), period.getEnd(), new Dur(0)); suite.addTest(new VFreeBusyTest("testPeriodCount", request, components, 0)); // anniversary-style events don't consume time.. components = new ComponentList(); event1 = new VEvent(new Date("20081225"), "Christmas 2008"); components.add(event1); start = new DateTime("20081225T110000"); end = new DateTime("20081225T113000"); request = new VFreeBusy(start, end); suite.addTest(new VFreeBusyTest("testPeriodCount", request, components, 0)); request = new VFreeBusy(start, end, new Dur(0, 0, 15, 0)); suite.addTest(new VFreeBusyTest("testFbType", request, components, FbType.FREE)); suite.addTest(new VFreeBusyTest("testPeriodCount", request, components, 1)); periods = new PeriodList(); periods.add(new Period(start, new Dur(0, 0, 30, 0))); suite.addTest(new VFreeBusyTest("testFreeBusyPeriods", request, components, periods)); return suite; } }
{ "content_hash": "f7c9506abb01c9d5b1b74827481f1e17", "timestamp": "", "source": "github", "line_count": 474, "max_line_length": 120, "avg_line_length": 37.67088607594937, "alnum_prop": 0.6491935483870968, "repo_name": "benfortuna/ical4j", "id": "5517f35691f25f53b265b08dd9e0910407320ce5", "size": "19423", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/net/fortuna/ical4j/model/component/VFreeBusyTest.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Groovy", "bytes": "299952" }, { "name": "HTML", "bytes": "17137" }, { "name": "Java", "bytes": "1898970" }, { "name": "Shell", "bytes": "704" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Security.Cryptography; using System.Text; /// <summary> /// Summary description for password /// </summary> public class password { SHA1CryptoServiceProvider sha = new SHA1CryptoServiceProvider(); StringBuilder sb = new StringBuilder(); public password() { // // TODO: Add constructor logic here // } public string create(String passwrd) { byte[] bs = sha.ComputeHash(System.Text.Encoding.ASCII.GetBytes(passwrd)); foreach (byte b in bs) { sb.Append(b.ToString("x2").ToLower()); } return sb.ToString(); } }
{ "content_hash": "807c0105420df10abc57383a8cb2f02e", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 82, "avg_line_length": 22.258064516129032, "alnum_prop": 0.6550724637681159, "repo_name": "Geoneer/GeoExplorer", "id": "2b4f3c9edc7736cda24955712b5d763701f99bd3", "size": "692", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ws/App_Code/password.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "2074" }, { "name": "C", "bytes": "21018" }, { "name": "C#", "bytes": "38016" }, { "name": "CSS", "bytes": "440245" }, { "name": "Java", "bytes": "718044" }, { "name": "JavaScript", "bytes": "22092165" }, { "name": "Makefile", "bytes": "1948" }, { "name": "Python", "bytes": "390453" }, { "name": "Shell", "bytes": "37801" } ], "symlink_target": "" }
title: Reflect Get localeTitle: Отразить Get --- ## Отразить Get Это заглушка. [Помогите нашему сообществу расширить его](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/reflect/reflect-get/index.md) . [Это руководство по быстрому стилю поможет вам принять ваш запрос на тягу](https://github.com/freecodecamp/guides/blob/master/README.md) . #### Дополнительная информация:
{ "content_hash": "04b8961513cd5afc01ee092cc3b0e156", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 177, "avg_line_length": 41.6, "alnum_prop": 0.7908653846153846, "repo_name": "otavioarc/freeCodeCamp", "id": "1329df538a25a28a18a28651d1bceb6b234502d3", "size": "568", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "guide/russian/javascript/standard-objects/reflect/reflect-get/index.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "35491" }, { "name": "HTML", "bytes": "17600" }, { "name": "JavaScript", "bytes": "777274" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <title>RangeUISlider Reference</title> <link rel="stylesheet" type="text/css" href="css/jazzy.css" /> <link rel="stylesheet" type="text/css" href="css/highlight.css" /> <meta charset='utf-8'> <script src="js/jquery.min.js" defer></script> <script src="js/jazzy.js" defer></script> <script src="js/lunr.min.js" defer></script> <script src="js/typeahead.jquery.js" defer></script> <script src="js/jazzy.search.js" defer></script> </head> <body> <a title="RangeUISlider Reference"></a> <header> <div class="content-wrapper"> <p><a href="index.html">RangeUISlider 3.1.0 Docs</a> (100% documented)</p> <p class="header-right"><a href="https://github.com/chicio/ID3TagEditor"><img src="img/gh.png" alt="GitHub"/>View on GitHub</a></p> <div class="header-right"> <form role="search" action="search.json"> <input type="text" placeholder="Search documentation" data-typeahead> </form> </div> </div> </header> <div class="content-wrapper"> <p id="breadcrumbs"> <a href="index.html">RangeUISlider Reference</a> <img id="carat" src="img/carat.png" alt=""/> RangeUISlider Reference </p> </div> <div class="content-wrapper"> <nav class="sidebar"> <ul class="nav-groups"> <li class="nav-group-name"> <a href="Classes.html">Classes</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="Classes/Bar.html">Bar</a> </li> <li class="nav-group-task"> <a href="Classes/Gradient.html">Gradient</a> </li> <li class="nav-group-task"> <a href="Classes/Knob.html">Knob</a> </li> <li class="nav-group-task"> <a href="Classes/KnobComponents.html">KnobComponents</a> </li> <li class="nav-group-task"> <a href="Classes.html#/s:13RangeUISlider9KnobLabelC">KnobLabel</a> </li> <li class="nav-group-task"> <a href="Classes/Knobs.html">Knobs</a> </li> <li class="nav-group-task"> <a href="Classes.html#/c:@M@RangeUISlider@objc(cs)Progress">Progress</a> </li> <li class="nav-group-task"> <a href="Classes/ProgressViews.html">ProgressViews</a> </li> <li class="nav-group-task"> <a href="Classes/RangeSliderCoordinator.html">RangeSliderCoordinator</a> </li> <li class="nav-group-task"> <a href="Classes/RangeUISlider.html">RangeUISlider</a> </li> <li class="nav-group-task"> <a href="Classes/RangeUISliderChangeEvent.html">RangeUISliderChangeEvent</a> </li> <li class="nav-group-task"> <a href="Classes/RangeUISliderChangeFinishedEvent.html">RangeUISliderChangeFinishedEvent</a> </li> <li class="nav-group-task"> <a href="Classes/RangeUISliderComponents.html">RangeUISliderComponents</a> </li> </ul> </li> <li class="nav-group-name"> <a href="Protocols.html">Protocols</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="Protocols/RangeUISliderDelegate.html">RangeUISliderDelegate</a> </li> </ul> </li> <li class="nav-group-name"> <a href="Structs.html">Structures</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="Structs/RangeSlider.html">RangeSlider</a> </li> </ul> </li> </ul> </nav> <article class="main-content"> <section> <section class="section"> <h1 id='rangeuislider' class='heading'>RangeUISlider</h1> <p><img src="https://github.com/chicio/RangeUISlider/workflows/Build%20iOS/badge.svg" alt="Build iOS"> <img src="https://github.com/chicio/RangeUISlider/workflows/SwiftLint/badge.svg" alt="SwiftLint"> <a href="https://img.shields.io/badge/platforms-iOS-orange.svg"><img src="https://img.shields.io/badge/platforms-iOS-orange.svg" alt="Supported platform"></a> <a href="https://cocoapods.org/pods/RangeUISlider"><img src="https://img.shields.io/cocoapods/v/RangeUISlider.svg" alt="CocoaPods Version"></a> <a href="https://cocoapods.org/pods/RangeUISlider"><img src="https://img.shields.io/cocoapods/metrics/doc-percent/RangeUISlider.svg" alt="CocoaPods Doc Coverage Percentage"></a> <a href="https://codebeat.co/projects/github-com-chicio-rangeuislider-master"><img src="https://codebeat.co/badges/33894981-7d8a-442a-ac12-1976c08de178" alt="codebeat badge"></a> <a href="https://raw.githubusercontent.com/chicio/RangeUISlider/master/LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license"></a></p> <p>An iOS range selection slider compatible with <code>UIKit</code> and <code>SwiftUI</code>. Developed using autolayout and highly customizable using <code>@IBDesignabled</code> and <code>@IBInspectable</code> or programmatically. It support also RTL (right to left) languages automatically out of the box.</p> <p align="center"> <img width="400" height="400" src="https://raw.githubusercontent.com/chicio/RangeUISlider/master/Screenshots/range-ui-slider.png"> </p> <hr> <h3 id='installation' class='heading'>Installation</h3> <p>There are three ways to install <code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> in your project: manual installation, as a stand-alone framework or using cocoapods.</p> <p><strong>Manual installation</strong></p> <p>To manually install <code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> simply drag and drop all the file contained in the <a href="https://github.com/chicio/RangeUISlider/tree/master/Source">Source</a> folder inside your project.</p> <p><strong>Framework</strong></p> <p><code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> is available also as a framework. To install it follow the standard procedure used to install a custom cocoa touch framework:</p> <ul> <li>drag the RangeUISlider.xcodeproj inside your project</li> <li>add it to the Embedded Binaries/Linked Frameworks and Libraries section of your project.</li> </ul> <p>See the <code>RangeUISliderDemo</code> demo project/target for an example of the setup of the framework.</p> <p><strong>CocoaPods</strong></p> <p>RangeUISlider is also available as a pod on <a href="https://cocoapods.org/pods/RangeUISlider">CocoaPods</a>. Add the dependency to your Podfile similar to the following:</p> <pre class="highlight plaintext"><code>target 'MyApp' do pod 'RangeUISlider', '~&gt; 3.0' end </code></pre> <p>and then run pod install (or pod update).</p> <p><strong>Swift Package Manager (SPM)</strong></p> <p><code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> is also available as a SPM package. Add it from the project configuration using the Github repository url. Choose master or a tag. If you choose the tag it must be &gt;= 1.11.0.</p> <p><img src="https://raw.githubusercontent.com/chicio/RangeUISlider/master/Screenshots/05-spm1.png" alt="spm 1"> <img src="https://raw.githubusercontent.com/chicio/RangeUISlider/master/Screenshots/06-spm2.png" alt="spm 2"> <img src="https://raw.githubusercontent.com/chicio/RangeUISlider/master/Screenshots/07-spm3.png" alt="spm 3"></p> <hr> <h3 id='usage' class='heading'>Usage</h3> <p>You can use RangeUISlider in three ways: </p> <ul> <li>in a <code>UIKit</code> project using Interface Builder (thanks to <code>@IBDesignable</code> and <code>@IBInspectable</code> )</li> <li>in a <code>UIKit</code> project programmatically</li> <li>in a <code>SwiftUI</code> project using the <code><a href="Structs/RangeSlider.html">RangeSlider</a></code> wrapper created using <code>UIViewRepresentable</code></li> </ul> <h4 id='interface-builder' class='heading'>Interface builder</h4> <p>To levearege the power of the <code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> in interface builder: </p> <ul> <li>drag a UIView into you storyboard</li> <li>set <code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> as custom class of that view <ul> <li><strong>IMPORTANT: set also the Module to RangeUISlider if you used cocoapods or the framework version during installation</strong></li> </ul></li> <li>start editing it using interface builder (and levearage the power of <code>@IBDesignabled</code> and <code>@IBInspectable</code>)</li> </ul> <p><a href="https://www.youtube.com/watch?v=Lorvozz-1HU">Here</a> you can find a video tutorial for the setup with Interface Builder.</p> <p align="center"> <a href="https://www.youtube.com/watch?v=Lorvozz-1HU" target="_blank"><img src="https://raw.githubusercontent.com/chicio/RangeUISlider/master/Screenshots/tutorial.png"></a> </p> <h4 id='programmatic' class='heading'>Programmatic</h4> <p>You can also use <code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> as a programmatic UI component by setting all the property you need in your code. Take a look at the <code>RangeUISliderDemo</code> project to see multiple example (e.g. take a look at <a href="https://github.com/chicio/RangeUISlider/blob/master/Demo/SetupProgrammaticViewController.swift">this contrroller</a>. In particular, remember to set <code>translatesAutoresizingMaskIntoConstraints = false</code> for the slider to use autolayout. Below you can find a simple example.</p> <pre class="highlight swift"><code><span class="k">override</span> <span class="kd">func</span> <span class="nf">viewDidLoad</span><span class="p">()</span> <span class="p">{</span> <span class="c1">// ...other code</span> <span class="k">super</span><span class="o">.</span><span class="nf">viewDidLoad</span><span class="p">()</span> <span class="n">rangeSlider</span> <span class="o">=</span> <span class="kt">RangeUISlider</span><span class="p">(</span><span class="nv">frame</span><span class="p">:</span> <span class="kt">CGRect</span><span class="p">(</span><span class="nv">origin</span><span class="p">:</span> <span class="kt">CGPoint</span><span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="mi">20</span><span class="p">),</span> <span class="nv">size</span><span class="p">:</span> <span class="kt">CGSize</span><span class="p">(</span><span class="nv">width</span><span class="p">:</span> <span class="mi">100</span><span class="p">,</span> <span class="nv">height</span><span class="p">:</span> <span class="mi">50</span><span class="p">)))</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">translatesAutoresizingMaskIntoConstraints</span> <span class="o">=</span> <span class="kc">false</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">delegate</span> <span class="o">=</span> <span class="k">self</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">barHeight</span> <span class="o">=</span> <span class="mi">20</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">barCorners</span> <span class="o">=</span> <span class="mi">10</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">leftKnobColor</span> <span class="o">=</span> <span class="err">#</span><span class="nf">colorLiteral</span><span class="p">(</span><span class="nv">red</span><span class="p">:</span> <span class="mf">0.5725490451</span><span class="p">,</span> <span class="nv">green</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">blue</span><span class="p">:</span> <span class="mf">0.2313725501</span><span class="p">,</span> <span class="nv">alpha</span><span class="p">:</span> <span class="mi">1</span><span class="p">)</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">leftKnobWidth</span> <span class="o">=</span> <span class="mi">40</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">leftKnobHeight</span> <span class="o">=</span> <span class="mi">40</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">leftKnobCorners</span> <span class="o">=</span> <span class="mi">20</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">rightKnobColor</span> <span class="o">=</span> <span class="err">#</span><span class="nf">colorLiteral</span><span class="p">(</span><span class="nv">red</span><span class="p">:</span> <span class="mf">0.5725490451</span><span class="p">,</span> <span class="nv">green</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">blue</span><span class="p">:</span> <span class="mf">0.2313725501</span><span class="p">,</span> <span class="nv">alpha</span><span class="p">:</span> <span class="mi">1</span><span class="p">)</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">rightKnobWidth</span> <span class="o">=</span> <span class="mi">40</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">rightKnobHeight</span> <span class="o">=</span> <span class="mi">40</span> <span class="n">rangeSlider</span><span class="o">.</span><span class="n">rightKnobCorners</span> <span class="o">=</span> <span class="mi">20</span> <span class="k">self</span><span class="o">.</span><span class="n">view</span><span class="o">.</span><span class="nf">addSubview</span><span class="p">(</span><span class="n">rangeSlider</span><span class="p">)</span> <span class="c1">// ...other code</span> <span class="p">}</span> </code></pre> <h4 id='swiftui' class='heading'>SwiftUI</h4> <p>You can use <code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> in a <code>SwiftUI</code> application/screen by leveraging the <code><a href="Structs/RangeSlider.html">RangeSlider</a></code> wrapper created using <code>UIViewRepresentable</code>. Below you can find a small example of the usage in a simple screen. You can find more example in the <code>RangeUISliderDemo</code> demo project (look <a href="https://github.com/chicio/RangeUISlider/blob/master/RangeUISliderDemo/SwiftUIHostingViewController.swift" title="swiftui rangeslider examples">here</a>). </p> <pre class="highlight swift"><code><span class="k">var</span> <span class="nv">body</span><span class="p">:</span> <span class="kd">some</span> <span class="kt">View</span> <span class="p">{</span> <span class="kt">VStack</span> <span class="p">{</span> <span class="c1">// ...other code</span> <span class="kt">RangeSlider</span><span class="p">(</span><span class="nv">minValueSelected</span><span class="p">:</span> <span class="o">&lt;</span><span class="n">binding</span> <span class="n">value</span><span class="o">&gt;</span><span class="p">,</span> <span class="nv">maxValueSelected</span><span class="p">:</span> <span class="o">&lt;</span><span class="n">binding</span> <span class="n">value</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">.</span><span class="nf">leftKnobColor</span><span class="p">(</span><span class="kt">Color</span><span class="p">(</span><span class="err">#</span><span class="nf">colorLiteral</span><span class="p">(</span><span class="nv">red</span><span class="p">:</span> <span class="mf">0.5725490451</span><span class="p">,</span> <span class="nv">green</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">blue</span><span class="p">:</span> <span class="mf">0.2313725501</span><span class="p">,</span> <span class="nv">alpha</span><span class="p">:</span> <span class="mi">1</span><span class="p">)))</span> <span class="o">.</span><span class="nf">leftKnobWidth</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span> <span class="o">.</span><span class="nf">leftKnobHeight</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span> <span class="o">.</span><span class="nf">leftKnobCorners</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span> <span class="o">.</span><span class="nf">rightKnobColor</span><span class="p">(</span><span class="kt">Color</span><span class="p">(</span><span class="err">#</span><span class="nf">colorLiteral</span><span class="p">(</span><span class="nv">red</span><span class="p">:</span> <span class="mf">0.5725490451</span><span class="p">,</span> <span class="nv">green</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">blue</span><span class="p">:</span> <span class="mf">0.2313725501</span><span class="p">,</span> <span class="nv">alpha</span><span class="p">:</span> <span class="mi">1</span><span class="p">)))</span> <span class="o">.</span><span class="nf">rightKnobWidth</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span> <span class="o">.</span><span class="nf">rightKnobHeight</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span> <span class="o">.</span><span class="nf">rightKnobCorners</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span> <span class="c1">// ...other code</span> <span class="p">}</span> <span class="p">}</span> </code></pre> <h3 id='access-range-values' class='heading'>Access range values</h3> <p>You can access the range values in two ways, depending on the fact that you&rsquo;re using <code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> in a <code>UIKit</code> or <code>SwiftUI</code> view:</p> <ul> <li>for <code>UIKit</code>, use <code><a href="Protocols/RangeUISliderDelegate.html">RangeUISliderDelegate</a></code> and the delegate property</li> <li>for <code>SwiftUI</code>, use the <code><a href="Structs/RangeSlider.html#/s:13RangeUISlider0A6SliderV16minValueSelected12CoreGraphics7CGFloatVvp">RangeSlider.minValueSelected</a></code> and <code><a href="Structs/RangeSlider.html#/s:13RangeUISlider0A6SliderV16maxValueSelected12CoreGraphics7CGFloatVvp">RangeSlider.maxValueSelected</a></code> binding values</li> </ul> <h4 id='uikit-rangeuisliderdelegate' class='heading'>UIKit - RangeUISliderDelegate</h4> <p>To get the current values from the slider in a <code>UIKit</code> project, set the slider delegate property. The delegate of <code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> must implement the <code><a href="Protocols/RangeUISliderDelegate.html">RangeUISliderDelegate</a></code> protocol, that has three methods. See code below.</p> <pre class="highlight swift"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">RangeUISliderDelegate</span> <span class="p">{</span> <span class="cm">/** Calls the delegate when the user has started the change of the range. */</span> <span class="kd">@objc</span> <span class="kd">optional</span> <span class="kd">func</span> <span class="nf">rangeChangeStarted</span><span class="p">()</span> <span class="cm">/** Calls the delegate when the user is changing the range by moving the knobs. - parameter event: the change event data. See `RangeUISliderChangeEvent`. */</span> <span class="kd">@objc</span> <span class="kd">optional</span> <span class="kd">func</span> <span class="nf">rangeIsChanging</span><span class="p">(</span><span class="nv">event</span><span class="p">:</span> <span class="kt">RangeUISliderChangeEvent</span><span class="p">)</span> <span class="cm">/** Calls the delegate when the user has finished the change of the range. - parameter event: the change finish event data. See `RangeUISliderChangeFinishedEvent`. */</span> <span class="kd">@objc</span> <span class="kd">func</span> <span class="nf">rangeChangeFinished</span><span class="p">(</span><span class="nv">event</span><span class="p">:</span> <span class="kt">RangeUISliderChangeFinishedEvent</span><span class="p">)</span> <span class="p">}</span> </code></pre> <h4 id='swiftui-binding-values' class='heading'>SwiftUI - Binding values</h4> <p>You can access the values of the slider in a <code>SwiftUI</code> project by passing two bindings properties to the <code><a href="Structs/RangeSlider.html">RangeSlider</a></code> init. See the example below.</p> <pre class="highlight swift"><code><span class="kd">struct</span> <span class="kt">SwiftUIHostingView</span><span class="p">:</span> <span class="kt">View</span> <span class="p">{</span> <span class="kd">@State</span> <span class="kd">private</span> <span class="k">var</span> <span class="nv">minValueSelected</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="o">=</span> <span class="mi">10</span> <span class="kd">@State</span> <span class="kd">private</span> <span class="k">var</span> <span class="nv">maxValueSelected</span><span class="p">:</span> <span class="kt">CGFloat</span> <span class="o">=</span> <span class="mi">40</span> <span class="k">var</span> <span class="nv">body</span><span class="p">:</span> <span class="kd">some</span> <span class="kt">View</span> <span class="p">{</span> <span class="kt">VStack</span> <span class="p">{</span> <span class="kt">RangeSlider</span><span class="p">(</span><span class="nv">minValueSelected</span><span class="p">:</span> <span class="k">self</span><span class="o">.</span><span class="err">$</span><span class="n">minValueSelected</span><span class="p">,</span> <span class="nv">maxValueSelected</span><span class="p">:</span> <span class="k">self</span><span class="o">.</span><span class="err">$</span><span class="n">maxValueSelected</span><span class="p">)</span> <span class="o">.</span><span class="nf">scaleMinValue</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span> <span class="o">.</span><span class="nf">scaleMaxValue</span><span class="p">(</span><span class="mi">80</span><span class="p">)</span> <span class="o">.</span><span class="nf">defaultValueLeftKnob</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span> <span class="o">.</span><span class="nf">defaultValueRightKnob</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span> <span class="o">.</span><span class="nf">leftKnobWidth</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span> <span class="o">.</span><span class="nf">leftKnobHeight</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span> <span class="o">.</span><span class="nf">leftKnobCorners</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span> <span class="o">.</span><span class="nf">rightKnobColor</span><span class="p">(</span><span class="kt">Color</span><span class="p">(</span><span class="err">#</span><span class="nf">colorLiteral</span><span class="p">(</span><span class="nv">red</span><span class="p">:</span> <span class="mf">0.5725490451</span><span class="p">,</span> <span class="nv">green</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">blue</span><span class="p">:</span> <span class="mf">0.2313725501</span><span class="p">,</span> <span class="nv">alpha</span><span class="p">:</span> <span class="mi">1</span><span class="p">)))</span> <span class="o">.</span><span class="nf">rightKnobWidth</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span> <span class="o">.</span><span class="nf">rightKnobHeight</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span> <span class="o">.</span><span class="nf">rightKnobCorners</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span> <span class="p">}</span> <span class="p">}</span> <span class="p">}</span> </code></pre> <hr> <h3 id='change-knob-current-values-programmatically-only-code-uikit-code' class='heading'>Change knob current values programmatically (only <code>UIKit</code>)</h3> <p>You can also change the values of the slider knobs by calling this two API:</p> <ul> <li><code>func changeLeftKnob(value: CGFloat)</code> to change programmatically the left knob value</li> <li><code>func changeRightKnob(value: CGFloat)</code> to change programmatically the right knob value</li> </ul> <p>The <code>value</code> passed to these methods should be in the slider range values (see the next section of the <a href="https://www.fabrizioduroni.it/RangeUISlider/" title="RangeUISlider doc">documentation</a> to understand how to customize the slider range). Take a look at the <a href="https://github.com/chicio/RangeUISlider/blob/master/Demo/ChangeProgrammaticViewController.swift">example in the ChangeProgrammaticViewController contained in the demo project </a> to understand how to use these API. </p> <h3 id='customizable-properties' class='heading'>Customizable properties</h3> <p>This is the list of the <code><a href="Classes/RangeUISlider.html">RangeUISlider</a></code> customizable properties directly from Interface Builder/programmatically (<code>UIKit</code>) or by using the <code><a href="Structs/RangeSlider.html">RangeSlider</a></code> access modifiers (<code>SwiftUI</code>):</p> <ul> <li>identifier of the slider (Int )</li> <li>range minimum value (CGFloat)</li> <li>range maximum value (CGFloat)</li> <li>step increment value (CGFloat)</li> <li>default starting value left knob (CGFloat)</li> <li>default starting value right knob (CGFloat)</li> <li>range selected color</li> <li>range selected image (override range selected color property)</li> <li>range selected edge inset top, left, bottom, right (used only if range selected image has been setted)</li> <li>range selected gradient color 1 (override range selected color and image)</li> <li>range selected gradient color 1 (override range selected color and image)</li> <li>range selected gradient start point (used only if range selected gradients color has been choosed)</li> <li>range selected gradient end point (used only if range selected gradients color has been choosed)</li> <li>range not selected color</li> <li>range not selected image (override range not selected color property)</li> <li>range not selected edge inset top, left, bottom, right (used only if range not selected image has been setted)</li> <li>range not selected gradient color 1 (override range not selected color and image)</li> <li>range not selected gradient color 1 (override range not selected color and image)</li> <li>range not selected gradient start point (used only if range not selected gradients color has been choosed)</li> <li>range not selected gradient end point (used only if range not selected gradients color has been choosed)</li> <li>left knob width</li> <li>left knob height</li> <li>left knob corners radius</li> <li>left knob color</li> <li>left knob image (override color)</li> <li>left knob shadow opacity</li> <li>left knob shadow color</li> <li>left knob shadow offset</li> <li>left knob shadow radius</li> <li>left knob gradient color 1 (override left knob color and image)</li> <li>left knob gradient color 2 (override left knob color and image)</li> <li>left knob gradient start point (used only if left knob gradients color has been choosed)</li> <li>left knob gradient end point (used only if left knob gradients color has been choosed)</li> <li>left knob border width</li> <li>left knob border color</li> <li>right knob width</li> <li>right knob height</li> <li>right knob corners radius</li> <li>right knob color</li> <li>right knob image (override color)</li> <li>right knob shadow opacity</li> <li>right knob shadow color</li> <li>right knob shadow offset</li> <li>right knob shadow radius</li> <li>right knob gradient color 1 (override right knob color and image)</li> <li>right knob gradient color 2 (override right knob color and image)</li> <li>right knob gradient start point (used only if right knob gradients color has been choosed)</li> <li>right knob gradient end point (used only if right knob gradients color has been choosed)</li> <li>right knob border width</li> <li>right knob border color</li> <li>bar height</li> <li>bar leading distance from container view</li> <li>bar trailing distance from container view</li> <li>bar corners</li> <li>bar shadow opacity</li> <li>bar shadow color</li> <li>bar shadow offset</li> <li>bar shadow radius</li> <li>bar border width</li> <li>bar border color</li> <li>show knobs labels</li> <li>knobs label top position</li> <li>knobs label font size</li> <li>knobs label font color</li> <li>knobs label number of decimal</li> </ul> <hr> <h3 id='documentation' class='heading'>Documentation</h3> <p>You can find the complete api documentation on <a href="https://rangeuislider.fabrizioduroni.it" title="RangeUISlider doc">fabrizioduroni.it</a>.</p> <hr> <h3 id='examples' class='heading'>Examples</h3> <p>In the following screenshot you can find some examples of the level of customization that it is possible to reach. You can find this examples in the <a href="https://github.com/chicio/RangeUISlider/tree/master/RangeUISliderDemo">demo project</a>.</p> <p align="center"> <img width="320" height="632" src="https://raw.githubusercontent.com/chicio/RangeUISlider/master/Screenshots/rangeuislider-example.png"> </p> </section> </section> <section id="footer"> <p>2020 <a class="link" href="https://www.fabrizioduroni.it" target="_blank" rel="external noopener">Fabrizio Duroni</a></p> <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p> </section> </article> </div> </body> </html>
{ "content_hash": "28cad5458249abec9d8356125c098030", "timestamp": "", "source": "github", "line_count": 398, "max_line_length": 866, "avg_line_length": 77.29396984924622, "alnum_prop": 0.6669700614374411, "repo_name": "chicio/RangeUISlider", "id": "20b27a24845ce212d3c8e31facd707378143950f", "size": "30767", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/docsets/RangeUISlider.docset/Contents/Resources/Documents/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "359" }, { "name": "Ruby", "bytes": "1127" }, { "name": "Shell", "bytes": "459" }, { "name": "Swift", "bytes": "175469" } ], "symlink_target": "" }
import { Routes, RouterModule } from '@angular/router'; import { StripePaymentComponent } from './stripe-payment.component'; const routes: Routes = [ { path: '', component: StripePaymentComponent } ]; export const routing = RouterModule.forChild(routes);
{ "content_hash": "339b145313e949d1fdb9fb25f3b668e3", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 68, "avg_line_length": 27.3, "alnum_prop": 0.6996336996336996, "repo_name": "krasnyuk/e-liquid-MS", "id": "f9b264812f326c7fcce7c62ba2411d8794b8385c", "size": "273", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "Client/app/+examples/stripe-payment/stripe-payment.routes.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "155532" }, { "name": "CSS", "bytes": "938314" }, { "name": "CoffeeScript", "bytes": "87399" }, { "name": "HTML", "bytes": "2630239" }, { "name": "JavaScript", "bytes": "37939786" }, { "name": "Makefile", "bytes": "1369" }, { "name": "PHP", "bytes": "16614" }, { "name": "PowerShell", "bytes": "5018" }, { "name": "Python", "bytes": "20344" }, { "name": "Shell", "bytes": "1416" }, { "name": "TypeScript", "bytes": "340047" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>User agent detail - Mozilla/5.0 (Linux; U; Android 2.2.2; en-us ; LG-P990H Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1/UCBrowser/8.3.0.143/145/444</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="../circle.css" rel="stylesheet"> </head> <body> <div class="container"> <div class="section"> <h1 class="header center orange-text">User agent detail</h1> <div class="row center"> <h5 class="header light"> Mozilla/5.0 (Linux; U; Android 2.2.2; en-us ; LG-P990H Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1/UCBrowser/8.3.0.143/145/444 </h5> </div> </div> <div class="section"> <table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>UAParser<br /><small>v0.5.0.2</small><br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">LG</td><td>P990H</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59">Detail</a> <!-- Modal Structure --> <div id="modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">Array ( [user_agent_string] => Mozilla/5.0 (Linux; U; Android 2.2.2; en-us ; LG-P990H Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1/UCBrowser/8.3.0.143/145/444 [family] => LG-P990H [brand] => LG [model] => P990H ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td><td>Android 4.0</td><td>WebKit </td><td>Android 2.2</td><td style="border-left: 1px solid #555">LG</td><td>Optimus 2X</td><td>Mobile Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.013</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-47a9cd06-e213-4882-bc34-db6aed664223">Detail</a> <!-- Modal Structure --> <div id="modal-47a9cd06-e213-4882-bc34-db6aed664223" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>BrowscapFull result detail</h4> <p><pre><code class="php">stdClass Object ( [browser_name_regex] => /^mozilla\/5\.0 \(.*linux.*android.2\.2.*lg\-p990.* build\/.*\) applewebkit\/.* \(khtml,.*like gecko.*\) version\/4\.0.*safari.*$/ [browser_name_pattern] => mozilla/5.0 (*linux*android?2.2*lg-p990* build/*) applewebkit/* (khtml,*like gecko*) version/4.0*safari* [parent] => Android Browser 4.0 [comment] => Android Browser 4.0 [browser] => Android [browser_type] => Browser [browser_bits] => 32 [browser_maker] => Google Inc [browser_modus] => unknown [version] => 4.0 [majorver] => 4 [minorver] => 0 [platform] => Android [platform_version] => 2.2 [platform_description] => Android OS [platform_bits] => 32 [platform_maker] => Google Inc [alpha] => [beta] => [win16] => [win32] => [win64] => [frames] => 1 [iframes] => 1 [tables] => 1 [cookies] => 1 [backgroundsounds] => [javascript] => 1 [vbscript] => [javaapplets] => 1 [activexcontrols] => [ismobiledevice] => 1 [istablet] => [issyndicationreader] => [crawler] => [isfake] => [isanonymized] => [ismodified] => [cssversion] => 3 [aolversion] => 0 [device_name] => Optimus 2X [device_maker] => LG [device_type] => Mobile Phone [device_pointing_method] => unknown [device_code_name] => P990 [device_brand_name] => LG [renderingengine_name] => WebKit [renderingengine_version] => unknown [renderingengine_description] => For Google Chrome, iOS (including both mobile Safari, WebViews within third-party apps, and web clips), Safari, Arora, Midori, OmniWeb, Shiira, iCab since version 4, Web, SRWare Iron, Rekonq, and in Maxthon 3. [renderingengine_maker] => Apple Inc ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>BrowscapLite<br /><small>6014</small><br /></td><td>Android 4.0</td><td><i class="material-icons">close</i></td><td>Android </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Phone</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.006</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-42bb56ba-b834-47c5-bea0-c0270e9ab371">Detail</a> <!-- Modal Structure --> <div id="modal-42bb56ba-b834-47c5-bea0-c0270e9ab371" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>BrowscapLite result detail</h4> <p><pre><code class="php">stdClass Object ( [browser_name_regex] => /^mozilla\/5\.0 \(.*linux.*android.* build\/.*\).*applewebkit\/.*\(.*khtml,.*like gecko.*\).*version\/4\.0.*safari.*$/ [browser_name_pattern] => mozilla/5.0 (*linux*android* build/*)*applewebkit/*(*khtml,*like gecko*)*version/4.0*safari* [parent] => Android Browser 4.0 [comment] => Android Browser 4.0 [browser] => Android [browser_type] => unknown [browser_bits] => 0 [browser_maker] => unknown [browser_modus] => unknown [version] => 4.0 [majorver] => 0 [minorver] => 0 [platform] => Android [platform_version] => unknown [platform_description] => unknown [platform_bits] => 0 [platform_maker] => unknown [alpha] => false [beta] => false [win16] => false [win32] => false [win64] => false [frames] => false [iframes] => false [tables] => false [cookies] => false [backgroundsounds] => false [javascript] => false [vbscript] => false [javaapplets] => false [activexcontrols] => false [ismobiledevice] => 1 [istablet] => [issyndicationreader] => false [crawler] => false [isfake] => false [isanonymized] => false [ismodified] => false [cssversion] => 0 [aolversion] => 0 [device_name] => unknown [device_maker] => unknown [device_type] => Mobile Phone [device_pointing_method] => unknown [device_code_name] => unknown [device_brand_name] => unknown [renderingengine_name] => unknown [renderingengine_version] => unknown [renderingengine_description] => unknown [renderingengine_maker] => unknown ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td><td>UC Browser 8.3</td><td><i class="material-icons">close</i></td><td>Android </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.02</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68">Detail</a> <!-- Modal Structure --> <div id="modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>BrowscapPhp result detail</h4> <p><pre><code class="php">stdClass Object ( [browser_name_regex] => /^mozilla\/5\.0 \(.*linux.*android.*\) applewebkit\/.* \(khtml,.*like gecko.*\) version\/.*safari\/.*ucbrowser\/8\.3.*$/ [browser_name_pattern] => mozilla/5.0 (*linux*android*) applewebkit/* (khtml,*like gecko*) version/*safari/*ucbrowser/8.3* [parent] => UC Browser 8.3 [comment] => UC Browser 8.3 [browser] => UC Browser [browser_type] => unknown [browser_bits] => 0 [browser_maker] => UCWeb Inc. [browser_modus] => unknown [version] => 8.3 [majorver] => 8 [minorver] => 3 [platform] => Android [platform_version] => unknown [platform_description] => unknown [platform_bits] => 0 [platform_maker] => unknown [alpha] => false [beta] => false [win16] => false [win32] => false [win64] => false [frames] => false [iframes] => false [tables] => false [cookies] => false [backgroundsounds] => false [javascript] => false [vbscript] => false [javaapplets] => false [activexcontrols] => false [ismobiledevice] => 1 [istablet] => [issyndicationreader] => false [crawler] => [isfake] => false [isanonymized] => false [ismodified] => false [cssversion] => 0 [aolversion] => 0 [device_name] => unknown [device_maker] => unknown [device_type] => Mobile Phone [device_pointing_method] => touchscreen [device_code_name] => unknown [device_brand_name] => unknown [renderingengine_name] => unknown [renderingengine_version] => unknown [renderingengine_description] => unknown [renderingengine_maker] => unknown ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>DonatjUAParser<br /><small>v0.5.1</small><br /></td><td>Android Browser 4.0</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050">Detail</a> <!-- Modal Structure --> <div id="modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>DonatjUAParser result detail</h4> <p><pre><code class="php">Array ( [platform] => Android [browser] => Android Browser [version] => 4.0 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>JenssegersAgent<br /><small>v2.3.3</small><br /></td><td>Safari 4.0</td><td><i class="material-icons">close</i></td><td>AndroidOS 2.2.2</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51">Detail</a> <!-- Modal Structure --> <div id="modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>JenssegersAgent result detail</h4> <p><pre><code class="php">Array ( [browserName] => Safari [browserVersion] => 4.0 [osName] => AndroidOS [osVersion] => 2.2.2 [deviceModel] => WebKit [isMobile] => 1 [isRobot] => [botName] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>NeutrinoApiCom<br /><small></small><br /></td><td>Android Webkit 4.0</td><td><i class="material-icons">close</i></td><td>Android 2.2.2</td><td style="border-left: 1px solid #555">LG</td><td>Optimus 2X Speed</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.29602</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b">Detail</a> <!-- Modal Structure --> <div id="modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>NeutrinoApiCom result detail</h4> <p><pre><code class="php">stdClass Object ( [mobile_screen_height] => 480 [is_mobile] => 1 [type] => mobile-browser [mobile_brand] => LG [mobile_model] => Optimus 2X Speed [version] => 4.0 [is_android] => 1 [browser_name] => Android Webkit [operating_system_family] => Android [operating_system_version] => 2.2.2 [is_ios] => [producer] => Google Inc. [operating_system] => Android 2.2.x Froyo [mobile_screen_width] => 320 [mobile_browser] => Android Webkit ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>PiwikDeviceDetector<br /><small>3.6.1</small><br /></td><td>UC Browser 8.3</td><td>WebKit </td><td>Android 2.2</td><td style="border-left: 1px solid #555">LG</td><td>P990H</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.002</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-4a941d34-a8d3-4914-9724-346f60ad7046">Detail</a> <!-- Modal Structure --> <div id="modal-4a941d34-a8d3-4914-9724-346f60ad7046" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>PiwikDeviceDetector result detail</h4> <p><pre><code class="php">Array ( [client] => Array ( [type] => browser [name] => UC Browser [short_name] => UC [version] => 8.3 [engine] => WebKit ) [operatingSystem] => Array ( [name] => Android [short_name] => AND [version] => 2.2 [platform] => ) [device] => Array ( [brand] => LG [brandName] => LG [model] => P990H [device] => 1 [deviceName] => smartphone ) [bot] => [extra] => Array ( [isBot] => [isBrowser] => 1 [isFeedReader] => [isMobileApp] => [isPIM] => [isLibrary] => [isMediaPlayer] => [isCamera] => [isCarBrowser] => [isConsole] => [isFeaturePhone] => [isPhablet] => [isPortableMediaPlayer] => [isSmartDisplay] => [isSmartphone] => 1 [isTablet] => [isTV] => [isDesktop] => [isMobile] => 1 [isTouchEnabled] => ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.1</small><br /></td><td>Navigator 4.0</td><td><i class="material-icons">close</i></td><td>Android 2.2.2</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-ec1cd248-02b0-457e-8a9d-35bb99af008c">Detail</a> <!-- Modal Structure --> <div id="modal-ec1cd248-02b0-457e-8a9d-35bb99af008c" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>SinergiBrowserDetector result detail</h4> <p><pre><code class="php">Array ( [browser] => Sinergi\BrowserDetector\Browser Object ( [userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; U; Android 2.2.2; en-us ; LG-P990H Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1/UCBrowser/8.3.0.143/145/444 ) [name:Sinergi\BrowserDetector\Browser:private] => Navigator [version:Sinergi\BrowserDetector\Browser:private] => 4.0 [isRobot:Sinergi\BrowserDetector\Browser:private] => [isChromeFrame:Sinergi\BrowserDetector\Browser:private] => [isFacebookWebView:Sinergi\BrowserDetector\Browser:private] => [isCompatibilityMode:Sinergi\BrowserDetector\Browser:private] => ) [operatingSystem] => Sinergi\BrowserDetector\Os Object ( [name:Sinergi\BrowserDetector\Os:private] => Android [version:Sinergi\BrowserDetector\Os:private] => 2.2.2 [isMobile:Sinergi\BrowserDetector\Os:private] => 1 [userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; U; Android 2.2.2; en-us ; LG-P990H Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1/UCBrowser/8.3.0.143/145/444 ) ) [device] => Sinergi\BrowserDetector\Device Object ( [name:Sinergi\BrowserDetector\Device:private] => unknown [userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; U; Android 2.2.2; en-us ; LG-P990H Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1/UCBrowser/8.3.0.143/145/444 ) ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td>UC Browser 8.3.0</td><td><i class="material-icons">close</i></td><td>Android 2.2.2</td><td style="border-left: 1px solid #555">LG</td><td>P990H</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-3160e405-8a8f-46dd-8f47-5115f06462d2">Detail</a> <!-- Modal Structure --> <div id="modal-3160e405-8a8f-46dd-8f47-5115f06462d2" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">UAParser\Result\Client Object ( [ua] => UAParser\Result\UserAgent Object ( [major] => 8 [minor] => 3 [patch] => 0 [family] => UC Browser ) [os] => UAParser\Result\OperatingSystem Object ( [major] => 2 [minor] => 2 [patch] => 2 [patchMinor] => [family] => Android ) [device] => UAParser\Result\Device Object ( [brand] => LG [model] => P990H [family] => LG-P990H ) [originalUserAgent] => Mozilla/5.0 (Linux; U; Android 2.2.2; en-us ; LG-P990H Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1/UCBrowser/8.3.0.143/145/444 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UserAgentApiCom<br /><small></small><br /></td><td>Safari 533.1</td><td>WebKit 533.1</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.15201</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6">Detail</a> <!-- Modal Structure --> <div id="modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UserAgentApiCom result detail</h4> <p><pre><code class="php">stdClass Object ( [platform_name] => Android [platform_version] => 2.2.2 [platform_type] => Mobile [browser_name] => Safari [browser_version] => 533.1 [engine_name] => WebKit [engine_version] => 533.1 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UserAgentStringCom<br /><small></small><br /></td><td>Android Webkit Browser </td><td><i class="material-icons">close</i></td><td>Android 2.2.2</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.078</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-08a9ddfb-838f-48d7-9ede-1d132306b2ee">Detail</a> <!-- Modal Structure --> <div id="modal-08a9ddfb-838f-48d7-9ede-1d132306b2ee" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UserAgentStringCom result detail</h4> <p><pre><code class="php">stdClass Object ( [agent_type] => Browser [agent_name] => Android Webkit Browser [agent_version] => -- [os_type] => Android [os_name] => Android [os_versionName] => [os_versionNumber] => 2.2.2 [os_producer] => [os_producerURL] => [linux_distibution] => Null [agent_language] => English - United States [agent_languageTag] => en-us ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td><td>UC Browser 8.3.0.143</td><td>WebKit 533.1</td><td>Android 2.2.2</td><td style="border-left: 1px solid #555">LG</td><td>LGP990H</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.24601</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c">Detail</a> <!-- Modal Structure --> <div id="modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhatIsMyBrowserCom result detail</h4> <p><pre><code class="php">stdClass Object ( [operating_system_name] => Android [simple_sub_description_string] => [simple_browser_string] => UC Browser 8.3 on Android (Froyo) [browser_version] => 8.3 [extra_info] => Array ( ) [operating_platform] => LGP990H [extra_info_table] => stdClass Object ( [System Build] => FRG83G ) [layout_engine_name] => WebKit [detected_addons] => Array ( ) [operating_system_flavour_code] => [hardware_architecture] => [operating_system_flavour] => [operating_system_frameworks] => Array ( ) [browser_name_code] => uc-browser [operating_system_version] => Froyo [simple_operating_platform_string] => LGP990H [is_abusive] => [layout_engine_version] => 533.1 [browser_capabilities] => Array ( ) [operating_platform_vendor_name] => LG [operating_system] => Android (Froyo) [operating_system_version_full] => 2.2.2 [operating_platform_code] => LGP990H [browser_name] => UC Browser [operating_system_name_code] => android [user_agent] => Mozilla/5.0 (Linux; U; Android 2.2.2; en-us ; LG-P990H Build/FRG83G) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1/UCBrowser/8.3.0.143/145/444 [browser_version_full] => 8.3.0.143 [browser] => UC Browser 8.3 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhichBrowser<br /><small>v2.0.18</small><br /></td><td>UC Browser 8.3</td><td>Webkit 533.1</td><td>Android 2.2.2</td><td style="border-left: 1px solid #555">LG</td><td>Optimus 2X Speed</td><td>mobile:smart</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-083a336f-5d73-4505-84f3-c5fc9bb78652">Detail</a> <!-- Modal Structure --> <div id="modal-083a336f-5d73-4505-84f3-c5fc9bb78652" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhichBrowser result detail</h4> <p><pre><code class="php">Array ( [browser] => Array ( [name] => UC Browser [version] => 8.3 [type] => browser ) [engine] => Array ( [name] => Webkit [version] => 533.1 ) [os] => Array ( [name] => Android [version] => 2.2.2 ) [device] => Array ( [type] => mobile [subtype] => smart [manufacturer] => LG [model] => Optimus 2X Speed ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Woothee<br /><small>v1.2.0</small><br /></td><td>Safari 4.0</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>smartphone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9">Detail</a> <!-- Modal Structure --> <div id="modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Woothee result detail</h4> <p><pre><code class="php">Array ( [name] => Safari [vendor] => Apple [version] => 4.0 [category] => smartphone [os] => Android [os_version] => 2.2.2 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Wurfl<br /><small>1.7.1.0</small><br /></td><td>UC Browser 8.3.0</td><td><i class="material-icons">close</i></td><td>Android 2.2.2</td><td style="border-left: 1px solid #555"></td><td></td><td>Feature Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.016</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50">Detail</a> <!-- Modal Structure --> <div id="modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Wurfl result detail</h4> <p><pre><code class="php">Array ( [virtual] => Array ( [is_android] => true [is_ios] => false [is_windows_phone] => false [is_app] => false [is_full_desktop] => false [is_largescreen] => false [is_mobile] => true [is_robot] => false [is_smartphone] => false [is_touchscreen] => true [is_wml_preferred] => false [is_xhtmlmp_preferred] => false [is_html_preferred] => true [advertised_device_os] => Android [advertised_device_os_version] => 2.2.2 [advertised_browser] => UC Browser [advertised_browser_version] => 8.3.0 [complete_device_name] => Generic Android 2.0 [device_name] => Generic Android 2.0 [form_factor] => Feature Phone [is_phone] => true [is_app_webview] => false ) [all] => Array ( [brand_name] => Generic [model_name] => Android 2.0 [unique] => true [ununiqueness_handler] => [is_wireless_device] => true [device_claims_web_support] => true [has_qwerty_keyboard] => true [can_skip_aligned_link_row] => true [uaprof] => [uaprof2] => [uaprof3] => [nokia_series] => 0 [nokia_edition] => 0 [device_os] => Android [mobile_browser] => UCWeb [mobile_browser_version] => [device_os_version] => 2.0 [pointing_method] => touchscreen [release_date] => 2009_october [marketing_name] => [model_extra_info] => [nokia_feature_pack] => 0 [can_assign_phone_number] => true [is_tablet] => false [manufacturer_name] => [is_bot] => false [is_google_glass] => false [proportional_font] => false [built_in_back_button_support] => false [card_title_support] => true [softkey_support] => false [table_support] => true [numbered_menus] => false [menu_with_select_element_recommended] => false [menu_with_list_of_links_recommended] => true [icons_on_menu_items_support] => false [break_list_of_links_with_br_element_recommended] => true [access_key_support] => false [wrap_mode_support] => false [times_square_mode_support] => false [deck_prefetch_support] => false [elective_forms_recommended] => true [wizards_recommended] => false [image_as_link_support] => false [insert_br_element_after_widget_recommended] => false [wml_can_display_images_and_text_on_same_line] => false [wml_displays_image_in_center] => false [opwv_wml_extensions_support] => false [wml_make_phone_call_string] => wtai://wp/mc; [chtml_display_accesskey] => false [emoji] => false [chtml_can_display_images_and_text_on_same_line] => false [chtml_displays_image_in_center] => false [imode_region] => none [chtml_make_phone_call_string] => tel: [chtml_table_support] => false [xhtml_honors_bgcolor] => true [xhtml_supports_forms_in_table] => true [xhtml_support_wml2_namespace] => false [xhtml_autoexpand_select] => false [xhtml_select_as_dropdown] => false [xhtml_select_as_radiobutton] => false [xhtml_select_as_popup] => false [xhtml_display_accesskey] => false [xhtml_supports_invisible_text] => false [xhtml_supports_inline_input] => false [xhtml_supports_monospace_font] => false [xhtml_supports_table_for_layout] => true [xhtml_supports_css_cell_table_coloring] => true [xhtml_format_as_css_property] => false [xhtml_format_as_attribute] => false [xhtml_nowrap_mode] => false [xhtml_marquee_as_css_property] => false [xhtml_readable_background_color1] => #FFFFFF [xhtml_readable_background_color2] => #FFFFFF [xhtml_allows_disabled_form_elements] => true [xhtml_document_title_support] => true [xhtml_preferred_charset] => iso-8859-1 [opwv_xhtml_extensions_support] => false [xhtml_make_phone_call_string] => tel: [xhtmlmp_preferred_mime_type] => text/html [xhtml_table_support] => true [xhtml_send_sms_string] => sms: [xhtml_send_mms_string] => mms: [xhtml_file_upload] => not_supported [cookie_support] => true [accept_third_party_cookie] => true [xhtml_supports_iframe] => full [xhtml_avoid_accesskeys] => true [xhtml_can_embed_video] => play_and_stop [ajax_support_javascript] => true [ajax_manipulate_css] => true [ajax_support_getelementbyid] => true [ajax_support_inner_html] => true [ajax_xhr_type] => standard [ajax_manipulate_dom] => true [ajax_support_events] => true [ajax_support_event_listener] => true [ajax_preferred_geoloc_api] => w3c_api [xhtml_support_level] => 4 [preferred_markup] => html_web_4_0 [wml_1_1] => false [wml_1_2] => false [wml_1_3] => false [html_wi_w3_xhtmlbasic] => true [html_wi_oma_xhtmlmp_1_0] => true [html_wi_imode_html_1] => false [html_wi_imode_html_2] => false [html_wi_imode_html_3] => false [html_wi_imode_html_4] => false [html_wi_imode_html_5] => false [html_wi_imode_htmlx_1] => false [html_wi_imode_htmlx_1_1] => false [html_wi_imode_compact_generic] => false [html_web_3_2] => true [html_web_4_0] => true [voicexml] => false [multipart_support] => false [total_cache_disable_support] => false [time_to_live_support] => false [resolution_width] => 320 [resolution_height] => 480 [columns] => 60 [max_image_width] => 320 [max_image_height] => 400 [rows] => 40 [physical_screen_width] => 34 [physical_screen_height] => 50 [dual_orientation] => true [density_class] => 1.0 [wbmp] => true [bmp] => false [epoc_bmp] => false [gif_animated] => false [jpg] => true [png] => true [tiff] => false [transparent_png_alpha] => true [transparent_png_index] => true [svgt_1_1] => false [svgt_1_1_plus] => false [greyscale] => false [gif] => true [colors] => 65536 [webp_lossy_support] => false [webp_lossless_support] => false [post_method_support] => true [basic_authentication_support] => true [empty_option_value_support] => true [emptyok] => false [nokia_voice_call] => false [wta_voice_call] => false [wta_phonebook] => false [wta_misc] => false [wta_pdc] => false [https_support] => true [phone_id_provided] => false [max_data_rate] => 200 [wifi] => true [sdio] => false [vpn] => false [has_cellular_radio] => true [max_deck_size] => 1000000 [max_url_length_in_requests] => 256 [max_url_length_homepage] => 0 [max_url_length_bookmark] => 0 [max_url_length_cached_page] => 0 [max_no_of_connection_settings] => 0 [max_no_of_bookmarks] => 0 [max_length_of_username] => 0 [max_length_of_password] => 0 [max_object_size] => 0 [downloadfun_support] => false [directdownload_support] => true [inline_support] => false [oma_support] => true [ringtone] => false [ringtone_3gpp] => false [ringtone_midi_monophonic] => false [ringtone_midi_polyphonic] => false [ringtone_imelody] => false [ringtone_digiplug] => false [ringtone_compactmidi] => false [ringtone_mmf] => false [ringtone_rmf] => false [ringtone_xmf] => false [ringtone_amr] => false [ringtone_awb] => false [ringtone_aac] => false [ringtone_wav] => false [ringtone_mp3] => false [ringtone_spmidi] => false [ringtone_qcelp] => false [ringtone_voices] => 1 [ringtone_df_size_limit] => 0 [ringtone_directdownload_size_limit] => 0 [ringtone_inline_size_limit] => 0 [ringtone_oma_size_limit] => 0 [wallpaper] => false [wallpaper_max_width] => 0 [wallpaper_max_height] => 0 [wallpaper_preferred_width] => 0 [wallpaper_preferred_height] => 0 [wallpaper_resize] => none [wallpaper_wbmp] => false [wallpaper_bmp] => false [wallpaper_gif] => false [wallpaper_jpg] => false [wallpaper_png] => false [wallpaper_tiff] => false [wallpaper_greyscale] => false [wallpaper_colors] => 2 [wallpaper_df_size_limit] => 0 [wallpaper_directdownload_size_limit] => 0 [wallpaper_inline_size_limit] => 0 [wallpaper_oma_size_limit] => 0 [screensaver] => false [screensaver_max_width] => 0 [screensaver_max_height] => 0 [screensaver_preferred_width] => 0 [screensaver_preferred_height] => 0 [screensaver_resize] => none [screensaver_wbmp] => false [screensaver_bmp] => false [screensaver_gif] => false [screensaver_jpg] => false [screensaver_png] => false [screensaver_greyscale] => false [screensaver_colors] => 2 [screensaver_df_size_limit] => 0 [screensaver_directdownload_size_limit] => 0 [screensaver_inline_size_limit] => 0 [screensaver_oma_size_limit] => 0 [picture] => false [picture_max_width] => 0 [picture_max_height] => 0 [picture_preferred_width] => 0 [picture_preferred_height] => 0 [picture_resize] => none [picture_wbmp] => false [picture_bmp] => false [picture_gif] => false [picture_jpg] => false [picture_png] => false [picture_greyscale] => false [picture_colors] => 2 [picture_df_size_limit] => 0 [picture_directdownload_size_limit] => 0 [picture_inline_size_limit] => 0 [picture_oma_size_limit] => 0 [video] => false [oma_v_1_0_forwardlock] => false [oma_v_1_0_combined_delivery] => false [oma_v_1_0_separate_delivery] => false [streaming_video] => true [streaming_3gpp] => true [streaming_mp4] => true [streaming_mov] => false [streaming_video_size_limit] => 0 [streaming_real_media] => none [streaming_flv] => false [streaming_3g2] => false [streaming_vcodec_h263_0] => 10 [streaming_vcodec_h263_3] => -1 [streaming_vcodec_mpeg4_sp] => 2 [streaming_vcodec_mpeg4_asp] => -1 [streaming_vcodec_h264_bp] => 3.0 [streaming_acodec_amr] => nb [streaming_acodec_aac] => lc [streaming_wmv] => none [streaming_preferred_protocol] => rtsp [streaming_preferred_http_protocol] => progressive_download [wap_push_support] => false [connectionless_service_indication] => false [connectionless_service_load] => false [connectionless_cache_operation] => false [connectionoriented_unconfirmed_service_indication] => false [connectionoriented_unconfirmed_service_load] => false [connectionoriented_unconfirmed_cache_operation] => false [connectionoriented_confirmed_service_indication] => false [connectionoriented_confirmed_service_load] => false [connectionoriented_confirmed_cache_operation] => false [utf8_support] => true [ascii_support] => false [iso8859_support] => false [expiration_date] => false [j2me_cldc_1_0] => false [j2me_cldc_1_1] => false [j2me_midp_1_0] => false [j2me_midp_2_0] => false [doja_1_0] => false [doja_1_5] => false [doja_2_0] => false [doja_2_1] => false [doja_2_2] => false [doja_3_0] => false [doja_3_5] => false [doja_4_0] => false [j2me_jtwi] => false [j2me_mmapi_1_0] => false [j2me_mmapi_1_1] => false [j2me_wmapi_1_0] => false [j2me_wmapi_1_1] => false [j2me_wmapi_2_0] => false [j2me_btapi] => false [j2me_3dapi] => false [j2me_locapi] => false [j2me_nokia_ui] => false [j2me_motorola_lwt] => false [j2me_siemens_color_game] => false [j2me_siemens_extension] => false [j2me_heap_size] => 0 [j2me_max_jar_size] => 0 [j2me_storage_size] => 0 [j2me_max_record_store_size] => 0 [j2me_screen_width] => 0 [j2me_screen_height] => 0 [j2me_canvas_width] => 0 [j2me_canvas_height] => 0 [j2me_bits_per_pixel] => 0 [j2me_audio_capture_enabled] => false [j2me_video_capture_enabled] => false [j2me_photo_capture_enabled] => false [j2me_capture_image_formats] => none [j2me_http] => false [j2me_https] => false [j2me_socket] => false [j2me_udp] => false [j2me_serial] => false [j2me_gif] => false [j2me_gif89a] => false [j2me_jpg] => false [j2me_png] => false [j2me_bmp] => false [j2me_bmp3] => false [j2me_wbmp] => false [j2me_midi] => false [j2me_wav] => false [j2me_amr] => false [j2me_mp3] => false [j2me_mp4] => false [j2me_imelody] => false [j2me_rmf] => false [j2me_au] => false [j2me_aac] => false [j2me_realaudio] => false [j2me_xmf] => false [j2me_wma] => false [j2me_3gpp] => false [j2me_h263] => false [j2me_svgt] => false [j2me_mpeg4] => false [j2me_realvideo] => false [j2me_real8] => false [j2me_realmedia] => false [j2me_left_softkey_code] => 0 [j2me_right_softkey_code] => 0 [j2me_middle_softkey_code] => 0 [j2me_select_key_code] => 0 [j2me_return_key_code] => 0 [j2me_clear_key_code] => 0 [j2me_datefield_no_accepts_null_date] => false [j2me_datefield_broken] => false [receiver] => false [sender] => false [mms_max_size] => 0 [mms_max_height] => 0 [mms_max_width] => 0 [built_in_recorder] => false [built_in_camera] => true [mms_jpeg_baseline] => false [mms_jpeg_progressive] => false [mms_gif_static] => false [mms_gif_animated] => false [mms_png] => false [mms_bmp] => false [mms_wbmp] => false [mms_amr] => false [mms_wav] => false [mms_midi_monophonic] => false [mms_midi_polyphonic] => false [mms_midi_polyphonic_voices] => 0 [mms_spmidi] => false [mms_mmf] => false [mms_mp3] => false [mms_evrc] => false [mms_qcelp] => false [mms_ota_bitmap] => false [mms_nokia_wallpaper] => false [mms_nokia_operatorlogo] => false [mms_nokia_3dscreensaver] => false [mms_nokia_ringingtone] => false [mms_rmf] => false [mms_xmf] => false [mms_symbian_install] => false [mms_jar] => false [mms_jad] => false [mms_vcard] => false [mms_vcalendar] => false [mms_wml] => false [mms_wbxml] => false [mms_wmlc] => false [mms_video] => false [mms_mp4] => false [mms_3gpp] => false [mms_3gpp2] => false [mms_max_frame_rate] => 0 [nokiaring] => false [picturemessage] => false [operatorlogo] => false [largeoperatorlogo] => false [callericon] => false [nokiavcard] => false [nokiavcal] => false [sckl_ringtone] => false [sckl_operatorlogo] => false [sckl_groupgraphic] => false [sckl_vcard] => false [sckl_vcalendar] => false [text_imelody] => false [ems] => false [ems_variablesizedpictures] => false [ems_imelody] => false [ems_odi] => false [ems_upi] => false [ems_version] => 0 [siemens_ota] => false [siemens_logo_width] => 101 [siemens_logo_height] => 29 [siemens_screensaver_width] => 101 [siemens_screensaver_height] => 50 [gprtf] => false [sagem_v1] => false [sagem_v2] => false [panasonic] => false [sms_enabled] => true [wav] => false [mmf] => false [smf] => false [mld] => false [midi_monophonic] => false [midi_polyphonic] => false [sp_midi] => false [rmf] => false [xmf] => false [compactmidi] => false [digiplug] => false [nokia_ringtone] => false [imelody] => false [au] => false [amr] => false [awb] => false [aac] => true [mp3] => true [voices] => 1 [qcelp] => false [evrc] => false [flash_lite_version] => [fl_wallpaper] => false [fl_screensaver] => false [fl_standalone] => false [fl_browser] => false [fl_sub_lcd] => false [full_flash_support] => false [css_supports_width_as_percentage] => true [css_border_image] => webkit [css_rounded_corners] => webkit [css_gradient] => none [css_spriting] => true [css_gradient_linear] => none [is_transcoder] => false [transcoder_ua_header] => user-agent [rss_support] => false [pdf_support] => true [progressive_download] => true [playback_vcodec_h263_0] => 10 [playback_vcodec_h263_3] => -1 [playback_vcodec_mpeg4_sp] => 0 [playback_vcodec_mpeg4_asp] => -1 [playback_vcodec_h264_bp] => -1 [playback_real_media] => none [playback_3gpp] => true [playback_3g2] => false [playback_mp4] => true [playback_mov] => false [playback_acodec_amr] => nb [playback_acodec_aac] => none [playback_df_size_limit] => 0 [playback_directdownload_size_limit] => 0 [playback_inline_size_limit] => 0 [playback_oma_size_limit] => 0 [playback_acodec_qcelp] => false [playback_wmv] => none [hinted_progressive_download] => true [html_preferred_dtd] => html4 [viewport_supported] => true [viewport_width] => device_width_token [viewport_userscalable] => no [viewport_initial_scale] => [viewport_maximum_scale] => [viewport_minimum_scale] => [mobileoptimized] => false [handheldfriendly] => false [canvas_support] => full [image_inlining] => true [is_smarttv] => false [is_console] => false [nfc_support] => false [ux_full_desktop] => false [jqm_grade] => C [is_sencha_touch_ok] => false ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Zsxsoft<br /><small>1.3</small><br /></td><td>UC Browser 8.3.0.143</td><td><i class="material-icons">close</i></td><td>Android 2.2.2</td><td style="border-left: 1px solid #555">LG</td><td>P990H</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-5d43e024-b46c-44f6-8914-529b05569bc2">Detail</a> <!-- Modal Structure --> <div id="modal-5d43e024-b46c-44f6-8914-529b05569bc2" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Zsxsoft result detail</h4> <p><pre><code class="php">Array ( [browser] => Array ( [link] => http://www.uc.cn/ [title] => UC Browser 8.3.0.143 [code] => ucbrowser [version] => 8.3.0.143 [name] => UC Browser [image] => img/16/browser/ucbrowser.png ) [os] => Array ( [link] => http://www.android.com/ [name] => Android [version] => 2.2.2 [code] => android [x64] => [title] => Android 2.2.2 [type] => os [dir] => os [image] => img/16/os/android.png ) [device] => Array ( [link] => http://www.lgmobile.com [title] => LG P990H [model] => P990H [brand] => LG [code] => lg [dir] => device [type] => device [image] => img/16/device/lg.png ) [platform] => Array ( [link] => http://www.lgmobile.com [title] => LG P990H [model] => P990H [brand] => LG [code] => lg [dir] => device [type] => device [image] => img/16/device/lg.png ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr></table> </div> <div class="section"> <h1 class="header center orange-text">About this comparison</h1> <div class="row center"> <h5 class="header light"> The primary goal of this project is simple<br /> I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br /> <br /> The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br /> <br /> You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br /> <br /> The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a> </h5> </div> </div> <div class="card"> <div class="card-content"> Comparison created <i>2016-05-10 08:04:06</i> | by <a href="https://github.com/ThaDafinser">ThaDafinser</a> </div> </div> </div> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script> <script> $(document).ready(function(){ // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered $('.modal-trigger').leanModal(); }); </script> </body> </html>
{ "content_hash": "4a8bdc730ba3fb8e05e0ffb76285e4db", "timestamp": "", "source": "github", "line_count": 1372, "max_line_length": 955, "avg_line_length": 41.32798833819242, "alnum_prop": 0.5468942894430532, "repo_name": "ThaDafinser/UserAgentParserComparison", "id": "ba23d679d75f42fdf8815f3ba31e7d7353d23d4e", "size": "56703", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "v5/user-agent-detail/a1/8c/a18c219f-3507-4d30-9eb7-303dcd1c140d.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2060859160" } ], "symlink_target": "" }
__author__ = 'frankhe' import lasagne import numpy as np import theano import theano.tensor as T from updates import deepmind_rmsprop class DeepQLearner: def __init__(self, input_width, input_height, num_actions, num_frames, discount, learning_rate, rho, rms_epsilon, momentum, clip_delta, freeze_interval, batch_size, network_type, update_rule, batch_accumulator, rng, input_scale=255.0, double=False, transition_length=4): if double: print 'USING DOUBLE DQN' self.input_width = input_width self.input_height = input_height self.num_actions = num_actions self.num_frames = num_frames self.batch_size = batch_size self.discount = discount self.rho = rho self.lr = learning_rate self.rms_epsilon = rms_epsilon self.momentum = momentum self.clip_delta = clip_delta self.freeze_interval = freeze_interval self.rng = rng lasagne.random.set_rng(self.rng) self.update_counter = 0 self.l_out = self.build_network(network_type, input_width, input_height, num_actions, num_frames, batch_size) if self.freeze_interval > 0: self.next_l_out = self.build_network(network_type, input_width, input_height, num_actions, num_frames, batch_size) self.reset_q_hat() states = T.tensor4('states_t') actions = T.icol('actions_t') target = T.col('evaluation_t') self.states_shared = theano.shared( np.zeros((batch_size, num_frames, input_height, input_width), dtype=theano.config.floatX)) self.actions_shared = theano.shared( np.zeros((batch_size, 1), dtype='int32'), broadcastable=(False, True)) self.target_shared = theano.shared( np.zeros((batch_size, 1), dtype=theano.config.floatX), broadcastable=(False, True)) self.states_transition_shared = theano.shared( np.zeros((batch_size, transition_length * 2, num_frames, input_height, input_width), dtype=theano.config.floatX)) self.states_one_shared = theano.shared( np.zeros((num_frames, input_height, input_width), dtype=theano.config.floatX)) q_vals = lasagne.layers.get_output(self.l_out, states / input_scale) """get Q(s) batch_size = 1 """ q1_givens = { states: self.states_one_shared.reshape((1, self.num_frames, self.input_height, self.input_width)) } self._q1_vals = theano.function([], q_vals[0], givens=q1_givens) """get Q(s) batch_size = batch size """ q_batch_givens = { states: self.states_shared.reshape((self.batch_size, self.num_frames, self.input_height, self.input_width)) } self._q_batch_vals = theano.function([], q_vals, givens=q_batch_givens) action_mask = T.eq(T.arange(num_actions).reshape((1, -1)), actions.reshape((-1, 1))).astype(theano.config.floatX) q_s_a = (q_vals * action_mask).sum(axis=1).reshape((-1, 1)) """ get Q(s,a) batch_size = batch size """ q_s_a_givens = { states: self.states_shared.reshape((self.batch_size, self.num_frames, self.input_height, self.input_width)), actions: self.actions_shared } self._q_s_a_vals = theano.function([], q_s_a, givens=q_s_a_givens) if self.freeze_interval > 0: q_target_vals = lasagne.layers.get_output(self.next_l_out, states / input_scale) else: q_target_vals = lasagne.layers.get_output(self.l_out, states / input_scale) q_target_vals = theano.gradient.disconnected_grad(q_target_vals) if not double: q_target = T.max(q_target_vals, axis=1) else: greedy_actions = T.argmax(q_vals, axis=1) q_target_mask = T.eq(T.arange(num_actions).reshape((1, -1)), greedy_actions.reshape((-1, 1)).astype(theano.config.floatX)) q_target = (q_target_vals * q_target_mask).sum(axis=1).reshape((-1, 1)) """get Q target Q'(s,a') for a batch of transitions batch size = batch_size * transition length""" q_target_transition_givens = { states: self.states_transition_shared.reshape( (batch_size * transition_length * 2, self.num_frames, self.input_height, self.input_width)) } self._q_target = theano.function([], q_target.reshape((batch_size, transition_length * 2)), givens=q_target_transition_givens) """get Q target_vals Q'(s) for a batch of transitions batch size = batch_size * transition length""" self._q_target_vals = theano.function([], q_target_vals.reshape( (batch_size, transition_length * 2, num_actions)), givens=q_target_transition_givens) diff = q_s_a - target if self.clip_delta > 0: # If we simply take the squared clipped diff as our loss, # then the gradient will be zero whenever the diff exceeds # the clip bounds. To avoid this, we extend the loss # linearly past the clip point to keep the gradient constant # in that regime. # # This is equivalent to declaring d loss/d q_vals to be # equal to the clipped diff, then backpropagating from # there, which is what the DeepMind implementation does. quadratic_part = T.minimum(abs(diff), self.clip_delta) linear_part = abs(diff) - quadratic_part loss = 0.5 * quadratic_part ** 2 + self.clip_delta * linear_part else: loss = 0.5 * diff ** 2 if batch_accumulator == 'sum': loss = T.sum(loss) elif batch_accumulator == 'mean': loss = T.mean(loss) else: raise ValueError("Bad accumulator: {}".format(batch_accumulator)) params = lasagne.layers.helper.get_all_params(self.l_out) if update_rule == 'deepmind_rmsprop': updates = deepmind_rmsprop(loss, params, self.lr, self.rho, self.rms_epsilon) elif update_rule == 'rmsprop': updates = lasagne.updates.rmsprop(loss, params, self.lr, self.rho, self.rms_epsilon) elif update_rule == 'sgd': updates = lasagne.updates.sgd(loss, params, self.lr) else: raise ValueError("Unrecognized update: {}".format(update_rule)) if self.momentum > 0: updates = lasagne.updates.apply_momentum(updates, None, self.momentum) """Q(s,a) target train()""" train_givens = { states: self.states_shared, actions: self.actions_shared, target: self.target_shared } self._train = theano.function([], [loss], updates=updates, givens=train_givens, on_unused_input='warn') self._train2 = theano.function([], [loss], updates=updates, givens=train_givens, on_unused_input='warn') def q_vals(self, single_state): self.states_one_shared.set_value(single_state) return self._q1_vals() def q_batch_vals(self, states): self.states_shared.set_value(states) return self._q_batch_vals() def q_s_a_batch_vals(self, states, actions): self.states_shared.set_value(states) self.actions_shared.set_value(actions) return self._q_s_a_vals() def q_target(self, batch_transition_states): self.states_transition_shared.set_value(batch_transition_states) return self._q_target() def q_target_vals(self, batch_transition_states): self.states_transition_shared.set_value(batch_transition_states) return self._q_target_vals() def train(self, states, actions, target): self.states_shared.set_value(states) self.actions_shared.set_value(actions) self.target_shared.set_value(target) if self.freeze_interval > 0 and self.update_counter % self.freeze_interval == 0: self.reset_q_hat() loss = self._train() self.update_counter += 1 return np.sqrt(loss) def train2(self, states, actions, target): self.states_shared.set_value(states) self.actions_shared.set_value(actions) self.target_shared.set_value(target) if self.freeze_interval > 0 and self.update_counter % self.freeze_interval == 0: self.reset_q_hat() loss = self._train2() return np.sqrt(loss) def build_network(self, network_type, input_width, input_height, output_dim, num_frames, batch_size): if network_type == "nature_cuda": return self.build_nature_network(input_width, input_height, output_dim, num_frames, batch_size) if network_type == "nature_dnn": return self.build_nature_network_dnn(input_width, input_height, output_dim, num_frames, batch_size) elif network_type == "linear": return self.build_linear_network(input_width, input_height, output_dim, num_frames, batch_size) else: raise ValueError("Unrecognized network: {}".format(network_type)) def choose_action(self, state, epsilon): if self.rng.rand() < epsilon: return self.rng.randint(0, self.num_actions) q_vals = self.q_vals(state) return np.argmax(q_vals) def reset_q_hat(self): all_params = lasagne.layers.helper.get_all_param_values(self.l_out) lasagne.layers.helper.set_all_param_values(self.next_l_out, all_params) def build_nature_network(self, input_width, input_height, output_dim, num_frames, batch_size): """ Build a large network consistent with the DeepMind Nature paper. """ from lasagne.layers import cuda_convnet l_in = lasagne.layers.InputLayer( shape=(None, num_frames, input_width, input_height) ) l_conv1 = cuda_convnet.Conv2DCCLayer( l_in, num_filters=32, filter_size=(8, 8), stride=(4, 4), nonlinearity=lasagne.nonlinearities.rectify, W=lasagne.init.HeUniform(), # Defaults to Glorot b=lasagne.init.Constant(.1), dimshuffle=True ) l_conv2 = cuda_convnet.Conv2DCCLayer( l_conv1, num_filters=64, filter_size=(4, 4), stride=(2, 2), nonlinearity=lasagne.nonlinearities.rectify, W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1), dimshuffle=True ) l_conv3 = cuda_convnet.Conv2DCCLayer( l_conv2, num_filters=64, filter_size=(3, 3), stride=(1, 1), nonlinearity=lasagne.nonlinearities.rectify, W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1), dimshuffle=True ) l_hidden1 = lasagne.layers.DenseLayer( l_conv3, num_units=512, nonlinearity=lasagne.nonlinearities.rectify, W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1) ) l_out = lasagne.layers.DenseLayer( l_hidden1, num_units=output_dim, nonlinearity=None, W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1) ) return l_out def build_nature_network_dnn(self, input_width, input_height, output_dim, num_frames, batch_size): """ Build a large network consistent with the DeepMind Nature paper. """ from lasagne.layers import dnn l_in = lasagne.layers.InputLayer( shape=(None, num_frames, input_width, input_height) ) l_conv1 = dnn.Conv2DDNNLayer( l_in, num_filters=32, filter_size=(8, 8), stride=(4, 4), nonlinearity=lasagne.nonlinearities.rectify, W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1) ) l_conv2 = dnn.Conv2DDNNLayer( l_conv1, num_filters=64, filter_size=(4, 4), stride=(2, 2), nonlinearity=lasagne.nonlinearities.rectify, W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1) ) l_conv3 = dnn.Conv2DDNNLayer( l_conv2, num_filters=64, filter_size=(3, 3), stride=(1, 1), nonlinearity=lasagne.nonlinearities.rectify, W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1) ) l_hidden1 = lasagne.layers.DenseLayer( l_conv3, num_units=512, nonlinearity=lasagne.nonlinearities.rectify, W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1) ) l_out = lasagne.layers.DenseLayer( l_hidden1, num_units=output_dim, nonlinearity=None, W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1) ) return l_out def build_linear_network(self, input_width, input_height, output_dim, num_frames, batch_size): """ Build a simple linear learner. Useful for creating tests that sanity-check the weight update code. """ l_in = lasagne.layers.InputLayer( shape=(None, num_frames, input_width, input_height) ) l_out = lasagne.layers.DenseLayer( l_in, num_units=output_dim, nonlinearity=None, W=lasagne.init.Constant(0.0), b=None ) return l_out
{ "content_hash": "36e208f8cf5a3a532e7d602d1da2bf58", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 112, "avg_line_length": 39.21989528795812, "alnum_prop": 0.5364437324789748, "repo_name": "ShibiHe/Q-Optimality-Tightening", "id": "1c676f1621c44203de1361684ec0d14e658af2fc", "size": "15005", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code/q_network.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "83356" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="@dimen/list_item_vertical_padding" android:paddingBottom="@dimen/list_item_vertical_padding" android:paddingLeft="@dimen/list_item_horizontal_padding" android:paddingRight="@dimen/list_item_horizontal_padding"> <TextView android:id="@+id/name" tools:text="San Francisco" android:textColor="@color/search_item_color" android:textSize="18sp" android:layout_width="fill_parent" android:layout_height="wrap_content"/> </LinearLayout>
{ "content_hash": "e79ce0583d3f1898be35f23299ca71a9", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 73, "avg_line_length": 43.95, "alnum_prop": 0.6393629124004551, "repo_name": "safrzone/safrzone-android", "id": "108893fc37287b24679e52e780e15a97772ae833", "size": "879", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/item_searchresult.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "50553" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.hsweb.web.dao.config.ConfigMapper"> <resultMap id="ConfigResultMap" type="org.hsweb.web.bean.po.config.Config"> <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/> <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR"/> <result property="content" column="content" javaType="String" jdbcType="VARCHAR"/> <result property="createDate" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/> <result property="classifiedId" column="classified_id" javaType="String" jdbcType="VARCHAR"/> </resultMap> <!--用于动态生成sql所需的配置--> <sql id="config"> <bind name="resultMapId" value="'ConfigResultMap'"/> <bind name="tableName" value="'s_config'"/> </sql> <insert id="insert" parameterType="org.hsweb.web.bean.common.InsertParam" > <include refid="config"/> <include refid="BasicMapper.buildInsertSql"/> </insert> <delete id="delete" parameterType="org.hsweb.web.bean.common.DeleteParam"> <include refid="config"/> <include refid="BasicMapper.buildDeleteSql"/> </delete> <update id="update" parameterType="org.hsweb.web.bean.common.UpdateParam"> <include refid="config"/> <include refid="BasicMapper.buildUpdateSql"/> </update> <select id="selectByPk" parameterType="string" resultMap="ConfigResultMap"> select * from s_config where u_id=#{id} </select> <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="ConfigResultMap"> <include refid="config"/> <include refid="BasicMapper.buildSelectSql"/> </select> <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int"> <include refid="config"/> <include refid="BasicMapper.buildTotalSql"/> </select> </mapper>
{ "content_hash": "dd20c50ce513c4bd9921982e3a245478", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 107, "avg_line_length": 42.285714285714285, "alnum_prop": 0.6616795366795367, "repo_name": "wuliuxs/axis-framework", "id": "f11d10b0c2fdcf5060f59a2780564e27409b7f95", "size": "2094", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "axis-web-dao/axis-web-dao-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/config/ConfigMapper.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "24446" }, { "name": "Java", "bytes": "726959" }, { "name": "JavaScript", "bytes": "222" }, { "name": "Lua", "bytes": "1101" }, { "name": "PLSQL", "bytes": "20279" } ], "symlink_target": "" }
.marquee{ overflow: hidden; position: relative; left:0px; transition:left 1s linear 1s; -webkit-transition: left 1s linear 1s; white-space: nowrap; } .marquee:hover{ transition:left 3s linear 3s; -webkit-transition: left 3s linear 3s; } .marqueeContainer{ overflow: hidden; } .marqueeWrapper{ overflow: hidden; }
{ "content_hash": "4cd83837f0cbb9d89b8991f0a8e16e93", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 39, "avg_line_length": 14.26086956521739, "alnum_prop": 0.725609756097561, "repo_name": "browner12/marquee", "id": "e1424cd3d17f1cad405a0ea4efce490c99b222e6", "size": "581", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "marquee.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "581" }, { "name": "JavaScript", "bytes": "584" } ], "symlink_target": "" }
using DragonSpark.Compose; using DragonSpark.Model.Commands; using DragonSpark.Model.Selection.Stores; using System.Collections.Generic; namespace DragonSpark.Model.Sequences.Collections.Commands; sealed class ItemCommands<T> : Store<IList<T>, ICommand<T>> { public static ItemCommands<T> Default { get; } = new ItemCommands<T>(); ItemCommands() : base(AddItemCommands<T>.Default.Then().Introduce().Select(InsertItemCommands<T>.Default)) {} }
{ "content_hash": "7430ae4d0c9d6d6e0dd595e3a62bb057", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 110, "avg_line_length": 34.38461538461539, "alnum_prop": 0.7807606263982103, "repo_name": "DragonSpark/Framework", "id": "410d914f532fae1594086e1fe4b2796280d1c67f", "size": "447", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DragonSpark/Model/Sequences/Collections/Commands/ItemCommands.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "2079497" }, { "name": "CSS", "bytes": "673" }, { "name": "HTML", "bytes": "103546" }, { "name": "JavaScript", "bytes": "1311" }, { "name": "TypeScript", "bytes": "2495" } ], "symlink_target": "" }
package com.slyak.services.file.service; import java.io.File; import java.io.InputStream; /** * . * * @author stormning on 2017/1/6. */ public interface StorageService { /** * @param inputStream * @return store key */ String store(InputStream inputStream); File restore(String key); }
{ "content_hash": "b64cad0cf292adbe2548ee60ab6f6c2f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 40, "avg_line_length": 14.428571428571429, "alnum_prop": 0.6864686468646864, "repo_name": "slyak/slyak-commons", "id": "bbd35c9bf2939925860c112f6ba75cee6f26817d", "size": "928", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "slyak-impl-parent/slyak-file-impl/src/main/java/com/slyak/services/file/service/StorageService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "49460" }, { "name": "Kotlin", "bytes": "6191" }, { "name": "Shell", "bytes": "7058" } ], "symlink_target": "" }
<!-- do not translate this --> | [Read these guidelines in other languages](/docs/i18n-languages) | |-| <!-- do not translate this --> # Orientações para Contribuição Olá 👋! freeCodeCamp.org é possível graças a milhares de voluntários gentis como você. Somos gratos por suas contribuições e estamos felizes em te receber. Nós seguimos as diretrizes do nosso ["Código de Conduta"](https://www.freecodecamp.org/code-of-conduct). Dedique um tempo para lê-lo. Ele não é muito longo. Divirta-se contribuindo 🎉! ## Esses são alguns jeitos divertidos de contribuir Você pode contribuir para qualquer área do seu interesse: 1. [Contribua para essa base de códigos abertos.](#contribua-para-essa-base-de-códigos-abertos) Nos ajude criando e editando [Artigos guia](https://www.freecodecamp.org/guide), [desafios de codificação](https://www.freecodecamp.org/learn), ou corrigindo bugs na plataforma de aprendizado. 2. Ajude campistas em nosso [fórum público](https://www.freecodecamp.org/forum/). - ❓ Ajude campistas [respondendo suas perguntas](https://www.freecodecamp.org/forum/?max_posts=1). - 💬 [Faça comentários](https://www.freecodecamp.org/forum/c/project-feedback?max_posts=1) em projetos dos campistas. 3. Nos ajude a legendar nosso [canal no YouTube](https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ/videos). ## Contribua para essa base de códigos abertos Nós temos uma base de código aberto gigantesca dos [Desafios de código](https://www.freecodecamp.org/learn) e [Artigos de guia](https://www.freecodecamp.org/guide). Esses desafios e artigos compõem o conteúdo de aprendizado disponível na plataforma de aprendizado da freeCodeCamp.org. Você pode nos ajudar: - [📝 Pesquise, Escreva e Atualize nossos artigos de guia.](#pesquise-escreva-e-atualize-nossos-artigos-de-guia) - [💻 Crie, Atualize e Corrija <i>Bugs</i> em nossos desafios de código.](#crie-atualize-e-corrija-bugs-em-nossos-desafios-de-código) - [🌐 Traduza artigos de guia e desafios de código.](#traduza-artigos-de-guia-e-desafios-de-código) - [🛠 Nos ajude a corrigir <i>bugs</i> na plataforma de aprendizado da freeCodeCamp.org.](#nos-ajude-a-corrigir-bugs-na-plataforma-de-aprendizado-da-freecodecamporg) ### Pesquise, Escreva e Atualize nossos artigos de guia **O que são Artigos de guia?** Artigos de guia ajudam você a ter um rápido entendimento sobre um conceito tecnológico. Eles são explicações em Português, curtas e diretas, que você pode ler antes de partir para recursos mais aprofundados. Você pode encontrar um [artigo de exemplo sobre elementos HTML aqui](../../guide/portuguese/html/elements/index.md). **Sobre o que eu posso escrever um artigo?** Nós agradecemos sua ajuda na escrita desses artigos. Você não precisa ser um especialista em um tópico para escrever sobre isso - Todo o Guia é código aberto, então mesmo que você cometa um erro, outro contribuidor vai eventualmente corrigí-lo. Para ajudar, encontre um `artigo provisório` na [página de Guias](https://www.freecodecamp.org/guide), escreva o artigo, e então abra um <i>pull request</i> (PR) para substituir o provisório pelo seu artigo. Um [<i>pull request</i>](https://help.github.com/articles/about-pull-requests/) é a forma como você vai sugerir mudanças. Ele permite que outros saibam das suas mudanças, revisem-nas e as adotem. Se você não consegue encontrar um artigo provisório do tópico sobre o qual você gostaria de escrever, você pode abrir um PR que cria o artigo provisório e então incluir o rascunho do seu artigo. **Se você gostaria de trabalhar nisso, por favor, siga as seguintes recomendações:** #### [Como trabalhar em Artigos de guia.](/docs/i18n-languages/portuguese/how-to-work-on-guide-articles.md) ### Crie, Atualize e Corrija <i>Bugs</i> em nossos desafios de código Todos os nossos Desafios de código tem curadoria da comunidade, trazendo conhecimento especializado de voluntários como você. Entretanto, eles precisam ser constantemente refinados para melhor qualidade. Por exemplo, você pode querer atualizar suas instruções para melhorar seu palavreado. Você pode atualizar as histórias de usuário para explicar o conceito melhor ou mesmo evitar redundâncias. Você pode querer refatorar testes que não passam em códigos válidos das histórias de usuário. **Se você gostaria de trabalhar nisso, por favor, siga as seguintes recomendações:** #### [Como trabalhar em desafios de código.](/docs/i18n-languages/portuguese/how-to-work-on-coding-challenges.md) ### Traduza artigos de guia e desafios de código Você pode nos ajudar a traduzir nossos Artigos de guia e Desafios de código para uma língua que você fala. Atualmente, nós temos versões traduzidas em: - [Arabic (عربي)](https://github.com/freeCodeCamp/freeCodeCamp/tree/master/guide/arabic) - [Chinese (中文)](https://github.com/freeCodeCamp/freeCodeCamp/tree/master/guide/chinese) - [Portuguese (Português)](https://github.com/freeCodeCamp/freeCodeCamp/tree/master/guide/portuguese) - [Russian (русский)](https://github.com/freeCodeCamp/freeCodeCamp/tree/master/guide/russian) - [Spanish (Español)](https://github.com/freeCodeCamp/freeCodeCamp/tree/master/guide/spanish) A maioria dessas versões são traduções de máquina. Nós vamos amar sua ajuda em melhorar a qualidade dessas traduções. **Se você gostaria de trabalhar nisso, por favor, siga as seguintes recomendações:** **[TODO]** Nós estamos no processo de atualizar os documentos para o fluxo de tradução. Siga [`#18313`](https://github.com/freeCodeCamp/freeCodeCamp/issues/18313) para acompanhar o progresso. ### Nos ajude a corrigir <i>bugs</i> na plataforma de aprendizado da freeCodeCamp.org Nossa plataforma de aprendizado roda em uma <i>stack</i> moderna de Javascript. Ela contém vários componentes, ferramentas e bibliotecas, incluindo, mas não limitadas a: Node.js, MongoDB, LoopBack, OAuth 2.0, React, Gatsby, Webpack, entre outras. De maneira geral, - Nós temos um servidor de API baseado em Node.js. - Um conjunto de aplicações cliente baseadas em React. - Um <i>script</i> que nós utilizamos para avaliar nossos projetos <i>Frontend</i>. Contribuir para isso requer certo conhecimento de APIs, sintaxe ES6 e bastante curiosidade. Nós esperamos certa familiaridade básica com algumas das tecnologias, ferramentas e bibliotecas mencionadas. Dito isso, não é necessário que você seja um especialista nelas. Sinta-se livre para nos fazer qualquer pergunta nos tópicos de questões relacionadas, e nós seremos gratos em explicar. Quando em dúvida, você pode contatar Mrugesh Mohapatra [`@raisedadead`](https://github.com/raisedadead) ou Stuart Taylor [`@bouncey`](https://github.com/bouncey) do nosso time de desenvolvimento da plataforma para o ajudar. **Se você gostaria de trabalhar nisso, por favor, siga as seguintes recomendações:** #### [Como configurar freeCodeCamp localmente.](/docs/i18n-languages/portuguese/how-to-setup-freecodecamp-locally.md) ## Perguntas Frequentes **Como eu posso reportar um <i>bug</i>?** Se você acha que encontrou um <i>bug</i>, primeiro leia o artigo ["Help I've Found a Bug"](https://forum.freecodecamp.org/t/how-to-report-a-bug/19543) e siga as instruções. Se você está confiante de que se trata de um <i>bug</i> novo, vá em frente e crie uma nova <i>issue</i> no GitHub. Certifique-se de incluir o máximo de informações possível para que nós possamos reproduzir o <i>bug</i>. Nós temos um modelo pré definido para <i>issues</i> para ajudá-lo nisso. Por favor, repare que qualquer <i>issue</i> que esteja buscando ajuda no código de algum desafio será fechada. O acompanhador de <i>issues</i> é restrito a problemas e discussões relacionadas à base de código. Você deve [buscar ajuda no fórum](https://www.freecodecamp.org/forum) antes de reportar sempre que estiver em dúvida. **Como eu posso reportar um problema de segurança?** Por favor não crie <i>issues</i> relacionadas à segurança no GitHub. Ao invés disso, por favor envie um email para `security@freecodecamp.org` e nós iremos analisar imediatamente. **Estou parado em algo que não está nessa documentação. Como posso conseguir ajuda?** Sinta-se livre para pedir ajuda: - [Na categoria de "Contribuidores" (<i>Contributors</i>) em nosso fórum público](https://www.freecodecamp.org/forum/c/contributors). - [Em nossa sala pública de <i>chat</i> de contribuidores no Gitter](https://gitter.im/FreeCodeCamp/Contributors). Nós estamos empolgados em te ajudar a contribuir para qualquer tópico em que você queira trabalhar. Certifique-se de fazer uma busca antes de publicar um tópico novo. Seja educado e paciente. Os voluntários e moderadores da nossa comunidade estão sempre por perto para te ajudar em suas questões. **Eu sou novo no GitHub e <i>Open Source</i> (Código Aberto) em geral:** Leia nosso [Guia de como contribuir para <i>Open Source</i>](https://github.com/freeCodeCamp/how-to-contribute-to-open-source). **O que esses rótulos diferentes marcados nas <i>issues</i> significam?** Nossa comunidade de moderadores faz uma [triagem](https://en.wikipedia.org/wiki/Software_bug#Bug_management) das <i>issues</i> e <i>pull requests</i> baseada em suas prioridades, gravidade e outros fatores. Você pode [encontrar um glossário completo dos seus significados aqui](https://github.com/freecodecamp/freecodecamp/labels). Você deveria passar pelas <i>issues</i> de **`Help Wanted`** (Ajuda necessária) ou **`first timers welcome`** (Iniciantes são bem vindos) para uma rápida consulta do que está livre para você trabalhar. Elas estão disponíveis e você não precisa de permissão para começar a trabalhar nelas. Se essas <i>issues</i> possuem falta de clareza do que deve ser feito, sinta-se livre para tirar suas dúvidas nos comentários. **Encontrei um erro de escrita, eu devo reportar antes de criar um <i>pull request</i>?** Você pode criar diretamente um <i>pull request</i> sem ter de reportar uma <i>issue</i> em casos de erros de escrita ou pequenas mudanças de palavreado. <i>Issues</i> são ferramentas para buscar confirmação em mudanças que você gostaria de propor por meio de um <i>pull request</i>.
{ "content_hash": "7221f5cddd70c19c1110f80bc02d00e4", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 403, "avg_line_length": 68.14189189189189, "alnum_prop": 0.7747149231531978, "repo_name": "BhaveshSGupta/FreeCodeCamp", "id": "ffb9cdb2ff104758f9e3a05e2cde53b0ae7a2182", "size": "10334", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/i18n-languages/portuguese/CONTRIBUTING.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "71786" }, { "name": "HTML", "bytes": "17627" }, { "name": "JavaScript", "bytes": "1003613" }, { "name": "Shell", "bytes": "340" } ], "symlink_target": "" }
// RobotBuilder Version: 2.0 // // This file was generated by RobotBuilder. It contains sections of // code that are automatically generated and assigned by robotbuilder. // These sections will be updated in the future when you export to // Java from RobotBuilder. Do not put any code or make any change in // the blocks indicating autogenerated code or it will be lost on an // update. Deleting the comments indicating the section will prevent // it from being updated in the future. package org.usfirst.frc4127.Loggerbots.commands; import org.usfirst.frc4127.Loggerbots.Robot; import edu.wpi.first.wpilibj.Timer; import edu.wpi.first.wpilibj.command.Command; /** * */ public class AutonomousCommand extends Command { // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_DECLARATIONS // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR public AutonomousCommand() { //Robot.drive.getMechanum4WheelRobotDrive().mecanumDrive_Polar(.5, 0, 0); //Robot.drive.getMechanum4WheelRobotDrive().mecanumDrive_Cartesian(1,0,0, Robot.oi.getHeading()); Robot.drive.getTank4WheelRobotDrive().tankDrive(1, 1); Timer.delay(2); Robot.drive.getTank4WheelRobotDrive().stopMotor(); } // Called just before this Command runs the first time protected void initialize() { } // Called repeatedly when this Command is scheduled to run protected void execute() { } // Make this return true when this Command no longer needs to run execute() protected boolean isFinished() { return false; } // Called once after isFinished returns true protected void end() { } // Called when another command which requires one or more of the same // subsystems is scheduled to run protected void interrupted() { } }
{ "content_hash": "f66e35a7975064a1cb763f061243f73b", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 102, "avg_line_length": 33.24561403508772, "alnum_prop": 0.7282321899736148, "repo_name": "Loggerbots4127/loggerbot_2017", "id": "7656344a2fb26dd6717889cd1b9c1be736993e39", "size": "1895", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/org/usfirst/frc4127/Loggerbots/commands/AutonomousCommand.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "15790" }, { "name": "Python", "bytes": "8893" }, { "name": "Shell", "bytes": "130" } ], "symlink_target": "" }
package kafka.server import java.io.File import java.util.Properties import java.util.concurrent.atomic.AtomicBoolean import kafka.cluster.{Partition, Replica} import kafka.log.{Log, LogManager} import kafka.utils._ import org.apache.kafka.common.TopicPartition import org.apache.kafka.common.metrics.Metrics import org.apache.kafka.common.utils.Time import org.easymock.EasyMock import org.junit.Assert._ import org.junit.{After, Before, Test} import scala.collection.mutable.{HashMap, Map} class IsrExpirationTest { var topicPartitionIsr: Map[(String, Int), Seq[Int]] = new HashMap[(String, Int), Seq[Int]]() val replicaLagTimeMaxMs = 100L val replicaFetchWaitMaxMs = 100 val leaderLogEndOffset = 20 val overridingProps = new Properties() overridingProps.put(KafkaConfig.ReplicaLagTimeMaxMsProp, replicaLagTimeMaxMs.toString) overridingProps.put(KafkaConfig.ReplicaFetchWaitMaxMsProp, replicaFetchWaitMaxMs.toString) val configs = TestUtils.createBrokerConfigs(2, TestUtils.MockZkConnect).map(KafkaConfig.fromProps(_, overridingProps)) val topic = "foo" val time = new MockTime val metrics = new Metrics var replicaManager: ReplicaManager = null @Before def setUp() { val logManager: LogManager = EasyMock.createMock(classOf[LogManager]) EasyMock.expect(logManager.liveLogDirs).andReturn(Array.empty[File]).anyTimes() EasyMock.replay(logManager) replicaManager = new ReplicaManager(configs.head, metrics, time, null, null, logManager, new AtomicBoolean(false), QuotaFactory.instantiate(configs.head, metrics, time, ""), new BrokerTopicStats, new MetadataCache(configs.head.brokerId), new LogDirFailureChannel(configs.head.logDirs.size)) } @After def tearDown() { replicaManager.shutdown(false) metrics.close() } /* * Test the case where a follower is caught up but stops making requests to the leader. Once beyond the configured time limit, it should fall out of ISR */ @Test def testIsrExpirationForStuckFollowers() { val log = logMock // create one partition and all replicas val partition0 = getPartitionWithAllReplicasInIsr(topic, 0, time, configs.head, log) assertEquals("All replicas should be in ISR", configs.map(_.brokerId).toSet, partition0.inSyncReplicas) // let the follower catch up to the Leader logEndOffset - 1 for (replica <- partition0.remoteReplicas) replica.updateFetchState( followerFetchOffsetMetadata = LogOffsetMetadata(leaderLogEndOffset - 1), followerStartOffset = 0L, followerFetchTimeMs= time.milliseconds, leaderEndOffset = leaderLogEndOffset) var partition0OSR = partition0.getOutOfSyncReplicas(configs.head.replicaLagTimeMaxMs) assertEquals("No replica should be out of sync", Set.empty[Int], partition0OSR) // let some time pass time.sleep(150) // now follower hasn't pulled any data for > replicaMaxLagTimeMs ms. So it is stuck partition0OSR = partition0.getOutOfSyncReplicas(configs.head.replicaLagTimeMaxMs) assertEquals("Replica 1 should be out of sync", Set(configs.last.brokerId), partition0OSR) EasyMock.verify(log) } /* * Test the case where a follower never makes a fetch request. It should fall out of ISR because it will be declared stuck */ @Test def testIsrExpirationIfNoFetchRequestMade() { val log = logMock // create one partition and all replicas val partition0 = getPartitionWithAllReplicasInIsr(topic, 0, time, configs.head, log) assertEquals("All replicas should be in ISR", configs.map(_.brokerId).toSet, partition0.inSyncReplicas) // Let enough time pass for the replica to be considered stuck time.sleep(150) val partition0OSR = partition0.getOutOfSyncReplicas(configs.head.replicaLagTimeMaxMs) assertEquals("Replica 1 should be out of sync", Set(configs.last.brokerId), partition0OSR) EasyMock.verify(log) } /* * Test the case where a follower continually makes fetch requests but is unable to catch up. It should fall out of the ISR * However, any time it makes a request to the LogEndOffset it should be back in the ISR */ @Test def testIsrExpirationForSlowFollowers() { // create leader replica val log = logMock // add one partition val partition0 = getPartitionWithAllReplicasInIsr(topic, 0, time, configs.head, log) assertEquals("All replicas should be in ISR", configs.map(_.brokerId).toSet, partition0.inSyncReplicas) // Make the remote replica not read to the end of log. It should be not be out of sync for at least 100 ms for (replica <- partition0.remoteReplicas) replica.updateFetchState( followerFetchOffsetMetadata = LogOffsetMetadata(leaderLogEndOffset - 2), followerStartOffset = 0L, followerFetchTimeMs= time.milliseconds, leaderEndOffset = leaderLogEndOffset) // Simulate 2 fetch requests spanning more than 100 ms which do not read to the end of the log. // The replicas will no longer be in ISR. We do 2 fetches because we want to simulate the case where the replica is lagging but is not stuck var partition0OSR = partition0.getOutOfSyncReplicas(configs.head.replicaLagTimeMaxMs) assertEquals("No replica should be out of sync", Set.empty[Int], partition0OSR) time.sleep(75) partition0.remoteReplicas.foreach { r => r.updateFetchState( followerFetchOffsetMetadata = LogOffsetMetadata(leaderLogEndOffset - 1), followerStartOffset = 0L, followerFetchTimeMs= time.milliseconds, leaderEndOffset = leaderLogEndOffset) } partition0OSR = partition0.getOutOfSyncReplicas(configs.head.replicaLagTimeMaxMs) assertEquals("No replica should be out of sync", Set.empty[Int], partition0OSR) time.sleep(75) // The replicas will no longer be in ISR partition0OSR = partition0.getOutOfSyncReplicas(configs.head.replicaLagTimeMaxMs) assertEquals("Replica 1 should be out of sync", Set(configs.last.brokerId), partition0OSR) // Now actually make a fetch to the end of the log. The replicas should be back in ISR partition0.remoteReplicas.foreach { r => r.updateFetchState( followerFetchOffsetMetadata = LogOffsetMetadata(leaderLogEndOffset), followerStartOffset = 0L, followerFetchTimeMs= time.milliseconds, leaderEndOffset = leaderLogEndOffset) } partition0OSR = partition0.getOutOfSyncReplicas(configs.head.replicaLagTimeMaxMs) assertEquals("No replica should be out of sync", Set.empty[Int], partition0OSR) EasyMock.verify(log) } /* * Test the case where a follower has already caught up with same log end offset with the leader. This follower should not be considered as out-of-sync */ @Test def testIsrExpirationForCaughtUpFollowers() { val log = logMock // create one partition and all replicas val partition0 = getPartitionWithAllReplicasInIsr(topic, 0, time, configs.head, log) assertEquals("All replicas should be in ISR", configs.map(_.brokerId).toSet, partition0.inSyncReplicas) // let the follower catch up to the Leader logEndOffset for (replica <- partition0.remoteReplicas) replica.updateFetchState( followerFetchOffsetMetadata = LogOffsetMetadata(leaderLogEndOffset), followerStartOffset = 0L, followerFetchTimeMs= time.milliseconds, leaderEndOffset = leaderLogEndOffset) var partition0OSR = partition0.getOutOfSyncReplicas(configs.head.replicaLagTimeMaxMs) assertEquals("No replica should be out of sync", Set.empty[Int], partition0OSR) // let some time pass time.sleep(150) // even though follower hasn't pulled any data for > replicaMaxLagTimeMs ms, the follower has already caught up. So it is not out-of-sync. partition0OSR = partition0.getOutOfSyncReplicas(configs.head.replicaLagTimeMaxMs) assertEquals("No replica should be out of sync", Set.empty[Int], partition0OSR) EasyMock.verify(log) } private def getPartitionWithAllReplicasInIsr(topic: String, partitionId: Int, time: Time, config: KafkaConfig, localLog: Log): Partition = { val leaderId = config.brokerId val tp = new TopicPartition(topic, partitionId) val partition = replicaManager.createPartition(tp) partition.setLog(localLog, isFutureLog = false) val allReplicas = getFollowerReplicas(partition, leaderId, time) allReplicas.foreach(r => partition.addReplicaIfNotExists(r)) // set in sync replicas for this partition to all the assigned replicas partition.inSyncReplicas = allReplicas.map(_.brokerId).toSet + leaderId // set lastCaughtUpTime to current time for (replica <- partition.remoteReplicas) replica.updateFetchState( followerFetchOffsetMetadata = LogOffsetMetadata(0L), followerStartOffset = 0L, followerFetchTimeMs= time.milliseconds, leaderEndOffset = 0L) // set the leader and its hw and the hw update time partition.leaderReplicaIdOpt = Some(leaderId) partition } private def logMock: Log = { val log: Log = EasyMock.createMock(classOf[Log]) EasyMock.expect(log.dir).andReturn(TestUtils.tempDir()).anyTimes() EasyMock.expect(log.logEndOffsetMetadata).andReturn(LogOffsetMetadata(leaderLogEndOffset)).anyTimes() EasyMock.expect(log.logEndOffset).andReturn(leaderLogEndOffset).anyTimes() EasyMock.replay(log) log } private def getFollowerReplicas(partition: Partition, leaderId: Int, time: Time): Seq[Replica] = { configs.filter(_.brokerId != leaderId).map { config => new Replica(config.brokerId, partition.topicPartition) } } }
{ "content_hash": "3044cd293f6404166a56a7f4fa555294", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 154, "avg_line_length": 42.31004366812227, "alnum_prop": 0.7403240788523068, "repo_name": "KevinLiLu/kafka", "id": "efdadbb311d244f9d1ddf5c33f974b595af73073", "size": "10489", "binary": false, "copies": "1", "ref": "refs/heads/trunk", "path": "core/src/test/scala/unit/kafka/server/ISRExpirationTest.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "29277" }, { "name": "Dockerfile", "bytes": "6044" }, { "name": "HTML", "bytes": "3739" }, { "name": "Java", "bytes": "17318873" }, { "name": "Python", "bytes": "851864" }, { "name": "Scala", "bytes": "6380036" }, { "name": "Shell", "bytes": "91444" }, { "name": "XSLT", "bytes": "7116" } ], "symlink_target": "" }
package me.yufan.gossip.utils; import me.yufan.gossip.mybatis.entity.Comment; import me.yufan.gossip.rest.dto.CommentDTO; public class RandomComment extends RandomEntityGenerator { private RandomComment() { // No constructor } public static CommentDTO randomCommentDTO() { return new CommentDTO() .setReplyPostId(randomId()) .setMessage(randomString(300)) .setArticleKey(randomString(20)) .setEmail("example@example.com") .setName(randomString(40)) .setWebsite("http://example.com"); } public static Comment randomRawComment() { return new Comment() .setArticleId(randomId()) .setParentId(randomId()) .setAuthorId(randomId()) .setMessage(randomString(400)); } }
{ "content_hash": "d92db9da1c176afe871f25b9166261bd", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 58, "avg_line_length": 28.79310344827586, "alnum_prop": 0.6227544910179641, "repo_name": "syhily/gossip", "id": "1fa255e7729c0b1d6849fd426d9e8cb3d9d8d833", "size": "835", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/me/yufan/gossip/utils/RandomComment.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "85059" }, { "name": "Shell", "bytes": "2612" } ], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in J. Linn. Soc. , Bot. 10(no. 45): 303 (1868) #### Original name Lentinus castoreus var. pusillus Berk. & M.A. Curtis ### Remarks null
{ "content_hash": "40f92b201c9d5e71a4316a7f6534baee", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 52, "avg_line_length": 15.076923076923077, "alnum_prop": 0.6632653061224489, "repo_name": "mdoering/backbone", "id": "3ff129cfe5745bc9a023c5f2137e48614586ed1e", "size": "272", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Basidiomycota/Agaricomycetes/Russulales/Auriscalpiaceae/Lentinellus/Lentinellus castoreus/Lentinus castoreus pusillus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package cz.fg.issuetracking.redmine; import cz.fg.issuetracking.api.*; import cz.fg.issuetracking.api.report.Report; import cz.fg.issuetracking.api.report.StringReportRender; import cz.fg.issuetracking.procedure.report.ChangelogReport; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import java.util.List; import java.util.Properties; /** * Redmine issue manager test * * @author Michal Franc, FG Forrest a.s. (c) 2013 * 22.8.13 17:03 */ @Ignore public class RedmineTest { static RedmineManagerFactory managerFactory; static Issue issue1, issue2, issue3, issue4, issue5, issue6, issue7, issue8, issue9, issue10; /*@BeforeClass*/ public static void prepareTestProjectState() throws Exception { IssueManager issueManager = createManagerFactory().getIssueManager(); Assert.assertNotNull(issueManager); issue1 = issueManager.createIssue("First issue", "first content", "MFR"); issue2 = issueManager.createIssue("Second issue", "second content", "MFR"); issue3 = issueManager.createIssue("Third issue", "third content", "MFR"); issue4 = issueManager.createIssue("Fourth issue", "fourth content", "MFR"); issue5 = issueManager.createIssue("Fifth issue", "fifth content", "MFR"); issue6 = issueManager.createIssue("Sixth issue", "sixth content", "SCMCOMMITER"); issue7 = issueManager.createIssue("Seventh issue", "seventh content", "SCMCOMMITER"); issue8 = issueManager.createIssue("Eighth issue", "eighth content", "SCMCOMMITER"); issue9 = issueManager.createIssue("Ninth issue", "ninth content", "SCMCOMMITER"); issue10 = issueManager.createIssue("Tenth issue", "tenth content", "SCMCOMMITER"); issueManager.setIssueState(IssueState.UNDER_DEVELOPMENT,issue2.getId(),issue3.getId(),issue4.getId()); issueManager.setIssueState(IssueState.SOLVED,issue5.getId(),issue6.getId(),issue7.getId(),issue8.getId()); issueManager.setIssueState(IssueState.RELEASED,issue9.getId(),issue10.getId(),issue1.getId()); VersionManager versionManager = createManagerFactory().getVersionManager(); versionManager.createVersion("1.0.0"); versionManager.createVersion("1.1.0"); versionManager.createVersion("2.0.0"); versionManager.createVersion("3.0.0"); issueManager.assignVersion("1.0.0",issue1.getId(),issue2.getId()); issueManager.assignVersion("1.1.0",issue3.getId(),issue4.getId()); issueManager.assignVersion("2.0.0",issue5.getId(),issue6.getId()); issueManager.assignVersion("3.0.0",issue7.getId(),issue8.getId(),issue9.getId(),issue10.getId()); } @Test public void testShouldCreateManager() throws Exception { RedmineManagerFactory f = createManagerFactory(); IssueManager issueManager = f.getIssueManager(); VersionManager versionManager = f.getVersionManager(); Assert.assertNotNull(issueManager); Assert.assertNotNull(versionManager); } @Test public void testShouldGetIssues() throws Exception { IssueManager issueManager = createManagerFactory().getIssueManager(); List<Issue> releasedIssues = issueManager.getReleasedIssues(); List<Issue> sleepingIssues = issueManager.getSleepingIssues(); List<Issue> solvedIssues = issueManager.getSolvedIssues(); List<Issue> underDevelopmentIssues = issueManager.getUnderDevelopmentIssues(); List<Issue> underDevelopmentSuspectsIssues = issueManager.getUnderDevelopmentSuspectsIssues(); Assert.assertEquals(3,releasedIssues.size()); Assert.assertEquals("First issue",releasedIssues.get(0).getName()); Assert.assertEquals(4,solvedIssues.size()); Assert.assertEquals("Fifth issue",solvedIssues.get(0).getName()); Assert.assertEquals(3,underDevelopmentIssues.size()); Assert.assertEquals("Second issue",underDevelopmentIssues.get(0).getName()); Assert.assertEquals(0,sleepingIssues.size()); Assert.assertEquals(0,underDevelopmentSuspectsIssues.size()); } @Test public void testShouldGetVersions() throws Exception { VersionManager versionManager = createManagerFactory().getVersionManager(); List<Version> releasedVersions = versionManager.getReleasedVersions(); List<Version> unreleasedVersions = versionManager.getUnreleasedVersions(); int releasedBefore = releasedVersions.size(); int unreleasedBefore = unreleasedVersions.size(); versionManager.createVersion("10.0.0"); unreleasedVersions = versionManager.getUnreleasedVersions(); releasedVersions = versionManager.getReleasedVersions(); Assert.assertEquals(releasedBefore,releasedVersions.size()); Assert.assertEquals(unreleasedBefore+1,unreleasedVersions.size()); versionManager.releaseVersion("10.0.0"); unreleasedVersions = versionManager.getUnreleasedVersions(); releasedVersions = versionManager.getReleasedVersions(); Assert.assertEquals(releasedBefore+1,releasedVersions.size()); Assert.assertEquals(unreleasedBefore, unreleasedVersions.size()); for (Version version : releasedVersions) { Assert.assertTrue(version.isReleased()); } for (Version version : unreleasedVersions) { Assert.assertTrue(!version.isReleased()); } } @Test public void testChangeLog() throws Exception { ChangelogReport report = new ChangelogReport(); report.setVersions(createManagerFactory().getVersionManager()); report.setIssues(createManagerFactory().getIssueManager()); Report result = report.create(); StringReportRender sr = new StringReportRender(); sr.render(result); System.out.println(sr.getResult()); } @Test @Ignore public void testCreate() throws Exception { RedmineManagerFactory f = createManagerFactory(); IssueManager issueManager = f.getIssueManager(); //Issue issue = issueManager.createIssue("Test", "content", "SCMCOMMITER"); VersionManager versionManager = f.getVersionManager(); //versionManager.createVersion("1.0.0"); //issueManager.assignVersion("1.0.0",issue.getId()); //issueManager.closeIssues("1.0.0"); versionManager.releaseVersion("1.0.0"); } private static RedmineManagerFactory createManagerFactory() throws Exception { if ( managerFactory==null) { //Properties properties = System.getProperties(); Properties properties = new Properties(); properties.load(properties.getClass().getResourceAsStream("/META-INF/redmine.properties")); managerFactory = new RedmineManagerFactory(properties); } return managerFactory; } }
{ "content_hash": "956c914e2ef1cc28dccf63e29d60511e", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 114, "avg_line_length": 44.58227848101266, "alnum_prop": 0.68725156161272, "repo_name": "francm/maven-issuetracking-plugin", "id": "9fe4bbb7daf04ff523511574ec05785f0f58a10e", "size": "7044", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/cz/fg/issuetracking/redmine/RedmineTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "84261" } ], "symlink_target": "" }
<!doctype html> <html class="theme-next mist use-motion" lang="zh-Hans"> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" /> <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css"> <link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" /> <link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" /> <meta name="keywords" content="Hexo, NexT" /> <link rel="alternate" href="/atom.xml" title="梦醒&fake" type="application/atom+xml" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" /> <meta name="description" content="梦醒&amp;fake的技术博客"> <meta property="og:type" content="website"> <meta property="og:title" content="梦醒&fake"> <meta property="og:url" content="http://yoursite.com/archives/2016/11/index.html"> <meta property="og:site_name" content="梦醒&fake"> <meta property="og:description" content="梦醒&amp;fake的技术博客"> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="梦醒&fake"> <meta name="twitter:description" content="梦醒&amp;fake的技术博客"> <script type="text/javascript" id="hexo.configurations"> var NexT = window.NexT || {}; var CONFIG = { root: '/', scheme: 'Mist', sidebar: {"display":"post"}, fancybox: true, motion: true, duoshuo: { userId: '0', author: '博主' }, algolia: { applicationID: '', apiKey: '', indexName: '', hits: {"per_page":10}, labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"} } }; </script> <link rel="canonical" href="http://yoursite.com/archives/2016/11/"/> <title> 归档 | 梦醒&fake </title> </head> <body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans"> <div class="container one-collumn page-archive "> <div class="headband"></div> <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"><div class="site-meta "> <div class="custom-logo-site-title"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <span class="site-title">梦醒&fake</span> <span class="logo-line-after"><i></i></span> </a> </div> <p class="site-subtitle">梦醒&fake的技术博客</p> </div> <div class="site-nav-toggle"> <button> <span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span> </button> </div> <nav class="site-nav"> <ul id="menu" class="menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"> <i class="menu-item-icon fa fa-fw fa-home"></i> <br /> 首页 </a> </li> <li class="menu-item menu-item-categories"> <a href="/categories" rel="section"> <i class="menu-item-icon fa fa-fw fa-th"></i> <br /> 分类 </a> </li> <li class="menu-item menu-item-about"> <a href="/about" rel="section"> <i class="menu-item-icon fa fa-fw fa-user"></i> <br /> 关于 </a> </li> <li class="menu-item menu-item-archives"> <a href="/archives" rel="section"> <i class="menu-item-icon fa fa-fw fa-archive"></i> <br /> 归档 </a> </li> <li class="menu-item menu-item-tags"> <a href="/tags" rel="section"> <i class="menu-item-icon fa fa-fw fa-tags"></i> <br /> 标签 </a> </li> <li class="menu-item menu-item-search"> <a href="javascript:;" class="popup-trigger"> <i class="menu-item-icon fa fa-search fa-fw"></i> <br /> 搜索 </a> </li> </ul> <div class="site-search"> <div class="popup"> <span class="search-icon fa fa-search"></span> <input type="text" id="local-search-input"> <div id="local-search-result"></div> <span class="popup-btn-close">close</span> </div> </div> </nav> </div> </header> <main id="main" class="main"> <div class="main-inner"> <div class="content-wrap"> <div id="content" class="content"> <section id="posts" class="posts-collapse"> <span class="archive-move-on"></span> <span class="archive-page-counter"> 嗯..! 目前共计 2 篇日志。 继续努力。 </span> <div class="collection-title"> <h2 class="archive-year motion-element" id="archive-year-2016">2016</h2> </div> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/11/15/hello-world/" itemprop="url"> <span itemprop="name">Hello World</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-11-15T18:58:03+08:00" content="2016-11-15" > 11-15 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/11/15/text1/" itemprop="url"> <span itemprop="name">Lavavel 使用阿里云队列消息服务MNS</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-11-15T16:05:00+08:00" content="2016-11-15" > 11-15 </time> </div> </header> </article> </section> </div> </div> <div class="sidebar-toggle"> <div class="sidebar-toggle-line-wrap"> <span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span> </div> </div> <aside id="sidebar" class="sidebar"> <div class="sidebar-inner"> <section class="site-overview sidebar-panel sidebar-panel-active"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" src="/uploads/avatar.jpg" alt="梦醒&fake" /> <p class="site-author-name" itemprop="name">梦醒&fake</p> <p class="site-description motion-element" itemprop="description">梦醒&fake的技术博客</p> </div> <nav class="site-state motion-element"> <div class="site-state-item site-state-posts"> <a href="/archives"> <span class="site-state-item-count">2</span> <span class="site-state-item-name">日志</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories"> <span class="site-state-item-count">1</span> <span class="site-state-item-name">分类</span> </a> </div> <div class="site-state-item site-state-tags"> <a href="/tags"> <span class="site-state-item-count">1</span> <span class="site-state-item-name">标签</span> </a> </div> </nav> <div class="feed-link motion-element"> <a href="/atom.xml" rel="alternate"> <i class="fa fa-rss"></i> RSS </a> </div> <div class="links-of-author motion-element"> </div> </section> </div> </aside> </div> </main> <footer id="footer" class="footer"> <div class="footer-inner"> <div class="copyright" > &copy; <span itemprop="copyrightYear">2016</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">梦醒&fake</span> </div> <div class="powered-by"> 由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动 </div> <div class="theme-info"> 主题 - <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next"> NexT.Mist </a> </div> </div> </footer> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> </div> </div> <script type="text/javascript"> if (Object.prototype.toString.call(window.Promise) !== '[object Function]') { window.Promise = null; } </script> <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script> <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script> <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script> <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script> <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script> <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script> <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script> <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script> <script type="text/javascript" id="motion.page.archive"> $('.archive-year').velocity('transition.slideLeftIn'); </script> <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script> <script type="text/javascript"> var duoshuoQuery = {short_name:"sj1370201"}; (function() { var ds = document.createElement('script'); ds.type = 'text/javascript';ds.async = true; ds.id = 'duoshuo-script'; ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'; ds.charset = 'UTF-8'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds); })(); </script> <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script> <script src="/js/src/hook-duoshuo.js"></script> <script type="text/javascript"> // Popup Window; var isfetched = false; // Search DB path; var search_path = "search.xml"; if (search_path.length == 0) { search_path = "search.xml"; } var path = "/" + search_path; // monitor main search box; function proceedsearch() { $("body").append('<div class="popoverlay">').css('overflow', 'hidden'); $('.popup').toggle(); } // search function; var searchFunc = function(path, search_id, content_id) { 'use strict'; $.ajax({ url: path, dataType: "xml", async: true, success: function( xmlResponse ) { // get the contents from search data isfetched = true; $('.popup').detach().appendTo('.header-inner'); var datas = $( "entry", xmlResponse ).map(function() { return { title: $( "title", this ).text(), content: $("content",this).text(), url: $( "url" , this).text() }; }).get(); var $input = document.getElementById(search_id); var $resultContent = document.getElementById(content_id); $input.addEventListener('input', function(){ var matchcounts = 0; var str='<ul class=\"search-result-list\">'; var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/); $resultContent.innerHTML = ""; if (this.value.trim().length > 1) { // perform local searching datas.forEach(function(data) { var isMatch = false; var content_index = []; var data_title = data.title.trim().toLowerCase(); var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase(); var data_url = decodeURIComponent(data.url); var index_title = -1; var index_content = -1; var first_occur = -1; // only match artiles with not empty titles and contents if(data_title != '') { keywords.forEach(function(keyword, i) { index_title = data_title.indexOf(keyword); index_content = data_content.indexOf(keyword); if( index_title >= 0 || index_content >= 0 ){ isMatch = true; if (i == 0) { first_occur = index_content; } } }); } // show search results if (isMatch) { matchcounts += 1; str += "<li><a href='"+ data_url +"' class='search-result-title'>"+ data_title +"</a>"; var content = data.content.trim().replace(/<[^>]+>/g,""); if (first_occur >= 0) { // cut out 100 characters var start = first_occur - 20; var end = first_occur + 80; if(start < 0){ start = 0; } if(start == 0){ end = 50; } if(end > content.length){ end = content.length; } var match_content = content.substring(start, end); // highlight all keywords keywords.forEach(function(keyword){ var regS = new RegExp(keyword, "gi"); match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>"); }); str += "<p class=\"search-result\">" + match_content +"...</p>" } str += "</li>"; } })}; str += "</ul>"; if (matchcounts == 0) { str = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>' } if (keywords == "") { str = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>' } $resultContent.innerHTML = str; }); proceedsearch(); } });} // handle and trigger popup window; $('.popup-trigger').click(function(e) { e.stopPropagation(); if (isfetched == false) { searchFunc(path, 'local-search-input', 'local-search-result'); } else { proceedsearch(); }; }); $('.popup-btn-close').click(function(e){ $('.popup').hide(); $(".popoverlay").remove(); $('body').css('overflow', ''); }); $('.popup').click(function(e){ e.stopPropagation(); }); </script> </body> </html>
{ "content_hash": "5d950c96c65be9e0a893bd72dca1b0a5", "timestamp": "", "source": "github", "line_count": 739, "max_line_length": 172, "avg_line_length": 22.216508795669824, "alnum_prop": 0.502679985381898, "repo_name": "sj1370201/sj1370201.github.io", "id": "be9916dbfe0981e5d174edec733e850813fb21fe", "size": "16632", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "archives/2016/11/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "52890" }, { "name": "HTML", "bytes": "203144" }, { "name": "JavaScript", "bytes": "331989" } ], "symlink_target": "" }
namespace verilog { namespace analysis { using verible::AutoFix; using verible::LintRuleStatus; using verible::LintViolation; using verible::SyntaxTreeContext; // Register ForbidConsecutiveNullStatementsRule VERILOG_REGISTER_LINT_RULE(ForbidConsecutiveNullStatementsRule); static const char kMessage[] = "Do not use consecutive null statements like \';;\'."; const LintRuleDescriptor& ForbidConsecutiveNullStatementsRule::GetDescriptor() { static const LintRuleDescriptor d{ .name = "forbid-consecutive-null-statements", .topic = "redundant-semicolons", .desc = "Checks that there are no occurrences of " "consecutive null statements like `;;`", }; return d; } void ForbidConsecutiveNullStatementsRule::HandleLeaf( const verible::SyntaxTreeLeaf& leaf, const SyntaxTreeContext& context) { if (context.IsInside(NodeEnum::kForSpec)) { // for loops are allowed to be: for (;;) state_ = State::kNormal; } else { switch (state_) { case State::kNormal: { if (leaf.Tag().tag == ';') { state_ = State::kExpectNonSemicolon; } break; } case State::kExpectNonSemicolon: { if (leaf.Tag().tag == ';') { violations_.insert(LintViolation( leaf, kMessage, context, {AutoFix("Remove superfluous semicolon", {leaf.get(), ""})})); } else { state_ = State::kNormal; } break; } } } } LintRuleStatus ForbidConsecutiveNullStatementsRule::Report() const { return LintRuleStatus(violations_, GetDescriptor()); } } // namespace analysis } // namespace verilog
{ "content_hash": "97bfa8f8b1bf01e0905ab93fcddcf3be", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 80, "avg_line_length": 28.084745762711865, "alnum_prop": 0.6493663246831624, "repo_name": "chipsalliance/verible", "id": "9030dcbd01a89108e89ccff66514bdaa969d2d55", "size": "2726", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "verilog/analysis/checkers/forbid_consecutive_null_statements_rule.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "3459" }, { "name": "C++", "bytes": "6853412" }, { "name": "Dockerfile", "bytes": "567" }, { "name": "JavaScript", "bytes": "1512" }, { "name": "Lex", "bytes": "58612" }, { "name": "Makefile", "bytes": "166" }, { "name": "Nix", "bytes": "558" }, { "name": "Python", "bytes": "44099" }, { "name": "Shell", "bytes": "169683" }, { "name": "Starlark", "bytes": "257597" }, { "name": "TypeScript", "bytes": "1711" }, { "name": "Yacc", "bytes": "282973" } ], "symlink_target": "" }