text
stringlengths
2
100k
meta
dict
'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim require('./$.string-trim')('trimRight', function($trim){ return function trimRight(){ return $trim(this, 2); }; });
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="hr" english-language-name="Croatian"> <!-- * This file is generated automatically. --> <!-- * To submit changes to this file upstream (to the DocBook Project) --> <!-- * do not submit an edited version of this file. Instead, submit an --> <!-- * edited version of the source file at the following location: --> <!-- * --> <!-- * https://docbook.svn.sourceforge.net/svnroot/docbook/trunk/gentext/locale/hr.xml --> <!-- * --> <!-- * E-mail the edited hr.xml source file to: --> <!-- * --> <!-- * [email protected] --> <!-- ******************************************************************** --> <!-- This file is part of the XSL DocBook Stylesheet distribution. --> <!-- See ../README or http://docbook.sf.net/release/xsl/current/ for --> <!-- copyright and other information. --> <!-- ******************************************************************** --> <!-- In these files, % with a letter is used for a placeholder: --> <!-- %t is the current element's title --> <!-- %s is the current element's subtitle (if applicable)--> <!-- %n is the current element's number label--> <!-- %p is the current element's page number (if applicable)--> <!-- ******************************************************************** --> <l:gentext key="Abstract" text="Sažetak"/> <l:gentext key="abstract" text="sažetak"/> <l:gentext key="Acknowledgements" text="Acknowledgements"/> <l:gentext key="acknowledgements" text="acknowledgements"/> <l:gentext key="Answer" text="Odgovor:"/> <l:gentext key="answer" text="odgovor:"/> <l:gentext key="Appendix" text="Dodatak"/> <l:gentext key="appendix" text="dodatak"/> <l:gentext key="Article" text="Članak"/> <l:gentext key="article" text="članak"/> <l:gentext key="Author" text="Author"/> <l:gentext key="Bibliography" text="Literatura"/> <l:gentext key="bibliography" text="literatura"/> <l:gentext key="Book" text="Knjiga"/> <l:gentext key="book" text="knjiga"/> <l:gentext key="CAUTION" text="OPREZ"/> <l:gentext key="Caution" text="Oprez"/> <l:gentext key="caution" text="oprez"/> <l:gentext key="Chapter" text="Poglavlje"/> <l:gentext key="chapter" text="poglavlje"/> <l:gentext key="Colophon" text="Impresum"/> <l:gentext key="colophon" text="impresum"/> <l:gentext key="Copyright" text="Autorska prava"/> <l:gentext key="copyright" text="autorska prava"/> <l:gentext key="Dedication" text="Posveta"/> <l:gentext key="dedication" text="posveta"/> <l:gentext key="Edition" text="Izdanje"/> <l:gentext key="edition" text="izdanje"/> <l:gentext key="Editor" text="Editor"/> <l:gentext key="Equation" text="Jednadžba"/> <l:gentext key="equation" text="jednadžba"/> <l:gentext key="Example" text="Primjer"/> <l:gentext key="example" text="primjer"/> <l:gentext key="Figure" text="Slika"/> <l:gentext key="figure" text="slika"/> <l:gentext key="Glossary" text="Rječnik"/> <l:gentext key="glossary" text="rječnik"/> <l:gentext key="GlossSee" text="Vidi"/> <l:gentext key="glosssee" text="vidi"/> <l:gentext key="GlossSeeAlso" text="Vidi i"/> <l:gentext key="glossseealso" text="vidi i"/> <l:gentext key="IMPORTANT" text="VAŽNO"/> <l:gentext key="important" text="važno"/> <l:gentext key="Important" text="Važno"/> <l:gentext key="Index" text="Kazalo"/> <l:gentext key="index" text="kazalo"/> <l:gentext key="ISBN" text="ISBN"/> <l:gentext key="isbn" text="ISBN"/> <l:gentext key="LegalNotice" text="Pravne odredbe"/> <l:gentext key="legalnotice" text="pravne odredbe"/> <l:gentext key="MsgAud" text="Primatelji"/> <l:gentext key="msgaud" text="primatelji"/> <l:gentext key="MsgLevel" text="Razina"/> <l:gentext key="msglevel" text="razina"/> <l:gentext key="MsgOrig" text="Izvor"/> <l:gentext key="msgorig" text="izvor"/> <l:gentext key="NOTE" text="BILJEŠKA"/> <l:gentext key="Note" text="Bilješka"/> <l:gentext key="note" text="bilješka"/> <l:gentext key="Part" text="Dio"/> <l:gentext key="part" text="dio"/> <l:gentext key="Preface" text="Predgovor"/> <l:gentext key="preface" text="predgovor"/> <l:gentext key="Procedure" text="Postupak"/> <l:gentext key="procedure" text="postupak"/> <l:gentext key="ProductionSet" text="Produkcija"/> <l:gentext key="PubDate" text="Datum publikacije"/> <l:gentext key="pubdate" text="datum publikacije"/> <l:gentext key="Published" text="Objavljeno"/> <l:gentext key="published" text="objavljeno"/> <l:gentext key="Publisher" text="Nakladnik"/> <l:gentext key="Qandadiv" text="Pitanje i Odgovor"/> <l:gentext key="qandadiv" text="pitanje i Odgovor"/> <l:gentext key="QandASet" text="Česti Upiti"/> <l:gentext key="Question" text="Pitanje:"/> <l:gentext key="question" text="pitanje:"/> <l:gentext key="RefEntry" text="Stranica"/> <l:gentext key="refentry" text="stranica"/> <l:gentext key="Reference" text="Referenca"/> <l:gentext key="reference" text="referenca"/> <l:gentext key="References" text="Reference"/> <l:gentext key="RefName" text="Ime"/> <l:gentext key="refname" text="Ime"/> <l:gentext key="RefSection" text="Odjeljak"/> <l:gentext key="refsection" text="odjeljak"/> <l:gentext key="RefSynopsisDiv" text="Pregled"/> <l:gentext key="refsynopsisdiv" text="Pregled"/> <l:gentext key="RevHistory" text="Povijest preinaka"/> <l:gentext key="revhistory" text="Povijest preinaka"/> <l:gentext key="revision" text="Preinaka"/> <l:gentext key="Revision" text="Preinaka"/> <l:gentext key="sect1" text="Odjeljak"/> <l:gentext key="sect2" text="Odjeljak"/> <l:gentext key="sect3" text="Odjeljak"/> <l:gentext key="sect4" text="Odjeljak"/> <l:gentext key="sect5" text="Odjeljak"/> <l:gentext key="section" text="odjeljak"/> <l:gentext key="Section" text="Odjeljak"/> <l:gentext key="see" text="vidi"/> <l:gentext key="See" text="Vidi"/> <l:gentext key="seealso" text="vidi i"/> <l:gentext key="Seealso" text="Vidi i"/> <l:gentext key="SeeAlso" text="Vidi i"/> <l:gentext key="set" text="set"/> <l:gentext key="Set" text="Set"/> <l:gentext key="setindex" text="kazalo"/> <l:gentext key="SetIndex" text="Kazalo"/> <l:gentext key="Sidebar" text="Rubni stupac"/> <l:gentext key="sidebar" text="rubni stupac"/> <l:gentext key="step" text="korak"/> <l:gentext key="Step" text="Korak"/> <l:gentext key="table" text="tablica"/> <l:gentext key="Table" text="Tablica"/> <l:gentext key="task" text="zadatak"/> <l:gentext key="Task" text="Zadatak"/> <l:gentext key="tip" text="Savjet"/> <l:gentext key="TIP" text="SAVJET"/> <l:gentext key="Tip" text="Savjet"/> <l:gentext key="Warning" text="Upozorenje"/> <l:gentext key="warning" text="upozorenje"/> <l:gentext key="WARNING" text="UPOZORENJE"/> <l:gentext key="and" text="i"/> <l:gentext key="or" text="ili"/> <l:gentext key="by" text="po"/> <l:gentext key="Edited" text="Uredio/la"/> <l:gentext key="edited" text="uredio/la"/> <l:gentext key="Editedby" text="Uredio/la"/> <l:gentext key="editedby" text="uredio/la"/> <l:gentext key="in" text="u"/> <l:gentext key="lastlistcomma" text=","/> <l:gentext key="listcomma" text=","/> <l:gentext key="notes" text="bilješke"/> <l:gentext key="Notes" text="Bilješke"/> <l:gentext key="Pgs" text="Str."/> <l:gentext key="pgs" text="str."/> <l:gentext key="Revisedby" text="Promijenjeno po: "/> <l:gentext key="revisedby" text="promijenjeno po: "/> <l:gentext key="TableNotes" text="Napomene"/> <l:gentext key="tablenotes" text="napomene"/> <l:gentext key="TableofContents" text="Sadržaj"/> <l:gentext key="tableofcontents" text="sadržaj"/> <l:gentext key="unexpectedelementname" text="Neočekivano ime elementa"/> <l:gentext key="unsupported" text="nepodržano"/> <l:gentext key="xrefto" text="xref za"/> <l:gentext key="Authors" text="Autori"/> <l:gentext key="copyeditor" text="Urdenik za autorska prava"/> <l:gentext key="graphicdesigner" text="Grafički dizajner"/> <l:gentext key="productioneditor" text="Urednik produkcija"/> <l:gentext key="technicaleditor" text="Tehnički urednik"/> <l:gentext key="translator" text="Prevodilac"/> <l:gentext key="listofequations" text="popis jednadžbi"/> <l:gentext key="ListofEquations" text="Popis jednadžbi"/> <l:gentext key="ListofExamples" text="Popis primjera"/> <l:gentext key="listofexamples" text="popis primjera"/> <l:gentext key="ListofFigures" text="Popis slika"/> <l:gentext key="listoffigures" text="popis slika"/> <l:gentext key="ListofProcedures" text="Popis postupaka"/> <l:gentext key="listofprocedures" text="popis postupaka"/> <l:gentext key="listoftables" text="popis tablica"/> <l:gentext key="ListofTables" text="Popis tablica "/> <l:gentext key="ListofUnknown" text="Popis nepoznanica"/> <l:gentext key="listofunknown" text="popis nepoznanica"/> <l:gentext key="nav-home" text="Početak"/> <l:gentext key="nav-next" text="Naprijed"/> <l:gentext key="nav-next-sibling" text="Skoči unaprijed"/> <l:gentext key="nav-prev" text="Natrag"/> <l:gentext key="nav-prev-sibling" text="Skoči unatrag"/> <l:gentext key="nav-up" text="Gore"/> <l:gentext key="nav-toc" text="Sadržaj"/> <l:gentext key="Draft" text="Nacrt"/> <l:gentext key="above" text="iznad"/> <l:gentext key="below" text="ispod"/> <l:gentext key="sectioncalled" text="the section called"/> <l:gentext key="index symbols" text="Oznake"/> <l:gentext key="writing-mode" text="lr-tb"/> <l:gentext key="lowercase.alpha" text="abcčćdđefghijklmnopqrsštuvwxyzž"/> <l:gentext key="uppercase.alpha" text="ABCČĆDĐEFGHIJKLMNOPQRSŠTUVWXYZŽ"/> <l:gentext key="normalize.sort.input" text="AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ" lang="en"/> <l:gentext key="normalize.sort.output" text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ" lang="en"/> <l:dingbat key="startquote" text="“"/> <l:dingbat key="endquote" text="”"/> <l:dingbat key="nestedstartquote" text="‘"/> <l:dingbat key="nestedendquote" text="’"/> <l:dingbat key="singlestartquote" text="‘"/> <l:dingbat key="singleendquote" text="’"/> <l:dingbat key="bullet" text="•"/> <l:gentext key="hyphenation-character" text="-"/> <l:gentext key="hyphenation-push-character-count" text="2"/> <l:gentext key="hyphenation-remain-character-count" text="2"/> <l:context name="keycap"><l:template name="alt" text="Alt" lang="en"/> <l:template name="backspace" text="&lt;—" lang="en"/> <l:template name="command" text="⌘" lang="en"/> <l:template name="control" text="Ctrl" lang="en"/> <l:template name="delete" text="Del" lang="en"/> <l:template name="down" text="↓" lang="en"/> <l:template name="end" text="End" lang="en"/> <l:template name="enter" text="Enter" lang="en"/> <l:template name="escape" text="Esc" lang="en"/> <l:template name="home" text="Home" lang="en"/> <l:template name="insert" text="Ins" lang="en"/> <l:template name="left" text="←" lang="en"/> <l:template name="meta" text="Meta" lang="en"/> <l:template name="option" text="???" lang="en"/> <l:template name="pagedown" text="Page ↓" lang="en"/> <l:template name="pageup" text="Page ↑" lang="en"/> <l:template name="right" text="→" lang="en"/> <l:template name="shift" text="Shift" lang="en"/> <l:template name="space" text="Space" lang="en"/> <l:template name="tab" text="→|" lang="en"/> <l:template name="up" text="↑" lang="en"/> </l:context> <l:context name="webhelp"><l:template name="Search" text="Search" lang="en"/> <l:template name="Enter_a_term_and_click" text="Enter a term and click " lang="en"/> <l:template name="Go" text="Go" lang="en"/> <l:template name="to_perform_a_search" text=" to perform a search." lang="en"/> <l:template name="txt_filesfound" text="Results" lang="en"/> <l:template name="txt_enter_at_least_1_char" text="You must enter at least one character." lang="en"/> <l:template name="txt_browser_not_supported" text="JavaScript is disabled on your browser. Please enable JavaScript to enjoy all the features of this site." lang="en"/> <l:template name="txt_please_wait" text="Please wait. Search in progress..." lang="en"/> <l:template name="txt_results_for" text="Results for: " lang="en"/> <l:template name="TableofContents" text="Contents" lang="en"/> <l:template name="HighlightButton" text="Toggle search result highlighting" lang="en"/> <l:template name="Your_search_returned_no_results" text="Your search returned no results." lang="en"/> </l:context> <l:context name="styles"><l:template name="person-name" text="first-last"/> </l:context> <l:context name="title"><l:template name="abstract" text="%t"/> <l:template name="acknowledgements" text="%t"/> <l:template name="answer" text="%t"/> <l:template name="appendix" text="Dodatak %n. %t"/> <l:template name="article" text="%t"/> <l:template name="authorblurb" text="%t"/> <l:template name="bibliodiv" text="%t"/> <l:template name="biblioentry" text="%t"/> <l:template name="bibliography" text="%t"/> <l:template name="bibliolist" text="%t"/> <l:template name="bibliomixed" text="%t"/> <l:template name="bibliomset" text="%t"/> <l:template name="biblioset" text="%t"/> <l:template name="blockquote" text="%t"/> <l:template name="book" text="%t"/> <l:template name="calloutlist" text="%t"/> <l:template name="caution" text="%t"/> <l:template name="chapter" text="Poglavlje %n. %t"/> <l:template name="colophon" text="%t"/> <l:template name="dedication" text="%t"/> <l:template name="equation" text="Jednadžba %n. %t"/> <l:template name="example" text="Primjer %n. %t"/> <l:template name="figure" text="Slika %n. %t"/> <l:template name="foil" text="%t"/> <l:template name="foilgroup" text="%t"/> <l:template name="formalpara" text="%t"/> <l:template name="glossary" text="%t"/> <l:template name="glossdiv" text="%t"/> <l:template name="glosslist" text="%t"/> <l:template name="glossentry" text="%t"/> <l:template name="important" text="%t"/> <l:template name="index" text="%t"/> <l:template name="indexdiv" text="%t"/> <l:template name="itemizedlist" text="%t"/> <l:template name="legalnotice" text="%t"/> <l:template name="listitem" text=""/> <l:template name="lot" text="%t"/> <l:template name="msg" text="%t"/> <l:template name="msgexplan" text="%t"/> <l:template name="msgmain" text="%t"/> <l:template name="msgrel" text="%t"/> <l:template name="msgset" text="%t"/> <l:template name="msgsub" text="%t"/> <l:template name="note" text="%t"/> <l:template name="orderedlist" text="%t"/> <l:template name="part" text="Dio %n. %t"/> <l:template name="partintro" text="%t"/> <l:template name="preface" text="%t"/> <l:template name="procedure" text="%t"/> <l:template name="procedure.formal" text="Postupak %n. %t"/> <l:template name="productionset" text="%t"/> <l:template name="productionset.formal" text="Produkcija %n"/> <l:template name="qandadiv" text="%t"/> <l:template name="qandaentry" text="%t"/> <l:template name="qandaset" text="%t"/> <l:template name="question" text="%t"/> <l:template name="refentry" text="%t"/> <l:template name="reference" text="%t"/> <l:template name="refsection" text="%t"/> <l:template name="refsect1" text="%t"/> <l:template name="refsect2" text="%t"/> <l:template name="refsect3" text="%t"/> <l:template name="refsynopsisdiv" text="%t"/> <l:template name="refsynopsisdivinfo" text="%t"/> <l:template name="screenshot" text="%t" lang="en"/> <l:template name="segmentedlist" text="%t"/> <l:template name="set" text="%t"/> <l:template name="setindex" text="%t"/> <l:template name="sidebar" text="%t"/> <l:template name="step" text="%t"/> <l:template name="table" text="Tablica %n. %t"/> <l:template name="task" text="%t"/> <l:template name="tasksummary" text="%t"/> <l:template name="taskprerequisites" text="%t"/> <l:template name="taskrelated" text="%t"/> <l:template name="tip" text="%t"/> <l:template name="toc" text="%t"/> <l:template name="variablelist" text="%t"/> <l:template name="varlistentry" text=""/> <l:template name="warning" text="%t"/> </l:context> <l:context name="title-unnumbered"><l:template name="appendix" text="%t"/> <l:template name="article/appendix" text="%t"/> <l:template name="bridgehead" text="%t"/> <l:template name="chapter" text="%t"/> <l:template name="sect1" text="%t"/> <l:template name="sect2" text="%t"/> <l:template name="sect3" text="%t"/> <l:template name="sect4" text="%t"/> <l:template name="sect5" text="%t"/> <l:template name="section" text="%t"/> <l:template name="simplesect" text="%t"/> <l:template name="topic" text="%t" lang="en"/> <l:template name="part" text="%t"/> </l:context> <l:context name="title-numbered"><l:template name="appendix" text="Dodatak %n. %t"/> <l:template name="article/appendix" text="%n. %t"/> <l:template name="bridgehead" text="%n. %t"/> <l:template name="chapter" text="Poglavlje %n. %t"/> <l:template name="part" text="Dio %n. %t"/> <l:template name="sect1" text="%n. %t"/> <l:template name="sect2" text="%n. %t"/> <l:template name="sect3" text="%n. %t"/> <l:template name="sect4" text="%n. %t"/> <l:template name="sect5" text="%n. %t"/> <l:template name="section" text="%n. %t"/> <l:template name="simplesect" text="%t"/> <l:template name="topic" text="%t" lang="en"/> </l:context> <l:context name="subtitle"><l:template name="appendix" text="%s"/> <l:template name="acknowledgements" text="%s"/> <l:template name="article" text="%s"/> <l:template name="bibliodiv" text="%s"/> <l:template name="biblioentry" text="%s"/> <l:template name="bibliography" text="%s"/> <l:template name="bibliomixed" text="%s"/> <l:template name="bibliomset" text="%s"/> <l:template name="biblioset" text="%s"/> <l:template name="book" text="%s"/> <l:template name="chapter" text="%s"/> <l:template name="colophon" text="%s"/> <l:template name="dedication" text="%s"/> <l:template name="glossary" text="%s"/> <l:template name="glossdiv" text="%s"/> <l:template name="index" text="%s"/> <l:template name="indexdiv" text="%s"/> <l:template name="lot" text="%s"/> <l:template name="part" text="%s"/> <l:template name="partintro" text="%s"/> <l:template name="preface" text="%s"/> <l:template name="refentry" text="%s"/> <l:template name="reference" text="%s"/> <l:template name="refsection" text="%s"/> <l:template name="refsect1" text="%s"/> <l:template name="refsect2" text="%s"/> <l:template name="refsect3" text="%s"/> <l:template name="refsynopsisdiv" text="%s"/> <l:template name="sect1" text="%s"/> <l:template name="sect2" text="%s"/> <l:template name="sect3" text="%s"/> <l:template name="sect4" text="%s"/> <l:template name="sect5" text="%s"/> <l:template name="section" text="%s"/> <l:template name="set" text="%s"/> <l:template name="setindex" text="%s"/> <l:template name="sidebar" text="%s"/> <l:template name="simplesect" text="%s"/> <l:template name="topic" text="%t" lang="en"/> <l:template name="toc" text="%s"/> </l:context> <l:context name="xref"><l:template name="abstract" text="%t"/> <l:template name="acknowledgements" text="%t"/> <l:template name="answer" text="Odgovor: %n"/> <l:template name="appendix" text="%t"/> <l:template name="article" text="%t"/> <l:template name="authorblurb" text="%t"/> <l:template name="bibliodiv" text="%t"/> <l:template name="bibliography" text="%t"/> <l:template name="bibliomset" text="%t"/> <l:template name="biblioset" text="%t"/> <l:template name="blockquote" text="%t"/> <l:template name="book" text="%t"/> <l:template name="calloutlist" text="%t"/> <l:template name="caution" text="%t"/> <l:template name="chapter" text="%t"/> <l:template name="colophon" text="%t"/> <l:template name="constraintdef" text="%t"/> <l:template name="dedication" text="%t"/> <l:template name="equation" text="%t"/> <l:template name="example" text="%t"/> <l:template name="figure" text="%t"/> <l:template name="foil" text="%t"/> <l:template name="foilgroup" text="%t"/> <l:template name="formalpara" text="%t"/> <l:template name="glossary" text="%t"/> <l:template name="glossdiv" text="%t"/> <l:template name="important" text="%t"/> <l:template name="index" text="%t"/> <l:template name="indexdiv" text="%t"/> <l:template name="itemizedlist" text="%t"/> <l:template name="legalnotice" text="%t"/> <l:template name="listitem" text="%n"/> <l:template name="lot" text="%t"/> <l:template name="msg" text="%t"/> <l:template name="msgexplan" text="%t"/> <l:template name="msgmain" text="%t"/> <l:template name="msgrel" text="%t"/> <l:template name="msgset" text="%t"/> <l:template name="msgsub" text="%t"/> <l:template name="note" text="%t"/> <l:template name="orderedlist" text="%t"/> <l:template name="part" text="%t"/> <l:template name="partintro" text="%t"/> <l:template name="preface" text="%t"/> <l:template name="procedure" text="%t"/> <l:template name="productionset" text="%t"/> <l:template name="qandadiv" text="%t"/> <l:template name="qandaentry" text="Pitanje: %n"/> <l:template name="qandaset" text="%t"/> <l:template name="question" text="Pitanje: %n"/> <l:template name="reference" text="%t"/> <l:template name="refsynopsisdiv" text="%t"/> <l:template name="screenshot" text="%t" lang="en"/> <l:template name="segmentedlist" text="%t"/> <l:template name="set" text="%t"/> <l:template name="setindex" text="%t"/> <l:template name="sidebar" text="%t"/> <l:template name="table" text="%t"/> <l:template name="task" text="%t"/> <l:template name="tip" text="%t"/> <l:template name="toc" text="%t"/> <l:template name="variablelist" text="%t"/> <l:template name="varlistentry" text="%n"/> <l:template name="warning" text="%t"/> <l:template name="olink.document.citation" text=" in %o"/> <l:template name="olink.page.citation" text=" (page %p)"/> <l:template name="page.citation" text=" [%p]"/> <l:template name="page" text="(page %p)"/> <l:template name="docname" text=" in %o"/> <l:template name="docnamelong" text=" in the document titled %o"/> <l:template name="pageabbrev" text="(p. %p)"/> <l:template name="Page" text="Page %p"/> <l:template name="topic" text="%t" lang="en"/> <l:template name="bridgehead" text="the section called “%t”"/> <l:template name="refsection" text="the section called “%t”"/> <l:template name="refsect1" text="the section called “%t”"/> <l:template name="refsect2" text="the section called “%t”"/> <l:template name="refsect3" text="the section called “%t”"/> <l:template name="sect1" text="the section called “%t”"/> <l:template name="sect2" text="the section called “%t”"/> <l:template name="sect3" text="the section called “%t”"/> <l:template name="sect4" text="the section called “%t”"/> <l:template name="sect5" text="the section called “%t”"/> <l:template name="section" text="the section called “%t”"/> <l:template name="simplesect" text="the section called “%t”"/> </l:context> <l:context name="xref-number"><l:template name="answer" text="Odgovor: %n"/> <l:template name="appendix" text="Dodatak %n"/> <l:template name="bridgehead" text="Odjeljak %n"/> <l:template name="chapter" text="Poglavlje %n"/> <l:template name="equation" text="Jednadžba %n"/> <l:template name="example" text="Primjer %n"/> <l:template name="figure" text="Slika %n"/> <l:template name="part" text="Dio %n"/> <l:template name="procedure" text="Postupak %n"/> <l:template name="productionset" text="Produkcija %n"/> <l:template name="qandadiv" text="Pitanje i Odgovor %n"/> <l:template name="qandaentry" text="Pitanje: %n"/> <l:template name="question" text="Pitanje: %n"/> <l:template name="sect1" text="Odjeljak %n"/> <l:template name="sect2" text="Odjeljak %n"/> <l:template name="sect3" text="Odjeljak %n"/> <l:template name="sect4" text="Odjeljak %n"/> <l:template name="sect5" text="Odjeljak %n"/> <l:template name="section" text="Odjeljak %n"/> <l:template name="table" text="Tablica %n"/> </l:context> <l:context name="xref-number-and-title"><l:template name="appendix" text="Dodatak %n, %t"/> <l:template name="bridgehead" text="Odjeljak %n, “%t”"/> <l:template name="chapter" text="Poglavlje %n, %t"/> <l:template name="equation" text="Jednadžba %n, “%t”"/> <l:template name="example" text="Primjer %n, “%t”"/> <l:template name="figure" text="Slika %n, “%t”"/> <l:template name="part" text="Dio %n, “%t”"/> <l:template name="procedure" text="Postupak %n, “%t”"/> <l:template name="productionset" text="Produkcija %n, “%t”"/> <l:template name="qandadiv" text="Pitanje i Odgovor %n, “%t”"/> <l:template name="refsect1" text="the section called “%t”"/> <l:template name="refsect2" text="the section called “%t”"/> <l:template name="refsect3" text="the section called “%t”"/> <l:template name="refsection" text="the section called “%t”"/> <l:template name="sect1" text="Odjeljak %n, “%t”"/> <l:template name="sect2" text="Odjeljak %n, “%t”"/> <l:template name="sect3" text="Odjeljak %n, “%t”"/> <l:template name="sect4" text="Odjeljak %n, “%t”"/> <l:template name="sect5" text="Odjeljak %n, “%t”"/> <l:template name="section" text="Odjeljak %n, “%t”"/> <l:template name="simplesect" text="the section called “%t”"/> <l:template name="table" text="Tablica %n, “%t”"/> </l:context> <l:context name="authorgroup"><l:template name="sep" text=", "/> <l:template name="sep2" text=" i "/> <l:template name="seplast" text=", i "/> </l:context> <l:context name="glossary"><l:template name="see" text="Vidi %t."/> <l:template name="seealso" text="Vidi i %t."/> <l:template name="seealso-separator" text=", "/> </l:context> <l:context name="msgset"><l:template name="MsgAud" text="Primatelji: "/> <l:template name="MsgLevel" text="Razina: "/> <l:template name="MsgOrig" text="Izvor: "/> </l:context> <l:context name="datetime"><l:template name="format" text="m/d/Y"/> </l:context> <l:context name="termdef"><l:template name="prefix" text="[Definicija: "/> <l:template name="suffix" text="]"/> </l:context> <l:context name="datetime-full"><l:template name="January" text="Siječanj"/> <l:template name="February" text="Veljača"/> <l:template name="March" text="Ožujak"/> <l:template name="April" text="Travanj"/> <l:template name="May" text="Svibanj"/> <l:template name="June" text="Lipanj"/> <l:template name="July" text="Srpanj"/> <l:template name="August" text="Kolovoz"/> <l:template name="September" text="Rujan"/> <l:template name="October" text="Listopad"/> <l:template name="November" text="Studeni"/> <l:template name="December" text="Prosinac"/> <l:template name="Monday" text="Ponedjeljak"/> <l:template name="Tuesday" text="Utorak"/> <l:template name="Wednesday" text="Srijeda"/> <l:template name="Thursday" text="Četvrtak"/> <l:template name="Friday" text="Petak"/> <l:template name="Saturday" text="Subota"/> <l:template name="Sunday" text="Nedjelja"/> </l:context> <l:context name="datetime-abbrev"><l:template name="Jan" text="Sij"/> <l:template name="Feb" text="Velj"/> <l:template name="Mar" text="Ožu"/> <l:template name="Apr" text="Tra"/> <l:template name="May" text="Svi"/> <l:template name="Jun" text="Lip"/> <l:template name="Jul" text="Srp"/> <l:template name="Aug" text="Kol"/> <l:template name="Sep" text="Ruj"/> <l:template name="Oct" text="Lis"/> <l:template name="Nov" text="Stu"/> <l:template name="Dec" text="Pro"/> <l:template name="Mon" text="Pon"/> <l:template name="Tue" text="Uto"/> <l:template name="Wed" text="Sri"/> <l:template name="Thu" text="Čet"/> <l:template name="Fri" text="Pet"/> <l:template name="Sat" text="Sub"/> <l:template name="Sun" text="Ned"/> </l:context> <l:context name="htmlhelp"><l:template name="langcode" text="0x041a Croatian"/> </l:context> <l:context name="index"><l:template name="term-separator" text=", "/> <l:template name="number-separator" text=", "/> <l:template name="range-separator" text="-"/> </l:context> <l:context name="iso690"><l:template name="lastfirst.sep" text=", "/> <l:template name="alt.person.two.sep" text=" – "/> <l:template name="alt.person.last.sep" text=" – "/> <l:template name="alt.person.more.sep" text=" – "/> <l:template name="primary.editor" text=" (ed.)"/> <l:template name="primary.many" text=", et al."/> <l:template name="primary.sep" text=". "/> <l:template name="submaintitle.sep" text=": "/> <l:template name="title.sep" text=". "/> <l:template name="othertitle.sep" text=", "/> <l:template name="medium1" text=" ["/> <l:template name="medium2" text="]"/> <l:template name="secondary.person.sep" text="; "/> <l:template name="secondary.sep" text=". "/> <l:template name="respons.sep" text=". "/> <l:template name="edition.sep" text=". "/> <l:template name="edition.serial.sep" text=", "/> <l:template name="issuing.range" text="-"/> <l:template name="issuing.div" text=", "/> <l:template name="issuing.sep" text=". "/> <l:template name="partnr.sep" text=". "/> <l:template name="placepubl.sep" text=": "/> <l:template name="publyear.sep" text=", "/> <l:template name="pubinfo.sep" text=". "/> <l:template name="spec.pubinfo.sep" text=", "/> <l:template name="upd.sep" text=", "/> <l:template name="datecit1" text=" [cited "/> <l:template name="datecit2" text="]"/> <l:template name="extent.sep" text=". "/> <l:template name="locs.sep" text=", "/> <l:template name="location.sep" text=". "/> <l:template name="serie.sep" text=". "/> <l:template name="notice.sep" text=". "/> <l:template name="access" text="Available "/> <l:template name="acctoo" text="Also available "/> <l:template name="onwww" text="from World Wide Web"/> <l:template name="oninet" text="from Internet"/> <l:template name="access.end" text=": "/> <l:template name="link1" text="&lt;"/> <l:template name="link2" text="&gt;"/> <l:template name="access.sep" text=". "/> <l:template name="isbn" text="ISBN "/> <l:template name="issn" text="ISSN "/> <l:template name="stdnum.sep" text=". "/> <l:template name="patcountry.sep" text=". "/> <l:template name="pattype.sep" text=", "/> <l:template name="patnum.sep" text=". "/> <l:template name="patdate.sep" text=". "/> </l:context><l:letters><l:l i="-1"/> <l:l i="0">Oznake</l:l> <l:l i="10">A</l:l> <l:l i="10">a</l:l> <l:l i="20">B</l:l> <l:l i="20">b</l:l> <l:l i="30">C</l:l> <l:l i="30">c</l:l> <l:l i="30">Ć</l:l> <l:l i="30">ć</l:l> <l:l i="30">Č</l:l> <l:l i="30">č</l:l> <l:l i="40">D</l:l> <l:l i="40">d</l:l> <l:l i="40">Đ</l:l> <l:l i="40">đ</l:l> <l:l i="50">E</l:l> <l:l i="50">e</l:l> <l:l i="60">F</l:l> <l:l i="60">f</l:l> <l:l i="70">G</l:l> <l:l i="70">g</l:l> <l:l i="80">H</l:l> <l:l i="80">h</l:l> <l:l i="90">I</l:l> <l:l i="90">i</l:l> <l:l i="100">J</l:l> <l:l i="100">j</l:l> <l:l i="110">K</l:l> <l:l i="110">k</l:l> <l:l i="120">L</l:l> <l:l i="120">l</l:l> <l:l i="130">M</l:l> <l:l i="130">m</l:l> <l:l i="140">N</l:l> <l:l i="140">n</l:l> <l:l i="150">O</l:l> <l:l i="150">o</l:l> <l:l i="160">P</l:l> <l:l i="160">p</l:l> <l:l i="180">R</l:l> <l:l i="180">r</l:l> <l:l i="190">S</l:l> <l:l i="190">s</l:l> <l:l i="190">Š</l:l> <l:l i="190">š</l:l> <l:l i="200">T</l:l> <l:l i="200">t</l:l> <l:l i="210">U</l:l> <l:l i="210">u</l:l> <l:l i="220">V</l:l> <l:l i="220">v</l:l> <l:l i="260">Z</l:l> <l:l i="260">z</l:l> <l:l i="260">Ž</l:l> <l:l i="260">ž</l:l> </l:letters> </l:l10n>
{ "pile_set_name": "Github" }
<?php namespace Faker\Provider\ar_SA; use Faker\Calculator\Luhn; class Person extends \Faker\Provider\Person { protected static $maleNameFormats = array( '{{firstNameMale}} {{lastName}}', '{{firstNameMale}} {{lastName}}', '{{firstNameMale}} {{lastName}}', '{{firstNameMale}} {{firstNameMale}} {{lastName}}', '{{firstNameMale}} {{firstNameMale}} {{firstNameMale}} {{lastName}}', '{{titleFemale}} {{firstNameFemale}} {{lastName}}', ); protected static $femaleNameFormats = array( '{{firstNameFemale}} {{lastName}}', '{{firstNameFemale}} {{lastName}}', '{{firstNameFemale}} {{lastName}}', '{{firstNameFemale}} {{lastName}}', '{{firstNameFemale}} {{firstNameMale}} {{lastName}}', '{{firstNameFemale}} {{firstNameMale}} {{firstNameMale}} {{lastName}}', '{{titleFemale}} {{firstNameFemale}} {{lastName}}', ); /** * @link http://muslim-names.us/ */ protected static $firstNameMale = array( 'آدم', 'أبراهيم', 'أحمد', 'أدهم', 'أسامة', 'أسعد', 'أشرف', 'أكثم', 'أكرم', 'أمجد', 'أمين', 'أنس', 'أنور', 'أواس', 'أوس', 'أيمن', 'أيهم', 'أيوب', 'إبراهيم', 'إسلام', 'إسماعيل', 'إلياس', 'إياد', 'إيهاب', 'ابان', 'ابراهيم', 'اثير', 'احسان', 'احمد', 'ادريس', 'ادم', 'ادهم', 'اديب', 'اسامة', 'اسحاق', 'اسحق', 'اسعد', 'اسلام', 'اسماعيل', 'اسيد', 'اشراف', 'اشرف', 'اصلان', 'اكثم', 'اكرم', 'البراء', 'البشر', 'الحارث', 'الحسين', 'الطفيل', 'العزم', 'الليث', 'المثنى', 'المنصور', 'الياس', 'اليمان', 'امجد', 'امير', 'امين', 'أنس', 'انور', 'انيس', 'اوس', 'اوسم', 'اويس', 'اياد', 'اياس', 'ايسر', 'ايمن', 'ايهم', 'ايوب', 'باسل', 'باسم', 'باهر', 'بدر', 'بدوان', 'براء', 'برهان', 'بسام', 'بشار', 'بشر', 'بشير', 'بكر', 'بلال', 'بليغ', 'بندر', 'بهاء', 'تركي', 'توفيق', 'ثامر', 'جابر', 'جاسر', 'جاسم', 'جبر', 'جبير', 'جراح', 'جريس', 'جعفر', 'جلال', 'جمال', 'جمزه', 'جميل', 'جهاد', 'جواد', 'حابس', 'حاتم', 'حارث', 'حازم', 'حافظ', 'حاكم', 'حامد', 'حبيب', 'حذيفة', 'حسام', 'حسان', 'حسن', 'حسني', 'حسين', 'حكم', 'حمد', 'حمدالله', 'حمدان', 'حمدي', 'حمزة', 'حمود', 'حميد', 'خالد', 'خضر', 'خلدون', 'خلف', 'خليفة', 'خليل', 'خميس', 'داوود', 'ذياب', 'ذيب', 'رأفت', 'رؤوف', 'رئاد', 'رائد', 'رائف', 'راجح', 'راجي', 'راشد', 'راضي', 'راغب', 'رافت', 'رافع', 'رافي', 'راكان', 'رامان', 'رامز', 'رامي', 'رامين', 'ربيع', 'رجا', 'رجائي', 'رجب', 'رداد', 'رزق', 'رسلان', 'رشاد', 'رشيد', 'رضا', 'رضوان', 'رعد', 'رغد', 'رغيد', 'ركان', 'رماح', 'رياض', 'ريان', 'زاهر', 'زاهي', 'زايد', 'زكريا', 'زمام', 'زهير', 'زياد', 'زيد', 'زيدان', 'زيدون', 'زين', 'زين العابدين', 'سائد', 'ساري', 'سالم', 'سامح', 'سامر', 'سامي', 'ساهر', 'سدير', 'سرمد', 'سري', 'سعد', 'سعود', 'سعيد', 'سفيان', 'سكوت', 'سلام', 'سلطان', 'سلمان', 'سليم', 'سليمان', 'سمعان', 'سميح', 'سنان', 'سند', 'سهل', 'سهم', 'سيف', 'شادي', 'شافع', 'شاكر', 'شامل', 'شاهر', 'شرحبيل', 'شريف', 'شهاب', 'شهم', 'شوان', 'صادق', 'صافي', 'صالح', 'صخر', 'صدام', 'صفاء', 'صفوان', 'صقر', 'صلاح', 'صلاح الدين', 'صهيب', 'ضرار', 'ضرغام', 'ضياء', 'ضياء الدين’, ', 'طارق', 'طالب', 'طاهر', 'طلال', 'طه', 'عادل', 'عاصم', 'عاطف', 'عامر', 'عايد', 'عبادة', 'عباس', 'عبد الباري', 'عبد الحافظ', 'عبد الحكيم', 'عبد الحليم', 'عبد الحميد', 'عبد الحي', 'عبد الرحمان', 'عبد الرحمن', 'عبد الرحيم', 'عبد الرزاق', 'عبد السلام', 'عبد السميع', 'عبد العزيز', 'عبد العفو', 'عبد الغني', 'عبد الفتاح', 'عبد القادر', 'عبد الكريم', 'عبد اللطيف', 'عبد الله', 'عبد المجيد', 'عبد المولى', 'عبد الناصر', 'عبد الهادي', 'عبد ربه', 'عبداالله', 'عبدالاله', 'عبدالباسط', 'عبدالجليل', 'عبدالجواد', 'عبدالحليم', 'عبدالحميد', 'عبدالرؤوف', 'عبدالرحمن', 'عبدالرحيم', 'عبدالرزاق', 'عبدالسلام', 'عبدالعزيز', 'عبدالفتاح', 'عبدالقادر', 'عبدالكريم', 'عبداللطيف', 'عبدالله', 'عبدالمجيد', 'عبدالمطلب', 'عبدالمعطي', 'عبدالمهيمن', 'عبدالناصر', 'عبدالهادي', 'عبدالوهاب', 'عبيدالله', 'عبيدة', 'عتيبه', 'عثمان', 'عدب', 'عدلي', 'عدنان', 'عدوان', 'عدي', 'عرار', 'عرمان', 'عروة', 'عريق', 'عرين', 'عز الدين', 'عزالدين', 'عزام', 'عزت', 'عزمي', 'عزيز', 'عصام', 'عقل', 'علاء', 'علي', 'عليان', 'عماد', 'عمار', 'عمر', 'عمران', 'عمرو', 'عملا', 'عميد', 'عناد', 'عنان', 'عواد', 'عودة', 'عوده', 'عوض', 'عوف', 'عون', 'عوني', 'عيد', 'عيدالله', 'عيسى', 'غازي', 'غالب', 'غانم', 'غدير', 'غسان', 'غيث', 'فؤاد', 'فائق', 'فاخر', 'فادي', 'فارس', 'فاروق', 'فاضل', 'فايز', 'فتحي', 'فجر', 'فراس', 'فرح', 'فريد', 'فلاح', 'فهد', 'فهمي', 'فواز', 'فوزي', 'فيصل', 'قارس', 'قاسم', 'قبلان', 'قتاده', 'قتيبة', 'قصي', 'قيس', 'كاظم', 'كامل', 'كايد', 'كرم', 'كريم', 'كفاح', 'كمال', 'كنان', 'لؤي', 'لبيب', 'لطف', 'لطفي', 'ليث', 'مأمون', 'مؤثر', 'مؤمن', 'مؤنس', 'مؤيد', 'ماجد', 'مازن', 'مالك', 'مامون', 'ماهر', 'مبارك', 'مثنى', 'مجاهد', 'مجد', 'مجدي', 'محسن', 'محمد ', 'محمود', 'محي', 'مختار', 'مخلص', 'مدحت', 'مدين', 'مراد', 'مرشد', 'مرهف', 'مروان', 'مسعد', 'مسعود', 'مسلم', 'مشاري', 'مشعل', 'مشهور', 'مصباح', 'مصطفى', 'مصطفي', 'مصعب', 'مضر', 'مطيع', 'مظفر', 'مظهر', 'معاذ', 'معاوية', 'معتز', 'معتصم', 'معمر', 'معن', 'معين', 'مفدي', 'مفلح', 'مقداد', 'ملهم', 'ممدوح', 'مناف', 'منتصر', 'منح', 'منذر', 'منصف', 'منصور', 'منير', 'مهاب', 'مهدي', 'مهران', 'مهند', 'موسى', 'موفق', 'نائل', 'ناجي', 'نادر', 'ناصر', 'ناهض', 'نايف', 'نبراس', 'نبيل', 'نجيب', 'نديم', 'نزار', 'نزال', 'نزيه', 'نسيم', 'نشات', 'نصار', 'نصر', 'نصري', 'نصوح', 'نضال', 'نظام', 'نعمان', 'نعمة', 'نعيم', 'نقولا', 'نمر', 'نهاد', 'نهار', 'نواف', 'نورس', 'نوفان', 'هادي', 'هارون', 'هاشم', 'هانى', 'هاني', 'هذال', 'هشام', 'هلال', 'همام', 'هيثم', 'وائل', 'واثق', 'واصف', 'وجدي', 'وجيه', 'وحيد', 'وديع', 'ورد', 'وسام', 'وسن', 'وسيم', 'وصفي', 'وضاح', 'وعد', 'وفاء', 'وليد', 'وهيب', 'ياسر', 'ياسين', 'يامن', 'يحيى', 'يزن', 'يزيد', 'يسار', 'يشار', 'يعرب', 'يعقوب', 'يمان', 'ينال', 'يوسف', 'يونس', ); /** * @link http://muslim-names.us/ */ protected static $firstNameFemale = array( 'آثار', 'آلاء', 'آناء', 'آية', 'أبرار', 'أحلام', 'أروى', 'أريج', 'أسماء', 'أسيل', 'أصاله', 'أفنان', 'ألاء', 'أماني', 'أمل', 'أميرة', 'أنسام', 'أنوار', 'إباء', 'إخلاص', 'إسراء', 'إسلام', 'إكرام', 'إنعام', 'إيمان', 'إيناس', 'ابتهاج', 'ابتهال', 'أبرار', 'إخلاص', 'ارجوان', 'أروى', 'أريج', 'أزهار', 'أسحار', 'اسراء', 'اسرار', 'اسيل', 'اشراق', 'أصالة', 'اعتدال', 'أفراح', 'أفنان', 'إكرام', 'آلاء', 'العنود', 'إلهام', 'آمال', 'أمنة', 'أميرة', 'أمينة', 'أناهيد', 'انتظار', 'أنعام', 'أنوار', 'آيات', 'إيمان', 'إيناس', 'آية', 'باسمة', 'بتول', 'بثينة', 'بدور', 'براء', 'براءة', 'بسمة', 'بشائر', 'بشرى', 'بلسم', 'بنان', 'بهجة', 'بيان', 'بيداء', 'بيسان', 'تالا', 'تالة', 'تالين', 'تحرير', 'تسنيم', 'تغريد', 'تقوى', 'تقى', 'تمارا', 'تماضر', 'تمام', 'تهاني', 'تولين', 'ثريا', 'جمانة', 'جميلة', 'جنى', 'جهاد', 'جود', 'حبيبة', 'حسناء', 'حصة', 'حلا', 'حليمة', 'حنان', 'حنين', 'حياة', 'ختام', 'خديجة', 'خلود', 'خولة', 'دارين', 'داليا', 'دالية', 'دانا', 'دانة', 'دانية', 'دعاء', 'دلال', 'دنى', 'دنيا', 'ديانا', 'ديما', 'دينا', 'رؤى', 'رؤيه', 'رابعة', 'راغدة', 'راما', 'رانا', 'رانيا', 'راوية', 'راية', 'ربا', 'رباب', 'ربى', 'رجاء', 'رحمة', 'رحمه', 'ردينة', 'رزان', 'رشا', 'رغد', 'رغدة', 'رفاه', 'رقية', 'رمال', 'رنا', 'رناد', 'رند', 'رنده', 'رنيم', 'رنين', 'رهام', 'رهف', 'رواء', 'روان', 'روزان', 'روزانا', 'روزين', 'رولى', 'روند', 'رويدة', 'ريان', 'ريتا', 'ريم', 'ريما', 'ريمان', 'ريناتا', 'ريناد', 'ريهام', 'زكية', 'زمان', 'زها', 'زهرة', 'زين', 'زينا', 'زينات', 'زينب', 'زينة', 'ساجدة', 'سارة', 'سجى', 'سحر', 'سدين', 'سرى', 'سرين', 'سعاد', 'سكينة', 'سلام', 'سلسبيل', 'سلمى', 'سلوى', 'سما', 'سماح', 'سماره', 'سمر', 'سمية', 'سميرة', 'سناء', 'سنابل', 'سندس', 'سنريت', 'سنن', 'سهاد', 'سهام', 'سهر', 'سهى', 'سهير', 'سهيله', 'سوار', 'سوزان', 'سوسن', 'سيرين', 'سيرينا', 'سيلفا', 'سيلين', 'سيما', 'شذى', 'شروق', 'شريفة', 'شرين', 'شريهان', 'شفاء', 'شهد', 'شيرين', 'شيماء', 'صابرين', 'صبا', 'صباح', 'صبرين', 'صفا', 'صفاء', 'صفية', 'صمود', 'ضحى', 'ضياء', 'عائشة', 'عاليا', 'عالية', 'عبلة', 'عبير', 'عزة', 'عزيزة', 'عفاف', 'علا', 'علياء', 'عنود', 'عهد', 'غادة', 'غدير', 'غرام', 'غزل', 'غصون', 'غفران', 'غنى', 'غيد', 'غيداء', 'غيده', 'فاتن', 'فادية', 'فاديه', 'فاطمة', 'فايزة', 'فتحية', 'فداء', 'فدوى', 'فدى', 'فرح', 'فريال', 'فريدة', 'فوزية', 'فيروز', 'فيفيان', 'قمر', 'كيان', 'لارا', 'لانا', 'لبنا', 'لجين', 'لطيفة', 'لمى', 'لميس', 'لنا', 'لورا', 'لورينا', 'لونا', 'ليان', 'ليدا', 'ليلى', 'ليليان', 'لين', 'لينا', 'لينة', 'ليندا', 'لينه', 'مايا', 'مجد', 'مجدولين', 'محبوبة', 'مديحة', 'مرام', 'مرح', 'مروة', 'مريام', 'مريم', 'مسعدة', 'مشيرة', 'معالي', 'ملاك', 'ملك', 'منار', 'منال', 'منى', 'مها', 'مي', 'ميادة', 'مياده', 'ميار', 'ميان', 'ميرا', 'ميرال', 'ميران', 'ميرفت', 'ميس', 'ميسا', 'ميساء', 'ميسر', 'ميسره', 'ميسم', 'ميسون', 'ميلاء', 'ميناس', 'نائله', 'ناديا', 'نادية', 'نادين', 'ناديه', 'نانسي', 'نبال', 'نبراس', 'نبيله', 'نجاة', 'نجاح', 'نجلاء', 'نجود', 'نجوى', 'نداء', 'ندى', 'ندين', 'نرمين', 'نسرين', 'نسيمة', 'نعمت', 'نعمه', 'نهاد', 'نهى', 'نهيدة', 'نوال', 'نور', 'نور الهدى', 'نورا', 'نوران', 'نيروز', 'نيفين', 'هادلين', 'هازار', 'هالة', 'هانيا', 'هايدي', 'هبة', 'هدايه', 'هدى', 'هديل', 'هزار', 'هلا', 'هنا', 'هناء', 'هنادي', 'هند', 'هيا', 'هيفا', 'هيفاء', 'هيلين', 'وئام', 'وجدان', 'وداد', 'ورود', 'وسام', 'وسن', 'وسيم', 'وعد', 'وفاء', 'ولاء', 'ىمنة', 'يارا', 'ياسمين', 'يسرى', ); protected static $lastName = array( 'العتيبي', 'الشهري', 'العنزي', 'الخضيري', 'الحسين', 'العسكر', 'باشا', 'مدني', 'العرفج', 'القحطاني', 'الفدا', 'المشيقح', 'العمرو', 'السالم', 'الشيباني', 'السهلي', 'المطرفي', 'الأحمري', 'الفيفي', 'العقل', 'الفرحان', 'الحصين', 'الأسمري', 'الماجد', 'الخالدي', 'السيف', 'الحنتوشي', 'الشهيل', 'الزامل', 'الصامل', 'السماعيل', 'الجريد', 'الحميد', 'المقبل', 'الراجحي', 'المنيف', 'السويلم', 'السمير', 'الصقير', 'الصقيه', 'سقا', 'مكي', 'جواهرجي', 'الجهني', 'الفريدي', 'برماوي', 'هوساوي', 'السعيد', 'الداوود', 'السليم', 'السماري', ); protected static $titleMale = array('السيد', 'الأستاذ', 'الدكتور', 'المهندس'); protected static $titleFemale = array('السيدة', 'الآنسة', 'الدكتورة', 'المهندسة'); private static $prefix = array('أ.', 'د.', 'أ.د', 'م.'); /** * @example 'أ.' */ public static function prefix() { return static::randomElement(static::$prefix); } /** * @example 1010101010 */ public static function idNumber() { $partialValue = static::numerify( static::randomElement(array(1, 2)) . str_repeat('#', 8) ); return Luhn::generateLuhnNumber($partialValue); } /** * @example 1010101010 */ public static function nationalIdNumber() { $partialValue = static::numerify(1 . str_repeat('#', 8)); return Luhn::generateLuhnNumber($partialValue); } /** * @example 2010101010 */ public static function foreignerIdNumber() { $partialValue = static::numerify(2 . str_repeat('#', 8)); return Luhn::generateLuhnNumber($partialValue); } }
{ "pile_set_name": "Github" }
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const { compareChunksNatural } = require("../util/comparators"); const { getShortChunkName, getLongChunkName, assignNames, getUsedChunkIds, assignAscendingChunkIds } = require("./IdHelpers"); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ class NamedChunkIdsPlugin { constructor(options) { this.delimiter = (options && options.delimiter) || "-"; this.context = options && options.context; } /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.compilation.tap("NamedChunkIdsPlugin", compilation => { compilation.hooks.chunkIds.tap("NamedChunkIdsPlugin", chunks => { const chunkGraph = compilation.chunkGraph; const context = this.context ? this.context : compiler.context; const delimiter = this.delimiter; const unnamedChunks = assignNames( Array.from(chunks).filter(chunk => { if (chunk.name) { chunk.id = chunk.name; chunk.ids = [chunk.name]; } return chunk.id === null; }), chunk => getShortChunkName( chunk, chunkGraph, context, delimiter, compiler.root ), chunk => getLongChunkName( chunk, chunkGraph, context, delimiter, compiler.root ), compareChunksNatural(chunkGraph), getUsedChunkIds(compilation), (chunk, name) => { chunk.id = name; chunk.ids = [name]; } ); if (unnamedChunks.length > 0) { assignAscendingChunkIds(unnamedChunks, compilation); } }); }); } } module.exports = NamedChunkIdsPlugin;
{ "pile_set_name": "Github" }
/* * Copyright (c) 2008-2015 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)in.h 8.3 (Berkeley) 1/3/94 */ #ifndef __KAME_NETINET_IN_H_INCLUDED_ #error "do not include netinet6/in6.h directly, include netinet/in.h. " \ " see RFC2553" #endif #ifndef _NETINET6_IN6_H_ #define _NETINET6_IN6_H_ #include <sys/appleapiopts.h> #include <sys/_types.h> #include <sys/_types/_sa_family_t.h> /* * Identification of the network protocol stack * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE * has the table of implementation/integration differences. */ #define __KAME__ #define __KAME_VERSION "2009/apple-darwin" #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) /* * Local port number conventions: * * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root), * unless a kernel is compiled with IPNOPRIVPORTS defined. * * When a user does a bind(2) or connect(2) with a port number of zero, * a non-conflicting local port address is chosen. * * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although * that is settable by sysctl(3); net.inet.ip.anonportmin and * net.inet.ip.anonportmax respectively. * * A user may set the IPPROTO_IP option IP_PORTRANGE to change this * default assignment range. * * The value IP_PORTRANGE_DEFAULT causes the default behavior. * * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT, * and exists only for FreeBSD compatibility purposes. * * The value IP_PORTRANGE_LOW changes the range to the "low" are * that is (by convention) restricted to privileged processes. * This convention is based on "vouchsafe" principles only. * It is only secure if you trust the remote host to restrict these ports. * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX. */ #define IPV6PORT_RESERVED 1024 #define IPV6PORT_ANONMIN 49152 #define IPV6PORT_ANONMAX 65535 #define IPV6PORT_RESERVEDMIN 600 #define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1) #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ /* * IPv6 address */ struct in6_addr { union { __uint8_t __u6_addr8[16]; __uint16_t __u6_addr16[8]; __uint32_t __u6_addr32[4]; } __u6_addr; /* 128-bit IP6 address */ }; #define s6_addr __u6_addr.__u6_addr8 #define INET6_ADDRSTRLEN 46 /* * Socket address for IPv6 */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define SIN6_LEN #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ struct sockaddr_in6 { __uint8_t sin6_len; /* length of this struct(sa_family_t) */ sa_family_t sin6_family; /* AF_INET6 (sa_family_t) */ in_port_t sin6_port; /* Transport layer port # (in_port_t) */ __uint32_t sin6_flowinfo; /* IP6 flow information */ struct in6_addr sin6_addr; /* IP6 address */ __uint32_t sin6_scope_id; /* scope zone index */ }; /* * Definition of some useful macros to handle IP6 addresses */ #define IN6ADDR_ANY_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6ADDR_LOOPBACK_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IN6ADDR_NODELOCAL_ALLNODES_INIT \ {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_INTFACELOCAL_ALLNODES_INIT \ {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} #define IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16 }}} #define IN6ADDR_V4MAPPED_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ extern const struct in6_addr in6addr_any; extern const struct in6_addr in6addr_loopback; #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) extern const struct in6_addr in6addr_nodelocal_allnodes; extern const struct in6_addr in6addr_linklocal_allnodes; extern const struct in6_addr in6addr_linklocal_allrouters; extern const struct in6_addr in6addr_linklocal_allv2routers; #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ /* * Equality * NOTE: Some of kernel programming environment (for example, openbsd/sparc) * does not supply memcmp(). For userland memcmp() is preferred as it is * in ANSI standard. */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IN6_ARE_ADDR_EQUAL(a, b) \ (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof (struct in6_addr)) \ == 0) #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ /* * Unspecified */ #define IN6_IS_ADDR_UNSPECIFIED(a) \ ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) /* * Loopback */ #define IN6_IS_ADDR_LOOPBACK(a) \ ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) /* * IPv4 compatible */ #define IN6_IS_ADDR_V4COMPAT(a) \ ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) /* * Mapped */ #define IN6_IS_ADDR_V4MAPPED(a) \ ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == \ ntohl(0x0000ffff))) /* * 6to4 */ #define IN6_IS_ADDR_6TO4(x) (ntohs((x)->s6_addr16[0]) == 0x2002) /* * KAME Scope Values */ #define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 #define __IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 #define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 #define __IPV6_ADDR_SCOPE_SITELOCAL 0x05 #define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ #define __IPV6_ADDR_SCOPE_GLOBAL 0x0e /* * Unicast Scope * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). */ #define IN6_IS_ADDR_LINKLOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) #define IN6_IS_ADDR_SITELOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) /* * Multicast */ #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) /* * Unique Local IPv6 Unicast Addresses (per RFC 4193) */ #define IN6_IS_ADDR_UNIQUE_LOCAL(a) \ (((a)->s6_addr[0] == 0xfc) || ((a)->s6_addr[0] == 0xfd)) #define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) /* * Multicast Scope */ #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) /* * Options for use with [gs]etsockopt at the IPV6 level. * First word of comment is data type; bool is stored in int. */ /* no hdrincl */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) /* * RFC 3542 define the following socket options in a manner incompatible * with RFC 2292: * IPV6_PKTINFO * IPV6_HOPLIMIT * IPV6_NEXTHOP * IPV6_HOPOPTS * IPV6_DSTOPTS * IPV6_RTHDR * * To use the new IPv6 Sockets options introduced by RFC 3542 * the constant __APPLE_USE_RFC_3542 must be defined before * including <netinet/in.h> * * To use the old IPv6 Sockets options from RFC 2292 * the constant __APPLE_USE_RFC_2292 must be defined before * including <netinet/in.h> * * Note that eventually RFC 3542 is going to be the * default and RFC 2292 will be obsolete. */ #if defined(__APPLE_USE_RFC_3542) && defined(__APPLE_USE_RFC_2292) #error "__APPLE_USE_RFC_3542 and __APPLE_USE_RFC_2292 cannot be both defined" #endif #if 0 /* the followings are relic in IPv4 and hence are disabled */ #define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ #define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */ #define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */ #define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */ #define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */ #endif /* 0 */ #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ #define IPV6_MULTICAST_IF 9 /* __uint8_t; set/get IP6 multicast i/f */ #define IPV6_MULTICAST_HOPS 10 /* __uint8_t; set/get IP6 multicast hops */ #define IPV6_MULTICAST_LOOP 11 /* __uint8_t; set/get IP6 mcast loopback */ #define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */ #define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ #define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ #define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ #define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ #define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ #define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ #define IPV6_2292RTHDR 24 /* ip6_rthdr: routing header */ /* buf/cmsghdr; set/get IPv6 options [obsoleted by RFC3542] */ #define IPV6_2292PKTOPTIONS 25 #ifdef __APPLE_USE_RFC_2292 #define IPV6_PKTINFO IPV6_2292PKTINFO #define IPV6_HOPLIMIT IPV6_2292HOPLIMIT #define IPV6_NEXTHOP IPV6_2292NEXTHOP #define IPV6_HOPOPTS IPV6_2292HOPOPTS #define IPV6_DSTOPTS IPV6_2292DSTOPTS #define IPV6_RTHDR IPV6_2292RTHDR #define IPV6_PKTOPTIONS IPV6_2292PKTOPTIONS #endif /* __APPLE_USE_RFC_2292 */ #define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ #define IPV6_V6ONLY 27 /* bool; only bind INET6 at wildcard bind */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define IPV6_BINDV6ONLY IPV6_V6ONLY #if 1 /* IPSEC */ #define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ #endif /* 1 */ #define IPV6_FAITH 29 /* deprecated */ #if 1 /* IPV6FIREWALL */ #define IPV6_FW_ADD 30 /* add a firewall rule to chain */ #define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ #define IPV6_FW_FLUSH 32 /* flush firewall rule chain */ #define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */ #define IPV6_FW_GET 34 /* get entire firewall rule chain */ #endif /* 1 */ /* * APPLE: NOTE the value of those 2 options is kept unchanged from * previous version of darwin/OS X for binary compatibility reasons * and differ from FreeBSD (values 57 and 61). See below. */ #define IPV6_RECVTCLASS 35 /* bool; recv traffic class values */ #define IPV6_TCLASS 36 /* int; send traffic class value */ #ifdef __APPLE_USE_RFC_3542 /* new socket options introduced in RFC3542 */ /* * ip6_dest; send dst option before rthdr * APPLE: Value purposely different than FreeBSD (35) to avoid * collision with definition of IPV6_RECVTCLASS in previous * darwin implementations */ #define IPV6_RTHDRDSTOPTS 57 /* * bool; recv if, dst addr * APPLE: Value purposely different than FreeBSD(36) to avoid * collision with definition of IPV6_TCLASS in previous * darwin implementations */ #define IPV6_RECVPKTINFO 61 #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ #define IPV6_RECVRTHDR 38 /* bool; recv routing header */ #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ #define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */ #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ /* * mtuinfo; get the current path MTU (sopt), 4 bytes int; * MTU notification (cmsg) */ #define IPV6_PATHMTU 44 #if 0 /* obsoleted during 2292bis -> 3542 */ /* no data; ND reachability confirm (cmsg only/not in of RFC3542) */ #define IPV6_REACHCONF 45 #endif /* more new socket options introduced in RFC3542 */ #define IPV6_3542PKTINFO 46 /* in6_pktinfo; send if, src addr */ #define IPV6_3542HOPLIMIT 47 /* int; send hop limit */ #define IPV6_3542NEXTHOP 48 /* sockaddr; next hop addr */ #define IPV6_3542HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ #define IPV6_3542DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ #define IPV6_3542RTHDR 51 /* ip6_rthdr; send routing header */ #define IPV6_PKTINFO IPV6_3542PKTINFO #define IPV6_HOPLIMIT IPV6_3542HOPLIMIT #define IPV6_NEXTHOP IPV6_3542NEXTHOP #define IPV6_HOPOPTS IPV6_3542HOPOPTS #define IPV6_DSTOPTS IPV6_3542DSTOPTS #define IPV6_RTHDR IPV6_3542RTHDR #define IPV6_AUTOFLOWLABEL 59 /* bool; attach flowlabel automagically */ #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ /* int; prefer temporary addresses as the source address. */ #define IPV6_PREFER_TEMPADDR 63 /* * The following option is private; do not use it from user applications. * It is deliberately defined to the same value as IP_MSFILTER. */ #define IPV6_MSFILTER 74 /* struct __msfilterreq; */ #endif /* __APPLE_USE_RFC_3542 */ #define IPV6_BOUND_IF 125 /* int; set/get bound interface */ /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. */ #define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ /* * Defaults and limits for options */ #define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ #define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ /* * The im6o_membership vector for each socket is now dynamically allocated at * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized * according to a power-of-two increment. */ #define IPV6_MIN_MEMBERSHIPS 31 #define IPV6_MAX_MEMBERSHIPS 4095 /* * Default resource limits for IPv6 multicast source filtering. * These may be modified by sysctl. */ #define IPV6_MAX_GROUP_SRC_FILTER 512 /* sources per group */ #define IPV6_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */ /* * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. */ struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; unsigned int ipv6mr_interface; }; /* * IPV6_2292PKTINFO: Packet information(RFC2292 sec 5) */ struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ }; /* * Control structure for IPV6_RECVPATHMTU socket option. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ uint32_t ip6m_mtu; }; /* * Argument for IPV6_PORTRANGE: * - which range to search when port is unspecified at bind() or connect() */ #define IPV6_PORTRANGE_DEFAULT 0 /* default range */ #define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ #define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ /* * Definitions for inet6 sysctl operations. * * Third level is protocol number. * Fourth level is desired variable within that protocol. */ #define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */ /* * Names for IP sysctl objects */ #define IPV6CTL_FORWARDING 1 /* act as router */ #define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ #define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */ #ifdef notyet #define IPV6CTL_DEFMTU 4 /* default MTU */ #endif #define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */ #define IPV6CTL_STATS 6 /* stats */ #define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */ #define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */ #define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */ #define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ #define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ #define IPV6CTL_ACCEPT_RTADV 12 #define IPV6CTL_KEEPFAITH 13 /* deprecated */ #define IPV6CTL_LOG_INTERVAL 14 #define IPV6CTL_HDRNESTLIMIT 15 #define IPV6CTL_DAD_COUNT 16 #define IPV6CTL_AUTO_FLOWLABEL 17 #define IPV6CTL_DEFMCASTHLIM 18 #define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ #define IPV6CTL_KAME_VERSION 20 #define IPV6CTL_USE_DEPRECATED 21 /* use deprec addr (RFC2462 5.5.4) */ #define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ #if 0 /* obsolete */ #define IPV6CTL_MAPPED_ADDR 23 #endif #define IPV6CTL_V6ONLY 24 #define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */ #define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */ #define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */ #define IPV6CTL_USETEMPADDR 32 /* use temporary addresses [RFC 4941] */ #define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */ #define IPV6CTL_TEMPVLTIME 34 /* valid lifetime for tmpaddrs */ #define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */ #define IPV6CTL_RIP6STATS 36 /* raw_ip6 stats */ #define IPV6CTL_PREFER_TEMPADDR 37 /* prefer temporary addr as src */ #define IPV6CTL_ADDRCTLPOLICY 38 /* get/set address selection policy */ #define IPV6CTL_USE_DEFAULTZONE 39 /* use default scope zone */ #define IPV6CTL_MAXFRAGS 41 /* max fragments */ #define IPV6CTL_MCAST_PMTU 44 /* enable pMTU discovery for mcast? */ #define IPV6CTL_NEIGHBORGCTHRESH 46 #define IPV6CTL_MAXIFPREFIXES 47 #define IPV6CTL_MAXIFDEFROUTERS 48 #define IPV6CTL_MAXDYNROUTES 49 #define ICMPV6CTL_ND6_ONLINKNSRFC4861 50 /* New entries should be added here from current IPV6CTL_MAXID value. */ /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6CTL_MAXID 51 __BEGIN_DECLS struct cmsghdr; extern int inet6_option_space(int); extern int inet6_option_init(void *, struct cmsghdr **, int); extern int inet6_option_append(struct cmsghdr *, const __uint8_t *, int, int); extern __uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); extern int inet6_option_next(const struct cmsghdr *, __uint8_t **); extern int inet6_option_find(const struct cmsghdr *, __uint8_t **, int); extern size_t inet6_rthdr_space(int, int); extern struct cmsghdr *inet6_rthdr_init(void *, int); extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, unsigned int); extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); #if 0 /* not implemented yet */ extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); #endif extern int inet6_rthdr_segments(const struct cmsghdr *); extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); extern int inet6_rthdr_getflags(const struct cmsghdr *, int); extern int inet6_opt_init(void *, socklen_t); extern int inet6_opt_append(void *, socklen_t, int, __uint8_t, socklen_t, __uint8_t, void **); extern int inet6_opt_finish(void *, socklen_t, int); extern int inet6_opt_set_val(void *, int, void *, socklen_t); extern int inet6_opt_next(void *, socklen_t, int, __uint8_t *, socklen_t *, void **); extern int inet6_opt_find(void *, socklen_t, int, __uint8_t, socklen_t *, void **); extern int inet6_opt_get_val(void *, int, void *, socklen_t); extern socklen_t inet6_rth_space(int, int); extern void *inet6_rth_init(void *, socklen_t, int, int); extern int inet6_rth_add(void *, const struct in6_addr *); extern int inet6_rth_reverse(const void *, void *); extern int inet6_rth_segments(const void *); extern struct in6_addr *inet6_rth_getaddr(const void *, int); extern void addrsel_policy_init(void); __END_DECLS #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ #endif /* !_NETINET6_IN6_H_ */
{ "pile_set_name": "Github" }
package glfw /* #define GLFW_EXPOSE_NATIVE_COCOA #define GLFW_EXPOSE_NATIVE_NSGL #include "glfw/include/GLFW/glfw3.h" #include "glfw/include/GLFW/glfw3native.h" // workaround wrappers needed due to a cgo and/or LLVM bug. // See: https://github.com/go-gl/glfw/issues/136 void *workaround_glfwGetCocoaWindow(GLFWwindow *w) { return (void *)glfwGetCocoaWindow(w); } void *workaround_glfwGetNSGLContext(GLFWwindow *w) { return (void *)glfwGetNSGLContext(w); } */ import "C" import "unsafe" // GetCocoaMonitor returns the CGDirectDisplayID of the monitor. func (m *Monitor) GetCocoaMonitor() uintptr { ret := uintptr(C.glfwGetCocoaMonitor(m.data)) panicError() return ret } // GetCocoaWindow returns the NSWindow of the window. func (w *Window) GetCocoaWindow() unsafe.Pointer { ret := C.workaround_glfwGetCocoaWindow(w.data) panicError() return ret } // GetNSGLContext returns the NSOpenGLContext of the window. func (w *Window) GetNSGLContext() unsafe.Pointer { ret := C.workaround_glfwGetNSGLContext(w.data) panicError() return ret }
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2010-2012 * Texas Instruments, <www.ti.com> * * Aneesh V <[email protected]> * Tom Rini <[email protected]> */ #include <common.h> #include <config.h> #include <spl.h> #include <image.h> #include <linux/compiler.h> #include <asm/mach-types.h> #ifndef CONFIG_SPL_DM /* Pointer to as well as the global data structure for SPL */ DECLARE_GLOBAL_DATA_PTR; /* * WARNING: This is going away very soon. Don't use it and don't submit * pafches that rely on it. The global_data area is set up in crt0.S. */ gd_t gdata __attribute__ ((section(".data"))); #endif /* * In the context of SPL, board_init_f() prepares the hardware for execution * from system RAM (DRAM, DDR...). As system RAM may not be available yet, * board_init_f() must use the current GD to store any data which must be * passed on to later stages. These data include the relocation destination, * the future stack, and the future GD location. BSS is cleared after this * function (and therefore must be accessible). * * We provide this version by default but mark it as __weak to allow for * platforms to do this in their own way if needed. Please see the top * level U-Boot README "Board Initialization Flow" section for info on what * to put in this function. */ void __weak board_init_f(ulong dummy) { } /* * This function jumps to an image with argument. Normally an FDT or ATAGS * image. */ #ifdef CONFIG_SPL_OS_BOOT #ifdef CONFIG_ARM64 void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) { debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg); cleanup_before_linux(); armv8_switch_to_el2((u64)spl_image->arg, 0, 0, 0, spl_image->entry_point, ES_TO_AARCH64); } #else void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) { unsigned long machid = 0xffffffff; #ifdef CONFIG_MACH_TYPE machid = CONFIG_MACH_TYPE; #endif debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg); typedef void (*image_entry_arg_t)(int, int, void *) __attribute__ ((noreturn)); image_entry_arg_t image_entry = (image_entry_arg_t)(uintptr_t) spl_image->entry_point; cleanup_before_linux(); image_entry(0, machid, spl_image->arg); } #endif /* CONFIG_ARM64 */ #endif
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "mac", "size" : "16x16", "scale" : "1x" }, { "idiom" : "mac", "size" : "16x16", "scale" : "2x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "1x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "2x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "1x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "2x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "1x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "2x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "1x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
--- http_interactions: - request: method: get uri: http://ps.pndsn.com/v2/auth/grant/sub-key/sub-a-mock-key?channel=demo&m=1&pnsdk=PubNub-Ruby/4.1.0&r=1&signature=LEom7N1yzQwVKxxIBL4EwSYmPvndqXC6FEllYrt8z9k=&timestamp=1464187919&ttl=1440&uuid=ruby-test-uuid-client-one&w=1 body: encoding: UTF-8 string: '' headers: User-Agent: - HTTPClient/1.0 (2.8.0, ruby 2.3.0 (2015-12-25)) Accept: - "*/*" Date: - Wed, 25 May 2016 14:51:59 GMT response: status: code: 200 message: OK headers: Date: - Wed, 25 May 2016 14:52:00 GMT Content-Type: - text/javascript; charset=UTF-8 Content-Length: - '203' Connection: - keep-alive Access-Control-Allow-Origin: - "*" Access-Control-Allow-Methods: - GET Access-Control-Allow-Headers: - Origin, X-Requested-With, Content-Type, Accept Cache-Control: - no-cache, no-store, must-revalidate body: encoding: UTF-8 string: '{"message":"Success","payload":{"level":"channel","subscribe_key":"sub-a-mock-key","ttl":1440,"channels":{"demo":{"r":1,"w":1,"m":1}}},"service":"Access Manager","status":200}' http_version: recorded_at: Wed, 25 May 2016 14:52:00 GMT recorded_with: VCR 3.0.1
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <title>SelectRole (GWT Javadoc)</title> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="SelectRole (GWT Javadoc)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/SelectRole.html">Use</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">GWT 2.9.0</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../com/google/gwt/aria/client/SelectedValue.html" title="enum in com.google.gwt.aria.client"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../com/google/gwt/aria/client/SeparatorRole.html" title="interface in com.google.gwt.aria.client"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/google/gwt/aria/client/SelectRole.html" target="_top">Frames</a></li> <li><a href="SelectRole.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">com.google.gwt.aria.client</div> <h2 title="Interface SelectRole" class="title">Interface SelectRole</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Superinterfaces:</dt> <dd><a href="../../../../../com/google/gwt/aria/client/CompositeRole.html" title="interface in com.google.gwt.aria.client">CompositeRole</a>, <a href="../../../../../com/google/gwt/aria/client/GroupRole.html" title="interface in com.google.gwt.aria.client">GroupRole</a>, <a href="../../../../../com/google/gwt/aria/client/InputRole.html" title="interface in com.google.gwt.aria.client">InputRole</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html" title="interface in com.google.gwt.aria.client">Role</a>, <a href="../../../../../com/google/gwt/aria/client/SectionRole.html" title="interface in com.google.gwt.aria.client">SectionRole</a>, <a href="../../../../../com/google/gwt/aria/client/StructureRole.html" title="interface in com.google.gwt.aria.client">StructureRole</a>, <a href="../../../../../com/google/gwt/aria/client/WidgetRole.html" title="interface in com.google.gwt.aria.client">WidgetRole</a></dd> </dl> <dl> <dt>All Known Subinterfaces:</dt> <dd><a href="../../../../../com/google/gwt/aria/client/ComboboxRole.html" title="interface in com.google.gwt.aria.client">ComboboxRole</a>, <a href="../../../../../com/google/gwt/aria/client/ListboxRole.html" title="interface in com.google.gwt.aria.client">ListboxRole</a>, <a href="../../../../../com/google/gwt/aria/client/MenubarRole.html" title="interface in com.google.gwt.aria.client">MenubarRole</a>, <a href="../../../../../com/google/gwt/aria/client/MenuRole.html" title="interface in com.google.gwt.aria.client">MenuRole</a>, <a href="../../../../../com/google/gwt/aria/client/RadiogroupRole.html" title="interface in com.google.gwt.aria.client">RadiogroupRole</a>, <a href="../../../../../com/google/gwt/aria/client/TreegridRole.html" title="interface in com.google.gwt.aria.client">TreegridRole</a>, <a href="../../../../../com/google/gwt/aria/client/TreeRole.html" title="interface in com.google.gwt.aria.client">TreeRole</a></dd> </dl> <dl> <dt>All Known Implementing Classes:</dt> <dd><a href="../../../../../com/google/gwt/aria/client/ComboboxRoleImpl.html" title="class in com.google.gwt.aria.client">ComboboxRoleImpl</a>, <a href="../../../../../com/google/gwt/aria/client/ListboxRoleImpl.html" title="class in com.google.gwt.aria.client">ListboxRoleImpl</a>, <a href="../../../../../com/google/gwt/aria/client/MenubarRoleImpl.html" title="class in com.google.gwt.aria.client">MenubarRoleImpl</a>, <a href="../../../../../com/google/gwt/aria/client/MenuRoleImpl.html" title="class in com.google.gwt.aria.client">MenuRoleImpl</a>, <a href="../../../../../com/google/gwt/aria/client/RadiogroupRoleImpl.html" title="class in com.google.gwt.aria.client">RadiogroupRoleImpl</a>, <a href="../../../../../com/google/gwt/aria/client/TreegridRoleImpl.html" title="class in com.google.gwt.aria.client">TreegridRoleImpl</a>, <a href="../../../../../com/google/gwt/aria/client/TreeRoleImpl.html" title="class in com.google.gwt.aria.client">TreeRoleImpl</a></dd> </dl> <hr> <br> <pre>public interface <span class="typeNameLabel">SelectRole</span> extends <a href="../../../../../com/google/gwt/aria/client/CompositeRole.html" title="interface in com.google.gwt.aria.client">CompositeRole</a>, <a href="../../../../../com/google/gwt/aria/client/GroupRole.html" title="interface in com.google.gwt.aria.client">GroupRole</a>, <a href="../../../../../com/google/gwt/aria/client/InputRole.html" title="interface in com.google.gwt.aria.client">InputRole</a></pre> <div class="block">A type that represents the <a href="http://www.w3.org/TR/wai-aria/roles#select">select</a> role in the ARIA specification.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../com/google/gwt/aria/client/Role.html" title="interface in com.google.gwt.aria.client"><code>Role</code></a>, <a href="../../../../../com/google/gwt/aria/client/Roles.html" title="class in com.google.gwt.aria.client"><code>Roles</code></a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.com.google.gwt.aria.client.CompositeRole"> <!-- --> </a> <h3>Methods inherited from interface&nbsp;com.google.gwt.aria.client.<a href="../../../../../com/google/gwt/aria/client/CompositeRole.html" title="interface in com.google.gwt.aria.client">CompositeRole</a></h3> <code><a href="../../../../../com/google/gwt/aria/client/CompositeRole.html#getAriaActivedescendantProperty-com.google.gwt.dom.client.Element-">getAriaActivedescendantProperty</a>, <a href="../../../../../com/google/gwt/aria/client/CompositeRole.html#removeAriaActivedescendantProperty-com.google.gwt.dom.client.Element-">removeAriaActivedescendantProperty</a>, <a href="../../../../../com/google/gwt/aria/client/CompositeRole.html#setAriaActivedescendantProperty-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.Id-">setAriaActivedescendantProperty</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.com.google.gwt.aria.client.GroupRole"> <!-- --> </a> <h3>Methods inherited from interface&nbsp;com.google.gwt.aria.client.<a href="../../../../../com/google/gwt/aria/client/GroupRole.html" title="interface in com.google.gwt.aria.client">GroupRole</a></h3> <code><a href="../../../../../com/google/gwt/aria/client/GroupRole.html#getAriaActivedescendantProperty-com.google.gwt.dom.client.Element-">getAriaActivedescendantProperty</a>, <a href="../../../../../com/google/gwt/aria/client/GroupRole.html#removeAriaActivedescendantProperty-com.google.gwt.dom.client.Element-">removeAriaActivedescendantProperty</a>, <a href="../../../../../com/google/gwt/aria/client/GroupRole.html#setAriaActivedescendantProperty-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.Id-">setAriaActivedescendantProperty</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.com.google.gwt.aria.client.SectionRole"> <!-- --> </a> <h3>Methods inherited from interface&nbsp;com.google.gwt.aria.client.<a href="../../../../../com/google/gwt/aria/client/SectionRole.html" title="interface in com.google.gwt.aria.client">SectionRole</a></h3> <code><a href="../../../../../com/google/gwt/aria/client/SectionRole.html#getAriaExpandedState-com.google.gwt.dom.client.Element-">getAriaExpandedState</a>, <a href="../../../../../com/google/gwt/aria/client/SectionRole.html#removeAriaExpandedState-com.google.gwt.dom.client.Element-">removeAriaExpandedState</a>, <a href="../../../../../com/google/gwt/aria/client/SectionRole.html#setAriaExpandedState-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.ExpandedValue-">setAriaExpandedState</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.com.google.gwt.aria.client.Role"> <!-- --> </a> <h3>Methods inherited from interface&nbsp;com.google.gwt.aria.client.<a href="../../../../../com/google/gwt/aria/client/Role.html" title="interface in com.google.gwt.aria.client">Role</a></h3> <code><a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaAtomicProperty-com.google.gwt.dom.client.Element-">getAriaAtomicProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaBusyState-com.google.gwt.dom.client.Element-">getAriaBusyState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaControlsProperty-com.google.gwt.dom.client.Element-">getAriaControlsProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaDescribedbyProperty-com.google.gwt.dom.client.Element-">getAriaDescribedbyProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaDisabledState-com.google.gwt.dom.client.Element-">getAriaDisabledState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaDropeffectProperty-com.google.gwt.dom.client.Element-">getAriaDropeffectProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaFlowtoProperty-com.google.gwt.dom.client.Element-">getAriaFlowtoProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaGrabbedState-com.google.gwt.dom.client.Element-">getAriaGrabbedState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaHaspopupProperty-com.google.gwt.dom.client.Element-">getAriaHaspopupProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaHiddenState-com.google.gwt.dom.client.Element-">getAriaHiddenState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaInvalidState-com.google.gwt.dom.client.Element-">getAriaInvalidState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaLabelledbyProperty-com.google.gwt.dom.client.Element-">getAriaLabelledbyProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaLabelProperty-com.google.gwt.dom.client.Element-">getAriaLabelProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaLiveProperty-com.google.gwt.dom.client.Element-">getAriaLiveProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaOwnsProperty-com.google.gwt.dom.client.Element-">getAriaOwnsProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getAriaRelevantProperty-com.google.gwt.dom.client.Element-">getAriaRelevantProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getName--">getName</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#getTabindexExtraAttribute-com.google.gwt.dom.client.Element-">getTabindexExtraAttribute</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#remove-com.google.gwt.dom.client.Element-">remove</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaAtomicProperty-com.google.gwt.dom.client.Element-">removeAriaAtomicProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaBusyState-com.google.gwt.dom.client.Element-">removeAriaBusyState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaControlsProperty-com.google.gwt.dom.client.Element-">removeAriaControlsProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaDescribedbyProperty-com.google.gwt.dom.client.Element-">removeAriaDescribedbyProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaDisabledState-com.google.gwt.dom.client.Element-">removeAriaDisabledState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaDropeffectProperty-com.google.gwt.dom.client.Element-">removeAriaDropeffectProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaFlowtoProperty-com.google.gwt.dom.client.Element-">removeAriaFlowtoProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaGrabbedState-com.google.gwt.dom.client.Element-">removeAriaGrabbedState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaHaspopupProperty-com.google.gwt.dom.client.Element-">removeAriaHaspopupProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaHiddenState-com.google.gwt.dom.client.Element-">removeAriaHiddenState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaInvalidState-com.google.gwt.dom.client.Element-">removeAriaInvalidState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaLabelledbyProperty-com.google.gwt.dom.client.Element-">removeAriaLabelledbyProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaLabelProperty-com.google.gwt.dom.client.Element-">removeAriaLabelProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaLiveProperty-com.google.gwt.dom.client.Element-">removeAriaLiveProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaOwnsProperty-com.google.gwt.dom.client.Element-">removeAriaOwnsProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeAriaRelevantProperty-com.google.gwt.dom.client.Element-">removeAriaRelevantProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#removeTabindexExtraAttribute-com.google.gwt.dom.client.Element-">removeTabindexExtraAttribute</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#set-com.google.gwt.dom.client.Element-">set</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaAtomicProperty-com.google.gwt.dom.client.Element-boolean-">setAriaAtomicProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaBusyState-com.google.gwt.dom.client.Element-boolean-">setAriaBusyState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaControlsProperty-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.Id...-">setAriaControlsProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaDescribedbyProperty-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.Id...-">setAriaDescribedbyProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaDisabledState-com.google.gwt.dom.client.Element-boolean-">setAriaDisabledState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaDropeffectProperty-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.DropeffectValue...-">setAriaDropeffectProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaFlowtoProperty-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.Id...-">setAriaFlowtoProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaGrabbedState-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.GrabbedValue-">setAriaGrabbedState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaHaspopupProperty-com.google.gwt.dom.client.Element-boolean-">setAriaHaspopupProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaHiddenState-com.google.gwt.dom.client.Element-boolean-">setAriaHiddenState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaInvalidState-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.InvalidValue-">setAriaInvalidState</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaLabelledbyProperty-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.Id...-">setAriaLabelledbyProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaLabelProperty-com.google.gwt.dom.client.Element-java.lang.String-">setAriaLabelProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaLiveProperty-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.LiveValue-">setAriaLiveProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaOwnsProperty-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.Id...-">setAriaOwnsProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setAriaRelevantProperty-com.google.gwt.dom.client.Element-com.google.gwt.aria.client.RelevantValue...-">setAriaRelevantProperty</a>, <a href="../../../../../com/google/gwt/aria/client/Role.html#setTabindexExtraAttribute-com.google.gwt.dom.client.Element-int-">setTabindexExtraAttribute</a></code></li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/SelectRole.html">Use</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">GWT 2.9.0</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../com/google/gwt/aria/client/SelectedValue.html" title="enum in com.google.gwt.aria.client"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../com/google/gwt/aria/client/SeparatorRole.html" title="interface in com.google.gwt.aria.client"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/google/gwt/aria/client/SelectRole.html" target="_top">Frames</a></li> <li><a href="SelectRole.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "pile_set_name": "Github" }
[projectoptions] mainfile=${PROJECTNAME}.lpr targetfile=${PROJECTNAME}${EXEEXT} messageoutputfile= makecommand=${COMPILER} makedir= unitdirs=10 ${ONGUARD}/ ${TIOPF}/GUI/fpGUI ${TIOPF}/Options ${TIOPF}/Core ${FPGUI}/src/reportengine ${FPGUI}/src/corelib/render/software ${FPGUI}/src ${FPGUI}/src/corelib/${FPG_GFX} ${FPGUI}/src/gui ${FPGUI}/src/corelib unitpref=-Fu incpref=-Fi libpref=-Fl objpref=-Fo targpref=-o befcommand=1 rm units/${TargetCPU}-${TargetOS}/* aftcommand=0 makeoptions=15 -l -Mobjfpc -Sh -Sc -Si -gl -O- -gh -B -O2 -XX -Xs -CX -FUunits/${Target}/ -FUunits -dUseCThreads -dAGGCanvas -viewn -dDEBUG -Sa -Cr -Ci -Co -b- -CR -Os -WG codetemplatedirs=1 ${TEMPLATEDIR} toolmenus=2 fpGUI &UI Designer &DocView toolfiles=2 ${FPGUI}/uidesigner/uidesigner${EXEEXT} ${FPGUI}/docview/docview${EXEEXT} toolparams=2 ${CURSOURCEFILE} ${HelpPath} -k ${cursword} fontnames=0 scriptbeforecopy= scriptaftercopy= newprojectfiles=5 ${TEMPLATEDIR}fpgui/project.pas ${TEMPLATEDIR}fpgui/frm_main.pas ${TEMPLATEDIR}fpgui/units/i386-linux/placeholder.txt ${TEMPLATEDIR}fpgui/units/i386-win32/placeholder.txt ${TEMPLATEDIR}fpgui/units/x86_64-linux/placeholder.txt newprojectfilesdest=5 ${%PROJECTNAME%}.pas ${%PROJECTDIR%}units/i386-linux/placeholder.txt ${%PROJECTDIR%}units/i386-win32/placeholder.txt ${%PROJECTDIR%}units/x86_64-linux/placeholder.txt newfinames=3 Program Unit Main Form newfifilters=3 "*.pas" "*.pp" "*.pas" "*.pp" newfiexts=3 pas pas pas newfisources=3 ${TEMPLATEDIR}default/program.pas ${TEMPLATEDIR}default/unit.pas ${TEMPLATEDIR}fpgui/mainform.pas newfonames=2 Main Form Simple Form newfonamebases=2 newfosources=2 ${TEMPLATEDIR}fpgui/mainform.pas ${TEMPLATEDIR}fpgui/simpleform.pas newfoforms=2 forcezorder=0 stripmessageesc=0 copymessages=0 closemessages=0 checkmethods=1 colorerror=-1610612712 colorwarning=-1610612717 colornote=-1610612716 usercolors=30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 usercolorcomment=30 formatmacronames=0 formatmacrovalues=0 settingsfile=${FPGUI}/extras/mseide_templates/fpgui_clean.prj settingseditor=1 settingsdebugger=1 settingsstorage=1 settingsprojecttree=0 settingsautoload=0 settingsautosave=0 modulenames=0 moduletypes=0 modulefiles=0 befcommandon=1 0 makeoptionson=15 63 7 7 63 24 0 63 63 32 63 0 4 0 63 24 aftcommandon=0 unitdirson=10 196671 65567 65567 196639 65599 196671 131103 196639 65567 65567 macroon=0 macronames=0 macrovalues=0 macrogroup=0 groupcomments=6 toolsave=2 -1 0 toolhide=2 0 0 toolparse=2 0 0 toolmessages=2 0 0 toolshortcuts=2 0 1 fontalias=0 fontancestors=0 fontheights=0 fontwidths=0 fontoptions=0 fontxscales=0 expandprojectfilemacros=5 1 1 -1 -1 -1 loadprojectfile=5 1 1 0 0 0 newinheritedforms=2 0 0 uid=0 sourcefilemasks=5 "*.pas" "*.dpr" "*.pp" "*.inc" "*.lpr" "*.c" "*.cc" "*.h" "*.mfm" "*.ipf" "*.sql" syntaxdeffiles=5 ${SYNTAXDEFDIR}pascal_solarized_dark.sdef ${SYNTAXDEFDIR}cpp.sdef ${SYNTAXDEFDIR}objecttext.sdef ${SYNTAXDEFDIR}ipf2.sdef ${SYNTAXDEFDIR}sql.sdef filemasknames=6 Source Forms Include Files Text IPF help All Files filemasks=6 "*.pp" "*.pas" "*.inc" "*.dpr" "*.lpr" "frm_*.pas" *.inc *.txt *.ipf * showgrid=1 snaptogrid=1 moveonfirstclick=1 noformdesignerdocking=0 gridsizex=8 gridsizey=8 autoindent=1 blockindent=2 linenumberson=1 rightmarginon=1 rightmarginchars=80 scrollheight=0 tabstops=2 spacetabs=1 showtabs=1 tabindent=0 editfontname=Raize editfontheight=16 editfontwidth=0 editfontextraspace=0 editfontcolor=-1879048183 editbkcolor=-1879048186 statementcolor=14745599 editfontantialiased=0 editmarkbrackets=1 backupfilecount=0 encoding=0 trimtrailingwhitespace=1 codetemplatedirs=1 ${TEMPLATEDIR} debugcommand=${DEBUGGER} debugoptions= debugtarget= runcommand= xtermcommand=xterm -S${PTSN}/${PTSH} remoteconnection= uploadcommand= gdbprocessor=Auto gdbservercommand= gdbservercommandattach= beforeconnect= afterconnect= beforeload= afterload= beforerun= sourcebase= sourcedirs=16 ${FPGUI}/src/corelib/render/software/ ${FPGUI}/src/reportengine/ ${FPGUI}/src/corelib/${FPG_GFX}/ ${FPGUI}/src/gui/ ${FPGUI}/src/corelib/ ${FPGUI}/src/ ${TIOPF}/GUI/fpGUI/ ${TIOPF}/Options/ ${TIOPF}/Core/ ${FPCDIR}src/packages/fcl-base/src/ ${FPCDIR}src/rtl/objpas/*/ ${FPCDIR}src/rtl/unix/ ${FPCDIR}src/rtl/linux/ ${FPCDIR}src/rtl/inc/ ../ ./ defines=0 progparameters= progworkingdirectory= envvarnames=0 envvarvalues=0 defineson=0 stoponexception=1 valuehints=1 activateonbreak=1 raiseonbreak=1 showconsole=1 externalconsole=0 settty=1 gdbdownload=0 downloadalways=0 startupbkpt=0 startupbkpton=0 gdbsimulator=0 gdbserverstartonce=0 gdbloadtimeout= gdbserverwait=0 nogdbserverexit=0 gdbservertty=0 exceptclassnames=2 EConvertError EAbort exceptignore=2 0 1 nodebugbeginend=0 fpcgdbworkaround=1 sigsettings=27 1,1,T,F 3,3,T,F 4,4,T,F 6,6,T,F 7,7,T,F 8,8,T,F 9,9,T,F 10,10,T,F 11,11,T,F 12,12,T,F 13,13,T,F 15,15,T,F 16,16,T,F 17,17,F,F 18,18,T,F 19,19,T,F 20,20,T,F 21,21,T,F 22,22,T,F 23,23,T,F 24,24,T,F 25,25,T,F 26,26,T,F 27,27,T,F 28,28,T,F 29,29,T,F 30,30,T,F defaultmake=1
{ "pile_set_name": "Github" }
<resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> </resources>
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <!-- Generated by javadoc (1.8.0_151) on Thu Jan 10 14:50:41 CET 2019 --> <title>TooManyFilterMissesException (documentation 1.0.0 API)</title> <meta name="date" content="2019-01-10"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="TooManyFilterMissesException (documentation 1.0.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../net/jqwik/api/TagList.html" title="annotation in net.jqwik.api"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../net/jqwik/api/Tuple.html" title="interface in net.jqwik.api"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?net/jqwik/api/TooManyFilterMissesException.html" target="_top">Frames</a></li> <li><a href="TooManyFilterMissesException.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#methods.inherited.from.class.java.lang.Throwable">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">net.jqwik.api</div> <h2 title="Class TooManyFilterMissesException" class="title">Class TooManyFilterMissesException</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>java.lang.Throwable</li> <li> <ul class="inheritance"> <li>java.lang.Exception</li> <li> <ul class="inheritance"> <li>java.lang.RuntimeException</li> <li> <ul class="inheritance"> <li><a href="../../../net/jqwik/api/JqwikException.html" title="class in net.jqwik.api">net.jqwik.api.JqwikException</a></li> <li> <ul class="inheritance"> <li>net.jqwik.api.TooManyFilterMissesException</li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Serializable</dd> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">TooManyFilterMissesException</span> extends <a href="../../../net/jqwik/api/JqwikException.html" title="class in net.jqwik.api">JqwikException</a></pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../serialized-form.html#net.jqwik.api.TooManyFilterMissesException">Serialized Form</a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../net/jqwik/api/TooManyFilterMissesException.html#TooManyFilterMissesException-java.lang.String-">TooManyFilterMissesException</a></span>(java.lang.String&nbsp;message)</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Throwable"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Throwable</h3> <code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="TooManyFilterMissesException-java.lang.String-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>TooManyFilterMissesException</h4> <pre>public&nbsp;TooManyFilterMissesException(java.lang.String&nbsp;message)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../net/jqwik/api/TagList.html" title="annotation in net.jqwik.api"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../net/jqwik/api/Tuple.html" title="interface in net.jqwik.api"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?net/jqwik/api/TooManyFilterMissesException.html" target="_top">Frames</a></li> <li><a href="TooManyFilterMissesException.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#methods.inherited.from.class.java.lang.Throwable">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "pile_set_name": "Github" }
// Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package fileutil import ( "os" "path/filepath" "sort" "strings" "time" ) func PurgeFile(dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}) <-chan error { return purgeFile(dirname, suffix, max, interval, stop, nil) } // purgeFile is the internal implementation for PurgeFile which can post purged files to purgec if non-nil. func purgeFile(dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}, purgec chan<- string) <-chan error { errC := make(chan error, 1) go func() { for { fnames, err := ReadDir(dirname) if err != nil { errC <- err return } newfnames := make([]string, 0) for _, fname := range fnames { if strings.HasSuffix(fname, suffix) { newfnames = append(newfnames, fname) } } sort.Strings(newfnames) fnames = newfnames for len(newfnames) > int(max) { f := filepath.Join(dirname, newfnames[0]) l, err := TryLockFile(f, os.O_WRONLY, PrivateFileMode) if err != nil { break } if err = os.Remove(f); err != nil { errC <- err return } if err = l.Close(); err != nil { plog.Errorf("error unlocking %s when purging file (%v)", l.Name(), err) errC <- err return } plog.Infof("purged file %s successfully", f) newfnames = newfnames[1:] } if purgec != nil { for i := 0; i < len(fnames)-len(newfnames); i++ { purgec <- fnames[i] } } select { case <-time.After(interval): case <-stop: return } } }() return errC }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <title>Reference (Java SE 12 &amp; JDK 12 )</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="javax.xml.crypto.dsig.Reference interface"> <meta name="keywords" content="getTransforms()"> <meta name="keywords" content="getDigestMethod()"> <meta name="keywords" content="getId()"> <meta name="keywords" content="getDigestValue()"> <meta name="keywords" content="getCalculatedDigestValue()"> <meta name="keywords" content="validate()"> <meta name="keywords" content="getDereferencedData()"> <meta name="keywords" content="getDigestInputStream()"> <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="Reference (Java SE 12 & JDK 12 )"; } } catch(err) { } //--> var data = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; 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="../../../../../index.html">Overview</a></li> <li><a href="../../../../module-summary.html">Module</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Reference.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 &amp; JDK 12</strong> </div></div> </div> <div class="subNav"> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <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> <!-- ======== START OF CLASS DATA ======== --> <main role="main"> <div class="header"> <div class="subTitle"><span class="moduleLabelInType">Module</span>&nbsp;<a href="../../../../module-summary.html">java.xml.crypto</a></div> <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">javax.xml.crypto.dsig</a></div> <h2 title="Interface Reference" class="title">Interface Reference</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Superinterfaces:</dt> <dd><code><a href="../URIReference.html" title="interface in javax.xml.crypto">URIReference</a></code>, <code><a href="../XMLStructure.html" title="interface in javax.xml.crypto">XMLStructure</a></code></dd> </dl> <hr> <pre>public interface <span class="typeNameLabel">Reference</span> extends <a href="../URIReference.html" title="interface in javax.xml.crypto">URIReference</a>, <a href="../XMLStructure.html" title="interface in javax.xml.crypto">XMLStructure</a></pre> <div class="block">A representation of the <code>Reference</code> element as defined in the <a href="http://www.w3.org/TR/xmldsig-core/"> W3C Recommendation for XML-Signature Syntax and Processing</a>. The XML schema is defined as: <pre> &lt;element name="Reference" type="ds:ReferenceType"/&gt; &lt;complexType name="ReferenceType"&gt; &lt;sequence&gt; &lt;element ref="ds:Transforms" minOccurs="0"/&gt; &lt;element ref="ds:DigestMethod"/&gt; &lt;element ref="ds:DigestValue"/&gt; &lt;/sequence&gt; &lt;attribute name="Id" type="ID" use="optional"/&gt; &lt;attribute name="URI" type="anyURI" use="optional"/&gt; &lt;attribute name="Type" type="anyURI" use="optional"/&gt; &lt;/complexType&gt; &lt;element name="DigestValue" type="ds:DigestValueType"/&gt; &lt;simpleType name="DigestValueType"&gt; &lt;restriction base="base64Binary"/&gt; &lt;/simpleType&gt; </pre> <p>A <code>Reference</code> instance may be created by invoking one of the <a href="XMLSignatureFactory.html#newReference(java.lang.String,javax.xml.crypto.dsig.DigestMethod)"><code>newReference</code></a> methods of the <a href="XMLSignatureFactory.html" title="class in javax.xml.crypto.dsig"><code>XMLSignatureFactory</code></a> class; for example: <pre> XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM"); Reference ref = factory.newReference ("http://www.ietf.org/rfc/rfc3275.txt", factory.newDigestMethod(DigestMethod.SHA1, null)); </pre></div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>1.6</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="XMLSignatureFactory.html#newReference(java.lang.String,javax.xml.crypto.dsig.DigestMethod)"><code>XMLSignatureFactory.newReference(String, DigestMethod)</code></a>, <a href="XMLSignatureFactory.html#newReference(java.lang.String,javax.xml.crypto.dsig.DigestMethod,java.util.List,java.lang.String,java.lang.String)"><code>XMLSignatureFactory.newReference(String, DigestMethod, List, String, String)</code></a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <div class="memberSummary"> <div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t3" class="tableTab" onclick="show(4);">Abstract Methods</button></div> <div id="memberSummary_tabpanel" role="tabpanel"> <table aria-labelledby="t0"> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colSecond" scope="col">Method</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor" id="i0"> <td class="colFirst"><code>byte[]</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCalculatedDigestValue()">getCalculatedDigestValue</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the calculated digest value of this <code>Reference</code> after a validation operation.</div> </td> </tr> <tr class="rowColor" id="i1"> <td class="colFirst"><code><a href="../Data.html" title="interface in javax.xml.crypto">Data</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDereferencedData()">getDereferencedData</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the dereferenced data, if <a href="XMLSignContext.html#SupportedProperties">reference caching</a> is enabled.</div> </td> </tr> <tr class="altColor" id="i2"> <td class="colFirst"><code><a href="../../../../../java.base/java/io/InputStream.html" title="class in java.io">InputStream</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDigestInputStream()">getDigestInputStream</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the pre-digested input stream, if <a href="XMLSignContext.html#SupportedProperties">reference caching</a> is enabled.</div> </td> </tr> <tr class="rowColor" id="i3"> <td class="colFirst"><code><a href="DigestMethod.html" title="interface in javax.xml.crypto.dsig">DigestMethod</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDigestMethod()">getDigestMethod</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the digest method of this <code>Reference</code>.</div> </td> </tr> <tr class="altColor" id="i4"> <td class="colFirst"><code>byte[]</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDigestValue()">getDigestValue</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the digest value of this <code>Reference</code>.</div> </td> </tr> <tr class="rowColor" id="i5"> <td class="colFirst"><code><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getId()">getId</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the optional <code>Id</code> attribute of this <code>Reference</code>, which permits this reference to be referenced from elsewhere.</div> </td> </tr> <tr class="altColor" id="i6"> <td class="colFirst"><code><a href="../../../../../java.base/java/util/List.html" title="interface in java.util">List</a>&lt;<a href="Transform.html" title="interface in javax.xml.crypto.dsig">Transform</a>&gt;</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getTransforms()">getTransforms</a></span>()</code></th> <td class="colLast"> <div class="block">Returns an <a href="../../../../../java.base/java/util/Collections.html#unmodifiableList(java.util.List)"><code>unmodifiable list</code></a> of <a href="Transform.html" title="interface in javax.xml.crypto.dsig"><code>Transform</code></a>s that are contained in this <code>Reference</code>.</div> </td> </tr> <tr class="rowColor" id="i7"> <td class="colFirst"><code>boolean</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#validate(javax.xml.crypto.dsig.XMLValidateContext)">validate</a></span>&#8203;(<a href="XMLValidateContext.html" title="interface in javax.xml.crypto.dsig">XMLValidateContext</a>&nbsp;validateContext)</code></th> <td class="colLast"> <div class="block">Validates this reference.</div> </td> </tr> </tbody> </table> </div> </div> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.javax.xml.crypto.URIReference"> <!-- --> </a> <h3>Methods declared in interface&nbsp;javax.xml.crypto.<a href="../URIReference.html" title="interface in javax.xml.crypto">URIReference</a></h3> <code><a href="../URIReference.html#getType()">getType</a>, <a href="../URIReference.html#getURI()">getURI</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.javax.xml.crypto.XMLStructure"> <!-- --> </a> <h3>Methods declared in interface&nbsp;javax.xml.crypto.<a href="../XMLStructure.html" title="interface in javax.xml.crypto">XMLStructure</a></h3> <code><a href="../XMLStructure.html#isFeatureSupported(java.lang.String)">isFeatureSupported</a></code></li> </ul> </li> </ul> </section> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a id="getTransforms()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTransforms</h4> <pre class="methodSignature"><a href="../../../../../java.base/java/util/List.html" title="interface in java.util">List</a>&lt;<a href="Transform.html" title="interface in javax.xml.crypto.dsig">Transform</a>&gt;&nbsp;getTransforms()</pre> <div class="block">Returns an <a href="../../../../../java.base/java/util/Collections.html#unmodifiableList(java.util.List)"><code>unmodifiable list</code></a> of <a href="Transform.html" title="interface in javax.xml.crypto.dsig"><code>Transform</code></a>s that are contained in this <code>Reference</code>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>an unmodifiable list of <code>Transform</code>s (may be empty but never <code>null</code>)</dd> </dl> </li> </ul> <a id="getDigestMethod()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getDigestMethod</h4> <pre class="methodSignature"><a href="DigestMethod.html" title="interface in javax.xml.crypto.dsig">DigestMethod</a>&nbsp;getDigestMethod()</pre> <div class="block">Returns the digest method of this <code>Reference</code>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the digest method</dd> </dl> </li> </ul> <a id="getId()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getId</h4> <pre class="methodSignature"><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;getId()</pre> <div class="block">Returns the optional <code>Id</code> attribute of this <code>Reference</code>, which permits this reference to be referenced from elsewhere.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the <code>Id</code> attribute (may be <code>null</code> if not specified)</dd> </dl> </li> </ul> <a id="getDigestValue()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getDigestValue</h4> <pre class="methodSignature">byte[]&nbsp;getDigestValue()</pre> <div class="block">Returns the digest value of this <code>Reference</code>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the raw digest value, or <code>null</code> if this reference has not been digested yet. Each invocation of this method returns a new clone to protect against subsequent modification.</dd> </dl> </li> </ul> <a id="getCalculatedDigestValue()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getCalculatedDigestValue</h4> <pre class="methodSignature">byte[]&nbsp;getCalculatedDigestValue()</pre> <div class="block">Returns the calculated digest value of this <code>Reference</code> after a validation operation. This method is useful for debugging if the reference fails to validate.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the calculated digest value, or <code>null</code> if this reference has not been validated yet. Each invocation of this method returns a new clone to protect against subsequent modification.</dd> </dl> </li> </ul> <a id="validate(javax.xml.crypto.dsig.XMLValidateContext)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>validate</h4> <pre class="methodSignature">boolean&nbsp;validate&#8203;(<a href="XMLValidateContext.html" title="interface in javax.xml.crypto.dsig">XMLValidateContext</a>&nbsp;validateContext) throws <a href="XMLSignatureException.html" title="class in javax.xml.crypto.dsig">XMLSignatureException</a></pre> <div class="block">Validates this reference. This method verifies the digest of this reference. <p>This method only validates the reference the first time it is invoked. On subsequent invocations, it returns a cached result.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>validateContext</code> - the validating context</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd><code>true</code> if this reference was validated successfully; <code>false</code> otherwise</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../../../java.base/java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if <code>validateContext</code> is <code>null</code></dd> <dd><code><a href="XMLSignatureException.html" title="class in javax.xml.crypto.dsig">XMLSignatureException</a></code> - if an unexpected exception occurs while validating the reference</dd> </dl> </li> </ul> <a id="getDereferencedData()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getDereferencedData</h4> <pre class="methodSignature"><a href="../Data.html" title="interface in javax.xml.crypto">Data</a>&nbsp;getDereferencedData()</pre> <div class="block">Returns the dereferenced data, if <a href="XMLSignContext.html#SupportedProperties">reference caching</a> is enabled. This is the result of dereferencing the URI of this reference during a validation or generation operation.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the dereferenced data, or <code>null</code> if reference caching is not enabled or this reference has not been generated or validated</dd> </dl> </li> </ul> <a id="getDigestInputStream()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getDigestInputStream</h4> <pre class="methodSignature"><a href="../../../../../java.base/java/io/InputStream.html" title="class in java.io">InputStream</a>&nbsp;getDigestInputStream()</pre> <div class="block">Returns the pre-digested input stream, if <a href="XMLSignContext.html#SupportedProperties">reference caching</a> is enabled. This is the input to the digest operation during a validation or signing operation.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>an input stream containing the pre-digested input, or <code>null</code> if reference caching is not enabled or this reference has not been generated or validated</dd> </dl> </li> </ul> </li> </ul> </section> </li> </ul> </div> </div> </main> <!-- ========= END OF CLASS DATA ========= --> <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="../../../../../index.html">Overview</a></li> <li><a href="../../../../module-summary.html">Module</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Reference.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 &amp; JDK 12</strong> </div></div> </div> <div class="subNav"> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> </div> <a id="skip.navbar.bottom"> <!-- --> </a> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> <p class="legalCopy"><small><a href="https://bugreport.java.com/bugreport/">Report a bug or suggest an enhancement</a><br> For further API reference and developer documentation see the <a href="https://docs.oracle.com/pls/topic/lookup?ctx=javase12.0.2&amp;id=homepage" target="_blank">Java SE Documentation</a>, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.<br> <a href="../../../../../../legal/copyright.html">Copyright</a> &copy; 1993, 2019, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.<br>All rights reserved. Use is subject to <a href="https://www.oracle.com/technetwork/java/javase/terms/license/java12.0.2speclicense.html">license terms</a> and the <a href="https://www.oracle.com/technetwork/java/redist-137594.html">documentation redistribution policy</a>. <!-- Version 12.0.2+10 --></small></p> </footer> </body> </html>
{ "pile_set_name": "Github" }
桐谷ゆい最新番号 【DUSA-036】ガテンなオンナの肉体労働 【VNDS-1030】ワーキング娘。 【VNDS-720】ワーキング娘。MIX</a>2006-05-20NEXT GROUP$$$ネクストイレブ118分钟
{ "pile_set_name": "Github" }
/* Copyright 2016 The Kubernetes Authors. 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. */ // +k8s:deepcopy-gen=package // +k8s:protobuf-gen=package // +k8s:openapi-gen=true package v1 // import "k8s.io/api/batch/v1"
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> </dependencies> <scenes> <!--Flutter View Controller--> <scene sceneID="tne-QT-ifu"> <objects> <viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController"> <layoutGuides> <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> </objects> </scene> </scenes> </document>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Author</key> <string>brumas</string> <key>CodecID</key> <integer>1089</integer> <key>CodecName</key> <string>VT2020/2021</string> <key>Files</key> <dict> <key>Layouts</key> <array> <dict> <key>Comment</key> <string>VIA VT2020/2021 Mirone</string> <key>Id</key> <integer>5</integer> <key>Path</key> <string>layout5.xml.zlib</string> </dict> <dict> <key>Comment</key> <string>VIA VT2020/2021 Mirone</string> <key>Id</key> <integer>7</integer> <key>Path</key> <string>layout7.xml.zlib</string> </dict> </array> <key>Platforms</key> <array> <dict> <key>Comment</key> <string>VIA VT2020/2021 Mirone</string> <key>Id</key> <integer>5</integer> <key>Path</key> <string>PlatformsM.xml.zlib</string> </dict> <dict> <key>Comment</key> <string>VIA VT2020/2021 Mirone</string> <key>Id</key> <integer>7</integer> <key>Path</key> <string>PlatformsM.xml.zlib</string> </dict> </array> </dict> <key>Patches</key> <array> <dict> <key>Count</key> <integer>2</integer> <key>Find</key> <data>hBnUEQ==</data> <key>MinKernel</key> <integer>13</integer> <key>MaxKernel</key> <integer>14</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>QQQGEQ==</data> </dict> <dict> <key>Count</key> <integer>2</integer> <key>Find</key> <data>ixnUEQ==</data> <key>MinKernel</key> <integer>15</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>QQQGEQ==</data> </dict> <dict> <key>Count</key> <integer>2</integer> <key>Find</key> <data>gxnUEQ==</data> <key>MinKernel</key> <integer>15</integer> <key>MaxKernel</key> <integer>15</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>AAAAAA==</data> </dict> <dict> <key>Count</key> <integer>2</integer> <key>Find</key> <data>ihnUEQ==</data> <key>MinKernel</key> <integer>16</integer> <key>Name</key> <string>AppleHDA</string> <key>Replace</key> <data>AAAAAA==</data> </dict> </array> <key>Revisions</key> <array> <integer>1048832</integer> </array> <key>Vendor</key> <string>VIA</string> </dict> </plist>
{ "pile_set_name": "Github" }
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This package contains integration tests for the // golang.org/x/crypto/ssh package. package test // import "golang.org/x/crypto/ssh/test"
{ "pile_set_name": "Github" }
// // Copyright 2016 Pixar // // Licensed under the Apache License, Version 2.0 (the "Apache License") // with the following modification; you may not use this file except in // compliance with the Apache License and the following modification to it: // Section 6. Trademarks. is deleted and replaced with: // // 6. Trademarks. This License does not grant permission to use the trade // names, trademarks, service marks, or product names of the Licensor // and its affiliates, except as required to comply with Section 4(c) of // the License and to reproduce the content of the NOTICE file. // // You may obtain a copy of the Apache License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the Apache License with the above modification is // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the Apache License for the specific // language governing permissions and limitations under the Apache License. // #ifndef USDRI_GENERATED_LIGHTFILTERAPI_H #define USDRI_GENERATED_LIGHTFILTERAPI_H /// \file usdRi/lightFilterAPI.h #include "pxr/pxr.h" #include "pxr/usd/usdRi/api.h" #include "pxr/usd/usd/apiSchemaBase.h" #include "pxr/usd/usd/prim.h" #include "pxr/usd/usd/stage.h" #include "pxr/usd/usdRi/tokens.h" #include "pxr/base/vt/value.h" #include "pxr/base/gf/vec3d.h" #include "pxr/base/gf/vec3f.h" #include "pxr/base/gf/matrix4d.h" #include "pxr/base/tf/token.h" #include "pxr/base/tf/type.h" PXR_NAMESPACE_OPEN_SCOPE class SdfAssetPath; // -------------------------------------------------------------------------- // // RILIGHTFILTERAPI // // -------------------------------------------------------------------------- // /// \class UsdRiLightFilterAPI /// /// /// \deprecated RenderMan-specific light filter settings will move to a /// new schema in a future release. /// /// Renderman-specific attributes for light filters. /// /// For any described attribute \em Fallback \em Value or \em Allowed \em Values below /// that are text/tokens, the actual token is published and defined in \ref UsdRiTokens. /// So to set an attribute to the value "rightHanded", use UsdRiTokens->rightHanded /// as the value. /// class UsdRiLightFilterAPI : public UsdAPISchemaBase { public: /// Compile time constant representing what kind of schema this class is. /// /// \sa UsdSchemaType static const UsdSchemaType schemaType = UsdSchemaType::SingleApplyAPI; /// Construct a UsdRiLightFilterAPI on UsdPrim \p prim . /// Equivalent to UsdRiLightFilterAPI::Get(prim.GetStage(), prim.GetPath()) /// for a \em valid \p prim, but will not immediately throw an error for /// an invalid \p prim explicit UsdRiLightFilterAPI(const UsdPrim& prim=UsdPrim()) : UsdAPISchemaBase(prim) { } /// Construct a UsdRiLightFilterAPI on the prim held by \p schemaObj . /// Should be preferred over UsdRiLightFilterAPI(schemaObj.GetPrim()), /// as it preserves SchemaBase state. explicit UsdRiLightFilterAPI(const UsdSchemaBase& schemaObj) : UsdAPISchemaBase(schemaObj) { } /// Destructor. USDRI_API virtual ~UsdRiLightFilterAPI(); /// Return a vector of names of all pre-declared attributes for this schema /// class and all its ancestor classes. Does not include attributes that /// may be authored by custom/extended methods of the schemas involved. USDRI_API static const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true); /// Return a UsdRiLightFilterAPI holding the prim adhering to this /// schema at \p path on \p stage. If no prim exists at \p path on /// \p stage, or if the prim at that path does not adhere to this schema, /// return an invalid schema object. This is shorthand for the following: /// /// \code /// UsdRiLightFilterAPI(stage->GetPrimAtPath(path)); /// \endcode /// USDRI_API static UsdRiLightFilterAPI Get(const UsdStagePtr &stage, const SdfPath &path); /// Applies this <b>single-apply</b> API schema to the given \p prim. /// This information is stored by adding "RiLightFilterAPI" to the /// token-valued, listOp metadata \em apiSchemas on the prim. /// /// \return A valid UsdRiLightFilterAPI object is returned upon success. /// An invalid (or empty) UsdRiLightFilterAPI object is returned upon /// failure. See \ref UsdPrim::ApplyAPI() for conditions /// resulting in failure. /// /// \sa UsdPrim::GetAppliedSchemas() /// \sa UsdPrim::HasAPI() /// \sa UsdPrim::ApplyAPI() /// \sa UsdPrim::RemoveAPI() /// USDRI_API static UsdRiLightFilterAPI Apply(const UsdPrim &prim); protected: /// Returns the type of schema this class belongs to. /// /// \sa UsdSchemaType USDRI_API UsdSchemaType _GetSchemaType() const override; private: // needs to invoke _GetStaticTfType. friend class UsdSchemaRegistry; USDRI_API static const TfType &_GetStaticTfType(); static bool _IsTypedSchema(); // override SchemaBase virtuals. USDRI_API const TfType &_GetTfType() const override; public: // --------------------------------------------------------------------- // // RICOMBINEMODE // --------------------------------------------------------------------- // /// Specifies how this filter combines with others. /// Valid values are: /// /// - multiply: The results of filters are multiplied together /// - max: The maximum result of the filters is used. This /// works best for grey-scale filters. /// - min: The minimum result of the filters is used. This /// works best for grey-scale filters. /// - screen: Similar to max, but combines gradients in a smoother /// way by using a screen operation: /// <pre>screen(a,b) = 1-(1-a)(1-b)</pre> /// This works best for grey-scale filters. /// /// Light filters on a light are grouped by their combine mode. /// Each group is executed and combined using that mode. Then, /// the final results of each group are multiplied together. /// /// Fallback: multiply /// /// /// | || /// | -- | -- | /// | Declaration | `token ri:combineMode = "multiply"` | /// | C++ Type | TfToken | /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token | /// | \ref UsdRiTokens "Allowed Values" | multiply, max, min, screen | USDRI_API UsdAttribute GetRiCombineModeAttr() const; /// See GetRiCombineModeAttr(), and also /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create. /// If specified, author \p defaultValue as the attribute's default, /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true - /// the default for \p writeSparsely is \c false. USDRI_API UsdAttribute CreateRiCombineModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const; public: // --------------------------------------------------------------------- // // RIDENSITY // --------------------------------------------------------------------- // /// Scales the strength of the filter. /// /// | || /// | -- | -- | /// | Declaration | `float ri:density = 1` | /// | C++ Type | float | /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float | USDRI_API UsdAttribute GetRiDensityAttr() const; /// See GetRiDensityAttr(), and also /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create. /// If specified, author \p defaultValue as the attribute's default, /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true - /// the default for \p writeSparsely is \c false. USDRI_API UsdAttribute CreateRiDensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const; public: // --------------------------------------------------------------------- // // RIINVERT // --------------------------------------------------------------------- // /// When true, inverts the output of the light filter. /// /// | || /// | -- | -- | /// | Declaration | `bool ri:invert = 0` | /// | C++ Type | bool | /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool | USDRI_API UsdAttribute GetRiInvertAttr() const; /// See GetRiInvertAttr(), and also /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create. /// If specified, author \p defaultValue as the attribute's default, /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true - /// the default for \p writeSparsely is \c false. USDRI_API UsdAttribute CreateRiInvertAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const; public: // --------------------------------------------------------------------- // // RIINTENSITY // --------------------------------------------------------------------- // /// Multipier for the diffuse and specular result. /// /// | || /// | -- | -- | /// | Declaration | `float ri:intensity = 0` | /// | C++ Type | float | /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float | USDRI_API UsdAttribute GetRiIntensityAttr() const; /// See GetRiIntensityAttr(), and also /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create. /// If specified, author \p defaultValue as the attribute's default, /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true - /// the default for \p writeSparsely is \c false. USDRI_API UsdAttribute CreateRiIntensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const; public: // --------------------------------------------------------------------- // // RIEXPOSURE // --------------------------------------------------------------------- // /// Exposure control for the multiplier. /// /// | || /// | -- | -- | /// | Declaration | `float ri:exposure = 0` | /// | C++ Type | float | /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float | USDRI_API UsdAttribute GetRiExposureAttr() const; /// See GetRiExposureAttr(), and also /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create. /// If specified, author \p defaultValue as the attribute's default, /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true - /// the default for \p writeSparsely is \c false. USDRI_API UsdAttribute CreateRiExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const; public: // --------------------------------------------------------------------- // // RIDIFFUSE // --------------------------------------------------------------------- // /// A multiplier for the effect of this light on the diffuse /// response of materials. This is a non-physical control. /// /// | || /// | -- | -- | /// | Declaration | `float ri:diffuse = 1` | /// | C++ Type | float | /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float | USDRI_API UsdAttribute GetRiDiffuseAttr() const; /// See GetRiDiffuseAttr(), and also /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create. /// If specified, author \p defaultValue as the attribute's default, /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true - /// the default for \p writeSparsely is \c false. USDRI_API UsdAttribute CreateRiDiffuseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const; public: // --------------------------------------------------------------------- // // RISPECULAR // --------------------------------------------------------------------- // /// A multiplier for the effect of this light on the specular /// response of materials. This is a non-physical control. /// /// | || /// | -- | -- | /// | Declaration | `float ri:specular = 1` | /// | C++ Type | float | /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float | USDRI_API UsdAttribute GetRiSpecularAttr() const; /// See GetRiSpecularAttr(), and also /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create. /// If specified, author \p defaultValue as the attribute's default, /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true - /// the default for \p writeSparsely is \c false. USDRI_API UsdAttribute CreateRiSpecularAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const; public: // ===================================================================== // // Feel free to add custom code below this line, it will be preserved by // the code generator. // // Just remember to: // - Close the class declaration with }; // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE // - Close the include guard with #endif // ===================================================================== // // --(BEGIN CUSTOM CODE)-- }; PXR_NAMESPACE_CLOSE_SCOPE #endif
{ "pile_set_name": "Github" }
OWA.areaChart = function( options ) { // config options this.options = { series: [], height: 125, width: '99%', // needed for flot resize plugin xaxis: { mode: 'time' }, timeformat: "%m/%d", showGrid: true, showLegend: true, showDots: true, lineWidth: 4, autoResizeCharts: true, fillColor: "rgba(202,225,255, 0.6)", colors: ["#1874CD", "#dba255", "#919733"] }; // merge passed options with defaults. if ( options ) { for (option in options) { if ( options.hasOwnProperty( option ) ) { this.options[ option ] = options[ option ]; } } } this.dom_id = ''; this.domSelector = ''; this.init = false; } OWA.areaChart.prototype = { setDomId: function(dom_id) { this.dom_id = dom_id; this.domSelector = "#" + dom_id + ' > .owa_areaChart'; // listen for data change events var that = this; jQuery( '#' + that.dom_id ).bind( 'new_result_set', function( event, resultSet ) { //jQuery( that.domSelector ).remove(); that.generate( resultSet ); }); }, getOption: function( name ) { if ( this.options.hasOwnProperty( name ) ) { return this.options[ name ]; } }, setOption: function ( name, value ) { this.options[name] = value; }, getContainerHeight : function() { var that = this; var h = jQuery("#"+that.dom_id).height(); //alert(h); return h; }, // move to OWA.util formatValue : function(type, value) { switch(type) { // convery yyyymmdd to javascript timestamp as flot requires that case 'yyyymmdd': //date = jQuery.datepicker.parseDate('yymmdd', value); //value = Date.parse(date); var year = value.substring(0,4) * 1; var month = (value.substring(4,6) * 1) -1; var day = value.substring(6,8) * 1; var d = Date.UTC(year,month,day,0,0,0,0); value = d; OWA.debug('year: %s, month: %s, day: %s, timestamp: %s',year,month,day,d); break; case 'currency': value = value/100; } return value; }, timestampFormatter : function(timestamp) { var d = new Date(timestamp*1); var curr_date = d.getUTCDate(); var curr_month = d.getUTCMonth() + 1; var curr_year = d.getUTCFullYear(); //alert(d+' date: '+curr_month); var date = curr_month + "/" + curr_date + "/" + curr_year; //var date = curr_month + "/" + curr_date; return date; }, /** * Main method for displaying an area chart */ generate : function( resultSet, series, dom_id ) { OWA.debug('generating area chart for ' + dom_id); // set dom_id just in case. if ( dom_id ) { this.setDomId( dom_id ); } dom_id = this.dom_id; // set series just in case. if ( series ) { this.options.series = series; } var selector = this.domSelector; // remove in case the chart is already there. // this is kind of a hack as it mean that only one area chart can be placed in a dom_id at a time. // this is needed so that charts can be over riden when report // tabs change. jQuery( selector ).remove(); // if there is data, plot it. if ( resultSet.resultsRows.length > 0 ) { // create data array for flot. var dataseries = []; series = this.options.series; var data = []; for( var ii = 0; ii <= series.length -1; ii++ ) { var x_series_name = series[ii].x; var y_series_name = series[ii].y; //create data array for( var i=0; i <= resultSet.resultsRows.length -1; i++ ) { data_type_x = resultSet.resultsRows[i][x_series_name].data_type; data_type_y = resultSet.resultsRows[i][y_series_name].data_type; var item =[this.formatValue(data_type_x, resultSet.resultsRows[i][x_series_name].value), this.formatValue(data_type_y, resultSet.resultsRows[i][y_series_name].value)]; data.push(item); } //alert(this.resultSet.resultsRows[i][series[ii].x].value); var l = resultSet.getMetricLabel(y_series_name); dataseries.push({ label: l, data: data}); } //if ( ! this.init ) { OWA.debug('ac init not set'); this.setupAreaChart(series, dom_id); //} var num_ticks = data.length; // reduce number of x axis ticks if data set has too many points. if (data.length > 10) { num_ticks = 10; } var options = { yaxis: { tickDecimals:0 }, xaxis:{ ticks: num_ticks, tickDecimals: null }, grid: {show: this.options.showGrid, hoverable: true, autoHilight:true, borderWidth:0, borderColor: null}, series: { points: { show: this.options.showDots, fill: this.options.showDots}, lines: { show: true, fill: true, fillColor: this.options.fillColor, lineWidth: this.options.lineWidth} }, colors: this.options.colors, legend: { position: 'ne', margin: [0,-10], show:this.options.showLegend } }; if (data_type_x === 'yyyymmdd') { options.xaxis.mode = "time"; //options.xaxis.timeformat = "%m/%d/%y"; options.xaxis.timeformat = this.options.timeformat; } //this.options.areaChart.flot = options; OWA.debug('Plotting area graph in ' + selector); var selector_dom = jQuery(selector); jQuery.plot(selector_dom, dataseries, options); this.init = true; } else { jQuery('#'+ dom_id).html("No data is available for this time period"); jQuery('#'+ dom_id).css('height', '50px'); } }, // shows a tool tip for flot charts showTooltip : function(x, y, contents) { jQuery('<div id="tooltip">' + contents + '</div>').css( { position: 'absolute', display: 'none', top: y + 5, left: x + 5, border: '1px solid #cccccc', padding: '2px', 'background-color': '#ffffff', opacity: 0.90 }).appendTo("body").fadeIn(100); }, setupAreaChart : function(series, dom_id) { dom_id = dom_id || this.dom_id; var that = this; //var w = this.getContainerWidth(); var w = jQuery("#"+dom_id).css('width'); //alert(w); var h = this.getContainerHeight() || this.getOption('height'); //var h = this.getOption('height'); jQuery("#"+dom_id).html('<div class="owa_areaChart"></div>'); jQuery(that.domSelector).css('width', this.getOption('width')); jQuery(that.domSelector).css('height', h); // binds a tooltip to plot points var previousPoint = null; jQuery(that.domSelector).bind("plothover", function (event, pos, item) { jQuery("#x").text(pos.x.toFixed(2)); jQuery("#y").text(pos.y.toFixed(2)); if (item) { if (previousPoint != item.datapoint) { previousPoint = item.datapoint; jQuery("#tooltip").remove(); var x = item.datapoint[0].toFixed(0), y = item.datapoint[1].toFixed(0); if (that.options.xaxis.mode === 'time') { x = that.timestampFormatter(x); } that.showTooltip(item.pageX -75, item.pageY -50, x+'<BR><B>'+item.series.label + ":</B> " + y); } } else { jQuery("#tooltip").remove(); previousPoint = null; } }); } }
{ "pile_set_name": "Github" }
diff --git a/node_modules/react-native-safe-area-view/index.js b/node_modules/react-native-safe-area-view/index.js index 0f93e5a..8ecce5c 100644 --- a/node_modules/react-native-safe-area-view/index.js +++ b/node_modules/react-native-safe-area-view/index.js @@ -174,6 +174,12 @@ class SafeView extends Component { const WIDTH = isLandscape ? X_HEIGHT : X_WIDTH; const HEIGHT = isLandscape ? X_WIDTH : X_HEIGHT; + // temporary fix, in order to execute the application after the porting to 0.63.x, waiting to replace react-navigation + if(this.view._component === undefined) + { + return; + } + this.view._component.measureInWindow((winX, winY, winWidth, winHeight) => { if (!this.view) { return;
{ "pile_set_name": "Github" }
// Andrés Mejía // Accepted using namespace std; #include <algorithm> #include <iostream> #include <iterator> #include <numeric> #include <sstream> #include <fstream> #include <cassert> #include <climits> #include <cstdlib> #include <cstring> #include <string> #include <cstdio> #include <vector> #include <cmath> #include <queue> #include <deque> #include <stack> #include <list> #include <map> #include <set> ////////////// Prewritten code follows. Look down for solution. //////////////// #define foreach(x, v) for (typeof (v).begin() x=(v).begin(); x !=(v).end(); ++x) #define For(i, a, b) for (int i=(a); i<(b); ++i) #define D(x) cout << #x " is " << (x) << endl const double EPS = 1e-9; int cmp(double x, double y = 0, double tol = EPS) { return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1; } ////////////////////////// Solution starts below. ////////////////////////////// namespace IO { #define MAXBUFF (1<<18) char buffer[MAXBUFF], *p = buffer+MAXBUFF; inline char read_char() { if( p == buffer+MAXBUFF ) { fread( buffer, 1, MAXBUFF, stdin ); p = buffer; } return *p++; } inline int read_int() { char c; while( !isdigit(c = read_char()) and c != '-' ); int sign = 1; if (c == '-') sign = -1, c = read_char(); int ret = c-'0'; while( isdigit(c = read_char()) ) ret = ret * 10 + c-'0'; return ret * sign; } } const int MAXN = 1001; long long dp[MAXN][MAXN]; int main(){ int n; while (n = IO::read_int()) { for (int i = 0; i < n; ++i) { for (int j = 0; j <= i; ++j) { dp[i][j] = IO::read_int(); if (i - 1 >= j) dp[i][j] += dp[i - 1][j]; } } dp[n][n - 1] = 0; for (int j = n - 1; j >= 0; --j) { for (int i = j; i < n; ++i) { dp[i][j] += i + 1 < n ? dp[i + 1][j + 1] : dp[n - 1][j + 1]; if (dp[i][j] < 0) dp[i][j] = 0; if (i - 1 >= j and dp[i - 1][j] > dp[i][j]) { dp[i][j] = dp[i - 1][j]; } } } printf("%lld\n", dp[n - 1][0]); } return 0; }
{ "pile_set_name": "Github" }
#ifndef _WINABLE_H #define _WINABLE_H #ifdef __cplusplus extern "C" { #endif #if (_WIN32_WINNT < 0x0403) #define INPUT_MOUSE 0x00000000 #define INPUT_KEYBOARD 0x00000001 #define INPUT_HARDWARE 0x00000002 #endif /* (_WIN32_WINNT < 0x04030) */ #if (WINVER < 0x0500) #define CHILDID_SELF 0 #define OBJID_WINDOW 0x00000000 #define OBJID_SYSMENU 0xFFFFFFFF #define OBJID_TITLEBAR 0xFFFFFFFE #define OBJID_MENU 0xFFFFFFFD #define OBJID_CLIENT 0xFFFFFFFC #define OBJID_VSCROLL 0xFFFFFFFB #define OBJID_HSCROLL 0xFFFFFFFA #define OBJID_SIZEGRIP 0xFFFFFFF9 #define OBJID_CARET 0xFFFFFFF8 #define OBJID_CURSOR 0xFFFFFFF7 #define OBJID_ALERT 0xFFFFFFF6 #define OBJID_SOUND 0xFFFFFFF5 #define GUI_CARETBLINKING 0x00000001 #define GUI_INMOVESIZE 0x00000002 #define GUI_INMENUMODE 0x00000004 #define GUI_SYSTEMMENUMODE 0x00000008 #define GUI_POPUPMENUMODE 0x00000010 #define WINEVENT_OUTOFCONTEXT 0x0000 #define WINEVENT_SKIPOWNTHREAD 0x0001 #define WINEVENT_SKIPOWNPROCESS 0x0002 #define WINEVENT_INCONTEXT 0x0004 #endif /* (WINVER < 0x0500) */ #if (_WIN32_WINNT < 0x0403) typedef struct tagMOUSEINPUT { LONG dx; LONG dy; DWORD mouseData; DWORD dwFlags; DWORD time; ULONG_PTR dwExtraInfo; } MOUSEINPUT,*PMOUSEINPUT; typedef struct tagKEYBDINPUT { WORD wVk; WORD wScan; DWORD dwFlags; DWORD time; ULONG_PTR dwExtraInfo; } KEYBDINPUT,*PKEYBDINPUT; typedef struct tagHARDWAREINPUT { DWORD uMsg; WORD wParamL; WORD wParamH; } HARDWAREINPUT,*PHARDWAREINPUT; typedef struct tagINPUT { DWORD type; _ANONYMOUS_UNION union { MOUSEINPUT mi; KEYBDINPUT ki; HARDWAREINPUT hi; } DUMMYUNIONNAME; } INPUT,*PINPUT,*LPINPUT; #endif /* (_WIN32_WINNT < 0x0403) */ #if (WINVER < 0x0500) typedef VOID (CALLBACK* WINEVENTPROC)(HWINEVENTHOOK,DWORD,HWND,LONG,LONG,DWORD,DWORD); typedef struct tagGUITHREADINFO { DWORD cbSize; DWORD flags; HWND hwndActive; HWND hwndFocus; HWND hwndCapture; HWND hwndMenuOwner; HWND hwndMoveSize; HWND hwndCaret; RECT rcCaret; } GUITHREADINFO,*PGUITHREADINFO,*LPGUITHREADINFO; #endif /* (WINVER < 0x0500) */ BOOL WINAPI BlockInput(BOOL); #if (_WIN32_WINNT < 0x0403) UINT WINAPI SendInput(UINT,LPINPUT,int); #endif #if (WINVER < 0x0500) BOOL WINAPI GetGUIThreadInfo(DWORD,LPGUITHREADINFO); void WINAPI NotifyWinEvent(DWORD,HWND,LONG,LONG); HWINEVENTHOOK WINAPI SetWinEventHook(UINT,UINT,HMODULE,WINEVENTPROC,DWORD,DWORD,UINT); BOOL WINAPI UnhookWinEvent(HWINEVENTHOOK); #endif /* (WINVER < 0x0500) */ #ifdef __cplusplus } #endif #endif
{ "pile_set_name": "Github" }
/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cache import ( "fmt" "sync" "k8s.io/apimachinery/pkg/util/sets" ) // ThreadSafeStore is an interface that allows concurrent access to a storage backend. // TL;DR caveats: you must not modify anything returned by Get or List as it will break // the indexing feature in addition to not being thread safe. // // The guarantees of thread safety provided by List/Get are only valid if the caller // treats returned items as read-only. For example, a pointer inserted in the store // through `Add` will be returned as is by `Get`. Multiple clients might invoke `Get` // on the same key and modify the pointer in a non-thread-safe way. Also note that // modifying objects stored by the indexers (if any) will *not* automatically lead // to a re-index. So it's not a good idea to directly modify the objects returned by // Get/List, in general. type ThreadSafeStore interface { Add(key string, obj interface{}) Update(key string, obj interface{}) Delete(key string) Get(key string) (item interface{}, exists bool) List() []interface{} ListKeys() []string Replace(map[string]interface{}, string) Index(indexName string, obj interface{}) ([]interface{}, error) IndexKeys(indexName, indexKey string) ([]string, error) ListIndexFuncValues(name string) []string ByIndex(indexName, indexKey string) ([]interface{}, error) GetIndexers() Indexers // AddIndexers adds more indexers to this store. If you call this after you already have data // in the store, the results are undefined. AddIndexers(newIndexers Indexers) error Resync() error } // threadSafeMap implements ThreadSafeStore type threadSafeMap struct { lock sync.RWMutex items map[string]interface{} // indexers maps a name to an IndexFunc indexers Indexers // indices maps a name to an Index indices Indices } func (c *threadSafeMap) Add(key string, obj interface{}) { c.lock.Lock() defer c.lock.Unlock() oldObject := c.items[key] c.items[key] = obj c.updateIndices(oldObject, obj, key) } func (c *threadSafeMap) Update(key string, obj interface{}) { c.lock.Lock() defer c.lock.Unlock() oldObject := c.items[key] c.items[key] = obj c.updateIndices(oldObject, obj, key) } func (c *threadSafeMap) Delete(key string) { c.lock.Lock() defer c.lock.Unlock() if obj, exists := c.items[key]; exists { c.deleteFromIndices(obj, key) delete(c.items, key) } } func (c *threadSafeMap) Get(key string) (item interface{}, exists bool) { c.lock.RLock() defer c.lock.RUnlock() item, exists = c.items[key] return item, exists } func (c *threadSafeMap) List() []interface{} { c.lock.RLock() defer c.lock.RUnlock() list := make([]interface{}, 0, len(c.items)) for _, item := range c.items { list = append(list, item) } return list } // ListKeys returns a list of all the keys of the objects currently // in the threadSafeMap. func (c *threadSafeMap) ListKeys() []string { c.lock.RLock() defer c.lock.RUnlock() list := make([]string, 0, len(c.items)) for key := range c.items { list = append(list, key) } return list } func (c *threadSafeMap) Replace(items map[string]interface{}, resourceVersion string) { c.lock.Lock() defer c.lock.Unlock() c.items = items // rebuild any index c.indices = Indices{} for key, item := range c.items { c.updateIndices(nil, item, key) } } // Index returns a list of items that match on the index function // Index is thread-safe so long as you treat all items as immutable func (c *threadSafeMap) Index(indexName string, obj interface{}) ([]interface{}, error) { c.lock.RLock() defer c.lock.RUnlock() indexFunc := c.indexers[indexName] if indexFunc == nil { return nil, fmt.Errorf("Index with name %s does not exist", indexName) } indexKeys, err := indexFunc(obj) if err != nil { return nil, err } index := c.indices[indexName] // need to de-dupe the return list. Since multiple keys are allowed, this can happen. returnKeySet := sets.String{} for _, indexKey := range indexKeys { set := index[indexKey] for _, key := range set.UnsortedList() { returnKeySet.Insert(key) } } list := make([]interface{}, 0, returnKeySet.Len()) for absoluteKey := range returnKeySet { list = append(list, c.items[absoluteKey]) } return list, nil } // ByIndex returns a list of items that match an exact value on the index function func (c *threadSafeMap) ByIndex(indexName, indexKey string) ([]interface{}, error) { c.lock.RLock() defer c.lock.RUnlock() indexFunc := c.indexers[indexName] if indexFunc == nil { return nil, fmt.Errorf("Index with name %s does not exist", indexName) } index := c.indices[indexName] set := index[indexKey] list := make([]interface{}, 0, set.Len()) for _, key := range set.List() { list = append(list, c.items[key]) } return list, nil } // IndexKeys returns a list of keys that match on the index function. // IndexKeys is thread-safe so long as you treat all items as immutable. func (c *threadSafeMap) IndexKeys(indexName, indexKey string) ([]string, error) { c.lock.RLock() defer c.lock.RUnlock() indexFunc := c.indexers[indexName] if indexFunc == nil { return nil, fmt.Errorf("Index with name %s does not exist", indexName) } index := c.indices[indexName] set := index[indexKey] return set.List(), nil } func (c *threadSafeMap) ListIndexFuncValues(indexName string) []string { c.lock.RLock() defer c.lock.RUnlock() index := c.indices[indexName] names := make([]string, 0, len(index)) for key := range index { names = append(names, key) } return names } func (c *threadSafeMap) GetIndexers() Indexers { return c.indexers } func (c *threadSafeMap) AddIndexers(newIndexers Indexers) error { c.lock.Lock() defer c.lock.Unlock() if len(c.items) > 0 { return fmt.Errorf("cannot add indexers to running index") } oldKeys := sets.StringKeySet(c.indexers) newKeys := sets.StringKeySet(newIndexers) if oldKeys.HasAny(newKeys.List()...) { return fmt.Errorf("indexer conflict: %v", oldKeys.Intersection(newKeys)) } for k, v := range newIndexers { c.indexers[k] = v } return nil } // updateIndices modifies the objects location in the managed indexes, if this is an update, you must provide an oldObj // updateIndices must be called from a function that already has a lock on the cache func (c *threadSafeMap) updateIndices(oldObj interface{}, newObj interface{}, key string) error { // if we got an old object, we need to remove it before we add it again if oldObj != nil { c.deleteFromIndices(oldObj, key) } for name, indexFunc := range c.indexers { indexValues, err := indexFunc(newObj) if err != nil { return err } index := c.indices[name] if index == nil { index = Index{} c.indices[name] = index } for _, indexValue := range indexValues { set := index[indexValue] if set == nil { set = sets.String{} index[indexValue] = set } set.Insert(key) } } return nil } // deleteFromIndices removes the object from each of the managed indexes // it is intended to be called from a function that already has a lock on the cache func (c *threadSafeMap) deleteFromIndices(obj interface{}, key string) error { for name, indexFunc := range c.indexers { indexValues, err := indexFunc(obj) if err != nil { return err } index := c.indices[name] if index == nil { continue } for _, indexValue := range indexValues { set := index[indexValue] if set != nil { set.Delete(key) } } } return nil } func (c *threadSafeMap) Resync() error { // Nothing to do return nil } func NewThreadSafeStore(indexers Indexers, indices Indices) ThreadSafeStore { return &threadSafeMap{ items: map[string]interface{}{}, indexers: indexers, indices: indices, } }
{ "pile_set_name": "Github" }
////<auto-generated <- Codemaid exclusion for now (PacketIndex Order is important for maintenance) using OpenNos.Core; namespace OpenNos.GameObject.Packets.ClientPackets { [PacketHeader("ncif")] public class NcifPacket : PacketDefinition { #region Properties [PacketIndex(0)] public byte Type { get; set; } [PacketIndex(1)] public long TargetId { get; set; } #endregion } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package java.util.function; import java.util.Objects; /** * Represents an operation that accepts a single {@code int}-valued argument and * returns no result. This is the primitive type specialization of * {@link Consumer} for {@code int}. Unlike most other functional interfaces, * {@code IntConsumer} is expected to operate via side-effects. * * <p>This is a <a href="package-summary.html">functional interface</a> * whose functional method is {@link #accept(int)}. * * @see Consumer * @since 1.8 */ @FunctionalInterface public interface IntConsumer { /** * Performs this operation on the given argument. * * @param value the input argument */ void accept(int value); /** * Returns a composed {@code IntConsumer} that performs, in sequence, this * operation followed by the {@code after} operation. If performing either * operation throws an exception, it is relayed to the caller of the * composed operation. If performing this operation throws an exception, * the {@code after} operation will not be performed. * * @param after the operation to perform after this operation * @return a composed {@code IntConsumer} that performs in sequence this * operation followed by the {@code after} operation * @throws NullPointerException if {@code after} is null */ default IntConsumer andThen(IntConsumer after) { Objects.requireNonNull(after); return (int t) -> { accept(t); after.accept(t); }; } }
{ "pile_set_name": "Github" }
/* Copyright 1988, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * The interfaces described by this header file are for miscellaneous utilities * and are not part of the Xlib standard. */ #ifndef _XMU_ERROR_H_ #define _XMU_ERROR_H_ #include <stdio.h> #include <X11/Xlib.h> #include <X11/Xfuncproto.h> _XFUNCPROTOBEGIN int XmuPrintDefaultErrorMessage ( Display *dpy, XErrorEvent *event, FILE *fp ); int XmuSimpleErrorHandler ( Display *dpy, XErrorEvent *errorp ); _XFUNCPROTOEND #endif /* _XMU_ERROR_H_ */
{ "pile_set_name": "Github" }
#ifndef HEADER_CURL_TRANSFER_H #define HEADER_CURL_TRANSFER_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <[email protected]>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ CURLcode Curl_pretransfer(struct SessionHandle *data); CURLcode Curl_second_connect(struct connectdata *conn); CURLcode Curl_posttransfer(struct SessionHandle *data); typedef enum { FOLLOW_NONE, /* not used within the function, just a placeholder to allow initing to this */ FOLLOW_FAKE, /* only records stuff, not actually following */ FOLLOW_RETRY, /* set if this is a request retry as opposed to a real redirect following */ FOLLOW_REDIR, /* a full true redirect */ FOLLOW_LAST /* never used */ } followtype; CURLcode Curl_follow(struct SessionHandle *data, char *newurl, followtype type); CURLcode Curl_readwrite(struct connectdata *conn, bool *done); int Curl_single_getsock(const struct connectdata *conn, curl_socket_t *socks, int numsocks); CURLcode Curl_readrewind(struct connectdata *conn); CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp); CURLcode Curl_reconnect_request(struct connectdata **connp); CURLcode Curl_retry_request(struct connectdata *conn, char **url); bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc); /* This sets up a forthcoming transfer */ void Curl_setup_transfer (struct connectdata *data, int sockindex, /* socket index to read from or -1 */ curl_off_t size, /* -1 if unknown at this point */ bool getheader, /* TRUE if header parsing is wanted */ curl_off_t *bytecountp, /* return number of bytes read */ int writesockindex, /* socket index to write to, it may very well be the same we read from. -1 disables */ curl_off_t *writecountp /* return number of bytes written */ ); long Curl_sleep_time(curl_off_t rate_bps, curl_off_t cur_rate_bps, int pkt_size); #endif /* HEADER_CURL_TRANSFER_H */
{ "pile_set_name": "Github" }
from unittest import mock import pytest from django.urls import reverse pytestmark = pytest.mark.django_db @mock.patch( 'rest_framework_json_api.utils' '.get_default_included_resources_from_serializer', new=lambda s: []) def test_multiple_entries_no_pagination(multiple_entries, client): expected = { "data": [ { "type": "posts", "id": "1", "attributes": { "headline": multiple_entries[0].headline, "bodyText": multiple_entries[0].body_text, "pubDate": None, "modDate": None }, "meta": { "bodyFormat": "text" }, "relationships": { "blog": { "data": {"type": "blogs", "id": "1"} }, "blogHyperlinked": { "links": { "related": "http://testserver/entries/1/blog", "self": "http://testserver/entries/1/relationships/blog_hyperlinked" } }, "authors": { "meta": {"count": 1}, "data": [{"type": "authors", "id": "1"}] }, "comments": { "meta": {"count": 1}, "data": [{"type": "comments", "id": "1"}] }, "commentsHyperlinked": { "links": { "related": "http://testserver/entries/1/comments", "self": "http://testserver/entries/1/relationships/comments_hyperlinked" } }, "suggested": { "data": [{"type": "entries", "id": "2"}], "links": { "related": "http://testserver/entries/1/suggested/", "self": "http://testserver/entries/1/relationships/suggested" } }, "suggestedHyperlinked": { "links": { "related": "http://testserver/entries/1/suggested/", "self": "http://testserver/entries/1" "/relationships/suggested_hyperlinked" } }, "featuredHyperlinked": { "links": { "related": "http://testserver/entries/1/featured", "self": "http://testserver/entries/1/relationships/featured_hyperlinked" } }, 'tags': {'data': [], 'meta': {'count': 0}}, } }, { "type": "posts", "id": "2", "attributes": { "headline": multiple_entries[1].headline, "bodyText": multiple_entries[1].body_text, "pubDate": None, "modDate": None }, "meta": { "bodyFormat": "text" }, "relationships": { "blog": { "data": {"type": "blogs", "id": "2"} }, "blogHyperlinked": { "links": { "related": "http://testserver/entries/2/blog", "self": "http://testserver/entries/2/relationships/blog_hyperlinked", } }, "authors": { "meta": {"count": 1}, "data": [{"type": "authors", "id": "2"}] }, "comments": { "meta": {"count": 1}, "data": [{"type": "comments", "id": "2"}] }, "commentsHyperlinked": { "links": { "related": "http://testserver/entries/2/comments", "self": "http://testserver/entries/2/relationships/comments_hyperlinked" } }, "suggested": { "data": [{"type": "entries", "id": "1"}], "links": { "related": "http://testserver/entries/2/suggested/", "self": "http://testserver/entries/2/relationships/suggested" } }, "suggestedHyperlinked": { "links": { "related": "http://testserver/entries/2/suggested/", "self": "http://testserver/entries/2" "/relationships/suggested_hyperlinked" } }, "featuredHyperlinked": { "links": { "related": "http://testserver/entries/2/featured", "self": "http://testserver/entries/2/relationships/featured_hyperlinked" } }, 'tags': {'data': [], 'meta': {'count': 0}}, } }, ] } response = client.get(reverse("nopage-entry-list")) assert expected == response.json()
{ "pile_set_name": "Github" }
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #pragma once #include "GameFramework/HUD.h" #include "TP_VehicleHud.generated.h" UCLASS(config = Game) class ATP_VehicleHud : public AHUD { GENERATED_BODY() public: ATP_VehicleHud(); /** Font used to render the vehicle info */ UPROPERTY() UFont* HUDFont; // Begin AHUD interface virtual void DrawHUD() override; // End AHUD interface };
{ "pile_set_name": "Github" }
# $OpenBSD: Makefile,v 1.38 2020/04/03 02:26:56 djm Exp $ .PATH: ${.CURDIR}/.. SRCS= ssh-agent.c ${SRCS_PKCS11_CLIENT} SRCS+= compat.c fatal.c readpass.c utf8.c SRCS+= ${SRCS_BASE} ${SRCS_KEY} ${SRCS_KEYP} ${SRCS_KRL} ${SRCS_UTL} SRCS+= ${SRCS_SK_CLIENT} PROG= ssh-agent BINOWN= root BINGRP= _sshagnt BINMODE=2555 BINDIR= /usr/bin .include <bsd.prog.mk> LDADD+= -lcrypto -lutil DPADD+= ${LIBCRYPTO} ${LIBUTIL}
{ "pile_set_name": "Github" }
/** * Marlin 3D Printer Firmware * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * */ #pragma once #ifdef SKR_HAS_LPC1769 #ifndef MCU_LPC1769 #error "Oops! Make sure you have the LPC1769 environment selected in your IDE." #endif #elif !defined(MCU_LPC1768) #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 // // Steppers // #ifndef E1_STEP_PIN #define E1_STEP_PIN P0_01 #endif #ifndef E1_DIR_PIN #define E1_DIR_PIN P0_00 #endif #ifndef E1_ENABLE_PIN #define E1_ENABLE_PIN P0_10 #endif // // Temperature Sensors // 3.3V max when defined as an analog input // #ifndef TEMP_0_PIN #define TEMP_0_PIN P0_24_A1 // A1 (T1) - (68) - TEMP_0_PIN #endif #ifndef TEMP_1_PIN #define TEMP_1_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_1_PIN #endif #ifndef TEMP_BED_PIN #define TEMP_BED_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_BED_PIN #endif #if HOTENDS == 1 #if TEMP_SENSOR_PROBE #define TEMP_PROBE_PIN TEMP_1_PIN #elif TEMP_SENSOR_CHAMBER #define TEMP_CHAMBER_PIN TEMP_1_PIN #endif #endif // // Heaters / Fans // #ifndef HEATER_0_PIN #define HEATER_0_PIN P2_07 #endif #if HOTENDS == 1 #ifndef FAN1_PIN #define FAN1_PIN P2_04 #endif #else #ifndef HEATER_1_PIN #define HEATER_1_PIN P2_04 #endif #endif #ifndef FAN_PIN #define FAN_PIN P2_03 #endif #ifndef HEATER_BED_PIN #define HEATER_BED_PIN P2_05 #endif // // LCD / Controller // #if HAS_SPI_LCD #define BEEPER_PIN P1_30 // (37) not 5V tolerant #endif // // SD Support // #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card #if SD_CONNECTION_IS(LCD) #define SCK_PIN P0_15 #define MISO_PIN P0_17 #define MOSI_PIN P0_18 #elif SD_CONNECTION_IS(ONBOARD) #undef SD_DETECT_PIN #define SD_DETECT_PIN P0_27 #define SCK_PIN P0_07 #define MISO_PIN P0_08 #define MOSI_PIN P0_09 #define SS_PIN ONBOARD_SD_CS_PIN #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif
{ "pile_set_name": "Github" }
namespace ClassLib066 { public class Class037 { public static string Property => "ClassLib066"; } }
{ "pile_set_name": "Github" }
#version 450 layout( local_size_x = 8, local_size_y = 8, local_size_z = 1) in; layout(binding = 0) writeonly uniform uimage2D dst; layout(push_constant) uniform u_info_t { uvec4 clear_value; ivec4 dst_offset; ivec4 dst_extent; } u_info; void main() { ivec3 thread_id = ivec3(gl_GlobalInvocationID); if (all(lessThan(thread_id.xy, u_info.dst_extent.xy))) { imageStore(dst, u_info.dst_offset.xy + thread_id.xy, u_info.clear_value); } }
{ "pile_set_name": "Github" }
<!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.5"/> <title>GLM: intrinsic_geometric.hpp Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">GLM &#160;<span id="projectnumber">0.9.5</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.5 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_8ceffd4ee35c3518d4e8bdc7e638efe8.html">Users</a></li><li class="navelem"><a class="el" href="dir_968fb7988749a6351e7b3d0c1783dec4.html">Groove</a></li><li class="navelem"><a class="el" href="dir_6e418c18ca640a0404613de005739e2e.html">Documents</a></li><li class="navelem"><a class="el" href="dir_e3ecd7863bd215c92a17f47e2ae3be43.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_edf753475b928be648c1cf1c6443cf63.html">glm</a></li><li class="navelem"><a class="el" href="dir_e50778361fd4ab4de52181ed9eb2b726.html">glm</a></li><li class="navelem"><a class="el" href="dir_4d1ca7e3aefdd5b86b5dba8da1c3d503.html">detail</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">intrinsic_geometric.hpp</div> </div> </div><!--header--> <div class="contents"> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;</div> <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#ifndef glm_core_intrinsic_geometric</span></div> <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define glm_core_intrinsic_geometric</span></div> <div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &quot;setup.hpp&quot;</span></div> <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div> <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#if(!(GLM_ARCH &amp; GLM_ARCH_SSE2))</span></div> <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor"></span><span class="preprocessor"># error &quot;SSE2 instructions not supported or enabled&quot;</span></div> <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#else</span></div> <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor">#include &quot;intrinsic_common.hpp&quot;</span></div> <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div> <div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="keyword">namespace </span>glm{</div> <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="keyword">namespace </span>detail</div> <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;{</div> <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="comment">//length</span></div> <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; __m128 sse_len_ps(__m128 x);</div> <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;</div> <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="comment">//distance</span></div> <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; __m128 sse_dst_ps(__m128 p0, __m128 p1);</div> <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div> <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="comment">//dot</span></div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; __m128 sse_dot_ps(__m128 v1, __m128 v2);</div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;</div> <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="comment">// SSE1</span></div> <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; __m128 sse_dot_ss(__m128 v1, __m128 v2);</div> <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div> <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="comment">//cross</span></div> <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; __m128 sse_xpd_ps(__m128 v1, __m128 v2);</div> <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div> <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="comment">//normalize</span></div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; __m128 sse_nrm_ps(__m128 v);</div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;</div> <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="comment">//faceforward</span></div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref);</div> <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div> <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="comment">//reflect</span></div> <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; __m128 sse_rfe_ps(__m128 I, __m128 N);</div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;</div> <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="comment">//refract</span></div> <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta);</div> <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div> <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;}<span class="comment">//namespace detail</span></div> <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;}<span class="comment">//namespace glm</span></div> <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div> <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="preprocessor">#include &quot;intrinsic_geometric.inl&quot;</span></div> <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;</div> <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="preprocessor">#endif//GLM_ARCH</span></div> <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif//glm_core_intrinsic_geometric</span></div> </div><!-- fragment --></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.5 </small></address> </body> </html>
{ "pile_set_name": "Github" }
// // ProfileProvider.swift // Example // // Created by DianQK on 04/11/2017. // Copyright © 2017 DianQK. All rights reserved. // import UIKit import Flix class ProfileProvider: SingleUITableViewCellProvider { let avatarImageView = UIImageView() let nameLabel = UILabel() let subTitleLabel = UILabel() init(avatar: UIImage, name: String) { super.init() avatarImageView.image = avatar nameLabel.text = name nameLabel.font = UIFont.systemFont(ofSize: 22) subTitleLabel.font = UIFont.systemFont(ofSize: 13) subTitleLabel.text = "Apple ID, iCloud, iTunes & App Store" self.accessoryType = .disclosureIndicator self.contentView.addSubview(avatarImageView) avatarImageView.translatesAutoresizingMaskIntoConstraints = false avatarImageView.leadingAnchor.constraint(equalTo: self.contentView.leadingAnchor, constant: 15).isActive = true avatarImageView.centerYAnchor.constraint(equalTo: self.contentView.centerYAnchor).isActive = true avatarImageView.widthAnchor.constraint(equalToConstant: 60).isActive = true avatarImageView.heightAnchor.constraint(equalToConstant: 60).isActive = true self.contentView.addSubview(nameLabel) nameLabel.translatesAutoresizingMaskIntoConstraints = false nameLabel.leadingAnchor.constraint(equalTo: avatarImageView.trailingAnchor, constant: 15).isActive = true nameLabel.topAnchor.constraint(equalTo: self.contentView.topAnchor, constant: 14).isActive = true self.contentView.addSubview(subTitleLabel) subTitleLabel.translatesAutoresizingMaskIntoConstraints = false subTitleLabel.leadingAnchor.constraint(equalTo: nameLabel.leadingAnchor).isActive = true subTitleLabel.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor, constant: -17).isActive = true itemHeight = { _ in 80 } } }
{ "pile_set_name": "Github" }
{-# LANGUAGE RecordWildCards #-} module Language.Marlowe.ACTUS.Model.STF.StateTransition where import Data.Time (Day) import Language.Marlowe.ACTUS.Definitions.BusinessEvents (EventType (..), RiskFactors (..)) import Language.Marlowe.ACTUS.Definitions.ContractState (ContractState, ContractStatePoly (ContractStatePoly, fac, feac, ipac, ipcb, ipnr, isc, nsc, nt, prf, prnxt, sd, tmd)) import Data.Maybe (fromJust, fromMaybe) import Language.Marlowe.ACTUS.Definitions.ContractTerms (ContractTerms (..), ContractType (LAM, PAM), ScheduleConfig) import Language.Marlowe.ACTUS.Definitions.Schedule (ShiftedDay (calculationDay)) import Language.Marlowe.ACTUS.Model.SCHED.ContractSchedule (schedule) import Language.Marlowe.ACTUS.Model.STF.StateTransitionModel (_STF_AD_PAM, _STF_CE_PAM, _STF_FP_PAM, _STF_IED_PAM, _STF_IPCI_PAM, _STF_IP_PAM, _STF_MD_PAM, _STF_PP_PAM, _STF_PRD_PAM, _STF_PY_PAM, _STF_RRF_PAM, _STF_RR_PAM, _STF_SC_PAM, _STF_TD_PAM) import Language.Marlowe.ACTUS.Model.Utility.ScheduleGenerator (inf, sup) import Language.Marlowe.ACTUS.Ops (YearFractionOps (_y)) import Language.Marlowe.ACTUS.Model.Utility.DateShift shift :: ScheduleConfig -> Day -> ShiftedDay shift = applyBDCWithCfg stateTransition :: EventType -> RiskFactors -> ContractTerms -> ContractState -> Day -> ContractState stateTransition ev RiskFactors{..} terms@ContractTerms{..} st@ContractStatePoly{..} t = let fpSchedule = schedule FP terms tfp_minus = fromMaybe t $ calculationDay <$> ((\sc -> sup sc t) =<< fpSchedule) tfp_plus = fromMaybe t $ calculationDay <$> ((\sc -> inf sc t) =<< fpSchedule) y_sd_t = _y ct_DCC sd t ct_MD y_tfpminus_t = _y ct_DCC tfp_minus t ct_MD y_tfpminus_tfpplus = _y ct_DCC tfp_minus tfp_plus ct_MD y_ipanx_t = _y ct_DCC (fromJust ct_IPANX) t ct_MD in case contractType of PAM -> case ev of AD -> _STF_AD_PAM st t y_sd_t IED -> _STF_IED_PAM st t y_ipanx_t ct_IPNR ct_IPANX ct_CNTRL ct_IPAC ct_NT MD -> _STF_MD_PAM st t PP -> _STF_PP_PAM st t pp_payoff y_sd_t y_tfpminus_t y_tfpminus_tfpplus ct_FEB ct_FER ct_CNTRL PY -> _STF_PY_PAM st t y_sd_t y_tfpminus_t y_tfpminus_tfpplus ct_FEB ct_FER ct_CNTRL FP -> _STF_FP_PAM st t y_sd_t PRD -> _STF_PRD_PAM st t y_sd_t y_tfpminus_t y_tfpminus_tfpplus ct_FEB ct_FER ct_CNTRL TD -> _STF_TD_PAM st t IP -> _STF_IP_PAM st t y_sd_t y_tfpminus_t y_tfpminus_tfpplus ct_FEB ct_FER ct_CNTRL IPCI -> _STF_IPCI_PAM st t y_sd_t y_tfpminus_t y_tfpminus_tfpplus ct_FEB ct_FER ct_CNTRL RR -> _STF_RR_PAM st t y_sd_t y_tfpminus_t y_tfpminus_tfpplus ct_FEB ct_FER ct_CNTRL ct_RRLF ct_RRLC ct_RRPC ct_RRPF ct_RRMLT ct_RRSP o_rf_RRMO RRF -> _STF_RRF_PAM st t y_sd_t y_tfpminus_t y_tfpminus_tfpplus ct_FEB ct_FER ct_CNTRL ct_RRNXT SC -> _STF_SC_PAM st t y_sd_t y_tfpminus_t y_tfpminus_tfpplus ct_FEB ct_FER ct_CNTRL ct_SCEF o_rf_SCMO ct_SCIED CE -> _STF_CE_PAM st t y_sd_t _ -> st LAM -> undefined
{ "pile_set_name": "Github" }
# numpy helper will be created separated first
{ "pile_set_name": "Github" }
{ "type": "minecraft:block", "pools": [ { "rolls": 1, "entries": [ { "type": "minecraft:item", "functions": [ { "function": "minecraft:set_count", "conditions": [ { "condition": "minecraft:block_state_property", "block": "quark:gray_shingles_vertical_slab", "properties": { "type": "double" } } ], "count": 2 }, { "function": "minecraft:explosion_decay" } ], "name": "quark:gray_shingles_vertical_slab" } ] } ] }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="maps_api_key"></string> <string name="dialog_play_services_unavailable">Google Play Services are unavailable.</string> <string name="dialog_download_play_services">Download Play Services</string> <string name="dialog_close_program">Close Program</string> <string name="app_name">GoogleMaps</string> <string name="action_add_location">Add Location</string> </resources>
{ "pile_set_name": "Github" }
// // ViewController.h // YWChooseAddress // // Created by Candy on 2018/1/2. // Copyright © 2018年 com.zhiweism. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
{ "pile_set_name": "Github" }
#include <stdio.h> #include <math.h> #include <omp.h> #include <windows.h> LARGE_INTEGER m_liPerfFreq; LARGE_INTEGER m_liPerfStart; LARGE_INTEGER liPerfNow; double dfTim; void getStartTime() { QueryPerformanceFrequency(&m_liPerfFreq); QueryPerformanceCounter(&m_liPerfStart); } void getEndTime() { QueryPerformanceCounter(&liPerfNow); dfTim=( ((liPerfNow.QuadPart - m_liPerfStart.QuadPart) * 1000.0f)/m_liPerfFreq.QuadPart); } void test() { static long num_steps = 1000000; double step, pi; double x, sum=0.0; int i=0; step = 1.0/(double)num_steps; getStartTime(); //#pragma omp parallel for private(x) reduction(+:sum) for (i=0; i<num_steps; i++) { x = (i+0.5)*step; sum += 4.0/(1.0+x*x); //printf("%f,%d\n",omp_get_thread_num()); } getEndTime(); printf("%f\n",dfTim); pi = step * sum; printf ("pi=%f\n",pi); }
{ "pile_set_name": "Github" }
package ceylon.language.meta; import static com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.getAppliedMetamodel; import static com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.getTypeDescriptor; import ceylon.language.Sequential; import ceylon.language.meta.model.ClassModel; import com.redhat.ceylon.compiler.java.metadata.Ceylon; import com.redhat.ceylon.compiler.java.metadata.Ignore; import com.redhat.ceylon.compiler.java.metadata.Method; import com.redhat.ceylon.compiler.java.metadata.Name; import com.redhat.ceylon.compiler.java.metadata.TypeInfo; import com.redhat.ceylon.compiler.java.metadata.TypeParameter; import com.redhat.ceylon.compiler.java.metadata.TypeParameters; import com.redhat.ceylon.compiler.java.metadata.Variance; import com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor; @Ceylon(major = 8) @Method public final class type_ { private type_() {} @SuppressWarnings("unchecked") @TypeInfo("ceylon.language.meta.model::ClassModel<Type,ceylon.language::Nothing>") @TypeParameters(@TypeParameter(value = "Type", variance = Variance.OUT, satisfies = "ceylon.language::Anything")) public static <Type> ClassModel<? extends Type, ? super Sequential<? extends Object>> type(@Ignore TypeDescriptor $reifiedType, @Name("instance") @TypeInfo("Type") Type instance) { return (ClassModel<? extends Type, ? super Sequential<? extends Object>>) getAppliedMetamodel(getTypeDescriptor(instance)); } }
{ "pile_set_name": "Github" }
webimage: config.yaml
{ "pile_set_name": "Github" }
/* eslint-env node, mocha */ 'use strict' const assert = require('assert') const mock = require('mock-require') const sinon = require('sinon') const { makeMockSocket, removeModuleFromRequireCache } = require('./utils') describe('realtime#socket event', function () { const noteId = 'note123' const note = { id: noteId, authors: [ { userId: 'user1', color: 'red', user: { id: 'user1', name: 'Alice' } }, { userId: 'user2', color: 'blue', user: { id: 'user2', name: 'Bob' } } ] } let realtime let clientSocket let modelsMock let eventFuncMap let configMock let clock beforeEach(function (done) { clock = sinon.useFakeTimers({ toFake: ['setInterval'] }) eventFuncMap = new Map() modelsMock = { Note: { parseNoteTitle: (data) => (data), destroy: sinon.stub().returns(Promise.resolve(1)), update: sinon.stub().returns(Promise.resolve([1])), findOne: sinon.stub().returns(Promise.resolve(note)) }, User: {} } modelsMock.User.getProfile = sinon.stub().callsFake((user) => { return user }) configMock = { fullversion: '1.5.0', minimumCompatibleVersion: '1.0.0', permission: { freely: 'freely', editable: 'editable', limited: 'limited', locked: 'locked', protected: 'protected', private: 'private' } } mock('../../lib/logger', { error: () => { }, info: () => { } }) mock('../../lib/history', {}) mock('../../lib/models', modelsMock) mock('../../lib/config', configMock) mock('../../lib/ot', require('../testDoubles/otFake')) realtime = require('../../lib/realtime/realtime') // get all socket event handler clientSocket = makeMockSocket(null, { noteId: noteId }) clientSocket.request.user.logged_in = true clientSocket.request.user.id = 'user1' // clientSocket.noteId = noteId clientSocket.on = function (event, func) { eventFuncMap.set(event, func) } realtime.maintenance = false realtime.io = (function () { const roomMap = new Map() return { to: function (roomId) { if (!roomMap.has(roomId)) { roomMap.set(roomId, { emit: sinon.stub() }) } return roomMap.get(roomId) } } }()) const wrappedFuncs = [] wrappedFuncs.push(sinon.stub(realtime, 'updateUserData')) wrappedFuncs.push(sinon.stub(realtime, 'emitOnlineUsers')) wrappedFuncs.push(sinon.stub(realtime, 'parseNoteIdFromSocketAsync').returns(Promise.resolve(noteId))) wrappedFuncs.push(sinon.stub(realtime, 'updateHistory')) wrappedFuncs.push(sinon.stub(realtime, 'emitRefresh')) realtime.connection(clientSocket) setTimeout(() => { wrappedFuncs.forEach((wrappedFunc) => { wrappedFunc.restore() }) done() }, 50) }) afterEach(function () { removeModuleFromRequireCache('../../lib/realtime/realtime') removeModuleFromRequireCache('../../lib/realtime/realtimeClientConnection') mock.stopAll() sinon.restore() clock.restore() clientSocket = null }) describe('refresh', function () { it('should call refresh', () => { const refreshFunc = eventFuncMap.get('refresh') const emitRefreshStub = sinon.stub(realtime, 'emitRefresh') refreshFunc() assert(emitRefreshStub.calledOnce) assert.deepStrictEqual(emitRefreshStub.lastCall.args[0], clientSocket) }) }) describe('user status', function () { it('should call emitUserStatus and update user data', () => { const userStatusFunc = eventFuncMap.get('user status') const emitUserStatusStub = sinon.stub(realtime, 'emitUserStatus') realtime.notes[noteId] = {} const userData = { idle: true, type: 'xs' } userStatusFunc(userData) assert(emitUserStatusStub.calledOnce) assert.deepStrictEqual(emitUserStatusStub.lastCall.args[0], clientSocket) assert(realtime.users[clientSocket.id].idle === true) assert(realtime.users[clientSocket.id].type === 'xs') }) it('should call emitUserStatus without userdata', () => { const userStatusFunc = eventFuncMap.get('user status') const emitUserStatusStub = sinon.stub(realtime, 'emitUserStatus') realtime.notes[noteId] = {} userStatusFunc() assert(emitUserStatusStub.calledOnce) assert.deepStrictEqual(emitUserStatusStub.lastCall.args[0], clientSocket) assert(realtime.users[clientSocket.id].idle === false) assert(realtime.users[clientSocket.id].type === null) }) it('should not call emitUserStatus when user not exists', () => { const userStatusFunc = eventFuncMap.get('user status') const emitUserStatusStub = sinon.stub(realtime, 'emitUserStatus') realtime.notes[noteId] = {} delete realtime.users[clientSocket.id] const userData = { idle: true, type: 'xs' } userStatusFunc(userData) assert(emitUserStatusStub.called === false) }) it('should not call emitUserStatus when note not exists', () => { const userStatusFunc = eventFuncMap.get('user status') const emitUserStatusStub = sinon.stub(realtime, 'emitUserStatus') realtime.deleteAllNoteFromPool() realtime.users[clientSocket.id] = {} const userData = { idle: true, type: 'xs' } userStatusFunc(userData) assert(emitUserStatusStub.called === false) }) }) describe('disconnect', function () { it('should push socket to disconnect queue and call disconnect function', () => { const disconnectFunc = eventFuncMap.get('disconnect') const queueForDisconnectStub = sinon.stub(realtime, 'queueForDisconnect') disconnectFunc() assert(queueForDisconnectStub.calledOnce) }) it('should quick return when socket is in disconnect queue', () => { const disconnectFunc = eventFuncMap.get('disconnect') const queueForDisconnectStub = sinon.stub(realtime, 'queueForDisconnect') realtime.disconnectProcessQueue.push(clientSocket.id, async () => {}) disconnectFunc() assert(queueForDisconnectStub.called === false) }) }) ;['cursor focus', 'cursor activity', 'cursor blur'].forEach((event) => { describe(event, function () { let cursorFocusFunc const cursorData = { cursor: 10 } beforeEach(() => { cursorFocusFunc = eventFuncMap.get(event) realtime.notes[noteId] = {} }) it('should broadcast to all client', () => { cursorFocusFunc(cursorData) const broadChannelEmitFake = clientSocket.broadcast.to(noteId).emit assert(broadChannelEmitFake.calledOnce) assert(broadChannelEmitFake.lastCall.args[0] === event) if (event === 'cursor blur') { assert(broadChannelEmitFake.lastCall.args[1].id === clientSocket.id) } else { assert.deepStrictEqual(broadChannelEmitFake.lastCall.args[1].cursor, cursorData) } }) it('should not broadcast when note not exists', () => { delete realtime.notes[noteId] cursorFocusFunc(cursorData) const broadChannelEmitFake = clientSocket.broadcast.to(noteId).emit assert(broadChannelEmitFake.called === false) }) it('should not broadcast when user not exists', () => { delete realtime.users[clientSocket.id] cursorFocusFunc(cursorData) const broadChannelEmitFake = clientSocket.broadcast.to(noteId).emit assert(broadChannelEmitFake.called === false) }) }) }) describe('version', function () { it('should emit server version ', () => { const versionFunc = eventFuncMap.get('version') versionFunc() assert(clientSocket.emit.called) assert(clientSocket.emit.lastCall.args[0], 'version') assert.deepStrictEqual(clientSocket.emit.lastCall.args[1], { version: '1.5.0', minimumCompatibleVersion: '1.0.0' }) }) }) describe('online users', function () { it('should return online user list', function () { const onlineUsersFunc = eventFuncMap.get('online users') realtime.notes[noteId] = { users: { 10: { id: 10 }, 20: { id: 20 } } } onlineUsersFunc() assert(clientSocket.emit.called) assert(clientSocket.emit.lastCall.args[0] === 'online users') const returnUserList = clientSocket.emit.lastCall.args[1].users assert(returnUserList.length === 2) assert(returnUserList[0].id === 10) assert(returnUserList[1].id === 20) }) it('should not return user list when note not exists', function () { const onlineUsersFunc = eventFuncMap.get('online users') realtime.deleteAllNoteFromPool() onlineUsersFunc() assert(clientSocket.emit.called === false) }) }) describe('user changed', function () { it('should call updateUserData', () => { const userChangedFunc = eventFuncMap.get('user changed') realtime.notes[noteId] = { users: { [clientSocket.id]: {} } } const updateUserDataStub = sinon.stub(realtime, 'updateUserData') const emitOnlineUsersStub = sinon.stub(realtime, 'emitOnlineUsers') userChangedFunc() assert(updateUserDataStub.calledOnce) assert(emitOnlineUsersStub.calledOnce) }) it('should direct return when note not exists', function () { const userChangedFunc = eventFuncMap.get('user changed') const updateUserDataStub = sinon.stub(realtime, 'updateUserData') const emitOnlineUsersStub = sinon.stub(realtime, 'emitOnlineUsers') realtime.deleteAllNoteFromPool() userChangedFunc() assert(updateUserDataStub.called === false) assert(emitOnlineUsersStub.called === false) }) it('should direct return when note\'s users not exists', function () { const userChangedFunc = eventFuncMap.get('user changed') realtime.notes[noteId] = { users: {} } delete realtime.users[clientSocket.id] const updateUserDataStub = sinon.stub(realtime, 'updateUserData') const emitOnlineUsersStub = sinon.stub(realtime, 'emitOnlineUsers') userChangedFunc() assert(updateUserDataStub.called === false) assert(emitOnlineUsersStub.called === false) }) }) describe('delete', function () { it('should delete note when owner request', function (done) { const currentUserId = 'user1_id' const noteOwnerId = 'user1_id' const otherClient = makeMockSocket() clientSocket.request = { user: { logged_in: true, id: currentUserId } } realtime.notes[noteId] = { owner: noteOwnerId, socks: [clientSocket, undefined, otherClient] } const deleteFunc = eventFuncMap.get('delete') deleteFunc() setTimeout(() => { assert(otherClient.disconnect.calledOnce) assert(otherClient.emit.calledOnce) assert(otherClient.emit.lastCall.args[0] === 'delete') assert(clientSocket.disconnect.calledOnce) assert(clientSocket.emit.calledOnce) assert(clientSocket.emit.lastCall.args[0] === 'delete') assert(modelsMock.Note.destroy.calledOnce) done() }, 10) }) it('should not do anything when user not login', function (done) { const noteOwnerId = 'user1_id' clientSocket.request = {} realtime.notes[noteId] = { owner: noteOwnerId, socks: [clientSocket] } const deleteFunc = eventFuncMap.get('delete') deleteFunc() setTimeout(() => { assert(modelsMock.Note.destroy.called === false) assert(clientSocket.disconnect.called === false) done() }, 10) }) it('should not do anything when note not exists', function (done) { const currentUserId = 'user1_id' clientSocket.request = { user: { logged_in: true, id: currentUserId } } const deleteFunc = eventFuncMap.get('delete') deleteFunc() setTimeout(() => { assert(modelsMock.Note.destroy.called === false) assert(clientSocket.disconnect.called === false) done() }, 10) }) it('should not do anything when note owner is not me', function (done) { const currentUserId = 'user1_id' const noteOwnerId = 'user2_id' const otherClient = makeMockSocket() clientSocket.request = { user: { logged_in: true, id: currentUserId } } realtime.notes[noteId] = { owner: noteOwnerId, socks: [clientSocket, otherClient] } const deleteFunc = eventFuncMap.get('delete') deleteFunc() setTimeout(() => { assert(clientSocket.disconnect.called === false) assert(modelsMock.Note.destroy.called === false) done() }, 10) }) it('should not do anything when note destroy fail', function (done) { const currentUserId = 'user1_id' const noteOwnerId = 'user1_id' modelsMock.Note.destroy.withArgs({ where: { id: noteId } }).returns(Promise.resolve(0)) const otherClient = makeMockSocket() clientSocket.request = { user: { logged_in: true, id: currentUserId } } realtime.notes[noteId] = { id: noteId, owner: noteOwnerId, socks: [clientSocket, otherClient] } const deleteFunc = eventFuncMap.get('delete') deleteFunc() setTimeout(() => { assert(modelsMock.Note.destroy.calledOnce) assert(clientSocket.disconnect.called === false) done() }, 10) }) }) describe('permission', function () { const ownerId = 'user1_id' const otherSignInUserId = 'user2_id' let otherClient let checkViewPermissionSpy let permissionFunc beforeEach(function () { otherClient = makeMockSocket() clientSocket.request = { user: { id: ownerId, logged_in: true } } otherClient.request = { user: { id: otherSignInUserId, logged_in: true } } realtime.deleteAllNoteFromPool() realtime.addNote({ id: noteId, owner: ownerId }) checkViewPermissionSpy = sinon.spy(realtime, 'checkViewPermission') permissionFunc = eventFuncMap.get('permission') }) it('should disconnect when lose view permission', function (done) { realtime.getNoteFromNotePool(noteId).permission = 'editable' realtime.getNoteFromNotePool(noteId).socks = [clientSocket, undefined, otherClient] permissionFunc('private') setTimeout(() => { // should change note permission to private assert(modelsMock.Note.update.calledOnce) assert(modelsMock.Note.update.lastCall.args[0].permission === 'private') assert(modelsMock.Note.update.lastCall.args[1].where.id === noteId) // should check all connected client assert(checkViewPermissionSpy.callCount === 2) assert(otherClient.emit.calledOnce) assert(otherClient.disconnect.calledOnce) done() }, 5) }) it('should not do anything when user not logged in', function (done) { clientSocket.request = {} permissionFunc('private') setTimeout(() => { assert(modelsMock.Note.update.called === false) done() }, 5) }) it('should not do anything when note not exists', function (done) { delete realtime.notes[noteId] permissionFunc('private') setTimeout(() => { assert(modelsMock.Note.update.called === false) done() }, 5) }) it('should not do anything when not note owner', function (done) { clientSocket.request.user.id = 'other_user_id' permissionFunc('private') setTimeout(() => { assert(modelsMock.Note.update.called === false) done() }, 5) }) it('should change permission to freely when config allowAnonymous, allowAnonymousEdits and allowAnonymousViews are true', function (done) { configMock.allowAnonymous = true configMock.allowAnonymousEdits = true configMock.allowAnonymousViews = true realtime.notes[noteId].socks = [clientSocket, undefined, otherClient] permissionFunc('freely') setTimeout(() => { assert(checkViewPermissionSpy.callCount === 2) assert(otherClient.emit.called === false) assert(otherClient.disconnect.called === false) assert(clientSocket.emit.called === false) assert(clientSocket.disconnect.called === false) done() }, 5) }) it('should not change permission to freely when config allowAnonymous, allowAnonymousEdits and allowAnonymousViews are false', function (done) { configMock.allowAnonymous = false configMock.allowAnonymousEdits = false configMock.allowAnonymousViews = false realtime.notes[noteId].socks = [clientSocket, undefined, otherClient] permissionFunc('freely') setTimeout(() => { assert(modelsMock.Note.update.called === false) assert(checkViewPermissionSpy.called === false) done() }, 5) }) it('should change permission to freely when config allowAnonymous is true', function (done) { configMock.allowAnonymous = true configMock.allowAnonymousEdits = false configMock.allowAnonymousViews = false realtime.notes[noteId].socks = [clientSocket, undefined, otherClient] permissionFunc('freely') setTimeout(() => { assert(checkViewPermissionSpy.callCount === 2) assert(otherClient.emit.called === false) assert(otherClient.disconnect.called === false) assert(clientSocket.emit.called === false) assert(clientSocket.disconnect.called === false) done() }, 5) }) it('should not change permission to freely when config allowAnonymousEdits is true', function (done) { configMock.allowAnonymous = false configMock.allowAnonymousEdits = true configMock.allowAnonymousViews = false realtime.notes[noteId].socks = [clientSocket, undefined, otherClient] permissionFunc('freely') setTimeout(() => { assert(modelsMock.Note.update.called === false) assert(checkViewPermissionSpy.called === false) done() }, 5) }) it('should not change permission to freely when config allowAnonymousViews is true', function (done) { configMock.allowAnonymous = false configMock.allowAnonymousEdits = false configMock.allowAnonymousViews = true realtime.notes[noteId].socks = [clientSocket, undefined, otherClient] permissionFunc('freely') setTimeout(() => { assert(modelsMock.Note.update.called === false) assert(checkViewPermissionSpy.called === false) done() }, 5) }) it('should change permission to editable when config allowAnonymousViews is true', function (done) { configMock.allowAnonymous = false configMock.allowAnonymousEdits = false configMock.allowAnonymousViews = true realtime.notes[noteId].socks = [clientSocket, undefined, otherClient] permissionFunc('editable') setTimeout(() => { assert(checkViewPermissionSpy.callCount === 2) assert(otherClient.emit.called === false) assert(otherClient.disconnect.called === false) assert(clientSocket.emit.called === false) assert(clientSocket.disconnect.called === false) done() }, 5) }) it('should change permission to freely when config allowAnonymousEdits and allowAnonymousViews are false true', function (done) { configMock.allowAnonymous = false configMock.allowAnonymousEdits = true configMock.allowAnonymousViews = true realtime.notes[noteId].socks = [clientSocket, undefined, otherClient] permissionFunc('freely') setTimeout(() => { assert(checkViewPermissionSpy.callCount === 2) assert(otherClient.emit.called === false) assert(otherClient.disconnect.called === false) assert(clientSocket.emit.called === false) assert(clientSocket.disconnect.called === false) done() }, 5) }) it('should change permission to editable when config allowAnonymousEdits and allowAnonymousViews are false true', function (done) { configMock.allowAnonymous = false configMock.allowAnonymousEdits = true configMock.allowAnonymousViews = true realtime.notes[noteId].socks = [clientSocket, undefined, otherClient] permissionFunc('editable') setTimeout(() => { assert(checkViewPermissionSpy.callCount === 2) assert(otherClient.emit.called === false) assert(otherClient.disconnect.called === false) assert(clientSocket.emit.called === false) assert(clientSocket.disconnect.called === false) done() }, 5) }) }) })
{ "pile_set_name": "Github" }
<a id="addToDeploymentPlanBulkActions" class="dropdown-item" data-title="@T["Bulk Action"]" data-message="@T["Are you sure you want to add these items to a deployment plan?"]">@T["Add to deployment plan"]</a> <script at="Foot" depends-on="jQuery"> $(function () { $('#addToDeploymentPlanBulkActions').on('click', function () { if ($(":checkbox[name='itemIds']:checked").length > 1) { var $this = $(this); confirmDialog({ ...$this.data(), callback: function (r) { if (r) { $('#modalAddToDeploymentPlanContentsBulkActionsDeploymentPlan').modal('show'); } } }); } }); }); </script>
{ "pile_set_name": "Github" }
/* * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package jdk.nashorn.internal.ir; import jdk.nashorn.internal.codegen.types.Type; /** * Class describing one or more local variable conversions that needs to be performed on entry to a control flow join * point. Note that the class is named as a singular "Conversion" and not a plural "Conversions", but instances of the * class have a reference to the next conversion, so multiple conversions are always represented with a single instance * that is a head of a linked list of instances. * @see JoinPredecessor */ public final class LocalVariableConversion { private final Symbol symbol; // TODO: maybe introduce a type pair class? These will often be repeated. private final Type from; private final Type to; private final LocalVariableConversion next; /** * Creates a new object representing a local variable conversion. * @param symbol the symbol representing the local variable whose value is being converted. * @param from the type value is being converted from. * @param to the type value is being converted to. * @param next next conversion at the same join point, if any (the conversion object implements a singly-linked * list of conversions). */ public LocalVariableConversion(final Symbol symbol, final Type from, final Type to, final LocalVariableConversion next) { this.symbol = symbol; this.from = from; this.to = to; this.next = next; } /** * Returns the type being converted from. * @return the type being converted from. */ public Type getFrom() { return from; } /** * Returns the type being converted to. * @return the type being converted to. */ public Type getTo() { return to; } /** * Returns the next conversion at the same join point, or null if this is the last one. * @return the next conversion at the same join point. */ public LocalVariableConversion getNext() { return next; } /** * Returns the symbol representing the local variable whose value is being converted. * @return the symbol representing the local variable whose value is being converted. */ public Symbol getSymbol() { return symbol; } /** * Returns true if this conversion is live. A conversion is live if the symbol has a slot for the conversion's * {@link #getTo() to} type. If a conversion is dead, it can be omitted in code generator. * @return true if this conversion is live. */ public boolean isLive() { return symbol.hasSlotFor(to); } /** * Returns true if this conversion {@link #isLive()}, or if any of its {@link #getNext()} conversions are live. * @return true if this conversion, or any conversion following it, are live. */ public boolean isAnyLive() { return isLive() || isAnyLive(next); } /** * Returns true if the passed join predecessor has {@link #isAnyLive()} conversion. * @param jp the join predecessor being examined. * @return true if the join predecessor conversion is not null and {@link #isAnyLive()}. */ public static boolean hasLiveConversion(final JoinPredecessor jp) { return isAnyLive(jp.getLocalVariableConversion()); } /** * Returns true if the passed conversion is not null, and it {@link #isAnyLive()}. * @parameter conv the conversion being tested for liveness. * @return true if the conversion is not null and {@link #isAnyLive()}. */ private static boolean isAnyLive(final LocalVariableConversion conv) { return conv != null && conv.isAnyLive(); } @Override public String toString() { return toString(new StringBuilder()).toString(); } /** * Generates a string representation of this conversion in the passed string builder. * @param sb the string builder in which to generate a string representation of this conversion. * @return the passed in string builder. */ public StringBuilder toString(final StringBuilder sb) { if(isLive()) { return toStringNext(sb.append('\u27e6'), true).append("\u27e7 "); } return next == null ? sb : next.toString(sb); } /** * Generates a string representation of the passed conversion in the passed string builder. * @param conv the conversion to render in the string builder. * @param sb the string builder in which to generate a string representation of this conversion. * @return the passed in string builder. */ public static StringBuilder toString(final LocalVariableConversion conv, final StringBuilder sb) { return conv == null ? sb : conv.toString(sb); } private StringBuilder toStringNext(final StringBuilder sb, final boolean first) { if(isLive()) { if(!first) { sb.append(", "); } sb.append(symbol.getName()).append(':').append(getTypeChar(from)).append('\u2192').append(getTypeChar(to)); return next == null ? sb : next.toStringNext(sb, false); } return next == null ? sb : next.toStringNext(sb, first); } private static char getTypeChar(final Type type) { if(type == Type.UNDEFINED) { return 'U'; } else if(type.isObject()) { return 'O'; } else if(type == Type.BOOLEAN) { return 'Z'; } return type.getBytecodeStackType(); } }
{ "pile_set_name": "Github" }
#!/usr/bin/env node require('../global'); echo('Appending docs to README.md'); cd(__dirname + '/..'); // Extract docs from shell.js var docs = grep('//@', 'shell.js'); docs = docs.replace(/\/\/\@include (.+)/g, function(match, path) { var file = path.match('.js$') ? path : path+'.js'; return grep('//@', file); }); // Remove '//@' docs = docs.replace(/\/\/\@ ?/g, ''); // Append docs to README sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md'); echo('All done.');
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 6b510f5e452db374babed0bb85d2b789 folderAsset: yes timeCreated: 1493758483 licenseType: Free DefaultImporter: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.index.mapper; import org.elasticsearch.plugins.MapperPlugin; import org.elasticsearch.plugins.Plugin; import java.util.function.Function; import java.util.function.Predicate; public class MockFieldFilterPlugin extends Plugin implements MapperPlugin { @Override public Function<String, Predicate<String>> getFieldFilter() { //this filter doesn't filter any field out, but it's used to exercise the code path executed when the filter is not no-op return index -> field -> true; } }
{ "pile_set_name": "Github" }
/* ************************************************************* The "Preferences" window ************************************************************* */ const electron = require('electron') const ipc = electron.ipcRenderer const jQuery = require('./vendor/jquery-3.1.0.js') const $ = jQuery ipc.on('window-ready', (event, prefs) => { // show current preferences $('#stackPath').val(prefs.stackPath) let save = () => { ipc.send('save-preferences', { stackPath: $('#stackPath').val() }) } // save preferences on enter $('form').submit( (event) => { save() event.preventDefault() }) // save on close as well window.onbeforeunload = save })
{ "pile_set_name": "Github" }
# coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors. # # 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. """Dataset catalog documentation template. Displayed in https://www.tensorflow.org/datasets/catalog/. """ import abc import textwrap from typing import List, Union import tensorflow_datasets as tfds Key = Union[int, str] class Block(str): """Indicates whether the content should be blocked (vs inlined). Inlined content: ``` * Section: <inlined> ``` Block content: ``` * Section: <block> ``` """ pass class IntentedBlock(Block): """Intented block. By default, blocks are stripped to correctly remove extra end-line & cie. Intented block will keep the returned formatting. """ # Token used to indicate the section shouldn't be displayed _SKIP_SECTION = object() class Section(abc.ABC): """Abstract class for a documentation Section (description, homepage, ...).""" NAME: str EXTRA_DOC: str = '' @abc.abstractmethod def get_key(self, builder: tfds.core.DatasetBuilder) -> Key: """Get the key of the section. The key is used to merge similar sections across builder configs. For instance, https://www.tensorflow.org/datasets/catalog/wiki40b only display once the `FeatureDict`, homepage,... as those sections are the same for all configs. Args: builder: The builder to document. Returns: key: The section key. """ pass @abc.abstractmethod def content(self, builder: tfds.core.DatasetBuilder) -> str: """Returns the section content.""" pass def display(self, builder: tfds.core.DatasetBuilder) -> str: """Returns the section content.""" content = self.content(builder) if content is _SKIP_SECTION: return '' header = f'* **{self.NAME}**{self.EXTRA_DOC}' is_block = isinstance(content, Block) if not isinstance(content, IntentedBlock): content = content.strip() # Note: `strip()` cast `Block` -> `str` if is_block: return f'{header}:\n\n{content}\n\n' else: return f'{header}: {content}\n\n' # --------------------------- Builder sections --------------------------- # pylint:disable = missing-class-docstring class HomepageSection(Section): NAME = 'Homepage' def get_key(self, builder): return builder.info.homepage def content(self, builder): homepage = builder.info.homepage return f'[{homepage}]({homepage})' class DatasetDescriptionSection(Section): NAME = 'Description' def get_key(self, builder): return builder.info.description def content(self, builder): return Block(builder.info.description) class ConfigDescriptionSection(Section): NAME = 'Config description' def get_key(self, builder): return builder.builder_config.description def content(self, builder): if not builder.builder_config: return _SKIP_SECTION return builder.builder_config.description class SourceCodeSection(Section): NAME = 'Source code' def get_key(self, _): return True # Always common to all configs def content(self, builder): class_path = tfds.core.utils.get_class_path(builder).split('.') del class_path[-2] class_path = '.'.join(class_path) class_url = tfds.core.utils.get_class_url(builder) return f'[`{class_path}`]({class_url})' class VersionSection(Section): NAME = 'Versions' def __init__(self, nightly_doc_util): self._nightly_doc_util = nightly_doc_util def _list_versions(self, builder): """List versions.""" for v in builder.versions: # List all available versions (in default order) if v == builder.version: # Highlight the default version version_name = '**`{}`** (default)'.format(str(v)) else: version_name = '`{}`'.format(str(v)) if self._nightly_doc_util.is_version_nightly(builder, str(v)): nightly_str = ' ' + self._nightly_doc_util.icon else: nightly_str = '' yield ' * {}{}: {}'.format( version_name, nightly_str, v.description or 'No release notes.' ) def get_key(self, builder): return tuple((str(v), v.description) for v in builder.versions) def content(self, builder): return IntentedBlock('\n'.join(self._list_versions(builder))) class DownloadSizeSection(Section): NAME = 'Download size' def get_key(self, builder): return builder.info.download_size def content(self, builder): return f'`{tfds.units.size_str(builder.info.download_size)}`' class DatasetSizeSection(Section): NAME = 'Dataset size' def get_key(self, builder): return builder.info.dataset_size def content(self, builder): return f'`{tfds.units.size_str(builder.info.dataset_size)}`' class ManualDatasetSection(Section): NAME = 'Manual download instructions' def get_key(self, builder): return builder.MANUAL_DOWNLOAD_INSTRUCTIONS def content(self, builder): manual_instructions = builder.MANUAL_DOWNLOAD_INSTRUCTIONS if not manual_instructions: return _SKIP_SECTION return textwrap.dedent( f""" This dataset requires you to download the source data manually into `download_config.manual_dir` (defaults to `~/tensorflow_datasets/downloads/manual/`):<br/> {tfds.core.utils.indent(manual_instructions, ' ')} """ ) class AutocacheSection(Section): NAME = 'Auto-cached' EXTRA_DOC = ( ' ([documentation]' '(https://www.tensorflow.org/datasets/performances#auto-caching))' ) def _build_autocached_info(self, builder): """Returns the auto-cache information string.""" always_cached = {} never_cached = {} unshuffle_cached = {} for split_name in sorted(builder.info.splits.keys()): split_name = str(split_name) cache_shuffled = builder._should_cache_ds( # pylint: disable=protected-access split_name, shuffle_files=True, read_config=tfds.ReadConfig()) cache_unshuffled = builder._should_cache_ds( # pylint: disable=protected-access split_name, shuffle_files=False, read_config=tfds.ReadConfig()) if all((cache_shuffled, cache_unshuffled)): always_cached[split_name] = None elif not any((cache_shuffled, cache_unshuffled)): never_cached[split_name] = None else: # Dataset is only cached when shuffled_files is False assert not cache_shuffled and cache_unshuffled unshuffle_cached[split_name] = None if not len(builder.info.splits) or not builder.info.dataset_size: # pylint: disable=g-explicit-length-test autocached_info = 'Unknown' elif len(always_cached) == len(builder.info.splits.keys()): autocached_info = 'Yes' # All splits are auto-cached. elif len(never_cached) == len(builder.info.splits.keys()): autocached_info = 'No' # Splits never auto-cached. else: # Some splits cached, some not. autocached_info_parts = [] if always_cached: split_names_str = ', '.join(always_cached) autocached_info_parts.append('Yes ({})'.format(split_names_str)) if never_cached: split_names_str = ', '.join(never_cached) autocached_info_parts.append('No ({})'.format(split_names_str)) if unshuffle_cached: split_names_str = ', '.join(unshuffle_cached) autocached_info_parts.append( 'Only when `shuffle_files=False` ({})'.format(split_names_str)) autocached_info = ', '.join(autocached_info_parts) return autocached_info def get_key(self, builder): return self._build_autocached_info(builder) def content(self, builder): return self._build_autocached_info(builder) class SplitInfoSection(Section): NAME = 'Splits' def _get_num_examples(self, split_info): if split_info.num_examples: return '{:,}'.format(split_info.num_examples) return 'Not computed' def get_key(self, builder): return tuple( (str(s.name), int(s.num_examples)) for s in builder.info.splits.values() ) def content(self, builder): splits_str = ('\n').join([ f'`\'{split_name}\'` | {self._get_num_examples(split_info)}' for split_name, split_info in sorted(builder.info.splits.items()) ]) return Block( textwrap.dedent( f""" Split | Examples :----- | -------: {tfds.core.utils.indent(splits_str, ' ')} """ ) ) class FeatureInfoSection(Section): NAME = 'Features' def get_key(self, builder): return repr(builder.info.features) def content(self, builder): code = textwrap.dedent( """ ```python {} ``` """ ).format(builder.info.features) return Block(code) class SupervisedKeySection(Section): NAME = 'Supervised keys' EXTRA_DOC = ( ' (See [`as_supervised` doc]' '(https://www.tensorflow.org/datasets/api_docs/python/tfds/load#args))' ) def get_key(self, builder): return builder.info.supervised_keys def content(self, builder): return f'`{str(builder.info.supervised_keys)}`' class DatasetCitationSection(Section): NAME = 'Citation' def get_key(self, builder): return builder.info.citation def content(self, builder): if not builder.info.citation: return '' return Block( textwrap.dedent( f""" ``` {tfds.core.utils.indent(builder.info.citation, ' ')} ``` """ ) ) class DatasetVisualizationSection(Section): NAME = 'Visualization' EXTRA_DOC = ( ' ([tfds.show_examples](https://www.tensorflow.org/datasets/api_docs/python/tfds/visualization/show_examples))' ) def __init__(self, visualization_util): self._visualization_util = visualization_util def get_key(self, builder): if self._visualization_util.has_visualization(builder): return builder.info.full_name return None # Fuse the sections together if no configs are available def content(self, builder): if not self._visualization_util.has_visualization(builder): return 'Not supported.' return Block(self._visualization_util.get_html_tag(builder)) # pylint:enable = missing-class-docstring # --------------------------- Single builder --------------------------- def _display_builder( builder: tfds.core.DatasetBuilder, sections: List[Section], ) -> str: """Display a single Builder / BuilderConfig.""" # Note: Section may be a subset of the section to display return ''.join(section.display(builder) for section in sections) # --------------------------- Builder configs --------------------------- def _display_all_builders( nightly_doc_util, builders: List[tfds.core.DatasetBuilder], all_sections: List[Section], ) -> str: """Display all sections for all Builder.""" # For each fields, extract if the field is shared or unique accross builder. common_sections = [] unique_sections = [] for section in all_sections: if len(set(section.get_key(b) for b in builders)) == 1: common_sections.append(section) else: unique_sections.append(section) common_builder_str = _display_builder(next(iter(builders)), common_sections) unique_builder_str = [] for i, builder in enumerate(builders): header_suffix = ' (default config)' if i == 0 else '' nightly_str = (' ' + nightly_doc_util.icon) \ if nightly_doc_util.is_config_nightly(builder) else '' unique_builder_str.append( f'## {builder.name}/{builder.builder_config.name}' f'{header_suffix}{nightly_str}\n') unique_builder_str.append(_display_builder(builder, unique_sections)) unique_builder_str = '\n'.join(unique_builder_str) return common_builder_str + '\n' + unique_builder_str # --------------------------- Main page --------------------------- def _display_dataset_heading(builder): return f'# `{builder.name}`' def _display_nightly_str(nightly_doc_util, builder): """Header nightly note section.""" if nightly_doc_util.is_builder_nightly(builder): return f"""\ Note: This dataset was added recently and is only available in our `tfds-nightly` package {nightly_doc_util.icon}. """ elif nightly_doc_util.has_nightly(builder): return f"""\ Note: This dataset has been updated since the last stable release. The new versions and config marked with {nightly_doc_util.icon} are only available in the `tfds-nightly` package. """ else: return '' def _display_manual_instructions(builder): """Header manual note section.""" if builder.MANUAL_DOWNLOAD_INSTRUCTIONS: return 'Warning: Manual download required. See instructions below.' return '' def _display_builder_configs( builder: tfds.core.DatasetBuilder, nightly_doc_util, config_builders: List[tfds.core.DatasetBuilder], all_sections: List[Section], ) -> str: """Builder configs.""" # First case: Single builder if not builder.builder_config: return _display_builder(builder, all_sections) # Second case: Builder configs return _display_all_builders(nightly_doc_util, config_builders, all_sections) def get_markdown_string( builder: tfds.core.DatasetBuilder, config_builders: List[tfds.core.DatasetBuilder], visu_doc_util, nightly_doc_util, ) -> str: """Build the dataset markdown.""" all_sections = [ DatasetDescriptionSection(), ConfigDescriptionSection(), HomepageSection(), SourceCodeSection(), VersionSection(nightly_doc_util), DownloadSizeSection(), DatasetSizeSection(), ManualDatasetSection(), AutocacheSection(), SplitInfoSection(), FeatureInfoSection(), SupervisedKeySection(), DatasetCitationSection(), DatasetVisualizationSection(visu_doc_util), ] doc_str = [ _display_dataset_heading(builder), _display_nightly_str(nightly_doc_util, builder), _display_manual_instructions(builder), _display_builder_configs( builder, nightly_doc_util, config_builders, all_sections ), ] return '\n\n'.join([tfds.core.utils.dedent(s) for s in doc_str if s])
{ "pile_set_name": "Github" }
// // spawn.hpp // ~~~~~~~~~ // // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_SPAWN_HPP #define BOOST_ASIO_SPAWN_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <boost/asio/detail/config.hpp> #include <boost/coroutine/all.hpp> #include <boost/asio/bind_executor.hpp> #include <boost/asio/detail/memory.hpp> #include <boost/asio/detail/type_traits.hpp> #include <boost/asio/detail/wrapped_handler.hpp> #include <boost/asio/executor.hpp> #include <boost/asio/io_context.hpp> #include <boost/asio/is_executor.hpp> #include <boost/asio/strand.hpp> #include <boost/asio/detail/push_options.hpp> namespace boost { namespace asio { /// Context object the represents the currently executing coroutine. /** * The basic_yield_context class is used to represent the currently executing * stackful coroutine. A basic_yield_context may be passed as a handler to an * asynchronous operation. For example: * * @code template <typename Handler> * void my_coroutine(basic_yield_context<Handler> yield) * { * ... * std::size_t n = my_socket.async_read_some(buffer, yield); * ... * } @endcode * * The initiating function (async_read_some in the above example) suspends the * current coroutine. The coroutine is resumed when the asynchronous operation * completes, and the result of the operation is returned. */ template <typename Handler> class basic_yield_context { public: /// The coroutine callee type, used by the implementation. /** * When using Boost.Coroutine v1, this type is: * @code typename coroutine<void()> @endcode * When using Boost.Coroutine v2 (unidirectional coroutines), this type is: * @code push_coroutine<void> @endcode */ #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined callee_type; #elif defined(BOOST_COROUTINES_UNIDIRECT) || defined(BOOST_COROUTINES_V2) typedef boost::coroutines::push_coroutine<void> callee_type; #else typedef boost::coroutines::coroutine<void()> callee_type; #endif /// The coroutine caller type, used by the implementation. /** * When using Boost.Coroutine v1, this type is: * @code typename coroutine<void()>::caller_type @endcode * When using Boost.Coroutine v2 (unidirectional coroutines), this type is: * @code pull_coroutine<void> @endcode */ #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined caller_type; #elif defined(BOOST_COROUTINES_UNIDIRECT) || defined(BOOST_COROUTINES_V2) typedef boost::coroutines::pull_coroutine<void> caller_type; #else typedef boost::coroutines::coroutine<void()>::caller_type caller_type; #endif /// Construct a yield context to represent the specified coroutine. /** * Most applications do not need to use this constructor. Instead, the * spawn() function passes a yield context as an argument to the coroutine * function. */ basic_yield_context( const detail::weak_ptr<callee_type>& coro, caller_type& ca, Handler& handler) : coro_(coro), ca_(ca), handler_(handler), ec_(0) { } /// Construct a yield context from another yield context type. /** * Requires that OtherHandler be convertible to Handler. */ template <typename OtherHandler> basic_yield_context(const basic_yield_context<OtherHandler>& other) : coro_(other.coro_), ca_(other.ca_), handler_(other.handler_), ec_(other.ec_) { } /// Return a yield context that sets the specified error_code. /** * By default, when a yield context is used with an asynchronous operation, a * non-success error_code is converted to system_error and thrown. This * operator may be used to specify an error_code object that should instead be * set with the asynchronous operation's result. For example: * * @code template <typename Handler> * void my_coroutine(basic_yield_context<Handler> yield) * { * ... * std::size_t n = my_socket.async_read_some(buffer, yield[ec]); * if (ec) * { * // An error occurred. * } * ... * } @endcode */ basic_yield_context operator[](boost::system::error_code& ec) const { basic_yield_context tmp(*this); tmp.ec_ = &ec; return tmp; } #if defined(GENERATING_DOCUMENTATION) private: #endif // defined(GENERATING_DOCUMENTATION) detail::weak_ptr<callee_type> coro_; caller_type& ca_; Handler handler_; boost::system::error_code* ec_; }; #if defined(GENERATING_DOCUMENTATION) /// Context object that represents the currently executing coroutine. typedef basic_yield_context<unspecified> yield_context; #else // defined(GENERATING_DOCUMENTATION) typedef basic_yield_context< executor_binder<void(*)(), executor> > yield_context; #endif // defined(GENERATING_DOCUMENTATION) /** * @defgroup spawn boost::asio::spawn * * @brief Start a new stackful coroutine. * * The spawn() function is a high-level wrapper over the Boost.Coroutine * library. This function enables programs to implement asynchronous logic in a * synchronous manner, as illustrated by the following example: * * @code boost::asio::spawn(my_strand, do_echo); * * // ... * * void do_echo(boost::asio::yield_context yield) * { * try * { * char data[128]; * for (;;) * { * std::size_t length = * my_socket.async_read_some( * boost::asio::buffer(data), yield); * * boost::asio::async_write(my_socket, * boost::asio::buffer(data, length), yield); * } * } * catch (std::exception& e) * { * // ... * } * } @endcode */ /*@{*/ /// Start a new stackful coroutine, calling the specified handler when it /// completes. /** * This function is used to launch a new coroutine. * * @param function The coroutine function. The function must have the signature: * @code void function(basic_yield_context<Handler> yield); @endcode * * @param attributes Boost.Coroutine attributes used to customise the coroutine. */ template <typename Function> void spawn(BOOST_ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes()); /// Start a new stackful coroutine, calling the specified handler when it /// completes. /** * This function is used to launch a new coroutine. * * @param handler A handler to be called when the coroutine exits. More * importantly, the handler provides an execution context (via the the handler * invocation hook) for the coroutine. The handler must have the signature: * @code void handler(); @endcode * * @param function The coroutine function. The function must have the signature: * @code void function(basic_yield_context<Handler> yield); @endcode * * @param attributes Boost.Coroutine attributes used to customise the coroutine. */ template <typename Handler, typename Function> void spawn(BOOST_ASIO_MOVE_ARG(Handler) handler, BOOST_ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes(), typename enable_if<!is_executor<typename decay<Handler>::type>::value && !is_convertible<Handler&, execution_context&>::value>::type* = 0); /// Start a new stackful coroutine, inheriting the execution context of another. /** * This function is used to launch a new coroutine. * * @param ctx Identifies the current coroutine as a parent of the new * coroutine. This specifies that the new coroutine should inherit the * execution context of the parent. For example, if the parent coroutine is * executing in a particular strand, then the new coroutine will execute in the * same strand. * * @param function The coroutine function. The function must have the signature: * @code void function(basic_yield_context<Handler> yield); @endcode * * @param attributes Boost.Coroutine attributes used to customise the coroutine. */ template <typename Handler, typename Function> void spawn(basic_yield_context<Handler> ctx, BOOST_ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes()); /// Start a new stackful coroutine that executes on a given executor. /** * This function is used to launch a new coroutine. * * @param ex Identifies the executor that will run the coroutine. The new * coroutine is implicitly given its own strand within this executor. * * @param function The coroutine function. The function must have the signature: * @code void function(yield_context yield); @endcode * * @param attributes Boost.Coroutine attributes used to customise the coroutine. */ template <typename Function, typename Executor> void spawn(const Executor& ex, BOOST_ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes(), typename enable_if<is_executor<Executor>::value>::type* = 0); /// Start a new stackful coroutine that executes on a given strand. /** * This function is used to launch a new coroutine. * * @param ex Identifies the strand that will run the coroutine. * * @param function The coroutine function. The function must have the signature: * @code void function(yield_context yield); @endcode * * @param attributes Boost.Coroutine attributes used to customise the coroutine. */ template <typename Function, typename Executor> void spawn(const strand<Executor>& ex, BOOST_ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes()); /// Start a new stackful coroutine that executes in the context of a strand. /** * This function is used to launch a new coroutine. * * @param s Identifies a strand. By starting multiple coroutines on the same * strand, the implementation ensures that none of those coroutines can execute * simultaneously. * * @param function The coroutine function. The function must have the signature: * @code void function(yield_context yield); @endcode * * @param attributes Boost.Coroutine attributes used to customise the coroutine. */ template <typename Function> void spawn(const boost::asio::io_context::strand& s, BOOST_ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes()); /// Start a new stackful coroutine that executes on a given execution context. /** * This function is used to launch a new coroutine. * * @param ctx Identifies the execution context that will run the coroutine. The * new coroutine is implicitly given its own strand within this execution * context. * * @param function The coroutine function. The function must have the signature: * @code void function(yield_context yield); @endcode * * @param attributes Boost.Coroutine attributes used to customise the coroutine. */ template <typename Function, typename ExecutionContext> void spawn(ExecutionContext& ctx, BOOST_ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes(), typename enable_if<is_convertible< ExecutionContext&, execution_context&>::value>::type* = 0); /*@}*/ } // namespace asio } // namespace boost #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/impl/spawn.hpp> #endif // BOOST_ASIO_SPAWN_HPP
{ "pile_set_name": "Github" }
/** * MegaMek - Copyright (C) 2005 Ben Mazur ([email protected]) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ package megamek.common.weapons.unofficial; import megamek.common.TechAdvancement; import megamek.common.weapons.missiles.MRMWeapon; /** * @author Sebastian Brocks */ public class ISMRM5OS extends MRMWeapon { /** * */ private static final long serialVersionUID = 3581161640370371727L; /** * */ public ISMRM5OS() { super(); name = "MRM 5 (OS)"; setInternalName(name); addLookupName("ISMRM5OS"); rackSize = 5; shortRange = 3; mediumRange = 8; longRange = 15; extremeRange = 16; bv = 6; flags = flags.or(F_ONESHOT); techAdvancement.setTechBase(TechAdvancement.TECH_BASE_IS); techAdvancement.setISAdvancement(DATE_NONE, DATE_NONE, 3057); techAdvancement.setTechRating(RATING_E); techAdvancement.setAvailability( new int[] { RATING_X, RATING_X, RATING_E, RATING_X }); } }
{ "pile_set_name": "Github" }
concrete TenseGrc of Tense = CatGrc [Tense,Temp], TenseX [Ant,Pol,AAnter,ASimul,PNeg,PPos] ** open ResGrc in { lin TTAnt t a = {s = t.s ++ a.s ; t = t.t ; a = a.a } ; TPres = {s = [] ; t = VPres VInd } ; -- or: VPerf VInd BR 220 TPast = {s = [] ; t = VImpf} ; -- or: VAor VInd, VPlqm TFut = {s = [] ; t = VFut FInd} ; -- and: VFut Opt, Inf, Part TCond = {s = "a)'n" ; t = VPres VInd} ; -- ??? }
{ "pile_set_name": "Github" }
angular.module('tab') .service('tab', [function(){ var tabMap = { activity: { name: "activity", title: "回顾", //show in tab templateUrl: "/tab/activity", //get template from the url active: false }, linkedtask: { name: "linkedtask", title: "相关任务", //show in tab templateUrl: "/tab/linktask", //get template from the url active: false }, linkedstory: { name: "linkedstory", title: "相关需求", //show in tab templateUrl: "/tab/linkstory", //get template from the url active: false }, linkedbug: { name: "linkedbug", title: "相关Bug", //show in tab templateUrl: "/tab/linkbug" //get template from the url }, comment: { name: "comment", title: "评论", //show in tab templateUrl: "/tab/comment", //get template from the url active: false }, duration: { name: "duration", title: "工作记录", templateUrl: "/tab/duration", active: false } }; this.getTabInfo = function(name, active) { var tab = null; if (tabMap[name] != undefined) { tab = angular.copy(tabMap[name]); if (active == true) { tab.active = true; } tab.exist = true; } else { tab = {exist: false}; } return tab; }; this.registerTab = function(tabInfo) { var newTab = { name: null, title: null, templateUrl: null, active: false }; if (tabInfo.name == undefined || tabInfo.name == '') return ; if (tabInfo.title == undefined || tabInfo.title == '') return ; if (tabInfo.templateUrl == undefined || tabInfo.templateUrl == '') return ; newTab.name = tabInfo.name; newTab.title = tabInfo.title; newTab.templateUrl = tabInfo.templateUrl; tabMap[newTab.name] = newTab; return ; } }]);
{ "pile_set_name": "Github" }
/* * Copyright (C) 2006-2010 Red Hat, Inc. All rights reserved. * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU General Public License v.2. */ #include <linux/miscdevice.h> #include <linux/init.h> #include <linux/wait.h> #include <linux/module.h> #include <linux/file.h> #include <linux/fs.h> #include <linux/poll.h> #include <linux/signal.h> #include <linux/spinlock.h> #include <linux/dlm.h> #include <linux/dlm_device.h> #include <linux/slab.h> #include "dlm_internal.h" #include "lockspace.h" #include "lock.h" #include "lvb_table.h" #include "user.h" static const char name_prefix[] = "dlm"; static const struct file_operations device_fops; static atomic_t dlm_monitor_opened; static int dlm_monitor_unused = 1; #ifdef CONFIG_COMPAT struct dlm_lock_params32 { __u8 mode; __u8 namelen; __u16 unused; __u32 flags; __u32 lkid; __u32 parent; __u64 xid; __u64 timeout; __u32 castparam; __u32 castaddr; __u32 bastparam; __u32 bastaddr; __u32 lksb; char lvb[DLM_USER_LVB_LEN]; char name[0]; }; struct dlm_write_request32 { __u32 version[3]; __u8 cmd; __u8 is64bit; __u8 unused[2]; union { struct dlm_lock_params32 lock; struct dlm_lspace_params lspace; struct dlm_purge_params purge; } i; }; struct dlm_lksb32 { __u32 sb_status; __u32 sb_lkid; __u8 sb_flags; __u32 sb_lvbptr; }; struct dlm_lock_result32 { __u32 version[3]; __u32 length; __u32 user_astaddr; __u32 user_astparam; __u32 user_lksb; struct dlm_lksb32 lksb; __u8 bast_mode; __u8 unused[3]; /* Offsets may be zero if no data is present */ __u32 lvb_offset; }; static void compat_input(struct dlm_write_request *kb, struct dlm_write_request32 *kb32, int namelen) { kb->version[0] = kb32->version[0]; kb->version[1] = kb32->version[1]; kb->version[2] = kb32->version[2]; kb->cmd = kb32->cmd; kb->is64bit = kb32->is64bit; if (kb->cmd == DLM_USER_CREATE_LOCKSPACE || kb->cmd == DLM_USER_REMOVE_LOCKSPACE) { kb->i.lspace.flags = kb32->i.lspace.flags; kb->i.lspace.minor = kb32->i.lspace.minor; memcpy(kb->i.lspace.name, kb32->i.lspace.name, namelen); } else if (kb->cmd == DLM_USER_PURGE) { kb->i.purge.nodeid = kb32->i.purge.nodeid; kb->i.purge.pid = kb32->i.purge.pid; } else { kb->i.lock.mode = kb32->i.lock.mode; kb->i.lock.namelen = kb32->i.lock.namelen; kb->i.lock.flags = kb32->i.lock.flags; kb->i.lock.lkid = kb32->i.lock.lkid; kb->i.lock.parent = kb32->i.lock.parent; kb->i.lock.xid = kb32->i.lock.xid; kb->i.lock.timeout = kb32->i.lock.timeout; kb->i.lock.castparam = (void *)(long)kb32->i.lock.castparam; kb->i.lock.castaddr = (void *)(long)kb32->i.lock.castaddr; kb->i.lock.bastparam = (void *)(long)kb32->i.lock.bastparam; kb->i.lock.bastaddr = (void *)(long)kb32->i.lock.bastaddr; kb->i.lock.lksb = (void *)(long)kb32->i.lock.lksb; memcpy(kb->i.lock.lvb, kb32->i.lock.lvb, DLM_USER_LVB_LEN); memcpy(kb->i.lock.name, kb32->i.lock.name, namelen); } } static void compat_output(struct dlm_lock_result *res, struct dlm_lock_result32 *res32) { res32->version[0] = res->version[0]; res32->version[1] = res->version[1]; res32->version[2] = res->version[2]; res32->user_astaddr = (__u32)(long)res->user_astaddr; res32->user_astparam = (__u32)(long)res->user_astparam; res32->user_lksb = (__u32)(long)res->user_lksb; res32->bast_mode = res->bast_mode; res32->lvb_offset = res->lvb_offset; res32->length = res->length; res32->lksb.sb_status = res->lksb.sb_status; res32->lksb.sb_flags = res->lksb.sb_flags; res32->lksb.sb_lkid = res->lksb.sb_lkid; res32->lksb.sb_lvbptr = (__u32)(long)res->lksb.sb_lvbptr; } #endif /* Figure out if this lock is at the end of its life and no longer available for the application to use. The lkb still exists until the final ast is read. A lock becomes EOL in three situations: 1. a noqueue request fails with EAGAIN 2. an unlock completes with EUNLOCK 3. a cancel of a waiting request completes with ECANCEL/EDEADLK An EOL lock needs to be removed from the process's list of locks. And we can't allow any new operation on an EOL lock. This is not related to the lifetime of the lkb struct which is managed entirely by refcount. */ static int lkb_is_endoflife(struct dlm_lkb *lkb, int sb_status, int type) { switch (sb_status) { case -DLM_EUNLOCK: return 1; case -DLM_ECANCEL: case -ETIMEDOUT: case -EDEADLK: if (lkb->lkb_grmode == DLM_LOCK_IV) return 1; break; case -EAGAIN: if (type == AST_COMP && lkb->lkb_grmode == DLM_LOCK_IV) return 1; break; } return 0; } /* we could possibly check if the cancel of an orphan has resulted in the lkb being removed and then remove that lkb from the orphans list and free it */ void dlm_user_add_ast(struct dlm_lkb *lkb, int type, int mode) { struct dlm_ls *ls; struct dlm_user_args *ua; struct dlm_user_proc *proc; int eol = 0, ast_type; if (lkb->lkb_flags & (DLM_IFL_ORPHAN | DLM_IFL_DEAD)) return; ls = lkb->lkb_resource->res_ls; mutex_lock(&ls->ls_clear_proc_locks); /* If ORPHAN/DEAD flag is set, it means the process is dead so an ast can't be delivered. For ORPHAN's, dlm_clear_proc_locks() freed lkb->ua so we can't try to use it. This second check is necessary for cases where a completion ast is received for an operation that began before clear_proc_locks did its cancel/unlock. */ if (lkb->lkb_flags & (DLM_IFL_ORPHAN | DLM_IFL_DEAD)) goto out; DLM_ASSERT(lkb->lkb_ua, dlm_print_lkb(lkb);); ua = lkb->lkb_ua; proc = ua->proc; if (type == AST_BAST && ua->bastaddr == NULL) goto out; spin_lock(&proc->asts_spin); ast_type = lkb->lkb_ast_type; lkb->lkb_ast_type |= type; if (type == AST_BAST) lkb->lkb_bastmode = mode; else lkb->lkb_castmode = mode; if (!ast_type) { kref_get(&lkb->lkb_ref); list_add_tail(&lkb->lkb_astqueue, &proc->asts); lkb->lkb_ast_first = type; wake_up_interruptible(&proc->wait); } if (type == AST_COMP && (ast_type & AST_COMP)) log_debug(ls, "ast overlap %x status %x %x", lkb->lkb_id, ua->lksb.sb_status, lkb->lkb_flags); eol = lkb_is_endoflife(lkb, ua->lksb.sb_status, type); if (eol) { lkb->lkb_flags |= DLM_IFL_ENDOFLIFE; } /* We want to copy the lvb to userspace when the completion ast is read if the status is 0, the lock has an lvb and lvb_ops says we should. We could probably have set_lvb_lock() set update_user_lvb instead and not need old_mode */ if ((lkb->lkb_ast_type & AST_COMP) && (lkb->lkb_lksb->sb_status == 0) && lkb->lkb_lksb->sb_lvbptr && dlm_lvb_operations[ua->old_mode + 1][lkb->lkb_grmode + 1]) ua->update_user_lvb = 1; else ua->update_user_lvb = 0; spin_unlock(&proc->asts_spin); if (eol) { spin_lock(&proc->locks_spin); if (!list_empty(&lkb->lkb_ownqueue)) { list_del_init(&lkb->lkb_ownqueue); dlm_put_lkb(lkb); } spin_unlock(&proc->locks_spin); } out: mutex_unlock(&ls->ls_clear_proc_locks); } static int device_user_lock(struct dlm_user_proc *proc, struct dlm_lock_params *params) { struct dlm_ls *ls; struct dlm_user_args *ua; int error = -ENOMEM; ls = dlm_find_lockspace_local(proc->lockspace); if (!ls) return -ENOENT; if (!params->castaddr || !params->lksb) { error = -EINVAL; goto out; } ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS); if (!ua) goto out; ua->proc = proc; ua->user_lksb = params->lksb; ua->castparam = params->castparam; ua->castaddr = params->castaddr; ua->bastparam = params->bastparam; ua->bastaddr = params->bastaddr; ua->xid = params->xid; if (params->flags & DLM_LKF_CONVERT) error = dlm_user_convert(ls, ua, params->mode, params->flags, params->lkid, params->lvb, (unsigned long) params->timeout); else { error = dlm_user_request(ls, ua, params->mode, params->flags, params->name, params->namelen, (unsigned long) params->timeout); if (!error) error = ua->lksb.sb_lkid; } out: dlm_put_lockspace(ls); return error; } static int device_user_unlock(struct dlm_user_proc *proc, struct dlm_lock_params *params) { struct dlm_ls *ls; struct dlm_user_args *ua; int error = -ENOMEM; ls = dlm_find_lockspace_local(proc->lockspace); if (!ls) return -ENOENT; ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS); if (!ua) goto out; ua->proc = proc; ua->user_lksb = params->lksb; ua->castparam = params->castparam; ua->castaddr = params->castaddr; if (params->flags & DLM_LKF_CANCEL) error = dlm_user_cancel(ls, ua, params->flags, params->lkid); else error = dlm_user_unlock(ls, ua, params->flags, params->lkid, params->lvb); out: dlm_put_lockspace(ls); return error; } static int device_user_deadlock(struct dlm_user_proc *proc, struct dlm_lock_params *params) { struct dlm_ls *ls; int error; ls = dlm_find_lockspace_local(proc->lockspace); if (!ls) return -ENOENT; error = dlm_user_deadlock(ls, params->flags, params->lkid); dlm_put_lockspace(ls); return error; } static int dlm_device_register(struct dlm_ls *ls, char *name) { int error, len; /* The device is already registered. This happens when the lockspace is created multiple times from userspace. */ if (ls->ls_device.name) return 0; error = -ENOMEM; len = strlen(name) + strlen(name_prefix) + 2; ls->ls_device.name = kzalloc(len, GFP_NOFS); if (!ls->ls_device.name) goto fail; snprintf((char *)ls->ls_device.name, len, "%s_%s", name_prefix, name); ls->ls_device.fops = &device_fops; ls->ls_device.minor = MISC_DYNAMIC_MINOR; error = misc_register(&ls->ls_device); if (error) { kfree(ls->ls_device.name); } fail: return error; } int dlm_device_deregister(struct dlm_ls *ls) { int error; /* The device is not registered. This happens when the lockspace was never used from userspace, or when device_create_lockspace() calls dlm_release_lockspace() after the register fails. */ if (!ls->ls_device.name) return 0; error = misc_deregister(&ls->ls_device); if (!error) kfree(ls->ls_device.name); return error; } static int device_user_purge(struct dlm_user_proc *proc, struct dlm_purge_params *params) { struct dlm_ls *ls; int error; ls = dlm_find_lockspace_local(proc->lockspace); if (!ls) return -ENOENT; error = dlm_user_purge(ls, proc, params->nodeid, params->pid); dlm_put_lockspace(ls); return error; } static int device_create_lockspace(struct dlm_lspace_params *params) { dlm_lockspace_t *lockspace; struct dlm_ls *ls; int error; if (!capable(CAP_SYS_ADMIN)) return -EPERM; error = dlm_new_lockspace(params->name, strlen(params->name), &lockspace, params->flags, DLM_USER_LVB_LEN); if (error) return error; ls = dlm_find_lockspace_local(lockspace); if (!ls) return -ENOENT; error = dlm_device_register(ls, params->name); dlm_put_lockspace(ls); if (error) dlm_release_lockspace(lockspace, 0); else error = ls->ls_device.minor; return error; } static int device_remove_lockspace(struct dlm_lspace_params *params) { dlm_lockspace_t *lockspace; struct dlm_ls *ls; int error, force = 0; if (!capable(CAP_SYS_ADMIN)) return -EPERM; ls = dlm_find_lockspace_device(params->minor); if (!ls) return -ENOENT; if (params->flags & DLM_USER_LSFLG_FORCEFREE) force = 2; lockspace = ls->ls_local_handle; dlm_put_lockspace(ls); /* The final dlm_release_lockspace waits for references to go to zero, so all processes will need to close their device for the ls before the release will proceed. release also calls the device_deregister above. Converting a positive return value from release to zero means that userspace won't know when its release was the final one, but it shouldn't need to know. */ error = dlm_release_lockspace(lockspace, force); if (error > 0) error = 0; return error; } /* Check the user's version matches ours */ static int check_version(struct dlm_write_request *req) { if (req->version[0] != DLM_DEVICE_VERSION_MAJOR || (req->version[0] == DLM_DEVICE_VERSION_MAJOR && req->version[1] > DLM_DEVICE_VERSION_MINOR)) { printk(KERN_DEBUG "dlm: process %s (%d) version mismatch " "user (%d.%d.%d) kernel (%d.%d.%d)\n", current->comm, task_pid_nr(current), req->version[0], req->version[1], req->version[2], DLM_DEVICE_VERSION_MAJOR, DLM_DEVICE_VERSION_MINOR, DLM_DEVICE_VERSION_PATCH); return -EINVAL; } return 0; } /* * device_write * * device_user_lock * dlm_user_request -> request_lock * dlm_user_convert -> convert_lock * * device_user_unlock * dlm_user_unlock -> unlock_lock * dlm_user_cancel -> cancel_lock * * device_create_lockspace * dlm_new_lockspace * * device_remove_lockspace * dlm_release_lockspace */ /* a write to a lockspace device is a lock or unlock request, a write to the control device is to create/remove a lockspace */ static ssize_t device_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct dlm_user_proc *proc = file->private_data; struct dlm_write_request *kbuf; sigset_t tmpsig, allsigs; int error; #ifdef CONFIG_COMPAT if (count < sizeof(struct dlm_write_request32)) #else if (count < sizeof(struct dlm_write_request)) #endif return -EINVAL; kbuf = kzalloc(count + 1, GFP_NOFS); if (!kbuf) return -ENOMEM; if (copy_from_user(kbuf, buf, count)) { error = -EFAULT; goto out_free; } if (check_version(kbuf)) { error = -EBADE; goto out_free; } #ifdef CONFIG_COMPAT if (!kbuf->is64bit) { struct dlm_write_request32 *k32buf; int namelen = 0; if (count > sizeof(struct dlm_write_request32)) namelen = count - sizeof(struct dlm_write_request32); k32buf = (struct dlm_write_request32 *)kbuf; /* add 1 after namelen so that the name string is terminated */ kbuf = kzalloc(sizeof(struct dlm_write_request) + namelen + 1, GFP_NOFS); if (!kbuf) { kfree(k32buf); return -ENOMEM; } if (proc) set_bit(DLM_PROC_FLAGS_COMPAT, &proc->flags); compat_input(kbuf, k32buf, namelen); kfree(k32buf); } #endif /* do we really need this? can a write happen after a close? */ if ((kbuf->cmd == DLM_USER_LOCK || kbuf->cmd == DLM_USER_UNLOCK) && (proc && test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags))) { error = -EINVAL; goto out_free; } sigfillset(&allsigs); sigprocmask(SIG_BLOCK, &allsigs, &tmpsig); error = -EINVAL; switch (kbuf->cmd) { case DLM_USER_LOCK: if (!proc) { log_print("no locking on control device"); goto out_sig; } error = device_user_lock(proc, &kbuf->i.lock); break; case DLM_USER_UNLOCK: if (!proc) { log_print("no locking on control device"); goto out_sig; } error = device_user_unlock(proc, &kbuf->i.lock); break; case DLM_USER_DEADLOCK: if (!proc) { log_print("no locking on control device"); goto out_sig; } error = device_user_deadlock(proc, &kbuf->i.lock); break; case DLM_USER_CREATE_LOCKSPACE: if (proc) { log_print("create/remove only on control device"); goto out_sig; } error = device_create_lockspace(&kbuf->i.lspace); break; case DLM_USER_REMOVE_LOCKSPACE: if (proc) { log_print("create/remove only on control device"); goto out_sig; } error = device_remove_lockspace(&kbuf->i.lspace); break; case DLM_USER_PURGE: if (!proc) { log_print("no locking on control device"); goto out_sig; } error = device_user_purge(proc, &kbuf->i.purge); break; default: log_print("Unknown command passed to DLM device : %d\n", kbuf->cmd); } out_sig: sigprocmask(SIG_SETMASK, &tmpsig, NULL); recalc_sigpending(); out_free: kfree(kbuf); return error; } /* Every process that opens the lockspace device has its own "proc" structure hanging off the open file that's used to keep track of locks owned by the process and asts that need to be delivered to the process. */ static int device_open(struct inode *inode, struct file *file) { struct dlm_user_proc *proc; struct dlm_ls *ls; ls = dlm_find_lockspace_device(iminor(inode)); if (!ls) return -ENOENT; proc = kzalloc(sizeof(struct dlm_user_proc), GFP_NOFS); if (!proc) { dlm_put_lockspace(ls); return -ENOMEM; } proc->lockspace = ls->ls_local_handle; INIT_LIST_HEAD(&proc->asts); INIT_LIST_HEAD(&proc->locks); INIT_LIST_HEAD(&proc->unlocking); spin_lock_init(&proc->asts_spin); spin_lock_init(&proc->locks_spin); init_waitqueue_head(&proc->wait); file->private_data = proc; return 0; } static int device_close(struct inode *inode, struct file *file) { struct dlm_user_proc *proc = file->private_data; struct dlm_ls *ls; sigset_t tmpsig, allsigs; ls = dlm_find_lockspace_local(proc->lockspace); if (!ls) return -ENOENT; sigfillset(&allsigs); sigprocmask(SIG_BLOCK, &allsigs, &tmpsig); set_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags); dlm_clear_proc_locks(ls, proc); /* at this point no more lkb's should exist for this lockspace, so there's no chance of dlm_user_add_ast() being called and looking for lkb->ua->proc */ kfree(proc); file->private_data = NULL; dlm_put_lockspace(ls); dlm_put_lockspace(ls); /* for the find in device_open() */ sigprocmask(SIG_SETMASK, &tmpsig, NULL); recalc_sigpending(); return 0; } static int copy_result_to_user(struct dlm_user_args *ua, int compat, int type, int mode, char __user *buf, size_t count) { #ifdef CONFIG_COMPAT struct dlm_lock_result32 result32; #endif struct dlm_lock_result result; void *resultptr; int error=0; int len; int struct_len; memset(&result, 0, sizeof(struct dlm_lock_result)); result.version[0] = DLM_DEVICE_VERSION_MAJOR; result.version[1] = DLM_DEVICE_VERSION_MINOR; result.version[2] = DLM_DEVICE_VERSION_PATCH; memcpy(&result.lksb, &ua->lksb, sizeof(struct dlm_lksb)); result.user_lksb = ua->user_lksb; if (type == AST_BAST) { result.user_astaddr = ua->bastaddr; result.user_astparam = ua->bastparam; result.bast_mode = mode; } else { result.user_astaddr = ua->castaddr; result.user_astparam = ua->castparam; } #ifdef CONFIG_COMPAT if (compat) len = sizeof(struct dlm_lock_result32); else #endif len = sizeof(struct dlm_lock_result); struct_len = len; /* copy lvb to userspace if there is one, it's been updated, and the user buffer has space for it */ if (ua->update_user_lvb && ua->lksb.sb_lvbptr && count >= len + DLM_USER_LVB_LEN) { if (copy_to_user(buf+len, ua->lksb.sb_lvbptr, DLM_USER_LVB_LEN)) { error = -EFAULT; goto out; } result.lvb_offset = len; len += DLM_USER_LVB_LEN; } result.length = len; resultptr = &result; #ifdef CONFIG_COMPAT if (compat) { compat_output(&result, &result32); resultptr = &result32; } #endif if (copy_to_user(buf, resultptr, struct_len)) error = -EFAULT; else error = len; out: return error; } static int copy_version_to_user(char __user *buf, size_t count) { struct dlm_device_version ver; memset(&ver, 0, sizeof(struct dlm_device_version)); ver.version[0] = DLM_DEVICE_VERSION_MAJOR; ver.version[1] = DLM_DEVICE_VERSION_MINOR; ver.version[2] = DLM_DEVICE_VERSION_PATCH; if (copy_to_user(buf, &ver, sizeof(struct dlm_device_version))) return -EFAULT; return sizeof(struct dlm_device_version); } /* a read returns a single ast described in a struct dlm_lock_result */ static ssize_t device_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct dlm_user_proc *proc = file->private_data; struct dlm_lkb *lkb; DECLARE_WAITQUEUE(wait, current); int error = 0, removed; int ret_type, ret_mode; int bastmode, castmode, do_bast, do_cast; if (count == sizeof(struct dlm_device_version)) { error = copy_version_to_user(buf, count); return error; } if (!proc) { log_print("non-version read from control device %zu", count); return -EINVAL; } #ifdef CONFIG_COMPAT if (count < sizeof(struct dlm_lock_result32)) #else if (count < sizeof(struct dlm_lock_result)) #endif return -EINVAL; try_another: /* do we really need this? can a read happen after a close? */ if (test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags)) return -EINVAL; spin_lock(&proc->asts_spin); if (list_empty(&proc->asts)) { if (file->f_flags & O_NONBLOCK) { spin_unlock(&proc->asts_spin); return -EAGAIN; } add_wait_queue(&proc->wait, &wait); repeat: set_current_state(TASK_INTERRUPTIBLE); if (list_empty(&proc->asts) && !signal_pending(current)) { spin_unlock(&proc->asts_spin); schedule(); spin_lock(&proc->asts_spin); goto repeat; } set_current_state(TASK_RUNNING); remove_wait_queue(&proc->wait, &wait); if (signal_pending(current)) { spin_unlock(&proc->asts_spin); return -ERESTARTSYS; } } /* there may be both completion and blocking asts to return for the lkb, don't remove lkb from asts list unless no asts remain */ lkb = list_entry(proc->asts.next, struct dlm_lkb, lkb_astqueue); removed = 0; ret_type = 0; ret_mode = 0; do_bast = lkb->lkb_ast_type & AST_BAST; do_cast = lkb->lkb_ast_type & AST_COMP; bastmode = lkb->lkb_bastmode; castmode = lkb->lkb_castmode; /* when both are queued figure out which to do first and switch first so the other goes in the next read */ if (do_cast && do_bast) { if (lkb->lkb_ast_first == AST_COMP) { ret_type = AST_COMP; ret_mode = castmode; lkb->lkb_ast_type &= ~AST_COMP; lkb->lkb_ast_first = AST_BAST; } else { ret_type = AST_BAST; ret_mode = bastmode; lkb->lkb_ast_type &= ~AST_BAST; lkb->lkb_ast_first = AST_COMP; } } else { ret_type = lkb->lkb_ast_first; ret_mode = (ret_type == AST_COMP) ? castmode : bastmode; lkb->lkb_ast_type &= ~ret_type; lkb->lkb_ast_first = 0; } /* if we're doing a bast but the bast is unnecessary, then switch to do nothing or do a cast if that was needed next */ if ((ret_type == AST_BAST) && dlm_modes_compat(bastmode, lkb->lkb_castmode_done)) { ret_type = 0; ret_mode = 0; if (do_cast) { ret_type = AST_COMP; ret_mode = castmode; lkb->lkb_ast_type &= ~AST_COMP; lkb->lkb_ast_first = 0; } } if (lkb->lkb_ast_first != lkb->lkb_ast_type) { log_print("device_read %x ast_first %x ast_type %x", lkb->lkb_id, lkb->lkb_ast_first, lkb->lkb_ast_type); } if (!lkb->lkb_ast_type) { list_del(&lkb->lkb_astqueue); removed = 1; } spin_unlock(&proc->asts_spin); if (ret_type) { error = copy_result_to_user(lkb->lkb_ua, test_bit(DLM_PROC_FLAGS_COMPAT, &proc->flags), ret_type, ret_mode, buf, count); if (ret_type == AST_COMP) lkb->lkb_castmode_done = castmode; if (ret_type == AST_BAST) lkb->lkb_bastmode_done = bastmode; } /* removes reference for the proc->asts lists added by dlm_user_add_ast() and may result in the lkb being freed */ if (removed) dlm_put_lkb(lkb); /* the bast that was queued was eliminated (see unnecessary above), leaving nothing to return */ if (!ret_type) goto try_another; return error; } static unsigned int device_poll(struct file *file, poll_table *wait) { struct dlm_user_proc *proc = file->private_data; poll_wait(file, &proc->wait, wait); spin_lock(&proc->asts_spin); if (!list_empty(&proc->asts)) { spin_unlock(&proc->asts_spin); return POLLIN | POLLRDNORM; } spin_unlock(&proc->asts_spin); return 0; } int dlm_user_daemon_available(void) { /* dlm_controld hasn't started (or, has started, but not properly populated configfs) */ if (!dlm_our_nodeid()) return 0; /* This is to deal with versions of dlm_controld that don't know about the monitor device. We assume that if the dlm_controld was started (above), but the monitor device was never opened, that it's an old version. dlm_controld should open the monitor device before populating configfs. */ if (dlm_monitor_unused) return 1; return atomic_read(&dlm_monitor_opened) ? 1 : 0; } static int ctl_device_open(struct inode *inode, struct file *file) { file->private_data = NULL; return 0; } static int ctl_device_close(struct inode *inode, struct file *file) { return 0; } static int monitor_device_open(struct inode *inode, struct file *file) { atomic_inc(&dlm_monitor_opened); dlm_monitor_unused = 0; return 0; } static int monitor_device_close(struct inode *inode, struct file *file) { if (atomic_dec_and_test(&dlm_monitor_opened)) dlm_stop_lockspaces(); return 0; } static const struct file_operations device_fops = { .open = device_open, .release = device_close, .read = device_read, .write = device_write, .poll = device_poll, .owner = THIS_MODULE, }; static const struct file_operations ctl_device_fops = { .open = ctl_device_open, .release = ctl_device_close, .read = device_read, .write = device_write, .owner = THIS_MODULE, }; static struct miscdevice ctl_device = { .name = "dlm-control", .fops = &ctl_device_fops, .minor = MISC_DYNAMIC_MINOR, }; static const struct file_operations monitor_device_fops = { .open = monitor_device_open, .release = monitor_device_close, .owner = THIS_MODULE, }; static struct miscdevice monitor_device = { .name = "dlm-monitor", .fops = &monitor_device_fops, .minor = MISC_DYNAMIC_MINOR, }; int __init dlm_user_init(void) { int error; atomic_set(&dlm_monitor_opened, 0); error = misc_register(&ctl_device); if (error) { log_print("misc_register failed for control device"); goto out; } error = misc_register(&monitor_device); if (error) { log_print("misc_register failed for monitor device"); misc_deregister(&ctl_device); } out: return error; } void dlm_user_exit(void) { misc_deregister(&ctl_device); misc_deregister(&monitor_device); }
{ "pile_set_name": "Github" }
#ifndef nukeOfxCamera_h #define nukeOfxCamera_h #include "ofxImageEffect.h" /* Software License : Copyright (c) 2010, The Foundry Visionmongers Ltd. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name The Foundry Visionmongers Ltd, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @file nukeOfxCamera.h This file defines a custom OFX extension to NUKE that allows cameras to be defined as nodal inputs to an image processing effect. It uses a custom suite that allows you to define camera inputs to an effect in a similar manner as image clips are defined in the standard image processing API. It uses the standard descriptor/instance split that is common to other OFX objects. So during effect description you define a camera input by name and set some properties on it. You can define more than one camera input to the effect, they will need different names however. After instance creation you can fetch data from a 'live' camera. This is done by via functions in the suite. As this is Nuke, you need to specify a frame and a view to fetch the value at. The view is available as a custom nuke property passed into all actions from nuke. */ /** @brief string to identify the Camera suite, pass to OfxHost::fetchSuite */ #define kNukeOfxCameraSuite "NukeOfxCameraSuite" typedef struct NukeOfxCameraStruct *NukeOfxCameraHandle; #define kNukeOfxCameraProjectionModePerspective 0.0 #define kNukeOfxCameraProjectionModeOrthographic 1.0 #define kNukeOfxCameraProjectionModeUV 2.0 #define kNukeOfxCameraProjectionModeSpherical 3.0 /** @brief Name of the projection mode nuke camera parameter. This has only one dimension and can be one of four values... - \ref kNukeOfxCameraProjectionPerspective - \ref kNukeOfxCameraProjectionOrthographic - \ref kNukeOfxCameraProjectionUV - \ref kNukeOfxCameraProjectionSpherical */ #define kNukeOfxCameraParamProjectionMode "projection_mode" /** @brief Name of the focal length nuke camera parameter. This has only one dimension. */ #define kNukeOfxCameraParamFocalLength "focal" /** @brief Name of the horizontal aperture nuke camera parameter. This has only one dimension. */ #define kNukeOfxCameraParamHorizontalAperture "haperture" /** @brief Name of the vertical aperture nuke camera parameter. This has only one dimension. */ #define kNukeOfxCameraParamVerticalAperture "vaperture" /** @brief Name of the near clipping plane nuke camera parameter This has only one dimension. */ #define kNukeOfxCameraParamNear "near" /** @brief Name of the far clipping plane nuke camera parameter This has only one dimension. */ #define kNukeOfxCameraParamFar "far" /** @brief Name of the window translate nuke camera parameter This has two dimensions. */ #define kNukeOfxCameraParamWindowTranslate "win_translate" /** @brief Name of the window scale nuke camera parameter This has two dimensions. */ #define kNukeOfxCameraParamWindowScale "win_scale" /** @brief Name of the window roll scale nuke camera parameter This has one dimension. */ #define kNukeOfxCameraParamWindowRoll "winroll" /** @brief Name of the focal point nuke camera parameter This has only one dimension. */ #define kNukeOfxCameraParamFocalPoint "focal_point" /** @brief Name of the camera position parameter This represents a homogenous 4x4 transform matrix that places the camera in 3D space. As such it has 16 values. */ #define kNukeOfxCameraParamPositionMatrix "position_matrix" /** @brief A suite to use Nuke cameras. This suite provides the functions needed by a plugin to define and use camera inputs for a Nuke image effect plugin. Cameras are named and more than one camera can be attached as an input to an effect. Camera descriptor property sets are defined to have the following properties - \ref kOfxPropType - (read only) set to "NukeCamera" - \ref kOfxPropName - (read only) the name the camera was created with - \ref kOfxPropLabel - (read/write) the user visible label for the camera - \ref kOfxPropShortLabel - (read/write) - \ref kOfxPropLongLabel - (read/write) - \ref kOfxImageClipPropOptional - (read/write) Instance property sets have all the descriptor properties (as read only) and the following properties... - \ref kOfxImageClipPropConnected - (read only) */ typedef struct NukeOfxCameraSuiteV1 { /** @brief Define a camera input to an effect. \arg pluginHandle - the decriptor handle passed into the 'describeInContext' action \arg name - unique name of the camera to define \arg propertySet - a property handle for the camera descriptor will be returned here Called by the plugin when the 'describeInContext' action has been called. Sets up a camera input with the given name. If not NULL, then a pointer to a PropertySetHandle for the Camera may be put in *propertySet. More than one camera can be defined, they will need different names. */ OfxStatus (*cameraDefine) (OfxImageEffectHandle pluginHandle, const char *name, OfxPropertySetHandle *propertySet); /** @brief Get the handle of the named camera input to an effect. \arg pluginHandle - an instance handle to the plugin \arg name - name of camera, previously used in a camera define call \arg camera - where to return the camera handle \arg propertySet - if not null, the descriptor handle for the camera's property set will be placed here. */ OfxStatus (*cameraGetHandle) (OfxImageEffectHandle pluginHandle, const char *name, NukeOfxCameraHandle *camera, OfxPropertySetHandle *propertySet); /** @brief Get the property set for the given camera \arg camera - the handle of the camera, as obtained from cameraGetHandle \arg propertySet - will be set with a pointer to the property set */ OfxStatus (*cameraGetPropertySet)(NukeOfxCameraHandle camera, OfxPropertySetHandle *propHandle); /** @brief Get an arbitrary camera parameter for a given time and view \arg camera - the handle of the camera, as obtained from cameraGetHandle \arg time - the time to evaluate the parameter for \arg view - the view to evaluate the parameter for \arg paramName - parameter name to look up (matches name of knob in Nuke, see defines at top of \ref ofxCamera.h) \arg baseReturnAddress - base address to store the evaluated result \arg returnSize - the number of doubles at the baseReturnAddress @returns - ::kOfxStatOK - if the parameter was fetched succesfully - ::kOfxStatFailed - if the camera was not connected - ::kOfxStatErrUnknown - if the named parameter could not be found */ OfxStatus (*cameraGetParameter) (NukeOfxCameraHandle camera, const char* paramName, double time, int view, double* baseReturnAddress, int returnSize); } NukeOfxCameraSuiteV1; #endif
{ "pile_set_name": "Github" }
// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package dns import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateSteeringPolicyRequest wrapper for the CreateSteeringPolicy operation type CreateSteeringPolicyRequest struct { // Details for creating a new steering policy. CreateSteeringPolicyDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case // of a timeout or server error without risk of executing that same action // again. Retry tokens expire after 24 hours, but can be invalidated before // then due to conflicting operations (for example, if a resource has been // deleted and purged from the system, then a retry of the original creation // request may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateSteeringPolicyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateSteeringPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateSteeringPolicyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateSteeringPolicyResponse wrapper for the CreateSteeringPolicy operation type CreateSteeringPolicyResponse struct { // The underlying http response RawResponse *http.Response // The SteeringPolicy instance SteeringPolicy `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to // contact Oracle about a particular request, please provide the request // ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The current version of the resource, ending with a // representation-specific suffix. This value may be used in If-Match // and If-None-Match headers for later requests of the same resource. ETag *string `presentIn:"header" name:"etag"` } func (response CreateSteeringPolicyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateSteeringPolicyResponse) HTTPResponse() *http.Response { return response.RawResponse }
{ "pile_set_name": "Github" }
// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt // Project developers. See the top-level LICENSE file for dates and other // details. No copyright assignment is required to contribute to VisIt. // **************************************************************************** // File: EllipsoidSlicePluginInfo.C // **************************************************************************** #include <EllipsoidSlicePluginInfo.h> #include <EllipsoidSliceAttributes.h> #include <visit-config.h> VISIT_PLUGIN_VERSION(EllipsoidSlice,OP_EXPORT) VISIT_OPERATOR_PLUGIN_ENTRY(EllipsoidSlice,General) // **************************************************************************** // Method: EllipsoidSliceGeneralPluginInfo::GetName // // Purpose: // Return the name of the operator plugin. // // Returns: A pointer to the name of the operator plugin. // // Programmer: generated by xml2info // Creation: omitted // // **************************************************************************** const char * EllipsoidSliceGeneralPluginInfo::GetName() const { return "EllipsoidSlice"; } // **************************************************************************** // Method: EllipsoidSliceGeneralPluginInfo::GetVersion // // Purpose: // Return the version of the operator plugin. // // Returns: A pointer to the version of the operator plugin. // // Programmer: generated by xml2info // Creation: omitted // // **************************************************************************** const char * EllipsoidSliceGeneralPluginInfo::GetVersion() const { return "1.0"; } // **************************************************************************** // Method: EllipsoidSliceGeneralPluginInfo::GetID // // Purpose: // Return the id of the operator plugin. // // Returns: A pointer to the id of the operator plugin. // // Programmer: generated by xml2info // Creation: omitted // // **************************************************************************** const char * EllipsoidSliceGeneralPluginInfo::GetID() const { return "EllipsoidSlice_1.0"; } // **************************************************************************** // Method: EllipsoidSliceGeneralPluginInfo::EnabledByDefault // // Purpose: // Return true if this plugin should be enabled by default; false otherwise. // // Returns: true/false // // Programmer: generated by xml2info // Creation: omitted // // **************************************************************************** bool EllipsoidSliceGeneralPluginInfo::EnabledByDefault() const { return true; } // **************************************************************************** // Method: EllipsoidSliceGeneralPluginInfo::GetCategoryName // // Purpose: // Return the category name to which the operator belongs. // // Returns: Return the category name to which the operator belongs. // // Programmer: generated by xml2info // Creation: omitted // // **************************************************************************** const char * EllipsoidSliceGeneralPluginInfo::GetCategoryName() const { return "Slicing"; }
{ "pile_set_name": "Github" }
#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type typedef NS_ENUM(NSInteger, ApplicableEnum) {five}; @interface I2 : NSObject @property (nonatomic) int prop; @end
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2015 Low Latency Trading Limited : Author Richard Rose * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and limitations under the License. *******************************************************************************/ package com.rr.model.generated.internal.type; /** Instructions for order handling on Broker trading floor */ import com.rr.model.internal.type.*; import com.rr.core.model.*; import com.rr.core.codec.RuntimeDecodingException; import com.rr.model.generated.internal.type.TypeIds; @SuppressWarnings( "unused" ) public enum HandlInst implements SingleByteLookup { AutoExecPrivate( TypeIds.HANDLINST_AUTOEXECPRIVATE, "1" ), AutoExecPublic( TypeIds.HANDLINST_AUTOEXECPUBLIC, "2" ), ManualBestExec( TypeIds.HANDLINST_MANUALBESTEXEC, "3" ), Unknown( TypeIds.HANDLINST_UNKNOWN, "?" ); public static int getMaxOccurs() { return 1; } public static int getMaxValueLen() { return 1; } private final byte _val; private final int _id; HandlInst( int id, String val ) { _val = val.getBytes()[0]; _id = id; } private static final int _indexOffset = 49; private static final HandlInst[] _entries = new HandlInst[15]; static { for ( int i=0 ; i < _entries.length ; i++ ) { _entries[i] = Unknown; } for ( HandlInst en : HandlInst.values() ) { if ( en == Unknown ) continue; _entries[ en.getVal() - _indexOffset ] = en; } } public static HandlInst getVal( byte val ) { final int arrIdx = val - _indexOffset; if ( arrIdx < 0 || arrIdx >= _entries.length ) { throw new RuntimeDecodingException( "Unsupported value of " + (char)val + " for HandlInst" ); } HandlInst eval; eval = _entries[ arrIdx ]; if ( eval == Unknown ) throw new RuntimeDecodingException( "Unsupported value of " + (char)val + " for HandlInst" ); return eval; } @Override public final byte getVal() { return _val; } public final int getID() { return _id; } }
{ "pile_set_name": "Github" }
name: "devopsinstitute" url: "http://devopsinstitute.com"
{ "pile_set_name": "Github" }
446cf45f3e1f3d3cb56ef3f305c80b60
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="pref_plugin_capture_panoramaaugmented_preference_title">Panorama</string> <string name="pref_plugin_capture_panoramaaugmented_preference_summary">HD Panorama çəkilişi</string> <string name="pref_plugin_capture_panoramaaugmented_imageheight_title">Panorama boyu</string> <string name="pref_plugin_capture_panoramaaugmented_imageheight_warning">Siz %d kadrı bu ölçüdə götürə bilərsiniz</string> <string name="pref_plugin_capture_panoramaaugmented_usehardwaregyro_title">Cihazda giroskopdan istifadə</string> <string name="pref_plugin_capture_panoramaaugmented_usehardwaregyro_summary">Giroskop avadanlığı tələb olunur. Əgər quraşdırılmayıbsa biz öz giroskop proqramımızdan istifadə edəcəyik</string> <string name="pref_plugin_capture_panoramaaugmented_nogyro_dialog_title">Giroskop yoxdur</string> <string name="pref_plugin_capture_panoramaaugmented_nogyro_dialog_text">Üzr istəyirik, sizin cihazda giroskop yoxdur. Bunun əvəzinə sizin təcrübənizi artırmaq üçün biz öz giroskop proqramımızdan istifadə edəcəyik</string> <string name="plugin_capture_panoramaaugmented_badframe">Lütfən çəkiliş zamanı basıb saxlayın</string> <string name="plugin_capture_panoramaaugmented_outofmemory">Üzr istəyirik, bu cihazın yaddaşına yerləşdirə biləcəyimiz maksimum kadrlardır.</string> <string name="plugin_capture_panoramaaugmented_stopcapture">360 panorama var! İşlənilir...</string> <string name="Panorama_Help_Header">Panorama köməyi</string> <string name="Panorama_Help">Mühüm: Əlinizi hərəkət etdirməyin, yalnız cihazı fırlayın!\n\n1. Cihazı əvvəlki kimi saxlayın\n2. Panorama çəkilişinə başlamaq üçün düyməni vurun\n3. Qırmızı bələdçilər üzrə cihazı fırlayın və yaşıl olduqda dayanın.\n4. Növbəti bələdçi üzrə kameranı hərəkət etdirin\n5. Panoramanı başa çatdırmaq üçün - düyməni vurun</string> <string name="pref_plugin_capture_panoramaaugmented_frameoverlap_title">Kadrların üst-üstə düşməsi</string> <string name="plugin_capture_panoramaaugmented_modeswitch_augmented">HD</string> <string name="plugin_capture_panoramaaugmented_modeswitch_sweep">Sürüşdür</string> <string name="pref_plugin_capture_panoramaaugmented_memory_title">Yaddaş məhdudiyyətləri</string> <string name="pref_plugin_capture_panoramaaugmented_memory_summary">Bir neçə kadra icazə verilir, lakin yaddaş çatışmazlığından xəta baş verə bilər</string> <string name="pref_plugin_capture_panoramaaugmented_aelock_title">Panorama AE/AWB bağlı</string> <string name="aelockNo">AE/AWB açıq</string> <string name="aelockHorizontal">AE/AWB yalnız üfiqi panorama üçün blokla</string> <string name="aelockAlways">AE/AWB həmişə blokla</string> </resources>
{ "pile_set_name": "Github" }
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Anscombe'] , ['LinearTrend'] , ['Seasonal_Second'] , ['SVR'] );
{ "pile_set_name": "Github" }
{ "name": "JPVideoPlayer", "version": "2.0.4", "summary": "Automatic play video in UITableView like Weibo home page in main thread and never block main thread.", "description": "This library provides an video player with cache support in UITableView.Cache video data at playingHandle play or stop video in mian-threadExcellent performance!Always play the video of the UITableViewCell in screen center when scrollingA guarantee that the same URL won't be downloaded several timesA guarantee that main thread will never be blocked", "homepage": "https://github.com/Chris-Pan/JPVideoPlayer", "license": "MIT", "authors": { "NewPan": "[email protected]" }, "platforms": { "ios": "8.0" }, "source": { "git": "https://github.com/Chris-Pan/JPVideoPlayer.git", "tag": "2.0.4" }, "source_files": "JPVideoPlayer/**/*.{h,m}", "frameworks": [ "Foundation", "UIKit", "AVFoundation", "MobileCoreServices" ], "requires_arc": true }
{ "pile_set_name": "Github" }
/**************************************************************** * Licensed to the Apache Software Foundation (ASF) under one * * or more contributor license agreements. See the NOTICE file * * distributed with this work for additional information * * regarding copyright ownership. The ASF licenses this file * * to you under the Apache License, Version 2.0 (the * * "License"); you may not use this file except in compliance * * with the License. You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, * * software distributed under the License is distributed on an * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * * KIND, either express or implied. See the License for the * * specific language governing permissions and limitations * * under the License. * ****************************************************************/ package org.apache.james.vault.dto.query; import java.util.List; import java.util.Objects; import org.apache.james.vault.search.Combinator; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; @JsonDeserialize(as = QueryDTO.class) public class QueryDTO implements QueryElement { @VisibleForTesting static QueryDTO and(QueryElement... queryElements) { return new QueryDTO(Combinator.AND.getValue(), ImmutableList.copyOf(queryElements)); } private final String combinator; private final List<QueryElement> criteria; @JsonCreator public QueryDTO(@JsonProperty("combinator") String combinator, @JsonProperty("criteria") List<QueryElement> criteria) { this.combinator = combinator; this.criteria = criteria; } public String getCombinator() { return combinator; } public List<QueryElement> getCriteria() { return criteria; } @Override public final boolean equals(Object o) { if (o instanceof QueryDTO) { QueryDTO queryDTO = (QueryDTO) o; return Objects.equals(this.combinator, queryDTO.getCombinator()) && Objects.equals(this.criteria, queryDTO.getCriteria()); } return false; } @Override public final int hashCode() { return Objects.hash(combinator, criteria); } }
{ "pile_set_name": "Github" }
package yaml // Set the writer error and return false. func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { emitter.error = yaml_WRITER_ERROR emitter.problem = problem return false } // Flush the output buffer. func yaml_emitter_flush(emitter *yaml_emitter_t) bool { if emitter.write_handler == nil { panic("write handler not set") } // Check if the buffer is empty. if emitter.buffer_pos == 0 { return true } // If the output encoding is UTF-8, we don't need to recode the buffer. if emitter.encoding == yaml_UTF8_ENCODING { if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) } emitter.buffer_pos = 0 return true } // Recode the buffer into the raw buffer. var low, high int if emitter.encoding == yaml_UTF16LE_ENCODING { low, high = 0, 1 } else { high, low = 1, 0 } pos := 0 for pos < emitter.buffer_pos { // See the "reader.c" code for more details on UTF-8 encoding. Note // that we assume that the buffer contains a valid UTF-8 sequence. // Read the next UTF-8 character. octet := emitter.buffer[pos] var w int var value rune switch { case octet&0x80 == 0x00: w, value = 1, rune(octet&0x7F) case octet&0xE0 == 0xC0: w, value = 2, rune(octet&0x1F) case octet&0xF0 == 0xE0: w, value = 3, rune(octet&0x0F) case octet&0xF8 == 0xF0: w, value = 4, rune(octet&0x07) } for k := 1; k < w; k++ { octet = emitter.buffer[pos+k] value = (value << 6) + (rune(octet) & 0x3F) } pos += w // Write the character. if value < 0x10000 { var b [2]byte b[high] = byte(value >> 8) b[low] = byte(value & 0xFF) emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1]) } else { // Write the character using a surrogate pair (check "reader.c"). var b [4]byte value -= 0x10000 b[high] = byte(0xD8 + (value >> 18)) b[low] = byte((value >> 10) & 0xFF) b[high+2] = byte(0xDC + ((value >> 8) & 0xFF)) b[low+2] = byte(value & 0xFF) emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3]) } } // Write the raw buffer. if err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil { return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) } emitter.buffer_pos = 0 emitter.raw_buffer = emitter.raw_buffer[:0] return true }
{ "pile_set_name": "Github" }
/** * @license Copyright (c) 2014-2018, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/license */ ( function() { 'use strict'; CKEDITOR.plugins.a11ychecker.quickFixes.get( { langCode: 'pt-br', name: 'QuickFix', callback: function( QuickFix ) { var emptyWhitespaceRegExp = /^[\s\n\r]+$/g; /** * QuickFix adding a caption in the `table` element. * * @member CKEDITOR.plugins.a11ychecker.quickFix * @class AddTableCaption * @constructor * @param {CKEDITOR.plugins.a11ychecker.Issue} issue Issue QuickFix is created for. */ function AddTableCaption( issue ) { QuickFix.call( this, issue ); } AddTableCaption.prototype = new QuickFix(); AddTableCaption.prototype.constructor = AddTableCaption; AddTableCaption.prototype.display = function( form ) { form.setInputs( { caption: { type: 'text', label: this.lang.captionLabel } } ); }; /** * @param {Object} formAttributes Object containing serialized form inputs. See * {@link CKEDITOR.plugins.a11ychecker.ViewerForm#serialize}. * @param {Function} callback Function to be called when a fix was applied. Gets QuickFix object * as a first parameter. */ AddTableCaption.prototype.fix = function( formAttributes, callback ) { var issueElement = this.issue.element, caption = issueElement.getDocument().createElement( 'caption' ); caption.setHtml( formAttributes.caption ); // Prepend the caption. issueElement.append( caption, true ); if ( callback ) { callback( this ); } }; AddTableCaption.prototype.validate = function( formAttributes ) { var proposedCaption = formAttributes.caption, ret = []; // Test if the caption has only whitespaces. if ( !proposedCaption || proposedCaption.match( emptyWhitespaceRegExp ) ) { ret.push( this.lang.errorEmpty ); } return ret; }; AddTableCaption.prototype.lang = {"captionLabel":"Legenda da tabela","errorEmpty":"O texto da legenda da tabela não pode estar vazio"}; CKEDITOR.plugins.a11ychecker.quickFixes.add( 'pt-br/AddTableCaption', AddTableCaption ); } } ); }() );
{ "pile_set_name": "Github" }
/**************************************************************************** * Copyright (C) from 2009 to Present EPAM Systems. * * This file is part of Indigo toolkit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ #include "indigo_match.h" #include "base_cpp/scanner.h" #include "indigo_mapping.h" #include "indigo_molecule.h" #include "indigo_reaction.h" #include "molecule/elements.h" #include "molecule/molecule_exact_matcher.h" #include "molecule/molecule_tautomer_matcher.h" #include "reaction/reaction_automapper.h" #include "reaction/reaction_exact_matcher.h" #include "reaction/reaction_substructure_matcher.h" void _indigoParseTauCondition(const char* list_ptr, int& aromaticity, Array<int>& label_list) { if (list_ptr == 0 || *list_ptr == 0) throw IndigoError("null or empty tautomer rule description is not allowed"); if (isdigit(*list_ptr)) { if (*list_ptr == '1') aromaticity = 1; else if (*list_ptr == '0') aromaticity = 0; else throw IndigoError("bad tautomer rule format"); list_ptr++; } else { aromaticity = -1; } label_list.clear(); QS_DEF(Array<char>, buf); buf.clear(); while (*list_ptr != 0) { if (isalpha((unsigned)*list_ptr)) buf.push(*list_ptr); else if (*list_ptr == ',') { buf.push(0); label_list.push(Element::fromString(buf.ptr())); buf.clear(); } else throw IndigoError("bad label list format in the tautomer rule"); list_ptr++; } buf.push(0); label_list.push(Element::fromString(buf.ptr())); } CEXPORT int indigoSetTautomerRule(int n, const char* beg, const char* end){INDIGO_BEGIN{if (n < 1 || n >= 32) throw IndigoError("tautomer rule index %d is out of range", n); AutoPtr<TautomerRule> rule(new TautomerRule()); _indigoParseTauCondition(beg, rule->aromaticity1, rule->list1); _indigoParseTauCondition(end, rule->aromaticity2, rule->list2); self.tautomer_rules.expand(n); self.tautomer_rules.reset(n - 1, rule.release()); return 1; } INDIGO_END(-1) } CEXPORT int indigoClearTautomerRules(){INDIGO_BEGIN{self.tautomer_rules.clear(); return 1; } INDIGO_END(-1) } CEXPORT int indigoRemoveTautomerRule(int n){INDIGO_BEGIN{self.tautomer_rules.remove(n - 1); return 1; } INDIGO_END(-1) } DLLEXPORT bool _indigoParseTautomerFlags(const char* flags, IndigoTautomerParams& params) { if (flags == 0) return false; BufferScanner scanner(flags); scanner.skipSpace(); QS_DEF(Array<char>, word); if (scanner.isEOF()) return false; scanner.readWord(word, 0); if (strcasecmp(word.ptr(), "TAU") != 0) return false; MoleculeTautomerMatcher::parseConditions(flags, params.conditions, params.force_hydrogens, params.ring_chain, params.method); return true; } DLLEXPORT int _indigoParseExactFlags(const char* flags, bool reaction, float* rms_threshold) { if (flags == 0) throw IndigoError("_indigoParseExactFlags(): zero string pointer"); if (!reaction && rms_threshold == 0) throw IndigoError("_indigoParseExactFlags(): zero float pointer"); static struct { const char* token; int type; // 1 -- molecule, 2 -- reaction, 3 -- both int value; } token_list[] = {{"ELE", 3, MoleculeExactMatcher::CONDITION_ELECTRONS}, {"MAS", 3, MoleculeExactMatcher::CONDITION_ISOTOPE}, {"STE", 3, MoleculeExactMatcher::CONDITION_STEREO}, {"FRA", 1, MoleculeExactMatcher::CONDITION_FRAGMENTS}, {"AAM", 2, ReactionExactMatcher::CONDITION_AAM}, {"RCT", 2, ReactionExactMatcher::CONDITION_REACTING_CENTERS}}; int i, res = 0, count = 0; bool had_float = false; bool had_none = false; bool had_all = false; if (!reaction) *rms_threshold = 0; BufferScanner scanner(flags); QS_DEF(Array<char>, word); while (1) { scanner.skipSpace(); if (scanner.isEOF()) break; if (had_float) throw IndigoError("_indigoParseExactFlags(): no value is allowed after the number"); scanner.readWord(word, 0); if (strcasecmp(word.ptr(), "NONE") == 0) { if (had_all) throw IndigoError("_indigoParseExactFlags(): NONE conflicts with ALL"); had_none = true; count++; continue; } if (strcasecmp(word.ptr(), "ALL") == 0) { if (had_none) throw IndigoError("_indigoParseExactFlags(): ALL conflicts with NONE"); had_all = true; res = MoleculeExactMatcher::CONDITION_ALL; if (reaction) res |= ReactionExactMatcher::CONDITION_ALL; count++; continue; } if (strcasecmp(word.ptr(), "TAU") == 0) // should have been handled before throw IndigoError("_indigoParseExactFlags(): no flags are allowed together with TAU"); for (i = 0; i < NELEM(token_list); i++) { if (strcasecmp(token_list[i].token, word.ptr()) == 0) { if (!reaction && !(token_list[i].type & 1)) throw IndigoError("_indigoParseExactFlags(): %s flag is allowed only for reaction matching", word.ptr()); if (reaction && !(token_list[i].type & 2)) throw IndigoError("_indigoParseExactFlags(): %s flag is allowed only for molecule matching", word.ptr()); if (had_all) throw IndigoError("_indigoParseExactFlags(): only negative flags are allowed together with ALL"); res |= token_list[i].value; break; } if (word[0] == '-' && strcasecmp(token_list[i].token, word.ptr() + 1) == 0) { if (!reaction && !(token_list[i].type & 1)) throw IndigoError("_indigoParseExactFlags(): %s flag is allowed only for reaction matching", word.ptr()); if (reaction && !(token_list[i].type & 2)) throw IndigoError("_indigoParseExactFlags(): %s flag is allowed only for molecule matching", word.ptr()); res &= ~token_list[i].value; break; } } if (i == NELEM(token_list)) { BufferScanner scanner2(word.ptr()); if (!reaction && scanner2.tryReadFloat(*rms_threshold)) { res |= MoleculeExactMatcher::CONDITION_3D; had_float = true; } else throw IndigoError("_indigoParseExactFlags(): unknown token %s", word.ptr()); } else count++; } if (had_none && count > 1) throw IndigoError("_indigoParseExactFlags(): no flags are allowed together with NONE"); if (count == 0) res |= MoleculeExactMatcher::CONDITION_ALL | ReactionExactMatcher::CONDITION_ALL; return res; } CEXPORT int indigoExactMatch(int handler1, int handler2, const char* flags) { INDIGO_BEGIN { IndigoObject& obj1 = self.getObject(handler1); IndigoObject& obj2 = self.getObject(handler2); if (flags == 0) flags = ""; if (IndigoBaseMolecule::is(obj1)) { Molecule& mol1 = obj1.getMolecule(); Molecule& mol2 = obj2.getMolecule(); IndigoTautomerParams params; AutoPtr<IndigoMapping> mapping(new IndigoMapping(mol1, mol2)); if (_indigoParseTautomerFlags(flags, params)) { MoleculeTautomerMatcher matcher(mol2, false); matcher.arom_options = self.arom_options; matcher.setRulesList(&self.tautomer_rules); matcher.setRules(params.conditions, params.force_hydrogens, params.ring_chain, params.method); matcher.setQuery(mol1); if (!matcher.find()) return 0; mapping->mapping.copy(matcher.getQueryMapping(), mol1.vertexEnd()); return self.addObject(mapping.release()); } MoleculeExactMatcher matcher(mol1, mol2); matcher.flags = _indigoParseExactFlags(flags, false, &matcher.rms_threshold); if (!matcher.find()) return 0; mapping->mapping.copy(matcher.getQueryMapping(), mol1.vertexEnd()); return self.addObject(mapping.release()); } if (IndigoBaseReaction::is(obj1)) { Reaction& rxn1 = obj1.getReaction(); Reaction& rxn2 = obj2.getReaction(); int i; ReactionExactMatcher matcher(rxn1, rxn2); matcher.flags = _indigoParseExactFlags(flags, true, 0); if (!matcher.find()) return 0; AutoPtr<IndigoReactionMapping> mapping(new IndigoReactionMapping(rxn1, rxn2)); mapping->mol_mapping.clear_resize(rxn1.end()); mapping->mol_mapping.fffill(); mapping->mappings.expand(rxn1.end()); for (i = rxn1.begin(); i != rxn1.end(); i = rxn1.next(i)) { if (rxn1.getSideType(i) == BaseReaction::CATALYST) continue; mapping->mol_mapping[i] = matcher.getTargetMoleculeIndex(i); mapping->mappings[i].copy(matcher.getQueryMoleculeMapping(i), rxn1.getBaseMolecule(i).vertexEnd()); } return self.addObject(mapping.release()); } throw IndigoError("indigoExactMatch(): %s is neither a molecule nor a reaction", obj1.debugInfo()); } INDIGO_END(-1); } IndigoMoleculeSubstructureMatchIter::IndigoMoleculeSubstructureMatchIter(Molecule& target_, QueryMolecule& query_, Molecule& original_target_, bool resonance, bool disable_folding_query_h) : IndigoObject(MOLECULE_SUBSTRUCTURE_MATCH_ITER), matcher(target_), target(target_), original_target(original_target_), query(query_) { matcher.disable_folding_query_h = disable_folding_query_h; matcher.setQuery(query); matcher.fmcache = &fmcache; matcher.use_pi_systems_matcher = resonance; _initialized = false; _found = false; _need_find = true; _embedding_index = 0; } IndigoMoleculeSubstructureMatchIter::~IndigoMoleculeSubstructureMatchIter() { } const char* IndigoMoleculeSubstructureMatchIter::debugInfo() { return "<molecule substructure match iterator>"; } IndigoObject* IndigoMoleculeSubstructureMatchIter::next() { if (!hasNext()) return 0; AutoPtr<IndigoMapping> mptr(new IndigoMapping(query, original_target)); // Expand mapping to fit possible implicit hydrogens mapping.expandFill(target.vertexEnd(), -1); if (!matcher.getEmbeddingsStorage().isEmpty()) { const GraphEmbeddingsStorage& storage = matcher.getEmbeddingsStorage(); int count; const int* query_mapping = storage.getMappingSub(_embedding_index, count); mptr->mapping.copy(query_mapping, query.vertexEnd()); } else mptr->mapping.copy(matcher.getQueryMapping(), query.vertexEnd()); for (int v = query.vertexBegin(); v != query.vertexEnd(); v = query.vertexNext(v)) { int mapped = mptr->mapping[v]; if (mapped >= 0) mptr->mapping[v] = mapping[mapped]; } _need_find = true; return mptr.release(); } bool IndigoMoleculeSubstructureMatchIter::hasNext() { if (!_need_find) return _found; if (!_initialized) { _initialized = true; _found = matcher.find(); } else { _embedding_index++; int cur_count = matcher.getEmbeddingsStorage().count(); if (_embedding_index < cur_count) _found = true; else _found = matcher.findNext(); } if (_embedding_index >= max_embeddings) throw IndigoError("Number of embeddings exceeded maximum allowed limit (%d). " "Adjust options to raise this limit.", max_embeddings); _need_find = false; return _found; } IndigoTautomerSubstructureMatchIter::IndigoTautomerSubstructureMatchIter(Molecule& target_, QueryMolecule& query_, Molecule& tautomerFound_, TautomerMethod method) : IndigoObject(MOLECULE_SUBSTRUCTURE_MATCH_ITER), matcher(target_, method), query(query_), tautomerFound(tautomerFound_) { matcher.setQuery(query); _initialized = false; _found = false; _need_find = true; _embedding_index = 0; _mask_index = 0; } IndigoTautomerSubstructureMatchIter::~IndigoTautomerSubstructureMatchIter() { } const char* IndigoTautomerSubstructureMatchIter::debugInfo() { return "<tautomer substructure match iterator>"; } IndigoObject* IndigoTautomerSubstructureMatchIter::next() { if (!hasNext()) return NULL; matcher.getTautomerFound(tautomerFound, _embedding_index, _mask_index); AutoPtr<IndigoMapping> mptr(new IndigoMapping(query, tautomerFound)); // Expand mapping to fit possible implicit hydrogens mapping.expandFill(tautomerFound.vertexEnd(), -1); if (!matcher.getEmbeddingsStorage().isEmpty()) { const GraphEmbeddingsStorage& storage = matcher.getEmbeddingsStorage(); int count; const int* query_mapping = storage.getMappingSub(_embedding_index, count); mptr->mapping.copy(query_mapping, query.vertexEnd()); } else mptr->mapping.copy(matcher.getQueryMapping(), query.vertexEnd()); for (int v = query.vertexBegin(); v != query.vertexEnd(); v = query.vertexNext(v)) { int mapped = mptr->mapping[v]; if (mapped >= 0) mptr->mapping[v] = mapping[mapped]; } _need_find = true; return mptr.release(); } bool IndigoTautomerSubstructureMatchIter::hasNext() { if (!_need_find) return _found; if (!_initialized) { _initialized = true; _found = matcher.find(); if (_found) { _embedding_index = 0; _mask_index = matcher.getMask(_embedding_index).nextSetBit(0); } } else { int cur_count = matcher.getEmbeddingsStorage().count(); _mask_index = matcher.getMask(_embedding_index).nextSetBit(_mask_index + 1); if (_mask_index == -1) { ++_embedding_index; } if (_embedding_index < cur_count) _found = true; else { _found = matcher.findNext(); if (_found) { _mask_index = matcher.getMask(_embedding_index).nextSetBit(0); } } } if (_embedding_index >= max_embeddings) throw IndigoError("Number of embeddings exceeded maximum allowed limit (%d). " "Adjust options to raise this limit.", max_embeddings); _need_find = false; return _found; } struct MatchCountContext { int embeddings_count, max_count; }; static bool _matchCountEmbeddingsCallback(Graph& sub, Graph& super, const int* core1, const int* core2, void* context_) { MatchCountContext* context = (MatchCountContext*)context_; context->embeddings_count++; if (context->embeddings_count >= context->max_count) return false; return true; } int IndigoMoleculeSubstructureMatchIter::countMatches(int embeddings_limit) { if (max_embeddings <= 0) throw IndigoError("Maximum allowed embeddings limit must be positive " "Adjust options to raise this limit."); MatchCountContext context; context.embeddings_count = 0; if (embeddings_limit != 0) context.max_count = __min(max_embeddings, embeddings_limit); else context.max_count = max_embeddings; matcher.find_all_embeddings = true; matcher.cb_embedding = _matchCountEmbeddingsCallback; matcher.cb_embedding_context = &context; matcher.find(); if (embeddings_limit != 0 && context.embeddings_count >= embeddings_limit) return embeddings_limit; if (context.embeddings_count >= max_embeddings) throw IndigoError("Number of embeddings exceeded maximum allowed limit (%d). " "Adjust options to raise this limit.", max_embeddings); return context.embeddings_count; } IndigoMoleculeSubstructureMatcher::IndigoMoleculeSubstructureMatcher(Molecule& target, int mode_) : IndigoObject(MOLECULE_SUBSTRUCTURE_MATCHER), target(target) { _arom_h_unfolded_prepared = false; _arom_prepared = false; _aromatized = false; mode = mode_; } IndigoMoleculeSubstructureMatcher::~IndigoMoleculeSubstructureMatcher() { } const char* IndigoMoleculeSubstructureMatcher::debugInfo() { return "<molecule substructure matcher>"; } void IndigoMoleculeSubstructureMatcher::ignoreAtom(int atom_index) { _ignored_atoms.push(atom_index); } void IndigoMoleculeSubstructureMatcher::unignoreAtom(int atom_index) { int pos = _ignored_atoms.find(atom_index); if (pos == -1) throw IndigoError("Atom with index %d wasn't ignored", atom_index); _ignored_atoms.remove(pos); } void IndigoMoleculeSubstructureMatcher::unignoreAllAtoms() { _ignored_atoms.clear(); } IndigoMoleculeSubstructureMatchIter* IndigoMoleculeSubstructureMatcher::iterateQueryMatches(IndigoObject& query_object, bool embedding_edges_uniqueness, bool find_unique_embeddings, bool for_iteration, int max_embeddings) { QueryMolecule& query = query_object.getQueryMolecule(); Molecule* target_prepared; Array<int>* mapping; bool* prepared; MoleculeAtomNeighbourhoodCounters* nei_counters; // If max_embeddings is 1 then it is only check for substructure // and not enumeration of number of matches if (MoleculeSubstructureMatcher::shouldUnfoldTargetHydrogens(query, max_embeddings != 1)) { if (!_arom_h_unfolded_prepared) _target_arom_h_unfolded.clone(target, &_mapping_arom_h_unfolded, 0); target_prepared = &_target_arom_h_unfolded; mapping = &_mapping_arom_h_unfolded; prepared = &_arom_h_unfolded_prepared; nei_counters = &_nei_counters_h_unfolded; } else { if (!_arom_prepared) _target_arom.clone(target, &_mapping_arom, 0); target_prepared = &_target_arom; mapping = &_mapping_arom; prepared = &_arom_prepared; nei_counters = &_nei_counters; } if (!*prepared) { if (!target.isAromatized()) { Indigo& indigo = indigoGetInstance(); target_prepared->aromatize(indigo.arom_options); } nei_counters->calculate(*target_prepared); *prepared = true; } AutoPtr<IndigoMoleculeSubstructureMatchIter> iter( new IndigoMoleculeSubstructureMatchIter(*target_prepared, query, target, (mode == RESONANCE), max_embeddings != 1)); if (query_object.type == IndigoObject::QUERY_MOLECULE) { IndigoQueryMolecule& qm_object = (IndigoQueryMolecule&)query_object; iter->matcher.setNeiCounters(&qm_object.getNeiCounters(), nei_counters); } Indigo& indigo = indigoGetInstance(); iter->matcher.arom_options = indigo.arom_options; iter->matcher.find_unique_embeddings = find_unique_embeddings; iter->matcher.find_unique_by_edges = embedding_edges_uniqueness; iter->matcher.save_for_iteration = for_iteration; for (int i = 0; i < _ignored_atoms.size(); i++) iter->matcher.ignoreTargetAtom(mapping->at(_ignored_atoms[i])); iter->matcher.restore_unfolded_h = false; iter->mapping.copy(*mapping); iter->max_embeddings = max_embeddings; return iter.release(); } IndigoTautomerSubstructureMatchIter* IndigoMoleculeSubstructureMatcher::iterateTautomerQueryMatches(IndigoObject& query_object, bool embedding_edges_uniqueness, bool find_unique_embeddings, bool for_iteration, int max_embeddings, TautomerMethod method) { QueryMolecule& query = query_object.getQueryMolecule(); Molecule* target_prepared; Array<int>* mapping; bool* prepared; MoleculeAtomNeighbourhoodCounters* nei_counters; { _target_arom_h_unfolded.clone(target, &_mapping_arom_h_unfolded, 0); target_prepared = &_target_arom_h_unfolded; mapping = &_mapping_arom_h_unfolded; prepared = &_arom_h_unfolded_prepared; nei_counters = &_nei_counters_h_unfolded; } AutoPtr<IndigoTautomerSubstructureMatchIter> iter(new IndigoTautomerSubstructureMatchIter(target, query, moleculeFound, method)); iter->matcher.find_unique_embeddings = find_unique_embeddings; iter->matcher.find_unique_by_edges = embedding_edges_uniqueness; iter->matcher.save_for_iteration = for_iteration; Array<int> simpleMapping; simpleMapping.expand(mapping->size()); for (int i = 0; i < simpleMapping.size(); ++i) { simpleMapping[i] = i; } iter->mapping.copy(simpleMapping); iter->max_embeddings = max_embeddings; return iter.release(); } bool IndigoMoleculeSubstructureMatcher::findTautomerMatch(QueryMolecule& query, PtrArray<TautomerRule>& tautomer_rules, Array<int>& mapping_out) { // shameless copy-paste from the method above bool* prepared; Molecule* target_prepared; Array<int>* mapping; if (MoleculeSubstructureMatcher::shouldUnfoldTargetHydrogens(query, false)) { if (!_arom_h_unfolded_prepared) _target_arom_h_unfolded.clone(target, &_mapping_arom_h_unfolded, 0); target_prepared = &_target_arom_h_unfolded; mapping = &_mapping_arom_h_unfolded; prepared = &_arom_h_unfolded_prepared; } else { if (!_arom_prepared) _target_arom.clone(target, &_mapping_arom, 0); target_prepared = &_target_arom; mapping = &_mapping_arom; prepared = &_arom_prepared; } Indigo& indigo = indigoGetInstance(); if (!target.isAromatized() && !*prepared) target_prepared->aromatize(indigo.arom_options); *prepared = true; if (tau_matcher.get() == 0) { bool substructure = true; tau_matcher.create(*target_prepared, substructure); } tau_matcher->setRulesList(&tautomer_rules); tau_matcher->setRules(tau_params.conditions, tau_params.force_hydrogens, tau_params.ring_chain, tau_params.method); tau_matcher->setQuery(query); tau_matcher->arom_options = indigo.arom_options; if (!tau_matcher->find()) return false; mapping_out.clear_resize(query.vertexEnd()); mapping_out.fffill(); const int* qm = tau_matcher->getQueryMapping(); for (int i = query.vertexBegin(); i != query.vertexEnd(); i = query.vertexNext(i)) if (qm[i] >= 0) mapping_out[i] = mapping->at(qm[i]); return true; } CEXPORT int indigoSubstructureMatcher(int target, const char* mode_str){INDIGO_BEGIN{IndigoObject& obj = self.getObject(target); if (IndigoBaseMolecule::is(obj)) { Molecule& mol = obj.getMolecule(); int mode = IndigoMoleculeSubstructureMatcher::NORMAL; IndigoTautomerParams tau_params; if (mode_str != 0 && *mode_str != 0) { if (_indigoParseTautomerFlags(mode_str, tau_params)) mode = IndigoMoleculeSubstructureMatcher::TAUTOMER; else if (strcasecmp(mode_str, "RES") == 0) mode = IndigoMoleculeSubstructureMatcher::RESONANCE; else throw IndigoError("indigoSubstructureMatcher(): unsupported mode %s", mode_str); } AutoPtr<IndigoMoleculeSubstructureMatcher> matcher(new IndigoMoleculeSubstructureMatcher(mol, mode)); if (mode == IndigoMoleculeSubstructureMatcher::TAUTOMER) matcher->tau_params = tau_params; return self.addObject(matcher.release()); } if (IndigoBaseReaction::is(obj)) { Reaction& rxn = obj.getReaction(); bool daylight_aam = false; if (mode_str != 0 && *mode_str != 0) { if (strcasecmp(mode_str, "DAYLIGHT-AAM") == 0) daylight_aam = true; else throw IndigoError("reaction substructure matcher: unknown mode %s", mode_str); } AutoPtr<IndigoReactionSubstructureMatcher> matcher(new IndigoReactionSubstructureMatcher(rxn)); matcher->daylight_aam = daylight_aam; return self.addObject(matcher.release()); } throw IndigoError("indigoSubstructureMatcher(): %s is neither a molecule not a reaction", obj.debugInfo()); } INDIGO_END(-1) } IndigoMoleculeSubstructureMatcher& IndigoMoleculeSubstructureMatcher::cast(IndigoObject& obj) { if (obj.type != IndigoObject::MOLECULE_SUBSTRUCTURE_MATCHER) throw IndigoError("%s is not a matcher object", obj.debugInfo()); return (IndigoMoleculeSubstructureMatcher&)obj; } IndigoMoleculeSubstructureMatchIter* IndigoMoleculeSubstructureMatcher::getMatchIterator(Indigo& self, int query, bool for_iteration, int max_embeddings) { return iterateQueryMatches(self.getObject(query), self.embedding_edges_uniqueness, self.find_unique_embeddings, for_iteration, max_embeddings); } IndigoTautomerSubstructureMatchIter* IndigoMoleculeSubstructureMatcher::getTautomerMatchIterator(Indigo& self, int query, bool for_iteration, int max_embeddings, TautomerMethod method) { return iterateTautomerQueryMatches(self.getObject(query), self.embedding_edges_uniqueness, self.find_unique_embeddings, for_iteration, max_embeddings, method); } CEXPORT int indigoIgnoreAtom(int target_matcher, int atom_object){ INDIGO_BEGIN{IndigoMoleculeSubstructureMatcher& matcher = IndigoMoleculeSubstructureMatcher::cast(self.getObject(target_matcher)); IndigoAtom& ia = IndigoAtom::cast(self.getObject(atom_object)); matcher.ignoreAtom(ia.idx); return 0; } INDIGO_END(-1) } // Ignore target atom in the substructure matcher CEXPORT int indigoUnignoreAtom(int target_matcher, int atom_object){ INDIGO_BEGIN{IndigoMoleculeSubstructureMatcher& matcher = IndigoMoleculeSubstructureMatcher::cast(self.getObject(target_matcher)); IndigoAtom& ia = IndigoAtom::cast(self.getObject(atom_object)); matcher.unignoreAtom(ia.idx); return 0; } INDIGO_END(-1) } CEXPORT int indigoUnignoreAllAtoms(int target_matcher){ INDIGO_BEGIN{IndigoMoleculeSubstructureMatcher& matcher = IndigoMoleculeSubstructureMatcher::cast(self.getObject(target_matcher)); matcher.unignoreAllAtoms(); return 0; } INDIGO_END(-1) } CEXPORT int indigoMatch(int target_matcher, int query) { INDIGO_BEGIN { IndigoObject& obj = self.getObject(target_matcher); if (obj.type == IndigoObject::MOLECULE_SUBSTRUCTURE_MATCHER) { IndigoMoleculeSubstructureMatcher& matcher = IndigoMoleculeSubstructureMatcher::cast(obj); if (matcher.mode == IndigoMoleculeSubstructureMatcher::TAUTOMER) { switch (matcher.tau_params.method) { case BASIC: { QueryMolecule& qmol = self.getObject(query).getQueryMolecule(); AutoPtr<IndigoMapping> mptr(new IndigoMapping(qmol, matcher.target)); if (!matcher.findTautomerMatch(qmol, self.tautomer_rules, mptr->mapping)) return 0; return self.addObject(mptr.release()); } case INCHI: case RSMARTS: { AutoPtr<IndigoTautomerSubstructureMatchIter> match_iter(matcher.getTautomerMatchIterator(self, query, true, 1, matcher.tau_params.method)); match_iter->matcher.find_unique_embeddings = false; if (!match_iter->hasNext()) return 0; return self.addObject(match_iter->next()); } } } else // NORMAL or RESONANCE { AutoPtr<IndigoMoleculeSubstructureMatchIter> match_iter(matcher.getMatchIterator(self, query, false, 1)); match_iter->matcher.find_unique_embeddings = false; if (!match_iter->hasNext()) return 0; return self.addObject(match_iter->next()); } } if (obj.type == IndigoObject::REACTION_SUBSTRUCTURE_MATCHER) { IndigoReactionSubstructureMatcher& matcher = IndigoReactionSubstructureMatcher::cast(obj); QueryReaction& qrxn = self.getObject(query).getQueryReaction(); int i, j; ReactionAutomapper ram(qrxn); ram.arom_options = self.arom_options; ram.correctReactingCenters(true); for (i = qrxn.begin(); i != qrxn.end(); i = qrxn.next(i)) if (MoleculeSubstructureMatcher::shouldUnfoldTargetHydrogens(qrxn.getQueryMolecule(i), false)) break; if (i != qrxn.end()) { matcher.target.unfoldHydrogens(); // expand mappings to include unfolded hydrogens for (i = matcher.target.begin(); i != matcher.target.end(); i = matcher.target.next(i)) matcher.mappings[i].expandFill(matcher.target.getBaseMolecule(i).vertexEnd(), -1); } if (matcher.matcher.get() == 0) matcher.matcher.create(matcher.target); matcher.matcher->use_daylight_aam_mode = matcher.daylight_aam; matcher.matcher->setQuery(qrxn); matcher.matcher->arom_options = self.arom_options; if (!matcher.matcher->find()) return 0; AutoPtr<IndigoReactionMapping> mapping(new IndigoReactionMapping(qrxn, matcher.original_target)); mapping->mol_mapping.clear_resize(qrxn.end()); mapping->mol_mapping.fffill(); mapping->mappings.expand(qrxn.end()); for (i = qrxn.begin(); i != qrxn.end(); i = qrxn.next(i)) { if (qrxn.getSideType(i) == BaseReaction::CATALYST) continue; int tmol_idx = matcher.matcher->getTargetMoleculeIndex(i); mapping->mol_mapping[i] = matcher.mol_mapping[tmol_idx]; BaseMolecule& qm = qrxn.getBaseMolecule(i); mapping->mappings[i].clear_resize(qm.vertexEnd()); mapping->mappings[i].fffill(); for (j = qm.vertexBegin(); j != qm.vertexEnd(); j = qm.vertexNext(j)) { int mapped = matcher.matcher->getQueryMoleculeMapping(i)[j]; if (mapped >= 0) // hydrogens are ignored mapping->mappings[i][j] = matcher.mappings[tmol_idx][mapped]; } } return self.addObject(mapping.release()); } throw IndigoError("indigoIterateMatches(): expected a matcher, got %s", obj.debugInfo()); } INDIGO_END(-1) } int indigoCountMatches(int target_matcher, int query) { return indigoCountMatchesWithLimit(target_matcher, query, 0); } CEXPORT int indigoCountMatchesWithLimit(int target_matcher, int query, int embeddings_limit) { INDIGO_BEGIN { IndigoObject& obj = self.getObject(target_matcher); if (obj.type == IndigoObject::MOLECULE_SUBSTRUCTURE_MATCHER) { IndigoMoleculeSubstructureMatcher& matcher = IndigoMoleculeSubstructureMatcher::cast(obj); if (matcher.mode == IndigoMoleculeSubstructureMatcher::TAUTOMER) throw IndigoError("count matches: not supported in this mode"); if (embeddings_limit > self.max_embeddings) throw IndigoError("count matches: embeddings limit is more then maximum " "allowed embeddings specified by options"); AutoPtr<IndigoMoleculeSubstructureMatchIter> match_iter(matcher.getMatchIterator(self, query, false, self.max_embeddings)); return match_iter->countMatches(embeddings_limit); } if (obj.type == IndigoObject::REACTION_SUBSTRUCTURE_MATCHER) throw IndigoError("count matches: can not work with reactions"); throw IndigoError("count matches: expected a matcher, got %s", obj.debugInfo()); } INDIGO_END(-1) } int indigoIterateMatches(int target_matcher, int query) { INDIGO_BEGIN { IndigoObject& obj = self.getObject(target_matcher); if (obj.type == IndigoObject::MOLECULE_SUBSTRUCTURE_MATCHER) { IndigoMoleculeSubstructureMatcher& matcher = IndigoMoleculeSubstructureMatcher::cast(obj); if (matcher.tau_params.method != BASIC && matcher.mode == IndigoMoleculeSubstructureMatcher::TAUTOMER) { AutoPtr<IndigoTautomerSubstructureMatchIter> match_iter( matcher.getTautomerMatchIterator(self, query, true, self.max_embeddings, matcher.tau_params.method)); return self.addObject(match_iter.release()); } else if (matcher.mode == IndigoMoleculeSubstructureMatcher::TAUTOMER) throw IndigoError("indigoIterateMatches(): not supported in this mode"); AutoPtr<IndigoMoleculeSubstructureMatchIter> match_iter(matcher.getMatchIterator(self, query, true, self.max_embeddings)); return self.addObject(match_iter.release()); } if (obj.type == IndigoObject::REACTION_SUBSTRUCTURE_MATCHER) throw IndigoError("indigoIterateMatches(): can not work with reactions"); throw IndigoError("indigoIterateMatches(): expected a matcher, got %s", obj.debugInfo()); } INDIGO_END(-1) } const char* IndigoReactionSubstructureMatcher::debugInfo() { return "<reaction substructure matcher>"; } IndigoReactionSubstructureMatcher::IndigoReactionSubstructureMatcher(Reaction& target_) : IndigoObject(REACTION_SUBSTRUCTURE_MATCHER), original_target(target_) { target.clone(target_, &mol_mapping, &mappings, 0); Indigo& indigo = indigoGetInstance(); target.aromatize(indigo.arom_options); daylight_aam = false; } IndigoReactionSubstructureMatcher::~IndigoReactionSubstructureMatcher() { } IndigoReactionSubstructureMatcher& IndigoReactionSubstructureMatcher::cast(IndigoObject& obj) { if (obj.type != IndigoObject::REACTION_SUBSTRUCTURE_MATCHER) throw IndigoError("%s is not a reaction matcher object", obj.debugInfo()); return (IndigoReactionSubstructureMatcher&)obj; }
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jackrabbit.standalone.cli.info; import org.apache.commons.chain.Command; import org.apache.commons.chain.Context; /** * Describes the given <code>Node</code>. */ public class Describe implements Command { /** * {@inheritDoc} */ public boolean execute(Context arg0) throws Exception { throw new UnsupportedOperationException(); } }
{ "pile_set_name": "Github" }
Fuel used by foo: 3
{ "pile_set_name": "Github" }
/* Copyright (c) 2014-2015 Arduino LLC. All right reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _VARIANT_ARDUINO_ZERO_ #define _VARIANT_ARDUINO_ZERO_ // The definitions here needs a SAMD core >=1.6.10 #define ARDUINO_SAMD_VARIANT_COMPLIANCE 10610 /*---------------------------------------------------------------------------- * Definitions *----------------------------------------------------------------------------*/ /** Frequency of the board main oscillator */ #define VARIANT_MAINOSC (32768ul) /** Master clock frequency */ #define VARIANT_MCK (48000000ul) /*---------------------------------------------------------------------------- * Headers *----------------------------------------------------------------------------*/ #include "WVariant.h" #ifdef __cplusplus #include "SERCOM.h" #include "Uart.h" #endif // __cplusplus #ifdef __cplusplus extern "C" { #endif // __cplusplus /*---------------------------------------------------------------------------- * Pins *----------------------------------------------------------------------------*/ // Number of pins defined in PinDescription array #ifdef __cplusplus extern "C" unsigned int PINCOUNT_fn(); #endif #define PINS_COUNT (PINCOUNT_fn()) #define NUM_DIGITAL_PINS (20u) #define NUM_ANALOG_INPUTS (6u) #define NUM_ANALOG_OUTPUTS (1u) #define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1) #define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) ) #define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin ) //#define analogInPinToBit(P) ( ) #define portOutputRegister(port) ( &(port->OUT.reg) ) #define portInputRegister(port) ( &(port->IN.reg) ) #define portModeRegister(port) ( &(port->DIR.reg) ) #define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER ) /* * digitalPinToTimer(..) is AVR-specific and is not defined for SAMD * architecture. If you need to check if a pin supports PWM you must * use digitalPinHasPWM(..). * * https://github.com/arduino/Arduino/issues/1833 */ // #define digitalPinToTimer(P) // LEDs #define PIN_LED_13 (13u) #define PIN_LED_RXL (25u) #define PIN_LED_TXL (26u) #define PIN_LED PIN_LED_13 #define PIN_LED2 PIN_LED_RXL #define PIN_LED3 PIN_LED_TXL #define LED_BUILTIN PIN_LED_13 /* * Analog pins */ #define PIN_A0 (14ul) #define PIN_A1 (15ul) #define PIN_A2 (16ul) #define PIN_A3 (17ul) #define PIN_A4 (18ul) #define PIN_A5 (19ul) #define PIN_DAC0 (14ul) static const uint8_t A0 = PIN_A0; static const uint8_t A1 = PIN_A1; static const uint8_t A2 = PIN_A2; static const uint8_t A3 = PIN_A3; static const uint8_t A4 = PIN_A4; static const uint8_t A5 = PIN_A5; static const uint8_t DAC0 = PIN_DAC0; #define ADC_RESOLUTION 12 // Other pins #define PIN_ATN (38ul) static const uint8_t ATN = PIN_ATN; /* * Serial interfaces */ // Serial (EDBG) #define PIN_SERIAL_RX (31ul) #define PIN_SERIAL_TX (30ul) #define PAD_SERIAL_TX (UART_TX_PAD_2) #define PAD_SERIAL_RX (SERCOM_RX_PAD_3) // Serial1 #define PIN_SERIAL1_RX (0ul) #define PIN_SERIAL1_TX (1ul) #define PAD_SERIAL1_TX (UART_TX_PAD_2) #define PAD_SERIAL1_RX (SERCOM_RX_PAD_3) /* * SPI Interfaces */ #define SPI_INTERFACES_COUNT 1 #define PIN_SPI_MISO (22u) #define PIN_SPI_MOSI (23u) #define PIN_SPI_SCK (24u) #define PERIPH_SPI sercom4 #define PAD_SPI_TX SPI_PAD_2_SCK_3 #define PAD_SPI_RX SERCOM_RX_PAD_0 static const uint8_t SS = PIN_A2 ; // SERCOM4 last PAD is present on A2 but HW SS isn't used. Set here only for reference. static const uint8_t MOSI = PIN_SPI_MOSI ; static const uint8_t MISO = PIN_SPI_MISO ; static const uint8_t SCK = PIN_SPI_SCK ; /* * Wire Interfaces */ #define WIRE_INTERFACES_COUNT 1 #define PIN_WIRE_SDA (20u) #define PIN_WIRE_SCL (21u) #define PERIPH_WIRE sercom3 #define WIRE_IT_HANDLER SERCOM3_Handler static const uint8_t SDA = PIN_WIRE_SDA; static const uint8_t SCL = PIN_WIRE_SCL; /* * USB */ #define PIN_USB_HOST_ENABLE (27ul) #define PIN_USB_DM (28ul) #define PIN_USB_DP (29ul) /* * I2S Interfaces */ #define I2S_INTERFACES_COUNT 1 #define I2S_DEVICE 0 #define I2S_CLOCK_GENERATOR 3 #define PIN_I2S_SD (9u) #define PIN_I2S_SCK (1u) #define PIN_I2S_FS (0u) #ifdef __cplusplus } #endif /*---------------------------------------------------------------------------- * Arduino objects - C++ only *----------------------------------------------------------------------------*/ #ifdef __cplusplus /* ========================= * ===== SERCOM DEFINITION * ========================= */ extern SERCOM sercom0; extern SERCOM sercom1; extern SERCOM sercom2; extern SERCOM sercom3; extern SERCOM sercom4; extern SERCOM sercom5; extern Uart Serial; extern Uart Serial1; #endif #ifdef __cplusplus extern "C" { #endif unsigned int PINCOUNT_fn(); #ifdef __cplusplus } #endif // These serial port names are intended to allow libraries and architecture-neutral // sketches to automatically default to the correct port name for a particular type // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, // the first hardware serial port whose RX/TX pins are not dedicated to another use. // // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor // // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial // // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library // // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. // // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX // pins are NOT connected to anything by default. #define SERIAL_PORT_USBVIRTUAL SerialUSB #define SERIAL_PORT_MONITOR Serial // Serial has no physical pins broken out, so it's not listed as HARDWARE port #define SERIAL_PORT_HARDWARE Serial1 #define SERIAL_PORT_HARDWARE_OPEN Serial1 #endif /* _VARIANT_ARDUINO_ZERO_ */
{ "pile_set_name": "Github" }
sphinx_rtd_theme==0.4.3 sphinx_markdown_tables==0.0.14
{ "pile_set_name": "Github" }
/** * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0 * * SPDX-License-Identifier: EPL-2.0 */ package org.openhab.binding.weather.internal.provider; import org.openhab.binding.weather.internal.common.LocationConfig; import org.openhab.binding.weather.internal.model.ProviderName; import org.openhab.binding.weather.internal.model.Weather; /** * Weather provider definition. * * @author Gerhard Riegler * @since 1.6.0 */ public interface WeatherProvider { /** * Returns the weather data for the specified location config. */ public Weather getWeather(LocationConfig locationConfig) throws Exception; /** * Returns the provider name. */ public ProviderName getProviderName(); }
{ "pile_set_name": "Github" }
package com.alibaba.alink; import com.alibaba.alink.operator.batch.BatchOperator; import com.alibaba.alink.operator.batch.classification.LogisticRegressionTrainBatchOp; import com.alibaba.alink.operator.batch.source.CsvSourceBatchOp; import com.alibaba.alink.operator.stream.dataproc.JsonValueStreamOp; import com.alibaba.alink.operator.stream.dataproc.SplitStreamOp; import com.alibaba.alink.operator.stream.evaluation.EvalBinaryClassStreamOp; import com.alibaba.alink.operator.stream.onlinelearning.FtrlPredictStreamOp; import com.alibaba.alink.operator.stream.onlinelearning.FtrlTrainStreamOp; import com.alibaba.alink.operator.stream.source.CsvSourceStreamOp; import com.alibaba.alink.pipeline.Pipeline; import com.alibaba.alink.pipeline.PipelineModel; import com.alibaba.alink.pipeline.dataproc.StandardScaler; import com.alibaba.alink.pipeline.feature.FeatureHasher; public class FTRLExample { public static void main(String[] args) throws Exception { String schemaStr = "id string, click string, dt string, C1 string, banner_pos int, site_id string, site_domain string, " + "site_category string, app_id string, app_domain string, app_category string, device_id string, " + "device_ip string, device_model string, device_type string, device_conn_type string, C14 int, C15 int, " + "C16 int, C17 int, C18 int, C19 int, C20 int, C21 int"; CsvSourceBatchOp trainBatchData = new CsvSourceBatchOp() .setFilePath("http://alink-release.oss-cn-beijing.aliyuncs.com/data-files/avazu-small.csv") .setSchemaStr(schemaStr); trainBatchData.firstN(10).print(); String labelColName = "click"; String[] selectedColNames = new String[]{ "C1", "banner_pos", "site_category", "app_domain", "app_category", "device_type", "device_conn_type", "C14", "C15", "C16", "C17", "C18", "C19", "C20", "C21", "site_id", "site_domain", "device_id", "device_model"}; String[] categoryColNames = new String[]{ "C1", "banner_pos", "site_category", "app_domain", "app_category", "device_type", "device_conn_type", "site_id", "site_domain", "device_id", "device_model"}; String[] numericalColNames = new String[]{ "C14", "C15", "C16", "C17", "C18", "C19", "C20", "C21"}; // result column name of feature engineering String vecColName = "vec"; int numHashFeatures = 30000; // setup feature engineering pipeline Pipeline featurePipeline = new Pipeline() .add( new StandardScaler() .setSelectedCols(numericalColNames) ) .add( new FeatureHasher() .setSelectedCols(selectedColNames) .setCategoricalCols(categoryColNames) .setOutputCol(vecColName) .setNumFeatures(numHashFeatures) ); // fit feature pipeline model PipelineModel featurePipelineModel = featurePipeline.fit(trainBatchData); // prepare stream train data CsvSourceStreamOp data = new CsvSourceStreamOp() .setFilePath("http://alink-release.oss-cn-beijing.aliyuncs.com/data-files/avazu-ctr-train-8M.csv") .setSchemaStr(schemaStr) .setIgnoreFirstLine(true); // split stream to train and eval data SplitStreamOp splitter = new SplitStreamOp().setFraction(0.5).linkFrom(data); // train initial batch model LogisticRegressionTrainBatchOp lr = new LogisticRegressionTrainBatchOp() .setVectorCol(vecColName) .setLabelCol(labelColName) .setWithIntercept(true) .setMaxIter(10); BatchOperator<?> initModel = featurePipelineModel.transform(trainBatchData).link(lr); // ftrl train FtrlTrainStreamOp model = new FtrlTrainStreamOp(initModel) .setVectorCol(vecColName) .setLabelCol(labelColName) .setWithIntercept(true) .setAlpha(0.1) .setBeta(0.1) .setL1(0.01) .setL2(0.01) .setTimeInterval(10) .setVectorSize(numHashFeatures) .linkFrom(featurePipelineModel.transform(splitter)); // ftrl predict FtrlPredictStreamOp predictResult = new FtrlPredictStreamOp(initModel) .setVectorCol(vecColName) .setPredictionCol("pred") .setReservedCols(new String[]{labelColName}) .setPredictionDetailCol("details") .linkFrom(model, featurePipelineModel.transform(splitter.getSideOutput(0))); // ftrl eval predictResult .link( new EvalBinaryClassStreamOp() .setLabelCol(labelColName) .setPredictionCol("pred") .setPredictionDetailCol("details") .setTimeInterval(10) ) .link( new JsonValueStreamOp() .setSelectedCol("Data") .setReservedCols(new String[]{"Statistics"}) .setOutputCols(new String[]{"Accuracy", "AUC", "ConfusionMatrix"}) .setJsonPath(new String[]{"$.Accuracy", "$.AUC", "$.ConfusionMatrix"}) ) .print(); } }
{ "pile_set_name": "Github" }
<# This test shows how to recover the correct error location in some cases. After failures with confusing error information examine errors in $Error. The error $Error[0] may show the correct location. #> try { # invoke the test which gets a confusing error location .\Test-2-misleading-error-location.ps1 } catch { # the caught error is misleading, it points to WillThrow $_ } # the last recorded" error is clear, it points to MissingCommand $Error[0]
{ "pile_set_name": "Github" }
import { Component, OnInit, OnChanges, SimpleChange, Input, Output, EventEmitter } from "@angular/core"; import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser'; @Component({ selector: 'doc-sidebar', templateUrl: './app/features/docSidebar/docsidebar.component.html', inputs: ['setDocSample'] }) export class DocSidebarComponent implements OnInit, OnChanges { @Input() docLink; @Output() setDocSample = new EventEmitter(); public url: SafeResourceUrl; public open: boolean = false; constructor(public sanitizer: DomSanitizer) { } ngOnInit() {} ngOnChanges(changes) { if(changes.docLink.currentValue) { this.url = this.sanitizer.bypassSecurityTrustResourceUrl(changes.docLink.currentValue); this.open = true; } } close() { this.setDocSample.emit(null); this.open = false; } }
{ "pile_set_name": "Github" }
#include <math.h> double fmax(double x, double y) { __asm__ ("fmaxnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y)); return x; }
{ "pile_set_name": "Github" }
#!/bin/bash # Reset UEFI Boot Method # # chkconfig: - 91 84 # description: Reset UEFI boot to Network First # processname: uefi_boot_method.py # # @copyright@ # Copyright (c) 2006 - 2019 Teradata # All rights reserved. Stacki(r) v5.x stacki.com # https://github.com/Teradata/stacki/blob/master/LICENSE.txt # @copyright@ # ### BEGIN INIT INFO # Provides: uefi-boot-method # Required-Start: $local_fs # Required-Stop: $local_fs # Default-Start: # Default-Stop: 0 1 6 # Short-Description: Set UEFI boot method # Description: Set UEFI Boot method to network first ### END INIT INFO # source function library . /etc/rc.status prog=/opt/stack/bin/uefi_boot_method.py RETVAL=0 start() { echo -n $"Setting UEFI boot method to Network First: " $prog >/dev/null if [ $RETVAL -eq 0 ]; then rc_status -v else rc_failed fi } stop() { echo } restart() { stop start } status() { echo $"Current UEFI Boot Status: " /usr/sbin/efibootmgr } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) status ;; *) echo $"Usage: $0 {start|stop|status|restart)" exit 1 ;; esac exit $RETVAL
{ "pile_set_name": "Github" }
/* * Copyright (C) 2016-2020 phantom.bot * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * commandRegister.js * * Register and keep track of commands. * * NOTE: You will have to register ANY command you implement! * The commandEvent will not get fired to your module if the registry does not know about it! */ (function() { var commands = {}, aliases = {}; /* * @function registerChatCommand * * @param {String} script * @param {String} command * @param {String} groupId */ function registerChatCommand(script, command, groupId) { // If groupId is undefined set it to 7 (viewer). groupId = (groupId === undefined ? 7 : groupId); if (commandExists(command)) { return; } // This is for the panel commands. if (groupId == 30) { if ($.inidb.exists('permcom', command)) { $.inidb.del('permcom', command); } commands[command] = { groupId: groupId, script: script, subcommands: {} }; return; } // Handle disabled commands. if ($.inidb.exists('disabledCommands', command)) { $.inidb.set('tempDisabledCommandScript', command, script); return; } // Get and set the command permission. groupId = $.getSetIniDbNumber('permcom', command, groupId); commands[command] = { groupId: groupId, script: script, subcommands: {} }; } /* * @function registerChatSubcommand * * @param {String} command * @param {String} subcommand * @param {String} groupId */ function registerChatSubcommand(command, subcommand, groupId) { // If groupId is undefined set it to 7 (viewer). groupId = (groupId === undefined ? 7 : groupId); if (!commandExists(command) || subCommandExists(command, subcommand)) { return; } // Get and set the command permission. groupId = $.getSetIniDbNumber('permcom', (command + ' ' + subcommand), groupId); commands[command].subcommands[subcommand] = { groupId: groupId } } /* * @function registerChatAlias * * @param {String} alias */ function registerChatAlias(alias) { if (!aliasExists(alias)) { aliases[alias] = true; } } /* * @function unregisterChatCommand * * @param {String} command */ function unregisterChatCommand(command) { if (commandExists(command)) { delete commands[command]; delete aliases[command]; } $.inidb.del('permcom', command); $.inidb.del('pricecom', command); $.inidb.del('cooldown', command); $.inidb.del('paycom', command); $.inidb.del('disabledCommands', command); } /* * @function tempUnRegisterChatCommand * * @param {String} command */ function tempUnRegisterChatCommand(command) { $.inidb.set('tempDisabledCommandScript', command, commands[command].script); if (commandExists(command)) { delete commands[command]; delete aliases[command]; } } /* * @function unregisterChatSubcommand * * @param {String} command * @param {String} subcommand */ function unregisterChatSubcommand(command, subcommand) { if (subCommandExists(command, subcommand)) { delete commands[command].subcommands[subcommand]; } $.inidb.del('permcom', command + ' ' + subcommand); $.inidb.del('pricecom', command + ' ' + subcommand); } /* * @function getCommandScript * * @param {String} command * @return {String} */ function getCommandScript(command) { if (commands[command] === undefined) { return "Undefined"; } return commands[command].script; } /* * @function commandExists * * @param {String} command * @return {Boolean} */ function commandExists(command) { return (commands[command] !== undefined); } /* * @function aliasExists * * @param {String} command */ function aliasExists(alias) { return (aliases[alias] !== undefined); } /* * @function subCommandExists * * @param {String} command * @param {String} subcommand * @return {Boolean} */ function subCommandExists(command, subcommand) { if (commandExists(command)) { return (commands[command].subcommands[subcommand] !== undefined); } return false; } /* * @function getCommandGroup * * @param {String} command * @return {Number} */ function getCommandGroup(command) { if (commandExists(command)) { return commands[command].groupId; } return 7; } /* * @function getCommandGroupName * * @param {String} command * @return {String} */ function getCommandGroupName(command) { var group = ''; if (commandExists(command)) { if (commands[command].groupId == 0) { group = 'Caster'; } else if (commands[command].groupId == 1) { group = 'Administrator'; } else if (commands[command].groupId == 2) { group = 'Moderator'; } else if (commands[command].groupId == 3) { group = 'Subscriber'; } else if (commands[command].groupId == 4) { group = 'Donator'; } else if (commands[command].groupId == 5) { group = 'VIP'; } else if (commands[command].groupId == 6) { group = 'Regular'; } else if (commands[command].groupId == 7) { group = 'Viewer'; } return group; } return 'Viewer'; } /* * @function getSubcommandGroup * * @param {String} command * @param {String} subcommand * @return {Number} */ function getSubcommandGroup(command, subcommand) { if (commandExists(command)) { if (subCommandExists(command, subcommand)) { return commands[command].subcommands[subcommand].groupId; } return getCommandGroup(command); } return 7; } /* * @function getSubCommandGroupName * * @param {String} command * @param {String} subcommand * @return {String} */ function getSubCommandGroupName(command, subcommand) { var group = ''; if (subCommandExists(command, subcommand)) { if (commands[command].subcommands[subcommand].groupId == 0) { group = 'Caster'; } else if (commands[command].subcommands[subcommand].groupId == 1) { group = 'Administrator'; } else if (commands[command].subcommands[subcommand].groupId == 2) { group = 'Moderator'; } else if (commands[command].subcommands[subcommand].groupId == 3) { group = 'Subscriber'; } else if (commands[command].subcommands[subcommand].groupId == 4) { group = 'Donator'; } else if (commands[command].subcommands[subcommand].groupId == 5) { group = 'VIP'; } else if (commands[command].subcommands[subcommand].groupId == 6) { group = 'Regular'; } else if (commands[command].subcommands[subcommand].groupId == 7) { group = 'Viewer'; } return group; } return 'Viewer'; } /* * @function updateCommandGroup * * @param {String} command * @param {Number} groupId */ function updateCommandGroup(command, groupId) { if (commandExists(command)) { commands[command].groupId = groupId; } } /* * @function updateSubcommandGroup * * @param {String} command * @param {String} subcommand * @param {Number} groupId */ function updateSubcommandGroup(command, subcommand, groupId) { if (subCommandExists(command, subcommand)) { commands[command].subcommands[subcommand].groupId = groupId; } } /* * @function getSubCommandFromArguments * * @param {String} command * @param {String[]} args */ function getSubCommandFromArguments(command, args) { if (!commandExists(command) || args[0] === undefined) { return ''; } else { var subCommand = args[0].toLowerCase(); if (subCommandExists(command, subCommand)) { return subCommand; } return ''; } } /** Export functions to API */ $.registerChatCommand = registerChatCommand; $.registerChatSubcommand = registerChatSubcommand; $.unregisterChatCommand = unregisterChatCommand; $.unregisterChatSubcommand = unregisterChatSubcommand; $.commandExists = commandExists; $.subCommandExists = subCommandExists; $.getCommandGroup = getCommandGroup; $.getCommandGroupName = getCommandGroupName; $.getSubcommandGroup = getSubcommandGroup; $.getSubCommandGroupName = getSubCommandGroupName; $.updateCommandGroup = updateCommandGroup; $.updateSubcommandGroup = updateSubcommandGroup; $.getCommandScript = getCommandScript; $.aliasExists = aliasExists; $.registerChatAlias = registerChatAlias; $.tempUnRegisterChatCommand = tempUnRegisterChatCommand; $.getSubCommandFromArguments = getSubCommandFromArguments; })();
{ "pile_set_name": "Github" }
{ "itemName" : "fuquantumchestadv", "price" : 950, "inventoryIcon" : "icons.png:chest", "dropCollision" : [-4.0, -3.0, 4.0, 3.0], "maxStack" : 1, "rarity" : "legendary", "description" : "^orange;Set Bonuses^reset;: ^yellow;^reset; ^cyan;Immune^reset;: Deadly Heat/Cold/Rads, Acid", "shortdescription" : "Morphite Chestpiece MK2", "category" : "chestarmour", "tooltipKind" : "armornew2", "itemTags" : [ "upgradeableWeapon" ], "maleFrames" : { "body" : "chestm.png", "backSleeve" : "bsleeve.png", "frontSleeve" : "fsleeve.png" }, "femaleFrames" : { "body" : "chestf.png", "backSleeve" : "bsleeve.png", "frontSleeve" : "fsleeve.png" }, "level" : 6, "collectablesOnPickup" : { "fu_armorpowerranged" : "fuquantumchestadv" }, "leveledStatusEffects" : [ { "levelFunction" : "standardArmorLevelPowerMultiplierMultiplier", "stat" : "powerMultiplier", "baseMultiplier" : 1.25 }, { "levelFunction" : "standardArmorLevelProtectionMultiplier", "stat" : "protection", "amount" : 0.45 }, { "levelFunction" : "standardArmorLevelMaxEnergyMultiplier", "stat" : "maxEnergy", "amount" : 7 }, { "levelFunction" : "standardArmorLevelMaxHealthMultiplier", "stat" : "maxHealth", "amount" : 3 }, { "levelFunction" : "fuArmorResistMultiplier", "stat" : "poisonResistance", "amount" : 0.034286 }, { "levelFunction" : "fuArmorResistMultiplier", "stat" : "electricResistance", "amount" : 0.034286 }, { "levelFunction" : "fuArmorResistMultiplier", "stat" : "iceResistance", "amount" : 0.034286 }, { "levelFunction" : "fuArmorResistMultiplier", "stat" : "fireResistance", "amount" : 0.034286 }, { "levelFunction" : "fuArmorResistMultiplier", "stat" : "radioactiveResistance", "amount" : 0.034286 }, { "levelFunction" : "fuArmorResistMultiplier", "stat" : "cosmicResistance", "amount" : 0.034286 }, { "levelFunction" : "fuArmorResistMultiplier", "stat" : "shadowResistance", "amount" : 0.034286 } ], "statusEffects" : [ "morphitesetbonus2", { "stat" : "fu_morphiteset2_chest", "amount" : 1 } ], "colorOptions" : [ /* WHITE */ { "ffca8a" : "e6e6e6", "e0975c" : "b6b6b6", "a85636" : "7b7b7b", "6f2919" : "373737" }, /* BLACK */ { "ffca8a" : "838383", "e0975c" : "555555", "a85636" : "383838", "6f2919" : "151515" }, /* GREY */ { "ffca8a" : "b5b5b5", "e0975c" : "808080", "a85636" : "555555", "6f2919" : "303030" }, /* RED */ { "ffca8a" : "f4988c", "e0975c" : "d93a3a", "a85636" : "932625", "6f2919" : "601119" }, /* ORANGE */ { "ffca8a" : "ffd495", "e0975c" : "ea9931", "a85636" : "af4e00", "6f2919" : "6e2900" }, /* YELLOW */ { "ffca8a" : "ffffa7", "e0975c" : "e2c344", "a85636" : "a46e06", "6f2919" : "642f00" }, /* GREEN */ { "ffca8a" : "b2e89d", "e0975c" : "51bd3b", "a85636" : "247824", "6f2919" : "144216" }, /* BLUE */ { "ffca8a" : "96cbe7", "e0975c" : "5588d4", "a85636" : "344495", "6f2919" : "1a1c51" }, /* PURPLE */ { "ffca8a" : "d29ce7", "e0975c" : "a451c4", "a85636" : "6a2284", "6f2919" : "320c40" }, /* PINK */ { "ffca8a" : "eab3db", "e0975c" : "d35eae", "a85636" : "97276d", "6f2919" : "59163f" }, /* BROWN */ { "ffca8a" : "ccae7c", "e0975c" : "a47844", "a85636" : "754c23", "6f2919" : "472b13" } ], //"upgrades" : 1 , "builder" : "/items/buildscripts/fubuildarmor.lua" }
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2012, 2013 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation * Andy Clement - Contributions for * Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work) *******************************************************************************/ package org.eclipse.jdt.internal.core.util; import org.eclipse.jdt.core.util.ClassFormatException; import org.eclipse.jdt.core.util.IConstantPool; import org.eclipse.jdt.core.util.IExtendedAnnotation; import org.eclipse.jdt.core.util.IRuntimeVisibleTypeAnnotationsAttribute; /** * Default implementation of IRuntimeVisibleTypeAnnotations */ public class RuntimeVisibleTypeAnnotationsAttribute extends ClassFileAttribute implements IRuntimeVisibleTypeAnnotationsAttribute { private static final IExtendedAnnotation[] NO_ENTRIES = new IExtendedAnnotation[0]; private int extendedAnnotationsNumber; private IExtendedAnnotation[] extendedAnnotations; /** * Constructor for RuntimeVisibleTypeAnnotations. * @param classFileBytes * @param constantPool * @param offset * @throws ClassFormatException */ public RuntimeVisibleTypeAnnotationsAttribute( byte[] classFileBytes, IConstantPool constantPool, int offset) throws ClassFormatException { super(classFileBytes, constantPool, offset); final int length = u2At(classFileBytes, 6, offset); this.extendedAnnotationsNumber = length; if (length != 0) { int readOffset = 8; this.extendedAnnotations = new IExtendedAnnotation[length]; for (int i = 0; i < length; i++) { ExtendedAnnotation extendedAnnotation = new ExtendedAnnotation(classFileBytes, constantPool, offset + readOffset); this.extendedAnnotations[i] = extendedAnnotation; readOffset += extendedAnnotation.sizeInBytes(); } } else { this.extendedAnnotations = NO_ENTRIES; } } @Override public IExtendedAnnotation[] getExtendedAnnotations() { return this.extendedAnnotations; } @Override public int getExtendedAnnotationsNumber() { return this.extendedAnnotationsNumber; } }
{ "pile_set_name": "Github" }
{ "ver": "1.0.0", "uuid": "f7deab9e-170a-4b0b-aa20-456deaece7a9", "type": "sprite", "wrapMode": "clamp", "filterMode": "bilinear", "subMetas": { "tex07": { "ver": "1.0.3", "uuid": "8da7d7dc-5eff-488e-b414-412e707b52e6", "rawTextureUuid": "f7deab9e-170a-4b0b-aa20-456deaece7a9", "trimType": "auto", "trimThreshold": 1, "rotated": false, "offsetX": 0, "offsetY": 0, "trimX": 0, "trimY": 0, "width": 1024, "height": 1024, "rawWidth": 1024, "rawHeight": 1024, "borderTop": 0, "borderBottom": 0, "borderLeft": 0, "borderRight": 0, "subMetas": {} } } }
{ "pile_set_name": "Github" }
.. _reference: ************* Reference ************* .. toctree:: :maxdepth: 1 reference/util.rst reference/boolalg/boolfunc.rst reference/boolalg/bdd.rst reference/boolalg/expr.rst reference/boolalg/bfarray.rst reference/boolalg/minimization.rst reference/boolalg/picosat.rst reference/boolalg/espresso.rst
{ "pile_set_name": "Github" }
import warnings from .. import widgets from .core import StringField, BooleanField __all__ = ( 'BooleanField', 'TextAreaField', 'PasswordField', 'FileField', 'HiddenField', 'SubmitField', 'TextField' ) class TextField(StringField): """ Legacy alias for StringField .. deprecated:: 2.0 """ def __init__(self, *args, **kw): super(TextField, self).__init__(*args, **kw) warnings.warn( 'The TextField alias for StringField has been deprecated and will be removed in WTForms 3.0', DeprecationWarning, stacklevel=2 ) class TextAreaField(StringField): """ This field represents an HTML ``<textarea>`` and can be used to take multi-line input. """ widget = widgets.TextArea() class PasswordField(StringField): """ A StringField, except renders an ``<input type="password">``. Also, whatever value is accepted by this field is not rendered back to the browser like normal fields. """ widget = widgets.PasswordInput() class FileField(StringField): """ Can render a file-upload field. Will take any passed filename value, if any is sent by the browser in the post params. This field will NOT actually handle the file upload portion, as wtforms does not deal with individual frameworks' file handling capabilities. """ widget = widgets.FileInput() class HiddenField(StringField): """ HiddenField is a convenience for a StringField with a HiddenInput widget. It will render as an ``<input type="hidden">`` but otherwise coerce to a string. """ widget = widgets.HiddenInput() class SubmitField(BooleanField): """ Represents an ``<input type="submit">``. This allows checking if a given submit button has been pressed. """ widget = widgets.SubmitInput()
{ "pile_set_name": "Github" }
# Copyright (C) 2015 KillerInstinct # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. try: import re2 as re except: import re from lib.cuckoo.common.abstracts import Signature class Vawtrak_APIs(Signature): name = "vawtrak_behavior" description = "Exhibits behavior characteristics of Vawtrak / Neverquest malware." severity = 3 weight = 3 categories = ["banking", "trojan"] families = ["vawtrak", "neverquest"] authors = ["KillerInstinct"] minimum = "1.3" evented = True filter_apinames = set(["NtOpenProcess", "NtCreateEvent", "NtOpenEvent", "NtCreateMutant", "RegSetValueExA", "CreateThread"]) def __init__(self, *args, **kwargs): Signature.__init__(self, *args, **kwargs) self.vawtrakauto = False self.eventtrigger = False self.eventcount = int() self.malscore = int() self.lastcall = str() def on_call(self, call, process): if call["api"] == "RegSetValueExA": # Autorun registry / filesystem behavior key = self.get_argument(call, "FullName").lower() if "\\software\\microsoft\\windows\\currentversion\\run\\" in key: buf = self.get_argument(call, "Buffer").lower() if re.match(r"^[A-Z]:\\ProgramData\\\w+\\\w+\.exe$", buf): self.vawtrakauto = True elif call["api"] == "NtCreateEvent" or call["api"] == "NtOpenEvent": buf = self.get_argument(call, "EventName") if re.match(r"^\{[0-9A-F]{8}(-[0-9A-F]{4}){3}-[0-9A-F]{12}\}$", buf): self.eventtrigger = True else: self.eventtrigger = False elif call["api"] == "CreateThread" or call["api"] == "NtOpenProcess": if self.eventtrigger: self.malscore += 2 self.lastcall = call["api"] # Reset event trigger if the current API isn't Nt[Create|Open]Event if call["api"] not in ["NtCreateEvent", "NtOpenEvent"]: self.eventtrigger = False def on_complete(self): if self.vawtrakauto: self.malscore += 2 if self.check_mutex(pattern=r"^\{[0-9A-F]{8}(-[0-9A-F]{4}){3}-[0-9A-F]{12}\}$", regex=True): self.malscore += 2 if self.malscore >= 10: uri_indicators = [ ".*\/rss\/feed\/stream", ".*\/modules\/[a-f0-9]{32}", ] for ioc in uri_indicators: match = self.check_url(pattern=ioc, regex=True) if match: buf = {"C2": match} if buf not in self.data: self.data.append(buf) return True return False
{ "pile_set_name": "Github" }
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #include "ThumbnailRendering/WorldThumbnailInfo.h" UWorldThumbnailInfo::UWorldThumbnailInfo(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { CameraMode = ECameraProjectionMode::Perspective; OrthoDirection = EOrthoThumbnailDirection::Top; }
{ "pile_set_name": "Github" }
--- scripts/Glacier2Util.py.orig 2018-08-27 01:10:47 UTC +++ scripts/Glacier2Util.py @@ -19,10 +19,13 @@ class Glacier2Router(ProcessFromBinDir, self.passwords = passwords def setup(self, current): + glacier2router = self.getMapping(current).getCommandLine(current, self, self.exe, "") + if not os.path.exists(self.exe) and os.path.exists("/usr/local/bin/glacier2router"): + self.exe = "/usr/local/bin/glacier2router" if self.passwords: path = os.path.join(current.testsuite.getPath(), "passwords") with open(path, "w") as file: - command = "\"%s\" %s" % (sys.executable, + command = "\"%s\" %s 2>/dev/null" % (sys.executable, os.path.abspath(os.path.join(toplevel, "scripts", "icehashpassword.py"))) #
{ "pile_set_name": "Github" }
/* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package java.util; /** * FomattableFlags are passed to the {@link Formattable#formatTo * Formattable.formatTo()} method and modify the output format for {@linkplain * Formattable Formattables}. Implementations of {@link Formattable} are * responsible for interpreting and validating any flags. * * @since 1.5 */ public class FormattableFlags { // Explicit instantiation of this class is prohibited. private FormattableFlags() {} /** * Left-justifies the output. Spaces (<tt>'&#92;u0020'</tt>) will be added * at the end of the converted value as required to fill the minimum width * of the field. If this flag is not set then the output will be * right-justified. * * <p> This flag corresponds to <tt>'-'</tt> (<tt>'&#92;u002d'</tt>) in * the format specifier. */ public static final int LEFT_JUSTIFY = 1<<0; // '-' /** * Converts the output to upper case according to the rules of the * {@linkplain java.util.Locale locale} given during creation of the * <tt>formatter</tt> argument of the {@link Formattable#formatTo * formatTo()} method. The output should be equivalent the following * invocation of {@link String#toUpperCase(java.util.Locale)} * * <pre> * out.toUpperCase() </pre> * * <p> This flag corresponds to <tt>'S'</tt> (<tt>'&#92;u0053'</tt>) in * the format specifier. */ public static final int UPPERCASE = 1<<1; // 'S' /** * Requires the output to use an alternate form. The definition of the * form is specified by the <tt>Formattable</tt>. * * <p> This flag corresponds to <tt>'#'</tt> (<tt>'&#92;u0023'</tt>) in * the format specifier. */ public static final int ALTERNATE = 1<<2; // '#' }
{ "pile_set_name": "Github" }
/* * This is the driver for the STA2x11 Video Input Port. * * Copyright (C) 2012 ST Microelectronics * author: Federico Vaga <[email protected]> * Copyright (C) 2010 WindRiver Systems, Inc. * authors: Andreas Kies <[email protected]> * Vlad Lungu <[email protected]> * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * * The full GNU General Public License is included in this distribution in * the file called "COPYING". * */ #include <linux/types.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/videodev2.h> #include <linux/kmod.h> #include <linux/pci.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/gpio.h> #include <linux/i2c.h> #include <linux/delay.h> #include <media/v4l2-common.h> #include <media/v4l2-device.h> #include <media/v4l2-ctrls.h> #include <media/v4l2-ioctl.h> #include <media/v4l2-fh.h> #include <media/v4l2-event.h> #include <media/videobuf2-dma-contig.h> #include "sta2x11_vip.h" #define DRV_VERSION "1.3" #ifndef PCI_DEVICE_ID_STMICRO_VIP #define PCI_DEVICE_ID_STMICRO_VIP 0xCC0D #endif #define MAX_FRAMES 4 /*Register offsets*/ #define DVP_CTL 0x00 #define DVP_TFO 0x04 #define DVP_TFS 0x08 #define DVP_BFO 0x0C #define DVP_BFS 0x10 #define DVP_VTP 0x14 #define DVP_VBP 0x18 #define DVP_VMP 0x1C #define DVP_ITM 0x98 #define DVP_ITS 0x9C #define DVP_STA 0xA0 #define DVP_HLFLN 0xA8 #define DVP_RGB 0xC0 #define DVP_PKZ 0xF0 /*Register fields*/ #define DVP_CTL_ENA 0x00000001 #define DVP_CTL_RST 0x80000000 #define DVP_CTL_DIS (~0x00040001) #define DVP_IT_VSB 0x00000008 #define DVP_IT_VST 0x00000010 #define DVP_IT_FIFO 0x00000020 #define DVP_HLFLN_SD 0x00000001 #define SAVE_COUNT 8 #define AUX_COUNT 3 #define IRQ_COUNT 1 struct vip_buffer { struct vb2_v4l2_buffer vb; struct list_head list; dma_addr_t dma; }; static inline struct vip_buffer *to_vip_buffer(struct vb2_v4l2_buffer *vb2) { return container_of(vb2, struct vip_buffer, vb); } /** * struct sta2x11_vip - All internal data for one instance of device * @v4l2_dev: device registered in v4l layer * @video_dev: properties of our device * @pdev: PCI device * @adapter: contains I2C adapter information * @register_save_area: All relevant register are saved here during suspend * @decoder: contains information about video DAC * @ctrl_hdl: handler for control framework * @format: pixel format, fixed UYVY * @std: video standard (e.g. PAL/NTSC) * @input: input line for video signal ( 0 or 1 ) * @disabled: Device is in power down state * @slock: for excluse acces of registers * @alloc_ctx: context for videobuf2 * @vb_vidq: queue maintained by videobuf2 layer * @buffer_list: list of buffer in use * @sequence: sequence number of acquired buffer * @active: current active buffer * @lock: used in videobuf2 callback * @tcount: Number of top frames * @bcount: Number of bottom frames * @overflow: Number of FIFO overflows * @iomem: hardware base address * @config: I2C and gpio config from platform * * All non-local data is accessed via this structure. */ struct sta2x11_vip { struct v4l2_device v4l2_dev; struct video_device video_dev; struct pci_dev *pdev; struct i2c_adapter *adapter; unsigned int register_save_area[IRQ_COUNT + SAVE_COUNT + AUX_COUNT]; struct v4l2_subdev *decoder; struct v4l2_ctrl_handler ctrl_hdl; struct v4l2_pix_format format; v4l2_std_id std; unsigned int input; int disabled; spinlock_t slock; struct vb2_alloc_ctx *alloc_ctx; struct vb2_queue vb_vidq; struct list_head buffer_list; unsigned int sequence; struct vip_buffer *active; /* current active buffer */ spinlock_t lock; /* Used in videobuf2 callback */ /* Interrupt counters */ int tcount, bcount; int overflow; void __iomem *iomem; /* I/O Memory */ struct vip_config *config; }; static const unsigned int registers_to_save[AUX_COUNT] = { DVP_HLFLN, DVP_RGB, DVP_PKZ }; static struct v4l2_pix_format formats_50[] = { { /*PAL interlaced */ .width = 720, .height = 576, .pixelformat = V4L2_PIX_FMT_UYVY, .field = V4L2_FIELD_INTERLACED, .bytesperline = 720 * 2, .sizeimage = 720 * 2 * 576, .colorspace = V4L2_COLORSPACE_SMPTE170M}, { /*PAL top */ .width = 720, .height = 288, .pixelformat = V4L2_PIX_FMT_UYVY, .field = V4L2_FIELD_TOP, .bytesperline = 720 * 2, .sizeimage = 720 * 2 * 288, .colorspace = V4L2_COLORSPACE_SMPTE170M}, { /*PAL bottom */ .width = 720, .height = 288, .pixelformat = V4L2_PIX_FMT_UYVY, .field = V4L2_FIELD_BOTTOM, .bytesperline = 720 * 2, .sizeimage = 720 * 2 * 288, .colorspace = V4L2_COLORSPACE_SMPTE170M}, }; static struct v4l2_pix_format formats_60[] = { { /*NTSC interlaced */ .width = 720, .height = 480, .pixelformat = V4L2_PIX_FMT_UYVY, .field = V4L2_FIELD_INTERLACED, .bytesperline = 720 * 2, .sizeimage = 720 * 2 * 480, .colorspace = V4L2_COLORSPACE_SMPTE170M}, { /*NTSC top */ .width = 720, .height = 240, .pixelformat = V4L2_PIX_FMT_UYVY, .field = V4L2_FIELD_TOP, .bytesperline = 720 * 2, .sizeimage = 720 * 2 * 240, .colorspace = V4L2_COLORSPACE_SMPTE170M}, { /*NTSC bottom */ .width = 720, .height = 240, .pixelformat = V4L2_PIX_FMT_UYVY, .field = V4L2_FIELD_BOTTOM, .bytesperline = 720 * 2, .sizeimage = 720 * 2 * 240, .colorspace = V4L2_COLORSPACE_SMPTE170M}, }; /* Write VIP register */ static inline void reg_write(struct sta2x11_vip *vip, unsigned int reg, u32 val) { iowrite32((val), (vip->iomem)+(reg)); } /* Read VIP register */ static inline u32 reg_read(struct sta2x11_vip *vip, unsigned int reg) { return ioread32((vip->iomem)+(reg)); } /* Start DMA acquisition */ static void start_dma(struct sta2x11_vip *vip, struct vip_buffer *vip_buf) { unsigned long offset = 0; if (vip->format.field == V4L2_FIELD_INTERLACED) offset = vip->format.width * 2; spin_lock_irq(&vip->slock); /* Enable acquisition */ reg_write(vip, DVP_CTL, reg_read(vip, DVP_CTL) | DVP_CTL_ENA); /* Set Top and Bottom Field memory address */ reg_write(vip, DVP_VTP, (u32)vip_buf->dma); reg_write(vip, DVP_VBP, (u32)vip_buf->dma + offset); spin_unlock_irq(&vip->slock); } /* Fetch the next buffer to activate */ static void vip_active_buf_next(struct sta2x11_vip *vip) { /* Get the next buffer */ spin_lock(&vip->lock); if (list_empty(&vip->buffer_list)) {/* No available buffer */ spin_unlock(&vip->lock); return; } vip->active = list_first_entry(&vip->buffer_list, struct vip_buffer, list); /* Reset Top and Bottom counter */ vip->tcount = 0; vip->bcount = 0; spin_unlock(&vip->lock); if (vb2_is_streaming(&vip->vb_vidq)) { /* streaming is on */ start_dma(vip, vip->active); /* start dma capture */ } } /* Videobuf2 Operations */ static int queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) { struct sta2x11_vip *vip = vb2_get_drv_priv(vq); if (!(*nbuffers) || *nbuffers < MAX_FRAMES) *nbuffers = MAX_FRAMES; *nplanes = 1; sizes[0] = vip->format.sizeimage; alloc_ctxs[0] = vip->alloc_ctx; vip->sequence = 0; vip->active = NULL; vip->tcount = 0; vip->bcount = 0; return 0; }; static int buffer_init(struct vb2_buffer *vb) { struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct vip_buffer *vip_buf = to_vip_buffer(vbuf); vip_buf->dma = vb2_dma_contig_plane_dma_addr(vb, 0); INIT_LIST_HEAD(&vip_buf->list); return 0; } static int buffer_prepare(struct vb2_buffer *vb) { struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct sta2x11_vip *vip = vb2_get_drv_priv(vb->vb2_queue); struct vip_buffer *vip_buf = to_vip_buffer(vbuf); unsigned long size; size = vip->format.sizeimage; if (vb2_plane_size(vb, 0) < size) { v4l2_err(&vip->v4l2_dev, "buffer too small (%lu < %lu)\n", vb2_plane_size(vb, 0), size); return -EINVAL; } vb2_set_plane_payload(&vip_buf->vb.vb2_buf, 0, size); return 0; } static void buffer_queue(struct vb2_buffer *vb) { struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct sta2x11_vip *vip = vb2_get_drv_priv(vb->vb2_queue); struct vip_buffer *vip_buf = to_vip_buffer(vbuf); spin_lock(&vip->lock); list_add_tail(&vip_buf->list, &vip->buffer_list); if (!vip->active) { /* No active buffer, active the first one */ vip->active = list_first_entry(&vip->buffer_list, struct vip_buffer, list); if (vb2_is_streaming(&vip->vb_vidq)) /* streaming is on */ start_dma(vip, vip_buf); /* start dma capture */ } spin_unlock(&vip->lock); } static void buffer_finish(struct vb2_buffer *vb) { struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct sta2x11_vip *vip = vb2_get_drv_priv(vb->vb2_queue); struct vip_buffer *vip_buf = to_vip_buffer(vbuf); /* Buffer handled, remove it from the list */ spin_lock(&vip->lock); list_del_init(&vip_buf->list); spin_unlock(&vip->lock); if (vb2_is_streaming(vb->vb2_queue)) vip_active_buf_next(vip); } static int start_streaming(struct vb2_queue *vq, unsigned int count) { struct sta2x11_vip *vip = vb2_get_drv_priv(vq); spin_lock_irq(&vip->slock); /* Enable interrupt VSYNC Top and Bottom*/ reg_write(vip, DVP_ITM, DVP_IT_VSB | DVP_IT_VST); spin_unlock_irq(&vip->slock); if (count) start_dma(vip, vip->active); return 0; } /* abort streaming and wait for last buffer */ static void stop_streaming(struct vb2_queue *vq) { struct sta2x11_vip *vip = vb2_get_drv_priv(vq); struct vip_buffer *vip_buf, *node; /* Disable acquisition */ reg_write(vip, DVP_CTL, reg_read(vip, DVP_CTL) & ~DVP_CTL_ENA); /* Disable all interrupts */ reg_write(vip, DVP_ITM, 0); /* Release all active buffers */ spin_lock(&vip->lock); list_for_each_entry_safe(vip_buf, node, &vip->buffer_list, list) { vb2_buffer_done(&vip_buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); list_del(&vip_buf->list); } spin_unlock(&vip->lock); } static struct vb2_ops vip_video_qops = { .queue_setup = queue_setup, .buf_init = buffer_init, .buf_prepare = buffer_prepare, .buf_finish = buffer_finish, .buf_queue = buffer_queue, .start_streaming = start_streaming, .stop_streaming = stop_streaming, }; /* File Operations */ static const struct v4l2_file_operations vip_fops = { .owner = THIS_MODULE, .open = v4l2_fh_open, .release = vb2_fop_release, .unlocked_ioctl = video_ioctl2, .read = vb2_fop_read, .mmap = vb2_fop_mmap, .poll = vb2_fop_poll }; /** * vidioc_querycap - return capabilities of device * @file: descriptor of device * @cap: contains return values * * the capabilities of the device are returned * * return value: 0, no error. */ static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { struct sta2x11_vip *vip = video_drvdata(file); strcpy(cap->driver, KBUILD_MODNAME); strcpy(cap->card, KBUILD_MODNAME); snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s", pci_name(vip->pdev)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } /** * vidioc_s_std - set video standard * @file: descriptor of device * @std: contains standard to be set * * the video standard is set * * return value: 0, no error. * * -EIO, no input signal detected * * other, returned from video DAC. */ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id std) { struct sta2x11_vip *vip = video_drvdata(file); /* * This is here for backwards compatibility only. * The use of V4L2_STD_ALL to trigger a querystd is non-standard. */ if (std == V4L2_STD_ALL) { v4l2_subdev_call(vip->decoder, video, querystd, &std); if (std == V4L2_STD_UNKNOWN) return -EIO; } if (vip->std != std) { vip->std = std; if (V4L2_STD_525_60 & std) vip->format = formats_60[0]; else vip->format = formats_50[0]; } return v4l2_subdev_call(vip->decoder, video, s_std, std); } /** * vidioc_g_std - get video standard * @file: descriptor of device * @std: contains return values * * the current video standard is returned * * return value: 0, no error. */ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *std) { struct sta2x11_vip *vip = video_drvdata(file); *std = vip->std; return 0; } /** * vidioc_querystd - get possible video standards * @file: descriptor of device * @std: contains return values * * all possible video standards are returned * * return value: delivered by video DAC routine. */ static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *std) { struct sta2x11_vip *vip = video_drvdata(file); return v4l2_subdev_call(vip->decoder, video, querystd, std); } static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *inp) { if (inp->index > 1) return -EINVAL; inp->type = V4L2_INPUT_TYPE_CAMERA; inp->std = V4L2_STD_ALL; sprintf(inp->name, "Camera %u", inp->index); return 0; } /** * vidioc_s_input - set input line * @file: descriptor of device * @i: new input line number * * the current active input line is set * * return value: 0, no error. * * -EINVAL, line number out of range */ static int vidioc_s_input(struct file *file, void *priv, unsigned int i) { struct sta2x11_vip *vip = video_drvdata(file); int ret; if (i > 1) return -EINVAL; ret = v4l2_subdev_call(vip->decoder, video, s_routing, i, 0, 0); if (!ret) vip->input = i; return 0; } /** * vidioc_g_input - return input line * @file: descriptor of device * @i: returned input line number * * the current active input line is returned * * return value: always 0. */ static int vidioc_g_input(struct file *file, void *priv, unsigned int *i) { struct sta2x11_vip *vip = video_drvdata(file); *i = vip->input; return 0; } /** * vidioc_enum_fmt_vid_cap - return video capture format * @f: returned format information * * returns name and format of video capture * Only UYVY is supported by hardware. * * return value: always 0. */ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *f) { if (f->index != 0) return -EINVAL; strcpy(f->description, "4:2:2, packed, UYVY"); f->pixelformat = V4L2_PIX_FMT_UYVY; f->flags = 0; return 0; } /** * vidioc_try_fmt_vid_cap - set video capture format * @file: descriptor of device * @f: new format * * new video format is set which includes width and * field type. width is fixed to 720, no scaling. * Only UYVY is supported by this hardware. * the minimum height is 200, the maximum is 576 (PAL) * * return value: 0, no error * * -EINVAL, pixel or field format not supported * */ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f) { struct sta2x11_vip *vip = video_drvdata(file); int interlace_lim; if (V4L2_PIX_FMT_UYVY != f->fmt.pix.pixelformat) { v4l2_warn(&vip->v4l2_dev, "Invalid format, only UYVY supported\n"); return -EINVAL; } if (V4L2_STD_525_60 & vip->std) interlace_lim = 240; else interlace_lim = 288; switch (f->fmt.pix.field) { default: case V4L2_FIELD_ANY: if (interlace_lim < f->fmt.pix.height) f->fmt.pix.field = V4L2_FIELD_INTERLACED; else f->fmt.pix.field = V4L2_FIELD_BOTTOM; break; case V4L2_FIELD_TOP: case V4L2_FIELD_BOTTOM: if (interlace_lim < f->fmt.pix.height) f->fmt.pix.height = interlace_lim; break; case V4L2_FIELD_INTERLACED: break; } /* It is the only supported format */ f->fmt.pix.pixelformat = V4L2_PIX_FMT_UYVY; f->fmt.pix.height &= ~1; if (2 * interlace_lim < f->fmt.pix.height) f->fmt.pix.height = 2 * interlace_lim; if (200 > f->fmt.pix.height) f->fmt.pix.height = 200; f->fmt.pix.width = 720; f->fmt.pix.bytesperline = f->fmt.pix.width * 2; f->fmt.pix.sizeimage = f->fmt.pix.width * 2 * f->fmt.pix.height; f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; return 0; } /** * vidioc_s_fmt_vid_cap - set current video format parameters * @file: descriptor of device * @f: returned format information * * set new capture format * return value: 0, no error * * other, delivered by video DAC routine. */ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f) { struct sta2x11_vip *vip = video_drvdata(file); unsigned int t_stop, b_stop, pitch; int ret; ret = vidioc_try_fmt_vid_cap(file, priv, f); if (ret) return ret; if (vb2_is_busy(&vip->vb_vidq)) { /* Can't change format during acquisition */ v4l2_err(&vip->v4l2_dev, "device busy\n"); return -EBUSY; } vip->format = f->fmt.pix; switch (vip->format.field) { case V4L2_FIELD_INTERLACED: t_stop = ((vip->format.height / 2 - 1) << 16) | (2 * vip->format.width - 1); b_stop = t_stop; pitch = 4 * vip->format.width; break; case V4L2_FIELD_TOP: t_stop = ((vip->format.height - 1) << 16) | (2 * vip->format.width - 1); b_stop = (0 << 16) | (2 * vip->format.width - 1); pitch = 2 * vip->format.width; break; case V4L2_FIELD_BOTTOM: t_stop = (0 << 16) | (2 * vip->format.width - 1); b_stop = (vip->format.height << 16) | (2 * vip->format.width - 1); pitch = 2 * vip->format.width; break; default: v4l2_err(&vip->v4l2_dev, "unknown field format\n"); return -EINVAL; } spin_lock_irq(&vip->slock); /* Y-X Top Field Offset */ reg_write(vip, DVP_TFO, 0); /* Y-X Bottom Field Offset */ reg_write(vip, DVP_BFO, 0); /* Y-X Top Field Stop*/ reg_write(vip, DVP_TFS, t_stop); /* Y-X Bottom Field Stop */ reg_write(vip, DVP_BFS, b_stop); /* Video Memory Pitch */ reg_write(vip, DVP_VMP, pitch); spin_unlock_irq(&vip->slock); return 0; } /** * vidioc_g_fmt_vid_cap - get current video format parameters * @file: descriptor of device * @f: contains format information * * returns current video format parameters * * return value: 0, always successful */ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f) { struct sta2x11_vip *vip = video_drvdata(file); f->fmt.pix = vip->format; return 0; } static const struct v4l2_ioctl_ops vip_ioctl_ops = { .vidioc_querycap = vidioc_querycap, /* FMT handling */ .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap, /* Buffer handlers */ .vidioc_create_bufs = vb2_ioctl_create_bufs, .vidioc_prepare_buf = vb2_ioctl_prepare_buf, .vidioc_reqbufs = vb2_ioctl_reqbufs, .vidioc_querybuf = vb2_ioctl_querybuf, .vidioc_qbuf = vb2_ioctl_qbuf, .vidioc_dqbuf = vb2_ioctl_dqbuf, /* Stream on/off */ .vidioc_streamon = vb2_ioctl_streamon, .vidioc_streamoff = vb2_ioctl_streamoff, /* Standard handling */ .vidioc_g_std = vidioc_g_std, .vidioc_s_std = vidioc_s_std, .vidioc_querystd = vidioc_querystd, /* Input handling */ .vidioc_enum_input = vidioc_enum_input, .vidioc_g_input = vidioc_g_input, .vidioc_s_input = vidioc_s_input, /* Log status ioctl */ .vidioc_log_status = v4l2_ctrl_log_status, /* Event handling */ .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; static struct video_device video_dev_template = { .name = KBUILD_MODNAME, .release = video_device_release_empty, .fops = &vip_fops, .ioctl_ops = &vip_ioctl_ops, .tvnorms = V4L2_STD_ALL, }; /** * vip_irq - interrupt routine * @irq: Number of interrupt ( not used, correct number is assumed ) * @vip: local data structure containing all information * * check for both frame interrupts set ( top and bottom ). * check FIFO overflow, but limit number of log messages after open. * signal a complete buffer if done * * return value: IRQ_NONE, interrupt was not generated by VIP * * IRQ_HANDLED, interrupt done. */ static irqreturn_t vip_irq(int irq, struct sta2x11_vip *vip) { unsigned int status; status = reg_read(vip, DVP_ITS); if (!status) /* No interrupt to handle */ return IRQ_NONE; if (status & DVP_IT_FIFO) if (vip->overflow++ > 5) pr_info("VIP: fifo overflow\n"); if ((status & DVP_IT_VST) && (status & DVP_IT_VSB)) { /* this is bad, we are too slow, hope the condition is gone * on the next frame */ return IRQ_HANDLED; } if (status & DVP_IT_VST) if ((++vip->tcount) < 2) return IRQ_HANDLED; if (status & DVP_IT_VSB) { vip->bcount++; return IRQ_HANDLED; } if (vip->active) { /* Acquisition is over on this buffer */ /* Disable acquisition */ reg_write(vip, DVP_CTL, reg_read(vip, DVP_CTL) & ~DVP_CTL_ENA); /* Remove the active buffer from the list */ vip->active->vb.vb2_buf.timestamp = ktime_get_ns(); vip->active->vb.sequence = vip->sequence++; vb2_buffer_done(&vip->active->vb.vb2_buf, VB2_BUF_STATE_DONE); } return IRQ_HANDLED; } static void sta2x11_vip_init_register(struct sta2x11_vip *vip) { /* Register initialization */ spin_lock_irq(&vip->slock); /* Clean interrupt */ reg_read(vip, DVP_ITS); /* Enable Half Line per vertical */ reg_write(vip, DVP_HLFLN, DVP_HLFLN_SD); /* Reset VIP control */ reg_write(vip, DVP_CTL, DVP_CTL_RST); /* Clear VIP control */ reg_write(vip, DVP_CTL, 0); spin_unlock_irq(&vip->slock); } static void sta2x11_vip_clear_register(struct sta2x11_vip *vip) { spin_lock_irq(&vip->slock); /* Disable interrupt */ reg_write(vip, DVP_ITM, 0); /* Reset VIP Control */ reg_write(vip, DVP_CTL, DVP_CTL_RST); /* Clear VIP Control */ reg_write(vip, DVP_CTL, 0); /* Clean VIP Interrupt */ reg_read(vip, DVP_ITS); spin_unlock_irq(&vip->slock); } static int sta2x11_vip_init_buffer(struct sta2x11_vip *vip) { int err; err = dma_set_coherent_mask(&vip->pdev->dev, DMA_BIT_MASK(29)); if (err) { v4l2_err(&vip->v4l2_dev, "Cannot configure coherent mask"); return err; } memset(&vip->vb_vidq, 0, sizeof(struct vb2_queue)); vip->vb_vidq.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vip->vb_vidq.io_modes = VB2_MMAP | VB2_READ; vip->vb_vidq.drv_priv = vip; vip->vb_vidq.buf_struct_size = sizeof(struct vip_buffer); vip->vb_vidq.ops = &vip_video_qops; vip->vb_vidq.mem_ops = &vb2_dma_contig_memops; vip->vb_vidq.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; err = vb2_queue_init(&vip->vb_vidq); if (err) return err; INIT_LIST_HEAD(&vip->buffer_list); spin_lock_init(&vip->lock); vip->alloc_ctx = vb2_dma_contig_init_ctx(&vip->pdev->dev); if (IS_ERR(vip->alloc_ctx)) { v4l2_err(&vip->v4l2_dev, "Can't allocate buffer context"); return PTR_ERR(vip->alloc_ctx); } return 0; } static void sta2x11_vip_release_buffer(struct sta2x11_vip *vip) { vb2_dma_contig_cleanup_ctx(vip->alloc_ctx); } static int sta2x11_vip_init_controls(struct sta2x11_vip *vip) { /* * Inititialize an empty control so VIP can inerithing controls * from ADV7180 */ v4l2_ctrl_handler_init(&vip->ctrl_hdl, 0); vip->v4l2_dev.ctrl_handler = &vip->ctrl_hdl; if (vip->ctrl_hdl.error) { int err = vip->ctrl_hdl.error; v4l2_ctrl_handler_free(&vip->ctrl_hdl); return err; } return 0; } /** * vip_gpio_reserve - reserve gpio pin * @dev: device * @pin: GPIO pin number * @dir: direction, input or output * @name: GPIO pin name * */ static int vip_gpio_reserve(struct device *dev, int pin, int dir, const char *name) { int ret; if (pin == -1) return 0; ret = gpio_request(pin, name); if (ret) { dev_err(dev, "Failed to allocate pin %d (%s)\n", pin, name); return ret; } ret = gpio_direction_output(pin, dir); if (ret) { dev_err(dev, "Failed to set direction for pin %d (%s)\n", pin, name); gpio_free(pin); return ret; } ret = gpio_export(pin, false); if (ret) { dev_err(dev, "Failed to export pin %d (%s)\n", pin, name); gpio_free(pin); return ret; } return 0; } /** * vip_gpio_release - release gpio pin * @dev: device * @pin: GPIO pin number * @name: GPIO pin name * */ static void vip_gpio_release(struct device *dev, int pin, const char *name) { if (pin != -1) { dev_dbg(dev, "releasing pin %d (%s)\n", pin, name); gpio_unexport(pin); gpio_free(pin); } } /** * sta2x11_vip_init_one - init one instance of video device * @pdev: PCI device * @ent: (not used) * * allocate reset pins for DAC. * Reset video DAC, this is done via reset line. * allocate memory for managing device * request interrupt * map IO region * register device * find and initialize video DAC * * return value: 0, no error * * -ENOMEM, no memory * * -ENODEV, device could not be detected or registered */ static int sta2x11_vip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { int ret; struct sta2x11_vip *vip; struct vip_config *config; /* Check if hardware support 26-bit DMA */ if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(26))) { dev_err(&pdev->dev, "26-bit DMA addressing not available\n"); return -EINVAL; } /* Enable PCI */ ret = pci_enable_device(pdev); if (ret) return ret; /* Get VIP platform data */ config = dev_get_platdata(&pdev->dev); if (!config) { dev_info(&pdev->dev, "VIP slot disabled\n"); ret = -EINVAL; goto disable; } /* Power configuration */ ret = vip_gpio_reserve(&pdev->dev, config->pwr_pin, 0, config->pwr_name); if (ret) goto disable; if (config->reset_pin >= 0) { ret = vip_gpio_reserve(&pdev->dev, config->reset_pin, 0, config->reset_name); if (ret) { vip_gpio_release(&pdev->dev, config->pwr_pin, config->pwr_name); goto disable; } } if (config->pwr_pin != -1) { /* Datasheet says 5ms between PWR and RST */ usleep_range(5000, 25000); ret = gpio_direction_output(config->pwr_pin, 1); } if (config->reset_pin != -1) { /* Datasheet says 5ms between PWR and RST */ usleep_range(5000, 25000); ret = gpio_direction_output(config->reset_pin, 1); } usleep_range(5000, 25000); /* Allocate a new VIP instance */ vip = kzalloc(sizeof(struct sta2x11_vip), GFP_KERNEL); if (!vip) { ret = -ENOMEM; goto release_gpios; } vip->pdev = pdev; vip->std = V4L2_STD_PAL; vip->format = formats_50[0]; vip->config = config; ret = sta2x11_vip_init_controls(vip); if (ret) goto free_mem; ret = v4l2_device_register(&pdev->dev, &vip->v4l2_dev); if (ret) goto free_mem; dev_dbg(&pdev->dev, "BAR #0 at 0x%lx 0x%lx irq %d\n", (unsigned long)pci_resource_start(pdev, 0), (unsigned long)pci_resource_len(pdev, 0), pdev->irq); pci_set_master(pdev); ret = pci_request_regions(pdev, KBUILD_MODNAME); if (ret) goto unreg; vip->iomem = pci_iomap(pdev, 0, 0x100); if (!vip->iomem) { ret = -ENOMEM; goto release; } pci_enable_msi(pdev); /* Initialize buffer */ ret = sta2x11_vip_init_buffer(vip); if (ret) goto unmap; spin_lock_init(&vip->slock); ret = request_irq(pdev->irq, (irq_handler_t) vip_irq, IRQF_SHARED, KBUILD_MODNAME, vip); if (ret) { dev_err(&pdev->dev, "request_irq failed\n"); ret = -ENODEV; goto release_buf; } /* Initialize and register video device */ vip->video_dev = video_dev_template; vip->video_dev.v4l2_dev = &vip->v4l2_dev; vip->video_dev.queue = &vip->vb_vidq; video_set_drvdata(&vip->video_dev, vip); ret = video_register_device(&vip->video_dev, VFL_TYPE_GRABBER, -1); if (ret) goto vrelease; /* Get ADV7180 subdevice */ vip->adapter = i2c_get_adapter(vip->config->i2c_id); if (!vip->adapter) { ret = -ENODEV; dev_err(&pdev->dev, "no I2C adapter found\n"); goto vunreg; } vip->decoder = v4l2_i2c_new_subdev(&vip->v4l2_dev, vip->adapter, "adv7180", vip->config->i2c_addr, NULL); if (!vip->decoder) { ret = -ENODEV; dev_err(&pdev->dev, "no decoder found\n"); goto vunreg; } i2c_put_adapter(vip->adapter); v4l2_subdev_call(vip->decoder, core, init, 0); sta2x11_vip_init_register(vip); dev_info(&pdev->dev, "STA2X11 Video Input Port (VIP) loaded\n"); return 0; vunreg: video_set_drvdata(&vip->video_dev, NULL); vrelease: video_unregister_device(&vip->video_dev); free_irq(pdev->irq, vip); release_buf: sta2x11_vip_release_buffer(vip); pci_disable_msi(pdev); unmap: vb2_queue_release(&vip->vb_vidq); pci_iounmap(pdev, vip->iomem); release: pci_release_regions(pdev); unreg: v4l2_device_unregister(&vip->v4l2_dev); free_mem: kfree(vip); release_gpios: vip_gpio_release(&pdev->dev, config->reset_pin, config->reset_name); vip_gpio_release(&pdev->dev, config->pwr_pin, config->pwr_name); disable: /* * do not call pci_disable_device on sta2x11 because it break all * other Bus masters on this EP */ return ret; } /** * sta2x11_vip_remove_one - release device * @pdev: PCI device * * Undo everything done in .._init_one * * unregister video device * free interrupt * unmap ioadresses * free memory * free GPIO pins */ static void sta2x11_vip_remove_one(struct pci_dev *pdev) { struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev); struct sta2x11_vip *vip = container_of(v4l2_dev, struct sta2x11_vip, v4l2_dev); sta2x11_vip_clear_register(vip); video_set_drvdata(&vip->video_dev, NULL); video_unregister_device(&vip->video_dev); free_irq(pdev->irq, vip); pci_disable_msi(pdev); vb2_queue_release(&vip->vb_vidq); pci_iounmap(pdev, vip->iomem); pci_release_regions(pdev); v4l2_device_unregister(&vip->v4l2_dev); vip_gpio_release(&pdev->dev, vip->config->pwr_pin, vip->config->pwr_name); vip_gpio_release(&pdev->dev, vip->config->reset_pin, vip->config->reset_name); kfree(vip); /* * do not call pci_disable_device on sta2x11 because it break all * other Bus masters on this EP */ } #ifdef CONFIG_PM /** * sta2x11_vip_suspend - set device into power save mode * @pdev: PCI device * @state: new state of device * * all relevant registers are saved and an attempt to set a new state is made. * * return value: 0 always indicate success, * even if device could not be disabled. (workaround for hardware problem) */ static int sta2x11_vip_suspend(struct pci_dev *pdev, pm_message_t state) { struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev); struct sta2x11_vip *vip = container_of(v4l2_dev, struct sta2x11_vip, v4l2_dev); unsigned long flags; int i; spin_lock_irqsave(&vip->slock, flags); vip->register_save_area[0] = reg_read(vip, DVP_CTL); reg_write(vip, DVP_CTL, vip->register_save_area[0] & DVP_CTL_DIS); vip->register_save_area[SAVE_COUNT] = reg_read(vip, DVP_ITM); reg_write(vip, DVP_ITM, 0); for (i = 1; i < SAVE_COUNT; i++) vip->register_save_area[i] = reg_read(vip, 4 * i); for (i = 0; i < AUX_COUNT; i++) vip->register_save_area[SAVE_COUNT + IRQ_COUNT + i] = reg_read(vip, registers_to_save[i]); spin_unlock_irqrestore(&vip->slock, flags); /* save pci state */ pci_save_state(pdev); if (pci_set_power_state(pdev, pci_choose_state(pdev, state))) { /* * do not call pci_disable_device on sta2x11 because it * break all other Bus masters on this EP */ vip->disabled = 1; } pr_info("VIP: suspend\n"); return 0; } /** * sta2x11_vip_resume - resume device operation * @pdev : PCI device * * re-enable device, set PCI state to powered and restore registers. * resume normal device operation afterwards. * * return value: 0, no error. * * other, could not set device to power on state. */ static int sta2x11_vip_resume(struct pci_dev *pdev) { struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev); struct sta2x11_vip *vip = container_of(v4l2_dev, struct sta2x11_vip, v4l2_dev); unsigned long flags; int ret, i; pr_info("VIP: resume\n"); /* restore pci state */ if (vip->disabled) { ret = pci_enable_device(pdev); if (ret) { pr_warn("VIP: Can't enable device.\n"); return ret; } vip->disabled = 0; } ret = pci_set_power_state(pdev, PCI_D0); if (ret) { /* * do not call pci_disable_device on sta2x11 because it * break all other Bus masters on this EP */ pr_warn("VIP: Can't enable device.\n"); vip->disabled = 1; return ret; } pci_restore_state(pdev); spin_lock_irqsave(&vip->slock, flags); for (i = 1; i < SAVE_COUNT; i++) reg_write(vip, 4 * i, vip->register_save_area[i]); for (i = 0; i < AUX_COUNT; i++) reg_write(vip, registers_to_save[i], vip->register_save_area[SAVE_COUNT + IRQ_COUNT + i]); reg_write(vip, DVP_CTL, vip->register_save_area[0]); reg_write(vip, DVP_ITM, vip->register_save_area[SAVE_COUNT]); spin_unlock_irqrestore(&vip->slock, flags); return 0; } #endif static const struct pci_device_id sta2x11_vip_pci_tbl[] = { {PCI_DEVICE(PCI_VENDOR_ID_STMICRO, PCI_DEVICE_ID_STMICRO_VIP)}, {0,} }; static struct pci_driver sta2x11_vip_driver = { .name = KBUILD_MODNAME, .probe = sta2x11_vip_init_one, .remove = sta2x11_vip_remove_one, .id_table = sta2x11_vip_pci_tbl, #ifdef CONFIG_PM .suspend = sta2x11_vip_suspend, .resume = sta2x11_vip_resume, #endif }; static int __init sta2x11_vip_init_module(void) { return pci_register_driver(&sta2x11_vip_driver); } static void __exit sta2x11_vip_exit_module(void) { pci_unregister_driver(&sta2x11_vip_driver); } #ifdef MODULE module_init(sta2x11_vip_init_module); module_exit(sta2x11_vip_exit_module); #else late_initcall_sync(sta2x11_vip_init_module); #endif MODULE_DESCRIPTION("STA2X11 Video Input Port driver"); MODULE_AUTHOR("Wind River"); MODULE_LICENSE("GPL v2"); MODULE_SUPPORTED_DEVICE("sta2x11 video input"); MODULE_VERSION(DRV_VERSION); MODULE_DEVICE_TABLE(pci, sta2x11_vip_pci_tbl);
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="sv"> <head> <!-- Generated by javadoc (version 1.7.0_71) on Wed Jul 13 20:46:57 CEST 2016 --> <title>API Help</title> <meta name="date" content="2016-07-13"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="API Help"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li><a href="overview-tree.html">Tree</a></li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-files/index-1.html">Index</a></li> <li class="navBarCell1Rev">Help</li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?help-doc.html" target="_top">Frames</a></li> <li><a href="help-doc.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 class="title">How This API Document Is Organized</h1> <div class="subTitle">This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.</div> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <h2>Overview</h2> <p>The <a href="overview-summary.html">Overview</a> page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.</p> </li> <li class="blockList"> <h2>Package</h2> <p>Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:</p> <ul> <li>Interfaces (italic)</li> <li>Classes</li> <li>Enums</li> <li>Exceptions</li> <li>Errors</li> <li>Annotation Types</li> </ul> </li> <li class="blockList"> <h2>Class/Interface</h2> <p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:</p> <ul> <li>Class inheritance diagram</li> <li>Direct Subclasses</li> <li>All Known Subinterfaces</li> <li>All Known Implementing Classes</li> <li>Class/interface declaration</li> <li>Class/interface description</li> </ul> <ul> <li>Nested Class Summary</li> <li>Field Summary</li> <li>Constructor Summary</li> <li>Method Summary</li> </ul> <ul> <li>Field Detail</li> <li>Constructor Detail</li> <li>Method Detail</li> </ul> <p>Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</p> </li> <li class="blockList"> <h2>Annotation Type</h2> <p>Each annotation type has its own separate page with the following sections:</p> <ul> <li>Annotation Type declaration</li> <li>Annotation Type description</li> <li>Required Element Summary</li> <li>Optional Element Summary</li> <li>Element Detail</li> </ul> </li> <li class="blockList"> <h2>Enum</h2> <p>Each enum has its own separate page with the following sections:</p> <ul> <li>Enum declaration</li> <li>Enum description</li> <li>Enum Constant Summary</li> <li>Enum Constant Detail</li> </ul> </li> <li class="blockList"> <h2>Tree (Class Hierarchy)</h2> <p>There is a <a href="overview-tree.html">Class Hierarchy</a> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.</p> <ul> <li>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.</li> <li>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</li> </ul> </li> <li class="blockList"> <h2>Deprecated API</h2> <p>The <a href="deprecated-list.html">Deprecated API</a> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</p> </li> <li class="blockList"> <h2>Index</h2> <p>The <a href="index-files/index-1.html">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p> </li> <li class="blockList"> <h2>Prev/Next</h2> <p>These links take you to the next or previous class, interface, package, or related page.</p> </li> <li class="blockList"> <h2>Frames/No Frames</h2> <p>These links show and hide the HTML frames. All pages are available with or without frames.</p> </li> <li class="blockList"> <h2>All Classes</h2> <p>The <a href="allclasses-noframe.html">All Classes</a> link shows all classes and interfaces except non-static nested types.</p> </li> <li class="blockList"> <h2>Serialized Form</h2> <p>Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.</p> </li> <li class="blockList"> <h2>Constant Field Values</h2> <p>The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.</p> </li> </ul> <em>This help file applies to API documentation generated using the standard doclet.</em></div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li><a href="overview-tree.html">Tree</a></li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-files/index-1.html">Index</a></li> <li class="navBarCell1Rev">Help</li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?help-doc.html" target="_top">Frames</a></li> <li><a href="help-doc.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "pile_set_name": "Github" }
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Steve Smith <[email protected]> # Atlassian open-source approval reference OSR-76. # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. # ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} DOCUMENTATION = """ module: jira version_added: "1.6" short_description: create and modify issues in a JIRA instance description: - Create and modify issues in a JIRA instance. options: uri: required: true description: - Base URI for the JIRA instance operation: required: true aliases: [ command ] choices: [ create, comment, edit, fetch, transition ] description: - The operation to perform. username: required: true description: - The username to log-in with. password: required: true description: - The password to log-in with. project: aliases: [ prj ] required: false description: - The project for this operation. Required for issue creation. summary: required: false description: - The issue summary, where appropriate. description: required: false description: - The issue description, where appropriate. issuetype: required: false description: - The issue type, for issue creation. issue: required: false description: - An existing issue key to operate on. comment: required: false description: - The comment text to add. status: required: false description: - The desired status; only relevant for the transition operation. assignee: required: false description: - Sets the assignee on create or transition operations. Note not all transitions will allow this. linktype: required: false version_added: 2.3 description: - Set type of link, when action 'link' selected inwardissue: required: false version_added: 2.3 description: - set issue from which link will be created outwardissue: required: false version_added: 2.3 description: - set issue to which link will be created fields: required: false description: - This is a free-form data structure that can contain arbitrary data. This is passed directly to the JIRA REST API (possibly after merging with other required data, as when passed to create). See examples for more information, and the JIRA REST API for the structure required for various fields. notes: - "Currently this only works with basic-auth." author: "Steve Smith (@tarka)" """ EXAMPLES = """ # Create a new issue and add a comment to it: - name: Create an issue jira: uri: '{{ server }}' username: '{{ user }}' password: '{{ pass }}' project: ANS operation: create summary: Example Issue description: Created using Ansible issuetype: Task register: issue - name: Comment on issue jira: uri: '{{ server }}' username: '{{ user }}' password: '{{ pass }}' issue: '{{ issue.meta.key }}' operation: comment comment: A comment added by Ansible # Assign an existing issue using edit - name: Assign an issue using free-form fields jira: uri: '{{ server }}' username: '{{ user }}' password: '{{ pass }}' issue: '{{ issue.meta.key}}' operation: edit assignee: ssmith # Create an issue with an existing assignee - name: Create an assigned issue jira: uri: '{{ server }}' username: '{{ user }}' password: '{{ pass }}' project: ANS operation: create summary: Assigned issue description: Created and assigned using Ansible issuetype: Task assignee: ssmith # Edit an issue - name: Set the labels on an issue using free-form fields jira: uri: '{{ server }}' username: '{{ user }}' password: '{{ pass }}' issue: '{{ issue.meta.key }}' operation: edit args: fields: labels: - autocreated - ansible # Retrieve metadata for an issue and use it to create an account - name: Get an issue jira: uri: '{{ server }}' username: '{{ user }}' password: '{{ pass }}' project: ANS operation: fetch issue: ANS-63 register: issue - name: Create a unix account for the reporter become: true user: name: '{{ issue.meta.fields.creator.name }}' comment: '{{issue.meta.fields.creator.displayName }}' - name: Create link from HSP-1 to MKY-1 jira: uri={{server}} username={{user}} password={{pass}} operation=link linktype=Relate inwardissue=HSP-1 outwardissue=MKY-1 # Transition an issue by target status - name: Close the issue jira: uri: '{{ server }}' username: '{{ user }}' password: '{{ pass }}' issue: '{{ issue.meta.key }}' operation: transition status: Done """ try: import json except ImportError: try: import simplejson as json except ImportError: # Let snippet from module_utils/basic.py return a proper error in this case pass import base64 from ansible.module_utils.basic import * from ansible.module_utils.urls import * from ansible.module_utils.pycompat24 import get_exception def request(url, user, passwd, data=None, method=None): if data: data = json.dumps(data) # NOTE: fetch_url uses a password manager, which follows the # standard request-then-challenge basic-auth semantics. However as # JIRA allows some unauthorised operations it doesn't necessarily # send the challenge, so the request occurs as the anonymous user, # resulting in unexpected results. To work around this we manually # inject the basic-auth header up-front to ensure that JIRA treats # the requests as authorized for this user. auth = base64.encodestring('%s:%s' % (user, passwd)).replace('\n', '') response, info = fetch_url(module, url, data=data, method=method, headers={'Content-Type':'application/json', 'Authorization':"Basic %s" % auth}) if info['status'] not in (200, 201, 204): module.fail_json(msg=info['msg']) body = response.read() if body: return json.loads(body) else: return {} def post(url, user, passwd, data): return request(url, user, passwd, data=data, method='POST') def put(url, user, passwd, data): return request(url, user, passwd, data=data, method='PUT') def get(url, user, passwd): return request(url, user, passwd) def create(restbase, user, passwd, params): createfields = { 'project': { 'key': params['project'] }, 'summary': params['summary'], 'description': params['description'], 'issuetype': { 'name': params['issuetype'] }} # Merge in any additional or overridden fields if params['fields']: createfields.update(params['fields']) data = {'fields': createfields} url = restbase + '/issue/' ret = post(url, user, passwd, data) return ret def comment(restbase, user, passwd, params): data = { 'body': params['comment'] } url = restbase + '/issue/' + params['issue'] + '/comment' ret = post(url, user, passwd, data) return ret def edit(restbase, user, passwd, params): data = { 'fields': params['fields'] } url = restbase + '/issue/' + params['issue'] ret = put(url, user, passwd, data) return ret def fetch(restbase, user, passwd, params): url = restbase + '/issue/' + params['issue'] ret = get(url, user, passwd) return ret def transition(restbase, user, passwd, params): # Find the transition id turl = restbase + '/issue/' + params['issue'] + "/transitions" tmeta = get(turl, user, passwd) target = params['status'] tid = None for t in tmeta['transitions']: if t['name'] == target: tid = t['id'] break if not tid: raise ValueError("Failed find valid transition for '%s'" % target) # Perform it url = restbase + '/issue/' + params['issue'] + "/transitions" data = { 'transition': { "id" : tid }, 'fields': params['fields']} ret = post(url, user, passwd, data) return ret def link(restbase, user, passwd, params): data = { 'type': { 'name': params['linktype'] }, 'inwardIssue': { 'key': params['inwardissue'] }, 'outwardIssue': { 'key': params['outwardissue'] }, } url = restbase + '/issueLink/' ret = post(url, user, passwd, data) return ret # Some parameters are required depending on the operation: OP_REQUIRED = dict(create=['project', 'issuetype', 'summary', 'description'], comment=['issue', 'comment'], edit=[], fetch=['issue'], transition=['status'], link=['linktype', 'inwardissue', 'outwardissue']) def main(): global module module = AnsibleModule( argument_spec=dict( uri=dict(required=True), operation=dict(choices=['create', 'comment', 'edit', 'fetch', 'transition', 'link'], aliases=['command'], required=True), username=dict(required=True), password=dict(required=True), project=dict(), summary=dict(), description=dict(), issuetype=dict(), issue=dict(aliases=['ticket']), comment=dict(), status=dict(), assignee=dict(), fields=dict(default={}, type='dict'), linktype=dict(), inwardissue=dict(), outwardissue=dict(), ), supports_check_mode=False ) op = module.params['operation'] # Check we have the necessary per-operation parameters missing = [] for parm in OP_REQUIRED[op]: if not module.params[parm]: missing.append(parm) if missing: module.fail_json(msg="Operation %s require the following missing parameters: %s" % (op, ",".join(missing))) # Handle rest of parameters uri = module.params['uri'] user = module.params['username'] passwd = module.params['password'] if module.params['assignee']: module.params['fields']['assignee'] = { 'name': module.params['assignee'] } if not uri.endswith('/'): uri = uri+'/' restbase = uri + 'rest/api/2' # Dispatch try: # Lookup the corresponding method for this operation. This is # safe as the AnsibleModule should remove any unknown operations. thismod = sys.modules[__name__] method = getattr(thismod, op) ret = method(restbase, user, passwd, module.params) except Exception: e = get_exception() return module.fail_json(msg=e.message) module.exit_json(changed=True, meta=ret) if __name__ == '__main__': main()
{ "pile_set_name": "Github" }
<!-- YAML added: v0.1.29 --> * `chunk` {string|Buffer} * `encoding` {string} * `callback` {Function} * 返回: {boolean} 发送一个请求主体的数据块。 通过多次调用此方法,可以将请求主体发送到服务器。 在这种情况下,建议在创建请求时使用 `['Transfer-Encoding', 'chunked']` 请求头行。 `encoding` 参数是可选的,仅当 `chunk` 是字符串时才适用。 默认为 `'utf8'`。 `callback` 参数是可选的,当刷新此数据块时调用,但仅当数据块非空时才会调用。 如果将整个数据成功刷新到内核缓冲区,则返回 `true`。 如果全部或部分数据在用户内存中排队,则返回 `false`。 当缓冲区再次空闲时,则触发 `'drain'` 事件。 当使用空字符串或 buffer 调用 `write` 函数时,则什么也不做且等待更多输入。
{ "pile_set_name": "Github" }
$NetBSD: distinfo,v 1.11 2020/07/09 08:36:41 adam Exp $ SHA1 (pyobjc-framework-ServiceManagement-6.2.2.tar.gz) = 35360f6d1dc8b96f203ea42a58c21bdf959d6531 RMD160 (pyobjc-framework-ServiceManagement-6.2.2.tar.gz) = bb3e584e25f5e1b8bdd909faf7f5c8c67641b542 SHA512 (pyobjc-framework-ServiceManagement-6.2.2.tar.gz) = 2385ea66329634dbfd6defa8e02ca18f69b2aca18086c3e041e1d5ac9257a36593d6331d72acaee7f8f7c3cf5625d3b037fae9199df31090aca89f3ff2b91316 Size (pyobjc-framework-ServiceManagement-6.2.2.tar.gz) = 11917 bytes
{ "pile_set_name": "Github" }
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:src="http://nwalsh.com/xmlns/litprog/fragment" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="5.0" xml:id="olink.outline.ext"> <refmeta> <refentrytitle>olink.outline.ext</refentrytitle> <refmiscinfo class="other" otherclass="datatype">string</refmiscinfo> </refmeta> <refnamediv> <refname>olink.outline.ext</refname> <refpurpose>The extension of OLink outline files</refpurpose> </refnamediv> <refsynopsisdiv> <src:fragment xml:id="olink.outline.ext.frag"> <xsl:param name="olink.outline.ext">.olink</xsl:param> </src:fragment> </refsynopsisdiv> <refsection><info><title>Description</title></info> <para>The extension to be expected for OLink outline files</para> <para>Bob has this parameter as dead. Please don't use</para> </refsection> </refentry>
{ "pile_set_name": "Github" }
<test-metadata> <benchmark-version>1.2</benchmark-version> <category>sqli</category> <test-number>00114</test-number> <vulnerability>false</vulnerability> <cwe>89</cwe> </test-metadata>
{ "pile_set_name": "Github" }