Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    ArrowInvalid
Message:      JSON parse error: Missing a closing quotation mark in string. in row 514
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 145, in _generate_tables
                  dataset = json.load(f)
                File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
                  return loads(fp.read(),
                File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
                  return _default_decoder.decode(s)
                File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode
                  raise JSONDecodeError("Extra data", s, end)
              json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 3891)
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1995, in _prepare_split_single
                  for _, table in generator:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 148, in _generate_tables
                  raise e
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables
                  pa_table = paj.read_json(
                File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
                File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
                File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
              pyarrow.lib.ArrowInvalid: JSON parse error: Missing a closing quotation mark in string. in row 514
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

text
string
meta
dict
package org.apache.carbondata.core.carbon; import org.apache.carbondata.core.metadata.CarbonTableIdentifier; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class CarbonTableIdentifierTest { static CarbonTableIdentifier carbonTableIdentifier; static CarbonTableIdentifier carbonTableIdentifier2; @BeforeClass public static void setup() { carbonTableIdentifier = new CarbonTableIdentifier("DatabseName", "tableName", "tableId"); } @Test public void equalsTestWithSameObject() { Boolean res = carbonTableIdentifier.equals(carbonTableIdentifier); Assert.assertTrue(res); } @Test public void equalsTestWithSimilarObject() { CarbonTableIdentifier carbonTableIdentifierTest = new CarbonTableIdentifier("DatabseName", "tableName", "tableId"); Boolean res = carbonTableIdentifier.equals(carbonTableIdentifierTest); Assert.assertTrue(res); } @Test public void equalsTestWithNullrObject() { Boolean res = carbonTableIdentifier.equals(carbonTableIdentifier2); Assert.assertTrue(!res); } @Test public void equalsTestWithStringrObject() { Boolean res = carbonTableIdentifier.equals("different class object"); Assert.assertTrue(!res); } @Test public void equalsTestWithoutDatabaseName() { CarbonTableIdentifier carbonTableIdentifierTest = new CarbonTableIdentifier(null, "tableName", "tableId"); Boolean res = carbonTableIdentifierTest.equals(carbonTableIdentifier); Assert.assertTrue(!res); } @Test public void equalsTestWithoutTableId() { CarbonTableIdentifier carbonTableIdentifierTest = new CarbonTableIdentifier("DatabseName", "tableName", null); Boolean res = carbonTableIdentifierTest.equals(carbonTableIdentifier); Assert.assertTrue(!res); } @Test public void equalsTestWithDifferentTableId() { CarbonTableIdentifier carbonTableIdentifierTest = new CarbonTableIdentifier("DatabseName", "tableName", "diffTableId"); Boolean res = carbonTableIdentifierTest.equals(carbonTableIdentifier); Assert.assertTrue(!res); } @Test public void equalsTestWithNullTableName() { CarbonTableIdentifier carbonTableIdentifierTest = new CarbonTableIdentifier("DatabseName", null, "tableId"); Boolean res = carbonTableIdentifierTest.equals(carbonTableIdentifier); Assert.assertTrue(!res); } @Test public void equalsTestWithDifferentTableName() { CarbonTableIdentifier carbonTableIdentifierTest = new CarbonTableIdentifier("DatabseName", "diffTableName", "tableId"); Boolean res = carbonTableIdentifierTest.equals(carbonTableIdentifier); Assert.assertTrue(!res); } @Test public void toStringTest() { String res = carbonTableIdentifier.toString(); System.out.printf("sfdsdf " + res); Assert.assertTrue(res.equals("DatabseName_tableName")); } }
{ "content_hash": "a90896ffe098442bf1ea7f8b2551d9a7", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 93, "avg_line_length": 35.08536585365854, "alnum_prop": 0.7612095933263816, "repo_name": "ravipesala/incubator-carbondata", "id": "2cb3e56c6367c8a32bc8ba3a3e81d0171a56d2c5", "size": "3677", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "core/src/test/java/org/apache/carbondata/core/carbon/CarbonTableIdentifierTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1639" }, { "name": "C++", "bytes": "104618" }, { "name": "CMake", "bytes": "1555" }, { "name": "Java", "bytes": "7320389" }, { "name": "Python", "bytes": "19915" }, { "name": "Scala", "bytes": "10982356" }, { "name": "Shell", "bytes": "4349" }, { "name": "Smalltalk", "bytes": "86" }, { "name": "Thrift", "bytes": "26649" } ] }
all: echo hello
{ "content_hash": "8afd72da1ce0cfd88f09a04c53f2ac3c", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 11, "avg_line_length": 8.5, "alnum_prop": 0.7058823529411765, "repo_name": "dplbsd/soc2013", "id": "aefd3e2a1ce58b699510adecea207ea500f63f50", "size": "190", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "head/tools/regression/usr.bin/make/basic/t2/Makefile", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "AGS Script", "bytes": "62471" }, { "name": "Assembly", "bytes": "4478661" }, { "name": "Awk", "bytes": "278525" }, { "name": "Batchfile", "bytes": "20417" }, { "name": "C", "bytes": "383420305" }, { "name": "C++", "bytes": "72796771" }, { "name": "CSS", "bytes": "109748" }, { "name": "ChucK", "bytes": "39" }, { "name": "D", "bytes": "3784" }, { "name": "DIGITAL Command Language", "bytes": "10640" }, { "name": "DTrace", "bytes": "2311027" }, { "name": "Emacs Lisp", "bytes": "65902" }, { "name": "EmberScript", "bytes": "286" }, { "name": "Forth", "bytes": "184405" }, { "name": "GAP", "bytes": "72156" }, { "name": "Groff", "bytes": "32248806" }, { "name": "HTML", "bytes": "6749816" }, { "name": "IGOR Pro", "bytes": "6301" }, { "name": "Java", "bytes": "112547" }, { "name": "KRL", "bytes": "4950" }, { "name": "Lex", "bytes": "398817" }, { "name": "Limbo", "bytes": "3583" }, { "name": "Logos", "bytes": "187900" }, { "name": "Makefile", "bytes": "3551839" }, { "name": "Mathematica", "bytes": "9556" }, { "name": "Max", "bytes": "4178" }, { "name": "Module Management System", "bytes": "817" }, { "name": "NSIS", "bytes": "3383" }, { "name": "Objective-C", "bytes": "836351" }, { "name": "PHP", "bytes": "6649" }, { "name": "Perl", "bytes": "5530761" }, { "name": "Perl6", "bytes": "41802" }, { "name": "PostScript", "bytes": "140088" }, { "name": "Prolog", "bytes": "29514" }, { "name": "Protocol Buffer", "bytes": "61933" }, { "name": "Python", "bytes": "299247" }, { "name": "R", "bytes": "764" }, { "name": "Rebol", "bytes": "738" }, { "name": "Ruby", "bytes": "45958" }, { "name": "Scilab", "bytes": "197" }, { "name": "Shell", "bytes": "10501540" }, { "name": "SourcePawn", "bytes": "463194" }, { "name": "SuperCollider", "bytes": "80208" }, { "name": "Tcl", "bytes": "80913" }, { "name": "TeX", "bytes": "719821" }, { "name": "VimL", "bytes": "22201" }, { "name": "XS", "bytes": "25451" }, { "name": "XSLT", "bytes": "31488" }, { "name": "Yacc", "bytes": "1857830" } ] }
from tkinter import * from tkinter.ttk import * from turtle import * import types ## helper functions for Scrolled Canvas, to forward Canvas-methods ## to ScrolledCanvas class def __methodDict(cls, _dict): """helper function for Scrolled Canvas""" baseList = list(cls.__bases__) baseList.reverse() for _super in baseList: __methodDict(_super, _dict) for key, value in cls.__dict__.items(): if type(value) == types.FunctionType: _dict[key] = value def __methods(cls): """helper function for Scrolled Canvas""" _dict = {} __methodDict(cls, _dict) return _dict.keys() __stringBody = ( 'def %(method)s(self, *args, **kw): return ' + 'self.%(attribute)s.%(method)s(*args, **kw)') def __forwardmethods(fromClass, toClass, toPart, exclude = ()): ### MANY CHANGES ### _dict_1 = {} __methodDict(toClass, _dict_1) _dict = {} mfc = __methods(fromClass) for ex in _dict_1.keys(): if ex[:1] == '_' or ex[-1:] == '_' or ex in exclude or ex in mfc: pass else: _dict[ex] = _dict_1[ex] for method, func in _dict.items(): d = {'method': method, 'func': func} if isinstance(toPart, str): execString = \ __stringBody % {'method' : method, 'attribute' : toPart} exec(execString, d) setattr(fromClass, method, d[method]) ### NEWU! class ScrolledCanvas(Frame): def __init__(self, master, width=500, height=350, canvwidth=600, canvheight=500): Frame.__init__(self, master, width=width, height=height) self._rootwindow = self.winfo_toplevel() self.width, self.height = width, height self.canvwidth, self.canvheight = canvwidth, canvheight self.bg = "white" self._canvas = Canvas(master, width=width, height=height, bg=self.bg, relief=SUNKEN, borderwidth=2) self.hscroll = Scrollbar(master, command=self._canvas.xview, orient=HORIZONTAL) self.vscroll = Scrollbar(master, command=self._canvas.yview) self._canvas.configure(xscrollcommand=self.hscroll.set, yscrollcommand=self.vscroll.set) self.rowconfigure(0, weight=1, minsize=0) self.columnconfigure(0, weight=1, minsize=0) self._canvas.grid(padx=1, in_ = self, pady=1, row=0, column=0, rowspan=1, columnspan=1, sticky='news') self.vscroll.grid(padx=1, in_ = self, pady=1, row=0, column=1, rowspan=1, columnspan=1, sticky='news') self.hscroll.grid(padx=1, in_ = self, pady=1, row=1, column=0, rowspan=1, columnspan=1, sticky='news') self._rootwindow.bind('<Configure>', self.onResize) self.after_idle(self.reset) def reset(self): self.onResize(1) def onResize(self, event): """self-explanatory""" self.update() try: region = self._canvas.bbox('all') except: return if region is not None: region = (region[0] , region[1], region[2], region[3]) self._canvas.configure(scrollregion = region) def bbox(self, *args): """ 'forward' method, which canvas itself has inherited... """ return self._canvas.bbox(*args) def cget(self, *args, **kwargs): """ 'forward' method, which canvas itself has inherited... """ return self._canvas.cget(*args, **kwargs) def config(self, *args, **kwargs): """ 'forward' method, which canvas itself has inherited... """ self._canvas.config(*args, **kwargs) def bind(self, *args, **kwargs): """ 'forward' method, which canvas itself has inherited... """ self._canvas.bind(*args, **kwargs) def unbind(self, *args, **kwargs): """ 'forward' method, which canvas itself has inherited... """ self._canvas.unbind(*args, **kwargs) def focus_force(self): """ 'forward' method, which canvas itself has inherited... """ self._canvas.focus_force() __forwardmethods(ScrolledCanvas, Canvas, '_canvas')
{ "content_hash": "9628fa4ff2e21dab18ddc59b16b50d32", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 74, "avg_line_length": 33.60629921259842, "alnum_prop": 0.5644329896907216, "repo_name": "Moggs/Workbench", "id": "ac98c8aea0573a28d6947bb417a26578d7c85cc6", "size": "4369", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Moggs/scrolledcanvas.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "67078" } ] }
package org.sakaiproject.tool.assessment.facade; import java.io.Serializable; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osid.assessment.AssessmentException; import org.sakaiproject.tool.assessment.data.dao.assessment.PublishedAssessmentData; import org.sakaiproject.tool.assessment.data.dao.assessment.PublishedSectionMetaData; import org.sakaiproject.tool.assessment.data.ifc.assessment.AssessmentIfc; import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemDataIfc; import org.sakaiproject.tool.assessment.data.ifc.assessment.SectionDataIfc; import org.sakaiproject.tool.assessment.data.ifc.assessment.SectionMetaDataIfc; import org.sakaiproject.tool.assessment.services.PersistenceService; public class PublishedSectionFacade extends SectionFacade implements Serializable, Comparable { private static final long serialVersionUID = 5788637014806801101L; private static Log log = LogFactory.getLog(PublishedSectionFacade.class); /** * This is a very important constructor. Please make sure that you have * set all the properties (declared above as private) of SectionFacade using * the "data" supplied. "data" is a org.osid.assessment.Section properties * and I use it to store info about an section. * @param data */ public PublishedSectionFacade(SectionDataIfc data){ super(data); } // the following method's signature has a one to one relationship to // org.sakaiproject.tool.assessment.osid.section.SectionImpl // which implements org.osid.assessment.Section /** * Get the Id for this SectionFacade. * @return org.osid.shared.Id */ org.osid.shared.Id getId(){ try { this.data = (SectionDataIfc) section.getData(); } catch (AssessmentException ex) { throw new DataFacadeException(ex.getMessage()); } PublishedSectionFacadeQueriesAPI publishedSectionFacadeQueries = PersistenceService.getInstance().getPublishedSectionFacadeQueries(); return publishedSectionFacadeQueries.getId(this.data.getSectionId()); } /** * Add a Meta Data to SectionFacade * @param label * @param entry */ public void addSectionMetaData(String label, String entry) { if (this.metaDataSet == null) { setSectionMetaDataSet(new HashSet()); this.metaDataMap = new HashMap(); } if (this.metaDataMap.get(label)!=null){ // just update Iterator iter = this.metaDataSet.iterator(); while (iter.hasNext()){ SectionMetaDataIfc metadata = (SectionMetaDataIfc) iter.next(); if (metadata.getLabel().equals(label)) metadata.setEntry(entry); } } else { this.metaDataMap.put(label, entry); this.data.getSectionMetaDataSet().add(new PublishedSectionMetaData((SectionDataIfc)this.data, label, entry)); this.metaDataSet = this.data.getSectionMetaDataSet(); } } public Set getItemFacadeSet() throws DataFacadeException { this.itemFacadeSet = new HashSet(); try { this.data = (SectionDataIfc) section.getData(); Set set = this.data.getItemSet(); Iterator iter = set.iterator(); while (iter.hasNext()) { PublishedItemFacade publishedItemFacade = new PublishedItemFacade((ItemDataIfc) iter .next()); this.itemFacadeSet.add(publishedItemFacade); } //this.sectionSet = data.getSectionSet(); } catch (AssessmentException ex) { throw new DataFacadeException(ex.getMessage()); } return this.itemFacadeSet; } public AssessmentIfc getAssessment() throws DataFacadeException { try { this.data = (SectionDataIfc) section.getData(); } catch (AssessmentException ex) { throw new DataFacadeException(ex.getMessage()); } return new PublishedAssessmentFacade(this.data.getAssessment()); } public void setAssessment(AssessmentIfc assessment) { this.assessment = (PublishedAssessmentFacade)assessment; PublishedAssessmentData d = (PublishedAssessmentData) ((PublishedAssessmentFacade) this.assessment).getData(); this.data.setAssessment(d); } }
{ "content_hash": "eec7fd50a95038901a569500ef55d5f4", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 137, "avg_line_length": 36.78632478632478, "alnum_prop": 0.7170074349442379, "repo_name": "payten/nyu-sakai-10.4", "id": "db989387382ff2cabd37c0d04058313adf4a7ab0", "size": "5210", "binary": false, "copies": "2", "ref": "refs/heads/scormcloud", "path": "samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/PublishedSectionFacade.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "59098" }, { "name": "ApacheConf", "bytes": "15" }, { "name": "AspectJ", "bytes": "6831" }, { "name": "Batchfile", "bytes": "5172" }, { "name": "C++", "bytes": "477" }, { "name": "CSS", "bytes": "2952622" }, { "name": "ColdFusion", "bytes": "146057" }, { "name": "HTML", "bytes": "6159499" }, { "name": "Handlebars", "bytes": "24740" }, { "name": "Java", "bytes": "42729208" }, { "name": "JavaScript", "bytes": "7061288" }, { "name": "Lasso", "bytes": "26436" }, { "name": "PHP", "bytes": "222029" }, { "name": "PLSQL", "bytes": "2161361" }, { "name": "Perl", "bytes": "72300" }, { "name": "Python", "bytes": "86996" }, { "name": "Ruby", "bytes": "26953" }, { "name": "SQLPL", "bytes": "862" }, { "name": "Shell", "bytes": "17279" }, { "name": "SourcePawn", "bytes": "1220" }, { "name": "XSLT", "bytes": "278954" } ] }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>mathcomp-finmap: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.13.1 / mathcomp-finmap - 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> mathcomp-finmap <small> 1.4.1 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-22 14:17:30 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-22 14:17:30 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.13.1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.06.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.06.1 Official 4.06.1 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Cyril Cohen &lt;cyril.cohen@inria.fr&gt;&quot; homepage: &quot;https://github.com/math-comp/finmap&quot; bug-reports: &quot;https://github.com/math-comp/finmap/issues&quot; dev-repo: &quot;git+https://github.com/math-comp/finmap.git&quot; license: &quot;CeCILL-B&quot; build: [ make &quot;-j&quot; &quot;%{jobs}%&quot; ] install: [ make &quot;install&quot; ] depends: [ &quot;coq&quot; { (&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.12~&quot;) } &quot;coq-mathcomp-ssreflect&quot; { (&gt;= &quot;1.9.0&quot; &amp; &lt; &quot;1.11~&quot;) } &quot;coq-mathcomp-bigenough&quot; { (&gt;= &quot;1.0.0&quot; &amp; &lt; &quot;1.1~&quot;) } ] tags: [ &quot;keyword:finmap&quot; &quot;keyword:finset&quot; &quot;keyword:multiset&quot; &quot;keyword:order&quot; &quot;date:2020-04-06&quot; &quot;logpath:mathcomp.finmap&quot;] authors: [ &quot;Cyril Cohen &lt;cyril.cohen@inria.fr&gt;&quot; &quot;Kazuhiko Sakaguchi &lt;sakaguchi@coins.tsukuba.ac.jp&gt;&quot; ] synopsis: &quot;Finite sets, finite maps, finitely supported functions, orders&quot; description: &quot;&quot;&quot; This library is an extension of mathematical component in order to support finite sets and finite maps on choicetypes (rather that finite types). This includes support for functions with finite support and multisets. The library also contains a generic order and set libary, which will be used to subsume notations for finite sets, eventually.&quot;&quot;&quot; url { src: &quot;https://github.com/math-comp/finmap/archive/1.4.1.tar.gz&quot; checksum: &quot;sha512=f38c70f1da125a26e9296d07a87804be00c103731cdcbdcb2a535d05d3afdc47e38bb71ea3b1601e67a1bce84fb4fe5d18fc7da58a67db700bdd0873694346a9&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-mathcomp-finmap.1.4.1 coq.8.13.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.13.1). The following dependencies couldn&#39;t be met: - coq-mathcomp-finmap -&gt; coq &lt; 8.12~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-mathcomp-finmap.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"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "1de210c0f9ef0bacf7e98de2c4610680", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 181, "avg_line_length": 45.20238095238095, "alnum_prop": 0.5628127469054517, "repo_name": "coq-bench/coq-bench.github.io", "id": "157e483df710dde5dec4712fff9144e4c1e8b2b4", "size": "7619", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.13.1/mathcomp-finmap/1.4.1.html", "mode": "33188", "license": "mit", "language": [] }
package uk.org.rbc1b.roms.db.volunteer.skill; import java.util.List; import org.hibernate.Criteria; import org.hibernate.SessionFactory; import org.hibernate.criterion.Restrictions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Repository; /** * @author ramindursingh */ @Repository public class HibernateSkillDao implements SkillDao { @Autowired private SessionFactory sessionFactory; @Override public Skill findSkill(final Integer skillId) { return (Skill) this.sessionFactory.getCurrentSession().get(Skill.class, skillId); } @SuppressWarnings("unchecked") @Override public List<Skill> findSkills(String name) { Criteria criteria = this.sessionFactory.getCurrentSession().createCriteria(Skill.class); criteria.add(Restrictions.like("name", name + "%")); return criteria.list(); } @SuppressWarnings("unchecked") @Override public List<Skill> findSkills(SkillSearchCriteria searchCriteria) { Criteria criteria = this.sessionFactory.getCurrentSession().createCriteria(Skill.class); if (searchCriteria.getDepartmentId() != null) { criteria.add(Restrictions.eq("department.id", searchCriteria.getDepartmentId())); } return criteria.list(); } @Override public void updateSkill(Skill skill) { this.sessionFactory.getCurrentSession().merge(skill); } @Override public void createSkill(Skill skill) { this.sessionFactory.getCurrentSession().save(skill); } @Override public void deleteSkill(Skill skill) { this.sessionFactory.getCurrentSession().delete(skill); } @Override @Cacheable("skillCategory.skillCategory") public SkillCategory findSkillCategory(Integer skillCategoryId) { return (SkillCategory) this.sessionFactory.getCurrentSession().get(SkillCategory.class, skillCategoryId); } @SuppressWarnings("unchecked") @Override public List<SkillCategory> findSkillCategories() { Criteria criteria = this.sessionFactory.getCurrentSession().createCriteria(SkillCategory.class); return criteria.list(); } }
{ "content_hash": "37c87aeb811b81a38fcc75217866288c", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 113, "avg_line_length": 30.635135135135137, "alnum_prop": 0.7194530216144684, "repo_name": "RBC1B/ROMS", "id": "e8bde0ac3daf920bdda611a61116fd2e149d5a71", "size": "3395", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/uk/org/rbc1b/roms/db/volunteer/skill/HibernateSkillDao.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "18428" }, { "name": "FreeMarker", "bytes": "27951" }, { "name": "Java", "bytes": "1436534" }, { "name": "JavaScript", "bytes": "187547" }, { "name": "PLSQL", "bytes": "276" }, { "name": "Shell", "bytes": "1388" } ] }
exports.create = function(_message, _talker) { var avatar; if (!_message || !_talker) return div; var div = Ti.UI.createView({ top : 0, height : Ti.UI.SIZE, width : Ti.UI.FILL, backgroundColor : (_talker == 'me') ? 'black' : 'white' }); var icon = Ti.UI.createImageView({ top : '5dp', left : '5dp', width : '75dp', }); div.add(icon); div.add(Ti.UI.createLabel({ top : '10dp', left : '95dp', right : '10dp', color : (_talker == 'me') ? '#00FF12' : '#333', textAlign : 'left', width : Ti.UI.FILL, font : { fontSize : (_talker == 'me') ? '20dp' : '24dp', fontFamily : (_talker == 'me') ? 'SourceCodePro-Medium' : 'AppleGaramond-Italic' }, text : _message })); var takePhoto = function() { require('model/camera').take({ onsuccess : function(_me) { div.removeEventListener('click', takePhoto); icon.setImage(_me); } }); }; if (_talker == 'me') { var me = require('model/tinybrain').getMe(); if (me == false) { avatar = '/assets/me.png'; Ti.UI.createNotification({ message : 'Please click on avatar to take a nice photo of you.' }).show(); div.addEventListener('click', takePhoto); } else avatar = me; } else avatar = Ti.App.Properties.getString('avatar'); icon.setImage(avatar); return div; };
{ "content_hash": "cba2109e07d8bc8041fde3d76f5079c4", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 83, "avg_line_length": 24.807692307692307, "alnum_prop": 0.5891472868217055, "repo_name": "AppWerft/TinyBrain", "id": "1fc33521aa76155796613b983e2f47fdda0a1c99", "size": "1290", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Resources/ui/chatentry.widget.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "14954" } ] }
/** * */ package com.eharmony.matching.vw.webservice.messagebodyreader.jsonexamplesmessagebodyreader; import java.io.InputStream; import java.util.Iterator; import com.eharmony.matching.vw.webservice.common.example.Example; import com.eharmony.matching.vw.webservice.core.ExampleReadException; /** * @author vrahimtoola * * Provides VW examples represented as JSON. */ public interface JsonExamplesProvider { /* * Allows the caller to consume JSON examples from an input stream. * * @param inputStream The input stream to consume JSON examples from. * * @returns An iterator that allows the caller to iterate over the examples. */ Iterator<Example> getExamplesFromStream(InputStream inputStream) throws ExampleReadException; }
{ "content_hash": "23c8e18bad5e2846b18396f785560a15", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 94, "avg_line_length": 28.25925925925926, "alnum_prop": 0.7680209698558322, "repo_name": "eHarmony/vw-webservice", "id": "c677c4aabc70d777bb77b3a9572e6cff6c053adf", "size": "763", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vw-webservice-jersey/src/main/java/com/eharmony/matching/vw/webservice/messagebodyreader/jsonexamplesmessagebodyreader/JsonExamplesProvider.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "152750" } ] }
import wx from cairis.core.armid import * import WidgetFactory from cairis.core.Borg import Borg from cairis.core.GoalAssociationParameters import GoalAssociationParameters __author__ = 'Shamal Faily' class GoalAssociationDialog(wx.Dialog): def __init__(self,parent,parameters): wx.Dialog.__init__(self,parent,GOALASSOCIATION_ID,'Goal association',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(600,400)) b = Borg() self.dbProxy = b.dbProxy self.theGoalAssociationId = -1 self.theEnvironmentName = '' self.theGoal = '' self.theGoalDimension = '' self.theGoalAssociationType = '' self.theSubGoal = '' self.theSubGoalDimension = '' self.theRationale = 'None.' self.theAlternativeFlag = 0 self.buildControls(parameters) self.commitVerb = 'Add' def buildControls(self,parameters): mainSizer = wx.BoxSizer(wx.VERTICAL) associationSizer = wx.BoxSizer(wx.HORIZONTAL) mainSizer.Add(WidgetFactory.buildCheckSizer(self,'Alternative',GOALASSOCIATION_CHECKALTERNATIVE_ID,False),0,wx.EXPAND) mainSizer.Add(associationSizer,0,wx.EXPAND) environments = self.dbProxy.getDimensionNames('environment') goals = [] associationTypes = ['and','or','conflict','responsible','obstruct','resolve'] goalDimensions = ['goal','requirement','countermeasure','obstacle'] subGoalDimensions = ['goal','requirement','role','task','usecase','countermeasure','domainproperty','obstacle','threat','vulnerability'] associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Environment',(87,30),GOALASSOCIATION_COMBOENVIRONMENT_ID,environments),0,wx.EXPAND) associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Dimension',(87,30),GOALASSOCIATION_COMBOGOALDIM_ID,goalDimensions),0,wx.EXPAND) associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Goal',(87,30),GOALASSOCIATION_COMBOGOAL_ID,goals),0,wx.EXPAND) associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Type',(87,30),GOALASSOCIATION_COMBOATYPE_ID,associationTypes),0,wx.EXPAND) associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Dimension',(87,30),GOALASSOCIATION_COMBOSUBGOALDIM_ID,subGoalDimensions),0,wx.EXPAND) associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Sub-Goal',(87,30),GOALASSOCIATION_COMBOSUBGOAL_ID,goals),0,wx.EXPAND) mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Rationale',(87,60),GOALASSOCIATION_TEXTRATIONALE_ID),1,wx.EXPAND,1,wx.EXPAND) mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,GOALASSOCIATION_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER) self.SetSizer(mainSizer) wx.EVT_BUTTON(self,GOALASSOCIATION_BUTTONCOMMIT_ID,self.onCommit) wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOENVIRONMENT_ID,self.onEnvironmentChange) wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOGOALDIM_ID,self.onGoalDimChange) wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOSUBGOALDIM_ID,self.onSubGoalDimChange) def load(self,association): self.theGoalAssociationId = association.id() envCtrl = self.FindWindowById(GOALASSOCIATION_COMBOENVIRONMENT_ID) goalCtrl = self.FindWindowById(GOALASSOCIATION_COMBOGOAL_ID) goalDimCtrl = self.FindWindowById(GOALASSOCIATION_COMBOGOALDIM_ID) atypeCtrl = self.FindWindowById(GOALASSOCIATION_COMBOATYPE_ID) subGoalCtrl = self.FindWindowById(GOALASSOCIATION_COMBOSUBGOAL_ID) subGoalDimCtrl = self.FindWindowById(GOALASSOCIATION_COMBOSUBGOALDIM_ID) alternativeCtrl = self.FindWindowById(GOALASSOCIATION_CHECKALTERNATIVE_ID) rationaleCtrl = self.FindWindowById(GOALASSOCIATION_TEXTRATIONALE_ID) buttonCtrl = self.FindWindowById(GOALASSOCIATION_BUTTONCOMMIT_ID) buttonCtrl.SetLabel('Edit') self.theEnvironmentName = association.environment() self.theGoal = association.goal() self.theGoalDimension = association.goalDimension() self.theGoalAssociationType = association.type() self.theSubGoal = association.subGoal() self.theSubGoalDimension = association.subGoalDimension() self.theAlternativeFlag = association.alternative() self.theRationale = association.rationale() envCtrl.SetValue(self.theEnvironmentName) goalCtrl.SetValue(self.theGoal) goalDimCtrl.SetValue(self.theGoalDimension) atypeCtrl.SetValue(self.theGoalAssociationType) subGoalCtrl.SetValue(self.theSubGoal) subGoalDimCtrl.SetValue(self.theSubGoalDimension) alternativeCtrl.SetValue(self.theAlternativeFlag) rationaleCtrl.SetValue(self.theRationale) self.commitVerb = 'Edit' def onCommit(self,evt): commitLabel = self.commitVerb + ' association' envCtrl = self.FindWindowById(GOALASSOCIATION_COMBOENVIRONMENT_ID) goalCtrl = self.FindWindowById(GOALASSOCIATION_COMBOGOAL_ID) goalDimCtrl = self.FindWindowById(GOALASSOCIATION_COMBOGOALDIM_ID) atypeCtrl = self.FindWindowById(GOALASSOCIATION_COMBOATYPE_ID) subGoalCtrl = self.FindWindowById(GOALASSOCIATION_COMBOSUBGOAL_ID) subGoalDimCtrl = self.FindWindowById(GOALASSOCIATION_COMBOSUBGOALDIM_ID) alternativeCtrl = self.FindWindowById(GOALASSOCIATION_CHECKALTERNATIVE_ID) rationaleCtrl = self.FindWindowById(GOALASSOCIATION_TEXTRATIONALE_ID) self.theEnvironmentName = envCtrl.GetValue() self.theGoal = goalCtrl.GetValue() self.theGoalDimension = goalDimCtrl.GetValue() self.theGoalAssociationType = atypeCtrl.GetValue() self.theSubGoal = subGoalCtrl.GetValue() self.theSubGoalDimension = subGoalDimCtrl.GetValue() self.theAlternativeFlag = alternativeCtrl.GetValue() self.theRationale = rationaleCtrl.GetValue() if (len(self.theRationale) == 0): self.theRationale = 'None.' if len(self.theEnvironmentName) == 0: dlg = wx.MessageDialog(self,'No environment selected',commitLabel,wx.OK) dlg.ShowModal() dlg.Destroy() return elif len(self.theGoalDimension) == 0: dlg = wx.MessageDialog(self,'No goal dimension selected',commitLabel,wx.OK) dlg.ShowModal() dlg.Destroy() return elif len(self.theGoal) == 0: dlg = wx.MessageDialog(self,'No goal selected',commitLabel,wx.OK) dlg.ShowModal() dlg.Destroy() return elif len(self.theSubGoalDimension) == 0: dlg = wx.MessageDialog(self,'No sub goal dimension selected',commitLabel,wx.OK) dlg.ShowModal() dlg.Destroy() return elif len(self.theSubGoal) == 0: dlg = wx.MessageDialog(self,'No sub goal selected',commitLabel,wx.OK) dlg.ShowModal() dlg.Destroy() return elif (len(self.theGoalAssociationType) == 0): dlg = wx.MessageDialog(self,'No association type selected',commitLabel,wx.OK) dlg.ShowModal() dlg.Destroy() return else: self.EndModal(GOALASSOCIATION_BUTTONCOMMIT_ID) def onEnvironmentChange(self,evt): envCtrl = self.FindWindowById(GOALASSOCIATION_COMBOENVIRONMENT_ID) goalCtrl = self.FindWindowById(GOALASSOCIATION_COMBOGOAL_ID) goalDimCtrl = self.FindWindowById(GOALASSOCIATION_COMBOGOALDIM_ID) atypeCtrl = self.FindWindowById(GOALASSOCIATION_COMBOATYPE_ID) subGoalCtrl = self.FindWindowById(GOALASSOCIATION_COMBOSUBGOAL_ID) subGoalDimCtrl = self.FindWindowById(GOALASSOCIATION_COMBOSUBGOALDIM_ID) alternativeCtrl = self.FindWindowById(GOALASSOCIATION_CHECKALTERNATIVE_ID) rationaleCtrl = self.FindWindowById(GOALASSOCIATION_TEXTRATIONALE_ID) goalCtrl.SetItems([]) subGoalCtrl.SetItems([]) goalCtrl.SetValue('') goalDimCtrl.SetValue('') atypeCtrl.SetValue('') subGoalCtrl.SetValue('') subGoalDimCtrl.SetValue('') alternativeCtrl.SetValue(0) rationaleCtrl.SetValue('') envName = envCtrl.GetStringSelection() def onGoalDimChange(self,evt): envCtrl = self.FindWindowById(GOALASSOCIATION_COMBOENVIRONMENT_ID) goalDimCtrl = self.FindWindowById(GOALASSOCIATION_COMBOGOALDIM_ID) envName = envCtrl.GetStringSelection() goalDimName = goalDimCtrl.GetStringSelection() if (envName != '') and (goalDimName != ''): goalCtrl = self.FindWindowById(GOALASSOCIATION_COMBOGOAL_ID) if (goalDimName == 'goal'): goalCtrl.SetItems(self.dbProxy.environmentGoals(envName)) elif (goalDimName == 'obstacle'): goalCtrl.SetItems(self.dbProxy.environmentObstacles(envName)) elif (goalDimName == 'countermeasure'): goalCtrl.SetItems(self.dbProxy.environmentCountermeasures(envName)) elif (goalDimName == 'requirement'): reqDict = self.dbProxy.getRequirements() descList = [] for r in reqDict.values(): descList.append(r.label()) goalCtrl.SetItems(descList) def onSubGoalDimChange(self,evt): envCtrl = self.FindWindowById(GOALASSOCIATION_COMBOENVIRONMENT_ID) subGoalDimCtrl = self.FindWindowById(GOALASSOCIATION_COMBOSUBGOALDIM_ID) envName = envCtrl.GetStringSelection() subGoalDimName = subGoalDimCtrl.GetStringSelection() if (envName != '') and (subGoalDimName != ''): subGoalCtrl = self.FindWindowById(GOALASSOCIATION_COMBOSUBGOAL_ID) if (subGoalDimName == 'goal'): subGoalCtrl.SetItems(self.dbProxy.environmentGoals(envName)) elif (subGoalDimName == 'obstacle'): subGoalCtrl.SetItems(self.dbProxy.environmentObstacles(envName)) elif (subGoalDimName == 'domainproperty'): subGoalCtrl.SetItems(self.dbProxy.environmentDomainProperties(envName)) elif (subGoalDimName == 'task'): subGoalCtrl.SetItems(self.dbProxy.environmentTasks(envName)) elif (subGoalDimName == 'usecase'): subGoalCtrl.SetItems(self.dbProxy.environmentUseCases(envName)) elif (subGoalDimName == 'countermeasure'): subGoalCtrl.SetItems(self.dbProxy.environmentCountermeasures(envName)) elif (subGoalDimName == 'requirement'): reqDict = self.dbProxy.getRequirements() descList = [] for r in reqDict.values(): descList.append(r.label()) subGoalCtrl.SetItems(descList) elif (subGoalDimName == 'role'): roleDict = self.dbProxy.getRoles() descList = [] for r in roleDict.values(): descList.append(r.name()) subGoalCtrl.SetItems(descList) def parameters(self): parameters = GoalAssociationParameters(self.theEnvironmentName,self.theGoal,self.theGoalDimension,self.theGoalAssociationType,self.theSubGoal,self.theSubGoalDimension,self.theAlternativeFlag,self.theRationale) parameters.setId(self.theGoalAssociationId) return parameters
{ "content_hash": "d86c1e1cf3f15473af24571ff27a2091", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 213, "avg_line_length": 47.62443438914027, "alnum_prop": 0.7440380047505938, "repo_name": "nathanbjenx/cairis", "id": "61ce3dc4d8dd472f6dea8aa64c64874e8a16d314", "size": "11324", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cairis/gui/GoalAssociationDialog.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "588306" }, { "name": "Dockerfile", "bytes": "829" }, { "name": "Gherkin", "bytes": "1615" }, { "name": "HTML", "bytes": "1664076" }, { "name": "JavaScript", "bytes": "416319" }, { "name": "Mako", "bytes": "13226" }, { "name": "PLpgSQL", "bytes": "1494775" }, { "name": "Python", "bytes": "4006311" }, { "name": "Shell", "bytes": "7035" } ] }
package cloud::azure::integration::servicebus::mode::messages; use base qw(cloud::azure::custom::mode); use strict; use warnings; sub get_metrics_mapping { my ($self, %options) = @_; my $metrics_mapping = { 'activemessages' => { 'output' => 'Count of active messages in a Queue/Topic', 'label' => 'active-messages', 'nlabel' => 'servicebus.namespace.messages.active.count', 'unit' => '', 'min' => '0' }, 'deadletteredmessages' => { 'output' => 'Count of dead-lettered messages in a Queue/Topic', 'label' => 'deadlettered-messages', 'nlabel' => 'servicebus.namespace.messages.deadlettered.count', 'unit' => '', 'min' => '0' }, 'incomingmessages' => { 'output' => 'Incoming Messages', 'label' => 'incoming-messages', 'nlabel' => 'servicebus.namespace.messages.incoming.count', 'unit' => '', 'min' => '0' }, 'messages' => { 'output' => 'Total messages', 'label' => 'total-messages', 'nlabel' => 'servicebus.namespace.messages.total.count', 'unit' => '', 'min' => '0' }, 'outgoingmessages' => { 'output' => 'Outgoing Messages', 'label' => 'outgoing-messages', 'nlabel' => 'servicebus.namespace.messages.outgoing.count', 'unit' => '', 'min' => '0' }, 'scheduledmessages' => { 'output' => 'Count of scheduled messages in a Queue/Topic.', 'label' => 'scheduled-messages', 'nlabel' => 'servicebus.namespace.messages.scheduled.count', 'unit' => '', 'min' => '0' }, }; return $metrics_mapping; } sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); bless $self, $class; $options{options}->add_options(arguments => { 'filter-metric:s' => { name => 'filter_metric' }, 'resource:s' => { name => 'resource' }, 'resource-group:s' => { name => 'resource_group' } }); return $self; } sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); if (!defined($self->{option_results}->{resource}) || $self->{option_results}->{resource} eq '') { $self->{output}->add_option_msg(short_msg => 'Need to specify either --resource <name> with --resource-group option or --resource <id>.'); $self->{output}->option_exit(); } my $resource = $self->{option_results}->{resource}; my $resource_group = defined($self->{option_results}->{resource_group}) ? $self->{option_results}->{resource_group} : ''; if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.ServiceBus\/namespaces\/(.*)$/) { $resource_group = $1; $resource = $2; } $self->{az_resource} = $resource; $self->{az_resource_group} = $resource_group; $self->{az_resource_type} = 'namespaces'; $self->{az_resource_namespace} = 'Microsoft.ServiceBus'; $self->{az_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 900; $self->{az_interval} = defined($self->{option_results}->{interval}) ? $self->{option_results}->{interval} : 'PT5M'; $self->{az_aggregations} = ['Average']; if (defined($self->{option_results}->{aggregation})) { $self->{az_aggregations} = []; foreach my $stat (@{$self->{option_results}->{aggregation}}) { if ($stat ne '') { push @{$self->{az_aggregations}}, ucfirst(lc($stat)); } } } foreach my $metric (keys %{$self->{metrics_mapping}}) { next if (defined($self->{option_results}->{filter_metric}) && $self->{option_results}->{filter_metric} ne '' && $metric !~ /$self->{option_results}->{filter_metric}/); push @{$self->{az_metrics}}, $metric; } } 1; __END__ =head1 MODE Check Azure Service Bus messages metrics. Example: Using resource name : perl centreon_plugins.pl --plugin=cloud::azure::integration::servicebus::plugin --mode=messages --custommode=api --resource=<busnamespace_id> --resource-group=<resourcegroup_id> --aggregation='average' --warning-servicebus-active-messages='1000' --critical-servicebus-active-messages='2000' Using resource id : perl centreon_plugins.pl --plugin=cloud::azure::integration::servicebus::plugin --mode=messages --custommode=api --resource='/subscriptions/<subscription_id>/resourceGroups/<resourcegroup_id>/providers/Microsoft.ServiceBus/namespaces/<busnamespace_id>' --aggregation='average' --warning-servicebus-active-messages='1000' --critical-servicebus-active-messages='2000' Default aggregation: 'average' / 'total', 'minimum' and 'maximum' are valid. =over 8 =item B<--resource> Set resource name or id (Required). =item B<--resource-group> Set resource group (Required if resource's name is used). =item B<--warning-*> Warning threshold where '*' can be: 'active-messages', 'deadlettered-messages', 'total-messages', 'incoming-messages', 'outgoing-messages', 'scheduled-messages'. =item B<--critical-*> Critical threshold where '*' can be: 'active-messages', 'deadlettered-messages', 'total-messages', 'incoming-messages', 'outgoing-messages', 'scheduled-messages'. =back =cut
{ "content_hash": "48fafb2fc7d23e99093a98269726ca80", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 146, "avg_line_length": 35.177215189873415, "alnum_prop": 0.5795250089960418, "repo_name": "Tpo76/centreon-plugins", "id": "b630abd1e95099fc68b827643c309182e7cc3db9", "size": "6318", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cloud/azure/integration/servicebus/mode/messages.pm", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "719" }, { "name": "Perl", "bytes": "19128067" } ] }
var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() { "use strict"; var _cssRatioSetter = function(pt, cssp, mod) { //Takes an individual CSSPropTween and converts it into a type:2 that has a setRatio that does everything the regular CSSPlugin.setRatio() method does but applying the mod() too. We do this to keep the main CSSPlugin.setRatio() as fast as possible (the vast majority of times, no mod() will be necessary) var type = pt.type, oldSetRatio = pt.setRatio, tween = cssp._tween, target = cssp._target; pt.type = 2; pt.m = mod; pt.setRatio = function(v) { var min = 0.000001, val, str, i; if (v === 1 && (tween._time === tween._duration || tween._time === 0)) { if (type !== 2) { if (pt.r && type !== -1) { val = Math.round(pt.s + pt.c); if (!type) { pt.t[pt.p] = mod(val + pt.xs0, target); } else if (type === 1) { str = pt.xs0 + val + pt.xs1; for (i = 1; i < pt.l; i++) { str += pt["xn"+i] + pt["xs"+(i+1)]; } pt.t[pt.p] = mod(str, target); } } else { pt.t[pt.p] = mod(pt.e, target); } } else { oldSetRatio.call(pt, v); } } else if (v || !(tween._time === tween._duration || tween._time === 0) || tween._rawPrevTime === -0.000001) { val = pt.c * v + pt.s; if (pt.r) { val = Math.round(val); } else if (val < min) if (val > -min) { val = 0; } if (!type) { pt.t[pt.p] = mod(val + pt.xs0, target); } else if (type === 1) { str = pt.xs0 + val + pt.xs1; for (i = 1; i < pt.l; i++) { str += pt["xn"+i] + pt["xs"+(i+1)]; } pt.t[pt.p] = mod(str, target); } else if (type === -1) { //non-tweening value pt.t[pt.p] = mod(pt.xs0, target); } else if (oldSetRatio) { oldSetRatio.call(pt, v); } } else { if (type !== 2) { pt.t[pt.p] = mod(pt.b, target); } else { oldSetRatio.call(pt, v); } } }; }, _modCSS = function(lookup, cssp) { var pt = cssp._firstPT, hasBezier = (lookup.rotation && cssp._overwriteProps.join("").indexOf("bezier") !== -1); //when a Bezier tween is applying autoRotation, it's a very special case we need to handle differently. while (pt) { if (typeof(lookup[pt.p]) === "function") { _cssRatioSetter(pt, cssp, lookup[pt.p]); } else if (hasBezier && pt.n === "bezier" && pt.plugin._overwriteProps.join("").indexOf("rotation") !== -1) { pt.data.mod = lookup.rotation; } pt = pt._next; } }, ModifiersPlugin = _gsScope._gsDefine.plugin({ propName: "modifiers", version: "0.0.3", API: 2, //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. init: function(target, value, tween) { this._tween = tween; this._vars = value; return true; }, initAll: function() { var tween = this._tween, lookup = this._vars, mpt = this, pt = tween._firstPT, val, next; while (pt) { next = pt._next; //record here, because it may get removed val = lookup[pt.n]; if (pt.pg) { if (pt.t._propName === "css") { //handle CSSPlugin uniquely (for performance, due to the fact that the values almost always are a concatenation of numbers and strings, like suffixes, and we don't want to slow down the regular CSSPlugin setRatio() performance with conditional checks for if the value needs to be modded, so we pull any modding prop out and change it to a type:2 one that simply calls a setRatio() method where we encapsulate the modding and update all together. That way, it says in the main CSSProp linked list and just has some custom logic applied to it inside its setRatio()) _modCSS(lookup, pt.t); } else if (pt.t !== mpt) { //don't run modProps on modProps :) val = lookup[pt.t._propName]; pt.t._mod((typeof(val) === "object") ? val : lookup); } } else if (typeof(val) === "function") { if (pt.f === 2 && pt.t) { //a blob (text containing multiple numeric values) pt.t._applyPT.m = val; } else { this._add(pt.t, pt.p, pt.s, pt.c, val); //remove from linked list if (next) { next._prev = pt._prev; } if (pt._prev) { pt._prev._next = next; } else if (tween._firstPT === pt) { tween._firstPT = next; } pt._next = pt._prev = null; tween._propLookup[pt.n] = mpt; } } pt = next; } return false; } }), p = ModifiersPlugin.prototype; p._add = function(target, p, s, c, mod) { this._addTween(target, p, s, s + c, p, mod); this._overwriteProps.push(p); }; p = _gsScope._gsDefine.globals.TweenLite.version.split("."); if (Number(p[0]) <= 1 && Number(p[1]) < 19 && _gsScope.console) { console.log("ModifiersPlugin requires GSAP 1.19.0 or later."); } }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date) (function(name) { "use strict"; var getGlobal = function() { return (_gsScope.GreenSockGlobals || _gsScope)[name]; }; if (typeof(module) !== "undefined" && module.exports) { //node require("../TweenLite.js"); module.exports = getGlobal(); } else if (typeof(define) === "function" && define.amd) { //AMD define(["TweenLite"], getGlobal); } }("ModifiersPlugin"));
{ "content_hash": "4049a4a82dcd45cce7782bd913284660", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 602, "avg_line_length": 35.95679012345679, "alnum_prop": 0.5610300429184549, "repo_name": "youonlyliveonce/24-1.studio", "id": "f1a1ab9a9cd236b57bf550ca5fb03f56889b2d06", "size": "6207", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "src/javascript/vendor/gsap/uncompressed/plugins/ModifiersPlugin.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "74976" }, { "name": "HTML", "bytes": "2785" }, { "name": "JavaScript", "bytes": "126034" }, { "name": "PHP", "bytes": "640275" } ] }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.12"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Tempest: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="icon.png"/></td> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Tempest </div> </td> <td> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.12 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('struct_tempest_1_1_d_x11_texture.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">Tempest::DX11Texture Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a>, including all inherited members.</p> <table class="directory"> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>depth</b> (defined in <a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a>)</td><td class="entry"><a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>rt</b> (defined in <a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a>)</td><td class="entry"><a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>rtMip</b> (defined in <a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a>)</td><td class="entry"><a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>texture</b> (defined in <a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a>)</td><td class="entry"><a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>view</b> (defined in <a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a>)</td><td class="entry"><a class="el" href="struct_tempest_1_1_d_x11_texture.html">Tempest::DX11Texture</a></td><td class="entry"></td></tr> </table></div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Mon Nov 14 2016 00:11:28 for Tempest by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li> </ul> </div> </body> </html>
{ "content_hash": "7592000b55d3c00d1345d015833262fc", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 303, "avg_line_length": 50.741379310344826, "alnum_prop": 0.663778457356439, "repo_name": "enotio/Tempest", "id": "dd1af1c4438452e892124baad29338d618755f14", "size": "5886", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/html/struct_tempest_1_1_d_x11_texture-members.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "209674" }, { "name": "C++", "bytes": "997335" }, { "name": "CSS", "bytes": "26404" }, { "name": "Java", "bytes": "10502" }, { "name": "Makefile", "bytes": "3047" }, { "name": "Objective-C", "bytes": "387" }, { "name": "Objective-C++", "bytes": "50885" }, { "name": "QML", "bytes": "1647" }, { "name": "QMake", "bytes": "11871" } ] }
<?php namespace SquadIT\WebApp\Controller; /* * This file is part of the SquadIT.WebApp package. */ use Neos\Flow\Annotations as Flow; use Neos\Flow\Persistence\Doctrine\PersistenceManager; use Neos\Flow\Security\Account; use Neos\Flow\Security\Policy\PolicyService; use SquadIT\WebApp\Domain\Model\Squad; use SquadIT\WebApp\Domain\Repository\SquadRepository; use SquadIT\WebApp\Domain\Model\User; use SquadIT\WebApp\Service\ImageProcessingService; class SquadController extends AbstractUserAwareActionController { /** * @Flow\Inject * @var PolicyService */ protected $policyService; /** * @Flow\Inject * @var PersistenceManager */ protected $persistenceManager; /** * @Flow\Inject * @var SquadRepository */ protected $squadRepository; /** * @Flow\Inject * @var ImageProcessingService */ protected $imageProcessingService; /** * @Flow\Inject * @var \Neos\Flow\ResourceManagement\ResourceManager */ protected $resourceManager; /** * @param Squad $squad * @return void */ public function showAction(Squad $squad) { $this->view->assign('squad', $squad); } /** * @return void */ public function newAction() { } /** * @return void */ public function initializeCreateAction() { $propertyConfiguration = $this->arguments->getArgument('newSquad')->getPropertyMappingConfiguration(); $propertyConfiguration->forProperty('members')->allowAllProperties(); } /** * @param Squad $newSquad * @return void */ public function createAction(Squad $newSquad) { /** @var PersistentResource */ $profilepicture = $newSquad->getProfilepicture(); if ($profilepicture) { // delete the uploaded profile picture $this->resourceManager->deleteResource($profilepicture); /** @var PersistentResource */ $processedImage = $this->imageProcessingService->processProfilepicture($profilepicture); // set the processed one $newSquad->setProfilepicture($processedImage); } $this->squadRepository->add($newSquad); $this->addFlashMessage('Created a new squad.'); $this->redirect('show', null, null, array('squad' => $newSquad)); } /** * @param Squad $squad * @return void */ public function editAction(Squad $squad) { $this->view->assign('squad', $squad); } /** * @return void */ public function initializeUpdateAction() { $propertyConfiguration = $this->arguments->getArgument('squad')->getPropertyMappingConfiguration(); $propertyConfiguration->forProperty('members')->allowAllProperties(); } /** * @param Squad $squad * @return void */ public function updateAction(Squad $squad) { // update and persist so that the resource is actually imported thus accessible to the processing service $this->squadRepository->update($squad); $this->persistenceManager->persistAll(); /** @var PersistentResource */ $processedImageResource = $this->imageProcessingService->processProfilepicture($squad->getProfilepicture()); $squad->setProfilepicture($processedImageResource); // set the processed picture, uploaded one will be deleted $this->squadRepository->update($squad); $this->addFlashMessage('Updated %s', null, null, array($squad->getName())); $this->redirect('show', null, null, array('squad' => $squad)); } /** * @param Squad $squad * @return void */ public function deleteAction(Squad $squad) { if ($squad->getProfilepicture() != null) { $this->resourceManager->deleteResource($squad->getProfilepicture()); } $this->squadRepository->remove($squad); $this->addFlashMessage('Deleted the squad.'); $this->redirect('index', 'Standard'); } /** * Change the team captain of a squad * * @param User $user * @param Squad $squad * @return void */ public function passLeadershipAction(User $user, Squad $squad) { $squad->setLeader($user); $this->squadRepository->update($squad); $this->addFlashMessage('%s is now team captain of %s', null, null, array($user->getFullName(), $squad->getName())); $this->redirect('show', null, null, array('squad' => $squad)); } }
{ "content_hash": "674956e0b3c8c86d38d7db8f26e0972d", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 124, "avg_line_length": 27.53012048192771, "alnum_prop": 0.6196936542669584, "repo_name": "PalatinCoder/SquadIT.WebApp", "id": "0be3d21db5b0875e0a590ab8e899fa44eb5522c6", "size": "4570", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Classes/Controller/SquadController.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "543" }, { "name": "Gherkin", "bytes": "6139" }, { "name": "HTML", "bytes": "44149" }, { "name": "PHP", "bytes": "115400" } ] }
package stats import ( "time" ) type Void struct{} func (v *Void) Add(name string, dur time.Duration) {} func (v *Void) Error(name string) {}
{ "content_hash": "b6e4f0a17fbdfb9ec06baef6659f9433", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 53, "avg_line_length": 13.363636363636363, "alnum_prop": 0.6598639455782312, "repo_name": "localhots/satan", "id": "b8b814ed254375c3125b319b8369448c04b49117", "size": "147", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "stats/void.go", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2055" }, { "name": "Go", "bytes": "30045" }, { "name": "HTML", "bytes": "689" }, { "name": "JavaScript", "bytes": "14170" }, { "name": "Python", "bytes": "542" } ] }
<?php namespace common\models; use Yii; use yii\base\NotSupportedException; use yii\behaviors\TimestampBehavior; use yii\db\ActiveRecord; use yii\web\IdentityInterface; /** * User model * * @property integer $id * @property string $username * @property string $password_hash * @property string $password_reset_token * @property string $email * @property string $auth_key * @property integer $status * @property integer $created_at * @property integer $updated_at * @property string $password write-only password */ class User extends ActiveRecord implements IdentityInterface { const STATUS_DELETED = 0; const STATUS_ACTIVE = 1; /** * @inheritdoc */ public static function tableName() { return '{{%user}}'; } /** * @inheritdoc */ public function behaviors() { return [ TimestampBehavior::className(), ]; } /** * @inheritdoc */ public function rules() { return [ ['status', 'default', 'value' => self::STATUS_ACTIVE], ['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED]], ]; } /** * @inheritdoc */ public static function findIdentity($id) { return static::findOne(['id' => $id, 'status' => self::STATUS_ACTIVE]); } /** * @inheritdoc */ public static function findIdentityByAccessToken($token, $type = null) { throw new NotSupportedException('"findIdentityByAccessToken" is not implemented.'); } /** * Finds user by username * * @param string $username * @return static|null */ public static function findByUsername($username) { return static::findOne(['username' => $username, 'status' => self::STATUS_ACTIVE]); } /** * Finds user by password reset token * * @param string $token password reset token * @return static|null */ public static function findByPasswordResetToken($token) { if (!static::isPasswordResetTokenValid($token)) { return null; } return static::findOne([ 'password_reset_token' => $token, 'status' => self::STATUS_ACTIVE, ]); } /** * Finds out if password reset token is valid * * @param string $token password reset token * @return bool */ public static function isPasswordResetTokenValid($token) { if (empty($token)) { return false; } $timestamp = (int) substr($token, strrpos($token, '_') + 1); $expire = Yii::$app->params['user.passwordResetTokenExpire']; return $timestamp + $expire >= time(); } /** * @inheritdoc */ public function getId() { return $this->getPrimaryKey(); } /** * @inheritdoc */ public function getAuthKey() { return $this->auth_key; } /** * @inheritdoc */ public function validateAuthKey($authKey) { return $this->getAuthKey() === $authKey; } /** * Validates password * * @param string $password password to validate * @return bool if password provided is valid for current user */ public function validatePassword($password) { return Yii::$app->security->validatePassword($password, $this->password_hash); } /** * Generates password hash from password and sets it to the model * * @param string $password */ public function setPassword($password) { $this->password_hash = Yii::$app->security->generatePasswordHash($password); } /** * Generates "remember me" authentication key */ public function generateAuthKey() { $this->auth_key = Yii::$app->security->generateRandomString(); } /** * Generates new password reset token */ public function generatePasswordResetToken() { $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time(); } /** * Removes password reset token */ public function removePasswordResetToken() { $this->password_reset_token = null; } }
{ "content_hash": "d0367d7bee18f3eda03d583abf43dc97", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 97, "avg_line_length": 22.55026455026455, "alnum_prop": 0.5774284373533553, "repo_name": "tianakong/admin", "id": "708971c32272eec76c61d3be8db8030eb8ef2fd5", "size": "4262", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "common/models/User.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2066" }, { "name": "CSS", "bytes": "424564" }, { "name": "HTML", "bytes": "2599" }, { "name": "JavaScript", "bytes": "1817695" }, { "name": "PHP", "bytes": "234663" }, { "name": "Shell", "bytes": "3256" } ] }
static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CRunFrame IMPLEMENT_DYNCREATE(CRunFrame, CFrameWnd) CRunFrame::CRunFrame() { } CRunFrame::~CRunFrame() { } BEGIN_MESSAGE_MAP(CRunFrame, CFrameWnd) //{{AFX_MSG_MAP(CRunFrame) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CRunFrame message handlers BOOL CRunFrame::PreCreateWindow(CREATESTRUCT& cs) { if (!CFrameWnd::PreCreateWindow(cs)) return FALSE; // cs.style &= ~WS_BORDER; cs.dwExStyle &= ~WS_EX_CLIENTEDGE; return TRUE; }
{ "content_hash": "467fc08e1b45d3550785e63893fc6bc4", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 77, "avg_line_length": 19.694444444444443, "alnum_prop": 0.5458392101551481, "repo_name": "qinyong99/SuperCxHMI", "id": "555765ee13ff380a089c1c8e10bf7d0e044516c5", "size": "870", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ui/CxRunCtrl/RunFrame.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1943091" }, { "name": "C++", "bytes": "6740361" }, { "name": "JavaScript", "bytes": "13745" }, { "name": "Objective-C", "bytes": "225865" }, { "name": "Python", "bytes": "10987" }, { "name": "Shell", "bytes": "6892" }, { "name": "Visual Basic", "bytes": "313" } ] }
require 'aws-sdk' module CSI module AWS # This module provides a client for making API requests to Amazon Lightsail. module Lightsail @@logger = CSI::Plugins::CSILogger.create # Supported Method Parameters:: # CSI::AWS::Lightsail.connect( # region: 'required - region name to connect (eu-west-1, ap-southeast-1, ap-southeast-2, eu-central-1, ap-northeast-2, ap-northeast-1, us-east-1, sa-east-1, us-west-1, us-west-2)', # access_key_id: 'required - Use AWS STS for best privacy (i.e. temporary access key id)', # secret_access_key: 'required - Use AWS STS for best privacy (i.e. temporary secret access key', # sts_session_token: 'optional - Temporary token returned by STS client for best privacy' # ) public_class_method def self.connect(opts = {}) region = opts[:region].to_s.scrub.chomp.strip access_key_id = opts[:access_key_id].to_s.scrub.chomp.strip secret_access_key = opts[:secret_access_key].to_s.scrub.chomp.strip sts_session_token = opts[:sts_session_token].to_s.scrub.chomp.strip @@logger.info('Connecting to AWS Lightsail...') if sts_session_token == '' lightsail_obj = Aws::Lightsail::Client.new( region: region, access_key_id: access_key_id, secret_access_key: secret_access_key ) else lightsail_obj = Aws::Lightsail::Client.new( region: region, access_key_id: access_key_id, secret_access_key: secret_access_key, session_token: sts_session_token ) end @@logger.info("complete.\n") lightsail_obj rescue StandardError => e raise e end # Supported Method Parameters:: # CSI::AWS::Lightsail.disconnect( # lightsail_obj: 'required - lightsail_obj returned from #connect method' # ) public_class_method def self.disconnect(opts = {}) lightsail_obj = opts[:lightsail_obj] @@logger.info('Disconnecting...') lightsail_obj = nil @@logger.info("complete.\n") lightsail_obj rescue StandardError => e raise e end # Author(s):: Jacob Hoopes <jake.hoopes@gmail.com> public_class_method def self.authors "AUTHOR(S): Jacob Hoopes <jake.hoopes@gmail.com> " end # Display Usage for this Module public_class_method def self.help puts "USAGE: lightsail_obj = #{self}.connect( region: 'required - region name to connect (eu-west-1, ap-southeast-1, ap-southeast-2, eu-central-1, ap-northeast-2, ap-northeast-1, us-east-1, sa-east-1, us-west-1, us-west-2)', access_key_id: 'required - Use AWS STS for best privacy (i.e. temporary access key id)', secret_access_key: 'required - Use AWS STS for best privacy (i.e. temporary secret access key', sts_session_token: 'optional - Temporary token returned by STS client for best privacy' ) puts lightsail_obj.public_methods #{self}.disconnect( lightsail_obj: 'required - lightsail_obj returned from #connect method' ) #{self}.authors " end end end end
{ "content_hash": "3f97ce5a68f6c2d9c24969cf83cac8f3", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 190, "avg_line_length": 36.6, "alnum_prop": 0.6044323011536127, "repo_name": "ninp0/csi", "id": "8e88bb13a9396fe3c8ca4dec58d793191313d7d3", "size": "3325", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/csi/aws/lightsail.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "1351941" }, { "name": "Shell", "bytes": "72652" } ] }
"""Tests of hashing tools.""" import os import unittest import file_tools import hashing_tools import working_directory def GenerateTestTree(noise, path): """Generate an interesting tree for testing. Args: noise: A string to inject to vary tree content. path: Location to emit tree (should not exist). """ os.mkdir(path) b = os.path.join(path, 'b' + noise) os.mkdir(b) b1 = os.path.join(path, 'b1' + noise) os.mkdir(b1) b2 = os.path.join(path, 'b2' + noise) file_tools.WriteFile('inside b2' + noise, b2) c = os.path.join(b, 'c' + noise) file_tools.WriteFile('inside c' + noise, c) class TestHashingTools(unittest.TestCase): def test_File(self): # Check that one file works. with working_directory.TemporaryWorkingDirectory() as work_dir: filename1 = os.path.join(work_dir, 'myfile1') filename2 = os.path.join(work_dir, 'myfile2') file_tools.WriteFile('booga', filename1) file_tools.WriteFile('booga', filename2) h1 = hashing_tools.StableHashPath(filename1) h2 = hashing_tools.StableHashPath(filename2) self.assertEqual(h1, h2) self.assertEqual(40, len(h1)) def test_NonmatchingFile(self): # Check that one file works. with working_directory.TemporaryWorkingDirectory() as work_dir: filename1 = os.path.join(work_dir, 'myfile1') filename2 = os.path.join(work_dir, 'myfile2') file_tools.WriteFile('booga', filename1) file_tools.WriteFile('boo', filename2) h1 = hashing_tools.StableHashPath(filename1) h2 = hashing_tools.StableHashPath(filename2) self.assertNotEqual(h1, h2) self.assertEqual(40, len(h1)) self.assertEqual(40, len(h2)) def test_Directory(self): # Check that a directory tree works. with working_directory.TemporaryWorkingDirectory() as work_dir: a1 = os.path.join(work_dir, 'a1') a2 = os.path.join(work_dir, 'a2') for path in [a1, a2]: GenerateTestTree('gorp', path) h1 = hashing_tools.StableHashPath(a1) h2 = hashing_tools.StableHashPath(a2) self.assertEqual(h1, h2) self.assertEqual(40, len(h1)) def test_NonmatchingDirectory(self): # Check that a directory tree works. with working_directory.TemporaryWorkingDirectory() as work_dir: a1 = os.path.join(work_dir, 'a1') a2 = os.path.join(work_dir, 'a2') GenerateTestTree('gorp', a1) GenerateTestTree('gorpy', a2) h1 = hashing_tools.StableHashPath(a1) h2 = hashing_tools.StableHashPath(a2) self.assertNotEqual(h1, h2) self.assertEqual(40, len(h1)) self.assertEqual(40, len(h2)) if __name__ == '__main__': unittest.main()
{ "content_hash": "bde10648d1a603a71a4cb6678bc19aef", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 67, "avg_line_length": 32.24096385542169, "alnum_prop": 0.6666666666666666, "repo_name": "Lind-Project/native_client", "id": "42da0c93eb75bbfbfe13f1398075efef2e4cfb75", "size": "2867", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "build/hashing_tools_test.py", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "149910" }, { "name": "Batchfile", "bytes": "10418" }, { "name": "C", "bytes": "10425715" }, { "name": "C++", "bytes": "7409986" }, { "name": "HTML", "bytes": "183711" }, { "name": "JavaScript", "bytes": "5925" }, { "name": "Logos", "bytes": "647" }, { "name": "Makefile", "bytes": "65439" }, { "name": "Objective-C++", "bytes": "2658" }, { "name": "Python", "bytes": "2127774" }, { "name": "Ragel", "bytes": "104506" }, { "name": "Shell", "bytes": "454354" } ] }
<!-- Copyright 2014-2016 CyberVision, Inc. 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. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.kaaproject.kaa.examples.econais</groupId> <version>1.3.0</version> <artifactId>ec19d</artifactId> </parent> <groupId>org.kaaproject.kaa.examples.econais.ec19d</groupId> <artifactId>trafficlights-driver</artifactId> <packaging>jar</packaging> <name>Kaa traffic lights demo</name> <url>http://kaaproject.org</url> <properties> <main.dir>${basedir}/../../..</main.dir> </properties> <dependencies> <dependency> <groupId>org.kaaproject.kaa.examples</groupId> <artifactId>common</artifactId> </dependency> </dependencies> <build> <resources> <resource> <directory>${project.build.directory}/generated-resources</directory> <filtering>true</filtering> </resource> </resources> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptors> <descriptor>${project.basedir}/assembly/src-c.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-resources</id> <phase>generate-resources</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/generated-resources/demo/trafficlights </outputDirectory> <resources> <resource> <directory>resources</directory> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
{ "content_hash": "e33fb6ca84b07bc2431865729f885166", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 110, "avg_line_length": 37.24175824175824, "alnum_prop": 0.5187370905871939, "repo_name": "maxml/sample-apps", "id": "15050f926bd4397a3fdd7cc1fd6b2e4eef6a9458", "size": "3389", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "econais/ec19d/trafficlights-driver/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "23868" }, { "name": "C", "bytes": "5016986" }, { "name": "C++", "bytes": "420951" }, { "name": "CMake", "bytes": "52788" }, { "name": "HTML", "bytes": "1482" }, { "name": "Java", "bytes": "2114878" }, { "name": "JavaScript", "bytes": "4701" }, { "name": "Makefile", "bytes": "9995" }, { "name": "Objective-C", "bytes": "382359" }, { "name": "Shell", "bytes": "73744" } ] }
"""Model configurations.""" from magenta.models.music_vae import configs from magenta.models.music_vae import data from magenta.models.music_vae import data_hierarchical MUSIC_VAE_CONFIG = {} melody_2bar_converter = data.OneHotMelodyConverter( skip_polyphony=False, max_bars=100, # Truncate long melodies before slicing. max_tensors_per_notesequence=None, slice_bars=2, gap_bars=None, steps_per_quarter=4, dedupe_event_lists=False) mel_2bar_nopoly_converter = data.OneHotMelodyConverter( skip_polyphony=True, max_bars=100, # Truncate long melodies before slicing. max_tensors_per_notesequence=None, slice_bars=2, gap_bars=None, steps_per_quarter=4, dedupe_event_lists=False) melody_16bar_converter = data.OneHotMelodyConverter( skip_polyphony=False, max_bars=100, # Truncate long melodies before slicing. slice_bars=16, gap_bars=16, max_tensors_per_notesequence=None, steps_per_quarter=4, dedupe_event_lists=False) multitrack_default_1bar_converter = data_hierarchical.MultiInstrumentPerformanceConverter( num_velocity_bins=8, hop_size_bars=1, min_num_instruments=2, max_num_instruments=8, max_events_per_instrument=64) multitrack_zero_1bar_converter = data_hierarchical.MultiInstrumentPerformanceConverter( num_velocity_bins=8, hop_size_bars=1, min_num_instruments=0, max_num_instruments=8, min_total_events=0, max_events_per_instrument=64, drop_tracks_and_truncate=True) MUSIC_VAE_CONFIG['melody-2-big'] = configs.CONFIG_MAP[ 'cat-mel_2bar_big']._replace(data_converter=melody_2bar_converter) MUSIC_VAE_CONFIG['melody-16-big'] = configs.CONFIG_MAP[ 'hierdec-mel_16bar']._replace(data_converter=melody_16bar_converter) MUSIC_VAE_CONFIG['multi-1-big'] = configs.CONFIG_MAP[ 'hier-multiperf_vel_1bar_big']._replace( data_converter=multitrack_default_1bar_converter) MUSIC_VAE_CONFIG['multi-0min-1-big'] = configs.CONFIG_MAP[ 'hier-multiperf_vel_1bar_big']._replace( data_converter=multitrack_zero_1bar_converter) MUSIC_VAE_CONFIG['melody-2-big-nopoly'] = configs.Config( model=configs.MusicVAE(configs.lstm_models.BidirectionalLstmEncoder(), configs.lstm_models.CategoricalLstmDecoder()), hparams=configs.merge_hparams( configs.lstm_models.get_default_hparams(), configs.HParams( batch_size=512, max_seq_len=32, # 2 bars w/ 16 steps per bar z_size=512, enc_rnn_size=[2048], dec_rnn_size=[2048, 2048, 2048], )), note_sequence_augmenter=data.NoteSequenceAugmenter(transpose_range=(-5, 5)), data_converter=mel_2bar_nopoly_converter)
{ "content_hash": "b744f79242e83d7b56bc9fab4a939315", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 90, "avg_line_length": 35.06410256410256, "alnum_prop": 0.7016453382084095, "repo_name": "magenta/symbolic-music-diffusion", "id": "52c6bad29d2587e749c194c61eba53f6a5aee517", "size": "3339", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "config.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "177372" } ] }
package soottocfg.ast.Absyn; // Java Package generated by the BNF Converter. public abstract class ProgramFile implements java.io.Serializable { public abstract <R,A> R accept(ProgramFile.Visitor<R,A> v, A arg); public interface Visitor <R,A> { public R visit(soottocfg.ast.Absyn.JhPrg p, A arg); } }
{ "content_hash": "d51aeae6ad33fd20d7df54f814066093", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 76, "avg_line_length": 31.4, "alnum_prop": 0.732484076433121, "repo_name": "jayhorn/jayhorn", "id": "ef6be464f5d49aa98c25d06927b83227695300c8", "size": "314", "binary": false, "copies": "1", "ref": "refs/heads/devel", "path": "soottocfg/src/main/java/soottocfg/ast/Absyn/ProgramFile.java", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "198" }, { "name": "Java", "bytes": "1461733" }, { "name": "Makefile", "bytes": "162" }, { "name": "Shell", "bytes": "1819" } ] }
{% load url from future %} {% load account_tags %} {% load i18n %} <div class="account-links row"> {% if user.is_authenticated %} {% if request.user.get_full_name%} <span> <i class="icon icon-user"></i> <strong>{% user_display request.user %}</strong> </span> | {% endif %} {% if user.is_staff %} <a href="{% url 'admin:index' %}" class="action">{% trans "Admin" %}</a> | {% endif %} <a href="{% url 'dashboard' %}">{% trans "Dashboard" %}</a> | <a href="{% url 'account_settings' %}">{% trans "Settings" %}</a> <form action="{% url 'account_logout' %}" method="post">{% csrf_token %} <button type="submit">{% trans "Log out" %}</button> </form> {% else %} <a class="login" href="{% url 'account_login' %}">{% trans "Log in" %}</a> {% if config.REGISTRATION_STATUS == 'open' or config.REGISTRATION_STATUS == 'soon' %} <a class="signup" href="{% url 'account_signup' %}">{% trans "Sign up" %}</a> {% endif %} {% endif %} </div>
{ "content_hash": "1fc829bc1bf7b493a7c1cbd624999332", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 93, "avg_line_length": 37.96666666666667, "alnum_prop": 0.4784899034240562, "repo_name": "smellman/sotmjp-website", "id": "9b79ae244c7c3cdf6687e426c4925fc227f25304", "size": "1139", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sotmjp/templates/_account_bar.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "85777" }, { "name": "HTML", "bytes": "167213" }, { "name": "JavaScript", "bytes": "428034" }, { "name": "Python", "bytes": "69456" }, { "name": "Shell", "bytes": "16242" } ] }
// Copyright (c) 2016 Sarin Na Wangkanai, All Rights Reserved. // The GNU GPLv3. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Moq; using System.ComponentModel.Design; using Wangkanai.Detection; namespace Wangkanai.Responsive.Test { public class ResponsiveTestAbstract { private HttpContext CreateContext() => new DefaultHttpContext(); public virtual IResponsiveService CreateService(string agent) { var context = CreateContext(agent); var service = new Mock<IResponsiveService>(); service.Setup(f => f.Context).Returns(context); service.Setup(f => f.UserAgent).Returns(new UserAgent(agent)); return service.Object; } public virtual HttpContext CreateContext(string value) { var context = CreateContext(); var header = "User-Agent"; context.Request.Headers.Add(header, new[] { value }); return context; } } }
{ "content_hash": "e6f428ad74ad76d56c0982f09a01ee9b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 78, "avg_line_length": 35.16129032258065, "alnum_prop": 0.6577981651376147, "repo_name": "wangkanai/Responsive", "id": "a9baba3a37753cf713a844e4a225c04f9ac52c2c", "size": "1092", "binary": false, "copies": "2", "ref": "refs/heads/dev", "path": "test/Wangkanai.Responsive.Test/ResponsiveTestAbstract.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "506" }, { "name": "C#", "bytes": "38288" }, { "name": "PowerShell", "bytes": "6031" }, { "name": "Shell", "bytes": "7568" } ] }
package com.amazonaws.services.translate.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.translate.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * TextTranslationJobProperties JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TextTranslationJobPropertiesJsonUnmarshaller implements Unmarshaller<TextTranslationJobProperties, JsonUnmarshallerContext> { public TextTranslationJobProperties unmarshall(JsonUnmarshallerContext context) throws Exception { TextTranslationJobProperties textTranslationJobProperties = new TextTranslationJobProperties(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("JobId", targetDepth)) { context.nextToken(); textTranslationJobProperties.setJobId(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("JobName", targetDepth)) { context.nextToken(); textTranslationJobProperties.setJobName(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("JobStatus", targetDepth)) { context.nextToken(); textTranslationJobProperties.setJobStatus(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("JobDetails", targetDepth)) { context.nextToken(); textTranslationJobProperties.setJobDetails(JobDetailsJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("SourceLanguageCode", targetDepth)) { context.nextToken(); textTranslationJobProperties.setSourceLanguageCode(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("TargetLanguageCodes", targetDepth)) { context.nextToken(); textTranslationJobProperties.setTargetLanguageCodes(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)) .unmarshall(context)); } if (context.testExpression("TerminologyNames", targetDepth)) { context.nextToken(); textTranslationJobProperties.setTerminologyNames(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)) .unmarshall(context)); } if (context.testExpression("ParallelDataNames", targetDepth)) { context.nextToken(); textTranslationJobProperties.setParallelDataNames(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)) .unmarshall(context)); } if (context.testExpression("Message", targetDepth)) { context.nextToken(); textTranslationJobProperties.setMessage(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("SubmittedTime", targetDepth)) { context.nextToken(); textTranslationJobProperties.setSubmittedTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); } if (context.testExpression("EndTime", targetDepth)) { context.nextToken(); textTranslationJobProperties.setEndTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context)); } if (context.testExpression("InputDataConfig", targetDepth)) { context.nextToken(); textTranslationJobProperties.setInputDataConfig(InputDataConfigJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("OutputDataConfig", targetDepth)) { context.nextToken(); textTranslationJobProperties.setOutputDataConfig(OutputDataConfigJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("DataAccessRoleArn", targetDepth)) { context.nextToken(); textTranslationJobProperties.setDataAccessRoleArn(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Settings", targetDepth)) { context.nextToken(); textTranslationJobProperties.setSettings(TranslationSettingsJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return textTranslationJobProperties; } private static TextTranslationJobPropertiesJsonUnmarshaller instance; public static TextTranslationJobPropertiesJsonUnmarshaller getInstance() { if (instance == null) instance = new TextTranslationJobPropertiesJsonUnmarshaller(); return instance; } }
{ "content_hash": "66a40850de0d13096406945970a80d5e", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 144, "avg_line_length": 49.472, "alnum_prop": 0.6282341526520052, "repo_name": "aws/aws-sdk-java", "id": "9d0849605c27fdf418a87f564f3e20c900ace68a", "size": "6764", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-translate/src/main/java/com/amazonaws/services/translate/model/transform/TextTranslationJobPropertiesJsonUnmarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [] }
using System; using System.IO; namespace ConsoleScenario.StreamHandling { public interface IAsyncDuplexStreamHandler : IDisposable { char Read(TimeSpan timeout); string ReadLine(TimeSpan timeout); string ReadError(TimeSpan timeout); void WriteLine(string command); void WaitForExit(); } public sealed class AsyncDuplexStreamHandler : IAsyncDuplexStreamHandler { private readonly TextWriter _input; private readonly AsyncStreamReader _outputReader; private readonly AsyncStreamReader _errorReader; public AsyncDuplexStreamHandler(TextReader output, TextWriter input, TextReader error) { _input = input; _outputReader = new AsyncStreamReader(output, "out"); _errorReader = new AsyncStreamReader(error, "err"); } public char Read(TimeSpan timeout) { CrashIfErrorPending(timeout); return _outputReader.Read(timeout); } public string ReadLine(TimeSpan timeout) { CrashIfErrorPending(timeout); return _outputReader.ReadLine(timeout); } public string ReadError(TimeSpan timeout) { var errorLine = _errorReader.ReadLine(timeout); if (String.IsNullOrWhiteSpace(errorLine)) // When throwing an exception, the first line will be empty errorLine = _errorReader.ReadLine(timeout); return errorLine; } private void CrashIfErrorPending(TimeSpan timeout) { if (!_errorReader.Pending()) return; var errorLine = ReadError(timeout); throw new ApplicationException(errorLine); } public void Write(string command) { _outputReader.Write(command); _input.Write(command); } public void WriteLine(string command) { _outputReader.WriteLine(command); _input.WriteLine(command); } public void WaitForExit() { _outputReader.Wait(); _errorReader.Wait(); } public void Dispose() { _outputReader.Dispose(); _errorReader.Dispose(); } } }
{ "content_hash": "2dfc62dcf3407cc063f04cc2b388f4fb", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 88, "avg_line_length": 21.272727272727273, "alnum_prop": 0.7264957264957265, "repo_name": "christianrondeau/ConsoleScenario", "id": "c78505916623ab1811c32b3182cab5532b98c086", "size": "1874", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ConsoleScenario/StreamHandling/AsyncDuplexStreamHandler.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "61901" } ] }
<?xml version="1.0" encoding="UTF-8"?> <sem:triples uri="http://www.lds.org/vrl/locations/specific-locations/general-specific-locations/city-hall-salt-lake-city-utah-usa" xmlns:sem="http://marklogic.com/semantics"> <sem:triple> <sem:subject>http://www.lds.org/vrl/locations/specific-locations/general-specific-locations/city-hall-salt-lake-city-utah-usa</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate> <sem:object datatype="xsd:string" xml:lang="eng">City Hall (Salt Lake City, Utah, USA)</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/vrl/locations/specific-locations/general-specific-locations/city-hall-salt-lake-city-utah-usa</sem:subject> <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate> <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object> </sem:triple> <sem:triple> <sem:subject>http://www.lds.org/vrl/locations/specific-locations/general-specific-locations/city-hall-salt-lake-city-utah-usa</sem:subject> <sem:predicate>http://www.lds.org/core#entityType</sem:predicate> <sem:object datatype="sem:iri">http://www.schema.org/Place</sem:object> </sem:triple> </sem:triples>
{ "content_hash": "4dfc84d58fca740fd08b7dd6fefec8ef", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 175, "avg_line_length": 69.55555555555556, "alnum_prop": 0.7348242811501597, "repo_name": "freshie/ml-taxonomies", "id": "14019ec2d3ef256651f367d234d9dd7a1ac827f5", "size": "1252", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "roxy/data/gospel-topical-explorer-v2/taxonomies/vrl/locations/specific-locations/general-specific-locations/city-hall-salt-lake-city-utah-usa.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4422" }, { "name": "CSS", "bytes": "38665" }, { "name": "HTML", "bytes": "356" }, { "name": "JavaScript", "bytes": "411651" }, { "name": "Ruby", "bytes": "259121" }, { "name": "Shell", "bytes": "7329" }, { "name": "XQuery", "bytes": "857170" }, { "name": "XSLT", "bytes": "13753" } ] }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>密码修改</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <script type="text/javascript"> console.time("test"); /* # 按照宽高比例设定html字体, width=device-width initial-scale=1版 # @pargam win 窗口window对象 # @pargam option{ designWidth: 设计稿宽度,必须 designHeight: 设计稿高度,不传的话则比例按照宽度来计算,可选 designFontSize: 设计稿宽高下用于计算的字体大小,默认20,可选 callback: 字体计算之后的回调函数,可选 } # return Boolean; # xiaoweili@tencent.com # ps:请尽量第一时间运行此js计算字体 */ !function(win, option) { var count = 0, designWidth = option.designWidth, designHeight = option.designHeight || 0, designFontSize = option.designFontSize || 20, callback = option.callback || null, root = document.documentElement, body = document.body, rootWidth, newSize, t, self; //返回root元素字体计算结果 function _getNewFontSize() { var scale = designHeight !== 0 ? Math.min(win.innerWidth / designWidth, win.innerHeight / designHeight) : win.innerWidth / designWidth; return parseInt( scale * 10000 * designFontSize ) / 10000; } !function () { rootWidth = root.getBoundingClientRect().width; self = self ? self : arguments.callee; //如果此时屏幕宽度不准确,就尝试再次获取分辨率,只尝试20次,否则使用win.innerWidth计算 if( rootWidth !== win.innerWidth && count < 20 ) { win.setTimeout(function () { count++; self(); }, 0); } else { newSize = _getNewFontSize(); //如果css已经兼容当前分辨率就不管了 if( newSize + 'px' !== getComputedStyle(root)['font-size'] ) { root.style.fontSize = newSize + "px"; return callback && callback(newSize); }; }; }(); //横竖屏切换的时候改变fontSize,根据需要选择使用 win.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function() { clearTimeout(t); t = setTimeout(function () { self(); }, 300); }, false); }(window, { designWidth: 640, designFontSize: 24, callback: function (argument) { console.timeEnd("test") } }); </script> <link href="css/reset.css" type="text/css" rel="stylesheet" /> <link href="css/srgl.css" type="text/css" rel="stylesheet" /> </head> <body> <div class="warp"> <header id="head_search_box" dd_name="结果页头部"> <div class="search_header"> <a href="javascript:;" class="back search_back" id="search_back" dd_name="返回"></a> <div class="search"> <sapn>密码修改</sapn> </div> </div> </header> <div class="header_bg"></div> <form action="" method="post" > <div class="bdyhk"> <div class="yhkzl"> <li><span>原密码</span><input type="password" name="mc" data-required="required" placeholder="输入旧密码"></li> <li><span>新密码</span><input type="password" name="mc" data-required="required" placeholder="输入新密码"></li> <li><span>密码确认</span><input type="password" name="mc" data-required="required" placeholder="再次输入新密码"></li> </div> </div> <div class="btu"> <button class="c-order-btn J_submit shdz">修改</button> </div> </form> </div> </body> </html>
{ "content_hash": "c38aa3ee233fd11e6affa18f7f305f8e", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 139, "avg_line_length": 31.01834862385321, "alnum_prop": 0.6131322094055013, "repo_name": "lihj/Gift", "id": "89c40e2addd72217f924b574a2925678ba100c35", "size": "3815", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app-html-720/7-1系统设置-密码修改.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "3234" }, { "name": "CSS", "bytes": "183077" }, { "name": "HTML", "bytes": "246645" }, { "name": "JavaScript", "bytes": "7949" }, { "name": "Objective-C", "bytes": "2509701" }, { "name": "Ruby", "bytes": "320" }, { "name": "Shell", "bytes": "8695" } ] }
package com.google.android.exoplayer.extractor.mp4; import com.google.android.exoplayer.extractor.Extractor; import com.google.android.exoplayer.extractor.ExtractorInput; import com.google.android.exoplayer.extractor.ExtractorOutput; import com.google.android.exoplayer.extractor.PositionHolder; import com.google.android.exoplayer.extractor.SeekMap; import com.google.android.exoplayer.extractor.TrackOutput; import com.google.android.exoplayer.extractor.mp4.Atom.ContainerAtom; import com.google.android.exoplayer.util.Assertions; import com.google.android.exoplayer.util.NalUnitUtil; import com.google.android.exoplayer.util.ParsableByteArray; import com.google.android.exoplayer.util.Util; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Stack; /** * Extracts data from an unfragmented MP4 file. */ public final class Mp4Extractor implements Extractor, SeekMap { // Parser states. private static final int STATE_AFTER_SEEK = 0; private static final int STATE_READING_ATOM_HEADER = 1; private static final int STATE_READING_ATOM_PAYLOAD = 2; private static final int STATE_READING_SAMPLE = 3; // Brand stored in the ftyp atom for QuickTime media. private static final int BRAND_QUICKTIME = Util.getIntegerCodeForString("qt "); /** * When seeking within the source, if the offset is greater than or equal to this value (or the * offset is negative), the source will be reloaded. */ private static final long RELOAD_MINIMUM_SEEK_DISTANCE = 256 * 1024; // Temporary arrays. private final ParsableByteArray nalStartCode; private final ParsableByteArray nalLength; private final ParsableByteArray atomHeader; private final Stack<ContainerAtom> containerAtoms; private int parserState; private int atomType; private long atomSize; private int atomHeaderBytesRead; private ParsableByteArray atomData; private int sampleSize; private int sampleBytesWritten; private int sampleCurrentNalBytesRemaining; // Extractor outputs. private ExtractorOutput extractorOutput; private Mp4Track[] tracks; private boolean isQuickTime; public Mp4Extractor() { atomHeader = new ParsableByteArray(Atom.LONG_HEADER_SIZE); containerAtoms = new Stack<>(); nalStartCode = new ParsableByteArray(NalUnitUtil.NAL_START_CODE); nalLength = new ParsableByteArray(4); enterReadingAtomHeaderState(); } @Override public boolean sniff(ExtractorInput input) throws IOException, InterruptedException { return Sniffer.sniffUnfragmented(input); } @Override public void init(ExtractorOutput output) { extractorOutput = output; } @Override public void seek() { containerAtoms.clear(); atomHeaderBytesRead = 0; sampleBytesWritten = 0; sampleCurrentNalBytesRemaining = 0; parserState = STATE_AFTER_SEEK; } @Override public int read(ExtractorInput input, PositionHolder seekPosition) throws IOException, InterruptedException { while (true) { switch (parserState) { case STATE_AFTER_SEEK: if (input.getPosition() == 0) { enterReadingAtomHeaderState(); } else { parserState = STATE_READING_SAMPLE; } break; case STATE_READING_ATOM_HEADER: if (!readAtomHeader(input)) { return RESULT_END_OF_INPUT; } break; case STATE_READING_ATOM_PAYLOAD: if (readAtomPayload(input, seekPosition)) { return RESULT_SEEK; } break; default: return readSample(input, seekPosition); } } } // SeekMap implementation. @Override public boolean isSeekable() { return true; } @Override public long getPosition(long timeUs) { long earliestSamplePosition = Long.MAX_VALUE; for (int trackIndex = 0; trackIndex < tracks.length; trackIndex++) { TrackSampleTable sampleTable = tracks[trackIndex].sampleTable; int sampleIndex = sampleTable.getIndexOfEarlierOrEqualSynchronizationSample(timeUs); if (sampleIndex == TrackSampleTable.NO_SAMPLE) { // Handle the case where the requested time is before the first synchronization sample. sampleIndex = sampleTable.getIndexOfLaterOrEqualSynchronizationSample(timeUs); } tracks[trackIndex].sampleIndex = sampleIndex; long offset = sampleTable.offsets[sampleIndex]; if (offset < earliestSamplePosition) { earliestSamplePosition = offset; } } return earliestSamplePosition; } // Private methods. private void enterReadingAtomHeaderState() { parserState = STATE_READING_ATOM_HEADER; atomHeaderBytesRead = 0; } private boolean readAtomHeader(ExtractorInput input) throws IOException, InterruptedException { if (atomHeaderBytesRead == 0) { // Read the standard length atom header. if (!input.readFully(atomHeader.data, 0, Atom.HEADER_SIZE, true)) { return false; } atomHeaderBytesRead = Atom.HEADER_SIZE; atomHeader.setPosition(0); atomSize = atomHeader.readUnsignedInt(); atomType = atomHeader.readInt(); } if (atomSize == Atom.LONG_SIZE_PREFIX) { // Read the extended atom size. int headerBytesRemaining = Atom.LONG_HEADER_SIZE - Atom.HEADER_SIZE; input.readFully(atomHeader.data, Atom.HEADER_SIZE, headerBytesRemaining); atomHeaderBytesRead += headerBytesRemaining; atomSize = atomHeader.readUnsignedLongToLong(); } if (shouldParseContainerAtom(atomType)) { long endPosition = input.getPosition() + atomSize - atomHeaderBytesRead; containerAtoms.add(new ContainerAtom(atomType, endPosition)); enterReadingAtomHeaderState(); } else if (shouldParseLeafAtom(atomType)) { // We don't support parsing of leaf atoms that define extended atom sizes, or that have // lengths greater than Integer.MAX_VALUE. Assertions.checkState(atomHeaderBytesRead == Atom.HEADER_SIZE); Assertions.checkState(atomSize <= Integer.MAX_VALUE); atomData = new ParsableByteArray((int) atomSize); System.arraycopy(atomHeader.data, 0, atomData.data, 0, Atom.HEADER_SIZE); parserState = STATE_READING_ATOM_PAYLOAD; } else { atomData = null; parserState = STATE_READING_ATOM_PAYLOAD; } return true; } /** * Processes the atom payload. If {@link #atomData} is null and the size is at or above the * threshold {@link #RELOAD_MINIMUM_SEEK_DISTANCE}, {@code true} is returned and the caller should * restart loading at the position in {@code positionHolder}. Otherwise, the atom is read/skipped. */ private boolean readAtomPayload(ExtractorInput input, PositionHolder positionHolder) throws IOException, InterruptedException { long atomPayloadSize = atomSize - atomHeaderBytesRead; long atomEndPosition = input.getPosition() + atomPayloadSize; boolean seekRequired = false; if (atomData != null) { input.readFully(atomData.data, atomHeaderBytesRead, (int) atomPayloadSize); if (atomType == Atom.TYPE_ftyp) { isQuickTime = processFtypAtom(atomData); } else if (!containerAtoms.isEmpty()) { containerAtoms.peek().add(new Atom.LeafAtom(atomType, atomData)); } } else { // We don't need the data. Skip or seek, depending on how large the atom is. if (atomPayloadSize < RELOAD_MINIMUM_SEEK_DISTANCE) { input.skipFully((int) atomPayloadSize); } else { positionHolder.position = input.getPosition() + atomPayloadSize; seekRequired = true; } } while (!containerAtoms.isEmpty() && containerAtoms.peek().endPosition == atomEndPosition) { Atom.ContainerAtom containerAtom = containerAtoms.pop(); if (containerAtom.type == Atom.TYPE_moov) { // We've reached the end of the moov atom. Process it and prepare to read samples. processMoovAtom(containerAtom); containerAtoms.clear(); parserState = STATE_READING_SAMPLE; return false; } else if (!containerAtoms.isEmpty()) { containerAtoms.peek().add(containerAtom); } } enterReadingAtomHeaderState(); return seekRequired; } /** * Process an ftyp atom to determine whether the media is QuickTime. * * @param atomData The ftyp atom data. * @return True if the media is QuickTime. False otherwise. */ private static boolean processFtypAtom(ParsableByteArray atomData) { atomData.setPosition(Atom.HEADER_SIZE); int majorBrand = atomData.readInt(); if (majorBrand == BRAND_QUICKTIME) { return true; } atomData.skipBytes(4); // minor_version while (atomData.bytesLeft() > 0) { if (atomData.readInt() == BRAND_QUICKTIME) { return true; } } return false; } /** * Updates the stored track metadata to reflect the contents of the specified moov atom. */ private void processMoovAtom(ContainerAtom moov) { List<Mp4Track> tracks = new ArrayList<>(); long earliestSampleOffset = Long.MAX_VALUE; // TODO: Apply gapless information. // GaplessInfo gaplessInfo = null; // Atom.ContainerAtom udta = moov.getContainerAtomOfType(Atom.TYPE_udta); // if (udta != null) { // gaplessInfo = AtomParsers.parseUdta(udta); // } for (int i = 0; i < moov.containerChildren.size(); i++) { Atom.ContainerAtom atom = moov.containerChildren.get(i); if (atom.type != Atom.TYPE_trak) { continue; } Track track = AtomParsers.parseTrak(atom, moov.getLeafAtomOfType(Atom.TYPE_mvhd), isQuickTime); if (track == null) { continue; } Atom.ContainerAtom stblAtom = atom.getContainerAtomOfType(Atom.TYPE_mdia) .getContainerAtomOfType(Atom.TYPE_minf).getContainerAtomOfType(Atom.TYPE_stbl); TrackSampleTable trackSampleTable = AtomParsers.parseStbl(track, stblAtom); if (trackSampleTable.sampleCount == 0) { continue; } Mp4Track mp4Track = new Mp4Track(track, trackSampleTable, extractorOutput.track(i)); // Each sample has up to three bytes of overhead for the start code that replaces its length. // Allow ten source samples per output sample, like the platform extractor. int maxInputSize = trackSampleTable.maximumSize + 3 * 10; mp4Track.trackOutput.format(track.mediaFormat.copyWithMaxInputSize(maxInputSize)); tracks.add(mp4Track); long firstSampleOffset = trackSampleTable.offsets[0]; if (firstSampleOffset < earliestSampleOffset) { earliestSampleOffset = firstSampleOffset; } } this.tracks = tracks.toArray(new Mp4Track[0]); extractorOutput.endTracks(); extractorOutput.seekMap(this); } /** * Attempts to extract the next sample in the current mdat atom for the specified track. * <p> * Returns {@link #RESULT_SEEK} if the source should be reloaded from the position in * {@code positionHolder}. * <p> * Returns {@link #RESULT_END_OF_INPUT} if no samples are left. Otherwise, returns * {@link #RESULT_CONTINUE}. * * @param input The {@link ExtractorInput} from which to read data. * @param positionHolder If {@link #RESULT_SEEK} is returned, this holder is updated to hold the * position of the required data. * @return One of the {@code RESULT_*} flags in {@link Extractor}. * @throws IOException If an error occurs reading from the input. * @throws InterruptedException If the thread is interrupted. */ private int readSample(ExtractorInput input, PositionHolder positionHolder) throws IOException, InterruptedException { int trackIndex = getTrackIndexOfEarliestCurrentSample(); if (trackIndex == TrackSampleTable.NO_SAMPLE) { return RESULT_END_OF_INPUT; } Mp4Track track = tracks[trackIndex]; TrackOutput trackOutput = track.trackOutput; int sampleIndex = track.sampleIndex; long position = track.sampleTable.offsets[sampleIndex]; long skipAmount = position - input.getPosition() + sampleBytesWritten; if (skipAmount < 0 || skipAmount >= RELOAD_MINIMUM_SEEK_DISTANCE) { positionHolder.position = position; return RESULT_SEEK; } input.skipFully((int) skipAmount); sampleSize = track.sampleTable.sizes[sampleIndex]; if (track.track.nalUnitLengthFieldLength != -1) { // Zero the top three bytes of the array that we'll use to parse nal unit lengths, in case // they're only 1 or 2 bytes long. byte[] nalLengthData = nalLength.data; nalLengthData[0] = 0; nalLengthData[1] = 0; nalLengthData[2] = 0; int nalUnitLengthFieldLength = track.track.nalUnitLengthFieldLength; int nalUnitLengthFieldLengthDiff = 4 - track.track.nalUnitLengthFieldLength; // NAL units are length delimited, but the decoder requires start code delimited units. // Loop until we've written the sample to the track output, replacing length delimiters with // start codes as we encounter them. while (sampleBytesWritten < sampleSize) { if (sampleCurrentNalBytesRemaining == 0) { // Read the NAL length so that we know where we find the next one. input.readFully(nalLength.data, nalUnitLengthFieldLengthDiff, nalUnitLengthFieldLength); nalLength.setPosition(0); sampleCurrentNalBytesRemaining = nalLength.readUnsignedIntToInt(); // Write a start code for the current NAL unit. nalStartCode.setPosition(0); trackOutput.sampleData(nalStartCode, 4); sampleBytesWritten += 4; sampleSize += nalUnitLengthFieldLengthDiff; } else { // Write the payload of the NAL unit. int writtenBytes = trackOutput.sampleData(input, sampleCurrentNalBytesRemaining, false); sampleBytesWritten += writtenBytes; sampleCurrentNalBytesRemaining -= writtenBytes; } } } else { while (sampleBytesWritten < sampleSize) { int writtenBytes = trackOutput.sampleData(input, sampleSize - sampleBytesWritten, false); sampleBytesWritten += writtenBytes; sampleCurrentNalBytesRemaining -= writtenBytes; } } trackOutput.sampleMetadata(track.sampleTable.timestampsUs[sampleIndex], track.sampleTable.flags[sampleIndex], sampleSize, 0, null); track.sampleIndex++; sampleBytesWritten = 0; sampleCurrentNalBytesRemaining = 0; return RESULT_CONTINUE; } /** * Returns the index of the track that contains the earliest current sample, or * {@link TrackSampleTable#NO_SAMPLE} if no samples remain. */ private int getTrackIndexOfEarliestCurrentSample() { int earliestSampleTrackIndex = TrackSampleTable.NO_SAMPLE; long earliestSampleOffset = Long.MAX_VALUE; for (int trackIndex = 0; trackIndex < tracks.length; trackIndex++) { Mp4Track track = tracks[trackIndex]; int sampleIndex = track.sampleIndex; if (sampleIndex == track.sampleTable.sampleCount) { continue; } long trackSampleOffset = track.sampleTable.offsets[sampleIndex]; if (trackSampleOffset < earliestSampleOffset) { earliestSampleOffset = trackSampleOffset; earliestSampleTrackIndex = trackIndex; } } return earliestSampleTrackIndex; } /** * Returns whether the extractor should parse a leaf atom with type {@code atom}. */ private static boolean shouldParseLeafAtom(int atom) { return atom == Atom.TYPE_mdhd || atom == Atom.TYPE_mvhd || atom == Atom.TYPE_hdlr || atom == Atom.TYPE_stsd || atom == Atom.TYPE_stts || atom == Atom.TYPE_stss || atom == Atom.TYPE_ctts || atom == Atom.TYPE_elst || atom == Atom.TYPE_stsc || atom == Atom.TYPE_stsz || atom == Atom.TYPE_stco || atom == Atom.TYPE_co64 || atom == Atom.TYPE_tkhd || atom == Atom.TYPE_ftyp || atom == Atom.TYPE_meta; } /** * Returns whether the extractor should parse a container atom with type {@code atom}. */ private static boolean shouldParseContainerAtom(int atom) { return atom == Atom.TYPE_moov || atom == Atom.TYPE_trak || atom == Atom.TYPE_mdia || atom == Atom.TYPE_minf || atom == Atom.TYPE_stbl || atom == Atom.TYPE_edts || atom == Atom.TYPE_udta; } private static final class Mp4Track { public final Track track; public final TrackSampleTable sampleTable; public final TrackOutput trackOutput; public int sampleIndex; public Mp4Track(Track track, TrackSampleTable sampleTable, TrackOutput trackOutput) { this.track = track; this.sampleTable = sampleTable; this.trackOutput = trackOutput; } } }
{ "content_hash": "046701bcc826c4b5aa1bb6fa884f05fe", "timestamp": "", "source": "github", "line_count": 443, "max_line_length": 100, "avg_line_length": 37.74943566591422, "alnum_prop": 0.692937869999402, "repo_name": "PavelSynek/ExoPlayer", "id": "b47702f0f4c274ae7519aa2bdf712cb2162cf7cd", "size": "17342", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/src/main/java/com/google/android/exoplayer/extractor/mp4/Mp4Extractor.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "9730" }, { "name": "Java", "bytes": "2328444" }, { "name": "Makefile", "bytes": "7477" }, { "name": "Shell", "bytes": "5513" } ] }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>V8 API Reference Guide for node.js v6.9.2: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for node.js v6.9.2 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1AccessorSignature.html">AccessorSignature</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">v8::AccessorSignature Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="classv8_1_1AccessorSignature.html">v8::AccessorSignature</a>, including all inherited members.</p> <table class="directory"> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>New</b>(Isolate *isolate, Local&lt; FunctionTemplate &gt; receiver=Local&lt; FunctionTemplate &gt;()) (defined in <a class="el" href="classv8_1_1AccessorSignature.html">v8::AccessorSignature</a>)</td><td class="entry"><a class="el" href="classv8_1_1AccessorSignature.html">v8::AccessorSignature</a></td><td class="entry"><span class="mlabel">static</span></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.11 </small></address> </body> </html>
{ "content_hash": "cf46242eee69ab457ac43c0d577ab501", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 423, "avg_line_length": 45.28971962616822, "alnum_prop": 0.6527032604209657, "repo_name": "v8-dox/v8-dox.github.io", "id": "268c88aed97c82cfdba8719efbf56b9b71e850a4", "size": "4846", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "0d15ec8/html/classv8_1_1AccessorSignature-members.html", "mode": "33188", "license": "mit", "language": [] }
package org.commerce4j.storefront.test; import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; /** * * @author Ignatiues */ public abstract class AbstractSpringDaoTest extends AbstractTransactionalDataSourceSpringContextTests { private C4jDBHelper c4jDbHelper; protected String[] getConfigLocations() { return new String[] { "applicationContextTest.xml" }; } /* * (non-Javadoc) * * @see * org.springframework.test.AbstractTransactionalSpringContextTests# * onSetUpInTransaction() */ @Override protected void onSetUpInTransaction() throws Exception { // TODO Auto-generated method stub // super.onSetUpInTransaction(); setTemplatesInTransaction(); c4jDbHelper = new C4jDBHelper(jdbcTemplate); System.out.println("Calling clear Database()"); c4jDbHelper.clearDatabase(); } private void setTemplatesInTransaction() { // TODO Auto-generated method stub } }
{ "content_hash": "8e3e05478a16218be0894b5a3e44589c", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 82, "avg_line_length": 20.829787234042552, "alnum_prop": 0.7262512768130746, "repo_name": "sudcea/commerce4j", "id": "1cdef38282b64dfa1625611533976ed9ce453fb4", "size": "1579", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/com.commerce4j/commerce4j-storefront/src/test/java/org/commerce4j/storefront/test/AbstractSpringDaoTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "7833" }, { "name": "Java", "bytes": "248708" }, { "name": "JavaScript", "bytes": "32169" }, { "name": "XSLT", "bytes": "975" } ] }
layout: post type: talk title: Let's talk about JWT date: 2022-04-30 00:00:00 -0300 hidden: true lang: en image: https://res.cloudinary.com/jesstemporal/image/upload/v1640360836/covers/talk_ycoaee.png tags: - english - jwt - talk description: Want to understand JWTs? Especially how to deal with them in python? Here's a talk for you related: true posts_list: - how-to-handle-jwts-in-python - solving-conflicts - introducing-gitfichas --- First talk at PyCon US was amazing. If you missed it or need a recap, here it is: <iframe width="560" height="315" src="https://www.youtube.com/embed/JyvJYkbzBNc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
{ "content_hash": "578e8afce51927367aa34938d10ed81f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 248, "avg_line_length": 33.608695652173914, "alnum_prop": 0.7645536869340233, "repo_name": "jtemporal/jtemporal.github.io", "id": "95af0b5d86dd799552109a29057c29f29ac03e74", "size": "777", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "_posts/2022-04-30-let-s-talk-about-jwt.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "733348" }, { "name": "Ruby", "bytes": "104" }, { "name": "SCSS", "bytes": "156716" }, { "name": "Vim Snippet", "bytes": "47" } ] }
package aQute.lib.putjar; import static java.nio.charset.StandardCharsets.UTF_8; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.zip.CRC32; import aQute.lib.io.IO; import aQute.lib.io.IOConstants; import aQute.libg.fileiterator.FileIterator; public class DirectoryInputStream extends InputStream { static final int BUFFER_SIZE = IOConstants.PAGE_SIZE * 16; final File root; final FileIterator fi; File element; int entries = 0; int state = START; long where = 0; final static int START = 0; final static int HEADER = 1; final static int DATA = 2; final static int DIRECTORY = 4; final static int EOF = 5; final static InputStream eof = new ByteArrayInputStream(new byte[0]); ByteArrayOutputStream directory = new ByteArrayOutputStream(); InputStream current = eof; public DirectoryInputStream(File dir) { root = dir; fi = new FileIterator(dir); } @Override public int read() throws IOException { if (fi == null) return -1; int c = current.read(); if (c < 0) { next(); c = current.read(); } if (c >= 0) where++; return c; } void next() throws IOException { switch (state) { case START : case DATA : nextHeader(); break; case HEADER : if (element.isFile() && element.length() > 0) { current = IO.stream(element); state = DATA; } else nextHeader(); break; case DIRECTORY : state = EOF; current = eof; break; case EOF : break; } } private void nextHeader() throws IOException { if (fi.hasNext()) { element = fi.next(); state = HEADER; current = getHeader(root, element); entries++; } else { current = getDirectory(); state = DIRECTORY; } } /** * <pre> * end of central dir signature 4 bytes (0x06054b50) number of this * disk 2 bytes number of the disk with the start of the central directory 2 * bytes total number of entries in the central directory on this disk 2 * bytes total number of entries in the central directory 2 bytes size of * the central directory 4 bytes offset of start of central directory with * respect to the starting disk number 4 bytes .ZIP file comment length 2 * bytes .ZIP file comment (variable size) * </pre> */ InputStream getDirectory() throws IOException { long where = this.where; int sizeDirectory = directory.size(); writeInt(directory, 0x504b0506); // Signature writeShort(directory, 0); // # of disk writeShort(directory, 0); // # of the disk with start of the central // dir writeShort(directory, entries); // # of entries writeInt(directory, sizeDirectory); // Size of central dir writeInt(directory, (int) where); writeShort(directory, 0); directory.close(); byte[] data = directory.toByteArray(); return new ByteArrayInputStream(data); } private void writeShort(OutputStream out, int v) throws IOException { for (int i = 0; i < 2; i++) { out.write((byte) (v & 0xFF)); v = v >> 8; } } private void writeInt(OutputStream out, int v) throws IOException { for (int i = 0; i < 4; i++) { out.write((byte) (v & 0xFF)); v = v >> 8; } } /** * Local file header: * * <pre> * local file header signature 4 bytes (0x04034b50) * version needed to extract 2 bytes general purpose bit flag 2 bytes * compression method 2 bytes last mod file time 2 bytes last mod file date * 2 bytes crc-32 4 bytes compressed size 4 bytes uncompressed size 4 bytes * file name length 2 bytes extra field length 2 bytes file name (variable * size) extra field (variable size) central file header signature 4 bytes * (0x02014b50) version made by 2 bytes version needed to extract 2 bytes * general purpose bit flag 2 bytes compression method 2 bytes last mod file * time 2 bytes last mod file date 2 bytes crc-32 4 bytes compressed size 4 * bytes uncompressed size 4 bytes file name length 2 bytes extra field * length 2 bytes file comment length 2 bytes disk number start 2 bytes * internal file attributes 2 bytes external file attributes 4 bytes * relative offset of local header 4 bytes file name (variable size) extra * field (variable size) file comment (variable size) * </pre> * </pre> */ private InputStream getHeader(File root, File file) throws IOException { long where = this.where; ByteArrayOutputStream bout = new ByteArrayOutputStream(); // Signature writeInt(bout, 0x04034b50); writeInt(directory, 0x504b0102); // Version needed to extract writeShort(directory, 0); // Version needed to extract writeShort(bout, 10); writeShort(directory, 10); // General purpose bit flag (use descriptor) writeShort(bout, 0); // descriptor follows data writeShort(directory, 0); // descriptor follows data // Compresson method (stored) writeShort(bout, 0); writeShort(directory, 0); // Mod time writeInt(bout, 0); writeInt(directory, 0); if (file.isDirectory()) { writeInt(bout, 0); // CRC writeInt(bout, 0); // Compressed size writeInt(bout, 0); // Uncompressed Size writeInt(directory, 0); writeInt(directory, 0); writeInt(directory, 0); } else { CRC32 crc = getCRC(file); writeInt(bout, (int) crc.getValue()); writeInt(bout, (int) file.length()); writeInt(bout, (int) file.length()); writeInt(directory, (int) crc.getValue()); writeInt(directory, (int) file.length()); writeInt(directory, (int) file.length()); } String p = getPath(root, file); if (file.isDirectory()) p = p + "/"; byte[] path = p.getBytes(UTF_8); writeShort(bout, path.length); writeShort(directory, path.length); writeShort(bout, 0); // extra length writeShort(directory, 0); bout.write(path); writeShort(directory, 0); // File comment length writeShort(directory, 0); // disk number start 2 bytes writeShort(directory, 0); // internal file attributes 2 bytes writeInt(directory, 0); // external file attributes 4 bytes writeInt(directory, (int) where); // relative offset of local header 4 // bytes directory.write(path); byte[] bytes = bout.toByteArray(); return new ByteArrayInputStream(bytes); } private String getPath(File root, File file) { if (file.equals(root)) return ""; String p = getPath(root, file.getParentFile()); if (p.length() == 0) p = file.getName(); else { p = p + "/" + file.getName(); } return p; } private CRC32 getCRC(File file) throws IOException { CRC32 crc = new CRC32(); try (InputStream in = IO.stream(file)) { byte data[] = new byte[BUFFER_SIZE]; int size = in.read(data); while (size > 0) { crc.update(data, 0, size); size = in.read(data); } } return crc; } }
{ "content_hash": "4cfe33c580d68ad4b8c6714ac14b5012", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 77, "avg_line_length": 26.96062992125984, "alnum_prop": 0.6740654205607477, "repo_name": "psoreide/bnd", "id": "5b0c53ddc8f4a97f4626cba53c8bb369ab1bedde", "size": "6848", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "aQute.libg/src/aQute/lib/putjar/DirectoryInputStream.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5971" }, { "name": "Groovy", "bytes": "137212" }, { "name": "HTML", "bytes": "20589" }, { "name": "Java", "bytes": "4890082" }, { "name": "Shell", "bytes": "13535" }, { "name": "XSLT", "bytes": "24433" } ] }
describe('play (option)', () => { it('should be null be default', () => { const image = window.createImage(); const viewer = new Viewer(image); expect(viewer.options.play).to.be.null; }); it('should execute the `play` hook function', (done) => { const image = window.createImage(); const viewer = new Viewer(image, { viewed() { expect(viewer.played).to.false; viewer.play(); expect(viewer.played).to.true; done(); }, play(event) { expect(event.type).to.equal('play'); }, }); viewer.show(); }); it('should not execute the `play` hook function when default prevented', (done) => { const image = window.createImage(); const viewer = new Viewer(image, { viewed() { expect(viewer.played).to.false; viewer.play(); expect(viewer.played).to.false; done(); }, play(event) { expect(event.type).to.equal('play'); event.preventDefault(); }, }); viewer.show(); }); });
{ "content_hash": "664c092c2620094600c0dfc549ac41b7", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 86, "avg_line_length": 23.444444444444443, "alnum_prop": 0.5450236966824644, "repo_name": "fengyuanchen/viewerjs", "id": "0b8a97400f4ef6bd135d92ae0a7684e1710ba028", "size": "1055", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "test/specs/options/play.spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "7028" }, { "name": "JavaScript", "bytes": "218561" }, { "name": "SCSS", "bytes": "7478" }, { "name": "Shell", "bytes": "125" } ] }
/* globals wx */ export function polyfill({ENV}) { class Container { constructor(width, height) { this.width = width; this.height = height; this.children = []; this._listeners = {}; } get clientWidth() { return this.width; } get clientHeight() { return this.height; } dispatchEvent(event, {left = 0, top = 0, width = this.width, height = this.height} = {}) { if(this.children.length > 0) { const type = event.type; const target = event.target; target.getBoundingClientRect = function () { return {left, top, width, height}; }; target.width = this.children[0].width; target.height = this.children[0].height; this._listeners[type].forEach((listener) => { listener(event); }); } } addEventListener(type, listener) { this._listeners[type] = this._listeners[type] || []; this._listeners[type].push(listener); } appendChild(el) { this.children.push(el); } removeChild(el) { const idx = this.children.indexOf(el); if(idx >= 0) { this.children.splice(idx, 1); return el; } return null; } insertBefore(el, ref) { if(ref == null) return this.appendChild(el); const idx = this.children.indexOf(ref); if(idx >= 0) { this.children.splice(idx, 0, el); } return null; } replaceChild(el, ref) { const idx = this.children.indexOf(ref); if(idx >= 0) { this.children.splice(idx, 1, el); return el; } return null; } } class CanvasWrap { constructor(width, height, ctx) { this._ctx = ctx; this.width = width; this.height = height; ctx.canvas = this; // ctx.canvas = ctx._context.canvas; } get width() { return this._width; } set width(value) { this._width = value; // this._ctx._context.canvas.width = value; } get height() { return this._height; } set height(value) { this._height = value; // this._ctx._context.canvas.height = value; } get contextType() { return '2d'; } getContext() { return this._ctx; } draw(reserve) { this._ctx.draw(reserve); } } function createCanvas(width, height, options = {}) { // const offscreen = options.offscreen !== false; // if (offscreen && wx.createOffscreenCanvas) { // const offscreenCanvas = wx.createOffscreenCanvas(width, height); // return offscreenCanvas; // } if(!options.id) return null; const context = wx.createCanvasContext(options.id, options.extra); const canvas = new CanvasWrap(width, height, context); return canvas; } ENV.Container = Container; ENV.createCanvas = createCanvas; const imageCache = {}; ENV.loadImage = function (src, {alias}) { if(imageCache[src]) return imageCache[src]; // console.log(wx.getImageInfo); if(ENV.canvas) { return new Promise((resolve) => { const image = ENV.canvas.createImage(); image.src = src; image.onload = function () { imageCache[src] = image; if(alias) imageCache[alias] = imageCache[src]; resolve(imageCache[src]); }; }); } return new Promise((resolve, reject) => { wx.getImageInfo({ src, success(res) { imageCache[src] = {image: new String(src)}; // eslint-disable-line no-new-wrappers imageCache[src].image.width = res.width; imageCache[src].image.height = res.height; if(alias) imageCache[alias] = imageCache[src]; resolve(imageCache[src]); }, fail(err) { reject(err); }, }); }); }; let textContext = null; ENV.createText = (text, {font, fillColor, strokeColor, strokeWidth, parseFont}) => { if(!textContext) textContext = wx.createCanvasContext('textCanvas'); textContext.save(); textContext.font = font; let {width} = textContext.measureText(text); const fontInfo = parseFont(font); const height = Math.max(fontInfo.pxLineHeight, fontInfo.pxHeight * 1.13); if(/italic|oblique/.test(font)) { width += height * Math.tan(15 * Math.PI / 180); } return {image: {font, fillColor, strokeColor, strokeWidth, text}, rect: [0, 0, width, height]}; }; }
{ "content_hash": "ab5073e9c16c1ac4f772f31b4e6050ad", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 99, "avg_line_length": 26.005847953216374, "alnum_prop": 0.5689228693501237, "repo_name": "spritejs/spritejs", "id": "1ea7d32423813028fb193a85f553f551e29e605e", "size": "4447", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/platform/wx-miniprogram.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "55688" }, { "name": "JavaScript", "bytes": "4938998" } ] }
'use strict'; function threatmodellocator() { var service = { getModelLocation: getModelLocation, getModelPath: getModelPath, getModelPathFromRouteParams: getModelPath, willMoveModel: willMoveModel, newModelLocation: '/new/threatmodel' }; return service; function getModelLocation(params) { return { organisation: params.organisation, repo: params.repo, branch: params.branch, model: params.model }; } function getModelPath(params) { var path = ''; path += params.organisation + '/'; path += params.repo + '/'; path += params.branch + '/'; path += params.model; return path; } function willMoveModel(params, changes) { return changes.model != params.model; } } module.exports = threatmodellocator;
{ "content_hash": "c7405d56efdf9cb383e53f48a95432c7", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 50, "avg_line_length": 21.523809523809526, "alnum_prop": 0.5829646017699115, "repo_name": "mike-goodwin/owasp-threat-dragon", "id": "94eba68bdef333fca9c6c173fefa61fbd26964fd", "size": "904", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "td/public/app/services/threatmodellocator.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "394758" }, { "name": "HTML", "bytes": "14662" }, { "name": "JavaScript", "bytes": "12148000" } ] }
using System; using System.Text.Json; using Azure.Core; namespace Azure.ResourceManager.DataFactory.Models { public partial class SsisPropertyOverride : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("value"); #if NET6_0_OR_GREATER writer.WriteRawValue(Value); #else JsonSerializer.Serialize(writer, JsonDocument.Parse(Value.ToString()).RootElement); #endif if (Optional.IsDefined(IsSensitive)) { writer.WritePropertyName("isSensitive"); writer.WriteBooleanValue(IsSensitive.Value); } writer.WriteEndObject(); } internal static SsisPropertyOverride DeserializeSsisPropertyOverride(JsonElement element) { BinaryData value = default; Optional<bool> isSensitive = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) { value = BinaryData.FromString(property.Value.GetRawText()); continue; } if (property.NameEquals("isSensitive")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } isSensitive = property.Value.GetBoolean(); continue; } } return new SsisPropertyOverride(value, Optional.ToNullable(isSensitive)); } } }
{ "content_hash": "9d1172539209428394e0530b49f7b744", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 97, "avg_line_length": 34.21568627450981, "alnum_prop": 0.5570200573065902, "repo_name": "Azure/azure-sdk-for-net", "id": "5e4ca0c86fb3b58f5d0f65daa514b3b8b7ec4b42", "size": "1883", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SsisPropertyOverride.Serialization.cs", "mode": "33188", "license": "mit", "language": [] }
package com.example; public class App { public static void main(String[] args) { HalflingThief thief = new HalflingThief(new HitAndRunMethod()); thief.steal(); thief.changeMethod(new SubtleMethod()); thief.steal(); } }
{ "content_hash": "069a11ca02ae99cc9ba1aa13d15bf023", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 71, "avg_line_length": 26, "alnum_prop": 0.6346153846153846, "repo_name": "xu6148152/Design-Patterns", "id": "6b78d0a0ccbd85109c2c9f59489b56f156bc0c52", "size": "260", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DesignPatterns/templatemethod/src/main/java/com/example/App.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "252493" } ] }
package edu.umd.mith.util.pairtree import scala.reflect.BeanProperty object Pairtree { val HexIndicator = "^" } class Pairtree( @BeanProperty var separator: Char, @BeanProperty var shortyLength: Int ) { def this() = this(java.io.File.separatorChar, 2) def mapToPPath(id: String): String = { require(id != null) this.concat(this.cleanId(id).grouped(this.shortyLength).toSeq: _*) } def mapToPPath(basePath: String, id: String, encapsulatingDirName: String): String = this.concat(basePath, this.mapToPPath(id), encapsulatingDirName) def mapToId(basepath: String, ppath: String): String = this.mapToId(this.removeBasepath(basepath, ppath)) def mapToId(path: String): String = this.uncleanId { val encapsulatingDir = this.extractEncapsulatingDirFromPpath(path) val id = if (path.endsWith(this.separator.toString)) path.init else path (if (encapsulatingDir != null) id.substring(0, id.length - encapsulatingDir.length) else id).replace(this.separator.toString, "") } def extractEncapsulatingDirFromPpath(basepath: String, ppath: String): String = this.extractEncapsulatingDirFromPpath(this.removeBasepath(basepath, ppath)) def extractEncapsulatingDirFromPpath(ppath: String): String = { require(ppath != null) //Walk the ppath looking for first non-shorty val ppathParts = ppath.split("\\" + this.separator) //If there is only 1 part if (ppathParts.length == 1) { //If part <= shorty length then no encapsulating dir if (ppathParts(0).length <= this.shortyLength) null //Else no ppath else throw new InvalidPpathException("Ppath (%s) contains no shorties" format ppath) } else { //All parts up to next to last and last should have shorty length ppathParts.take(ppathParts.size - 2).find(_.size != this.shortyLength).foreach { _ => throw new InvalidPpathException( "Ppath (%s) has parts of incorrect length" format ppath ) } val nextToLastPart = ppathParts(ppathParts.length - 2) val lastPart = ppathParts(ppathParts.length - 1) //Next to last should have shorty length or less if (nextToLastPart.length > this.shortyLength) throw new InvalidPpathException("Ppath (%s) has parts of incorrect length" format ppath) //If next to last has shorty length if (nextToLastPart.length == this.shortyLength) //If last has length > shorty length then encapsulating dir if (lastPart.length > this.shortyLength) lastPart else null else lastPart } } private def concat(paths: String*): String = if (paths.isEmpty) null else paths.filterNot(_ == null).map( path => if (path.last == this.separator) path.init else path ).mkString(this.separator.toString) def removeBasepath(basePath: String, path: String) = { require(basePath != null) require(path != null) var newPath = path if (path.startsWith(basePath)) { newPath = newPath.substring(basePath.length) if (newPath.startsWith(this.separator.toString)) newPath = newPath.substring(1) } newPath } def cleanId(id: String) = { require(id != null) //First pass val bytes = try id.getBytes("utf-8") catch { case e: java.io.UnsupportedEncodingException => throw new RuntimeException("Error getting UTF-8 for path", e) } val buffer = new StringBuffer bytes.foreach { byte => val i = (byte & 0xff).toInt if ( i < 0x21 || i > 0x7e || i == 0x22 || i == 0x2a || i == 0x2b || i == 0x2c || i == 0x3c || i == 0x3d || i == 0x3e || i == 0x3f || i == 0x5c || i == 0x5e || i == 0x7c ) { //Encode buffer.append(Pairtree.HexIndicator) buffer.append(Integer.toHexString(i)) } else { //Don't encode val chars = Character.toChars(i) assert(chars.length == 1) buffer.append(chars(0)) } } buffer.toString.replace('/', '=').replace(':', '+').replace('.', ',') } def uncleanId(id: String) = { require(id != null) val buffer = new StringBuffer var c = 0 while (c < id.length) { id.charAt(c) match { case '=' => buffer.append('/') case '+' => buffer.append(':') case ',' => buffer.append('.') case '^' => { val chars = Character.toChars(Integer.parseInt(id.substring(c + 1, c + 3), 16)) assert(chars.length == 1) buffer.append(chars(0)) c += 2 } case chr => buffer.append(chr) } c += 1 } buffer.toString } @SerialVersionUID(1L) class InvalidPpathException(msg: String) extends Exception(msg) }
{ "content_hash": "c7bed8a873a1acad33b0022a336181f8", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 133, "avg_line_length": 32.90972222222222, "alnum_prop": 0.6269255117113315, "repo_name": "umd-mith/mith-jvm-lib", "id": "5937927c1a8f1f8849e7e8abe9964446b10334f8", "size": "5436", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "util/src/main/scala/edu/umd/mith/util/pairtree/Pairtree.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "14479" }, { "name": "Scala", "bytes": "82755" } ] }
CREATE TABLE readme_rendering ( version_id INTEGER NOT NULL PRIMARY KEY REFERENCES versions (id) ON DELETE CASCADE, rendered_at TIMESTAMP NOT NULL ); INSERT INTO readme_rendering (version_id, rendered_at) SELECT id, readme_rendered_at FROM versions WHERE readme_rendered_at IS NOT NULL; ALTER TABLE versions DROP COLUMN readme_rendered_at;
{ "content_hash": "e0834db87c14508358e32e6c203bce12", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 87, "avg_line_length": 39.111111111111114, "alnum_prop": 0.7784090909090909, "repo_name": "rust-lang/crates.io", "id": "9dfbeb9cca99bdbcc649a77d4b8280664ca988b4", "size": "352", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "migrations/2017-09-23-210614_move_readme_rendering_onto_versions/down.sql", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "67200" }, { "name": "Dockerfile", "bytes": "568" }, { "name": "HTML", "bytes": "11846" }, { "name": "Handlebars", "bytes": "83618" }, { "name": "JavaScript", "bytes": "470275" }, { "name": "Jinja", "bytes": "1552" }, { "name": "PLpgSQL", "bytes": "18281" }, { "name": "Procfile", "bytes": "130" }, { "name": "Rust", "bytes": "941606" }, { "name": "Shell", "bytes": "3281" } ] }
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (12.0.1) on Fri Jun 07 18:36:59 PDT 2019 --> <title>Deprecated List</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="dc.created" content="2019-06-07"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="script.js"></script> <script type="text/javascript" src="jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="jquery/jquery-3.3.1.js"></script> <script type="text/javascript" src="jquery/jquery-migrate-3.0.1.js"></script> <script type="text/javascript" src="jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Deprecated List"; } } catch(err) { } //--> var pathtoroot = "./"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="main/package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li class="navBarCell1Rev">Deprecated</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="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </li> </ul> </div> <a id="skip.navbar.top"> <!-- --> </a> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <main role="main"> <div class="header"> <h1 title="Deprecated API" class="title">Deprecated API</h1> <h2 title="Contents">Contents</h2> </div> </main> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="main/package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li class="navBarCell1Rev">Deprecated</li> <li><a href="index-files/index-1.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <a id="skip.navbar.bottom"> <!-- --> </a> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> </footer> </body> </html>
{ "content_hash": "3eebb1545179fd47a1925b3a26969b95", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 112, "avg_line_length": 31.216216216216218, "alnum_prop": 0.6375180375180375, "repo_name": "tliang1/Java-Practice", "id": "800bd9f3ff354c690c0144c056011c3e46e296b4", "size": "3465", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Practice/Intro-To-Java-8th-Ed-Daniel-Y.-Liang/Chapter-14/Chapter14P17/doc/deprecated-list.html", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "710145" } ] }
package com.pureperfect.purview.validators.net; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Mark a field as one that is a host name. * * <p> * E.G: * </p> * * <pre> * * public class MyClass * { * //When validating fields * &#064;Host * private String value; * * ...//or * * //When validating method return values * &#064;Host * public String getValue() { * ... * }; * * ...//or * * //When validating method parameters * public static void foo(&#64;Host String bar) { * ... * } * } * </pre> * * @author J. Chris Folsom * @version 1.1 * @since 1.0 */ @Retention(RetentionPolicy.RUNTIME) @Target( { ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER }) public @interface Host { /** * Validator for a host name. * * @author J. Chris Folsom * @version 1.1 * @since 1.0 */ public class Validator implements com.pureperfect.purview.Validator<InvalidHostNameProblem, Object, Host, Object, CharSequence> { /** * {@inheritDoc} */ public InvalidHostNameProblem validate(final Object instance, final Host annotation, final Object target, final CharSequence value) { if (value == null || value.length() < 1) { if (annotation.required()) { return new InvalidHostNameProblem(instance, annotation, target, value); } return null; } return ValidationRoutines.validateHost(instance, annotation, target, value, annotation.reverseLookup()); } } /** * Optional message key to use to define an i18n message. * * @return Optional message key to use to define an i18n message. */ String messageKey() default ""; /** * Whether or not the field is required. If it is not required, null values * and empty strings will be allowed. * * @return Whether or not the field is required. */ boolean required() default false; /** * Whether or not to perform a reverse lookup to validate the host. * * @return true if reverse lookup. */ boolean reverseLookup() default false; /** * The {@link Host.Validator Validator} for this annotation. * * @return {@link Host.Validator} */ Class<?> validator() default Validator.class; }
{ "content_hash": "16e04c20a3315a4b2c732d9825e6ce03", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 96, "avg_line_length": 20.991071428571427, "alnum_prop": 0.6456826882177796, "repo_name": "PurePerfect/purview", "id": "85cb0e86789d86bad373f89ca6f4f404a92ccc0a", "size": "2964", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/pureperfect/purview/validators/net/Host.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "377740" } ] }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "bb5e7d8a940ac8e4f4c45022303c1ee7", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "d369f3ff982f4046945a622717e1db11b1f30671", "size": "176", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Rutaceae/Peltostigma/Peltostigma eximium/README.md", "mode": "33188", "license": "apache-2.0", "language": [] }
package cscie99.team2.lingolearn.client.view; import java.util.List; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.HasClickHandlers; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.ListBox; import com.google.gwt.user.client.ui.Widget; import cscie99.team2.lingolearn.shared.Course; public class EnrollInCourseView extends Composite { interface Binder extends UiBinder<Widget, EnrollInCourseView> { } private static final Binder binder = GWT.create(Binder.class); @UiField ListBox courseList; @UiField Button enrollButton; private List<Course> listOfCourses; public EnrollInCourseView() { initWidget(binder.createAndBindUi(this)); } public HasClickHandlers getEnrollButton() { return enrollButton; } public Course getSelectedCourse() { int idx = courseList.getSelectedIndex(); Course c = listOfCourses.get(idx); return c; } public void setCourseList(List<Course> courses) { listOfCourses = courses; for (int i=0;i<courses.size();i++) { courseList.addItem(courses.get(i).getCourseName()); } } }
{ "content_hash": "937ea7a89940c811e9de4aba066dc4b4", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 67, "avg_line_length": 27.23404255319149, "alnum_prop": 0.75078125, "repo_name": "lingolearn/lingolearn", "id": "2893d0a9cbf825b1ca83774a45187199f797b688", "size": "1280", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/cscie99/team2/lingolearn/client/view/EnrollInCourseView.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "68206" }, { "name": "Java", "bytes": "495666" } ] }
End of preview.

No dataset card yet

Downloads last month
5