text
stringlengths
1
22.8M
```html <html> <head> <title>NVIDIA(R) PhysX(R) SDK 3.4 API Reference: Class Members</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css"> </head> <body bgcolor="#FFFFFF"> <div id="header"> <hr class="first"> <img alt="" src="images/PhysXlogo.png" align="middle"> <br> <center> <a class="qindex" href="main.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center> <hr class="second"> </div> <!-- Generated by Doxygen 1.5.8 --> <div class="tabs"> <ul> <li class="current"><a href="functions.html"><span>All</span></a></li> <li><a href="functions_func.html"><span>Functions</span></a></li> <li><a href="functions_vars.html"><span>Variables</span></a></li> <li><a href="functions_type.html"><span>Typedefs</span></a></li> <li><a href="functions_enum.html"><span>Enumerations</span></a></li> <li><a href="functions_eval.html"><span>Enumerator</span></a></li> <li><a href="functions_rela.html"><span>Related&nbsp;Functions</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="functions.html#index__"><span>_</span></a></li> <li><a href="functions_0x61.html#index_a"><span>a</span></a></li> <li><a href="functions_0x62.html#index_b"><span>b</span></a></li> <li><a href="functions_0x63.html#index_c"><span>c</span></a></li> <li class="current"><a href="functions_0x64.html#index_d"><span>d</span></a></li> <li><a href="functions_0x65.html#index_e"><span>e</span></a></li> <li><a href="functions_0x66.html#index_f"><span>f</span></a></li> <li><a href="functions_0x67.html#index_g"><span>g</span></a></li> <li><a href="functions_0x68.html#index_h"><span>h</span></a></li> <li><a href="functions_0x69.html#index_i"><span>i</span></a></li> <li><a href="functions_0x6b.html#index_k"><span>k</span></a></li> <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li> <li><a href="functions_0x6d.html#index_m"><span>m</span></a></li> <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li> <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li> <li><a href="functions_0x70.html#index_p"><span>p</span></a></li> <li><a href="functions_0x71.html#index_q"><span>q</span></a></li> <li><a href="functions_0x72.html#index_r"><span>r</span></a></li> <li><a href="functions_0x73.html#index_s"><span>s</span></a></li> <li><a href="functions_0x74.html#index_t"><span>t</span></a></li> <li><a href="functions_0x75.html#index_u"><span>u</span></a></li> <li><a href="functions_0x76.html#index_v"><span>v</span></a></li> <li><a href="functions_0x77.html#index_w"><span>w</span></a></li> <li><a href="functions_0x78.html#index_x"><span>x</span></a></li> <li><a href="functions_0x79.html#index_y"><span>y</span></a></li> <li><a href="functions_0x7a.html#index_z"><span>z</span></a></li> <li><a href="functions_0x7e.html#index_~"><span>~</span></a></li> </ul> </div> <div class="contents"> Here is a list of all class members with links to the classes they belong to: <p> <h3><a class="anchor" name="index_d">- d -</a></h3><ul> <li>d : <a class="el" href="classPxPlane.html#7cf263ac8ebddc47953a3fcbfc0a0455">PxPlane</a> <li>damping : <a class="el" href="structPx1DConstraint.html#c5dc79c3d9b9f4c81ffb4ec77941fb40">Px1DConstraint</a> , <a class="el" href="classPxJointLimitParameters.html#ac6d185cfc3adea24cdb943cf893beac">PxJointLimitParameters</a> , <a class="el" href="classPxSpring.html#0a87d5342df941b96ac1ad97dc3eb306">PxSpring</a> <li>data : <a class="el" href="structPxQueryFilterData.html#8a0359e9d009598fb7e09d7dfc375456">PxQueryFilterData</a> , <a class="el" href="structPxStridedData.html#d98a9e00d44b1c2c48c6dec114693f18">PxStridedData</a> , <a class="el" href="structPxTypedStridedData.html#6c2abde7dd9d76ea38eae00b7afa958a">PxTypedStridedData&lt; TDataType &gt;</a> <li>deallocate() : <a class="el" href="classPxDefaultAllocator.html#73221f0158b7740403cd922dca5408fd">PxDefaultAllocator</a> , <a class="el" href="classPxAllocatorCallback.html#6af8b56b5a786150796b9854d16fde38">PxAllocatorCallback</a> <li>deltaXP : <a class="el" href="structPxControllerState.html#b29dba2a8c3b33fb25b9d460ebf0fee8">PxControllerState</a> <li>denormalizedNormal() : <a class="el" href="classPxTriangle.html#2d7de197aa065e126b4074ca1a0e72f4">PxTriangle</a> <li>density : <a class="el" href="classPxControllerDesc.html#6da1c7c40072c2419015dc40e754ab66">PxControllerDesc</a> <li>densityBuffer : <a class="el" href="classPxParticleFluidReadData.html#faf473d99ac091f4eab7bfa5f8e0f6a1">PxParticleFluidReadData</a> <li>detachShape() : <a class="el" href="classPxRigidActor.html#467f9dc1517978b8d517936a475d3c4c">PxRigidActor</a> <li>DeviceToHost : <a class="el" href="structphysx_1_1PxGpuTaskHint.html#your_sha256_hash>physx::PxGpuTaskHint</a> <li>dir : <a class="el" href="structPxControllerHit.html#2b0631afdd736ccd98fc3250c27c5864">PxControllerHit</a> <li>disableWheel() : <a class="el" href="classPxVehicleWheelsSimData.html#98eb5965f7c02a507ae7979cea8b54c0">PxVehicleWheelsSimData</a> <li>disconnect() : <a class="el" href="classPxPvd.html#fe4f8510743ad3ac6b98ef0b94597299">PxPvd</a> , <a class="el" href="classPxPvdTransport.html#cf8e898a2f3b47581545e166015218b4">PxPvdTransport</a> <li>distance : <a class="el" href="structPxLocationHit.html#daccd7aa233279818ecdf50356ed0c76">PxLocationHit</a> , <a class="el" href="structPxClothCollisionPlane.html#488afcb958cda9593710f6fafc17c26d">PxClothCollisionPlane</a> , <a class="el" href="classPxPlane.html#62350635f430e98c8c752b3649401803">PxPlane</a> <li>distanceSquared() : <a class="el" href="structPxExtendedVec3.html#22394a46dcdc626c8bc84361070b6586">PxExtendedVec3</a> <li>dominance0 : <a class="el" href="structPxDominanceGroupPair.html#ca0435bf44309f7b432df322c32deb8a">PxDominanceGroupPair</a> <li>dominance1 : <a class="el" href="structPxDominanceGroupPair.html#5767359f402fbda972c3a44e5d86aa75">PxDominanceGroupPair</a> <li>doRaycastCCD() : <a class="el" href="classRaycastCCDManager.html#6023b5afa45982aa31f9310ca649bab2">RaycastCCDManager</a> <li>dot() : <a class="el" href="classPxVec2.html#df189688aa95d9b60da424f8728eae28">PxVec2</a> , <a class="el" href="classPxVec4.html#3fdaa88c7a4fcc660d0cd858bbde1012">PxVec4</a> , <a class="el" href="classPxVec3.html#f29c27e8aae481d97570e7990388bdf5">PxVec3</a> , <a class="el" href="structPxExtendedVec3.html#88c2a501b8808fd689144b3f40e58ec0">PxExtendedVec3</a> , <a class="el" href="classPxQuat.html#c41840a9219dd8c85c61233020ffab5a">PxQuat</a> <li>drawLines() : <a class="el" href="classPxPvdSceneClient.html#21e113d4a346e863848c6c30d53c594c">PxPvdSceneClient</a> <li>drawPoints() : <a class="el" href="classPxPvdSceneClient.html#1f356a5ae75e8ec68026b3773f0e38ed">PxPvdSceneClient</a> <li>drawText() : <a class="el" href="classPxPvdSceneClient.html#f78c548dbc479e5cc41cd6046f06d390">PxPvdSceneClient</a> <li>drawTriangles() : <a class="el" href="classPxPvdSceneClient.html#2f6ba1cc210504c47594e2143cb64ec9">PxPvdSceneClient</a> <li>dumpBinaryMetaData() : <a class="el" href="classPxSerialization.html#86026f68eb651de87e4a7720bc708893">PxSerialization</a> <li>dynamicFriction : <a class="el" href="structPxModifiableContact.html#c38e4614b09fbbf10d8044b0630a7ac3">PxModifiableContact</a> , <a class="el" href="structPxContactPatch.html#02ea0a2efb0fed52c4cb9a8219c5d275">PxContactPatch</a> <li>dynamicStructure : <a class="el" href="classPxSceneDesc.html#038ba820b16315ea55c6e12a3cbe2b7f">PxSceneDesc</a> <li>dynamicTreeRebuildRateHint : <a class="el" href="classPxSceneDesc.html#c3270ea72968fc446cacb81a7ce683d3">PxSceneDesc</a> </ul> </div> <hr style="width: 100%; height: 2px;"><br> </body> </html> ```
```xml <?xml version="1.0" encoding="UTF-8"?> <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> <file source-language="en" target-language="tr" datatype="plaintext" original="flashmessages.en.xlf"> <body> <trans-unit id="S9k1S7Z" resname="warning"> <source>warning</source> <target state="translated">Uyar</target> </trans-unit> <trans-unit id="WmrEP_5" resname="timesheet.stop.success"> <source>timesheet.stop.success</source> <target state="translated">Zaman kayd durduruldu</target> </trans-unit> <trans-unit id="NPBnpK_" resname="timesheet.stop.error"> <source>timesheet.stop.error</source> <target state="translated">Zaman kayd durdurulamad</target> </trans-unit> <trans-unit id="CCUoZga" resname="timesheet.start.success"> <source>timesheet.start.success</source> <target state="translated">Zaman kayd balatld</target> </trans-unit> <trans-unit id="3w9tuox" resname="timesheet.start.error"> <source>timesheet.start.error</source> <target state="translated">Zaman kayd balatlamad</target> </trans-unit> <trans-unit id="kPINWEK" resname="timesheet.locked.warning"> <source>timesheet.locked.warning</source> <target state="translated">Da aktarlan bir kayd dzenliyorsunuz</target> </trans-unit> <trans-unit id="72Ih8zO" resname="action.update.success"> <source>action.update.success</source> <target state="translated">Deiiklikler kaydedildi</target> </trans-unit> <trans-unit id="xeu1LSy" resname="action.update.error"> <source>action.update.error</source> <target state="translated">Deiiklikler kaydedilemed: %reason%</target> </trans-unit> <trans-unit id="YV50HDB" resname="action.delete.success"> <source>action.delete.success</source> <target state="translated">Kayt silindi</target> </trans-unit> <trans-unit id="mW91Tmb" resname="action.delete.error"> <source>action.delete.error</source> <target state="translated">Kayt silinemedi: %reason%</target> </trans-unit> <trans-unit id="B_cz49z" resname="invoice.first_template"> <source>invoice.first_template</source> <target state="translated">Devam edebilmek iin fatura ablonu oluturmanz gereklidir</target> </trans-unit> <trans-unit id="wejAEcR" resname="action.upload.error"> <source>action.upload.error</source> <target>Dosya karya yklenemedi veya kaydedilemedi: %reason%</target> </trans-unit> <trans-unit resname="action.csrf.error" id="bOE_q5R"> <source>action.csrf.error</source> <target>Eylem gerekletirilemedi: geersiz gvenlik belirteci.</target> </trans-unit> </body> </file> </xliff> ```
Chisa Hutchinson is an American playwright. Her plays have won multiple awards including the 2010 GLAAD Award, a Lilly Award in 2010, as well as a Lanford Wilson Award in 2015. She was a Lark Fellow as well as a Dramatist Guild Fellow in 2010–11. She was also a cast member of the Neo-Futurists in New York. Hutchinson was a staff writer for the Blue Man Group. She has been a member of New Dramatists for four years. Currently she is a Humanitas Fellow and the Tow Foundation Fellow at Second Stage. Hutchinson teaches creative writing at the University of Delaware. Most recently her play Somebody's Daughter was included on the 2017 Kilroys List which includes un-produced plays by female and trans playwrights. Early life Chisa Hutchinson was born in Queens, New York in 1980. At the age of four she was unofficially adopted by a family in Newark, New Jersey. At the age of 14 Hutchinson relocated to the Short Hills section of Millburn, New Jersey to attend Kent Place School. It is here that she was exposed to theatre for the first time. While attending high school, her drama teacher took her to attend a debate between August Wilson and Robert Brustein which inspired her to write African American centric theatre. Education Hutchinson attended Vassar College where she received a B.A. in Dramatic Arts. She would later go to earn her M.F.A. in Dramatic Writing from Tisch School of the Arts. At Vassar College, Hutchinson was the only Black drama major. Because her education was not exploring theatre by Black writers, Hutchinson felt compelled to create her own work. Themes Hutchinson's work centers around responding to social issues, although she states that, "the best way to write a play about a social issue is to not make it about a social issue." Her plays tell stories of people that are rarely seen on stage, such as transgender stories or stories of people of color. In interview she stated Plays She Likes Girls (Lark Play Development Center, Working Man's Clothes) Mama's Gonna Buy You (Inge Center for the Arts) This is not the Play (Mad Dog Theatre Company, Cleveland Public Theater) Sex on Sunday (Lark Play Development Center, the BE Company) Tunde's Trumpet (Summer Stage, BOOM Arts) The Subject (Atlantic Theatre Company, Playwrights' Foundation, Victory Gardens Theater, Partial Comfort, and Rattlestick Playwrights Theater) Somebody's Daughter (Cherry Lane Theatre, Second Stage) Alondra Was Here (the Wild Project) The Wedding Gift (Contemporary American Theatre Festival, Forward Flux) Dead & Breathing (Lark Play Development Center, National Black Theater) Awards GLAAD Award (2010) Lilly Award (2010) New York Innovative Theatre Award (2012) Paul Green Award (2013) Helen Merrill Award (2013) Lanford Wilson Award (2015) Personal life After the opening of her play She Likes Girls in 2008 Hutchinson's sexuality was put into the spotlight because the play centers around a young lesbian woman. Hutchinson however self identifies as bisexual. Critical reception Hutchinson's play She Likes Girls centers around a young lesbian couple at an inter-city high school. This play and the topics it deals with would lead her to receive a GLAAD (Gay and Lesbian Alliance Against Defamation) Award. Not only did the play win this award but it received positive reviews throughout its run in New York City. In 2022, Chisa Hutchinson was included in the book 50 Key Figures in Queer US Theatre, profiled in a chapter written by theatre scholar La Donna L. Forsgren. References External links Official website 1980 births Living people American women dramatists and playwrights Kent Place School alumni Vassar College alumni Tisch School of the Arts alumni University of Delaware faculty Writers from Queens, New York People from Millburn, New Jersey Writers from New Jersey 21st-century American dramatists and playwrights 21st-century American women writers 21st-century African-American women writers 21st-century African-American writers
```dns zone \data\ ngram 1=36 ngram 2=45 ngram 3=10 ngram 4=6 ngram 5=4 \1-grams: -1.383514 , -0.30103 -1.139057 . -0.845098 -1.029493 </s> -99 <s> -0.4149733 -1.285941 a -0.69897 -1.687872 also -0.30103 -1.687872 beyond -0.30103 -1.687872 biarritz -0.30103 -1.687872 call -0.30103 -1.687872 concerns -0.30103 -1.687872 consider -0.30103 -1.687872 considering -0.30103 -1.687872 for -0.30103 -1.509559 higher -0.30103 -1.687872 however -0.30103 -1.687872 i -0.30103 -1.687872 immediate -0.30103 -1.687872 in -0.30103 -1.687872 is -0.30103 -1.285941 little -0.69897 -1.383514 loin -0.30103 -1.687872 look -0.30103 -1.285941 looking -0.4771212 -1.206319 more -0.544068 -1.509559 on -0.4771212 -1.509559 screening -0.4771212 -1.687872 small -0.30103 -1.687872 the -0.30103 -1.687872 to -0.30103 -1.687872 watch -0.30103 -1.687872 watching -0.30103 -1.687872 what -0.30103 -1.687872 would -0.30103 -3.141592 foo -2.718281 bar 3.0 -6.535897 baz -0.0 \2-grams: -0.6925742 , . -0.7522095 , however -0.7522095 , is -0.0602359 . </s> -0.4846522 <s> looking -0.4771214 -1.051485 <s> screening -1.07153 <s> the -1.07153 <s> watching -1.07153 <s> what -0.09132547 a little -0.69897 -0.2922095 also call -0.2922095 beyond immediate -0.2705918 biarritz . -0.2922095 call for -0.2922095 concerns in -0.2922095 consider watch -0.2922095 considering consider -0.2834328 for , -0.5511513 higher more -0.5845945 higher small -0.2834328 however , -0.2922095 i would -0.2922095 immediate concerns -0.2922095 in biarritz -0.2922095 is to -0.09021038 little more -0.1998621 -0.7273645 loin , -0.6925742 loin . -0.6708385 loin </s> -0.2922095 look beyond -0.4638903 looking higher -0.4638903 looking on -0.4771212 -0.5136299 more . -0.4771212 -0.3561665 more loin -0.1649931 on a -0.4771213 -0.1649931 screening a -0.4771213 -0.2705918 small . -0.287799 the screening -0.2922095 to look -0.2622373 watch </s> -0.2922095 watching considering -0.2922095 what i -0.2922095 would also -2 also would -6 -6 foo bar \3-grams: -0.01916512 more . </s> -0.0283603 on a little -0.4771212 -0.0283603 screening a little -0.4771212 -0.01660496 a little more -0.09409451 -0.3488368 <s> looking higher -0.3488368 <s> looking on -0.4771212 -0.1892331 little more loin -0.04835128 looking on a -0.4771212 -3 also would consider -7 -7 to look a \4-grams: -0.009249173 looking on a little -0.4771212 -0.005464747 on a little more -0.4771212 -0.005464747 screening a little more -0.1453306 a little more loin -0.01552657 <s> looking on a -0.4771212 -4 also would consider higher -8 \5-grams: -0.003061223 <s> looking on a little -0.001813953 looking on a little more -0.0432557 on a little more loin -5 also would consider higher looking \end\ ```
```javascript export const now = () => { return Date.now(); }; export * from "./credentials.js"; ```
The 2013–14 UMass Lowell River Hawks men's basketball team represented the University of Massachusetts Lowell during the 2013–14 NCAA Division I men's basketball season. This was the River Hawks first year in Division I. They were coached by first year head coach Pat Duquette and played most of their home games at Costello Athletic Center. Three games were played at the Tsongas Center at UMass Lowell for the 2013-2014 season. They are members of the America East Conference. They finished the season 10–18, 8–8 in American East play to finish in fifth place. As part of their transition to Division I, they are ineligible for post season play until the 2017–18 season. Roster Schedule |- !colspan=9 style="background:#CC3333; color:#333399;"| Regular Season References UMass Lowell River Hawks men's basketball seasons UMass Lowell UMass Lowell River Hawks men's basketball UMass Lowell River Hawks men's basketball
```c /*your_sha256_hash--------- * * columnar_customscan.c * * This file contains the implementation of a postgres custom scan that * we use to push down the projections into the table access methods. * * $Id$ * *your_sha256_hash--------- */ #include <math.h> #include "postgres.h" #include "miscadmin.h" #include "access/amapi.h" #include "access/skey.h" #include "catalog/pg_am.h" #include "catalog/pg_statistic.h" #include "commands/defrem.h" #include "nodes/extensible.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" #include "nodes/pg_list.h" #include "nodes/plannodes.h" #include "optimizer/cost.h" #include "optimizer/optimizer.h" #include "optimizer/pathnode.h" #include "optimizer/paths.h" #include "optimizer/plancat.h" #include "optimizer/restrictinfo.h" #if PG_VERSION_NUM >= PG_VERSION_16 #include "parser/parse_relation.h" #include "parser/parsetree.h" #endif #include "utils/builtins.h" #include "utils/lsyscache.h" #include "utils/relcache.h" #include "utils/ruleutils.h" #include "utils/selfuncs.h" #include "utils/spccache.h" #include "citus_version.h" #include "columnar/columnar.h" #include "columnar/columnar_customscan.h" #include "columnar/columnar_metadata.h" #include "columnar/columnar_tableam.h" #include "distributed/listutils.h" /* * ColumnarScanState represents the state for a columnar scan. It's a * CustomScanState with additional fields specific to columnar scans. */ typedef struct ColumnarScanState { CustomScanState custom_scanstate; /* must be first field */ ExprContext *css_RuntimeContext; List *qual; } ColumnarScanState; typedef bool (*PathPredicate)(Path *path); /* functions to cost paths in-place */ static void CostColumnarPaths(PlannerInfo *root, RelOptInfo *rel, Oid relationId); static void CostColumnarIndexPath(PlannerInfo *root, RelOptInfo *rel, Oid relationId, IndexPath *indexPath); static void CostColumnarSeqPath(RelOptInfo *rel, Oid relationId, Path *path); static void CostColumnarScan(PlannerInfo *root, RelOptInfo *rel, Oid relationId, CustomPath *cpath, int numberOfColumnsRead, int nClauses); /* functions to add new paths */ static void AddColumnarScanPaths(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte); static void AddColumnarScanPath(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte, Relids required_relids); /* helper functions to be used when costing paths or altering them */ static void RemovePathsByPredicate(RelOptInfo *rel, PathPredicate removePathPredicate); static bool IsNotIndexPath(Path *path); static Cost ColumnarIndexScanAdditionalCost(PlannerInfo *root, RelOptInfo *rel, Oid relationId, IndexPath *indexPath); static int RelationIdGetNumberOfAttributes(Oid relationId); static Cost ColumnarPerStripeScanCost(RelOptInfo *rel, Oid relationId, int numberOfColumnsRead); static uint64 ColumnarTableStripeCount(Oid relationId); static Path * CreateColumnarSeqScanPath(PlannerInfo *root, RelOptInfo *rel, Oid relationId); static void AddColumnarScanPathsRec(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte, Relids paramRelids, Relids candidateRelids, int depthLimit); /* hooks and callbacks */ static void ColumnarSetRelPathlistHook(PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTblEntry *rte); static void ColumnarGetRelationInfoHook(PlannerInfo *root, Oid relationObjectId, bool inhparent, RelOptInfo *rel); static Plan * ColumnarScanPath_PlanCustomPath(PlannerInfo *root, RelOptInfo *rel, struct CustomPath *best_path, List *tlist, List *clauses, List *custom_plans); static List * ColumnarScanPath_ReparameterizeCustomPathByChild(PlannerInfo *root, List *custom_private, RelOptInfo *child_rel); static Node * ColumnarScan_CreateCustomScanState(CustomScan *cscan); static void ColumnarScan_BeginCustomScan(CustomScanState *node, EState *estate, int eflags); static TupleTableSlot * ColumnarScan_ExecCustomScan(CustomScanState *node); static void ColumnarScan_EndCustomScan(CustomScanState *node); static void ColumnarScan_ReScanCustomScan(CustomScanState *node); static void ColumnarScan_ExplainCustomScan(CustomScanState *node, List *ancestors, ExplainState *es); /* helper functions to build strings for EXPLAIN */ static const char * ColumnarPushdownClausesStr(List *context, List *clauses); static const char * ColumnarProjectedColumnsStr(List *context, List *projectedColumns); static List * set_deparse_context_planstate(List *dpcontext, Node *node, List *ancestors); /* other helpers */ static List * ColumnarVarNeeded(ColumnarScanState *columnarScanState); static Bitmapset * ColumnarAttrNeeded(ScanState *ss); #if PG_VERSION_NUM >= PG_VERSION_16 static Bitmapset * fixup_inherited_columns(Oid parentId, Oid childId, Bitmapset *columns); #endif /* saved hook value in case of unload */ static set_rel_pathlist_hook_type PreviousSetRelPathlistHook = NULL; static get_relation_info_hook_type PreviousGetRelationInfoHook = NULL; static bool EnableColumnarCustomScan = true; static bool EnableColumnarQualPushdown = true; static double ColumnarQualPushdownCorrelationThreshold = 0.9; static int ColumnarMaxCustomScanPaths = 64; static int ColumnarPlannerDebugLevel = DEBUG3; const struct CustomPathMethods ColumnarScanPathMethods = { .CustomName = "ColumnarScan", .PlanCustomPath = ColumnarScanPath_PlanCustomPath, .ReparameterizeCustomPathByChild = ColumnarScanPath_ReparameterizeCustomPathByChild, }; const struct CustomScanMethods ColumnarScanScanMethods = { .CustomName = "ColumnarScan", .CreateCustomScanState = ColumnarScan_CreateCustomScanState, }; const struct CustomExecMethods ColumnarScanExecuteMethods = { .CustomName = "ColumnarScan", .BeginCustomScan = ColumnarScan_BeginCustomScan, .ExecCustomScan = ColumnarScan_ExecCustomScan, .EndCustomScan = ColumnarScan_EndCustomScan, .ReScanCustomScan = ColumnarScan_ReScanCustomScan, .ExplainCustomScan = ColumnarScan_ExplainCustomScan, }; static const struct config_enum_entry debug_level_options[] = { { "debug5", DEBUG5, false }, { "debug4", DEBUG4, false }, { "debug3", DEBUG3, false }, { "debug2", DEBUG2, false }, { "debug1", DEBUG1, false }, { "debug", DEBUG2, true }, { "info", INFO, false }, { "notice", NOTICE, false }, { "warning", WARNING, false }, { "log", LOG, false }, { NULL, 0, false } }; /* * columnar_customscan_init installs the hook required to intercept the postgres planner and * provide extra paths for columnar tables */ void columnar_customscan_init() { PreviousSetRelPathlistHook = set_rel_pathlist_hook; set_rel_pathlist_hook = ColumnarSetRelPathlistHook; PreviousGetRelationInfoHook = get_relation_info_hook; get_relation_info_hook = ColumnarGetRelationInfoHook; /* register customscan specific GUC's */ DefineCustomBoolVariable( "columnar.enable_custom_scan", gettext_noop("Enables the use of a custom scan to push projections and quals " "into the storage layer."), NULL, &EnableColumnarCustomScan, true, PGC_USERSET, GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE, NULL, NULL, NULL); DefineCustomBoolVariable( "columnar.enable_qual_pushdown", gettext_noop("Enables qual pushdown into columnar. This has no effect unless " "columnar.enable_custom_scan is true."), NULL, &EnableColumnarQualPushdown, true, PGC_USERSET, GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE, NULL, NULL, NULL); DefineCustomRealVariable( "columnar.qual_pushdown_correlation_threshold", gettext_noop("Correlation threshold to attempt to push a qual " "referencing the given column. A value of 0 means " "attempt to push down all quals, even if the column " "is uncorrelated."), NULL, &ColumnarQualPushdownCorrelationThreshold, 0.9, 0.0, 1.0, PGC_USERSET, GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE, NULL, NULL, NULL); DefineCustomIntVariable( "columnar.max_custom_scan_paths", gettext_noop("Maximum number of custom scan paths to generate " "for a columnar table when planning."), NULL, &ColumnarMaxCustomScanPaths, 64, 1, 1024, PGC_USERSET, GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE, NULL, NULL, NULL); DefineCustomEnumVariable( "columnar.planner_debug_level", "Message level for columnar planning information.", NULL, &ColumnarPlannerDebugLevel, DEBUG3, debug_level_options, PGC_USERSET, 0, NULL, NULL, NULL); RegisterCustomScanMethods(&ColumnarScanScanMethods); } static void ColumnarSetRelPathlistHook(PlannerInfo *root, RelOptInfo *rel, Index rti, RangeTblEntry *rte) { /* call into previous hook if assigned */ if (PreviousSetRelPathlistHook) { PreviousSetRelPathlistHook(root, rel, rti, rte); } if (!OidIsValid(rte->relid) || rte->rtekind != RTE_RELATION || rte->inh) { /* some calls to the pathlist hook don't have a valid relation set. Do nothing */ return; } /* * Here we want to inspect if this relation pathlist hook is accessing a columnar table. * If that is the case we want to insert an extra path that pushes down the projection * into the scan of the table to minimize the data read. */ Relation relation = RelationIdGetRelation(rte->relid); if (!RelationIsValid(relation)) { ereport(ERROR, (errmsg("could not open relation with OID %u", rte->relid))); } if (relation->rd_tableam == GetColumnarTableAmRoutine()) { if (rte->tablesample != NULL) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("sample scans not supported on columnar tables"))); } if (list_length(rel->partial_pathlist) != 0) { /* * Parallel scans on columnar tables are already discardad by * ColumnarGetRelationInfoHook but be on the safe side. */ elog(ERROR, "parallel scans on columnar are not supported"); } /* * There are cases where IndexPath is normally more preferrable over * SeqPath for heapAM but not for columnarAM. In such cases, an * IndexPath could wrongly dominate a SeqPath based on the costs * estimated by postgres earlier. For this reason, here we manually * create a SeqPath, estimate the cost based on columnarAM and append * to pathlist. * * Before doing that, we first re-cost all the existing paths so that * add_path makes correct cost comparisons when appending our SeqPath. */ CostColumnarPaths(root, rel, rte->relid); Path *seqPath = CreateColumnarSeqScanPath(root, rel, rte->relid); add_path(rel, seqPath); if (EnableColumnarCustomScan) { ereport(DEBUG1, (errmsg("pathlist hook for columnar table am"))); /* * When columnar custom scan is enabled (columnar.enable_custom_scan), * we only consider ColumnarScanPath's & IndexPath's. For this reason, * we remove other paths and re-estimate IndexPath costs to make accurate * comparisons between them. * * Even more, we might calculate an equal cost for a * ColumnarCustomScan and a SeqPath if we are reading all columns * of given table since we don't consider chunk group filtering * when costing ColumnarCustomScan. * In that case, if we don't remove SeqPath's, we might wrongly choose * SeqPath thinking that its cost would be equal to ColumnarCustomScan. */ RemovePathsByPredicate(rel, IsNotIndexPath); AddColumnarScanPaths(root, rel, rte); } } RelationClose(relation); } static void ColumnarGetRelationInfoHook(PlannerInfo *root, Oid relationObjectId, bool inhparent, RelOptInfo *rel) { if (PreviousGetRelationInfoHook) { PreviousGetRelationInfoHook(root, relationObjectId, inhparent, rel); } if (IsColumnarTableAmTable(relationObjectId)) { /* disable parallel query */ rel->rel_parallel_workers = 0; /* disable index-only scan */ IndexOptInfo *indexOptInfo = NULL; foreach_ptr(indexOptInfo, rel->indexlist) { memset(indexOptInfo->canreturn, false, indexOptInfo->ncolumns * sizeof(bool)); } } } /* * RemovePathsByPredicate removes the paths that removePathPredicate * evaluates to true from pathlist of given rel. */ static void RemovePathsByPredicate(RelOptInfo *rel, PathPredicate removePathPredicate) { List *filteredPathList = NIL; Path *path = NULL; foreach_ptr(path, rel->pathlist) { if (!removePathPredicate(path)) { filteredPathList = lappend(filteredPathList, path); } } rel->pathlist = filteredPathList; } /* * IsNotIndexPath returns true if given path is not an IndexPath. */ static bool IsNotIndexPath(Path *path) { return !IsA(path, IndexPath); } /* * CreateColumnarSeqScanPath returns Path for sequential scan on columnar * table with relationId. */ static Path * CreateColumnarSeqScanPath(PlannerInfo *root, RelOptInfo *rel, Oid relationId) { /* columnar doesn't support parallel scan */ int parallelWorkers = 0; Relids requiredOuter = rel->lateral_relids; Path *path = create_seqscan_path(root, rel, requiredOuter, parallelWorkers); CostColumnarSeqPath(rel, relationId, path); return path; } /* * CostColumnarPaths re-costs paths of given RelOptInfo for * columnar table with relationId. */ static void CostColumnarPaths(PlannerInfo *root, RelOptInfo *rel, Oid relationId) { Path *path = NULL; foreach_ptr(path, rel->pathlist) { if (IsA(path, IndexPath)) { /* * Since we don't provide implementations for scan_bitmap_next_block * & scan_bitmap_next_tuple, postgres doesn't generate bitmap index * scan paths for columnar tables already (see related comments in * TableAmRoutine). For this reason, we only consider IndexPath's * here. */ CostColumnarIndexPath(root, rel, relationId, (IndexPath *) path); } else if (path->pathtype == T_SeqScan) { CostColumnarSeqPath(rel, relationId, path); } } } /* * CostColumnarIndexPath re-costs given index path for columnar table with * relationId. */ static void CostColumnarIndexPath(PlannerInfo *root, RelOptInfo *rel, Oid relationId, IndexPath *indexPath) { if (!enable_indexscan) { /* costs are already set to disable_cost, don't adjust them */ return; } ereport(DEBUG4, (errmsg("columnar table index scan costs estimated by " "indexAM: startup cost = %.10f, total cost = " "%.10f", indexPath->path.startup_cost, indexPath->path.total_cost))); /* * We estimate the cost for columnar table read during index scan. Also, * instead of overwriting total cost, we "add" ours to the cost estimated * by indexAM since we should consider index traversal related costs too. */ Cost columnarIndexScanCost = ColumnarIndexScanAdditionalCost(root, rel, relationId, indexPath); indexPath->path.total_cost += columnarIndexScanCost; ereport(DEBUG4, (errmsg("columnar table index scan costs re-estimated " "by columnarAM (including indexAM costs): " "startup cost = %.10f, total cost = %.10f", indexPath->path.startup_cost, indexPath->path.total_cost))); } /* * ColumnarIndexScanAdditionalCost returns additional cost estimated for * index scan described by IndexPath for columnar table with relationId. */ static Cost ColumnarIndexScanAdditionalCost(PlannerInfo *root, RelOptInfo *rel, Oid relationId, IndexPath *indexPath) { int numberOfColumnsRead = RelationIdGetNumberOfAttributes(relationId); Cost perStripeCost = ColumnarPerStripeScanCost(rel, relationId, numberOfColumnsRead); /* * We don't need to pass correct loop count to amcostestimate since we * will only use index correlation & index selectivity, and loop count * doesn't have any effect on those two. */ double fakeLoopCount = 1; Cost fakeIndexStartupCost; Cost fakeIndexTotalCost; double fakeIndexPages; Selectivity indexSelectivity; double indexCorrelation; amcostestimate_function amcostestimate = indexPath->indexinfo->amcostestimate; amcostestimate(root, indexPath, fakeLoopCount, &fakeIndexStartupCost, &fakeIndexTotalCost, &indexSelectivity, &indexCorrelation, &fakeIndexPages); Relation relation = RelationIdGetRelation(relationId); if (!RelationIsValid(relation)) { ereport(ERROR, (errmsg("could not open relation with OID %u", relationId))); } uint64 rowCount = ColumnarTableRowCount(relation); RelationClose(relation); double estimatedRows = rowCount * indexSelectivity; /* * In the worst case (i.e no correlation between the column & the index), * we need to read a different stripe for each row. */ double maxStripeReadCount = estimatedRows; /* * In the best case (i.e the column is fully correlated with the index), * we wouldn't read the same stripe again and again thanks * to locality. */ double avgStripeRowCount = rowCount / (double) ColumnarTableStripeCount(relationId); double minStripeReadCount = estimatedRows / avgStripeRowCount; /* * While being close to 0 means low correlation, being close to -1 or +1 * means high correlation. For index scans on columnar tables, it doesn't * matter if the column and the index are "correlated" (+1) or * "anti-correlated" (-1) since both help us avoiding from reading the * same stripe again and again. */ double absIndexCorrelation = float_abs(indexCorrelation); /* * To estimate the number of stripes that we need to read, we do linear * interpolation between minStripeReadCount & maxStripeReadCount. To do * that, we use complement to 1 of absolute correlation, where being * close to 0 means high correlation and being close to 1 means low * correlation. * In practice, we only want to do an index scan when absIndexCorrelation * is 1 (or extremely close to it), or when the absolute number of tuples * returned is very small. Other cases will have a prohibitive cost. */ double complementIndexCorrelation = 1 - absIndexCorrelation; double estimatedStripeReadCount = minStripeReadCount + complementIndexCorrelation * (maxStripeReadCount - minStripeReadCount); /* even in the best case, we will read a single stripe */ estimatedStripeReadCount = Max(estimatedStripeReadCount, 1.0); Cost scanCost = perStripeCost * estimatedStripeReadCount; ereport(DEBUG4, (errmsg("re-costing index scan for columnar table: " "selectivity = %.10f, complement abs " "correlation = %.10f, per stripe cost = %.10f, " "estimated stripe read count = %.10f, " "total additional cost = %.10f", indexSelectivity, complementIndexCorrelation, perStripeCost, estimatedStripeReadCount, scanCost))); return scanCost; } /* * CostColumnarSeqPath sets costs given seq path for columnar table with * relationId. */ static void CostColumnarSeqPath(RelOptInfo *rel, Oid relationId, Path *path) { if (!enable_seqscan) { /* costs are already set to disable_cost, don't adjust them */ return; } /* * Seq scan doesn't support projection or qual pushdown, so we will read * all the stripes and all the columns. */ double stripesToRead = ColumnarTableStripeCount(relationId); int numberOfColumnsRead = RelationIdGetNumberOfAttributes(relationId); path->startup_cost = 0; path->total_cost = stripesToRead * ColumnarPerStripeScanCost(rel, relationId, numberOfColumnsRead); } /* * RelationIdGetNumberOfAttributes returns number of attributes that relation * with relationId has. */ static int RelationIdGetNumberOfAttributes(Oid relationId) { Relation relation = RelationIdGetRelation(relationId); if (!RelationIsValid(relation)) { ereport(ERROR, (errmsg("could not open relation with OID %u", relationId))); } int nattrs = relation->rd_att->natts; RelationClose(relation); return nattrs; } /* * CheckVarStats() checks whether a qual involving this Var is likely to be * useful based on the correlation stats. If so, or if stats are unavailable, * return true; otherwise return false and sets absVarCorrelation in case * caller wants to use for logging purposes. */ static bool CheckVarStats(PlannerInfo *root, Var *var, Oid sortop, float4 *absVarCorrelation) { /* * Collect isunique, ndistinct, and varCorrelation. */ VariableStatData varStatData; examine_variable(root, (Node *) var, var->varno, &varStatData); if (varStatData.rel == NULL || !HeapTupleIsValid(varStatData.statsTuple)) { return true; } AttStatsSlot sslot; if (!get_attstatsslot(&sslot, varStatData.statsTuple, STATISTIC_KIND_CORRELATION, sortop, ATTSTATSSLOT_NUMBERS)) { ReleaseVariableStats(varStatData); return true; } Assert(sslot.nnumbers == 1); float4 varCorrelation = sslot.numbers[0]; ReleaseVariableStats(varStatData); /* * If the Var is not highly correlated, then the chunk's min/max bounds * will be nearly useless. */ if (float_abs(varCorrelation) < ColumnarQualPushdownCorrelationThreshold) { if (absVarCorrelation) { /* * Report absVarCorrelation if caller wants to know why given * var is rejected. */ *absVarCorrelation = float_abs(varCorrelation); } return false; } return true; } /* * ExprReferencesRelid returns true if any of the Expr's Vars refer to the * given relid; false otherwise. */ static bool ExprReferencesRelid(Expr *expr, Index relid) { List *exprVars = pull_var_clause( (Node *) expr, PVC_RECURSE_AGGREGATES | PVC_RECURSE_WINDOWFUNCS | PVC_RECURSE_PLACEHOLDERS); ListCell *lc; foreach(lc, exprVars) { Var *var = (Var *) lfirst(lc); if (var->varno == relid) { return true; } } return false; } /* * ExtractPushdownClause extracts an Expr node from given clause for pushing down * into the given rel (including join clauses). This test may not be exact in * all cases; it's used to reduce the search space for parameterization. * * Note that we don't try to handle cases like "Var + ExtParam = 3". That * would require going through eval_const_expression after parameter binding, * and that doesn't seem worth the effort. Here we just look for "Var op Expr" * or "Expr op Var", where Var references rel and Expr references other rels * (or no rels at all). * * Moreover, this function also looks into BoolExpr's to recursively extract * pushdownable OpExpr's of them: * i) AND_EXPR: * Take pushdownable args of AND expressions by ignoring the other args. * ii) OR_EXPR: * Ignore the whole OR expression if we cannot exract a pushdownable Expr * from one of its args. * iii) NOT_EXPR: * Simply ignore NOT expressions since we don't expect to see them before * an expression that we can pushdown, see the comment in function. * * The reasoning for those three rules could also be summarized as such; * for any expression that we cannot push-down, we must assume that it * evaluates to true. * * For example, given following WHERE clause: * ( * (a > random() OR a < 30) * AND * a < 200 * ) OR * ( * a = 300 * OR * a > 400 * ); * Even if we can pushdown (a < 30), we cannot pushdown (a > random() OR a < 30) * due to (a > random()). However, we can pushdown (a < 200), so we extract * (a < 200) from the lhs of the top level OR expression. * * For the rhs of the top level OR expression, since we can pushdown both (a = 300) * and (a > 400), we take this part as is. * * Finally, since both sides of the top level OR expression yielded pushdownable * expressions, we will pushdown the following: * (a < 200) OR ((a = 300) OR (a > 400)) */ static Expr * ExtractPushdownClause(PlannerInfo *root, RelOptInfo *rel, Node *node) { CHECK_FOR_INTERRUPTS(); check_stack_depth(); if (node == NULL) { return NULL; } if (IsA(node, BoolExpr)) { BoolExpr *boolExpr = castNode(BoolExpr, node); if (boolExpr->boolop == NOT_EXPR) { /* * Standard planner should have already applied de-morgan rule to * simple NOT expressions. If we encounter with such an expression * here, then it can't be a pushdownable one, such as: * WHERE id NOT IN (SELECT id FROM something). */ ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: cannot push down clause: " "must not contain a subplan"))); return NULL; } List *pushdownableArgs = NIL; Node *boolExprArg = NULL; foreach_ptr(boolExprArg, boolExpr->args) { Expr *pushdownableArg = ExtractPushdownClause(root, rel, (Node *) boolExprArg); if (pushdownableArg) { pushdownableArgs = lappend(pushdownableArgs, pushdownableArg); } else if (boolExpr->boolop == OR_EXPR) { ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: cannot push down clause: " "all arguments of an OR expression must be " "pushdownable but one of them was not, due " "to the reason given above"))); return NULL; } /* simply skip AND args that we cannot pushdown */ } int npushdownableArgs = list_length(pushdownableArgs); if (npushdownableArgs == 0) { ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: cannot push down clause: " "none of the arguments were pushdownable, " "due to the reason(s) given above "))); return NULL; } else if (npushdownableArgs == 1) { return (Expr *) linitial(pushdownableArgs); } if (boolExpr->boolop == AND_EXPR) { return make_andclause(pushdownableArgs); } else if (boolExpr->boolop == OR_EXPR) { return make_orclause(pushdownableArgs); } else { /* already discarded NOT expr, so should not be reachable */ return NULL; } } if (IsA(node, ScalarArrayOpExpr)) { if (!contain_volatile_functions(node)) { return (Expr *) node; } else { return NULL; } } if (!IsA(node, OpExpr) || list_length(((OpExpr *) node)->args) != 2) { ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: cannot push down clause: " "must be binary operator expression"))); return NULL; } OpExpr *opExpr = castNode(OpExpr, node); Expr *lhs = list_nth(opExpr->args, 0); Expr *rhs = list_nth(opExpr->args, 1); Var *varSide; Expr *exprSide; if (IsA(lhs, Var) && ((Var *) lhs)->varno == rel->relid && !ExprReferencesRelid((Expr *) rhs, rel->relid)) { varSide = castNode(Var, lhs); exprSide = rhs; } else if (IsA(rhs, Var) && ((Var *) rhs)->varno == rel->relid && !ExprReferencesRelid((Expr *) lhs, rel->relid)) { varSide = castNode(Var, rhs); exprSide = lhs; } else { ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: cannot push down clause: " "must match 'Var <op> Expr' or 'Expr <op> Var'"), errhint("Var must only reference this rel, " "and Expr must not reference this rel"))); return NULL; } if (varSide->varattno <= 0) { ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: cannot push down clause: " "var is whole-row reference or system column"))); return NULL; } if (contain_volatile_functions((Node *) exprSide)) { ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: cannot push down clause: " "expr contains volatile functions"))); return NULL; } /* only the default opclass is used for qual pushdown. */ Oid varOpClass = GetDefaultOpClass(varSide->vartype, BTREE_AM_OID); Oid varOpFamily; Oid varOpcInType; if (!OidIsValid(varOpClass) || !get_opclass_opfamily_and_input_type(varOpClass, &varOpFamily, &varOpcInType)) { ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: cannot push down clause: " "cannot find default btree opclass and opfamily for type: %s", format_type_be(varSide->vartype)))); return NULL; } if (!op_in_opfamily(opExpr->opno, varOpFamily)) { ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: cannot push down clause: " "operator %d not a member of opfamily %d", opExpr->opno, varOpFamily))); return NULL; } Oid sortop = get_opfamily_member(varOpFamily, varOpcInType, varOpcInType, BTLessStrategyNumber); Assert(OidIsValid(sortop)); /* * Check that statistics on the Var support the utility of this * clause. */ float4 absVarCorrelation = 0; if (!CheckVarStats(root, varSide, sortop, &absVarCorrelation)) { ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: cannot push down clause: " "absolute correlation (%.3f) of var attribute %d is " "smaller than the value configured in " "\"columnar.qual_pushdown_correlation_threshold\" " "(%.3f)", absVarCorrelation, varSide->varattno, ColumnarQualPushdownCorrelationThreshold))); return NULL; } return (Expr *) node; } /* * FilterPushdownClauses filters for clauses that are candidates for pushing * down into rel. */ static List * FilterPushdownClauses(PlannerInfo *root, RelOptInfo *rel, List *inputClauses) { List *filteredClauses = NIL; ListCell *lc; foreach(lc, inputClauses) { RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc); /* * Ignore clauses that don't refer to this rel, and pseudoconstants. * * XXX: A pseudoconstant may be of use, but it doesn't make sense to * push it down because it doesn't contain any Vars. Look into if * there's something we should do with pseudoconstants here. */ if (rinfo->pseudoconstant || !bms_is_member(rel->relid, rinfo->required_relids)) { continue; } Expr *pushdownableExpr = ExtractPushdownClause(root, rel, (Node *) rinfo->clause); if (!pushdownableExpr) { continue; } rinfo = copyObject(rinfo); rinfo->clause = pushdownableExpr; filteredClauses = lappend(filteredClauses, rinfo); } return filteredClauses; } /* * PushdownJoinClauseMatches is a callback that returns true, indicating that * we want all of the clauses from generate_implied_equalities_for_column(). */ static bool PushdownJoinClauseMatches(PlannerInfo *root, RelOptInfo *rel, EquivalenceClass *ec, EquivalenceMember *em, void *arg) { return true; } /* * FindPushdownJoinClauses finds join clauses, including those implied by ECs, * that may be pushed down. */ static List * FindPushdownJoinClauses(PlannerInfo *root, RelOptInfo *rel) { List *joinClauses = copyObject(rel->joininfo); /* * Here we are generating the clauses just so we can later extract the * interesting relids. This is somewhat wasteful, but it allows us to * filter out joinclauses, reducing the number of relids we need to * consider. * * XXX: also find additional clauses for joininfo that are implied by ECs? */ List *ecClauses = generate_implied_equalities_for_column( root, rel, PushdownJoinClauseMatches, NULL, rel->lateral_referencers); List *allClauses = list_concat(joinClauses, ecClauses); return FilterPushdownClauses(root, rel, allClauses); } /* * FindCandidateRelids identifies candidate rels for parameterization from the * list of join clauses. * * Some rels cannot be considered for parameterization, such as a partitioned * parent of the given rel. Other rels are just not useful because they don't * appear in a join clause that could be pushed down. */ static Relids FindCandidateRelids(PlannerInfo *root, RelOptInfo *rel, List *joinClauses) { Relids candidateRelids = NULL; ListCell *lc; foreach(lc, joinClauses) { RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc); candidateRelids = bms_add_members(candidateRelids, rinfo->required_relids); } candidateRelids = bms_del_members(candidateRelids, rel->relids); candidateRelids = bms_del_members(candidateRelids, rel->lateral_relids); return candidateRelids; } /* * Combinations() calculates the number of combinations of n things taken k at * a time. When the correct result is large, the calculation may produce a * non-integer result, or overflow to inf, which caller should handle * appropriately. * * Use the following two formulae from Knuth TAoCP, 1.2.6: * (2) Combinations(n, k) = (n*(n-1)..(n-k+1)) / (k*(k-1)..1) * (5) Combinations(n, k) = Combinations(n, n-k) */ static double Combinations(int n, int k) { double v = 1; /* * If k is close to n, then both the numerator and the denominator are * close to n!, and we may overflow even if the input is reasonable * (e.g. Combinations(500, 500)). Use formula (5) to choose the smaller, * but equivalent, k. */ k = Min(k, n - k); /* calculate numerator of formula (2) first */ for (int i = n; i >= n - k + 1; i--) { v *= i; } /* * Divide by each factor in the denominator of formula (2), skipping * division by 1. */ for (int i = k; i >= 2; i--) { v /= i; } return v; } /* * ChooseDepthLimit() calculates the depth limit for the parameterization * search, given the number of candidate relations. * * The maximum number of paths generated for a given depthLimit is: * * Combinations(nCandidates, 0) + Combinations(nCandidates, 1) + ... + * Combinations(nCandidates, depthLimit) * * There's no closed formula for a partial sum of combinations, so just keep * increasing the depth until the number of combinations exceeds the limit. */ static int ChooseDepthLimit(int nCandidates) { if (!EnableColumnarQualPushdown) { return 0; } int depth = 0; double numPaths = 1; while (depth < nCandidates) { numPaths += Combinations(nCandidates, depth + 1); if (numPaths > (double) ColumnarMaxCustomScanPaths) { break; } depth++; } return depth; } /* * AddColumnarScanPaths is the entry point for recursively generating * parameterized paths. See AddColumnarScanPathsRec() for discussion. */ static void AddColumnarScanPaths(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) { List *joinClauses = FindPushdownJoinClauses(root, rel); Relids candidateRelids = FindCandidateRelids(root, rel, joinClauses); int depthLimit = ChooseDepthLimit(bms_num_members(candidateRelids)); /* must always parameterize by lateral refs */ Relids paramRelids = bms_copy(rel->lateral_relids); AddColumnarScanPathsRec(root, rel, rte, paramRelids, candidateRelids, depthLimit); } /* * AddColumnarScanPathsRec is a recursive function to search the * parameterization space and add CustomPaths for columnar scans. * * The set paramRelids is the parameterization at the current level, and * candidateRelids is the set from which we draw to generate paths with * greater parameterization. * * Columnar tables resemble indexes because of the ability to push down * quals. Ordinary quals, such as x = 7, can be pushed down easily. But join * quals of the form "x = y" (where "y" comes from another rel) require the * proper parameterization. * * Paths that require more outer rels can push down more join clauses that * depend on those outer rels. But requiring more outer rels gives the planner * fewer options for the shape of the plan. That means there is a trade-off, * and we should generate plans of various parameterizations, then let the * planner choose. We always need to generate one minimally-parameterized path * (parameterized only by lateral refs, if present) to make sure that at least * one path can be chosen. Then, we generate as many parameterized paths as we * reasonably can. * * The set of all possible parameterizations is the power set of * candidateRelids. The power set has cardinality 2^N, where N is the * cardinality of candidateRelids. To avoid creating a huge number of paths, * limit the depth of the search; the depthLimit is equivalent to the maximum * number of required outer rels (beyond the minimal parameterization) for the * path. A depthLimit of zero means that only the minimally-parameterized path * will be generated. */ static void AddColumnarScanPathsRec(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte, Relids paramRelids, Relids candidateRelids, int depthLimit) { CHECK_FOR_INTERRUPTS(); check_stack_depth(); Assert(!bms_overlap(paramRelids, candidateRelids)); AddColumnarScanPath(root, rel, rte, paramRelids); /* recurse for all candidateRelids, unless we hit the depth limit */ Assert(depthLimit >= 0); if (depthLimit-- == 0) { return; } /* * Iterate through parameter combinations depth-first. Deeper levels * generate paths of greater parameterization (and hopefully lower * cost). */ Relids tmpCandidateRelids = bms_copy(candidateRelids); int relid = -1; while ((relid = bms_next_member(candidateRelids, relid)) >= 0) { Relids tmpParamRelids = bms_add_member( bms_copy(paramRelids), relid); /* * Because we are generating combinations (not permutations), remove * the relid from the set of candidates at this level as we descend to * the next. */ tmpCandidateRelids = bms_del_member(tmpCandidateRelids, relid); AddColumnarScanPathsRec(root, rel, rte, tmpParamRelids, tmpCandidateRelids, depthLimit); } bms_free(tmpCandidateRelids); } /* * ParameterizationAsString returns the string representation of the set of * rels given in paramRelids. * * Takes a StringInfo so that it doesn't return palloc'd memory. This makes it * easy to call this function as an argument to ereport(), such that it won't * be evaluated unless the message is going to be output somewhere. */ static char * ParameterizationAsString(PlannerInfo *root, Relids paramRelids, StringInfo buf) { bool firstTime = true; int relid = -1; if (bms_num_members(paramRelids) == 0) { return "unparameterized"; } appendStringInfoString(buf, "parameterized by rels {"); while ((relid = bms_next_member(paramRelids, relid)) >= 0) { RangeTblEntry *rte = root->simple_rte_array[relid]; const char *relname = quote_identifier(rte->eref->aliasname); appendStringInfo(buf, "%s%s", firstTime ? "" : ", ", relname); if (relname != rte->eref->aliasname) { pfree((void *) relname); } firstTime = false; } appendStringInfoString(buf, "}"); return buf->data; } /* * ContainsExecParams tests whether the node contains any exec params. The * signature accepts an extra argument for use with expression_tree_walker. */ static bool ContainsExecParams(Node *node, void *notUsed) { if (node == NULL) { return false; } else if (IsA(node, Param)) { Param *param = castNode(Param, node); if (param->paramkind == PARAM_EXEC) { return true; } } return expression_tree_walker(node, ContainsExecParams, NULL); } /* * Create and add a path with the given parameterization paramRelids. * * XXX: Consider refactoring to be more like postgresGetForeignPaths(). The * only differences are param_info and custom_private. */ static void AddColumnarScanPath(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte, Relids paramRelids) { /* * Must return a CustomPath, not a larger structure containing a * CustomPath as the first field. Otherwise, nodeToString() will fail to * output the additional fields. */ CustomPath *cpath = makeNode(CustomPath); cpath->methods = &ColumnarScanPathMethods; #if (PG_VERSION_NUM >= PG_VERSION_15) /* necessary to avoid extra Result node in PG15 */ cpath->flags = CUSTOMPATH_SUPPORT_PROJECTION; #endif /* * populate generic path information */ Path *path = &cpath->path; path->pathtype = T_CustomScan; path->parent = rel; path->pathtarget = rel->reltarget; /* columnar scans are not parallel-aware, but they are parallel-safe */ path->parallel_safe = rel->consider_parallel; path->param_info = get_baserel_parampathinfo(root, rel, paramRelids); /* * Usable clauses for this parameterization exist in baserestrictinfo and * ppi_clauses. */ List *allClauses = copyObject(rel->baserestrictinfo); if (path->param_info != NULL) { allClauses = list_concat(allClauses, path->param_info->ppi_clauses); } allClauses = FilterPushdownClauses(root, rel, allClauses); /* * Plain clauses may contain extern params, but not exec params, and can * be evaluated at init time or rescan time. Track them in another list * that is a subset of allClauses. * * Note: although typically baserestrictinfo contains plain clauses, * that's not always true. It can also contain a qual referencing a Var at * a higher query level, which can be turned into an exec param, and * therefore it won't be a plain clause. */ List *plainClauses = NIL; ListCell *lc; foreach(lc, allClauses) { RestrictInfo *rinfo = lfirst_node(RestrictInfo, lc); if (bms_is_subset(rinfo->required_relids, rel->relids) && !ContainsExecParams((Node *) rinfo->clause, NULL)) { plainClauses = lappend(plainClauses, rinfo); } } /* * We can't make our own CustomPath structure, so we need to put * everything in the custom_private list. To keep the two lists separate, * we make them sublists in a 2-element list. */ if (EnableColumnarQualPushdown) { cpath->custom_private = list_make2(copyObject(plainClauses), copyObject(allClauses)); } else { cpath->custom_private = list_make2(NIL, NIL); } int numberOfColumnsRead = 0; #if PG_VERSION_NUM >= PG_VERSION_16 if (rte->perminfoindex > 0) { /* * If perminfoindex > 0, that means that this relation's permission info * is directly found in the list of rteperminfos of the Query(root->parse) * So, all we have to do here is retrieve that info. */ RTEPermissionInfo *perminfo = getRTEPermissionInfo(root->parse->rteperminfos, rte); numberOfColumnsRead = bms_num_members(perminfo->selectedCols); } else { /* * If perminfoindex = 0, that means we are skipping the check for permission info * for this relation, which means that it's either a partition or an inheritance child. * In these cases, we need to access the permission info of the top parent of this relation. * After thorough checking, we found that the index of the top parent pointing to the correct * range table entry in Query's range tables (root->parse->rtable) is found under * RelOptInfo rel->top_parent->relid. * For reference, check expand_partitioned_rtentry and expand_inherited_rtentry PG functions */ Assert(rel->top_parent); RangeTblEntry *parent_rte = rt_fetch(rel->top_parent->relid, root->parse->rtable); RTEPermissionInfo *perminfo = getRTEPermissionInfo(root->parse->rteperminfos, parent_rte); numberOfColumnsRead = bms_num_members(fixup_inherited_columns(perminfo->relid, rte->relid, perminfo-> selectedCols)); } #else numberOfColumnsRead = bms_num_members(rte->selectedCols); #endif int numberOfClausesPushed = list_length(allClauses); CostColumnarScan(root, rel, rte->relid, cpath, numberOfColumnsRead, numberOfClausesPushed); StringInfoData buf; initStringInfo(&buf); ereport(ColumnarPlannerDebugLevel, (errmsg("columnar planner: adding CustomScan path for %s", rte->eref->aliasname), errdetail("%s; %d clauses pushed down", ParameterizationAsString(root, paramRelids, &buf), numberOfClausesPushed))); add_path(rel, path); } #if PG_VERSION_NUM >= PG_VERSION_16 /* * fixup_inherited_columns * * Exact function Copied from PG16 as it's static. * * When user is querying on a table with children, it implicitly accesses * child tables also. So, we also need to check security label of child * tables and columns, but there is no guarantee attribute numbers are * same between the parent and children. * It returns a bitmapset which contains attribute number of the child * table based on the given bitmapset of the parent. */ static Bitmapset * fixup_inherited_columns(Oid parentId, Oid childId, Bitmapset *columns) { Bitmapset *result = NULL; /* * obviously, no need to do anything here */ if (parentId == childId) { return columns; } int index = -1; while ((index = bms_next_member(columns, index)) >= 0) { /* bit numbers are offset by FirstLowInvalidHeapAttributeNumber */ AttrNumber attno = index + FirstLowInvalidHeapAttributeNumber; /* * whole-row-reference shall be fixed-up later */ if (attno == InvalidAttrNumber) { result = bms_add_member(result, index); continue; } char *attname = get_attname(parentId, attno, false); attno = get_attnum(childId, attname); if (attno == InvalidAttrNumber) { elog(ERROR, "cache lookup failed for attribute %s of relation %u", attname, childId); } result = bms_add_member(result, attno - FirstLowInvalidHeapAttributeNumber); pfree(attname); } return result; } #endif /* * CostColumnarScan calculates the cost of scanning the columnar table. The * cost is estimated by using all stripe metadata to estimate based on the * columns to read how many pages need to be read. */ static void CostColumnarScan(PlannerInfo *root, RelOptInfo *rel, Oid relationId, CustomPath *cpath, int numberOfColumnsRead, int nClauses) { Path *path = &cpath->path; List *allClauses = lsecond(cpath->custom_private); Selectivity clauseSel = clauselist_selectivity( root, allClauses, rel->relid, JOIN_INNER, NULL); /* * We already filtered out clauses where the overall selectivity would be * misleading, such as inequalities involving an uncorrelated column. So * we can apply the selectivity directly to the number of stripes. */ double stripesToRead = clauseSel * ColumnarTableStripeCount(relationId); stripesToRead = Max(stripesToRead, 1.0); path->rows = rel->rows; path->startup_cost = 0; path->total_cost = stripesToRead * ColumnarPerStripeScanCost(rel, relationId, numberOfColumnsRead); } /* * ColumnarPerStripeScanCost calculates the cost to scan a single stripe * of given columnar table based on number of columns that needs to be * read during scan operation. */ static Cost ColumnarPerStripeScanCost(RelOptInfo *rel, Oid relationId, int numberOfColumnsRead) { Relation relation = RelationIdGetRelation(relationId); if (!RelationIsValid(relation)) { ereport(ERROR, (errmsg("could not open relation with OID %u", relationId))); } List *stripeList = StripesForRelfilelocator(RelationPhysicalIdentifier_compat( relation)); RelationClose(relation); uint32 maxColumnCount = 0; uint64 totalStripeSize = 0; StripeMetadata *stripeMetadata = NULL; foreach_ptr(stripeMetadata, stripeList) { totalStripeSize += stripeMetadata->dataLength; maxColumnCount = Max(maxColumnCount, stripeMetadata->columnCount); } /* * When no stripes are in the table we don't have a count in maxColumnCount. To * prevent a division by zero turning into a NaN we keep the ratio on zero. * This will result in a cost of 0 for scanning the table which is a reasonable * cost on an empty table. */ if (maxColumnCount == 0) { return 0; } double columnSelectionRatio = numberOfColumnsRead / (double) maxColumnCount; Cost tableScanCost = (double) totalStripeSize / BLCKSZ * columnSelectionRatio; Cost perStripeScanCost = tableScanCost / list_length(stripeList); /* * Finally, multiply the cost of reading a single stripe by seq page read * cost to make our estimation scale compatible with postgres. * Since we are calculating the cost for a single stripe here, we use seq * page cost instead of random page cost. This is because, random page * access only happens when switching between columns, which is pretty * much neglactable. */ double relSpaceSeqPageCost; get_tablespace_page_costs(rel->reltablespace, NULL, &relSpaceSeqPageCost); perStripeScanCost = perStripeScanCost * relSpaceSeqPageCost; return perStripeScanCost; } /* * ColumnarTableStripeCount returns the number of stripes that columnar * table with relationId has by using stripe metadata. */ static uint64 ColumnarTableStripeCount(Oid relationId) { Relation relation = RelationIdGetRelation(relationId); if (!RelationIsValid(relation)) { ereport(ERROR, (errmsg("could not open relation with OID %u", relationId))); } List *stripeList = StripesForRelfilelocator(RelationPhysicalIdentifier_compat( relation)); int stripeCount = list_length(stripeList); RelationClose(relation); return stripeCount; } static Plan * ColumnarScanPath_PlanCustomPath(PlannerInfo *root, RelOptInfo *rel, struct CustomPath *best_path, List *tlist, List *clauses, List *custom_plans) { /* * Must return a CustomScan, not a larger structure containing a * CustomScan as the first field. Otherwise, copyObject() will fail to * copy the additional fields. */ CustomScan *cscan = makeNode(CustomScan); cscan->methods = &ColumnarScanScanMethods; /* XXX: also need to store projected column list for EXPLAIN */ if (EnableColumnarQualPushdown) { /* * Lists of pushed-down clauses. The Vars in custom_exprs referencing * other relations will be changed into exec Params by * create_customscan_plan(). * * Like CustomPath->custom_private, keep a list of plain clauses * separate from the list of all clauses by making them sublists of a * 2-element list. * * XXX: custom_exprs are the quals that will be pushed into the * columnar reader code; some of these may not be usable. We should * fix this by processing the quals more completely and using * ScanKeys. */ List *plainClauses = extract_actual_clauses( linitial(best_path->custom_private), false /* no pseudoconstants */); List *allClauses = extract_actual_clauses( lsecond(best_path->custom_private), false /* no pseudoconstants */); cscan->custom_exprs = copyObject(list_make2(plainClauses, allClauses)); } else { cscan->custom_exprs = list_make2(NIL, NIL); } cscan->scan.plan.qual = extract_actual_clauses( clauses, false /* no pseudoconstants */); cscan->scan.plan.targetlist = list_copy(tlist); cscan->scan.scanrelid = best_path->path.parent->relid; #if (PG_VERSION_NUM >= 150000) /* necessary to avoid extra Result node in PG15 */ cscan->flags = CUSTOMPATH_SUPPORT_PROJECTION; #endif return (Plan *) cscan; } /* * ReparameterizeMutator changes all varnos referencing the topmost parent of * child_rel to instead reference child_rel directly. */ static Node * ReparameterizeMutator(Node *node, RelOptInfo *child_rel) { if (node == NULL) { return NULL; } if (IsA(node, Var)) { Var *var = castNode(Var, node); if (bms_is_member(var->varno, child_rel->top_parent_relids)) { var = copyObject(var); var->varno = child_rel->relid; } return (Node *) var; } if (IsA(node, RestrictInfo)) { RestrictInfo *rinfo = castNode(RestrictInfo, node); rinfo = copyObject(rinfo); rinfo->clause = (Expr *) expression_tree_mutator( (Node *) rinfo->clause, ReparameterizeMutator, (void *) child_rel); return (Node *) rinfo; } return expression_tree_mutator(node, ReparameterizeMutator, (void *) child_rel); } /* * ColumnarScanPath_ReparameterizeCustomPathByChild is a method called when a * path is reparameterized directly to a child relation, rather than the * top-level parent. * * For instance, let there be a join of two partitioned columnar relations PX * and PY. A path for a ColumnarScan of PY3 might be parameterized by PX so * that the join qual "PY3.a = PX.a" (referencing the parent PX) can be pushed * down. But if the planner decides on a partition-wise join, then the path * will be reparameterized on the child table PX3 directly. * * When that happens, we need to update all Vars in the pushed-down quals to * reference PX3, not PX, to match the new parameterization. This method * notifies us that it needs to be done, and allows us to update the * information in custom_private. */ static List * ColumnarScanPath_ReparameterizeCustomPathByChild(PlannerInfo *root, List *custom_private, RelOptInfo *child_rel) { return (List *) ReparameterizeMutator((Node *) custom_private, child_rel); } static Node * ColumnarScan_CreateCustomScanState(CustomScan *cscan) { ColumnarScanState *columnarScanState = (ColumnarScanState *) newNode( sizeof(ColumnarScanState), T_CustomScanState); CustomScanState *cscanstate = &columnarScanState->custom_scanstate; cscanstate->methods = &ColumnarScanExecuteMethods; return (Node *) cscanstate; } /* * EvalParamsMutator evaluates Params in the expression and replaces them with * Consts. */ static Node * EvalParamsMutator(Node *node, ExprContext *econtext) { if (node == NULL) { return NULL; } if (IsA(node, Param)) { Param *param = (Param *) node; int16 typLen; bool typByVal; bool isnull; get_typlenbyval(param->paramtype, &typLen, &typByVal); /* XXX: should save ExprState for efficiency */ ExprState *exprState = ExecInitExprWithParams((Expr *) node, econtext->ecxt_param_list_info); Datum pval = ExecEvalExpr(exprState, econtext, &isnull); return (Node *) makeConst(param->paramtype, param->paramtypmod, param->paramcollid, (int) typLen, pval, isnull, typByVal); } return expression_tree_mutator(node, EvalParamsMutator, (void *) econtext); } static void ColumnarScan_BeginCustomScan(CustomScanState *cscanstate, EState *estate, int eflags) { CustomScan *cscan = (CustomScan *) cscanstate->ss.ps.plan; ColumnarScanState *columnarScanState = (ColumnarScanState *) cscanstate; ExprContext *stdecontext = cscanstate->ss.ps.ps_ExprContext; /* * Make a new ExprContext just like the existing one, except that we don't * reset it every tuple. */ ExecAssignExprContext(estate, &cscanstate->ss.ps); columnarScanState->css_RuntimeContext = cscanstate->ss.ps.ps_ExprContext; cscanstate->ss.ps.ps_ExprContext = stdecontext; ResetExprContext(columnarScanState->css_RuntimeContext); List *plainClauses = linitial(cscan->custom_exprs); columnarScanState->qual = (List *) EvalParamsMutator( (Node *) plainClauses, columnarScanState->css_RuntimeContext); /* scan slot is already initialized */ } /* * ColumnarAttrNeeded returns a list of AttrNumber's for the ones that are * needed during columnar custom scan. * Throws an error if finds a Var referencing to an attribute not supported * by ColumnarScan. */ static Bitmapset * ColumnarAttrNeeded(ScanState *ss) { TupleTableSlot *slot = ss->ss_ScanTupleSlot; int natts = slot->tts_tupleDescriptor->natts; Bitmapset *attr_needed = NULL; Plan *plan = ss->ps.plan; int flags = PVC_RECURSE_AGGREGATES | PVC_RECURSE_WINDOWFUNCS | PVC_RECURSE_PLACEHOLDERS; List *vars = list_concat(pull_var_clause((Node *) plan->targetlist, flags), pull_var_clause((Node *) plan->qual, flags)); ListCell *lc; foreach(lc, vars) { Var *var = lfirst(lc); if (var->varattno < 0) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg( "UPDATE and CTID scans not supported for ColumnarScan"))); } if (var->varattno == 0) { elog(DEBUG1, "Need attribute: all"); /* all attributes are required, we don't need to add more so break*/ attr_needed = bms_add_range(attr_needed, 0, natts - 1); break; } elog(DEBUG1, "Need attribute: %d", var->varattno); attr_needed = bms_add_member(attr_needed, var->varattno - 1); } return attr_needed; } static TupleTableSlot * ColumnarScanNext(ColumnarScanState *columnarScanState) { CustomScanState *node = (CustomScanState *) columnarScanState; /* * get information from the estate and scan state */ TableScanDesc scandesc = node->ss.ss_currentScanDesc; EState *estate = node->ss.ps.state; ScanDirection direction = estate->es_direction; TupleTableSlot *slot = node->ss.ss_ScanTupleSlot; if (scandesc == NULL) { /* the columnar access method does not use the flags, they are specific to heap */ uint32 flags = 0; Bitmapset *attr_needed = ColumnarAttrNeeded(&node->ss); /* * We reach here if the scan is not parallel, or if we're serially * executing a scan that was planned to be parallel. */ scandesc = columnar_beginscan_extended(node->ss.ss_currentRelation, estate->es_snapshot, 0, NULL, NULL, flags, attr_needed, columnarScanState->qual); bms_free(attr_needed); node->ss.ss_currentScanDesc = scandesc; } /* * get the next tuple from the table */ if (table_scan_getnextslot(scandesc, direction, slot)) { return slot; } return NULL; } /* * SeqRecheck -- access method routine to recheck a tuple in EvalPlanQual */ static bool ColumnarScanRecheck(ColumnarScanState *node, TupleTableSlot *slot) { return true; } static TupleTableSlot * ColumnarScan_ExecCustomScan(CustomScanState *node) { return ExecScan(&node->ss, (ExecScanAccessMtd) ColumnarScanNext, (ExecScanRecheckMtd) ColumnarScanRecheck); } static void ColumnarScan_EndCustomScan(CustomScanState *node) { /* * get information from node */ TableScanDesc scanDesc = node->ss.ss_currentScanDesc; /* * Free the exprcontext */ ExecFreeExprContext(&node->ss.ps); /* * clean out the tuple table */ if (node->ss.ps.ps_ResultTupleSlot) { ExecClearTuple(node->ss.ps.ps_ResultTupleSlot); } ExecClearTuple(node->ss.ss_ScanTupleSlot); /* * close heap scan */ if (scanDesc != NULL) { table_endscan(scanDesc); } } static void ColumnarScan_ReScanCustomScan(CustomScanState *node) { CustomScan *cscan = (CustomScan *) node->ss.ps.plan; ColumnarScanState *columnarScanState = (ColumnarScanState *) node; ResetExprContext(columnarScanState->css_RuntimeContext); List *allClauses = lsecond(cscan->custom_exprs); columnarScanState->qual = (List *) EvalParamsMutator( (Node *) allClauses, columnarScanState->css_RuntimeContext); TableScanDesc scanDesc = node->ss.ss_currentScanDesc; if (scanDesc != NULL) { /* XXX: hack to pass quals as scan keys */ ScanKey scanKeys = (ScanKey) columnarScanState->qual; table_rescan(node->ss.ss_currentScanDesc, scanKeys); } } static void ColumnarScan_ExplainCustomScan(CustomScanState *node, List *ancestors, ExplainState *es) { ColumnarScanState *columnarScanState = (ColumnarScanState *) node; List *context = set_deparse_context_planstate( es->deparse_cxt, (Node *) &node->ss.ps, ancestors); List *projectedColumns = ColumnarVarNeeded(columnarScanState); const char *projectedColumnsStr = ColumnarProjectedColumnsStr( context, projectedColumns); ExplainPropertyText("Columnar Projected Columns", projectedColumnsStr, es); CustomScan *cscan = castNode(CustomScan, node->ss.ps.plan); List *chunkGroupFilter = lsecond(cscan->custom_exprs); if (chunkGroupFilter != NULL) { const char *pushdownClausesStr = ColumnarPushdownClausesStr( context, chunkGroupFilter); ExplainPropertyText("Columnar Chunk Group Filters", pushdownClausesStr, es); ColumnarScanDesc columnarScanDesc = (ColumnarScanDesc) node->ss.ss_currentScanDesc; if (columnarScanDesc != NULL) { ExplainPropertyInteger( "Columnar Chunk Groups Removed by Filter", NULL, ColumnarScanChunkGroupsFiltered(columnarScanDesc), es); } } } /* * ColumnarPushdownClausesStr represents the clauses to push down as a string. */ static const char * ColumnarPushdownClausesStr(List *context, List *clauses) { Expr *conjunction; Assert(list_length(clauses) > 0); if (list_length(clauses) == 1) { conjunction = (Expr *) linitial(clauses); } else { conjunction = make_andclause(clauses); } bool useTableNamePrefix = false; bool showImplicitCast = false; return deparse_expression((Node *) conjunction, context, useTableNamePrefix, showImplicitCast); } /* * ColumnarProjectedColumnsStr generates projected column string for * explain output. */ static const char * ColumnarProjectedColumnsStr(List *context, List *projectedColumns) { if (list_length(projectedColumns) == 0) { return "<columnar optimized out all columns>"; } bool useTableNamePrefix = false; bool showImplicitCast = false; return deparse_expression((Node *) projectedColumns, context, useTableNamePrefix, showImplicitCast); } /* * ColumnarVarNeeded returns a list of Var objects for the ones that are * needed during columnar custom scan. * Throws an error if finds a Var referencing to an attribute not supported * by ColumnarScan. */ static List * ColumnarVarNeeded(ColumnarScanState *columnarScanState) { ScanState *scanState = &columnarScanState->custom_scanstate.ss; List *varList = NIL; Bitmapset *neededAttrSet = ColumnarAttrNeeded(scanState); int bmsMember = -1; while ((bmsMember = bms_next_member(neededAttrSet, bmsMember)) >= 0) { Relation columnarRelation = scanState->ss_currentRelation; /* neededAttrSet already represents 0-indexed attribute numbers */ Form_pg_attribute columnForm = TupleDescAttr(RelationGetDescr(columnarRelation), bmsMember); if (columnForm->attisdropped) { ereport(ERROR, (errcode(ERRCODE_UNDEFINED_COLUMN), errmsg("cannot explain column with attrNum=%d " "of columnar table %s since it is dropped", bmsMember + 1, RelationGetRelationName(columnarRelation)))); } else if (columnForm->attnum <= 0) { /* * ColumnarAttrNeeded should have already thrown an error for * system columns. Similarly, it should have already expanded * whole-row references to individual attributes. */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot explain column with attrNum=%d " "of columnar table %s since it is either " "a system column or a whole-row " "reference", columnForm->attnum, RelationGetRelationName(columnarRelation)))); } /* * varlevelsup is used to figure out the (query) level of the Var * that we are investigating. Since we are dealing with a particular * relation, it is useless here. */ Index varlevelsup = 0; CustomScanState *customScanState = (CustomScanState *) columnarScanState; CustomScan *customScan = (CustomScan *) customScanState->ss.ps.plan; Index scanrelid = customScan->scan.scanrelid; Var *var = makeVar(scanrelid, columnForm->attnum, columnForm->atttypid, columnForm->atttypmod, columnForm->attcollation, varlevelsup); varList = lappend(varList, var); } return varList; } /* * set_deparse_context_planstate is a compatibility wrapper for versions 13+. */ static List * set_deparse_context_planstate(List *dpcontext, Node *node, List *ancestors) { PlanState *ps = (PlanState *) node; return set_deparse_context_plan(dpcontext, ps->plan, ancestors); } ```
```php <?php /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */ namespace Google\Service\ToolResults; class ToolOutputReference extends \Google\Model { protected $creationTimeType = Timestamp::class; protected $creationTimeDataType = ''; protected $outputType = FileReference::class; protected $outputDataType = ''; protected $testCaseType = TestCaseReference::class; protected $testCaseDataType = ''; /** * @param Timestamp */ public function setCreationTime(Timestamp $creationTime) { $this->creationTime = $creationTime; } /** * @return Timestamp */ public function getCreationTime() { return $this->creationTime; } /** * @param FileReference */ public function setOutput(FileReference $output) { $this->output = $output; } /** * @return FileReference */ public function getOutput() { return $this->output; } /** * @param TestCaseReference */ public function setTestCase(TestCaseReference $testCase) { $this->testCase = $testCase; } /** * @return TestCaseReference */ public function getTestCase() { return $this->testCase; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(ToolOutputReference::class, 'Google_Service_ToolResults_ToolOutputReference'); ```
```html <html lang="en"> <head> <title>MSP430 Syntax - Using as</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Using as"> <meta name="generator" content="makeinfo 4.8"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="MSP430_002dDependent.html#MSP430_002dDependent" title="MSP430-Dependent"> <link rel="prev" href="MSP430-Options.html#MSP430-Options" title="MSP430 Options"> <link rel="next" href="MSP430-Floating-Point.html#MSP430-Floating-Point" title="MSP430 Floating Point"> <link href="path_to_url" rel="generator-home" title="Texinfo Homepage"> <!-- This file documents the GNU Assembler "as". Permission is granted to copy, distribute and/or modify this document or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the --> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <p> <a name="MSP430-Syntax"></a> Next:&nbsp;<a rel="next" accesskey="n" href="MSP430-Floating-Point.html#MSP430-Floating-Point">MSP430 Floating Point</a>, Previous:&nbsp;<a rel="previous" accesskey="p" href="MSP430-Options.html#MSP430-Options">MSP430 Options</a>, Up:&nbsp;<a rel="up" accesskey="u" href="MSP430_002dDependent.html#MSP430_002dDependent">MSP430-Dependent</a> <hr> </div> <h4 class="subsection">9.29.2 Syntax</h4> <ul class="menu"> <li><a accesskey="1" href="MSP430_002dMacros.html#MSP430_002dMacros">MSP430-Macros</a>: Macros <li><a accesskey="2" href="MSP430_002dChars.html#MSP430_002dChars">MSP430-Chars</a>: Special Characters <li><a accesskey="3" href="MSP430_002dRegs.html#MSP430_002dRegs">MSP430-Regs</a>: Register Names <li><a accesskey="4" href="MSP430_002dExt.html#MSP430_002dExt">MSP430-Ext</a>: Assembler Extensions </ul> </body></html> ```
```c++ // // windows/basic_stream_handle.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // // file LICENSE_1_0.txt or copy at path_to_url // #ifndef BOOST_ASIO_WINDOWS_BASIC_STREAM_HANDLE_HPP #define BOOST_ASIO_WINDOWS_BASIC_STREAM_HANDLE_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/asio/windows/basic_overlapped_handle.hpp> #if defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE) \ || defined(GENERATING_DOCUMENTATION) #include <boost/asio/detail/push_options.hpp> namespace boost { namespace asio { namespace windows { /// Provides stream-oriented handle functionality. /** * The windows::basic_stream_handle class provides asynchronous and blocking * stream-oriented handle functionality. * * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. * * @par Concepts: * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. */ template <typename Executor = any_io_executor> class basic_stream_handle : public basic_overlapped_handle<Executor> { public: /// The type of the executor associated with the object. typedef Executor executor_type; /// Rebinds the handle type to another executor. template <typename Executor1> struct rebind_executor { /// The handle type when rebound to the specified executor. typedef basic_stream_handle<Executor1> other; }; /// The native representation of a handle. #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined native_handle_type; #else typedef boost::asio::detail::win_iocp_handle_service::native_handle_type native_handle_type; #endif /// Construct a stream handle without opening it. /** * This constructor creates a stream handle without opening it. * * @param ex The I/O executor that the stream handle will use, by default, to * dispatch handlers for any asynchronous operations performed on the stream * handle. */ explicit basic_stream_handle(const executor_type& ex) : basic_overlapped_handle<Executor>(ex) { } /// Construct a stream handle without opening it. /** * This constructor creates a stream handle without opening it. The handle * needs to be opened or assigned before data can be sent or received on it. * * @param context An execution context which provides the I/O executor that * the stream handle will use, by default, to dispatch handlers for any * asynchronous operations performed on the stream handle. */ template <typename ExecutionContext> explicit basic_stream_handle(ExecutionContext& context, typename constraint< is_convertible<ExecutionContext&, execution_context&>::value, defaulted_constraint >::type = defaulted_constraint()) : basic_overlapped_handle<Executor>(context) { } /// Construct a stream handle on an existing native handle. /** * This constructor creates a stream handle object to hold an existing native * handle. * * @param ex The I/O executor that the stream handle will use, by default, to * dispatch handlers for any asynchronous operations performed on the stream * handle. * * @param handle The new underlying handle implementation. * * @throws boost::system::system_error Thrown on failure. */ basic_stream_handle(const executor_type& ex, const native_handle_type& handle) : basic_overlapped_handle<Executor>(ex, handle) { } /// Construct a stream handle on an existing native handle. /** * This constructor creates a stream handle object to hold an existing native * handle. * * @param context An execution context which provides the I/O executor that * the stream handle will use, by default, to dispatch handlers for any * asynchronous operations performed on the stream handle. * * @param handle The new underlying handle implementation. * * @throws boost::system::system_error Thrown on failure. */ template <typename ExecutionContext> basic_stream_handle(ExecutionContext& context, const native_handle_type& handle, typename constraint< is_convertible<ExecutionContext&, execution_context&>::value >::type = 0) : basic_overlapped_handle<Executor>(context, handle) { } #if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move-construct a stream handle from another. /** * This constructor moves a stream handle from one object to another. * * @param other The other stream handle object from which the move * will occur. * * @note Following the move, the moved-from object is in the same state as if * constructed using the @c basic_stream_handle(const executor_type&) * constructor. */ basic_stream_handle(basic_stream_handle&& other) : basic_overlapped_handle<Executor>(std::move(other)) { } /// Move-assign a stream handle from another. /** * This assignment operator moves a stream handle from one object to * another. * * @param other The other stream handle object from which the move will occur. * * @note Following the move, the moved-from object is in the same state as if * constructed using the @c basic_stream_handle(const executor_type&) * constructor. */ basic_stream_handle& operator=(basic_stream_handle&& other) { basic_overlapped_handle<Executor>::operator=(std::move(other)); return *this; } #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Write some data to the handle. /** * This function is used to write data to the stream handle. The function call * will block until one or more bytes of the data has been written * successfully, or until an error occurs. * * @param buffers One or more data buffers to be written to the handle. * * @returns The number of bytes written. * * @throws boost::system::system_error Thrown on failure. An error code of * boost::asio::error::eof indicates that the connection was closed by the * peer. * * @note The write_some operation may not transmit all of the data to the * peer. Consider using the @ref write function if you need to ensure that * all data is written before the blocking operation completes. * * @par Example * To write a single data buffer use the @ref buffer function as follows: * @code * handle.write_some(boost::asio::buffer(data, size)); * @endcode * See the @ref buffer documentation for information on writing multiple * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers) { boost::system::error_code ec; std::size_t s = this->impl_.get_service().write_some( this->impl_.get_implementation(), buffers, ec); boost::asio::detail::throw_error(ec, "write_some"); return s; } /// Write some data to the handle. /** * This function is used to write data to the stream handle. The function call * will block until one or more bytes of the data has been written * successfully, or until an error occurs. * * @param buffers One or more data buffers to be written to the handle. * * @param ec Set to indicate what error occurred, if any. * * @returns The number of bytes written. Returns 0 if an error occurred. * * @note The write_some operation may not transmit all of the data to the * peer. Consider using the @ref write function if you need to ensure that * all data is written before the blocking operation completes. */ template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers, boost::system::error_code& ec) { return this->impl_.get_service().write_some( this->impl_.get_implementation(), buffers, ec); } /// Start an asynchronous write. /** * This function is used to asynchronously write data to the stream handle. * The function call always returns immediately. * * @param buffers One or more data buffers to be written to the handle. * Although the buffers object may be copied as necessary, ownership of the * underlying memory blocks is retained by the caller, which must guarantee * that they remain valid until the handler is called. * * @param handler The handler to be called when the write operation completes. * Copies will be made of the handler as required. The function signature of * the handler must be: * @code void handler( * const boost::system::error_code& error, // Result of operation. * std::size_t bytes_transferred // Number of bytes written. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. On * immediate completion, invocation of the handler will be performed in a * manner equivalent to using boost::asio::post(). * * @note The write operation may not transmit all of the data to the peer. * Consider using the @ref async_write function if you need to ensure that all * data is written before the asynchronous operation completes. * * @par Example * To write a single data buffer use the @ref buffer function as follows: * @code * handle.async_write_some(boost::asio::buffer(data, size), handler); * @endcode * See the @ref buffer documentation for information on writing multiple * buffers in one go, and how to use it with arrays, boost::array or * std::vector. * * @par Per-Operation Cancellation * This asynchronous operation supports cancellation for the following * boost::asio::cancellation_type values: * * @li @c cancellation_type::terminal * * @li @c cancellation_type::partial * * @li @c cancellation_type::total */ template <typename ConstBufferSequence, BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code, std::size_t)) WriteHandler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, void (boost::system::error_code, std::size_t)) async_write_some(const ConstBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) { return async_initiate<WriteHandler, void (boost::system::error_code, std::size_t)>( initiate_async_write_some(this), handler, buffers); } /// Read some data from the handle. /** * This function is used to read data from the stream handle. The function * call will block until one or more bytes of data has been read successfully, * or until an error occurs. * * @param buffers One or more buffers into which the data will be read. * * @returns The number of bytes read. * * @throws boost::system::system_error Thrown on failure. An error code of * boost::asio::error::eof indicates that the connection was closed by the * peer. * * @note The read_some operation may not read all of the requested number of * bytes. Consider using the @ref read function if you need to ensure that * the requested amount of data is read before the blocking operation * completes. * * @par Example * To read into a single data buffer use the @ref buffer function as follows: * @code * handle.read_some(boost::asio::buffer(data, size)); * @endcode * See the @ref buffer documentation for information on reading into multiple * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template <typename MutableBufferSequence> std::size_t read_some(const MutableBufferSequence& buffers) { boost::system::error_code ec; std::size_t s = this->impl_.get_service().read_some( this->impl_.get_implementation(), buffers, ec); boost::asio::detail::throw_error(ec, "read_some"); return s; } /// Read some data from the handle. /** * This function is used to read data from the stream handle. The function * call will block until one or more bytes of data has been read successfully, * or until an error occurs. * * @param buffers One or more buffers into which the data will be read. * * @param ec Set to indicate what error occurred, if any. * * @returns The number of bytes read. Returns 0 if an error occurred. * * @note The read_some operation may not read all of the requested number of * bytes. Consider using the @ref read function if you need to ensure that * the requested amount of data is read before the blocking operation * completes. */ template <typename MutableBufferSequence> std::size_t read_some(const MutableBufferSequence& buffers, boost::system::error_code& ec) { return this->impl_.get_service().read_some( this->impl_.get_implementation(), buffers, ec); } /// Start an asynchronous read. /** * This function is used to asynchronously read data from the stream handle. * The function call always returns immediately. * * @param buffers One or more buffers into which the data will be read. * Although the buffers object may be copied as necessary, ownership of the * underlying memory blocks is retained by the caller, which must guarantee * that they remain valid until the handler is called. * * @param handler The handler to be called when the read operation completes. * Copies will be made of the handler as required. The function signature of * the handler must be: * @code void handler( * const boost::system::error_code& error, // Result of operation. * std::size_t bytes_transferred // Number of bytes read. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. On * immediate completion, invocation of the handler will be performed in a * manner equivalent to using boost::asio::post(). * * @note The read operation may not read all of the requested number of bytes. * Consider using the @ref async_read function if you need to ensure that the * requested amount of data is read before the asynchronous operation * completes. * * @par Example * To read into a single data buffer use the @ref buffer function as follows: * @code * handle.async_read_some(boost::asio::buffer(data, size), handler); * @endcode * See the @ref buffer documentation for information on reading into multiple * buffers in one go, and how to use it with arrays, boost::array or * std::vector. * * @par Per-Operation Cancellation * This asynchronous operation supports cancellation for the following * boost::asio::cancellation_type values: * * @li @c cancellation_type::terminal * * @li @c cancellation_type::partial * * @li @c cancellation_type::total */ template <typename MutableBufferSequence, BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code, std::size_t)) ReadHandler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, void (boost::system::error_code, std::size_t)) async_read_some(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) { return async_initiate<ReadHandler, void (boost::system::error_code, std::size_t)>( initiate_async_read_some(this), handler, buffers); } private: class initiate_async_write_some { public: typedef Executor executor_type; explicit initiate_async_write_some(basic_stream_handle* self) : self_(self) { } executor_type get_executor() const BOOST_ASIO_NOEXCEPT { return self_->get_executor(); } template <typename WriteHandler, typename ConstBufferSequence> void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler, const ConstBufferSequence& buffers) const { // If you get an error on the following line it means that your handler // does not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; detail::non_const_lvalue<WriteHandler> handler2(handler); self_->impl_.get_service().async_write_some( self_->impl_.get_implementation(), buffers, handler2.value, self_->impl_.get_executor()); } private: basic_stream_handle* self_; }; class initiate_async_read_some { public: typedef Executor executor_type; explicit initiate_async_read_some(basic_stream_handle* self) : self_(self) { } executor_type get_executor() const BOOST_ASIO_NOEXCEPT { return self_->get_executor(); } template <typename ReadHandler, typename MutableBufferSequence> void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler, const MutableBufferSequence& buffers) const { // If you get an error on the following line it means that your handler // does not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; detail::non_const_lvalue<ReadHandler> handler2(handler); self_->impl_.get_service().async_read_some( self_->impl_.get_implementation(), buffers, handler2.value, self_->impl_.get_executor()); } private: basic_stream_handle* self_; }; }; } // namespace windows } // namespace asio } // namespace boost #include <boost/asio/detail/pop_options.hpp> #endif // defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE) // || defined(GENERATING_DOCUMENTATION) #endif // BOOST_ASIO_WINDOWS_BASIC_STREAM_HANDLE_HPP ```
Ngerengere River is a river of the Morogoro Region of Tanzania. It rises in the Uluguru Mountains, and flows eastwards to join the Ruvu River at approximately 7.05085 S, 38.51571 E. The city of Morogoro is on the Ngerengere River. The Mindu Dam project, began in 1978, has been surrounded by controversy. The dam is being rapidly silted due to deforestation in the surrounding areas. It faces mercury poisoning from gold mining nearby and a threat to water supply. Rivers of Tanzania Geography of Morogoro Region
```prolog #!/usr/bin/env perl use strict; use Getopt::Long; use FindBin qw($Bin); use File::Temp qw(tempdir tempfile); use POSIX; my $PID = $$; $SIG{TERM} = $SIG{INT} = $SIG{QUIT} = sub { die; }; my $BINDIR = "$Bin/bin"; my $SRC; my $TRG; my $OUTPUT = "lex"; my $THREADS = 8; my $PARALLEL = 0; my $HELP; GetOptions( "b|bindir=s" => \$BINDIR, "s|source=s" => \$SRC, "t|target=s" => \$TRG, "o|output=s" => \$OUTPUT, "threads=i" => \$THREADS, "parallel" => \$PARALLEL, "h|help" => \$HELP, ); if($HELP) { print "Usage: perl $0 -b bindir -s corpus.src -t corpus.tgt [-o outputprefix] [--threads 8] [--parallel]\n"; exit 0; } die "--bindir arg is required" if not defined $BINDIR; die "-s|--source arg is required" if not defined $SRC; die "-t|--target arg is required" if not defined $TRG; die "-o|--output arg is required" if not defined $OUTPUT; for my $app (qw(fast_align atools extract_lex)) { die "Could not find $app in $BINDIR" if not -e "$BINDIR/$app"; } my $TEMPDIR = tempdir(CLEANUP => 1); my (undef, $CORPUS) = tempfile(DIR => $TEMPDIR); my (undef, $ALN_S2T) = tempfile(DIR => $TEMPDIR); my (undef, $ALN_T2S) = tempfile(DIR => $TEMPDIR); my (undef, $ALN_GDF) = tempfile(DIR => $TEMPDIR); execute("paste $SRC $TRG | sed 's/\\t/ ||| /' > $CORPUS"); my @COMMANDS = ( "OMP_NUM_THREADS=$THREADS $BINDIR/fast_align -vdo -i $CORPUS > $ALN_S2T", "OMP_NUM_THREADS=$THREADS $BINDIR/fast_align -vdor -i $CORPUS > $ALN_T2S" ); my @PIDS; for my $c (@COMMANDS) { if ($PARALLEL) { my $pid = fork(); if (!$pid) { execute($c); exit(0); } else { push(@PIDS, $pid); print "Forked process $pid\n"; } } else { execute($c); } } if ($PARALLEL) { waitpid($_, 0) foreach(@PIDS); } execute("$BINDIR/atools -c grow-diag-final -i $ALN_S2T -j $ALN_T2S > $ALN_GDF"); execute("$BINDIR/extract_lex $TRG $SRC $ALN_GDF $OUTPUT.s2t $OUTPUT.t2s"); sub execute { my $command = shift; logMessage("Executing:\t$command"); my $ret = system($command); if ($ret != 0) { logMessage("Command '$command' finished with return status $ret"); logMessage("Aborting and killing parent process"); kill(2, $PID); die; } } sub logMessage { my $message = shift; my $time = POSIX::strftime("%m/%d/%Y %H:%M:%S", localtime()); my $log_message = $time."\t$message\n"; print STDERR $log_message; } ```
Boiling Point, known in Japan as , is a 1990 Japanese crime film written and directed by Takeshi Kitano, who also co-stars under his stage name Beat Takeshi. It was Kitano's second film as a director and first film as a screenwriter. Boiling Point is seen as an important first step in his development as an editor and as a director. Plot outline Masaki is a shiftless, inattentive young man who is a member of a losing local baseball team, whose coach is threatened and attacked by a local yakuza. He teams up with a friend to go to Okinawa to purchase guns so they can get revenge. A psychotic yakuza member named Uehara befriends them upon their arrival in Okinawa. Uehara has his own agenda of revenge, and as the story progresses the two boys drift further into his orbit, with unsettling results. Cast Takeshi Kitano as Uehara YΕ«rei Yanagi as Masaki Yuriko Ishida as Sayaka Gadarukanaru Taka as Takashi Iguchi Dankan as Kazuo Eri Fuse as Miki Production Kitano's trademark black humor suffuses the film in many ways: at one point, the boy finally does get a gun, but shoots out the windshield of his girlfriend's car by mistake. The film also features comedian Iizuka Minoru, also known as Dankan, who went on to become a Kitano regular (Getting Any?) and Katsuo Tokashiki, who is famous for his kickboxing skills in Japan. He also played a guard in Takeshi Kitano's Takeshi's Castle in the 1980s. The original title, 3-4X Jugatsu, is the final score of a baseball game played in the film. "Jugatsu" (October) was added to the title, because the most exciting games of baseball, play-off games, are played in October. Reception Boiling Point has an approval rating of 94% on review aggregator website Rotten Tomatoes, based on 17 reviews, and an average rating of 7/10. References External links 1990 films 1990s action films 1990s crime drama films Japanese crime comedy films Films directed by Takeshi Kitano Films set in Okinawa Prefecture Japanese crime drama films 1990s Japanese-language films Shochiku films Yakuza films 1990 drama films 1990s Japanese films
```python # -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # path_to_url from scrapy import signals class XueqiuSpiderMiddleware(object): # Not all methods need to be defined. If a method is not defined, # scrapy acts as if the spider middleware does not modify the # passed objects. @classmethod def from_crawler(cls, crawler): # This method is used by Scrapy to create your spiders. s = cls() crawler.signals.connect(s.spider_opened, signal=signals.spider_opened) return s def process_spider_input(response, spider): # Called for each response that goes through the spider # middleware and into the spider. # Should return None or raise an exception. return None def process_spider_output(response, result, spider): # Called with the results returned from the Spider, after # it has processed the response. # Must return an iterable of Request, dict or Item objects. for i in result: yield i def process_spider_exception(response, exception, spider): # Called when a spider or process_spider_input() method # (from other spider middleware) raises an exception. # Should return either None or an iterable of Response, dict # or Item objects. pass def process_start_requests(start_requests, spider): # Called with the start requests of the spider, and works # similarly to the process_spider_output() method, except # that it doesnt have a response associated. # Must return only requests (not items). for r in start_requests: yield r def spider_opened(self, spider): spider.logger.info('Spider opened: %s' % spider.name) ```
```xml <?xml version="1.0" encoding="UTF-8"?> <feature id="org.lamport.tla.toolbox.feature.jclouds" label="TLA+ Toolbox JClouds Feature" version="1.0.0.qualifier" provider-name="Markus Alexander Kuppe" plugin="org.lamport.tla.toolbox.jclouds" license-feature="org.lamport.tla.toolbox.feature.branding" license-feature-version="1.0.0.qualifier"> <description> This feature defines the set of plug-ins that are required to run the base of the TLA+ Toolbox. </description> <includes id="org.apache.jclouds.feature" version="0.0.0"/> <plugin id="org.lamport.tla.toolbox.jclouds" download-size="0" install-size="0" version="0.0.0"/> <plugin id="org.apache.commons.io" download-size="0" install-size="0" version="0.0.0" unpack="false"/> <plugin id="com.jcraft.jsch" download-size="0" install-size="0" version="0.0.0" unpack="false"/> </feature> ```
Steven Randjelovic (born 21 April 1975) is a former professional tennis player from Australia. Career Randjelovic appeared at his only ATP International Series event in 1998, when he competed in the main draw of both the singles and doubles at Newport's Hall of Fame Tennis Championships. He was beaten by Grant Stafford in the opening round but made the quarter-finals of the doubles, partnering Lorenzo Manta. In 1999 he played in the Austrian Open but was unable to progress past the first round, losing to Andrei Cherkasov. He won two Challenger doubles titles that year. He and doubles partner Ashley Fisher were given a wildcard entry into the 2000 Australian Open. They lost their opening round match to 11th seeds, JiΕ™Γ­ NovΓ‘k and David Rikl. Challenger titles Singles: (1) Doubles: (3) References 1975 births Living people Australian male tennis players Place of birth missing (living people)
```prolog #!/usr/bin/env perl $flavour = shift; $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; ( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or ( $xlate="${dir}perlasm/ppc-xlate.pl" and -f $xlate) or die "can't locate ppc-xlate.pl"; open STDOUT,"| $^X $xlate $flavour ".shift || die "can't call $xlate: $!"; if ($flavour=~/64/) { $CMPLI="cmpldi"; $SHRLI="srdi"; $SIGNX="extsw"; } else { $CMPLI="cmplwi"; $SHRLI="srwi"; $SIGNX="mr"; } $code=<<___; .machine "any" .text .globl .OPENSSL_ppc64_probe .align 4 .OPENSSL_ppc64_probe: fcfid f1,f1 extrdi r0,r0,32,0 blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .globl .OPENSSL_altivec_probe .align 4 .OPENSSL_altivec_probe: .long 0x10000484 # vor v0,v0,v0 blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .globl .OPENSSL_wipe_cpu .align 4 .OPENSSL_wipe_cpu: xor r0,r0,r0 fmr f0,f31 fmr f1,f31 fmr f2,f31 mr r3,r1 fmr f3,f31 xor r4,r4,r4 fmr f4,f31 xor r5,r5,r5 fmr f5,f31 xor r6,r6,r6 fmr f6,f31 xor r7,r7,r7 fmr f7,f31 xor r8,r8,r8 fmr f8,f31 xor r9,r9,r9 fmr f9,f31 xor r10,r10,r10 fmr f10,f31 xor r11,r11,r11 fmr f11,f31 xor r12,r12,r12 fmr f12,f31 fmr f13,f31 blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .globl .OPENSSL_atomic_add .align 4 .OPENSSL_atomic_add: Ladd: lwarx r5,0,r3 add r0,r4,r5 stwcx. r0,0,r3 bne- Ladd $SIGNX r3,r0 blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 .globl .OPENSSL_rdtsc .align 4 .OPENSSL_rdtsc: mftb r3 mftbu r4 blr .long 0 .byte 0,12,0x14,0,0,0,0,0 .globl .OPENSSL_cleanse .align 4 .OPENSSL_cleanse: $CMPLI r4,7 li r0,0 bge Lot $CMPLI r4,0 beqlr- Little: mtctr r4 stb r0,0(r3) addi r3,r3,1 bdnz \$-8 blr Lot: andi. r5,r3,3 beq Laligned stb r0,0(r3) subi r4,r4,1 addi r3,r3,1 b Lot Laligned: $SHRLI r5,r4,2 mtctr r5 stw r0,0(r3) addi r3,r3,4 bdnz \$-8 andi. r4,r4,3 bne Little blr .long 0 .byte 0,12,0x14,0,0,0,2,0 .long 0 ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; print $code; close STDOUT; ```
```php <?php /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */ namespace Google\Service\RemoteBuildExecution; class GoogleDevtoolsRemoteworkersV1test2DirectoryMetadata extends \Google\Model { protected $digestType = GoogleDevtoolsRemoteworkersV1test2Digest::class; protected $digestDataType = ''; public $path; /** * @param GoogleDevtoolsRemoteworkersV1test2Digest */ public function setDigest(GoogleDevtoolsRemoteworkersV1test2Digest $digest) { $this->digest = $digest; } /** * @return GoogleDevtoolsRemoteworkersV1test2Digest */ public function getDigest() { return $this->digest; } public function setPath($path) { $this->path = $path; } public function getPath() { return $this->path; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(GoogleDevtoolsRemoteworkersV1test2DirectoryMetadata::class, your_sha256_hash1test2DirectoryMetadata'); ```
William Traher (1908-1984) was an American painter and muralist. He painted a mural in the DeWitt Post Office in DeWitt, Arkansas. His work was exhibited at the Museum of Modern Art in 1936. References 1908 births 1984 deaths People from Rock Springs, Wyoming Artists from Wyoming American male painters American muralists Section of Painting and Sculpture artists 20th-century American painters 20th-century American male artists
```java package com.yahoo.search.searchers.test; import com.yahoo.search.Query; import com.yahoo.search.schema.Field; import com.yahoo.search.schema.FieldSet; import com.yahoo.search.schema.Schema; import com.yahoo.search.schema.SchemaInfo; import com.yahoo.search.searchchain.Execution; import com.yahoo.search.searchers.QueryValidator; import org.junit.jupiter.api.Test; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; /** * @author bratseth */ public class QueryValidatorFieldTypeTest { @Test void testTensorsCannotBeSearchedForTerms() { var test = new Schema.Builder("test") .add(new Field.Builder("mytensor1", "tensor(x[100])").build()) .add(new Field.Builder("mytensor2", "tensor<float>(x[100])").build()) .add(new Field.Builder("mystring", "string").addAlias("fieldAlias").build()) .add(new FieldSet.Builder("myFieldSet").addField("mystring").build()) .build(); var schemaInfo = new SchemaInfo(List.of(test), List.of()); Execution execution = new Execution(Execution.Context.createContextStub(schemaInfo)); assertSucceeds("?query=mystring:foo", execution); assertSucceeds("?query=fieldAlias:foo", execution); assertSucceeds("?query=myFieldSet:foo", execution); assertSucceeds("?query=none:foo", execution); assertFails("Cannot search for terms in 'mytensor1': It is a tensor field", "?query=mytensor1:foo", execution); assertFails("Cannot search for terms in 'mytensor2': It is a tensor field", "?query=mytensor2:foo", execution); } private void assertSucceeds(String query, Execution execution) { new QueryValidator().search(new Query(query), execution); } private void assertFails(String expectedError, String query, Execution execution) { try { new QueryValidator().search(new Query(query), execution); fail("Expected validation error from " + query); } catch (IllegalArgumentException e) { // success assertEquals(expectedError, e.getMessage()); } } } ```
```go // go run mksyscall.go -openbsd -tags openbsd,arm64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && arm64 // +build openbsd,arm64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(from int, to int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrtable() (rtable int, err error) { r0, _, e1 := RawSyscall(SYS_GETRTABLE, 0, 0, 0) rtable = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrtable(rtable int) (err error) { _, _, e1 := RawSyscall(SYS_SETRTABLE, uintptr(rtable), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, buf *byte, nbuf int) (n int, err error) { r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, buf *byte, nbuf int) (n int, err error) { r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } ```
Osc-Dis or Oscillator in Distortion is the eighth album by Japanese band The Mad Capsule Markets. It was released in Japan in 1999 and released outside Japan in 2001. Osc-Dis was the band's breakthrough album and finally got them recognized overseas, with the single "Pulse". The album mixes industrial metal, industrial rock and punk rock with various kinds of electronic music. It was more melodic than their previous album and included elements of pop punk. There are vocal contributions from Hirosuke from Balzac, Yamada from Geronimo, and Katsya from NND. This album also saw the birth of the band's mascots The White Crusher and The Cyborn. The song "Pulse" appears on the in-game soundtrack to Tony Hawk's Pro Skater 3 and in Jonny Moseley Mad Trix. Track listing Other versions include a digipak with a bonus DVD including videos for "Tribe", "Pulse", "All the Time in Sunny Beach", "Good Girl", "MIDI Surf", and "Systematic" References The Mad Capsule Markets albums 1999 albums 2001 albums
```python import itertools from routersploit.core.exploit import * from routersploit.core.telnet.telnet_client import TelnetClient from routersploit.resources import wordlists class Exploit(TelnetClient): __info__ = { "name": "Telnet Bruteforce", "description": "Module performs bruteforce attack against Telnet service. " "If valid credentials are found, they are displayed to the user.", "authors": ( "Marcin Bury <marcin[at]threat9.com>", # routersploit module ), "devices": ( "Multiple devices", ) } target = OptIP("", "Target IPv4, IPv6 address or file with ip:port (file://)") port = OptPort(23, "Target Telnet port") threads = OptInteger(8, "Number of threads") usernames = OptWordlist("admin", "Username or file with usernames (file://)") passwords = OptWordlist(wordlists.passwords, "Password or file with passwords (file://)") stop_on_success = OptBool(True, "Stop on first valid authentication attempt") verbosity = OptBool(True, "Display authentication attempts") def run(self): self.credentials = [] self.attack() @multi def attack(self): if not self.check(): return print_status("Starting bruteforce attack against Telnet service") data = LockedIterator(itertools.product(self.usernames, self.passwords)) self.run_threads(self.threads, self.target_function, data) if self.credentials: print_success("Credentials found!") headers = ("Target", "Port", "Service", "Username", "Password") print_table(headers, *self.credentials) else: print_error("Credentials not found") def target_function(self, running, data): while running.is_set(): try: username, password = data.next() telnet_client = self.telnet_create() if telnet_client.login(username, password, retries=3): if self.stop_on_success: running.clear() self.credentials.append((self.target, self.port, self.target_protocol, username, password)) telnet_client.close() except StopIteration: break def check(self): telnet_client = self.telnet_create() if telnet_client.test_connect(): print_status("Target exposes Telnet service", verbose=self.verbosity) return True print_status("Target does not expose Telnet service", verbose=self.verbosity) return False @mute def check_default(self): if self.check(): self.credentials = [] data = LockedIterator(itertools.product(self.usernames, self.passwords)) self.run_threads(self.threads, self.target_function, data) if self.credentials: return self.credentials return None ```
Epermenia pseudofuscomaculata is a moth of the family Epermeniidae. It is endemic to Kyushu, Japan. The length of the forewings is . As the species name suggests, it is similar to Epermenia fuscomaculata, but the forewings are a little darker, especially on the apical area. The fasciae are reddish brown. Etymology The specific name refers to the similarity to Epermenia fuscomaculata. References External links Moths described in 2006 Endemic insects of Japan Epermeniidae Moths of Japan
Eight hundred and thirty-one municipalities in the Canadian province of Quebec held municipal elections to elect mayors and councillors on November 7, 1993. Incumbent mayor Jean-Paul L'Allier was re-elected in Quebec City and his Rassemblement Populaire party won sixteen out of twenty council seats. Municipal elections were not held in Montreal, Quebec's largest city, in this electoral cycle. The previous municipal election in Montreal took place in 1990 and the next was scheduled for 1994. Results Laval Source: "Incumbents all re-elected in Montreal East voting," Montreal Gazette, 9 November 1993, A6. Verdun Party colours have been randomly chosen and do not indicate affiliation with or resemblance to any municipal, provincial, or federal party. Source: "Incumbents all re-elected in Montreal East voting," Montreal Gazette, 9 November 1993, A6. References 1993
```go /* path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package jsonutils import ( "bytes" "encoding/json" "io" "strings" "testing" "github.com/MakeNowJust/heredoc/v2" ) func TestWriteToken(t *testing.T) { tests := []struct { name string input string indent string expected string }{ { name: "WriteJson", input: heredoc.Doc(`{"key1": 123,"key2" : true } `), indent: "", expected: heredoc.Doc(`{ "key1": 123, "key2": true }`), }, { name: "WriteJsonWithIndent", input: heredoc.Doc(`{"key1" :123, "999" : [123.5678,"abc"] }`), indent: "###", expected: heredoc.Doc(`###{ ### "key1": 123, ### "999": [ ### 123.5678, ### "abc" ### ] ###}`), }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { var buf bytes.Buffer out := &JSONStreamWriter{ out: &buf, indent: test.indent, } in := json.NewDecoder(strings.NewReader(test.input)) for { token, err := in.Token() if err != nil { if err == io.EOF { // No more token break } else { t.Fatalf("unexpected error parsing json input: %v", err) } } if err := out.WriteToken(token); err != nil { t.Fatalf("error writing json: %v", err) } } if buf.String() != test.expected { t.Fatalf("Actual result:\n%s\nExpect:\n%s", buf.String(), test.expected) } }) } } ```
Qasr Ali () is a Syrian village located in Al-Hamraa Nahiyah in Hama District, Hama. According to the Syria Central Bureau of Statistics (CBS), Qasr Ali had a population of 263 in the 2004 census. References Populated places in Hama District
```xml /** * A recreation of this demo: path_to_url */ import { Chart } from '@antv/g2'; const axis = { zIndex: 1, titlePosition: 'right', line: true, labelStroke: '#fff', labelLineWidth: 5, labelFontSize: 10, labelStrokeLineJoin: 'round', titleStroke: '#fff', titleFontSize: 10, titleLineWidth: 5, titleStrokeLineJoin: 'round', titleTransform: 'translate(-50%, 0) rotate(-90)', lineStroke: 'black', tickStroke: 'black', lineLineWidth: 1, }; const chart = new Chart({ container: 'container', autoFit: true, }); chart.coordinate({ type: 'parallel' }); chart .line() .data({ type: 'fetch', value: 'path_to_url }) .encode('position', [ 'economy (mpg)', 'cylinders', 'displacement (cc)', 'power (hp)', 'weight (lb)', '0-60 mph (s)', 'year', ]) .encode('color', 'weight (lb)') .style('lineWidth', 1.5) .style('strokeOpacity', 0.4) .scale('color', { palette: 'brBG', offset: (t) => 1 - t, }) .legend({ color: { length: 400, layout: { justifyContent: 'center' } }, }) .axis('position', axis) .axis('position1', axis) .axis('position2', axis) .axis('position3', axis) .axis('position4', axis) .axis('position5', axis) .axis('position6', axis) .axis('position7', axis); chart.interaction('tooltip', { series: false }); chart.render(); ```
Myristica guatteriifolia is a species of plant in the family Myristicaceae. It is a tree found in Indonesia, Malaysia, Myanmar, the Philippines, and Vietnam. References guatteriifolia Trees of Myanmar Trees of Vietnam Trees of Malesia Least concern plants Taxonomy articles created by Polbot
"The Hanging Tree" is a song by American composer James Newton Howard featuring vocals from American actress Jennifer Lawrence. It was written by Suzanne Collins and composed by Howard, Jeremiah Fraites and Wesley Schultz from the band the Lumineers. The song was released by Republic Records on December 9, 2014, as the second single from the soundtrack for The Hunger Games: Mockingjay, Part 1 (2014). It was first included in the film's score album but was later added to the digital extended edition of the film's soundtrack. "The Hanging Tree" is a folk ballad that features orchestral strings and a choir. "The Hanging Tree" received mostly positive reviews from music critics with some praising Lawrence's vocals, its elements of Appalachian music, and its effectiveness as a murder ballad. Commercially, the song garnered success on charts internationally, peaking atop record charts in several markets, including Austria, Hungary, and Germany. It debuted and peaked at number 12 on the Billboard Hot 100 and at number 20 in the United Kingdom's Official Chart Company. "The Hanging Tree" was eventually certified platinum in Canada and Germany as well as double platinum in the United States. To promote the song, a remix by producer Michael Gazzo was released. Background and release "The Hanging Tree" was written by Suzanne Collins and originally appeared in her novel Mockingjay (2010); Jeremiah Fraites and Wesley Schultz from American indie folk band the Lumineers composed the track while production was handled by James Newton Howard. Schultz revealed that director Francis Lawrence instructed him to create a melody that could be "hummed or sung by one person" or "by a thousand people"; he also informed Schultz not to make the song "overly complicated". To Schultz, the song felt like an innocent nursery rhyme despite its dark undertones. Schultz and Fraites then submitted a "couple melodies in about a day and a half or two days" during the month of September 2013. Lawrence later contacted both Schultz and Fraites via text message that the melody was chosen for the film, saying, "It worked out great in the movie. We just shot the scene. [Jennifer] was really nervous but it went great." The lead protagonist Katniss Everdeen performs the song in the film, which is also heard over the closing credits. Jennifer Lawrence revealed on Late Night with David Letterman that she was anxious about singing the song in the film, citing her fear of "singing in front of other people" as her reason; she also disclosed that she cried on set when filming the scene. Francis confessed to Vulture that Jennifer Lawrence suggested New Zealand singer Lorde instead provide vocals for the track that she could lip sync to on film; Francis rejected this idea. In preparation, Francis sent Jennifer Lawrence to a vocal coach, in an effort to provide the actress with confidence; she also practiced singing "all day" for the scene. "The Hanging Tree" was released as part of the film's score soundtrack on 24 November 2014; it is accompanied with a B-side titled "The Mockingjay". The track does not appear on the original release of the film's soundtrack. However, due to the success of "The Hanging Tree", it was later added to the digital extended edition of the soundtrack as the 15th track. On 9 December 2014, "The Hanging Tree" was released as the second single from the soundtrack. Michael Gazzo released a remix of the songβ€”titled "The Hanging Tree" (Rebel Remix)β€”on 15 December 2014. In an interview with Yahoo! Music, Gazzo commented that despite the track's dark tonality, he envisioned the song "uplifting an entire group of people to rise up. To unite." Composition and use in books "The Hanging Tree" is composed in the key of A minor with a "moderately, somewhat freely" tempo of 88 beats per minute. Lawrence's vocals span a range of E3 to A5 and its chord progression follows a basic sequence of A5–Am–Asus–F/A. It is a folk ballad, accompanied with orchestral strings and a choir. Chris Payne of The Hollywood Reporter called it a "minimal folk sing-a-long". WBUR noted that the song's themes represent the tropes of Appalachian music, which commonly used murder themes in their lyrics. "The Hanging Tree" received comparisons to other songs such as "Tom Dooley", Billie Holiday's 1939 ballad "Strange Fruit" (which also includes references to hanging and trees), and the civil rights protest song "We Shall Overcome" as well as a passage from Frederick Douglass' memoir My Bondage and My Freedom (1855) about African-American spirituals. In the film, Lawrence performs the song a cappella. In the novel's context, it is a song that Katniss learned from her father, and is used as a battlecry. Katniss's mother prohibited the use of the song in her home after hearing Katniss and her sister Primrose chant the song while making necklaces. Peeta Mellark, Katniss's love interest, associates "The Hanging Tree" with her father; Peeta heard her father sing the song once when he traded goods at Peeta's parents' bakery. According to Haymitch Abernathy, the song was the first memory Peeta associated with Katniss that did not trigger a "mental breakdown" after the Capitol propagandized him. After realizing this, Katniss uses "The Hanging Tree" as a remedy for Peeta's "Capitol-implanted hatred". She reminds herself of the song once more after Peeta tells her to kill him, in an effort to prevent himself from harming members of their rescue team due to how the Capitol "reprogrammed" him. In the adaption, however, Plutarch Heavensbee uses the film of Katniss singing as anti-Capitol propaganda and changes the lyrics from "necklace of rope" to "necklace of hope" to reduce some of the macabre undertones in the original song. Plutarch then uses the song as a rebel anthem. In The Ballad of Songbirds and Snakes (2020), the song is revealed to have been penned by Lucy Gray Baird, the first Hunger Games victor from District 12. Lucy Gray wrote the song after she and Coriolanus Snow witnessed the execution of a rebel called Arlo Chance. Arlo was being hanged for killing three men, and his lover, Lil, was in the crowd. When she screamed his name he yelled for her to run. The jabberjays in the area picked it up and after he was dead, continued to repeat it. That inspired the first two lines of the song. The song's namesake was the site where Lucy Gray would meet her former lover, Billy Taupe. The hangings were conducted from a tree because District 12 had not been provided with proper gallows at the time. Reception and promotion "The Hanging Tree" received positive reviews from music critics, with several critics complimenting its effectiveness as a murder ballad. Jeff Baker, writing for OregonLive.com called the song the best part of the film. Baker complimented Lawrence for turning the track into a "murder ballad that calls back to her Kentucky roots". Stereogum writer Gabriella Tully Claymore called it a "creepy-as-hell take on classic Americana murder ballads". Stephanie Merry from The Washington Post praised Lawrence's vocal delivery, commenting that her "raspy voice [matches] the dark narrative and Appalachian style of the music". "The Hanging Tree" debuted at number 12 on the US Billboard Hot 100 for the week of 13 December 2014 and debuted outside the 50 position (2.1 million U.S. streams) on Streaming Songs, charting at number two (200,000 downloads sold) on Digital Songs and received eight spins on U.S. radio. "The Hanging Tree" became the highest-charting song from The Hunger Games franchise on the chart, surpassing "Eyes Open" by Taylor Swift, which peaked at number 19. Lawrence became one of 13 Academy Award-winning recipients to chart on the Hot 100; the last female Academy Award winner to achieve this feat was Cher with "Believe" (1998). The song peaked at number one in Austria, Germany and Hungary; it peaked in the top five in Australia. It was certified platinum by Music Canada (MC) and double platinum by the Recording Industry Association of America (RIAA). "The Hanging Tree" was performed live for the first time at "Hollywood in Vienna", a gala honoring excellence in music. James Newton Howard performed with Edita MalovčiΔ‡ as a substitute for Lawrence; it was conducted by Keith Lockhart of the Boston Pops Orchestra. Howard was reportedly in tears after the performance and rose to his feet to give a standing ovation. To promote the song, Howard embarked on a European tour called "3 Decades of Music for Hollywood" and held a contest in search for a female vocalist, one for each tour date, that would sing Lawrence's verses. On September 20, 2023, "The Hanging Tree (Lucy Gray's version)" featuring vocals from American actress Rachel Zegler, who portrayed the protagonist Lucy Gray Baird performs the song in the film" as the first single from the unreleased The Hunger Games: The Ballad of Songbirds & Snakes was teased in a trailer for The Ballad of Songbirds and Snakes, A film adaptation from the same book and served as a spin-off and a prequel to The Hunger Games trilogy. released on November 17, 2023. confirmed by film producer Nina Jacobson in her twitter. Track listing Personnel Credits adapted from the liner notes of The Hunger Games: Mockingjay, Part 1 (Original Motion Picture Score). Jennifer Lawrence – vocals Suzanne Collins – songwriter James Newton Howard – producer Wesley Schultz – composer Jeremiah Fraites – composer Charts Weekly charts Year-end charts Certifications Release history References 2014 songs 2014 singles The Hunger Games music Folk ballads American folk songs 2010s ballads Murder ballads Songs about trees Music based on novels The Lumineers Number-one singles in Austria Number-one singles in Germany Number-one singles in Hungary
The Changan Alsvin V3 is a subcompact sedan produced by Chinese auto maker Changan Automobile. Overview Previewed by the Changan B501 concept, the production version Alsvin V3 subcompact sedan debuted at the 2011 Guangzhou Auto Show. Later actually listed as the Alsvin 100 or Yuexiang 100, and finally with the confirmed name of Alsvin V3 when launched on to the market in June 2012. Price ranges from 43.900 to 48.900 yuan. The Changan Alsvin V3 is a subcompact sedan slightly smaller and positioned under the Changan Alsvin/Changan Alsvin V5 in the market, and is built on a different platform employing multi-link independent suspension in the rear. The Alsvin V3 is powered by a 1.3 liter inline-4 16V DOHC engine producing 69kW and 121Nm with a 5-speed manual transmission as the only gearbox option. Deliveries of the Alsvin V3 started on June 20, 2012. In 2013, 76,858 units were sold and 70,143 deliveries were made in 2014. Facelift A facelift debuted on the 2014 Guangzhou Auto Show with a launch on the Chinese car market at Q1 2015. The facelift focuses on the front with a new grille similar to the ones on the Alsvin V7. The post-facelift model adds a 1.4 liter EA14 inline-four engine and a 5-speed automatic transmission as additional options. References External links – Changan Official website Cars introduced in 2012 2010s cars Cars of China Front-wheel-drive vehicles Alsvin V3 Subcompact cars Sedans
Below are the results for season 12 (XII) of the World Poker Tour Results Merit Cyprus Classic Casino: Merit Crystal Cove Hotel and Casino, Alsancak Mevkii Kyrenia, Cyprus Buy-in: $4,000 + $400 6-Day Event: August 16-21, 2013 Number of Entries: 262 Total Prize Pool: $1,000,000 Number of Payouts: 27 Legends of Poker Casino: The Bicycle Casino, Bell Gardens, California Buy-in: $3,500 + $200 7-Day Event: August 29-September 4, 2013 Number of Entries: 716 Total Prize Pool: $2,430,820 Number of Payouts: 72 Borgata Poker Open Casino: Borgata, Atlantic City, New Jersey Buy-in: $3,300 + 200 6-Day Event: September 15-20, 2013 Number of Entries: 1,189 Total Prize Pool: $3,805,989 Number of Payouts: 110 Grand Prix de Paris Casino: Aviation Club de France, Paris, France Buy-in: €7,500 6-Day Event: October 25-30, 2013 Number of Entries: 187 Total Prize Pool: €1,839,496 Number of Payouts: 21 Emperors Palace Poker Classic Casino: Emperors Palace Hotel Casino, Johannesburg, South Africa Buy-in: $3,300 + $300 5-Day Event: November 7-11, 2013 Number of Entries: 191 Total Prize Pool: $561,528 Number of Payouts: 27 bestbet Jacksonville Fall Poker Scramble Casino: bestbet Jacksonville, Jacksonville, Florida Buy-in: $3,200 + $240 5-Day Event: November 15-19, 2013 Number of Entries: 358 Total Prize Pool: $1,145,600 Number of Payouts: 45 WPT Caribbean Casino: Casino Royale, St. Maarten Buy-in: $3,200 + $300 6-Day Event: November 19-24, 2013 Number of Entries: 191 Total Prize Pool: $592,864 Number of Payouts: 24 WPT Montreal Casino: Playground Poker Club, Kahnawake, Quebec Buy-in: $3,500 + $350 7-Day Event: November 29-December 5, 2013 Number of Entries: 862 Total Prize Pool: $2,738,435 Number of Payouts: 99 Doyle Brunson Five Diamond World Poker Classic Casino: Bellagio, Las Vegas, Nevada Buy-in: $10,000 + $300 6-Day Event: December 6-11, 2013 Number of Entries: 449 Total Prize Pool: $4,355,300 Number of Payouts: 45 WPT South Korea Casino: Ramada Plaza Jeju, Jeju, South Korea Buy-in: $2,700 + $300 4-Day Event: December 16-19, 2013 Number of Entries: 137 Total Prize Pool: $358,803 Number of Payouts: 21 WPT Prague Casino: Card Casino Prague, Prague, Czech Republic Buy-in: €3,300 7-Day Event: December 15-21, 2013 Number of Entries: 306 Total Prize Pool: €881,550 Number of Payouts: 36 Borgata Winter Poker Open Casino: Borgata, Atlantic City, New Jersey Buy-in: $3,300 + $200 6-Day Event: January 26-31, 2014 Number of Entries: 1,229 Total Prize Pool: $3,934,029 Number of Payouts: 120 Lucky Hearts Poker Open Casino: Seminole Casino Coconut Creek, Coconut Creek, Florida Buy-in: $3,250 + $175 + $75 6-Day Event: February 7-12, 2014 Number of Entries: 415 Total Prize Pool: $1,348,750 Number of Payouts: 54 Fallsview Poker Classic Casino: Fallsview Casino, Niagara Falls, Ontario Buy-in: $5,000 3-Day Event: February 22-24, 2014 Number of Entries: 383 Total Prize Pool: $1,729,510 Number of Payouts: 45 L.A. Poker Classic Casino: Commerce Casino, Commerce, California Buy-in: $9,600 + $400 6-Day Event: March 1-6, 2014 Number of Entries: 534 Total Prize Pool: $5,126,400 Number of Payouts: 63 Bay 101 Shooting Star Casino: Bay 101, San Jose, California Buy-in: $7,150 + $350 5-Day Event: March 10-14, 2014 Number of Entries: 718 Total Prize Pool: $5,133,700 Number of Payouts: 72 WPT Venice Carnival Casino: Casino di Venezia Ca Vendramin Calergi, Venice, Italy Buy-in: €2,700 + €300 6-Day Event: March 10-15, 2014 Number of Entries: 144 Total Prize Pool: €377,136 Number of Payouts: 18 WPT Thunder Valley Casino: Thunder Valley Casino, Lincoln, California Buy-in: $3,200 + $300 5-Day Event: March 15-19, 2014 Number of Entries: 465 Total Prize Pool: $1,488,000 Number of Payouts: 54 Jacksonville bestbet Open Casino: bestbet Jacksonville, Jacksonville, Florida Buy-in: $3,200 + $240 + $60 5-Day Event: March 21-25, 2014 Number of Entries: 258 Total Prize Pool: $825,600 Number of Payouts: 27 Seminole Hard Rock Showdown Casino: Seminole Hard Rock Hotel and Casino, Hollywood, Florida Buy-in: $3,500 7-Day Event: April 10-16, 2014 Number of Entries: 1,795 Total Prize Pool: $5,763,150 Number of Payouts: 170 WPT World Championship Casino: Borgata, Atlantic City, New Jersey Buy-in: $15,000 + $400 5-Day Event: April 22-26, 2014 Number of Entries: 328 Total Prize Pool: $4,852,400 Number of Payouts: 36 References World Poker Tour 2013 in poker 2014 in poker
```c /***************************************************************************** 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 of Intel Corporation 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. ****************************************************************************** * Contents: Native C interface to LAPACK utility function * Author: Intel Corporation *****************************************************************************/ #include "lapacke_utils.h" /* Converts input general matrix from row-major(C) to column-major(Fortran) * layout or vice versa. */ void API_SUFFIX(LAPACKE_zgg_trans)( int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_double* in, lapack_int ldin, lapack_complex_double* out, lapack_int ldout ) { API_SUFFIX(LAPACKE_zge_trans)( matrix_layout, m, n, in, ldin, out, ldout ); } ```
```java /* * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package org.apache.rocketmq.store.ha; import org.apache.rocketmq.common.BrokerConfig; import org.apache.rocketmq.store.DefaultMessageStore; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) public class HAClientTest { private HAClient haClient; @Mock private DefaultMessageStore messageStore; @Before public void setUp() throws Exception { // when(messageStore.getMessageStoreConfig()).thenReturn(new MessageStoreConfig()); when(messageStore.getBrokerConfig()).thenReturn(new BrokerConfig()); this.haClient = new DefaultHAClient(this.messageStore); } @After public void tearDown() throws Exception { this.haClient.shutdown(); } @Test public void updateMasterAddress() { assertThat(this.haClient.getMasterAddress()).isNull(); this.haClient.updateMasterAddress("127.0.0.1:10911"); assertThat(this.haClient.getMasterAddress()).isEqualTo("127.0.0.1:10911"); this.haClient.updateMasterAddress("127.0.0.1:10912"); assertThat(this.haClient.getMasterAddress()).isEqualTo("127.0.0.1:10912"); } @Test public void updateHaMasterAddress() { assertThat(this.haClient.getHaMasterAddress()).isNull(); this.haClient.updateHaMasterAddress("127.0.0.1:10911"); assertThat(this.haClient.getHaMasterAddress()).isEqualTo("127.0.0.1:10911"); this.haClient.updateHaMasterAddress("127.0.0.1:10912"); assertThat(this.haClient.getHaMasterAddress()).isEqualTo("127.0.0.1:10912"); } } ```
Pearl Ondaatje was a pioneer of Radio Ceylon, the oldest radio station in South Asia. She was one of the radio station's first female newsreaders and a presenter of radio programs, including programs for women listeners of the radio station. Pearl Ondaatje worked very closely with the Australian administrator Clifford Dodd and Livy Wijemanne in shaping the new Commercial Service of Radio Ceylon in the 1950s in Colombo. Millions of listeners across South Asia tuned into the hear the voices of announcers such as Pearl Ondaatje. Radio Ceylon ruled the airwaves of the Indian sub-continent in the 1950s and 1960s. She is a relative of the Canadian philanthropist, Sir Christopher Ondaatje and his brother, the award-winning author Michael Ondaatje, who were both born in Ceylon. See also Radio Ceylon Sri Lanka Broadcasting Corporation External links Sri Lanka Broadcasting Corporation Sir Christopher Ondaatje Michael Ondaatje SLBC-creating new waves of history Eighty Years of Broadcasting in Sri Lanka Sri Lankan radio journalists P Indian Tamil journalists of Sri Lanka
Datisca cannabina, called false hemp, is a species of flowering plant in the genus Datisca, family Datiscaceae, native to the Aegean Islands, Crete, Cyprus, Anatolia, the Levant, the Transcaucasus, Iraq, Iran, Central Asia, Afghanistan, Pakistan, the western Himalayas and Nepal. It is one of the very few species known to have true androdioecy, meaning it has a mix of male and hermaphroditic individuals. This tall herbaceous perennial grows to a maximum height and spread of , with ash-like clusters of bright green leaves, and arching shoots covered in tassels of small green and white flowers during summer. It is hardy but prefers a sheltered position in full sun or partial shade. Local artisans use its roots to produce a fast yellow dye. References Datiscaceae Taxa named by Carl Linnaeus Plants described in 1753
```javascript import React from 'react'; import { Nav, NavItem, NavLink } from 'reactstrap'; import Props from '../Props'; function Example() { return <Props components={[Nav, NavItem, NavLink]} />; } export default Example; ```
Xylophanes schreiteri is a moth of the family Sphingidae. It is known from Argentina and Bolivia. The wingspan is 71–92Β mm. It is similar to Xylophanes resta, but both forewings and hindwings are apically more falcate and the outer margin of the forewing is straighter. Furthermore, distal to discal spot on the forewing upperside there is a dark brown dash running parallel and sometimes connected to the first postmedian line, which is stronger and reaches closer to the apex. The forewing underside has a pale yellow apical area on the costa, although this is occasionally pale buff and contrasting strongly with the orange-yellow ground colour. Adults are on wing from February to March and again from October to November in Argentina. The larvae probably feed on Rubiaceae and Malvaceae species. References schreiteri Moths described in 1923
```c /* * * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ #include "pxr/imaging/plugin/hioAvif/aom/config/aom_config.h" #define RTCD_C #include "pxr/imaging/plugin/hioAvif/aom/config/av1_rtcd.h" #include "pxr/imaging/plugin/hioAvif/aom/aom_ports/aom_once.h" void av1_rtcd() { // TODO(JBB): Remove this aom_once, by insuring that both the encoder and // decoder setup functions are protected by aom_once(); aom_once(setup_rtcd_internal); } ```
Dingy-en-Vuache (; ) is a commune in the Haute-Savoie department in the Auvergne-RhΓ΄ne-Alpes region in south-eastern France. See also Communes of the Haute-Savoie department References Communes of Haute-Savoie
Jorge Carneiro (born 11 September 1956) is a Brazilian equestrian. He competed in two events at the 1984 Summer Olympics. References 1956 births Living people Brazilian male equestrians Olympic equestrians for Brazil Equestrians at the 1984 Summer Olympics Sportspeople from Rio de Janeiro (city)
```python from __future__ import annotations import re from datetime import datetime, timedelta, timezone from math import fmod from typing import Any from .singleton_local_time_zone import local_time_zone from .time_span import TimeSpan, total_microseconds from .time_span import create as create_time_span from .types import FSharpRef from .util import DateKind # Some of the code in this file has been adapted from # path_to_url short_days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] long_days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] short_months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ] long_months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ] def subtract(x: datetime, y: datetime | TimeSpan) -> datetime | TimeSpan: if isinstance(y, datetime): delta = x - y # ts.microseconds only contains the microseconds provided to the constructor # so we need to calculate the total microseconds ourselves delta_microseconds = delta.days * (24 * 3600 * 10**6) + delta.seconds * 10**6 + delta.microseconds return create_time_span(0, 0, 0, 0, 0, delta_microseconds) return x - timedelta(microseconds=total_microseconds(y)) def op_subtraction(x: datetime, y: datetime | TimeSpan) -> datetime | TimeSpan: return subtract(x, y) def create( year: int, month: int, day: int, h: int = 0, m: int = 0, s: int = 0, ms: int = 0, mc: int = 0, kind: DateKind | None = None, ) -> datetime: if kind == DateKind.UTC: date = datetime( year=year, month=month, day=day, hour=h, minute=m, second=s, microsecond=mc + ms * 1_000, tzinfo=timezone.utc, ) else: date = datetime(year, month, day, h, m, s, mc + ms * 1_000) if kind == DateKind.Local: date = date.astimezone(local_time_zone) return date def year(d: datetime) -> int: return d.year def month(d: datetime) -> int: return d.month def day(d: datetime) -> int: return d.day def hour(d: datetime) -> int: return d.hour def minute(d: datetime) -> int: return d.minute def second(d: datetime) -> int: return d.second def millisecond(d: datetime) -> int: return d.microsecond // 1_000 def microsecond(d: datetime) -> int: return d.microsecond def to_universal_time(d: datetime) -> datetime: return d.astimezone(timezone.utc) def day_of_week(d: datetime) -> int: return (d.weekday() + 1) % 7 def day_of_year(d: datetime) -> int: return d.timetuple().tm_yday def to_short_date_string(date: datetime) -> str: return datetime.strftime(date, "%m/%d/%Y") def to_long_date_string(date: datetime) -> str: return datetime.strftime(date, "%A, %d %B %Y") def to_short_time_string(date: datetime) -> str: return datetime.strftime(date, "%H:%M") def to_long_time_string(date: datetime) -> str: return datetime.strftime(date, "%H:%M:%S") def parse_repeat_token(format: str, pos: int, pattern_char: str) -> int: token_length = 0 internal_pos = pos while internal_pos < len(format) and format[internal_pos] == pattern_char: internal_pos += 1 token_length += 1 return token_length # Get the next character at the index of 'pos' in the 'format' string. # Return value of -1 means 'pos' is already at the end of the 'format' string. # Otherwise, return value is the int value of the next character. def parse_next_char(format: str, pos: int) -> int: if pos >= len(format) - 1: return -1 return ord(format[pos + 1]) def parse_quoted_string(format: str, pos: int) -> tuple[str, int]: begin_pos = pos format_length = len(format) # Get the character used to quote the string quote_char = format[pos] result = "" found_quote = False while pos < format_length: pos += 1 current_char = format[pos] if current_char == quote_char: found_quote = True break elif current_char == "\\": if pos < format_length: pos += 1 result += format[pos] else: # This means that '\'is the last character in the format string. raise ValueError("Invalid string format") else: result += current_char if not found_quote: # We couldn't find the matching quote raise ValueError(f"Invalid string format could not find matching quote for {quote_char}") return (result, pos - begin_pos + 1) def date_to_string_with_custom_format(date: datetime, format: str, utc: bool) -> str: cursor_pos = 0 token_length = 0 result = "" localized_date = date.astimezone(timezone.utc) if utc else date while cursor_pos < len(format): token = format[cursor_pos] match token: case "d": token_length = parse_repeat_token(format, cursor_pos, "d") cursor_pos += token_length match token_length: case 1: result += str(localized_date.day) case 2: result += localized_date.strftime("%d") case 3: result += short_days[day_of_week(localized_date)] case 4: result += long_days[day_of_week(localized_date)] case _: pass case "f": token_length = parse_repeat_token(format, cursor_pos, "f") cursor_pos += token_length match token_length: case 1 | 2 | 3 | 4 | 5 | 6: precision = 10 ** (6 - token_length) result += str(localized_date.microsecond // precision).zfill(token_length) # Python datetime only support precision up to the microsecond # so we need to fill the rest with 0 case 7: result += str(localized_date.microsecond).zfill(6).ljust(token_length, "0") case _: pass case "F": token_length = parse_repeat_token(format, cursor_pos, "F") cursor_pos += token_length match token_length: case 1 | 2 | 3 | 4 | 5 | 6: precision = 10 ** (6 - token_length) value = localized_date.microsecond // precision if value != 0: result += str(value).zfill(token_length) # Python datetime only support precision up to the microsecond # so we can't go further # We alse need to pad start with 0 if the value is not 0 case 7: value = localized_date.microsecond if value != 0: result += str(value).zfill(6).rstrip("0") case _: pass case "g": token_length = parse_repeat_token(format, cursor_pos, "g") cursor_pos += token_length match token_length: case 1 | 2: result += "A.D." case _: pass case "h": token_length = parse_repeat_token(format, cursor_pos, "h") cursor_pos += token_length match token_length: case 1: result += str(localized_date.hour % 12) case 2: result += localized_date.strftime("%I") case _: pass case "H": token_length = parse_repeat_token(format, cursor_pos, "H") cursor_pos += token_length match token_length: case 1: result += str(localized_date.hour) case 2: result += localized_date.strftime("%H") case _: pass case "K": token_length = parse_repeat_token(format, cursor_pos, "K") cursor_pos += token_length match token_length: case 1: match kind(date): case DateKind.UTC: result += "Z" case DateKind.Local: # %:z is not a perfect match for the .NET equivalent # but it seems to do the job # If needed we can probably compute the offset manually # and format it ourselves result += date.strftime("%:z") case DateKind.Unspecified: result += "" case _: pass case "m": token_length = parse_repeat_token(format, cursor_pos, "m") cursor_pos += token_length match token_length: case 1: result += str(localized_date.minute) case 2: result += localized_date.strftime("%M") case _: pass case "M": token_length = parse_repeat_token(format, cursor_pos, "M") cursor_pos += token_length match token_length: case 1: result += str(localized_date.month) case 2: result += localized_date.strftime("%m") case 3: result += short_months[month(localized_date) - 1] case 4: result += long_months[month(localized_date) - 1] case _: pass case "s": token_length = parse_repeat_token(format, cursor_pos, "s") cursor_pos += token_length match token_length: case 1: result += str(localized_date.second) case 2: result += localized_date.strftime("%S") case _: pass case "t": token_length = parse_repeat_token(format, cursor_pos, "t") cursor_pos += token_length match token_length: case 1: result += localized_date.strftime("%p")[:1] case 2: result += localized_date.strftime("%p") case _: pass case "y": token_length = parse_repeat_token(format, cursor_pos, "y") cursor_pos += token_length match token_length: case 1: result += str(localized_date.year % 100) case 2: result += str(localized_date.year)[-2:].zfill(2) case length: result += str(localized_date.year).zfill(length) case "z": token_length = parse_repeat_token(format, cursor_pos, "z") cursor_pos += token_length match kind(date): case DateKind.UTC: utc_offet_text = localized_date.strftime("%z") case DateKind.Local: utc_offet_text = localized_date.strftime("%z") case DateKind.Unspecified: utc_offet_text = to_local_time(date).strftime("%z") sign = utc_offet_text[:1] hours = int(utc_offet_text[1:3]) minutes = int(utc_offet_text[3:5]) match token_length: case 1: result += f"{sign}{hours}" case 2: result += f"{sign}{hours:02}" case 3 | _: result += f"{sign}{hours:02}:{minutes:02}" case ":": cursor_pos += 1 result += ":" case "/": cursor_pos += 1 result += "/" case "'" | '"': quoted_string, quoted_string_length = parse_quoted_string(format, cursor_pos) cursor_pos += quoted_string_length result += quoted_string case "%": next_char = parse_next_char(format, cursor_pos) if next_char >= 0 and next_char != ord("%"): cursor_pos += 2 result += date_to_string_with_custom_format(date, chr(next_char), utc) else: raise Exception("Invalid string format") case "\\": next_char = parse_next_char(format, cursor_pos) if next_char >= 0: result += chr(next_char) cursor_pos += 2 else: raise Exception("Invalid string format") case _: cursor_pos += 1 result += token pass return result def date_to_string_with_offset(date: datetime, format: str | None = None) -> str: utc = date.tzinfo == timezone.utc match format: case None: raise NotImplementedError("date_to_string_with_offset") case "O" | "o": return date.strftime("%Y-%m-%dT%H:%M:%S.%fZ") case _ if len(format) == 1: raise Exception("Unrecognized Date print format") case _: return date_to_string_with_custom_format(date, format, utc) def date_to_string_with_kind(date: datetime, format: str | None = None) -> str: utc = date.tzinfo == timezone.utc if not format: return date.isoformat() if utc else str(date) elif len(format) == 1: if format == "d": return to_short_date_string(date) elif format == "D": return to_long_date_string(date) elif format == "T": return to_long_time_string(date) elif format == "t": return to_short_time_string(date) elif format == "O" or format == "o": return date.astimezone().isoformat(timespec="milliseconds") else: raise Exception("Unrecognized Date print format") else: return date_to_string_with_custom_format(date, format, utc) def to_string(date: datetime, format: str | None = None, provider: Any | None = None) -> str: if date.tzinfo: return date_to_string_with_offset(date, format) return date_to_string_with_kind(date, format) def now() -> datetime: return datetime.now() def utc_now() -> datetime: return datetime.utcnow() def today() -> datetime: return datetime.replace(now(), hour=0, minute=0, second=0, microsecond=0) def to_local_time(date: datetime) -> datetime: return date.astimezone().replace(tzinfo=local_time_zone) def compare(x: datetime, y: datetime) -> int: if x == y: return 0 if x < y: return -1 return 1 def equals(x: datetime, y: datetime) -> bool: return x == y def max_value() -> datetime: return datetime.max def min_value() -> datetime: return datetime.min def op_addition(x: datetime, y: TimeSpan) -> datetime: return x + timedelta(microseconds=total_microseconds(y)) def add(x: datetime, y: TimeSpan) -> datetime: return op_addition(x, y) def parse(string: str) -> datetime: try: return datetime.fromisoformat(string).astimezone() except ValueError: pass # For the time-only formats, needs a special treatment # because in Python, they are set in 1900-01-01 while # in F# they are set in the current date hoursFormats = { # Matches a time string in 24-hour format "HH:MM:SS" r"^\d{1,2}:\d{1,2}:\d{2}$": "%H:%M:%S", # Matches a time string in 12-hour format with AM/PM "HH:MM:SS AM" or "HH:MM:SS PM" r"^(0?[1-9]|1[0-2]):([0-5][1-9]|0?[0-9]):([0-5][0-9]|0?[0-9]) [AP]M$": "%I:%M:%S %p", r"^\d{1,2}:\d{1,2}:\d{2} [AP]M$": "%H:%M:%S %p", } for pattern, format in hoursFormats.items(): if re.fullmatch(pattern, string): hourDate = datetime.strptime(string, format) # If the hour is 0 PM, then in .NET it is 12 PM (python keeps it as 0) hourOffset = 12 if hourDate.hour == 0 and string.endswith(" PM") else 0 return datetime.replace( now(), hour=hourDate.hour + hourOffset, minute=hourDate.minute, second=hourDate.second, microsecond=0, ) formats = { # 9/10/2014 1:50:34 PM r"^(0?[1-9]|1[0-2])\/(0?[1-9]|1[0-2])\/\d{4} ([0-9]|(0|1)[0-9]|2[0-4]):([0-5][0-9]|0?[0-9]):([0-5][0-9]|0?[0-9]) [AP]M$": "%m/%d/%Y %I:%M:%S %p", # 9/10/2014 1:50:34 r"^(0?[1-9]|1[0-2])\/(0?[1-9]|1[0-2])\/\d{4} ([0-9]|(0|1)[0-9]|2[0-4]):([0-5][0-9]|0?[0-9]):([0-5][0-9]|0?[0-9])$": "%m/%d/%Y %H:%M:%S", } for pattern, format in formats.items(): if re.fullmatch(pattern, string): return datetime.strptime(string, format) # Matches a datetime string in the format "YYYY-MM-DDTHH:MM:SS.ffffff". This format usually parses with # `fromisoformat`, but not with Python 3.10 iso_format_regex = r"(?P<header>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.)(?P<microseconds>\d{0,7})" # In Python %f only supports exactly 6 digits so we need to adapt the string # If microseconds has 7 digits, we remove the last one # If microseconds has less than 6 digits, we pad it with 0 def adapt_microseconds(m: re.Match[str]) -> str: microseconds = m.group("microseconds") header_text = m.group("header") if len(microseconds) == 7: microseconds = microseconds[:-1] return header_text + microseconds.ljust(6, "0") if re.fullmatch(iso_format_regex, string): adapted_string = re.sub(iso_format_regex, adapt_microseconds, string) return datetime.strptime(adapted_string, "%Y-%m-%dT%H:%M:%S.%f") raise ValueError("Unsupported format by Fable: %s" % (string)) def try_parse(string: str, def_value: FSharpRef[datetime]) -> bool: try: def_value.contents = parse(string) return True except Exception: return False def date(d: datetime) -> datetime: return create(d.year, d.month, d.day, 0, 0, 0, 0, 0, kind(d)) def is_leap_year(year: int) -> bool: return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) def days_in_month(year: int, month: int) -> int: if month == 2: return 29 if is_leap_year(year) else 28 if month in (4, 6, 9, 11): return 30 return 31 def add_years(d: datetime, v: int) -> datetime: new_month = month(d) new_year = year(d) + v _days_in_month = days_in_month(new_year, new_month) new_day = min(_days_in_month, day(d)) return create(new_year, new_month, new_day, hour(d), minute(d), second(d), millisecond(d), microsecond(d), kind(d)) def add_months(d: datetime, v: int) -> datetime: new_month = month(d) + v new_month_ = 0 year_offset = 0 if new_month > 12: new_month_ = int(fmod(new_month, 12)) year_offset = new_month // 12 new_month = new_month_ elif new_month < 1: new_month_ = 12 + int(fmod(new_month, 12)) year_offset = new_month // 12 + (-1 if new_month_ == 12 else 0) new_month = new_month_ new_year = year(d) + year_offset _days_in_month = days_in_month(new_year, new_month) new_day = min(_days_in_month, day(d)) return create(new_year, new_month, new_day, hour(d), minute(d), second(d), millisecond(d), microsecond(d), kind(d)) def add_days(d: datetime, v: int) -> datetime: return d + timedelta(days=v) def add_hours(d: datetime, v: int) -> datetime: return d + timedelta(hours=v) def add_minutes(d: datetime, v: int) -> datetime: return d + timedelta(minutes=v) def add_seconds(d: datetime, v: int) -> datetime: return d + timedelta(seconds=v) def add_milliseconds(d: datetime, v: int) -> datetime: return d + timedelta(milliseconds=v) def add_microseconds(d: datetime, v: int) -> datetime: return d + timedelta(microseconds=v) def kind(d: datetime) -> DateKind: if d.tzinfo == timezone.utc: return DateKind.UTC elif d.tzinfo is None: return DateKind.Unspecified # Should we check that tzinfo is local_time_zone? return DateKind.Local def specify_kind(d: datetime, kind: DateKind) -> datetime: return create(year(d), month(d), day(d), hour(d), minute(d), second(d), millisecond(d), microsecond(d), kind) def ticks(d: datetime) -> int: # Note: It can happens that Ticks differs a little bit from the .NET implementation # because of some rounding/precision issues in Python # DateTime(1, 1, 1, 0, 0, 0, 0, 99, DateTimeKind.Utc).Ticks should be 990 # but Python returns 1040 # because d.timestamp(): # - returns -62135596799.9999 # - instead of -62135596800000 # compute timestamp in microseconds return unix_epoch_microseconds_to_ticks(int(d.timestamp() * 1_000_000), date_offset(d) * 1_000) def unix_epoch_microseconds_to_ticks(us: int, offset: int) -> int: return int(((us + 62135596800000000) + offset) * 10) def ticks_to_unix_epoch_microseconds(ticks: int) -> int: return int((ticks - 621355968000000000) // 10) def date_offset(d: datetime) -> int: if d.tzinfo == timezone.utc: return 0 else: utc_offset = d.utcoffset() # Is it correct to force an offset to local time # for DateKind.Unspecified? if utc_offset is None: forced_utc_offset = d.astimezone().utcoffset() assert forced_utc_offset is not None return int(forced_utc_offset.total_seconds() * 1_000) else: return int(utc_offset.total_seconds() * 1_000) # return 0 if d.tzinfo == timezone.utc else def create_from_epoch_microseconds(us: int, kind: DateKind | None = None) -> datetime: if kind == DateKind.UTC: date = datetime.fromtimestamp(us / 1_000_000, timezone.utc) else: date = datetime.fromtimestamp(us / 1_000_000) if kind == DateKind.Local: date = date.astimezone() return date def from_ticks(ticks: int, kind: DateKind | None = None) -> datetime: # Better default than Unspecified kind = kind or DateKind.Local date = create_from_epoch_microseconds(ticks_to_unix_epoch_microseconds(ticks), kind) # Ticks are local to offset (in this case, either UTC or Local/Unknown). # If kind is anything but UTC, that means that the tick number was not # in utc, thus getTime() cannot return UTC, and needs to be shifted. if kind != DateKind.UTC: date = create_from_epoch_microseconds(int(date.timestamp() * 1_000_000 - date_offset(date) * 1_000), kind) return date __all__ = [ "subtract", "op_subtraction", "create", "year", "month", "day", "hour", "minute", "second", "millisecond", "microsecond", "to_universal_time", "day_of_week", "day_of_year", "to_short_date_string", "to_long_date_string", "to_short_time_string", "to_long_time_string", "to_string", "now", "utc_now", "today", "to_local_time", "compare", "equals", "max_value", "min_value", "op_addition", "add", "parse", "try_parse", "date", "is_leap_year", "days_in_month", "add_years", "add_months", "add_days", "add_hours", "add_minutes", "add_seconds", "add_milliseconds", "add_microseconds", "kind", "specify_kind", "ticks", "date_offset", "from_ticks", ] ```
Arniston Rangers Football Club are a Scottish football club, based in the town of Gorebridge. They play in the East of Scotland Football League (Second Division), having moved from the SJFA East Region Premier League in 2018. Nicknamed "Arni", they were formed in 1878 and presently play their home games at Newbyres Park, which has room for 1,000 spectators. They wear maroon strips (uniforms). Towards the end of the 2022/23 season Arni got young ultras providing a great atmosphere at Newbyres Park. They also achieved promotion to the EOSFL First Division in the 2022/23 Season. Ground problems at Newbyres meant that some home games during the 2008–09 season were played at Musselburgh. Honours Scottish Junior Cup Runners-up: 1922–23 Other honours Edinburgh & District League winners: 1953–54 East Region Division One winners: 1969–70, 1971–72 Fife & Lothians Cup winners: 1975–76, 1997–98 East Region Division Two winners: 1994–95 East of Scotland Junior Cup winners: 1909–10, 1912–13, 1921–22, 1922–23, 1947–48, 1970–71, 1980–81 Brown Cup winners: 1975–76 Andy Kelly Cup 2008 St Michaels Cup 2005–06 Former players 1. Players that have played/managed in the top two divisions of the Scottish Football League or any foreign equivalent to this level (i.e. fully professional league).2. Players with full international caps.3. Players that hold a club record or have captained the club. Paddy Crossan Willie Wilson Scott Nisbet Darren McGregor References External links Official club site Football clubs in Scotland Scottish Junior Football Association clubs Football in Midlothian Association football clubs established in 1878 1878 establishments in Scotland East of Scotland Football League teams
```smalltalk using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Reflection; namespace ClosedXML.Tests { /// <summary> /// Summary description for ResourceFileExtractor. /// </summary> public sealed class ResourceFileExtractor { #region Static #region Private fields private static readonly IDictionary<string, ResourceFileExtractor> extractors = new ConcurrentDictionary<string, ResourceFileExtractor>(); #endregion Private fields #region Public properties /// <summary>Instance of resource extractor for executing assembly </summary> public static ResourceFileExtractor Instance { get { Assembly _assembly = Assembly.GetCallingAssembly(); string _key = _assembly.GetName().FullName; if (!extractors.TryGetValue(_key, out ResourceFileExtractor extractor) && !extractors.TryGetValue(_key, out extractor)) { extractor = new ResourceFileExtractor(_assembly, true, null); extractors.Add(_key, extractor); } return extractor; } } #endregion Public properties #endregion Static #region Private fields private readonly Assembly m_assembly; private readonly ResourceFileExtractor m_baseExtractor; private bool m_isStatic; //private string ResourceFilePath { get; } #endregion Private fields #region Constructors /// <summary> /// Create instance /// </summary> /// <param name="resourceFilePath"><c>ResourceFilePath</c> in assembly. Example: .Properties.Scripts.</param> /// <param name="baseExtractor"></param> public ResourceFileExtractor(string resourceFilePath, ResourceFileExtractor baseExtractor) : this(Assembly.GetCallingAssembly(), baseExtractor) { ResourceFilePath = resourceFilePath; } /// <summary> /// Create instance /// </summary> /// <param name="baseExtractor"></param> public ResourceFileExtractor(ResourceFileExtractor baseExtractor) : this(Assembly.GetCallingAssembly(), baseExtractor) { } /// <summary> /// Create instance /// </summary> /// <param name="resourcePath"><c>ResourceFilePath</c> in assembly. Example: .Properties.Scripts.</param> public ResourceFileExtractor(string resourcePath) : this(Assembly.GetCallingAssembly(), resourcePath) { } /// <summary> /// Instance constructor /// </summary> /// <param name="assembly"></param> /// <param name="resourcePath"></param> public ResourceFileExtractor(Assembly assembly, string resourcePath) : this(assembly ?? Assembly.GetCallingAssembly()) { ResourceFilePath = resourcePath; } /// <summary> /// Instance constructor /// </summary> public ResourceFileExtractor() : this(Assembly.GetCallingAssembly()) { } /// <summary> /// Instance constructor /// </summary> /// <param name="assembly"></param> public ResourceFileExtractor(Assembly assembly) : this(assembly ?? Assembly.GetCallingAssembly(), (ResourceFileExtractor)null) { } /// <summary> /// Instance constructor /// </summary> /// <param name="assembly"></param> /// <param name="baseExtractor"></param> public ResourceFileExtractor(Assembly assembly, ResourceFileExtractor baseExtractor) : this(assembly ?? Assembly.GetCallingAssembly(), false, baseExtractor) { } /// <summary> /// Instance constructor /// </summary> /// <param name="assembly"></param> /// <param name="isStatic"></param> /// <param name="baseExtractor"></param> /// <exception cref="ArgumentNullException">Argument is null.</exception> private ResourceFileExtractor(Assembly assembly, bool isStatic, ResourceFileExtractor baseExtractor) { #region Check if (assembly is null) { throw new ArgumentNullException("assembly"); } #endregion Check Assembly = assembly; m_baseExtractor = baseExtractor; AssemblyName = Assembly.GetName().Name; IsStatic = isStatic; ResourceFilePath = ".Resources."; } #endregion Constructors #region Public properties /// <summary> Work assembly </summary> public Assembly Assembly { get; } /// <summary> Work assembly name </summary> public string AssemblyName { get; } /// <summary> /// Path to read resource files. Example: .Resources.Upgrades. /// </summary> public string ResourceFilePath { get; } public bool IsStatic { get; set; } public IEnumerable<string> GetFileNames(Func<String, Boolean> predicate = null) { predicate = predicate ?? (s => true); string _path = AssemblyName + ResourceFilePath; foreach (string _resourceName in Assembly.GetManifestResourceNames()) { if (_resourceName.StartsWith(_path) && predicate(_resourceName)) { yield return _resourceName.Replace(_path, string.Empty); } } } #endregion Public properties #region Public methods public string ReadFileFromResource(string fileName) { Stream _stream = ReadFileFromResourceToStream(fileName); string _result; StreamReader sr = new StreamReader(_stream); try { _result = sr.ReadToEnd(); } finally { sr.Close(); } return _result; } public string ReadFileFromResourceFormat(string fileName, params object[] formatArgs) { return string.Format(ReadFileFromResource(fileName), formatArgs); } /// <summary> /// Read file in current assembly by specific path /// </summary> /// <param name="specificPath">Specific path</param> /// <param name="fileName">Read file name</param> public string ReadSpecificFileFromResource(string specificPath, string fileName) { ResourceFileExtractor _ext = new ResourceFileExtractor(Assembly, specificPath); return _ext.ReadFileFromResource(fileName); } /// <summary> /// Read file in current assembly by specific file name /// </summary> /// <param name="fileName"></param> /// <exception cref="ApplicationException"><c>ApplicationException</c>.</exception> public Stream ReadFileFromResourceToStream(string fileName) { string _nameResFile = AssemblyName + ResourceFilePath + fileName; Stream _stream = Assembly.GetManifestResourceStream(_nameResFile); #region Not found if (_stream is null) { #region Get from base extractor if (!(m_baseExtractor is null)) { return m_baseExtractor.ReadFileFromResourceToStream(fileName); } #endregion Get from base extractor throw new ArgumentException("Can't find resource file " + _nameResFile, nameof(fileName)); } #endregion Not found return _stream; } #endregion Public methods } } ```
Smoking in Taiwan is regulated by the Tobacco Hazards Prevention Act (Taiwan). Tobacco advertising is banned, and smoking is banned in all indoor public places. Taiwan was the second Asian country to institute an indoor smoking ban, after Bhutan. The Government of Taiwan (Republic of China) is planning to extend the smoking ban to cars, motorbikes, and pedestrians. Prevalence Of Taiwan's population of 23 million, about 5 million people smoke. Within Taipei, Taiwan's capital city, the prevalence rate decreased to 15.3% in 2009. 2010 was Taipei's Anti-smoking year. However, in 2013 Taiwan recorded 18% of adult smoking rate, the lowest since 1990. This was the result of the government efforts to discourage smoking since the enactment of the Tobacco Hazards Prevention Act in 1997. Studies have shown that the smoke-free legislation has had a positive effect on the rate of quitting attempts and annual cessation rates in Taiwan. Law Smoking is prohibited in the following places: schools under the level of senior high school and other places in which the main purpose is to provide education or a venue for activities to children and teenagers the indoor places of colleges or universities, libraries, museums, art galleries, and other institutions for cultural or social education the places of medical treatment centers, nursing institutions, other medical institutions, and social welfare organizations, with the exception of the indoor smoking rooms of welfare organizations for the elderly with independent ventilation systems and that are completely separated from the non-smoking areas (rooms), or the outdoor places of said social welfare organizations for the elderly the indoor places of governmental agencies and state-owned enterprises mass transportation vehicles, taxicabs, tour buses, the MRT system, stations, and traveler waiting areas places where flammable or explosive articles are manufactured, stored, or sold business places of financial institutions, post offices, and telecommunication enterprises places providing indoor physical training, sports, or body fitness inside classrooms, reading rooms, laboratories, performance halls and auditoriums, exhibition halls, conference halls (rooms) and elevators the indoor places of opera houses, movie theaters, audiovisual singing businesses, information leisure businesses, and other public leisure entertainment places the indoor places of hotels, shopping malls, dining and drinking establishments, and other places for public consumption, except for those places with indoor smoking rooms that have independent ventilation systems and that are completely separated from the non-smoking areas (rooms), semi-open-air restaurants and places that provide drinks, cigar bars, and pubs and audiovisual singing businesses that open business after 9:00pm and are restricted to those 18 years of age or older indoor workplaces shared by more than three persons other indoor places for public use and places or transportation vehicles designated by the competent authorities at each level. Conspicuous non-smoking signs shall be placed at all entrances of the places prescribed in the preceding paragraph. No smoking paraphernalia shall be supplied or displayed therein. Guidelines for related measures of space, equipment and establishment of the indoor smoking rooms prescribed in the preceding Subparagraph 3 of Paragraph 1 and the provision of the preceding Subparagraph 11 of Paragraph 1 shall be enacted by the central competent authority in charge. As per the authorization of the Tobacco Hazards Prevention Act (β€œthe Act” hereafter) promulgated on 11 July 2007, the guidelines for related measures of space, equipment and establishment of the indoor smoking rooms (β€œthe room” hereafter) prescribed in the Act’s Subparagraph 3 of Paragraph 1 in Article 15 and the provision of the Act’s Subparagraph 11 of Paragraph 1 in Article 15 were enacted by Department of Health, Executive Yuan, and are summarized as follows: The area shall be above 6 m2 and below 35 m2. It may occupy at most 20% of the total floor space of the establishment. No services other than smoking, cleaning or maintenance shall be provided. The room shall be fully separated with physical barriers from other areas of the building. The entrance shall be sliding door type with automatic closing mechanism. It shall remain closed except when people enter or leave the room. The requirements of the independent air-conditioning and ventilation systems of the room are as follows: equipped with fresh air and exhaust ductwork directly connecting to outdoor area and independent to any other indoor spaces, air-conditioning or ventilation systems; negative pressure of 8 Pa; ventilation rate of 30 m3/hour per m2 of floor area of the room and replaces the full volume of air 10 times per hour; distance between the exhaust vent of the room and the entrance of the building or any other buildings or nonsmoking areas shall be above 5 m. The room shall not be in operation 1 hour before and after the cleaning or maintenance work and the independent air-conditioning and ventilation system shall remain on during this period. Enforcement Fines have been issued to both individuals and businesses for violations. The government created a hotline (0800-531-531) and offers a monetary reward for citizens who submit photos of violations. References External links No Smoking: Taiwan's Tobacco Hazard Prevention and Control Act Tobacco Hazards Prevention Act implemented in Taiwan Taiwan - Tobacco Hazards Control Act Tobacco Hazard Prevention Act takes effect in Taiwan Taiwan Tobacco in Taiwan
Health in Israel is generally considered good. Infant mortality is low. Life expectancy, 82.1 years is high. There is good management of chronic disease and excellent primary care. Expenditure on healthcare is 7.2% of Gross Domestic Product, compared with an average of 9.2% in the OECD. In 2003, Israel had the second highest rate of skin cancer in the world, but this has decreased substantially since then due to public health campaigns recommending avoiding the hottest time of day, discouraging sun-bathing and using sun protection such as greater clothing coverage and sunscreen. Hereditary breast, ovarian and melanoma cancer rates are particularly acute in Ashkenazi Jewish populations in Israel (31.8% of Israeli Jews), in-part due to a higher-prevalence of BRCA and BRCA2 mutations (1 in 40 vs 1 in 400 in most populations worldwide) in Ashkenazi Jewish populations, which increase the likelihood of hereditary cancers. Overweight and obesity In 2013-2015 adult overweight & obesity rates in Israel were 36.7% and 17.8% respectively. Socioeconomic status was one factor that impacted overweight and obesity percentages, particularly for women. Women in lower classes were four times as likely to be overweight or obese as women in upper classes. Only 20.2% of the entire population reported that they exercise for twenty minutes or more three times a week. The frequency of exercise among the Jewish Israeli population was twice as high as that for the Arab population. Men and women of Arab descent are more likely to be of an unhealthy weight than Jewish men and women. Obesity is also far more common among Haredi Jews than secular Jews. Smoking Smoking prevalence among males remained relatively constant at 30% in the years 1994–2004. Among females the prevalence declined slightly from 25% in 1998 to 18% in 2003. For youth, 14% smoked at least once per week in a 2001 publication. In 2005 Israeli youths have begun to use bidis and hookah, as alternative methods of tobacco use. In 1990, smoking was the cause of about 1,800 male deaths in Israel which was around 12% of all male deaths. Smoking has not been found to be significant cause of death among Israeli women. The average number of cigarettes smoked per Israeli stands at 2162 (6). There are several anti-tobacco use legislations in effect. For instance, advertising is prohibited in youth publications and is forbidden on television and radio. in addition to substantial increases in tobacco taxes, although comparatively the prices are still among the lowest compared to all of the European countries. Until 2004, there was no minimum age requirement for buying tobacco products in Israel, however, an amendment to the tobacco marketing and advertisement law that became effective at 2004 has limited the sale of tobacco to people above the age of 18. According to Israel Central Bureau of Statistics, the smoking rate in the Israeli adult population in 2009 was 20.9%, down from 34% in 2000. A Ministry of Health nationwide survey conducted in 2011 found that 20.6% of the population aged 21 and older were smokers. The highest percentage of smokers was among Arab males, 44% percent of whom smoked, though this figure is down from 50% in 1996. In 2014 19.8% of adult Israelis smoked, 26.3% in the Arab population and 18.4% in the Jewish population. 35% of non-smoking respondents to the World Health Survey reported that they had been exposed to passive smoking. Smoking is responsible for about 8,000 deaths in Israel every year, about 700 among passive smokers. The cost of the damage of smoking to the health system is estimated at NIS 1.7 billion (about $440 million) a year. The annual loss of working capacity and paid sick days in the wider economy is estimated at NIS 1.9 billion ($490 million). About NIS 8.2 billion ($2.12 billion) is spent on tobacco products each year. 40 tons of tobacco worth some NIS 24 million ($6.2 million) and about 1.3 million cigarette packs were intercepted at the border crossing between Israel and the Palestinian Authority in 2014. See also Healthcare in Israel Universal healthcare in Israel References
```smalltalk namespace CSharpFunctionalExtensions { public interface IResult { bool IsFailure { get; } bool IsSuccess { get; } } public interface IValue<out T> { T Value { get; } } public interface IError<out E> { E Error { get; } } public interface IResult<out T, out E> : IValue<T>, IUnitResult<E> { } public interface IResult<out T> : IResult<T, string> { } public interface IUnitResult<out E> : IResult, IError<E> { } } ```
```objective-c /****************************************************************************** * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * ******************************************************************************/ #ifndef _HCI_LAYER_H_ #define _HCI_LAYER_H_ #include "common/bt_target.h" #include "stack/bt_types.h" #include "osi/allocator.h" #include "osi/osi.h" #include "osi/future.h" #include "osi/thread.h" #include "osi/pkt_queue.h" ///// LEGACY DEFINITIONS ///// /* Message event mask across Host/Controller lib and stack */ #define MSG_EVT_MASK 0xFF00 /* eq. BT_EVT_MASK */ #define MSG_SUB_EVT_MASK 0x00FF /* eq. BT_SUB_EVT_MASK */ /* Message event ID passed from Host/Controller lib to stack */ #define MSG_HC_TO_STACK_HCI_ERR 0x1300 /* eq. BT_EVT_TO_BTU_HCIT_ERR */ #define MSG_HC_TO_STACK_HCI_ACL 0x1100 /* eq. BT_EVT_TO_BTU_HCI_ACL */ #define MSG_HC_TO_STACK_HCI_SCO 0x1200 /* eq. BT_EVT_TO_BTU_HCI_SCO */ #define MSG_HC_TO_STACK_HCI_EVT 0x1000 /* eq. BT_EVT_TO_BTU_HCI_EVT */ #define MSG_HC_TO_STACK_L2C_SEG_XMIT 0x1900 /* eq. BT_EVT_TO_BTU_L2C_SEG_XMIT */ /* Message event ID passed from stack to vendor lib */ #define MSG_STACK_TO_HC_HCI_ACL 0x2100 /* eq. BT_EVT_TO_LM_HCI_ACL */ #define MSG_STACK_TO_HC_HCI_SCO 0x2200 /* eq. BT_EVT_TO_LM_HCI_SCO */ #define MSG_STACK_TO_HC_HCI_CMD 0x2000 /* eq. BT_EVT_TO_LM_HCI_CMD */ /* Local Bluetooth Controller ID for BR/EDR */ #define LOCAL_BR_EDR_CONTROLLER_ID 0 #define HCI_CMD_MSG_F_VND_FUTURE (0x01) #define HCI_CMD_MSG_F_VND_QUEUED (0x02) #define HCI_CMD_MSG_F_VND_SENT (0x04) ///// END LEGACY DEFINITIONS ///// typedef struct hci_hal_t hci_hal_t; //typedef struct btsnoop_t btsnoop_t; typedef struct controller_t controller_t; //typedef struct hci_inject_t hci_inject_t; typedef struct packet_fragmenter_t packet_fragmenter_t; //typedef struct vendor_t vendor_t; //typedef struct low_power_manager_t low_power_manager_t; //typedef unsigned char * bdaddr_t; typedef uint16_t command_opcode_t; /* typedef enum { LPM_DISABLE, LPM_ENABLE, LPM_WAKE_ASSERT, LPM_WAKE_DEASSERT } low_power_command_t; */ typedef void (*command_complete_cb)(BT_HDR *response, void *context); typedef void (*command_status_cb)(uint8_t status, BT_HDR *command, void *context); typedef struct hci_t { // Send a low power command, if supported and the low power manager is enabled. //void (*send_low_power_command)(low_power_command_t command); // Do the postload sequence (call after the rest of the BT stack initializes). void (*do_postload)(void); // Send a command through the HCI layer void (*transmit_command)( BT_HDR *command, command_complete_cb complete_callback, command_status_cb status_cb, void *context ); future_t *(*transmit_command_futured)(BT_HDR *command); // Send some data downward through the HCI layer void (*transmit_downward)(uint16_t type, void *data); } hci_t; const hci_t *hci_layer_get_interface(void); int hci_start_up(void); void hci_shut_down(void); bool hci_downstream_data_post(uint32_t timeout); #if (BLE_ADV_REPORT_FLOW_CONTROL == TRUE) int hci_adv_credits_prep_to_release(uint16_t num); int hci_adv_credits_try_release(uint16_t num); int hci_adv_credits_force_release(uint16_t num); #endif #endif /* _HCI_LAYER_H_ */ ```
The Trade Disputes Act 1965 is an Act of Parliament of the United Kingdom, which supported closed shop practices in industrial relations. The principal effect was to reverse the legal position established by Rookes v Barnard in 1964, in which the threat of strike action from a union resulted in the sacking of a worker who had recently left that union. The House of Lords, acting as the highest court of appeal, held that the threat of strike action was unlawful intimidation. The Trades Union Congress was concerned that the case would set a precedent for lawsuits against trade unions in a wide range of circumstances. Civil law had been one of the main tools employers used against unions in their early days until the Trade Disputes Act 1906 gave unions immunity from certain torts (including conspiracy) when taken in pursuit of an industrial dispute. However, intimidation was not covered under the Trades Disputes Act, and it seemed possible that the Rookes vs Barnard judgment would support classifying a strike in any closed shop dispute as unlawful 'intimidation'. As a result, the Labour government of Harold Wilson introduced legislation to restore the status quo from before the case. The Act specified that a threat to withhold one's own labour or to induce others to do the same could give no cause for action in tort. However, a case of 'intimidation' in the everyday sense (for instance, a threat of physical violence) in the course of an industrial dispute would still be unlawful for the same reasons as set out in the case. The Conservatives sought to amend the legislation to exclude the protection if the dispute was regarding the continued employment of an individual. That was intended to undermine the practice of the closed shop, the subject of the original case. The closed shop was eroded by the Conservative government in the 1980s and eventually banned by the Employment Act 1990. References United Kingdom Acts of Parliament 1965
Marodian is a rural locality in the Fraser Coast Region, Queensland, Australia. In the , Marodian had a population of 0 people. History The locality takes its name from the parish name, which in turn is derived from the name of a pastoral run held by James and Norman Leith Hay in 1852. The pastoral run name might come from the Kabi language word maridhan meaning place of kangaroos. References Fraser Coast Region Localities in Queensland
```java package org.bouncycastle.asn1.pkcs; import java.math.BigInteger; import java.util.Enumeration; import org.bouncycastle.asn1.ASN1EncodableVector; import org.bouncycastle.asn1.ASN1Integer; import org.bouncycastle.asn1.ASN1Object; import org.bouncycastle.asn1.ASN1Primitive; import org.bouncycastle.asn1.ASN1Sequence; import org.bouncycastle.asn1.ASN1TaggedObject; import org.bouncycastle.asn1.DERSequence; /** * @deprecated use RSAPrivateKey */ public class RSAPrivateKeyStructure extends ASN1Object { private int version; private BigInteger modulus; private BigInteger publicExponent; private BigInteger privateExponent; private BigInteger prime1; private BigInteger prime2; private BigInteger exponent1; private BigInteger exponent2; private BigInteger coefficient; private ASN1Sequence otherPrimeInfos = null; public static RSAPrivateKeyStructure getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); } public static RSAPrivateKeyStructure getInstance( Object obj) { if (obj instanceof RSAPrivateKeyStructure) { return (RSAPrivateKeyStructure)obj; } else if (obj instanceof ASN1Sequence) { return new RSAPrivateKeyStructure((ASN1Sequence)obj); } throw new IllegalArgumentException("unknown object in factory: " + obj.getClass().getName()); } public RSAPrivateKeyStructure( BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger prime1, BigInteger prime2, BigInteger exponent1, BigInteger exponent2, BigInteger coefficient) { this.version = 0; this.modulus = modulus; this.publicExponent = publicExponent; this.privateExponent = privateExponent; this.prime1 = prime1; this.prime2 = prime2; this.exponent1 = exponent1; this.exponent2 = exponent2; this.coefficient = coefficient; } public RSAPrivateKeyStructure( ASN1Sequence seq) { Enumeration e = seq.getObjects(); BigInteger v = ((ASN1Integer)e.nextElement()).getValue(); if (v.intValue() != 0 && v.intValue() != 1) { throw new IllegalArgumentException("wrong version for RSA private key"); } version = v.intValue(); modulus = ((ASN1Integer)e.nextElement()).getValue(); publicExponent = ((ASN1Integer)e.nextElement()).getValue(); privateExponent = ((ASN1Integer)e.nextElement()).getValue(); prime1 = ((ASN1Integer)e.nextElement()).getValue(); prime2 = ((ASN1Integer)e.nextElement()).getValue(); exponent1 = ((ASN1Integer)e.nextElement()).getValue(); exponent2 = ((ASN1Integer)e.nextElement()).getValue(); coefficient = ((ASN1Integer)e.nextElement()).getValue(); if (e.hasMoreElements()) { otherPrimeInfos = (ASN1Sequence)e.nextElement(); } } public int getVersion() { return version; } public BigInteger getModulus() { return modulus; } public BigInteger getPublicExponent() { return publicExponent; } public BigInteger getPrivateExponent() { return privateExponent; } public BigInteger getPrime1() { return prime1; } public BigInteger getPrime2() { return prime2; } public BigInteger getExponent1() { return exponent1; } public BigInteger getExponent2() { return exponent2; } public BigInteger getCoefficient() { return coefficient; } /** * This outputs the key in PKCS1v2 format. * <pre> * RSAPrivateKey ::= SEQUENCE { * version Version, * modulus INTEGER, -- n * publicExponent INTEGER, -- e * privateExponent INTEGER, -- d * prime1 INTEGER, -- p * prime2 INTEGER, -- q * exponent1 INTEGER, -- d mod (p-1) * exponent2 INTEGER, -- d mod (q-1) * coefficient INTEGER, -- (inverse of q) mod p * otherPrimeInfos OtherPrimeInfos OPTIONAL * } * * Version ::= INTEGER { two-prime(0), multi(1) } * (CONSTRAINED BY {-- version must be multi if otherPrimeInfos present --}) * </pre> * <p> * This routine is written to output PKCS1 version 2.1, private keys. */ public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new ASN1Integer(version)); // version v.add(new ASN1Integer(getModulus())); v.add(new ASN1Integer(getPublicExponent())); v.add(new ASN1Integer(getPrivateExponent())); v.add(new ASN1Integer(getPrime1())); v.add(new ASN1Integer(getPrime2())); v.add(new ASN1Integer(getExponent1())); v.add(new ASN1Integer(getExponent2())); v.add(new ASN1Integer(getCoefficient())); if (otherPrimeInfos != null) { v.add(otherPrimeInfos); } return new DERSequence(v); } } ```
```javascript module.exports = { policy: require('./basic-auth'), schema: { $id: 'path_to_url allOf: [ { $ref: 'path_to_url } ] } }; ```
```javascript CKEDITOR.plugins.setLang("templates","en-ca",{button:"Templates",emptyListMsg:"(No templates defined)",insertOption:"Replace actual contents",options:"Template Options",selectPromptMsg:"Please select the template to open in the editor",title:"Content Templates"}); ```
```javascript var _ = require('lodash') var path = require('path') var minimist = require('minimist') var version = require('./package.json').version var EventEmitter = require('events') module.exports = function (cb) { var zenbot = { version } var args = minimist(process.argv.slice(3)) var conf = {} var config = {} var overrides = {} module.exports.debug = args.debug // 1. load conf overrides file if present if(!_.isUndefined(args.conf)){ try { overrides = require(path.resolve(process.cwd(), args.conf)) } catch (err) { console.error(err + ', failed to load conf overrides file!') } } // 2. load conf.js if present try { conf = require('./conf') } catch (err) { console.error(err + ', falling back to conf-sample') } // 3. Load conf-sample.js and merge var defaults = require('./conf-sample') _.defaultsDeep(config, overrides, conf, defaults) zenbot.conf = config var eventBus = new EventEmitter() zenbot.conf.eventBus = eventBus var authStr = '', authMechanism, connectionString if(zenbot.conf.mongo.username){ authStr = encodeURIComponent(zenbot.conf.mongo.username) if(zenbot.conf.mongo.password) authStr += ':' + encodeURIComponent(zenbot.conf.mongo.password) authStr += '@' // authMechanism could be a conf.js parameter to support more mongodb authentication methods authMechanism = zenbot.conf.mongo.authMechanism || 'DEFAULT' } if (zenbot.conf.mongo.connectionString) { connectionString = zenbot.conf.mongo.connectionString } else { connectionString = 'mongodb://' + authStr + zenbot.conf.mongo.host + ':' + zenbot.conf.mongo.port + '/' + zenbot.conf.mongo.db + '?' + (zenbot.conf.mongo.replicaSet ? '&replicaSet=' + zenbot.conf.mongo.replicaSet : '' ) + (authMechanism ? '&authMechanism=' + authMechanism : '' ) } require('mongodb').MongoClient.connect(connectionString, { useNewUrlParser: true, useUnifiedTopology: true}, function (err, client) { if (err) { console.error('WARNING: MongoDB Connection Error: ', err) console.error('WARNING: without MongoDB some features (such as backfilling/simulation) may be disabled.') console.error('Attempted authentication string: ' + connectionString) cb(null, zenbot) return } var db = client.db(zenbot.conf.mongo.db) _.set(zenbot, 'conf.db.mongo', db) cb(null, zenbot) }) } ```
```xml <Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> <PropertyGroup Label="Configuration"> <SignAssembly>True</SignAssembly> <DelaySign>False</DelaySign> <RootNamespace /> <DocumentationFile>$(TargetDir)bin\$(Configuration)\$(TargetFramework)\itext.svg.xml</DocumentationFile> </PropertyGroup> <PropertyGroup> <TargetFrameworks>netstandard2.0;net461</TargetFrameworks> </PropertyGroup> <PropertyGroup> <OutputType>library</OutputType> </PropertyGroup> <PropertyGroup> <AssemblyOriginatorKeyFile>itext.snk</AssemblyOriginatorKeyFile> </PropertyGroup> <PropertyGroup> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> <AssemblyName>itext.svg</AssemblyName> <RootNamespace /> </PropertyGroup> <PropertyGroup> <NoWarn>1701;1702;1591;1570;1572;1573;1574;1580;1584;1658;0108</NoWarn> </PropertyGroup> <ItemGroup Condition=" '$(TargetFramework)' == 'net461' "> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="resources\default.css"> <LogicalName>iText.Svg.default.css</LogicalName> </EmbeddedResource> </ItemGroup> <ItemGroup> <ProjectReference Include="..\itext.io\itext.io.csproj" /> <ProjectReference Include="..\itext.kernel\itext.kernel.csproj" /> <ProjectReference Include="..\itext.layout\itext.layout.csproj" /> <ProjectReference Include="..\itext.styledxmlparser\itext.styledxmlparser.csproj" /> </ItemGroup> </Project> ```
The A77 autoroute is a motorway in central France. The road starts at the hamlet of Rosiers in Seine-et-Marne and finishes to the south of Nevers in NiΓ¨vre. It is also known as the l'Arbre - the motorway of the Tree. It has been designed to minimise its effect on the environment. Each of the rest areas bears the name of a species. The road has been integrated into the landscape helped by zoologists to allow the passage of the animals (wild or cattle) from one side of the road to the other, as in the forest of Montargis. This added to the cost of construction. Rosiers to Cosne-Cours-sur-Loire The motorway is managed by the company the Paris-Rhine-Rhone (SAPRR). It is a toll road with 2x2 lanes and totals . Before 1999: The A77 was formed by re-numbering an old motorway connection to the A6 autoroute. The road was the upgraded N7 to Dordives. The toll road follows the valley of the Loing. 1999: Opening of the Dordives - Briare section of 2000: Opening of the Briare - Cosne-Cours-sur-Loire section of 2009: Opening of the junction with the A19 autoroute. Junctions Exchange A6-A77 Exchanging half between A6 and A77 17 (Dordives) 5Β km: Towns served: Dordives, Souppes-sur-Loing, ChΓ’teau-Landon, FerriΓ¨res-en-GΓ’tinais Exchange A19-A77 Junction with the A19 autoroute Rest areas: L'HΓͺtre Poupre/Le Sophora 18 (Montargis) 28Β km: Towns served city Montargis Rest areas: Le CΓ¨dre/Le Liquidambar 18.1 (Varennes-Changy): Towns served: Varennes-Changy Service Area: Jardin des Arbres 19 (Nogent-sur-Vernisson Gien) to 54Β km: Served cities Gien and Nogent-sur-Vernisson Rest areas: Gingko feel Paris-Province, Tulipier feel Province-Paris 20 (Briare) to 67Β km: served city Briare 21 (Auxerre/Saint-Fargeau) to 80Β km: Towns served: Bonny-sur-Loire, Saint-Fargeau 62Β km Auxerre Rest areas: Caule/SΓ©quoΓ―a 22 (Cosne-sur-Loire/Saint-Amand-en-Puisaye) 97Β km: Towns served: Cosne-sur-Loire Saint-Amand-en-Puisaye Cosne-sur-Loire to Nevers-South The motorway is managed by the dΓ©partement of NiΓ¨vre. It is a free motorway with 2x2 lanes. From 1992 to 2004: Phased opening of the section Cosne to Nevers-South Junctions 22.1 (Cosne-sur-Loire-centre) 99Β km: Towns served: Cosne-sur-Loire 23 (Cosne-sur-Loire-Sud) 103Β km: Towns served: Cosne-sur-Loire 24 (Malataverne) 108Β km: Towns Served: Sancerre and Saint-Laurent-l'Abbaye Service Area: 25 (Pouilly-sur-Loire-nord) 108Β km: Towns served: Pouilly-sur-Loire which is located pile at the medium between the source and the mouth of the Loire Rest area of Pouilly feel Paris-Province 26 (Pouilly-sur-Loire-sud) 112Β km: Towns served: Pouilly-sur-Loire Rest area: Pouilly 27 (Mesves-sur-Loire) 117Β km: Towns served: Mesves-sur-Loire 28 (CharitΓ©-sur-Loire-nord) 119Β km: Towns served: La CharitΓ©-sur-Loire 29 (CharitΓ©-sur-Loire-Center) 122Β km: Towns served: La CharitΓ©-sur-Loire 30 (La Marche) 129Β km: Towns served: La Marche 31 (Pougues-les-Eaux Nord) 136Β km: Towns served: Pougues-les-Eaux Rest Area: Pougues-les-Eaux 32 (Varennes-Pougues-les-Eaux) 143Β km: Towns served: Pougues-les-Eaux and Varennes-Vauzelles Z.I. 33 (Nevers-center) 145Β km: Towns served: Nevers Center, Varennes-Vauzelles, ChΓ’teau de la Rocherie 34 (Nevers-sud St-Γ‰loi) 150Β km: Towns served: Nevers 36 (Saint-Γ‰loi) 154Β km: Towns served: Saint-Γ‰loi, Decize 37 (Nevers-sud)) 158Β km: Towns served: Nevers Rest area: Faience Manufacturers Nevers to Moulins Plans are to extend the motorway to Moulins, with sections already under construction on the existing RN7. The by-pass of Moulins and Villeneuve-sur-Allier has already been completed to autoroute standard. As of December 2022, the plans have not been completed. External links A77 Motorway in Saratlas A77
The Museum of Sonoma County, commonly known as the Sonoma County Museum, is a non-profit organization located in downtown Santa Rosa, California. Its 7th St. campus comprises the historic 1910 Santa Rosa Post Office, a contemporary art gallery, and a sculpture garden. Between the two buildings, the Museum presents 10-12 rotating exhibitions per year and maintains a permanent collection of over 18,000 objects that document the region's rich history and celebrate local artists. The historic post office is on the National Register of Historic Places. History Santa Rosa’s Historic 1910 Post Office and Federal Building Originally housed in the old adobe home on Maria Carrillo's Rancho Cabeza de Santa Rosa, the Santa Rosa Post Office was later relocated in the Atheneum Theatre building on Fifth and D Streets. It was finally slated to be given a permanent home through a bill introduced in the House of Representatives on March 8, 1906. The legislation called for β€œthe purchase of a site and erection of a public building at Santa Rosa, California . . . a suitable building with fireproof vaults therein, for the accommodation of the post-office and other government offices . . . ” with the entire amount of funding not to exceed β€œthe sum of one hundred thousand dollars.” A month after the legislation was introduced, the 1906 earthquake destroyed most of downtown Santa Rosa. As a result, the Santa Rosa Post Office operated temporarily out of Jenkins Grocery, surrounded by wreckage and debris. Local hop dealer, C.C. Donovan, wrote to James Knox Taylor, Supervising Architect of Federal Buildings, asking him to give priority to the construction of the new Post Office slated for Santa Rosa. Taylor (known as the national architect) designed a structure that linked architectural design to the history, environment, and culture of the community and its surroundings. The new Santa Rosa Post Office building was an example of Classic Federal Architecture in California, a design style greatly influenced by the World's Columbian Exposition of 1893. Construction of the new Post Office located at Fifth and A Streets began in 1908. The building process was a community effort, exemplified by determination and superior craftsmanship. The Santa Rosa-based contracting firm of Hoyt Bros. hired local firms to complete the majority of the interior and exterior work. Henry Kroncke of the Santa Rosa Planing Mills did the interior woodwork. J. C. Mailer Hardware installed the building's plumbing. Stone contractor, George Reilly, was responsible for the Bedford stone columns and marble terrazzo floors. Technologically, the building was ahead of its time. Ray Oil Burner Company of San Francisco installed a new automatic oil burning system, which was not shown publicly in the Bay Area until the 1915 Panama Pacific Exposition in San Francisco. In addition to heating the building, the system provided hot showers for the mail carriers. On March 9, 1910, Post Master H. L. Tripp and his postal staff moved into the newly completed Santa Rosa Post Office. Moving the Museum The Santa Rosa Main Post Office was eventually relocated to 2nd Street and following the 1969 earthquake that ravaged much of downtown Santa Rosa, the historic post office was slated to be razed to make way for a mall. Architect Dan Peterson led the campaign to save the post office by proposing that it be moved out of the path of urban renewal. Starting in April 1979, workmen raised the great structure and lay before it a bed of rails and a network of pulleys and cables. The building moved, but almost imperceptibly β€” an average of 36 feet a day. The building was moved over 750 feet to its new home on 7th street, between A and B streets. Architect Dan Petersen restored it as a museum and placed the building onto the National Register of Historic Places. It reopened in 1985 as the Sonoma County Museum. Sculpture Garden The Sculpture Garden was designed by Frederic Warnecke, a Landscape Architect, son of renown architect John Carl Warnecke. It opened in the summer of 2011 and was dedicated to Evert B. and Norma Person. Contemporary Art, Expansion, and Name Change In 2001, Tom Golden of Freestone donated his collection of some 125 drawings, sculptures, collages and photographs by world-famous conceptual artists Christo and Jeanne-Claude, remembered in Sonoma and Marin counties for their β€˜70s project β€œRunning Fence,” with white nylon fabric stretching more than 20 miles cross-country to Bodega Bay. In 2005, the Museum of Contemporary Art (MOCA) merged with the Sonoma County Museum, when that organization scrapped plans for a $5.5 million facility at the Luther Burbank Center for the Arts. In 2015, the Museum expanded east into the remodeled back half of former Conklin Brothers flooring company warehouse at Seventh and B streets. The expansion came with a rebranding and the Sonoma County Museum was reborn as twins, with one museum for art (Art Museum of Sonoma County) and one for history (History Museum of Sonoma County), under the parent organization of the Museums of Sonoma County. In 2018, the museum underwent a final name change to Museum of Sonoma County. The change from plural to singular reflects the Museum’s vision of being recognized as one organization with two buildings, multiple galleries, and a sculpture garden on its Seventh Street campus, rather than two separate entities (β€œArt Museum of Sonoma County” and β€œHistory Museum of Sonoma County”) under the umbrella of a parent organization ("Museums of Sonoma County"). β€œWith our new name change, the Museum aims to bring art and history in alignment to allow for a more synergistic relationship between the two,” said Jeff Nathanson, Executive Director. β€œWe are reimagining the Museum as a major cultural destination for the region, with a wide range of art and history programs for people of all ages and backgrounds.” Collection The museum maintains a permanent collection of over 18,000 objects that document the region's rich history and celebrate artists who have lived or worked in the North Bay. It includes extensive collections of historic paintings, sculpture, photographs, prints, costumes, textiles, ceramics, glass, industrial tools, machinery, wood sculpture, furniture, objects, documents, and graphics relative to the local communities, commerce, technologies, and lifestyles. Notable collections include: Tom Golden's Christo and Jeanne-Claude collection, which the museum offers as a traveling exhibition. It includes 125 drawings, sculptures, collages, and photographs by world-famous conceptual artists Christo and Jeanne-Claude, remembered in Sonoma and Marin counties for their β€˜70s project β€œRunning Fence,” Marguerite Wildenhain ceramics Carroll Barnes sculptures 19th century California landscapes by artists such as Thomas Hill, Frederick Farina Schafer, and Frederick Butman Objects and artifacts related to the utopian community of Fountaingrove, Thomas Lake Harris, and Kanaye Nagasawa Song Wong Bourbeau (1909-1996), a third-generation Santa Rosan, was known throughout Santa Rosa not only as an astute businesswoman, but for her tireless dedication as a community activist and philanthropist. Over two hundred photographs and artifacts make up this extensive collection, representing the rich and significant history and culture of Santa Rosa's Chinatown and Chinese community. See also List of United States post offices References External links Museums in Santa Rosa, California Museums established in 1985 Renaissance Revival architecture in California Art museums and galleries in California History museums in California 1985 establishments in California
```c /* * */ #include <stdint.h> #include <string.h> #include "btc_ble_mesh_ble.h" #include "adv.h" #include "scan.h" #include "mesh/adapter.h" #include "esp_ble_mesh_ble_api.h" #if CONFIG_BLE_MESH_BLE_COEX_SUPPORT static void btc_ble_mesh_ble_copy_req_data(btc_msg_t *msg, void *p_dst, void *p_src) { #if CONFIG_BLE_MESH_SUPPORT_BLE_SCAN esp_ble_mesh_ble_cb_param_t *p_dst_data = (esp_ble_mesh_ble_cb_param_t *)p_dst; esp_ble_mesh_ble_cb_param_t *p_src_data = (esp_ble_mesh_ble_cb_param_t *)p_src; if (!msg || !p_src_data || !p_dst_data) { BT_ERR("%s, Invalid parameter", __func__); return; } switch (msg->act) { case ESP_BLE_MESH_SCAN_BLE_ADVERTISING_PKT_EVT: if (p_src_data->scan_ble_adv_pkt.data && p_src_data->scan_ble_adv_pkt.length) { p_dst_data->scan_ble_adv_pkt.length = p_src_data->scan_ble_adv_pkt.length; p_dst_data->scan_ble_adv_pkt.data = bt_mesh_calloc(p_src_data->scan_ble_adv_pkt.length); if (p_dst_data->scan_ble_adv_pkt.data) { memcpy(p_dst_data->scan_ble_adv_pkt.data, p_src_data->scan_ble_adv_pkt.data, p_src_data->scan_ble_adv_pkt.length); } else { BT_ERR("%s, Out of memory, act %d", __func__, msg->act); } } break; default: break; } #endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */ } static void btc_ble_mesh_ble_free_req_data(btc_msg_t *msg) { #if CONFIG_BLE_MESH_SUPPORT_BLE_SCAN esp_ble_mesh_ble_cb_param_t *arg = NULL; if (!msg) { BT_ERR("%s, Invalid parameter", __func__); return; } arg = (esp_ble_mesh_ble_cb_param_t *)msg->arg; switch (msg->act) { case ESP_BLE_MESH_SCAN_BLE_ADVERTISING_PKT_EVT: if (arg->scan_ble_adv_pkt.data) { bt_mesh_free(arg->scan_ble_adv_pkt.data); } break; default: break; } #endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */ } static void btc_ble_mesh_ble_callback(esp_ble_mesh_ble_cb_param_t *cb_params, uint8_t act) { btc_msg_t msg = {0}; /* If corresponding callback is not registered, event will not be posted. */ if (!btc_profile_cb_get(BTC_PID_BLE_MESH_BLE_COEX)) { return; } msg.sig = BTC_SIG_API_CB; msg.pid = BTC_PID_BLE_MESH_BLE_COEX; msg.act = act; btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_ble_cb_param_t), btc_ble_mesh_ble_copy_req_data, btc_ble_mesh_ble_free_req_data); } #if CONFIG_BLE_MESH_SUPPORT_BLE_SCAN void bt_mesh_ble_scan_cb_evt_to_btc(const bt_mesh_addr_t *addr, uint8_t adv_type, uint8_t data[], uint16_t length, int8_t rssi) { esp_ble_mesh_ble_cb_param_t param = {0}; if (addr == NULL) { BT_ERR("%s, Invalid parameter", __func__); return; } memcpy(param.scan_ble_adv_pkt.addr, addr->val, sizeof(addr->val)); param.scan_ble_adv_pkt.addr_type = addr->type; if (data && length) { param.scan_ble_adv_pkt.data = data; param.scan_ble_adv_pkt.length = length; } param.scan_ble_adv_pkt.adv_type = adv_type; param.scan_ble_adv_pkt.rssi = rssi; btc_ble_mesh_ble_callback(&param, ESP_BLE_MESH_SCAN_BLE_ADVERTISING_PKT_EVT); } #endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */ void btc_ble_mesh_ble_call_handler(btc_msg_t *msg) { esp_ble_mesh_ble_cb_param_t param = {0}; btc_ble_mesh_ble_args_t *arg = NULL; if (!msg) { BT_ERR("%s, Invalid parameter", __func__); return; } arg = (btc_ble_mesh_ble_args_t *)msg->arg; switch (msg->act) { #if CONFIG_BLE_MESH_SUPPORT_BLE_ADV case BTC_BLE_MESH_ACT_START_BLE_ADV: { struct bt_mesh_ble_adv_param *set = (struct bt_mesh_ble_adv_param *)&arg->start_ble_adv.param; struct bt_mesh_ble_adv_data *data = NULL; if (arg->start_ble_adv.data.adv_data_len || arg->start_ble_adv.data.scan_rsp_data_len) { data = (struct bt_mesh_ble_adv_data *)&arg->start_ble_adv.data; } param.start_ble_advertising_comp.err_code = bt_mesh_start_ble_advertising(set, data, &param.start_ble_advertising_comp.index); btc_ble_mesh_ble_callback(&param, ESP_BLE_MESH_START_BLE_ADVERTISING_COMP_EVT); break; } case BTC_BLE_MESH_ACT_STOP_BLE_ADV: param.stop_ble_advertising_comp.index = arg->stop_ble_adv.index; param.stop_ble_advertising_comp.err_code = bt_mesh_stop_ble_advertising(arg->stop_ble_adv.index); btc_ble_mesh_ble_callback(&param, ESP_BLE_MESH_STOP_BLE_ADVERTISING_COMP_EVT); break; #endif /* CONFIG_BLE_MESH_SUPPORT_BLE_ADV */ #if CONFIG_BLE_MESH_SUPPORT_BLE_SCAN case BTC_BLE_MESH_ACT_START_BLE_SCAN: param.start_ble_scan_comp.err_code = bt_mesh_start_ble_scan((struct bt_mesh_ble_scan_param *)&arg->start_ble_scan.param); btc_ble_mesh_ble_callback(&param, ESP_BLE_MESH_START_BLE_SCANNING_COMP_EVT); break; case BTC_BLE_MESH_ACT_STOP_BLE_SCAN: param.stop_ble_scan_comp.err_code = bt_mesh_stop_ble_scan(); btc_ble_mesh_ble_callback(&param, ESP_BLE_MESH_STOP_BLE_SCANNING_COMP_EVT); break; #endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */ default: return; } } static inline void btc_ble_mesh_ble_cb_to_app(esp_ble_mesh_ble_cb_event_t event, esp_ble_mesh_ble_cb_param_t *param) { esp_ble_mesh_ble_cb_t btc_ble_mesh_cb = (esp_ble_mesh_ble_cb_t)btc_profile_cb_get(BTC_PID_BLE_MESH_BLE_COEX); if (btc_ble_mesh_cb) { btc_ble_mesh_cb(event, param); } } void btc_ble_mesh_ble_cb_handler(btc_msg_t *msg) { esp_ble_mesh_ble_cb_param_t *param = NULL; if (!msg) { BT_ERR("%s, Invalid parameter", __func__); return; } param = (esp_ble_mesh_ble_cb_param_t *)msg->arg; if (msg->act < ESP_BLE_MESH_BLE_EVT_MAX) { btc_ble_mesh_ble_cb_to_app(msg->act, param); } else { BT_ERR("%s, Unknown act %d", __func__, msg->act); } btc_ble_mesh_ble_free_req_data(msg); } #endif /* CONFIG_BLE_MESH_BLE_COEX_SUPPORT */ ```
"Age of Apocalypse" is a 1995 comic book crossover storyline mostly published in the X-Men franchise of books by Marvel Comics. The Age of Apocalypse briefly replaced the universe of Earth-616 and had ramifications in the main Marvel Comics universe when the original timeline was restored. It was later retconned as having occurred in the alternate universe of Earth-295. During the entirety of the Age of Apocalypse event the regularly published X-Men comics were replaced by new X-Men related mini series, focusing on various teams and individuals in the Age of Apocalypse world including X-Calibre, Gambit and the X-Ternals, Generation Next, Astonishing X-Men, Amazing X-Men, Weapon X, Factor X, X-Man and X-Universe. The event was bookended by two one shots, X-Men Alpha and X-Men Omega. The storyline starts with Legion (David Haller), a psychotic mutant who traveled back in time to kill Magneto before he can commit various crimes against humanity. Legion accidentally kills Professor Charles Xavier, his father, leading to a major change in the timeline. The death of Professor Xavier leads Apocalypse to attack 10 years sooner than he did in the original timeline, taking control of Earth and altering everything that happened from that point forward. Apocalypse is opposed by several factions of mutant resistance, including a group led by Magneto. The group manages to send the mutant Bishop back in time to prevent the murder of Professor Xavier, undoing the entire timeline. In 2005, Marvel published an Age of Apocalypse one-shot and miniseries to celebrate the 10th anniversary of the fan favorite event. The book looks at what happened after the end of the original story, revealing that the timeline became in fact an alternate earth, designated "Earth-295". The "Dark Angel Saga" in 2011 revisited the alternate reality once more, leading to an Age of Apocalypse ongoing series launched in 2012 that ran for 14 issues. The world was also featured as part of Marvel's 2015 Secret Wars. Storyline Legion (David Haller), a psychotic mutant on Earth and son of Professor Charles Xavier, travels back in time with the intention of killing Magneto (Erik Lehnsherr). However, Legion travels to a time when Magneto and Xavier are still friends while in Israel. As Xavier dies trying to protect Magneto, Legion vanishes, and a new timeline is created. The only person aware of how history has changed is Lucas Bishop, a time traveling mutant who followed Legion. Because of Xavier's sacrifice, Magneto comes to believe in his late friend's dream of a peaceful coexistence between humans and mutants. Apocalypse (En Sabah Nur), an immortal mutant villain, was monitoring the fight. He chooses this moment as the perfect time to begin his world conquest, which did not happen in the mainstream Marvel universe for another ten years. Magneto assembles the X-Men just as Apocalypse begins his war. Despite the X-Men's resistance, Apocalypse conquers all of North America and eventually mutants are considered the ruling class. Apocalypse initiates a genocidal campaign called "cullings," killing millions of humans. To further ensure that no one is left to challenge him or undo the circumstances that led to his reign, he has everyone with telepathic or chronal abilities hunted down. Meanwhile, the changes in the timeline result in a destructive crystallization wave created by the M'Kraan Crystal. X-Men: Alpha X-Men: Alpha was published in January 1995 and launched the "Age of Apocalypse" crossover story. It briefly shows readers how many popular X-Men characters have changed in this new world. Bishop is reunited with Magneto while retaining fragmented memories of the true timeline. Magneto assigns his X-Men and their allies various missions. Some are to gather the forces needed to change history while others will continue resisting Apocalypse. The story continues in eight interlocking miniseries, each focusing on a different team of X-Men or other mutant forces. Each miniseries temporarily replaced one of the monthly X-Men titles being published at the time. X-Calibre X-Calibre is a team built around Nightcrawler (Kurt Wagner), who is sent by Magneto to locate Destiny (Irene Adler), a mutant capable of seeing into the future, so that she can verify Bishop's story. Nightcrawler must travel to Avalon, a secret refuge where mutants and humans live together in peace. Along his journey, he encounters John Proudstar (Thunderbird), the monk Cain, the pirate Callisto, and his mother Mystique (Raven Darkholme). The chief antagonists for Nightcrawler's journey consist of the Pale Riders, a trio of Apocalypse's servants made up of Moonstar (Danielle Moonstar), Damask (Emma Steed), Dead Man Wade (Wade Wilson) and the Shadow King (Amahl Farouk). Nightcrawler's team consists of Mystique, Switchback, and later Damask, who joins Nightcrawler after realizing the beauty Avalon has to offer. The X-Calibre series gets its name from an in-joke between Nightcrawler and his mother, Mystique, because of the caliber of bullets she uses, simply stamped with an X. This title replaced Excalibur. Gambit and the X-Ternals Gambit (Remy LeBeau)'s X-Ternals consist of Sunspot (Roberto de Costa), Jubilee (Jubilation Lee), Strong Guy (Guido Carosella) and Lila Cheney. They are sent deep into space using Lila's teleportation in order to retrieve a shard of the M'Kraan Crystal, essential to the verification of Bishop's alternate reality. The X-Ternals are pursued by Rictor, a henchman of Apocalypse desperate to earn his master's praise by killing Gambit. Upon reaching Shi'ar space, the X-ternals fight the Imperial Guard in order to retrieve the crystal shard. Upon their return to Earth, Strong Guy betrays the team, not only stealing the M'Kraan Crystal, but also kidnapping Magneto's son, Charles. This title replaced X-Force. Generation Next Generation Next consists of a young group of mutant students trained by the husband and wife team of Colossus (Piotr "Peter" Rasputin) and Shadowcat (Katherine Pryde-Rasputin). They consist of Chamber (Jonothan "Jono" Starsmore), Husk (Paige Guthrie), Mondo, Vincente Cimetta, and Skin (Angelo Espinoza). They are sent by Magneto into the Seattle Core to rescue Colossus' sister, Illyana Rasputin, who is the last surviving transdimensional teleporter. Illyana Rasputin is a slave of the Sugar Man, one of Apocalypse's prefects and ruler of the Seattle Core. Mondo finds Illyana Rasputin and hides her inside of his body, intending to smuggle her out at shift change. When Mondo is found out, the ensuing fight finds the Sugar Man killing Mondo with a blast from his tongue, exposing the rest of Generation Next. While fighting a near hopeless battle, Generation Next is left for dead by Colossus, who sacrifices them in order to save his sister. This title replaced Generation X. Astonishing X-Men The Astonishing X-Men are led by Rogue (Anna Marie Lehnsherr, Magneto's wife) and consist of Sabretooth (Victor Creed), Blink (Clarice Ferguson), Wild Child (Kyle Gibney), Morph (Kevin Sydney) and Sunfire (Shiro Yoshida). They are sent by Magneto to stop the cullings, which are being undertaken by Holocaust, Apocalypse's son and one of his horsemen. While helping with the evacuation and protection of humans, Sabretooth asks Blink to teleport him to Holocaust's location, which she reluctantly does. Sabretooth and Holocaust fight a vicious duel but Sabretooth is defeated and seemingly killed, horrifying Blink. (Sabretooth had rescued Blink from Mr. Sinister and she had come to see him as her dearest friend and mentor.) The team then fights Holocaust and his Infinites, destroying his factory. However, Holocaust manages to escape and the team returns to Xavier's mansion, where Rogue learns that both her son and her husband have been captured. Sabretooth is revealed by Iceman to have survived the battle, to Blink's delight. This title replaced The Uncanny X-Men. Amazing X-Men The Amazing X-Men consist of team leader Quicksilver (Pietro Lehnsherr) and Storm (Ororo Munroe), Dazzler (Alison Blaire), Banshee (Sean Cassidy), Iceman (Robert "Bobby" Drake), and Exodus (Paris Bennet). The team is sent to Maine by Magneto to aid in the evacuation of humanity to Europe. During this mission, the team fights Apocalypse's Brotherhood of Chaos, as well as the Horseman Abyss, who is defeated (but not killed) by Quicksilver. During their absence from the Xavier Mansion, Magneto and Bishop are attacked by Apocalypse himself, who captures them both. Fulfilling their mission, Quicksilver splits up his team to help the other X-Men: sending Iceman to rendezvous with Rogue's team (the Astonishing X-Men) and Dazzler and Exodus to find Magneto's son, Charles. Finally, Quicksilver, Storm, and Banshee go to rescue Bishop, who is in the hands of the Madri, Apocalypse's priests. This title replaced X-Men. Weapon X Weapon X (Logan) and his lover Jean Grey are depicted in this series carrying out missions for the Human High Council. Jean and Weapon X drift apart, as the Human High Council intends to launch a nuclear strike on the U.S. as Jean is appalled by the loss of life it would cause. After Weapon X concludes a battle with Donald Pierce, Jean leaves to help evacuate the U.S., bidding a tearful farewell to Logan. Weapon X is then sent to recruit Gateway, whose teleportation ability is necessary to bring the fleet to America. As the fleet leaves, Weapon X decides to join them, if only to find Jean somewhere in America before the bombs are dropped. This title temporarily replaced Wolverine. Factor X Factor X consists of the Elite Mutant Force (EMF), who serve Apocalypse. They are split into five sibling groups: Cyclops and Havok (Scott Summers and Alex Summers), Emplate and the Twins (Marius, Nicole, and Claudette St. Croix), Cannonball and Amazon (Sam and Elizabeth Guthrie), the Bedlam Brothers (Jesse and Terrence Aaronson), and Aurora and Northstar (Jean-Marie and Jean-Paul Beaubier). The EMF is tasked with maintaining control of Apocalypse's breeding pens, where people are imprisoned, tortured, and experimented on by the Beast, also a member of the EMF. Havok, jealous of his brother's leadership role, discovers that Cyclops is a traitor who has been helping people escape the pens; and in one such escape attempt, both Aurora and Northstar are seriously injured. Havok then exposes Cyclops and attempts to kill him, but Cyclops escapes with the aid of Jean Grey, who has arrived to evacuate as many people as she can before the Human High Council's nuclear strike. The Bedlam Brothers also choose to side with Cyclops, and they successfully defeat both Amazon and Cannonball. Cyclops and Jean defeat Havok, and as they lead the freed prisoners out of the pens, Havok is determined to kill his brother. This title replaced X-Factor. X-Man The protagonist of X-Man is Nate Grey, a mutant born of Cyclops' and Jean Grey's DNA, and the most powerful telekinetic in the world. He lives under the guidance of his father figure Forge, who leads a group of outcasts consisting of Mastermind, Toad, Brute, and Sauron, who attack trains and factories of Apocalypse while masquerading as a theatre troupe. This title replaced Cable. Characters and affiliations Mutant heroes The only then-existing major mutant character missing in the original Age of Apocalypse is Psylocke. When the "Age of Apocalypse" storyline was revisited a decade later, she appeared in X-Men: Age of Apocalypse #4 in Asian form. Her origin remains unknown. There has been no explanation of what she was doing during the original Age of Apocalypse, other than the fact that she had some kind of past connection with Weapon X. Other anti-Apocalypse forces Besides the X-Men and its many offshoots, the Human High Council remains as the only other power opposing Apocalypse. Unlike the X-Men, however, the Human High Council considers the extermination of mutants as a viable option. Bolivar and Moira Trask, as well as Brian Braddock, are the major proponents for a mutant holocaust. Secretly, the Human High Council supports the Human Underground Resistance. X-Universe also reveals the fate of several other individuals. Peter Parker was executed because he was a potential contact for Gwen Stacy. T'Challa and Namor perished when Wakanda and Atlantis were attacked by Apocalypse. Frank Castle went missing following a mutant raid on a Buddhist temple where he had sought peace after the death of his family. Reed Richards and Johnny Storm sacrificed themselves in the evacuation of Manhattan Island. Apocalypse's agents Neutrals Timeline escapees Some characters escaped the Age of Apocalypse into the Earth-616 continuity. These include Dark Beast, Nate Grey (the Age of Apocalypse version of Cable), Holocaust and Sugar Man. Nate Grey allied himself with the X-Men a few times and once with Spider-Man. He later "died" by disseminating into every life form on the Earth, but has since returned to the living and is now residing in San Francisco and is part of the New Mutants roster. Blink escaped into the multiverse and ended up leading the reality-hopping team of heroes known as the Exiles. Her counterpart on Earth-616 was thought to have died during the "Phalanx Covenant" storyline, but brought back from the dead by Selene during the "Necrosha" event. Prophet was taken at Jean Grey's request to the Earth-616 at the end of the crossover that would close the Age of Apocalypse timeline from the timestream. Former timeline escapees Holocaust remained at large in the main Marvel Universe until he joined the Exiles and was killed by another universe's evil version of Hyperion. Sabretooth survived through the same means as Blink and joined a team of reality-hopping super beings known as Weapon X. During one mission, he opted to stay behind on to raise David Richards. Eventually, he was brought back into action and joined the Exiles. He has since returned to the Age of Apocalypse. Hatchet-9, the only surviving Mecha-Mutate officer of Assault-Regiment Delta, a regiment of traitor humans who traded limbs and more for the power and privilege of serving the High Lord Apocalypse. Rastus, a heavily two-headed mutated creation of Sugar Man and one of many wardens of Seattles' Core, was also revealed to have escaped to Earth-616. He joined Sugar Man and lived in the catacombs underneath the island nation of Genosha until he was accidentally discovered by the Dark Beast. He was eventually killed by Callisto. Wild Child left this timeline when a time-traveler, Quentin Quire, saved him from the Friends of Humanity and then used Wild Child to replace the latter's counterpart, who had recently died. Wild Child was later returned to the Age of Apocalypse and subsequently killed in battle. Nightcrawler decided to stay on Earth-616 after the events of the Dark Angel Saga. He joined the X-Force team so he could search for Iceman, Blob, Dark Beast and Sugar Man. He then tracked and killed his former teammates Iceman and Blob. During the X-Termination crossover, Nightcrawler apparently gave his own life to close the Age of Apocalypse timeline from the Timestream. Blob left the Age of Apocalypse due to the events put in motion by Archangel. He later joined Daken's Brotherhood with the apparent goal of exacting revenge on X-Force. He was killed by the AoA Nightcrawler who teleported a shark inside Blob's body. Iceman was revealed to have defected from the X-Men and was working for Weapon Omega. He also left the Age of Apocalypse through the same means as Blob and was tracked down by Wolverine, Deadpool, and the AoA Nightcrawler. During the fight, Nightcrawler teleported to a factory and fought Iceman, defeating him without either man using their powers. Once Iceman was defeated, Nightcrawler threw his body into an incinerator. Beast was sent twenty years into Earth-616's past. This allowed for several retcons which were used to explain that he (now known as Dark Beast) was responsible for the creation of the Morlocks and also why Mister Sinister initiated the "Mutant Massacre", as he recognized his stolen handiwork and ordered it exterminated as a debasement of his art. He later came under the employment of Norman Osborn's Dark X-Men, with the responsibility of keeping his counterpart and Charles Xavier captive while Osborn carried out his plan. He then returned to the Age of Apocalypse timeline and helped Weapon Omega on his quest to control America, but at the end Weapon Omega was defeated and Dark Beast was taken back to Earth-616. He was thought to be deceased, after apparently dying in a bomb explosion after progressively suffering from fatal health problems due to his own further experimentations on himself. During the 2017 Secret Empire storyline, Dark Beast turns up alive and healthy but is eventually killed by Magik. Sugar Man was also sent twenty years into Earth-616's past, and it was through him the Genegineer received the advanced genetic research to allow the small nation of Genosha to become powerful by enslaving mutants. He remained at large in the main Marvel Universe and only a few knew about his existence. Sugar Man returned to the Age of Apocalypse timeline after being released from Steve Rogers' custody by Dark Beast, and was believed to remain there at the end of the crossover that would close the Age of Apocalypse timeline. But it was revealed that he had returned to the main reality before the event and was thought to be deceased at the hands of Magneto, only to reappear alive and planning to send six hundred mutant embryos to the future. He was later killed by a mysterious assailant who was hunting down the former Age of Apocalypse residents. Alternate versions "What If... The Age of Apocalypse Had Not Ended?" An alternate AoA reality was presented when Magneto, giving up on Bishop's mission in the final moments, rescued his family from the nuclear explosions alongside some of his allies. Magneto, Rogue, Sunfire, Quicksilver, and Weapon X found themselves working with the last remaining human heroes (including Tony Stark, Invisible Woman and Gwen Stacy, the latter of which formed a romance with Quicksilver) to deal with a new threat: the Coming of Galactus. As there was no Fantastic Four, it fell to the survivors to work against Galactus and his herald, the Silver Surfer. As the heroes sprung into action, Night-Thrasher ended up using advanced technology to empower himself with amazing psychic powers. Together, they were able to do the impossible and claim victory. After Weapon X used his adamantium claws to slay the Silver Surfer, the collective psychic potential of humanity was focused against Galactus, eventually killing him. Prequels Before the tenth anniversary, the Age of Apocalypse was considered a dead reality that no longer existedβ€”a fact that was frequently mentioned by timeline escapees, such as Sugar Man and Blink. However, there were quite a few prequels written that took place before its destruction. By the Light told the story of Blink transporting the X-Men to the moon where they faced Apocalypse's new horseman of Death, Maximus the Mad. Sinister Bloodlines followed the return of a Brood-infected Christopher Summers (Corsair) to Earth and his reunion, after escaping the experimentations of Sinister and Dark Beast, with Scott and Alex. Blink was a four issue miniseries intended to reintroduce the Age of Apocalypse version of Blink as a teaser to the Exiles ongoing series. This story takes place prior to the "Age of Apocalypse" main events, but is largely set in the Negative Zone. Blink becomes lost in the Negative Zone after attempting to incite Blastaar towards war with Apocalypse and instead joins a rebellion against Blastaar alongside her lover, who turns out to be a de-evolved version of Annihilus. The last four pages of the final issue show Blink during the destruction of the Age of Apocalypse and becoming unhinged from time. X-Man, during its run, occasionally re-visited the Age of Apocalypse, both through time travel and flashbacks. X-Man #-1 shows Mr. Sinister releasing Nate from his growth vat as a child to check on his progress. In the 1996 X-Man Annual, Sugar Man uses a variation on a time machine powered by Nate's psionic force to return to the early years of Apocalypse's rule where he hopes to take control himself. Nate follows and meets up with Forge, Magneto, Morph, and Mastermind, and is surprised to discover that Forge knew that he would be there because an older Nate Grey had time traveled and told Forge about his memories of this event. On the orders of this older Nate Grey, Forge forces the younger Nate to re-power the machine and return himself and Sugar Man to Earth-616. This leads to a rift between Forge and Magneto, who believed they should have allowed Nate to stay so that he could help them fight Apocalypse. Later, in X-Man #53 and #54, Nate, Jean Grey, and Cyclops run across a temporal rift that brings an infinite processing plant to Earth-616. Age of Apocalypse 10th Anniversary In 2005, Marvel published an Age of Apocalypse one-shot and miniseries to celebrate the 10th anniversary of the fan favorite event. The one-shot features stories set before the events depicted in the original "Age of Apocalypse" event, similar in focus to the Tales from the Age of Apocalypse issues. The one-shot contains the story of how Colossus and Shadowcat left the X-Men to train Generation Next; how Sabretooth met Wild Child; the first appearance of the Silver Samurai; and how the world survived the Human High Council's nuclear attack. The limited series, which takes place after the nuclear attack in X-Men: Omega, introduced several characters who were not in the original storyline. Long time characters Cloak and Dagger, Psylocke, and the Morlocks (including Feral, Leech, Marrow, Skids, and Thornn), who were survivors of Mr. Sinister's experiments, are introduced. Newer characters Beak, Icarus, and X-23 are seen along with an alternate version of Xorn. Jean Grey is also revealed to have saved everyone from the nuclear attack by tapping into the Phoenix Force-level powers, and is revived from death by Sinister. Dark Angel Saga In 2011, the Age of Apocalypse was featured in a storyline in the ongoing series Uncanny X-Force 11–18 by Rick Remender. Seeking a Celestial 'Life Seed' in order to save Angel (Warren Worthington) from becoming the new Apocalypse, The Uncanny X-Force, under the guidance of Dark Beast, journey to the Age of Apocalypse. X-Force arrives ten years after the X-Men had defeated Mister Sinister, yet it seems the X-Men still face enormous challenges in this harsh setting. The world, which during the previous appearance had seemed to be on the road to recovery, has once again fallen on hard times, similar to when Apocalypse was ruling, with Sentinels now roaming the streets. As they follow Dark Beast to one of his labs, they are unknowingly followed by Wildchild and Sabretooth (Earth-295). Dark Beast finds the life seed but before he could hand it over to the X-Force members, Nightcrawler teleports in and swipes the seed away, figuring that Dark Beast was up to some evil plot after decades of absence. After a brief quarrel which ended with the life seed destroyed by Sunfire, Psylocke recognizes Sabretooth from her time on the Exiles and convinces Wolverine (Earth-616) that this version of Sabretooth isn't a bad guy, which ends their battle. With the life seed destroyed, Dark Beast sneaks over to the portal back to the 616 Marvel Universe and walks in, leaving X-Force stranded in the Age of Apocalypse world. Nightcrawler's team, realizing that the sentinels are descending on their position, evacuates along with X-Force, taking them to the X-Men's new base in Atlantis. It was soon revealed that a new "Heir of Apocalypse" has risen and that's the reason why the world as fallen once again into a Dark Age that resulted on the apparent extinction of the human race. Using a version of M.O.D.O.K., they discover the body of the slain Celestial which apparently still contains life seeds. However, as X-Force also learn that the only way to return to the main reality is to seek the help of Gateway who in turn is kept prisoner in the mysterious floating city known as The Sky, the Sentinels soon arrives at Atlantis forcing the group to abandon the complex. As Fantomex leads a small team to the place where the Celestial is, the rest of the team invades The Sky to retrieve Gateway, however they are confronted by the Black Legion, a group of psychotic and merciless killers under the service of the Heir of Apocalypse, consisting of Blob, Manphibian, Demon-Ock (a demonic creature with mechanical tentacles), Beta-Red (a female counterpart of Omega Red), Grimm Chamber (a Thing/Chamber hybrid), Iron Ghost (a Ghost Rider/Iron Man hybrid), Orange Hulk (a solar-powered Hulk), White Cloak (a Cloak/Dagger hybrid), Zombie Sentry (an undead version of Sentry) and Venomcap (Captain America bonded with a symbiote). During the fight, X-Force and the Earth-295 X-Men run into the long thought deceased Weapon X (Logan/Wolverine Earth-295). He appears using Apocalypse armor and reveals himself to be the Heir of Apocalypse. Meanwhile, unaware of the problems Wolverine and his team are facing in the fortress, Fantomex and his small crew dive into the heart of the deceased Celestial in order to get the life seed they need to free Warren. After battling some drones, they manage to find only one seed and flee with it, losing Gambit in the battle, while, back in the fortress, Wolverine and his crew try to battle Weapon X and the Black Legion. However, Weapon X proves too powerful, since he had been augmented by the Celestial technology, when the cosmic entities came to judge planet Earth, and while he had ascended in form and power, his mind had become so twisted to the point of creating genetic-powerful warriors to kill Charles Lehnsherr, the infant son of Magneto and Rogue. Weapon X easily manages to swat them all and take Jean Grey so he could transform her into Death, a horseman of Apocalypse. To perform the ritual he approaches Storm who was enslaved and transform into a blind seer made of living stone. After taking out the Black Legion and freeing Gateway, Wolverine ask Gateway to open a portal to bring forth Fantomex team. Using Fantomex, they manage to free Jean and open a gateway to their world. Wolverine wants Jean to come too but she refuses and forces them through the gateway with her powers. As X-Force returns to their world, they are greeted by Dark Beast, the Horsemen of Apocalypse, and Archangel, now wearing Apocalypse's armor. After a long fight, Fantomex retreats and gets Gateway to teleport the AOA X-Men to help X-Force, together they defeat Archangel, the AoA X-Men decide to go back to their timeline while Nightcrawler decides to stay in this timeline and vows to kill, Dark Beast, Iceman, Sugar Man, and any other villain that escaped the AOA timeline to this one. Age of Apocalypse ongoing series Publishing history In the Marvel Point One one-shot, a new team of anti-mutant humans calling themselves the X-Terminated, pledged to combat the rule of the ascended Weapon X and his minions, after X-Force's attempt to stop the genocidal successor of Apocalypse. The group consisted of remaining members of the human race in the Age of Apocalypse who have been pushed to the edge of extinction by mutants. Members of that team were Prophet (William Stryker), Goodnight (a rebuilt Donald Pierce), Deadeye (Zora Risman), Fiend (Francesca Trask), and Horror Show (Graydon Creed). Plot summary As Jean Grey and Sabretooth returned from Earth-616, they meet the human coalition. It is also revealed that Jean had ordered much to Magneto's horror, the creation of clones of the Scarlet Witch, so they could use the spell Jean saw previously on Wolverine's mind that de-powered 99% of mutantkind. However Weapon X and his Black Legion attack the last human city where Weapon X himself slays both Magneto and Rogue, leaving Jean Grey and Sabretooth the last two X-Men alive (Sunfire had given his life to stop Archangel's plans on Earth-616, and Nightcrawler decided to stay on that reality to hunt down Dark Beast, Blob, Iceman and Sugar Man). Jean telepathically nudges clones of the Scarlet Witch to recreate the Decimation and remove all mutants' powers across the globe. However, this was only successful within a radius of 12 feet, so Jean Grey and Sabretooth are both left de-powered while Weapon X and his forces remained powered. The human coalition distracts Weapon X with a bomb long enough for the group to escape as the city explodes behind them. As the human coalition (X-Terminated Team, now including Jean Grey) continues to fight the forces of Weapon X, now renamed Weapon Omega, they find Harper Simmons, a human journalist from Earth-616 who was forced to come to the Age of Apocalypse while investigating the prison break of Sugar Man by Dark Beast on Earth-616. He creates a pamphlet that incites human and mutant riots against Weapon Omega, who is now bringing back deceased mutants like Emplate, Scott Summers and Alex Summers using energies siphoned from the celestial life seed. Harper Simons joins with the X-Terminated. Others who work with the X-Terminated are Doctor Moreau and Bolivar Trask. After discovering the resurrected Penance, he ordered his servants Azazel, Cyclops and Colossus to bring her into the fold. She initially refused and undid Colossus' brainwashing causing him to abandon Weapon Omega and serve Penance. A fight broke out but Azazel agreed to leave. He returned with Weapon Omega who demanded that Penance kneel before him which she did. Unbeknownst to Weapon Omega however Penance was also making deals with the Human Resistance. It has since been revealed that when the Celestials had come to Earth, they tried to resurrect Apocalypse by rewrite his genetic code to form a new body. After a small team of X-Men went investigate the ship they discovered that Apocalypse was already in the form of a child which Weapon X effectively kills despite Jean's pleas. With the death of the child, Weapon X took on the role of the Evolutionary Caretaker in an effort to spare his world from the Celestials wrath. Thus, he restarted the campaigns of extermination perpetrated by Apocalypse against the human race after being corrupted by the Seed. The X-Terminated later travel to Latveria so they could get the information they need to defeat Weapon Omega, as Doom had apparently managed to create a device capable of storing the Death Seed's powers which they aptly referred to as the "Apocalypse Force" from its host body and empowering it within a new user, however they are approached by the Queen, actually Doom's wife and former member of the Human High Council, Emma Frost, who had her telepathic powers returned to her and was now in league with Weapon Omega. The X-Terminated eventually gained the information they needed by killing Doom and removed the intel literally from his head. With the information they gained, the X-Terminated build the device, however, Weapon Omega after being alerted that Jean Grey was hiding out in the city, resolved to hunt his wife down himself, and vowed that if her humanity could not be cured, he would kill her himself. Jean Grey was ultimately responsible for removing the power of the Death Seed within her former lover and were absorbed by Jean as the next host. Thanks to her history with the Phoenix Force, though, Jean was strong enough to reject the power of the Death Seed and displaced it. After everything died down, Weapon Omega emerged from the rubble as Logan once again, his mind now clear of the corrupting force of the Death Seed. Unknown to him or Jean, however, the energies of the seed had in fact been contained by Bolivar Trask in a giant machine under the Nevada Desert. "X-Termination" In March 2013, the X-Treme X-Men, Age of Apocalypse, and Astonishing X-Men titles were part of the "X-Termination" crossover event, which focused on the AoA Nightcrawler's trip home. Age of Apocalypse #14, the final issue of the series, will be Part 3 of the event. Following the completion of his quest, Nightcrawler decided it was time to return home. Even though this world was in a much better state, he still missed his own and he wanted to return to fight Weapon Omega. After managing to avoid Wolverine, who was hunting him down, Nightcrawler eventually tracked down another exile from his world: Dark Beast, however, unbeknownst to them, due to the dimension-hopping activities of various superheroes and villains, the walls in the netherspace have become weak and began to crack. The rift first became known on Earth-TRN262 in the head of the Sphinx. Lord Xavier, the Witch King, Nazi Xavier, and Xavier Head began sacrificing civilians to an interdimensional rift to gain power. The X-treme X-Men, who had been trying to stop this from happening by killing ten evil Xaviers across various realities before they could use their powers to trigger the event, were able to rescue their Xavier and narrowly defeated Lord Xavier and Nazi Xavier. Unfortunately, the X-treme X-Men did not act quickly enough to save that world, and were forced to make an interdimensional jump, leaving that reality and all its citizens being consumed by the vortex. Unbeknownst to them, an army of monsters were waiting on the other side of the portal. Using a pair of modified goggles, which Dark Beast explains will allow them to enter the Dreaming Celestial safely in a bid to return home. Kurt teleports them inside, where McCoy attempts to open a portal to their home reality. However, before the portal stabilizes, the machine he was using begins to malfunction. Before he can fix it, the X-Men arrive and the two have to flee, with Nightcrawler teleporting them through the portal. However, once they arrive in their homeworld, the portal doesn't close behind them, which worries the Dark Beast. The situation is complicated first by Wolverine's team, which comes through the portal to take Kurt back to their reality, and then by Dazzler and her team of X-treme X-Men, who seem keen to close the portal. As Xavier of the X-treme X-Men uses his powers to try and close the portal three huge monsters emerge from it. Xavier tries to tell them they mean no harm but one of the monsters kills him and dissolves his body to absorb its energy. As it does so, it grows slightly bigger. In response, Dazzler blasts one with her light beams, but it absorbs her energy and grows in size. After trying various methods of attack, the teams realize that the monsters are nearly invulnerable. Karma tries possessing one but it ends up possessing her. They find out that the monsters were trapped between dimensions by the Celestials and that the constant travelling between worlds has weakened the barriers and freed them. Karma is dying but Iceman freezes the monsters and saves Karma. As the teams regroup to try and figure out what to do, Sage picks up on some thought the monsters are projecting. She screams for someone to shut the portal down, but it's too late and one of the monsters walks through it to the 616 universe. As Howlett, Wolverine, Northstar and Hercules go after it, the second monster heads off into New Apocalypse, whilst the third starts to drain energy from the portal itself. Prophet says that they could use the power of Apocalypse to defeat them but Jean Grey isn't so keen. After some deliberation, the teams decide to split up with some staying on New Apocalypse and the other going to fight the creature through the portal. Sabretooth and Horror Show sacrifice themselves to provide a distraction whilst Kid Nightcrawler teleports a group of people through the portal. The remaining group in New Apocalypse heads off to formulate a plan of attack as the second monster tears through the city. Northstar, Hercules, Howlett and Wolverine emerge in San Francisco of the 616 universe, where they find the monster draining the energy from the Dreaming Celestial's chest. In the Age of Apocalypse reality, Jean and her group travel to the Apocalypse power. Fiend radios through from New Apocalypse, where one of the monsters is attacking. After a short conversation, the radio goes silent and Jean realizes her friend is dead. They make their way through some caverns to the room the Apocalypse power is being kept in. Dark Beast slips away as the others look at the canister the power resides in. Jean has Kurt teleport them both away as she doesn't trust anyone else. In the 616 universe, Howlett and Wolverine try attacking the monster but it just continues attacking the Celestial. Northstar throws Hercules at it and the monster is finally ripped away from it. Wolverine and Howlett are severely injured, so Kid Nightcrawler starts to teleport them away as Hercules continues to fight the monster. The monster kills him before Kurt can get to him in time. The monster then advances on the Celestial again, which decides to leave. However, the monster uses a grappling hook to prevent it from doing so and, even though the rest of the team manages to separate the two, the monster begins to absorb the energy from the Celestial. The team can only watch as the monster kills the Dreaming Celestial and absorbs all of its energy, continuing to grow in size and power. In the AoA reality, Jean tells Kurt the plan is for her to use the Apocalypse power herself, as she managed to use the Phoenix Force and resist it. Before she can, though, Dark Beast snatches the canister off her just as one of the monsters finds them and attacks. As Howlett mourns the death of Hercules, the monster in 616 becomes stronger, due to the Celestial it just destroyed. Northstar creates a vortex around it to stop it being empowered by more energy, whilst Prophet tries to figure out how to kill it. He finds out that billions more monsters are headed to where this one is and, if they don't destroy this one, the whole world is doomed. In New Apocalypse on the other side of the portal, Jean is being chased by another monster. Dazzler and her team slow it down and Kurt teleports Prophet and Howlett through the portal. They see Dark Beast trying to take the power of the Apocalypse seed for himself. Nightcrawler and Jean try to take the seed off him but he fights back. Another monster enters and grabs the seed but is hurt by its touch. Dark Beast grabs the seed again and runs off with Jean and Nightcrawler chasing him. Prophet realizes that the monster was hurt by the seed. Kid Nightcrawler tells Dazzler her world is in danger too and Prophet says they have to close the portal and sacrifice one world. Dazzler refuses to do that and comes up with a plan. Whilst the others chase down Jean and the seed, Dazzler and Cyclops head to the portal. They use their powers to try and draw the monster through but it doesn't go for it. Kid Nightcrawler finds them and decides he can do it. He teleports to the monster and then teleports it through the portal. The strain of doing it was too much for him, though, and he dies in Dazzler's arms. Nightcrawler, Prophet, Howlett and Dark Beast teleport in. Dark Beast won't let go of the seed, so Dazzler confronts him, beats him up and takes the seed. She then hands it over to Jean Grey, so they can have her use it on the three monsters at the same time. Jean Grey has taken in the power of Apocalypse and has been transformed into an immensely powerful being. Though she still holds on to her personality, the death powers are already corrupting her. As the monsters feed off the energy from the portal, Jean engages them in combat, blasting them away and drawing their attention. Howlett mourns the death of Kid Nightcrawler, causing AoA Nightcrawler to face up to what he has done. Prophet tells him to stop pitying himself and says they need Sage and the Celestial black box from the other universe. Nightcrawler teleports through the portal and on his way he sees billions of other monsters descends upon the portal. In the 616 universe, Wolverine and Northstar are arguing about what to do. Sage manages to connect her mind to the black box and sees the origin of the monsters. The Celestials created life because they were lonely. They decided to create death as well, so they formed the monsters. However, the monsters turned against the Celestials who couldn't kill them so they separated the universe into the Multiverse and bond them in the walls that separated all realities. The constant traveling between universes weakened the walls and allowed the monsters to escape again. Suddenly, Nightcrawler appears and take Sage back with him. In New Apocalypse, Jean is fighting the monsters but more continue to come through the portal. Slowly, the death seed starts to take her over more and she begins to lose herself. As the carnage spreads, Sage and Nightcrawler appear and Sage tells Prophet she knows what to do. He already knows, though. The monsters need a prison and this universe is the best choice. Dazzler tries to tell him there must be another way but he says there isn't. They need to get everyone they can back to her world and then close off the portal. Nightcrawler says he can do both. As Jean continues to fight the monsters in New Apocalypse, Prophet orders everyone to evacuate to the 616 reality. Dazzler objects to leaving, but Prophet tells her sacrificing the AoA reality is the only way. Nightcrawler begins to teleport everyone back, first taking Harper Simmons and then Sage. However, when he goes to take Iceman, the Dark Beast breaks free of his shackles and goes with them. He is quickly knocked out by Gambit on the other side, but not before jamming a nugget of the Apocalypse seed within Iceman to keep it safe. As Nightcrawler next takes Howlett and Cyclops, Dazzler begs Prophet to come with her but he refuses, saying a captain goes down with the ship. However, the decision is made for him when Jean Grey knocks him out and instructs Dazzler to take him back to her world. Jean goes off to continue her fight as Nightcrawler teleports Dazzler and Prophet away. In the 616 reality, Nightcrawler realizes that if he grabs onto the black swirls in the portal, he can teleport the opening back in on itself. Sage confirms he could close the portal and, before anyone can stop him, he goes. He manages to close it at the cost of his own life and separate the entirety of Earth-295 from the Multiverse. Afterwards, Howlett and Cyclops decide to travel to Greece to collect Hercules from the underworld. Wolverine offers Dazzler a job at the school but she declines, as she needs a bit of time to herself. A few weeks later, Harper meets Prophet on a beach, where they have a drink to remember their old team. Elsewhere, Dazzler creates a holographic image to make sure everyone remembers her fallen teammates. What If Synopsis for "What If... The Age of Apocalypse Had Not Ended?" An alternate AoA reality was presented when Magneto, giving up on Bishop's mission in the final moments, rescued his family from the nuclear explosions alongside some of his allies. Magneto, Rogue, Sunfire, Quicksilver, and Weapon X found themselves working with the last remaining human heroes (including Tony Stark, Invisible Woman and Gwen Stacy, the latter of which formed a romance with Quicksilver) to deal with a new threat: the Coming of Galactus. As there was no Fantastic Four, it fell to the survivors to work against Galactus and his herald, the Silver Surfer. As the heroes sprung into action, Night-Thrasher ended up using advanced technology to empower himself with amazing psychic powers. Together, they were able to do the impossible and claim victory. After Weapon X used his adamantium claws to slay the Silver Surfer, the collective psychic potential of humanity was focused against Galactus, eventually killing him. Secret Wars (2015) The Age of Apocalypse is featured as one of the many domains of Battleworld in Secret Wars. It has its differences from the only original storyline, with two of the main ones being the inclusion of Cypher as a prominent character and Magneto marrying Marvel Girl aka Emma Frost instead of Rogue. The Age of Apocalypse's location on Battleworld is known as the Domain of Apocalypse, the most ruthless domain of all. X-Men Disassembled During a battle with Nate Grey, Legion tries to send him back to his universe, however, things don't go as Legion planned and instead he ended banishing not only X-Man, but Armor, Pixie, Glob, Rockslide and himself to the Age of Apocalypse universe that exists on Legion's mindscape. Collected editions In other media The 2001 Game Boy Advance video game X-Men: Reign of Apocalypse is based loosely on the Age of Apocalypse storyline. In this version, the X-Men (consisting of Cyclops, Storm, Rogue, and Wolverine) accidentally travels to an alternate universe where Apocalypse has taken over the world and most of the X-Men have turned into his henchmen. It is later revealed that Apocalypse plans to travel to the regular timeline and take it over as well. In the end, the X-Men defeats Apocalypse and returns to their timeline. X-Men Legends II: Rise of Apocalypse is heavily influenced by the Age of Apocalypse storyline, including several characters and concepts from the storyline. Wolverine and the X-Men season 2's main storyline and setting was originally supposed to be the Age of Apocalypse, but the series was cancelled before production of the second season could begin. In X-Men: The Animated Series, there is an episode, "ONE MAN'S WORTH" (1995) whose story line directly inspired the Age of Apocalypse event. Marvel: Avengers Alliance featured a special operations titled Apocalypse based on the Age of Apocalypse storyline. Marvel Future Fight features a level based on the Age of Apocalypse event. Features an alternate costume for Magneto, Wolverine, Apocalypse, Beast, Rogue and Cyclops based on his Age of Apocalation incarnations. Marvel Ultimate Alliance 3: The Black Order features an alternate costume for Colossus based on his Age of Apocalypse incarnation. References External links UncannyXmen.Net's look at the Age of Apocalypse Age of Apocalypse summary It Only Hurts When I Sing: The Age of Apocalypse Resource Center Age of Apocalypse at Marvel Wikia Comics by Fabian Nicieza Comics by Mark Waid Marvel Comics dimensions Comics about multiple time paths Comics about time travel Dystopian comics
```javascript /** * Select2 Latvian translation */ (function ($) { "use strict"; $.extend($.fn.select2.defaults, { formatNoMatches: function () { return "Sakritbu nav"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Ldzu ievadiet vl " + n + " simbol" + (n == 11 ? "us" : (/^\d*[1]$/im.test(n)? "u" : "us")); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Ldzu ievadiet par " + n + " simbol" + (n == 11 ? "iem" : (/^\d*[1]$/im.test(n)? "u" : "iem")) + " mazk"; }, formatSelectionTooBig: function (limit) { return "Js varat izvlties ne vairk k " + limit + " element" + (limit == 11 ? "us" : (/^\d*[1]$/im.test(limit)? "u" : "us")); }, formatLoadMore: function (pageNumber) { return "Datu ielde..."; }, formatSearching: function () { return "Meklana..."; } }); })(jQuery); ```
```objective-c /***************************************************************************/ /* */ /* fterrors.h */ /* */ /* FreeType error code handling (specification). */ /* */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This special header file is used to define the handling of FT2 */ /* enumeration constants. It can also be used to generate error message */ /* strings with a small macro trick explained below. */ /* */ /* I - Error Formats */ /* ----------------- */ /* */ /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */ /* defined in ftoption.h in order to make the higher byte indicate */ /* the module where the error has happened (this is not compatible */ /* with standard builds of FreeType 2). See the file `ftmoderr.h' for */ /* more details. */ /* */ /* */ /* II - Error Message strings */ /* -------------------------- */ /* */ /* The error definitions below are made through special macros that */ /* allow client applications to build a table of error message strings */ /* if they need it. The strings are not included in a normal build of */ /* FreeType 2 to save space (most client applications do not use */ /* them). */ /* */ /* To do so, you have to define the following macros before including */ /* this file: */ /* */ /* FT_ERROR_START_LIST :: */ /* This macro is called before anything else to define the start of */ /* the error list. It is followed by several FT_ERROR_DEF calls */ /* (see below). */ /* */ /* FT_ERROR_DEF( e, v, s ) :: */ /* This macro is called to define one single error. */ /* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */ /* `v' is the error numerical value. */ /* `s' is the corresponding error string. */ /* */ /* FT_ERROR_END_LIST :: */ /* This macro ends the list. */ /* */ /* Additionally, you have to undefine __FTERRORS_H__ before #including */ /* this file. */ /* */ /* Here is a simple example: */ /* */ /* { */ /* #undef __FTERRORS_H__ */ /* #define FT_ERRORDEF( e, v, s ) { e, s }, */ /* #define FT_ERROR_START_LIST { */ /* #define FT_ERROR_END_LIST { 0, 0 } }; */ /* */ /* const struct */ /* { */ /* int err_code; */ /* const char* err_msg; */ /* } ft_errors[] = */ /* */ /* #include FT_ERRORS_H */ /* } */ /* */ /*************************************************************************/ #ifndef __FTERRORS_H__ #define __FTERRORS_H__ /* include module base error codes */ #include FT_MODULE_ERRORS_H /*******************************************************************/ /*******************************************************************/ /***** *****/ /***** SETUP MACROS *****/ /***** *****/ /*******************************************************************/ /*******************************************************************/ #undef FT_NEED_EXTERN_C /* FT_ERR_PREFIX is used as a prefix for error identifiers. */ /* By default, we use `FT_Err_'. */ /* */ #ifndef FT_ERR_PREFIX #define FT_ERR_PREFIX FT_Err_ #endif /* FT_ERR_BASE is used as the base for module-specific errors. */ /* */ #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS #ifndef FT_ERR_BASE #define FT_ERR_BASE FT_Mod_Err_Base #endif #else #undef FT_ERR_BASE #define FT_ERR_BASE 0 #endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */ /* If FT_ERRORDEF is not defined, we need to define a simple */ /* enumeration type. */ /* */ #ifndef FT_ERRORDEF #define FT_ERRORDEF( e, v, s ) e = v, #define FT_ERROR_START_LIST enum { #define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) }; #ifdef __cplusplus #define FT_NEED_EXTERN_C extern "C" { #endif #endif /* !FT_ERRORDEF */ /* this macro is used to define an error */ #define FT_ERRORDEF_( e, v, s ) \ FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s ) /* this is only used for <module>_Err_Ok, which must be 0! */ #define FT_NOERRORDEF_( e, v, s ) \ FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s ) #ifdef FT_ERROR_START_LIST FT_ERROR_START_LIST #endif /* now include the error codes */ #include FT_ERROR_DEFINITIONS_H #ifdef FT_ERROR_END_LIST FT_ERROR_END_LIST #endif /*******************************************************************/ /*******************************************************************/ /***** *****/ /***** SIMPLE CLEANUP *****/ /***** *****/ /*******************************************************************/ /*******************************************************************/ #ifdef FT_NEED_EXTERN_C } #endif #undef FT_ERROR_START_LIST #undef FT_ERROR_END_LIST #undef FT_ERRORDEF #undef FT_ERRORDEF_ #undef FT_NOERRORDEF_ #undef FT_NEED_EXTERN_C #undef FT_ERR_BASE /* FT_ERR_PREFIX is needed internally */ #ifndef FT2_BUILD_LIBRARY #undef FT_ERR_PREFIX #endif #endif /* __FTERRORS_H__ */ /* END */ ```
Berkeh () is a village in Kushk-e Hezar Rural District, Beyza District, Sepidan County, Fars Province, Iran. At the 2006 census, its population was 220, in 48 families. References Populated places in Beyza County
```go // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Solaris system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system call stubs. // Note that sometimes we use a lowercase //sys name and wrap // it in our own nicer implementation, either here or in // syscall_solaris.go or syscall_unix.go. package unix import ( "sync/atomic" "syscall" "unsafe" ) // Implemented in runtime/syscall_solaris.go. type syscallFunc uintptr func rawSysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) type SockaddrDatalink struct { Family uint16 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [244]int8 raw RawSockaddrDatalink } func clen(n []byte) int { for i := 0; i < len(n); i++ { if n[i] == 0 { return i } } return len(n) } // ParseDirent parses up to max directory entries in buf, // appending the names to names. It returns the number // bytes consumed from buf, the number of entries added // to names, and the new names slice. func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { origlen := len(buf) for max != 0 && len(buf) > 0 { dirent := (*Dirent)(unsafe.Pointer(&buf[0])) if dirent.Reclen == 0 { buf = nil break } buf = buf[dirent.Reclen:] if dirent.Ino == 0 { // File absent in directory. continue } bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0])) var name = string(bytes[0:clen(bytes[:])]) if name == "." || name == ".." { // Useless names continue } max-- count++ names = append(names, name) } return origlen - len(buf), count, names } //sysnb pipe(p *[2]_C_int) (n int, err error) func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL } var pp [2]_C_int n, err := pipe(&pp) if n != 0 { return err } p[0] = int(pp[0]) p[1] = int(pp[1]) return nil } func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Family = AF_INET p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) for i := 0; i < len(sa.Addr); i++ { sa.raw.Addr[i] = sa.Addr[i] } return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil } func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL } sa.raw.Family = AF_INET6 p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) p[0] = byte(sa.Port >> 8) p[1] = byte(sa.Port) sa.raw.Scope_id = sa.ZoneId for i := 0; i < len(sa.Addr); i++ { sa.raw.Addr[i] = sa.Addr[i] } return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil } func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { name := sa.Name n := len(name) if n >= len(sa.raw.Path) { return nil, 0, EINVAL } sa.raw.Family = AF_UNIX for i := 0; i < n; i++ { sa.raw.Path[i] = int8(name[i]) } // length is family (uint16), name, NUL. sl := _Socklen(2) if n > 0 { sl += _Socklen(n) + 1 } if sa.raw.Path[0] == '@' { sa.raw.Path[0] = 0 // Don't count trailing NUL for abstract address. sl-- } return unsafe.Pointer(&sa.raw), sl, nil } //sys getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getsockname func Getsockname(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if err = getsockname(fd, &rsa, &len); err != nil { return } return anyToSockaddr(&rsa) } const ImplementsGetwd = true //sys Getcwd(buf []byte) (n int, err error) func Getwd() (wd string, err error) { var buf [PathMax]byte // Getcwd will return an error if it failed for any reason. _, err = Getcwd(buf[0:]) if err != nil { return "", err } n := clen(buf[:]) if n < 1 { return "", EINVAL } return string(buf[:n]), nil } /* * Wrapped */ //sysnb getgroups(ngid int, gid *_Gid_t) (n int, err error) //sysnb setgroups(ngid int, gid *_Gid_t) (err error) func Getgroups() (gids []int, err error) { n, err := getgroups(0, nil) // Check for error and sanity check group count. Newer versions of // Solaris allow up to 1024 (NGROUPS_MAX). if n < 0 || n > 1024 { if err != nil { return nil, err } return nil, EINVAL } else if n == 0 { return nil, nil } a := make([]_Gid_t, n) n, err = getgroups(n, &a[0]) if n == -1 { return nil, err } gids = make([]int, n) for i, v := range a[0:n] { gids[i] = int(v) } return } func Setgroups(gids []int) (err error) { if len(gids) == 0 { return setgroups(0, nil) } a := make([]_Gid_t, len(gids)) for i, v := range gids { a[i] = _Gid_t(v) } return setgroups(len(a), &a[0]) } func ReadDirent(fd int, buf []byte) (n int, err error) { // Final argument is (basep *uintptr) and the syscall doesn't take nil. // TODO(rsc): Can we use a single global basep for all calls? return Getdents(fd, buf, new(uintptr)) } // Wait status is 7 bits at bottom, either 0 (exited), // 0x7F (stopped), or a signal number that caused an exit. // The 0x80 bit is whether there was a core dump. // An extra number (exit code, signal causing a stop) // is in the high bits. type WaitStatus uint32 const ( mask = 0x7F core = 0x80 shift = 8 exited = 0 stopped = 0x7F ) func (w WaitStatus) Exited() bool { return w&mask == exited } func (w WaitStatus) ExitStatus() int { if w&mask != exited { return -1 } return int(w >> shift) } func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != 0 } func (w WaitStatus) Signal() syscall.Signal { sig := syscall.Signal(w & mask) if sig == stopped || sig == 0 { return -1 } return sig } func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 } func (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP } func (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP } func (w WaitStatus) StopSignal() syscall.Signal { if !w.Stopped() { return -1 } return syscall.Signal(w>>shift) & 0xFF } func (w WaitStatus) TrapCause() int { return -1 } //sys wait4(pid int32, statusp *_C_int, options int, rusage *Rusage) (wpid int32, err error) func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (int, error) { var status _C_int rpid, err := wait4(int32(pid), &status, options, rusage) wpid := int(rpid) if wpid == -1 { return wpid, err } if wstatus != nil { *wstatus = WaitStatus(status) } return wpid, nil } //sys gethostname(buf []byte) (n int, err error) func Gethostname() (name string, err error) { var buf [MaxHostNameLen]byte n, err := gethostname(buf[:]) if n != 0 { return "", err } n = clen(buf[:]) if n < 1 { return "", EFAULT } return string(buf[:n]), nil } //sys utimes(path string, times *[2]Timeval) (err error) func Utimes(path string, tv []Timeval) (err error) { if tv == nil { return utimes(path, nil) } if len(tv) != 2 { return EINVAL } return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } //sys utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) func UtimesNano(path string, ts []Timespec) error { if ts == nil { return utimensat(AT_FDCWD, path, nil, 0) } if len(ts) != 2 { return EINVAL } return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error { if ts == nil { return utimensat(dirfd, path, nil, flags) } if len(ts) != 2 { return EINVAL } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) } //sys fcntl(fd int, cmd int, arg int) (val int, err error) // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(lk)), 0, 0, 0) if e1 != 0 { return e1 } return nil } //sys futimesat(fildes int, path *byte, times *[2]Timeval) (err error) func Futimesat(dirfd int, path string, tv []Timeval) error { pathp, err := BytePtrFromString(path) if err != nil { return err } if tv == nil { return futimesat(dirfd, pathp, nil) } if len(tv) != 2 { return EINVAL } return futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } // Solaris doesn't have an futimes function because it allows NULL to be // specified as the path for futimesat. However, Go doesn't like // NULL-style string interfaces, so this simple wrapper is provided. func Futimes(fd int, tv []Timeval) error { if tv == nil { return futimesat(fd, nil, nil) } if len(tv) != 2 { return EINVAL } return futimesat(fd, nil, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_UNIX: pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa)) sa := new(SockaddrUnix) // Assume path ends at NUL. // This is not technically the Solaris semantics for // abstract Unix domain sockets -- they are supposed // to be uninterpreted fixed-size binary blobs -- but // everyone uses this convention. n := 0 for n < len(pp.Path) && pp.Path[n] != 0 { n++ } bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] sa.Name = string(bytes) return sa, nil case AF_INET: pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) sa := new(SockaddrInet4) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) for i := 0; i < len(sa.Addr); i++ { sa.Addr[i] = pp.Addr[i] } return sa, nil case AF_INET6: pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) sa := new(SockaddrInet6) p := (*[2]byte)(unsafe.Pointer(&pp.Port)) sa.Port = int(p[0])<<8 + int(p[1]) sa.ZoneId = pp.Scope_id for i := 0; i < len(sa.Addr); i++ { sa.Addr[i] = pp.Addr[i] } return sa, nil } return nil, EAFNOSUPPORT } //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) = libsocket.accept func Accept(fd int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny nfd, err = accept(fd, &rsa, &len) if nfd == -1 { return } sa, err = anyToSockaddr(&rsa) if err != nil { Close(nfd) nfd = 0 } return } //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.recvmsg func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { var msg Msghdr var rsa RawSockaddrAny msg.Name = (*byte)(unsafe.Pointer(&rsa)) msg.Namelen = uint32(SizeofSockaddrAny) var iov Iovec if len(p) > 0 { iov.Base = (*int8)(unsafe.Pointer(&p[0])) iov.SetLen(len(p)) } var dummy int8 if len(oob) > 0 { // receive at least one normal byte if len(p) == 0 { iov.Base = &dummy iov.SetLen(1) } msg.Accrights = (*int8)(unsafe.Pointer(&oob[0])) } msg.Iov = &iov msg.Iovlen = 1 if n, err = recvmsg(fd, &msg, flags); n == -1 { return } oobn = int(msg.Accrightslen) // source address is only specified if the socket is unconnected if rsa.Addr.Family != AF_UNSPEC { from, err = anyToSockaddr(&rsa) } return } func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { _, err = SendmsgN(fd, p, oob, to, flags) return } //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.sendmsg func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { var ptr unsafe.Pointer var salen _Socklen if to != nil { ptr, salen, err = to.sockaddr() if err != nil { return 0, err } } var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(ptr)) msg.Namelen = uint32(salen) var iov Iovec if len(p) > 0 { iov.Base = (*int8)(unsafe.Pointer(&p[0])) iov.SetLen(len(p)) } var dummy int8 if len(oob) > 0 { // send at least one normal byte if len(p) == 0 { iov.Base = &dummy iov.SetLen(1) } msg.Accrights = (*int8)(unsafe.Pointer(&oob[0])) } msg.Iov = &iov msg.Iovlen = 1 if n, err = sendmsg(fd, &msg, flags); err != nil { return 0, err } if len(oob) > 0 && len(p) == 0 { n = 0 } return n, nil } //sys acct(path *byte) (err error) func Acct(path string) (err error) { if len(path) == 0 { // Assume caller wants to disable accounting. return acct(nil) } pathp, err := BytePtrFromString(path) if err != nil { return err } return acct(pathp) } /* * Expose the ioctl function */ //sys ioctl(fd int, req int, arg uintptr) (err error) func IoctlSetInt(fd int, req int, value int) (err error) { return ioctl(fd, req, uintptr(value)) } func IoctlSetWinsize(fd int, req int, value *Winsize) (err error) { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } func IoctlSetTermios(fd int, req int, value *Termios) (err error) { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } func IoctlSetTermio(fd int, req int, value *Termio) (err error) { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } func IoctlGetInt(fd int, req int) (int, error) { var value int err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) return value, err } func IoctlGetWinsize(fd int, req int) (*Winsize, error) { var value Winsize err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) return &value, err } func IoctlGetTermios(fd int, req int) (*Termios, error) { var value Termios err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) return &value, err } func IoctlGetTermio(fd int, req int) (*Termio, error) { var value Termio err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) return &value, err } /* * Exposed directly */ //sys Access(path string, mode uint32) (err error) //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error) //sys Chdir(path string) (err error) //sys Chmod(path string, mode uint32) (err error) //sys Chown(path string, uid int, gid int) (err error) //sys Chroot(path string) (err error) //sys Close(fd int) (err error) //sys Creat(path string, mode uint32) (fd int, err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(oldfd int, newfd int) (err error) //sys Exit(code int) //sys Fchdir(fd int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Fdatasync(fd int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) //sysnb Getgid() (gid int) //sysnb Getpid() (pid int) //sysnb Getpgid(pid int) (pgid int, err error) //sysnb Getpgrp() (pgid int, err error) //sys Geteuid() (euid int) //sys Getegid() (egid int) //sys Getppid() (ppid int) //sys Getpriority(which int, who int) (n int, err error) //sysnb Getrlimit(which int, lim *Rlimit) (err error) //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Gettimeofday(tv *Timeval) (err error) //sysnb Getuid() (uid int) //sys Kill(pid int, signum syscall.Signal) (err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) //sys Listen(s int, backlog int) (err error) = libsocket.listen //sys Lstat(path string, stat *Stat_t) (err error) //sys Madvise(b []byte, advice int) (err error) //sys Mkdir(path string, mode uint32) (err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mkfifoat(dirfd int, path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) //sys Mlock(b []byte) (err error) //sys Mlockall(flags int) (err error) //sys Mprotect(b []byte, prot int) (err error) //sys Munlock(b []byte) (err error) //sys Munlockall() (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys Pause() (err error) //sys Pread(fd int, p []byte, offset int64) (n int, err error) //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Rename(from string, to string) (err error) //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Rmdir(path string) (err error) //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek //sysnb Setegid(egid int) (err error) //sysnb Seteuid(euid int) (err error) //sysnb Setgid(gid int) (err error) //sys Sethostname(p []byte) (err error) //sysnb Setpgid(pid int, pgid int) (err error) //sys Setpriority(which int, who int, prio int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setreuid(ruid int, euid int) (err error) //sysnb Setrlimit(which int, lim *Rlimit) (err error) //sysnb Setsid() (pid int, err error) //sysnb Setuid(uid int) (err error) //sys Shutdown(s int, how int) (err error) = libsocket.shutdown //sys Stat(path string, stat *Stat_t) (err error) //sys Symlink(path string, link string) (err error) //sys Sync() (err error) //sysnb Times(tms *Tms) (ticks uintptr, err error) //sys Truncate(path string, length int64) (err error) //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) //sys Umask(mask int) (oldmask int) //sysnb Uname(buf *Utsname) (err error) //sys Unmount(target string, flags int) (err error) = libc.umount //sys Unlink(path string) (err error) //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys Utime(path string, buf *Utimbuf) (err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.bind //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.connect //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.sendto //sys socket(domain int, typ int, proto int) (fd int, err error) = libsocket.socket //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.socketpair //sys write(fd int, p []byte) (n int, err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) = libsocket.getsockopt //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getpeername //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) = libsocket.setsockopt //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = libsocket.recvfrom func readlen(fd int, buf *byte, nbuf int) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procread)), 3, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf), 0, 0, 0) n = int(r0) if e1 != 0 { err = e1 } return } func writelen(fd int, buf *byte, nbuf int) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwrite)), 3, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf), 0, 0, 0) n = int(r0) if e1 != 0 { err = e1 } return } var mapper = &mmapper{ active: make(map[*byte][]byte), mmap: mmap, munmap: munmap, } func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { return mapper.Mmap(fd, offset, length, prot, flags) } func Munmap(b []byte) (err error) { return mapper.Munmap(b) } //sys sysconf(name int) (n int64, err error) // pageSize caches the value of Getpagesize, since it can't change // once the system is booted. var pageSize int64 // accessed atomically func Getpagesize() int { n := atomic.LoadInt64(&pageSize) if n == 0 { n, _ = sysconf(_SC_PAGESIZE) atomic.StoreInt64(&pageSize, n) } return int(n) } ```
```go // Code generated by protoc-gen-go. // source: grant.proto // DO NOT EDIT! /* Package authz is a generated protocol buffer package. It is generated from these files: grant.proto It has these top-level messages: GrantList Grant */ package authz import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type GrantList struct { Grants []*Grant `protobuf:"bytes,1,rep,name=grants" json:"grants,omitempty"` } func (m *GrantList) Reset() { *m = GrantList{} } func (m *GrantList) String() string { return proto.CompactTextString(m) } func (*GrantList) ProtoMessage() {} func (*GrantList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (m *GrantList) GetGrants() []*Grant { if m != nil { return m.Grants } return nil } type Grant struct { GuardType string `protobuf:"bytes,1,opt,name=guard_type,json=guardType" json:"guard_type,omitempty"` GuardData []byte `protobuf:"bytes,2,opt,name=guard_data,json=guardData,proto3" json:"guard_data,omitempty"` Policy string `protobuf:"bytes,3,opt,name=policy" json:"policy,omitempty"` CreatedAt string `protobuf:"bytes,4,opt,name=created_at,json=createdAt" json:"created_at,omitempty"` Protected bool `protobuf:"varint,5,opt,name=protected" json:"protected,omitempty"` } func (m *Grant) Reset() { *m = Grant{} } func (m *Grant) String() string { return proto.CompactTextString(m) } func (*Grant) ProtoMessage() {} func (*Grant) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *Grant) GetGuardType() string { if m != nil { return m.GuardType } return "" } func (m *Grant) GetGuardData() []byte { if m != nil { return m.GuardData } return nil } func (m *Grant) GetPolicy() string { if m != nil { return m.Policy } return "" } func (m *Grant) GetCreatedAt() string { if m != nil { return m.CreatedAt } return "" } func (m *Grant) GetProtected() bool { if m != nil { return m.Protected } return false } func init() { proto.RegisterType((*GrantList)(nil), "authz.GrantList") proto.RegisterType((*Grant)(nil), "authz.Grant") } func init() { proto.RegisterFile("grant.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ // 193 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4e, 0x2f, 0x4a, 0xcc, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4d, 0x2c, 0x2d, 0xc9, 0xa8, 0x52, 0x32, 0xe4, 0xe2, 0x74, 0x07, 0x89, 0xfa, 0x64, 0x16, 0x97, 0x08, 0xa9, 0x70, 0xb1, 0x81, 0x95, 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0xf1, 0xe8, 0x81, 0x15, 0xe9, 0x81, 0x55, 0x04, 0x41, 0xe5, 0x94, 0x66, 0x31, 0x72, 0xb1, 0x82, 0x45, 0x84, 0x64, 0xb9, 0xb8, 0xd2, 0x4b, 0x13, 0x8b, 0x52, 0xe2, 0x4b, 0x2a, 0x0b, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x38, 0xc1, 0x22, 0x21, 0x95, 0x05, 0xa9, 0x08, 0xe9, 0x94, 0xc4, 0x92, 0x44, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x1e, 0xa8, 0xb4, 0x4b, 0x62, 0x49, 0xa2, 0x90, 0x18, 0x17, 0x5b, 0x41, 0x7e, 0x4e, 0x66, 0x72, 0xa5, 0x04, 0x33, 0x58, 0x27, 0x94, 0x07, 0xd2, 0x96, 0x5c, 0x94, 0x9a, 0x58, 0x92, 0x9a, 0x12, 0x9f, 0x58, 0x22, 0xc1, 0x02, 0x31, 0x15, 0x2a, 0xe2, 0x58, 0x22, 0x24, 0xc3, 0xc5, 0x09, 0xf2, 0x41, 0x6a, 0x72, 0x49, 0x6a, 0x8a, 0x04, 0xab, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x42, 0x20, 0x89, 0x0d, 0xec, 0x3b, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x08, 0xbf, 0xea, 0xec, 0x00, 0x00, 0x00, } ```
Arthur Louis Thurlow (May 5, 1913 – May 27, 2020) was a Canadian politician and judge. He represented the electoral district of Lunenburg County in the Nova Scotia House of Assembly from 1949 to 1953. He was a member of the Nova Scotia Liberal Party. Early life and education Thurlow was born in 1913 at Lunenburg, Nova Scotia, son of Maude (Kinley) and Charles Thurlow. He was educated at Dalhousie University, and was a lawyer by career. He married Mabel R. Maxwell in 1941. Political career Thurlow entered provincial politics in 1949, when he was elected in the dual-member Lunenburg County riding with Liberal Gordon E. Romkey. In the 1953 election, Thurlow and Romkey were both defeated, losing the riding to Progressive Conservative's Harley J. Spence and R. Clifford Levy. Judiciary Thurlow was appointed a judge in 1956, serving from 1956 to 1971 as puisne judge of the Exchequer Court of Canada, from 1971 to 1975 as judge of the Federal Court of Appeal, from December 4, 1975 to January 3, 1980 as associate chief justice of the Federal Court of Canada. On January 4, 1980, Thurlow was appointed chief justice of the Federal Court of Canada, serving until his retirement on May 5, 1988. Later life Thurlow was appointed an Officer of the Order of Canada in April 1992. Thurlow celebrated his 100th birthday in May 2013, and died on May 27, 2020. References 1913 births 2020 deaths Canadian centenarians Dalhousie University alumni Judges in Nova Scotia Men centenarians Nova Scotia Liberal Party MLAs Officers of the Order of Canada People from Lunenburg County, Nova Scotia Judges of the Exchequer Court of Canada Judges of the Federal Court of Canada
```c /***************************************************************************** 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 of Intel Corporation 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. ***************************************************************************** * Contents: Native middle-level C interface to LAPACK function dsbev * Author: Intel Corporation *****************************************************************************/ #include "lapacke_utils.h" lapack_int API_SUFFIX(LAPACKE_dsbev_work)( int matrix_layout, char jobz, char uplo, lapack_int n, lapack_int kd, double* ab, lapack_int ldab, double* w, double* z, lapack_int ldz, double* work ) { lapack_int info = 0; if( matrix_layout == LAPACK_COL_MAJOR ) { /* Call LAPACK function and adjust info */ LAPACK_dsbev( &jobz, &uplo, &n, &kd, ab, &ldab, w, z, &ldz, work, &info ); if( info < 0 ) { info = info - 1; } } else if( matrix_layout == LAPACK_ROW_MAJOR ) { lapack_int ldab_t = MAX(1,kd+1); lapack_int ldz_t = MAX(1,n); double* ab_t = NULL; double* z_t = NULL; /* Check leading dimension(s) */ if( ldab < n ) { info = -7; API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_dsbev_work", info ); return info; } if( ldz < n ) { info = -10; API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_dsbev_work", info ); return info; } /* Allocate memory for temporary array(s) */ ab_t = (double*)LAPACKE_malloc( sizeof(double) * ldab_t * MAX(1,n) ); if( ab_t == NULL ) { info = LAPACK_TRANSPOSE_MEMORY_ERROR; goto exit_level_0; } if( API_SUFFIX(LAPACKE_lsame)( jobz, 'v' ) ) { z_t = (double*)LAPACKE_malloc( sizeof(double) * ldz_t * MAX(1,n) ); if( z_t == NULL ) { info = LAPACK_TRANSPOSE_MEMORY_ERROR; goto exit_level_1; } } /* Transpose input matrices */ API_SUFFIX(LAPACKE_dsb_trans)( matrix_layout, uplo, n, kd, ab, ldab, ab_t, ldab_t ); /* Call LAPACK function and adjust info */ LAPACK_dsbev( &jobz, &uplo, &n, &kd, ab_t, &ldab_t, w, z_t, &ldz_t, work, &info ); if( info < 0 ) { info = info - 1; } /* Transpose output matrices */ API_SUFFIX(LAPACKE_dsb_trans)( LAPACK_COL_MAJOR, uplo, n, kd, ab_t, ldab_t, ab, ldab ); if( API_SUFFIX(LAPACKE_lsame)( jobz, 'v' ) ) { API_SUFFIX(LAPACKE_dge_trans)( LAPACK_COL_MAJOR, n, n, z_t, ldz_t, z, ldz ); } /* Release memory and exit */ if( API_SUFFIX(LAPACKE_lsame)( jobz, 'v' ) ) { LAPACKE_free( z_t ); } exit_level_1: LAPACKE_free( ab_t ); exit_level_0: if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) { API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_dsbev_work", info ); } } else { info = -1; API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_dsbev_work", info ); } return info; } ```
```c++ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/compiler/backend/instruction-scheduler.h" namespace v8 { namespace internal { namespace compiler { bool InstructionScheduler::SchedulerSupported() { return true; } int InstructionScheduler::GetTargetInstructionFlags( const Instruction* instr) const { switch (instr->arch_opcode()) { case kArmAdd: case kArmAnd: case kArmBic: case kArmClz: case kArmCmp: case kArmCmn: case kArmTst: case kArmTeq: case kArmOrr: case kArmEor: case kArmSub: case kArmRsb: case kArmMul: case kArmMla: case kArmMls: case kArmSmmul: case kArmSmull: case kArmSmmla: case kArmUmull: case kArmSdiv: case kArmUdiv: case kArmMov: case kArmMvn: case kArmBfc: case kArmUbfx: case kArmSbfx: case kArmSxtb: case kArmSxth: case kArmSxtab: case kArmSxtah: case kArmUxtb: case kArmUxth: case kArmUxtab: case kArmUxtah: case kArmRbit: case kArmRev: case kArmAddPair: case kArmSubPair: case kArmMulPair: case kArmLslPair: case kArmLsrPair: case kArmAsrPair: case kArmVcmpF32: case kArmVaddF32: case kArmVsubF32: case kArmVmulF32: case kArmVmlaF32: case kArmVmlsF32: case kArmVdivF32: case kArmVabsF32: case kArmVnegF32: case kArmVsqrtF32: case kArmVcmpF64: case kArmVaddF64: case kArmVsubF64: case kArmVmulF64: case kArmVmlaF64: case kArmVmlsF64: case kArmVdivF64: case kArmVmodF64: case kArmVabsF64: case kArmVnegF64: case kArmVsqrtF64: case kArmVrintmF32: case kArmVrintmF64: case kArmVrintpF32: case kArmVrintpF64: case kArmVrintzF32: case kArmVrintzF64: case kArmVrintaF64: case kArmVrintnF32: case kArmVrintnF64: case kArmVcvtF32F64: case kArmVcvtF64F32: case kArmVcvtF32S32: case kArmVcvtF32U32: case kArmVcvtF64S32: case kArmVcvtF64U32: case kArmVcvtS32F32: case kArmVcvtU32F32: case kArmVcvtS32F64: case kArmVcvtU32F64: case kArmVmovU32F32: case kArmVmovF32U32: case kArmVmovLowU32F64: case kArmVmovLowF64U32: case kArmVmovHighU32F64: case kArmVmovHighF64U32: case kArmVmovF64U32U32: case kArmVmovU32U32F64: case kArmFloat32Max: case kArmFloat64Max: case kArmFloat32Min: case kArmFloat64Min: case kArmFloat64SilenceNaN: case kArmF32x4Splat: case kArmF32x4ExtractLane: case kArmF32x4ReplaceLane: case kArmF32x4SConvertI32x4: case kArmF32x4UConvertI32x4: case kArmF32x4Abs: case kArmF32x4Neg: case kArmF32x4RecipApprox: case kArmF32x4RecipSqrtApprox: case kArmF32x4Add: case kArmF32x4AddHoriz: case kArmF32x4Sub: case kArmF32x4Mul: case kArmF32x4Div: case kArmF32x4Min: case kArmF32x4Max: case kArmF32x4Eq: case kArmF32x4Ne: case kArmF32x4Lt: case kArmF32x4Le: case kArmI32x4Splat: case kArmI32x4ExtractLane: case kArmI32x4ReplaceLane: case kArmI32x4SConvertF32x4: case kArmI32x4SConvertI16x8Low: case kArmI32x4SConvertI16x8High: case kArmI32x4Neg: case kArmI32x4Shl: case kArmI32x4ShrS: case kArmI32x4Add: case kArmI32x4AddHoriz: case kArmI32x4Sub: case kArmI32x4Mul: case kArmI32x4MinS: case kArmI32x4MaxS: case kArmI32x4Eq: case kArmI32x4Ne: case kArmI32x4GtS: case kArmI32x4GeS: case kArmI32x4UConvertF32x4: case kArmI32x4UConvertI16x8Low: case kArmI32x4UConvertI16x8High: case kArmI32x4ShrU: case kArmI32x4MinU: case kArmI32x4MaxU: case kArmI32x4GtU: case kArmI32x4GeU: case kArmI16x8Splat: case kArmI16x8ExtractLane: case kArmI16x8ReplaceLane: case kArmI16x8SConvertI8x16Low: case kArmI16x8SConvertI8x16High: case kArmI16x8Neg: case kArmI16x8Shl: case kArmI16x8ShrS: case kArmI16x8SConvertI32x4: case kArmI16x8Add: case kArmI16x8AddSaturateS: case kArmI16x8AddHoriz: case kArmI16x8Sub: case kArmI16x8SubSaturateS: case kArmI16x8Mul: case kArmI16x8MinS: case kArmI16x8MaxS: case kArmI16x8Eq: case kArmI16x8Ne: case kArmI16x8GtS: case kArmI16x8GeS: case kArmI16x8UConvertI8x16Low: case kArmI16x8UConvertI8x16High: case kArmI16x8ShrU: case kArmI16x8UConvertI32x4: case kArmI16x8AddSaturateU: case kArmI16x8SubSaturateU: case kArmI16x8MinU: case kArmI16x8MaxU: case kArmI16x8GtU: case kArmI16x8GeU: case kArmI8x16Splat: case kArmI8x16ExtractLane: case kArmI8x16ReplaceLane: case kArmI8x16Neg: case kArmI8x16Shl: case kArmI8x16ShrS: case kArmI8x16SConvertI16x8: case kArmI8x16Add: case kArmI8x16AddSaturateS: case kArmI8x16Sub: case kArmI8x16SubSaturateS: case kArmI8x16Mul: case kArmI8x16MinS: case kArmI8x16MaxS: case kArmI8x16Eq: case kArmI8x16Ne: case kArmI8x16GtS: case kArmI8x16GeS: case kArmI8x16UConvertI16x8: case kArmI8x16AddSaturateU: case kArmI8x16SubSaturateU: case kArmI8x16ShrU: case kArmI8x16MinU: case kArmI8x16MaxU: case kArmI8x16GtU: case kArmI8x16GeU: case kArmS128Zero: case kArmS128Dup: case kArmS128And: case kArmS128Or: case kArmS128Xor: case kArmS128Not: case kArmS128Select: case kArmS32x4ZipLeft: case kArmS32x4ZipRight: case kArmS32x4UnzipLeft: case kArmS32x4UnzipRight: case kArmS32x4TransposeLeft: case kArmS32x4TransposeRight: case kArmS32x4Shuffle: case kArmS16x8ZipLeft: case kArmS16x8ZipRight: case kArmS16x8UnzipLeft: case kArmS16x8UnzipRight: case kArmS16x8TransposeLeft: case kArmS16x8TransposeRight: case kArmS8x16ZipLeft: case kArmS8x16ZipRight: case kArmS8x16UnzipLeft: case kArmS8x16UnzipRight: case kArmS8x16TransposeLeft: case kArmS8x16TransposeRight: case kArmS8x16Concat: case kArmS8x16Shuffle: case kArmS32x2Reverse: case kArmS16x4Reverse: case kArmS16x2Reverse: case kArmS8x8Reverse: case kArmS8x4Reverse: case kArmS8x2Reverse: case kArmS1x4AnyTrue: case kArmS1x4AllTrue: case kArmS1x8AnyTrue: case kArmS1x8AllTrue: case kArmS1x16AnyTrue: case kArmS1x16AllTrue: return kNoOpcodeFlags; case kArmVldrF32: case kArmVldrF64: case kArmVld1F64: case kArmVld1S128: case kArmLdrb: case kArmLdrsb: case kArmLdrh: case kArmLdrsh: case kArmLdr: case kArmPeek: case kArmWord32AtomicPairLoad: return kIsLoadOperation; case kArmVstrF32: case kArmVstrF64: case kArmVst1F64: case kArmVst1S128: case kArmStrb: case kArmStrh: case kArmStr: case kArmPush: case kArmPoke: case kArmDmbIsh: case kArmDsbIsb: case kArmWord32AtomicPairStore: case kArmWord32AtomicPairAdd: case kArmWord32AtomicPairSub: case kArmWord32AtomicPairAnd: case kArmWord32AtomicPairOr: case kArmWord32AtomicPairXor: case kArmWord32AtomicPairExchange: case kArmWord32AtomicPairCompareExchange: return kHasSideEffect; #define CASE(Name) case k##Name: COMMON_ARCH_OPCODE_LIST(CASE) #undef CASE // Already covered in architecture independent code. UNREACHABLE(); } UNREACHABLE(); } int InstructionScheduler::GetInstructionLatency(const Instruction* instr) { // TODO(all): Add instruction cost modeling. return 1; } } // namespace compiler } // namespace internal } // namespace v8 ```
```css Drop caps with `:first-letter` Change the style of the decoration with `text-decoration-style` Change the color of the decoration with `text-decoration-color` Use ```list-style-type``` to change the marker type in lists Underline feature on HTML elements ```
```javascript /** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v6.2.1 * @link path_to_url * @license MIT */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var rowRenderer_1 = require("./rowRenderer"); var gridPanel_1 = require("../gridPanel/gridPanel"); var context_1 = require("../context/context"); var context_2 = require("../context/context"); var headerRenderer_1 = require("../headerRendering/headerRenderer"); var renderedHeaderCell_1 = require("../headerRendering/renderedHeaderCell"); var gridOptionsWrapper_1 = require("../gridOptionsWrapper"); var AutoWidthCalculator = (function () { function AutoWidthCalculator() { } // this is the trick: we create a dummy container and clone all the cells // into the dummy, then check the dummy's width. then destroy the dummy // as we don't need it any more. // drawback: only the cells visible on the screen are considered AutoWidthCalculator.prototype.getPreferredWidthForColumn = function (column) { var renderedHeaderCell = this.getHeaderCellForColumn(column); // cell isn't visible if (!renderedHeaderCell) { return -1; } var eDummyContainer = document.createElement('span'); // position fixed, so it isn't restricted to the boundaries of the parent eDummyContainer.style.position = 'fixed'; // we put the dummy into the body container, so it will inherit all the // css styles that the real cells are inheriting var eBodyContainer = this.gridPanel.getBodyContainer(); eBodyContainer.appendChild(eDummyContainer); // get all the cells that are currently displayed (this only brings back // rendered cells, rows not rendered due to row visualisation will not be here) this.putRowCellsIntoDummyContainer(column, eDummyContainer); // also put header cell in // we only consider the lowest level cell, not the group cell. in 99% of the time, this // will be enough. if we consider groups, then it gets to complicated for what it's worth, // as the groups can span columns and this class only considers one column at a time. this.cloneItemIntoDummy(renderedHeaderCell.getGui(), eDummyContainer); // at this point, all the clones are lined up vertically with natural widths. the dummy // container will have a width wide enough just to fit the largest. var dummyContainerWidth = eDummyContainer.offsetWidth; // we are finished with the dummy container, so get rid of it eBodyContainer.removeChild(eDummyContainer); // we add padding as I found without it, the gui still put '...' after some of the texts var autoSizePadding = this.gridOptionsWrapper.getAutoSizePadding(); if (typeof autoSizePadding !== 'number' || autoSizePadding < 0) { autoSizePadding = 4; } return dummyContainerWidth + autoSizePadding; }; AutoWidthCalculator.prototype.getHeaderCellForColumn = function (column) { var renderedHeaderCell = null; // find the rendered header cell this.headerRenderer.forEachHeaderElement(function (headerElement) { if (headerElement instanceof renderedHeaderCell_1.RenderedHeaderCell) { var currentCell = headerElement; if (currentCell.getColumn() === column) { renderedHeaderCell = currentCell; } } }); return renderedHeaderCell; }; AutoWidthCalculator.prototype.putRowCellsIntoDummyContainer = function (column, eDummyContainer) { var _this = this; var eOriginalCells = this.rowRenderer.getAllCellsForColumn(column); eOriginalCells.forEach(function (eCell, index) { _this.cloneItemIntoDummy(eCell, eDummyContainer); }); }; AutoWidthCalculator.prototype.cloneItemIntoDummy = function (eCell, eDummyContainer) { // make a deep clone of the cell var eCellClone = eCell.cloneNode(true); // the original has a fixed width, we remove this to allow the natural width based on content eCellClone.style.width = ''; // the original has position = absolute, we need to remove this so it's positioned normally eCellClone.style.position = 'static'; eCellClone.style.left = ''; // we put the cell into a containing div, as otherwise the cells would just line up // on the same line, standard flow layout, by putting them into divs, they are laid // out one per line var eCloneParent = document.createElement('div'); // table-row, so that each cell is on a row. i also tried display='block', but this // didn't work in IE eCloneParent.style.display = 'table-row'; // the twig on the branch, the branch on the tree, the tree in the hole, // the hole in the bog, the bog in the clone, the clone in the parent, // the parent in the dummy, and the dummy down in the vall-e-ooo, OOOOOOOOO! Oh row the rattling bog.... eCloneParent.appendChild(eCellClone); eDummyContainer.appendChild(eCloneParent); }; __decorate([ context_2.Autowired('rowRenderer'), __metadata('design:type', rowRenderer_1.RowRenderer) ], AutoWidthCalculator.prototype, "rowRenderer", void 0); __decorate([ context_2.Autowired('headerRenderer'), __metadata('design:type', headerRenderer_1.HeaderRenderer) ], AutoWidthCalculator.prototype, "headerRenderer", void 0); __decorate([ context_2.Autowired('gridPanel'), __metadata('design:type', gridPanel_1.GridPanel) ], AutoWidthCalculator.prototype, "gridPanel", void 0); __decorate([ context_2.Autowired('gridOptionsWrapper'), __metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper) ], AutoWidthCalculator.prototype, "gridOptionsWrapper", void 0); AutoWidthCalculator = __decorate([ context_1.Bean('autoWidthCalculator'), __metadata('design:paramtypes', []) ], AutoWidthCalculator); return AutoWidthCalculator; })(); exports.AutoWidthCalculator = AutoWidthCalculator; ```
Augusto Graziani (4 May 1933 – 5 January 2014) was an Italian economist, Professor in Political Economy at University la Sapienza, most known for his contribution to monetary economics in founding monetary circuit theory. See also Endogenous money Further reading Scientific Profile in augustograziani.com Complete work in augustograziani.com Brief biography. Philip Arestis, Malcolm C. Sawyer, A biographical dictionary of dissenting economists, "Augusto GRAZIANI" (biography), pp.Β 254–263. Augusto Graziani, "The theory of the monetary circuit", Economies et Societes, vol. 24, nΒ°. 6, pp.Β 7‐36 (1990). Augusto Graziani, "The theory of the monetary circuit", in The money supply in the economic process: a post Keynesian perspective, vol. 60, eds M. Musella and C. Panico, Elgar Reference Collection, International Library of Critical Writings in Economics, Aldershot, U.K. (1995) Augusto Graziani, "The Marxist Theory of Money". International Journal of Political Economy, vol. 27, nΒ° 2, Marxian Theory: The Italian Debate (Summer, 1997), pp.Β 26–50. Augusto Graziani, The Monetary Theory of Production, Cambridge University Press, Cambridge, UK (2003). References Monetary economists Italian economists Post-Keynesian economists 1933 births 2014 deaths
The Taipei Railway Workshop () was the largest railway workshop of the Taiwan Railways Administration. For decades it manufactured and maintained thousands of railway vehicles. The workshop was established in 1935 to replace the original workshop, which had become inadequate. It was the largest railway workshop ever built in Taiwan. The Governor-General of Taiwan recognized its establishment as a celebration of the Empire of Japan's rule of Taiwan for 40 years. The 16.82-hectare site on Civic Boulevard was the largest and oldest kind on the island. It closed in 2012. It was constructed in 1930 and featured distinctive structures such as a 168-meter-long train assembly shed. The operation was transferred to TRA Fugang Vehicle Depot (Chinese: ). The workshop was recognized as an "official national historic site" in 2015. The government of Taiwan says it is planning to transform the facility into a railway museum. In popular culture The Taipei Railway Workshop was featured in the 2013 Jay Chou film The Rooftop and in the 2014 Luc Besson film Lucy. Gallery Transportation The Taipei Railway Workshop is accessible within walking distance northeast from Sun Yat-sen Memorial Hall Station of the Taipei Metro. References 1935 establishments in Taiwan Executive Yuan Railway workshops in Taiwan Defunct railway workshops 3 ft 6 in gauge railways in Taiwan National monuments of Taiwan
A lead (, rhymes with "reed") is a large fracture within an expanse of sea ice, defining a linear area of open water that can be used for navigation purposes. Leads vary in width from meters to hundreds of meters. As is the case for polynyas (another sea ice feature involving open water), leads allow the direct interaction between the atmosphere and the ocean, and are important for Arctic sea ice ecology. Additionally it has been lately found that ice leads contribute significantly to the amount of mercury deposited onto surface and leaked into the ocean. If the air is cold enough (typically in the winter), the water within a lead quickly refreezes, such that in many cases, leads are partly or entirely covered by a thin layer of new ice. Differences between leads and polynyas Unlike polynyas, which tend to occur, and remain, at a given location, leads are transient features that can form anywhere in an ice-covered ocean. Moreover, while the origin of polynyas is linked with either warm air current circulation from the coastline or a warm water upwelling, the driving force behind lead formation is a state of stress, either wind- or current-induced, within the plane of the ice. Lead formation is therefore tied in with synoptic-scale weather patterns, typically lasting a few days. Also, because the open water within a lead tends to quickly refreeze, the contribution of leads to heat exchange and water vapour output to the atmosphere is significantly less than that of polynyas, where refreezing of the open water is prevented. Formation Sea ice is often classified according to whether or not it is attached (or frozen) to the shoreline. If attached, it is called land fast ice. Otherwise, it is called drift ice and is free to move with currents and winds. This is why leads typically belong to the drift ice zone. They are seen as a stress relieving mechanism, in response to divergent current flows or the effects of wind. Leads are cracks or fissures that initiate inside an otherwise continuous sea ice cover, and open up progressively afterward. They are linear features, though generally not rigorously straight, as they may comprise any number of short offsets at an angle with the general trend of the initial crack. This crack may cut right across both thin and thick ice. Because leads are associated with the initial break up of an ice cover, they open the way to various dynamic processes that can take place afterward, involving the interaction between individual floes, such as the formation of pressure ridges. Depending on the state of stress within the drift zone, leads may also close up. As the two sides converge back toward each other, this can lead to finger rafting of the new ice inside the lead. Ice formation in leads Once a crack occurs within the ice cover and begins to expand to make up a lead, the open water inside the lead is exposed to cold air temperatures and will freeze. Because wind fetch inside a lead is typically very short, wave action is considerably reduced. Ice growth, therefore, takes place in a low-energy regime environment. Following a stage of frazil ice formation, which sometimes results from seeding by snow crystals, the resulting thin ice skim is followed by the growth of congelation ice. In windier regions, as in the Southern Ocean, frazil ice accumulation may occur along the downwind side of leads. If the ice on that side is thin, the frazil may be driven below that ice (resulting in a complex interlayering pattern). Leads affect global water circulation. As the ice begins to form inside a lead, it incorporates some of the salt in the seawater but rejects most of it similar to the growth of other ice types. This brine then sinks, inducing convective processes in the water column below. During warm air intrusions, refrozen leads can accumulate a substantial amount of drifting snow, resulting in over 50% snow mass fraction of lead ice and potential contribution to snow losses in the spring season. Types There are a few types of leads: A blind lead is a lead that is closed off – both ends terminate within the drift ice zone. A flaw lead is a lead that forms between the fast ice zone and the drift ice zone. An open lead is a lead that connects two bodies of open water – the term is also used for a lead in which open water is found. A shore lead is a lead that forms between the drift ice zone and the shore. See also References
```python from unittest import mock from boto3 import client from moto import mock_aws from tests.providers.aws.utils import ( AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1, set_mocked_aws_provider, ) class Test_ec2_securitygroup_with_many_ingress_egress_rules: @mock_aws def test_ec2_default_sgs(self): # Create EC2 Mocked Resources ec2_client = client("ec2", region_name=AWS_REGION_US_EAST_1) ec2_client.create_vpc(CidrBlock="10.0.0.0/16") from prowler.providers.aws.services.ec2.ec2_service import EC2 aws_provider = set_mocked_aws_provider( [AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1] ) aws_provider._audit_config = {"max_security_group_rules": 50} with mock.patch( "prowler.providers.common.provider.Provider.get_global_provider", return_value=aws_provider, ), mock.patch( "prowler.providers.aws.services.ec2.ec2_securitygroup_with_many_ingress_egress_rules.ec2_securitygroup_with_many_ingress_egress_rules.ec2_client", new=EC2(aws_provider), ): # Test Check from prowler.providers.aws.services.ec2.ec2_securitygroup_with_many_ingress_egress_rules.ec2_securitygroup_with_many_ingress_egress_rules import ( ec2_securitygroup_with_many_ingress_egress_rules, ) check = ec2_securitygroup_with_many_ingress_egress_rules() result = check.execute() # One default sg per region assert len(result) == 3 # All are compliant by default assert result[0].status == "PASS" assert result[1].status == "PASS" assert result[2].status == "PASS" @mock_aws def test_ec2_non_compliant_default_sg(self): # Create EC2 Mocked Resources ec2_client = client("ec2", region_name=AWS_REGION_US_EAST_1) ec2_client.create_vpc(CidrBlock="10.0.0.0/16") default_sg = ec2_client.describe_security_groups(GroupNames=["default"])[ "SecurityGroups" ][0] default_sg_id = default_sg["GroupId"] default_sg_name = default_sg["GroupName"] for i in range(60): ec2_client.authorize_security_group_ingress( GroupId=default_sg_id, IpPermissions=[ { "IpProtocol": "tcp", "FromPort": i, "ToPort": i, "IpRanges": [{"CidrIp": "0.0.0.0/0"}], } ], ) from prowler.providers.aws.services.ec2.ec2_service import EC2 aws_provider = set_mocked_aws_provider( [AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1] ) aws_provider._audit_config = {"max_security_group_rules": 50} with mock.patch( "prowler.providers.common.provider.Provider.get_global_provider", return_value=aws_provider, ), mock.patch( "prowler.providers.aws.services.ec2.ec2_securitygroup_with_many_ingress_egress_rules.ec2_securitygroup_with_many_ingress_egress_rules.ec2_client", new=EC2(aws_provider), ): # Test Check from prowler.providers.aws.services.ec2.ec2_securitygroup_with_many_ingress_egress_rules.ec2_securitygroup_with_many_ingress_egress_rules import ( ec2_securitygroup_with_many_ingress_egress_rules, ) check = ec2_securitygroup_with_many_ingress_egress_rules() result = check.execute() # One default sg per region assert len(result) == 3 # Search changed sg for sg in result: if sg.resource_id == default_sg_id: assert sg.status == "FAIL" assert sg.region == AWS_REGION_US_EAST_1 assert ( sg.status_extended == f"Security group {default_sg_name} ({default_sg_id}) has 60 inbound rules and 1 outbound rules." ) assert ( sg.resource_arn == f"arn:{aws_provider.identity.partition}:ec2:{AWS_REGION_US_EAST_1}:{aws_provider.identity.account}:security-group/{default_sg_id}" ) assert sg.resource_details == default_sg_name assert sg.resource_tags == [] @mock_aws def test_ec2_compliant_default_sg(self): # Create EC2 Mocked Resources ec2_client = client("ec2", region_name=AWS_REGION_US_EAST_1) ec2_client.create_vpc(CidrBlock="10.0.0.0/16") default_sg = ec2_client.describe_security_groups(GroupNames=["default"])[ "SecurityGroups" ][0] default_sg_id = default_sg["GroupId"] default_sg_name = default_sg["GroupName"] ec2_client.authorize_security_group_ingress( GroupId=default_sg_id, IpPermissions=[ { "IpProtocol": "tcp", "FromPort": 23, "ToPort": 23, "IpRanges": [{"CidrIp": "123.123.123.123/32"}], } ], ) from prowler.providers.aws.services.ec2.ec2_service import EC2 aws_provider = set_mocked_aws_provider( [AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1] ) aws_provider._audit_config = {"max_security_group_rules": 50} with mock.patch( "prowler.providers.common.provider.Provider.get_global_provider", return_value=aws_provider, ), mock.patch( "prowler.providers.aws.services.ec2.ec2_securitygroup_with_many_ingress_egress_rules.ec2_securitygroup_with_many_ingress_egress_rules.ec2_client", new=EC2(aws_provider), ): # Test Check from prowler.providers.aws.services.ec2.ec2_securitygroup_with_many_ingress_egress_rules.ec2_securitygroup_with_many_ingress_egress_rules import ( ec2_securitygroup_with_many_ingress_egress_rules, ) check = ec2_securitygroup_with_many_ingress_egress_rules() result = check.execute() # One default sg per region assert len(result) == 3 # Search changed sg for sg in result: if sg.resource_id == default_sg_id: assert sg.status == "PASS" assert sg.region == AWS_REGION_US_EAST_1 assert ( sg.status_extended == f"Security group {default_sg_name} ({default_sg_id}) has 1 inbound rules and 1 outbound rules." ) assert ( sg.resource_arn == f"arn:{aws_provider.identity.partition}:ec2:{AWS_REGION_US_EAST_1}:{aws_provider.identity.account}:security-group/{default_sg_id}" ) assert sg.resource_details == default_sg_name assert sg.resource_tags == [] ```
```c++ #include <AggregateFunctions/AggregateFunctionFactory.h> #include <Core/Settings.h> #include <DataTypes/DataTypeDate.h> #include <DataTypes/DataTypeDateTime.h> #include <DataTypes/DataTypeNullable.h> #include <Interpreters/Context.h> #include <IO/ReadHelpers.h> #include <IO/WriteHelpers.h> #include <IO/ReadBufferFromString.h> #include <IO/WriteBufferFromString.h> #include <DataTypes/DataTypesNumber.h> #include <Columns/ColumnString.h> #include <Columns/ColumnVector.h> #include <Columns/ColumnNullable.h> #include <Common/ArenaAllocator.h> #include <Common/assert_cast.h> #include <AggregateFunctions/IAggregateFunction.h> #include <bitset> namespace DB { constexpr size_t max_events_size = 64; constexpr size_t min_required_args = 3; namespace ErrorCodes { extern const int ILLEGAL_TYPE_OF_ARGUMENT; extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; extern const int BAD_ARGUMENTS; extern const int UNKNOWN_AGGREGATE_FUNCTION; extern const int TOO_LARGE_ARRAY_SIZE; } namespace { enum class SequenceDirection : uint8_t { Forward, Backward, }; enum SequenceBase : uint8_t { Head, Tail, FirstMatch, LastMatch, }; /// This is for security const UInt64 max_node_size_deserialize = 0xFFFFFF; /// NodeBase used to implement a linked list for storage of SequenceNextNodeImpl template <typename Node, size_t MaxEventsSize> struct NodeBase { UInt64 size; /// size of payload DataTypeDateTime::FieldType event_time; std::bitset<MaxEventsSize> events_bitset; bool can_be_base; char * data() { return reinterpret_cast<char *>(this) + sizeof(Node); } const char * data() const { return reinterpret_cast<const char *>(this) + sizeof(Node); } Node * clone(Arena * arena) const { return reinterpret_cast<Node *>( const_cast<char *>(arena->alignedInsert(reinterpret_cast<const char *>(this), sizeof(Node) + size, alignof(Node)))); } void write(WriteBuffer & buf) const { writeVarUInt(size, buf); buf.write(data(), size); writeBinary(event_time, buf); UInt64 ulong_bitset = events_bitset.to_ulong(); writeBinary(ulong_bitset, buf); writeBinary(can_be_base, buf); } static Node * read(ReadBuffer & buf, Arena * arena) { UInt64 size; readVarUInt(size, buf); if (unlikely(size > max_node_size_deserialize)) throw Exception(ErrorCodes::TOO_LARGE_ARRAY_SIZE, "Too large node state size"); Node * node = reinterpret_cast<Node *>(arena->alignedAlloc(sizeof(Node) + size, alignof(Node))); node->size = size; buf.readStrict(node->data(), size); readBinary(node->event_time, buf); UInt64 ulong_bitset; readBinary(ulong_bitset, buf); node->events_bitset = ulong_bitset; readBinary(node->can_be_base, buf); return node; } }; /// It stores String, timestamp, bitset of matched events. template <size_t MaxEventsSize> struct NodeString : public NodeBase<NodeString<MaxEventsSize>, MaxEventsSize> { using Node = NodeString<MaxEventsSize>; static Node * allocate(const IColumn & column, size_t row_num, Arena * arena) { StringRef string = assert_cast<const ColumnString &>(column).getDataAt(row_num); Node * node = reinterpret_cast<Node *>(arena->alignedAlloc(sizeof(Node) + string.size, alignof(Node))); node->size = string.size; memcpy(node->data(), string.data, string.size); return node; } void insertInto(IColumn & column) { assert_cast<ColumnString &>(column).insertData(this->data(), this->size); } bool compare(const Node * rhs) const { auto cmp = strncmp(this->data(), rhs->data(), std::min(this->size, rhs->size)); return (cmp == 0) ? this->size < rhs->size : cmp < 0; } }; /// TODO : Support other types than string template <typename Node> struct SequenceNextNodeGeneralData { using Allocator = MixedAlignedArenaAllocator<alignof(Node *), 4096>; using Array = PODArray<Node *, 32, Allocator>; Array value; bool sorted = false; struct Comparator final { bool operator()(const Node * lhs, const Node * rhs) const { return lhs->event_time == rhs->event_time ? lhs->compare(rhs) : lhs->event_time < rhs->event_time; } }; void sort() { if (!sorted) { std::stable_sort(std::begin(value), std::end(value), Comparator{}); sorted = true; } } }; /// Implementation of sequenceFirstNode template <typename T, typename Node> class SequenceNextNodeImpl final : public IAggregateFunctionDataHelper<SequenceNextNodeGeneralData<Node>, SequenceNextNodeImpl<T, Node>> { using Self = SequenceNextNodeImpl<T, Node>; using Data = SequenceNextNodeGeneralData<Node>; static Data & data(AggregateDataPtr __restrict place) { return *reinterpret_cast<Data *>(place); } static const Data & data(ConstAggregateDataPtr __restrict place) { return *reinterpret_cast<const Data *>(place); } static constexpr size_t base_cond_column_idx = 2; static constexpr size_t event_column_idx = 1; SequenceBase seq_base_kind; SequenceDirection seq_direction; const size_t min_required_args; DataTypePtr & data_type; UInt8 events_size; UInt64 max_elems; public: SequenceNextNodeImpl( const DataTypePtr & data_type_, const DataTypes & arguments, const Array & parameters_, SequenceBase seq_base_kind_, SequenceDirection seq_direction_, size_t min_required_args_, UInt64 max_elems_ = std::numeric_limits<UInt64>::max()) : IAggregateFunctionDataHelper<SequenceNextNodeGeneralData<Node>, Self>(arguments, parameters_, data_type_) , seq_base_kind(seq_base_kind_) , seq_direction(seq_direction_) , min_required_args(min_required_args_) , data_type(this->argument_types[0]) , events_size(arguments.size() - min_required_args) , max_elems(max_elems_) { } String getName() const override { return "sequenceNextNode"; } bool haveSameStateRepresentationImpl(const IAggregateFunction & rhs) const override { return this->getName() == rhs.getName() && this->haveEqualArgumentTypes(rhs); } void insert(Data & a, const Node * v, Arena * arena) const { ++a.total_values; a.value.push_back(v->clone(arena), arena); } void create(AggregateDataPtr __restrict place) const override /// NOLINT { new (place) Data; } void add(AggregateDataPtr __restrict place, const IColumn ** columns, size_t row_num, Arena * arena) const override { Node * node = Node::allocate(*columns[event_column_idx], row_num, arena); const auto timestamp = assert_cast<const ColumnVector<T> *>(columns[0])->getData()[row_num]; /// The events_bitset variable stores matched events in the form of bitset. /// Each Nth-bit indicates that the Nth-event are matched. /// For example, event1 and event3 is matched then the values of events_bitset is 0x00000005. /// 0x00000000 /// + 1 (bit of event1) /// + 4 (bit of event3) node->events_bitset.reset(); for (UInt8 i = 0; i < events_size; ++i) if (assert_cast<const ColumnVector<UInt8> *>(columns[min_required_args + i])->getData()[row_num]) node->events_bitset.set(i); node->event_time = static_cast<DataTypeDateTime::FieldType>(timestamp); node->can_be_base = assert_cast<const ColumnVector<UInt8> *>(columns[base_cond_column_idx])->getData()[row_num]; data(place).value.push_back(node, arena); } void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, Arena * arena) const override { if (data(rhs).value.empty()) return; if (data(place).value.size() >= max_elems) return; auto & a = data(place).value; auto & b = data(rhs).value; const auto a_size = a.size(); const UInt64 new_elems = std::min(data(rhs).value.size(), static_cast<size_t>(max_elems) - data(place).value.size()); for (UInt64 i = 0; i < new_elems; ++i) a.push_back(b[i]->clone(arena), arena); /// Either sort whole container or do so partially merging ranges afterwards using Comparator = typename SequenceNextNodeGeneralData<Node>::Comparator; if (!data(place).sorted && !data(rhs).sorted) std::stable_sort(std::begin(a), std::end(a), Comparator{}); else { const auto begin = std::begin(a); const auto middle = std::next(begin, a_size); const auto end = std::end(a); if (!data(place).sorted) std::stable_sort(begin, middle, Comparator{}); if (!data(rhs).sorted) std::stable_sort(middle, end, Comparator{}); std::inplace_merge(begin, middle, end, Comparator{}); } data(place).sorted = true; } void serialize(ConstAggregateDataPtr __restrict place, WriteBuffer & buf, std::optional<size_t> /* version */) const override { /// Temporarily do a const_cast to sort the values. It helps to reduce the computational burden on the initiator node. this->data(const_cast<AggregateDataPtr>(place)).sort(); writeBinary(data(place).sorted, buf); auto & value = data(place).value; size_t size = std::min(static_cast<size_t>(events_size + 1), value.size()); switch (seq_base_kind) { case SequenceBase::Head: writeVarUInt(size, buf); for (size_t i = 0; i < size; ++i) value[i]->write(buf); break; case SequenceBase::Tail: writeVarUInt(size, buf); for (size_t i = 0; i < size; ++i) value[value.size() - size + i]->write(buf); break; case SequenceBase::FirstMatch: case SequenceBase::LastMatch: writeVarUInt(value.size(), buf); for (auto & node : value) node->write(buf); break; } } void deserialize(AggregateDataPtr __restrict place, ReadBuffer & buf, std::optional<size_t> /* version */, Arena * arena) const override { readBinary(data(place).sorted, buf); UInt64 size; readVarUInt(size, buf); if (unlikely(size == 0)) return; if (unlikely(size > max_node_size_deserialize)) throw Exception(ErrorCodes::TOO_LARGE_ARRAY_SIZE, "Too large array size (maximum: {})", max_node_size_deserialize); auto & value = data(place).value; value.resize(size, arena); for (UInt64 i = 0; i < size; ++i) value[i] = Node::read(buf, arena); } std::optional<size_t> getBaseIndex(Data & data) const { if (data.value.size() == 0) return {}; switch (seq_base_kind) { case SequenceBase::Head: if (data.value[0]->can_be_base) return 0; break; case SequenceBase::Tail: if (data.value[data.value.size() - 1]->can_be_base) return data.value.size() - 1; break; case SequenceBase::FirstMatch: for (size_t i = 0; i < data.value.size(); ++i) { if (data.value[i]->events_bitset.test(0) && data.value[i]->can_be_base) return i; } break; case SequenceBase::LastMatch: for (size_t i = 0; i < data.value.size(); ++i) { auto reversed_i = data.value.size() - i - 1; if (data.value[reversed_i]->events_bitset.test(0) && data.value[reversed_i]->can_be_base) return reversed_i; } break; } return {}; } /// This method returns an index of next node that matched the events. /// matched events in the chain of events are represented as a bitmask. /// The first matched event is 0x00000001, the second one is 0x00000002, the third one is 0x00000004, and so on. UInt32 getNextNodeIndex(Data & data) const { const UInt32 unmatched_idx = static_cast<UInt32>(data.value.size()); if (data.value.size() <= events_size) return unmatched_idx; data.sort(); std::optional<size_t> base_opt = getBaseIndex(data); if (!base_opt.has_value()) return unmatched_idx; UInt32 base = static_cast<UInt32>(base_opt.value()); if (events_size == 0) return data.value.size() > 0 ? base : unmatched_idx; UInt32 i = 0; switch (seq_direction) { case SequenceDirection::Forward: for (i = 0; i < events_size && base + i < data.value.size(); ++i) if (!data.value[base + i]->events_bitset.test(i)) break; return (i == events_size) ? base + i : unmatched_idx; case SequenceDirection::Backward: for (i = 0; i < events_size && i < base; ++i) if (!data.value[base - i]->events_bitset.test(i)) break; return (i == events_size) ? base - i : unmatched_idx; } } void insertResultInto(AggregateDataPtr __restrict place, IColumn & to, Arena *) const override { auto & value = data(place).value; UInt32 event_idx = getNextNodeIndex(this->data(place)); if (event_idx < value.size()) { ColumnNullable & to_concrete = assert_cast<ColumnNullable &>(to); value[event_idx]->insertInto(to_concrete.getNestedColumn()); to_concrete.getNullMapData().push_back(0); } else { to.insertDefault(); } } bool allocatesMemoryInArena() const override { return true; } }; template <typename T> inline AggregateFunctionPtr createAggregateFunctionSequenceNodeImpl( const DataTypePtr data_type, const DataTypes & argument_types, const Array & parameters, SequenceDirection direction, SequenceBase base) { return std::make_shared<SequenceNextNodeImpl<T, NodeString<max_events_size>>>( data_type, argument_types, parameters, base, direction, min_required_args); } AggregateFunctionPtr createAggregateFunctionSequenceNode(const std::string & name, const DataTypes & argument_types, const Array & parameters, const Settings * settings) { if (settings == nullptr || !settings->allow_experimental_funnel_functions) { throw Exception(ErrorCodes::UNKNOWN_AGGREGATE_FUNCTION, "Aggregate function {} is experimental. " "Set `allow_experimental_funnel_functions` setting to enable it", name); } if (parameters.size() < 2) throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Aggregate function '{}' requires 2 parameters (direction, head)", name); auto expected_param_type = Field::Types::Which::String; if (parameters.at(0).getType() != expected_param_type || parameters.at(1).getType() != expected_param_type) throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Aggregate function '{}' requires 'String' parameters", name); String param_dir = parameters.at(0).safeGet<String>(); std::unordered_map<std::string, SequenceDirection> seq_dir_mapping{ {"forward", SequenceDirection::Forward}, {"backward", SequenceDirection::Backward}, }; if (!seq_dir_mapping.contains(param_dir)) throw Exception(ErrorCodes::BAD_ARGUMENTS, "Aggregate function {} doesn't support a parameter: {}", name, param_dir); SequenceDirection direction = seq_dir_mapping[param_dir]; String param_base = parameters.at(1).safeGet<String>(); std::unordered_map<std::string, SequenceBase> seq_base_mapping{ {"head", SequenceBase::Head}, {"tail", SequenceBase::Tail}, {"first_match", SequenceBase::FirstMatch}, {"last_match", SequenceBase::LastMatch}, }; if (!seq_base_mapping.contains(param_base)) throw Exception(ErrorCodes::BAD_ARGUMENTS, "Aggregate function {} doesn't support a parameter: {}", name, param_base); SequenceBase base = seq_base_mapping[param_base]; if ((base == SequenceBase::Head && direction == SequenceDirection::Backward) || (base == SequenceBase::Tail && direction == SequenceDirection::Forward)) throw Exception(ErrorCodes::BAD_ARGUMENTS, "Invalid argument combination of '{}' with '{}'", param_base, param_dir); if (argument_types.size() < min_required_args) throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Aggregate function {} requires at least {} arguments.", name, toString(min_required_args)); bool is_base_match_type = base == SequenceBase::FirstMatch || base == SequenceBase::LastMatch; if (is_base_match_type && argument_types.size() < min_required_args + 1) throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Aggregate function {} requires at least {} arguments when base is first_match or last_match.", name, toString(min_required_args + 1)); if (argument_types.size() > max_events_size + min_required_args) throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Aggregate function '{}' requires at most {} (timestamp, value_column, ...{} events) arguments.", name, max_events_size + min_required_args, max_events_size); if (const auto * cond_arg = argument_types[2].get(); cond_arg && !isUInt8(cond_arg)) throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Illegal type {} of third argument of aggregate function {}, " "must be UInt8", cond_arg->getName(), name); for (const auto i : collections::range(min_required_args, argument_types.size())) { const auto * cond_arg = argument_types[i].get(); if (!isUInt8(cond_arg)) throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Illegal type '{}' of {} argument of aggregate function '{}', must be UInt8", cond_arg->getName(), i + 1, name); } if (WhichDataType(argument_types[1].get()).idx != TypeIndex::String) throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Illegal type {} of second argument of aggregate function {}, must be String", argument_types[1].get()->getName(), name); DataTypePtr data_type = makeNullable(argument_types[1]); WhichDataType timestamp_type(argument_types[0].get()); if (timestamp_type.idx == TypeIndex::UInt8) return createAggregateFunctionSequenceNodeImpl<UInt8>(data_type, argument_types, parameters, direction, base); if (timestamp_type.idx == TypeIndex::UInt16) return createAggregateFunctionSequenceNodeImpl<UInt16>(data_type, argument_types, parameters, direction, base); if (timestamp_type.idx == TypeIndex::UInt32) return createAggregateFunctionSequenceNodeImpl<UInt32>(data_type, argument_types, parameters, direction, base); if (timestamp_type.idx == TypeIndex::UInt64) return createAggregateFunctionSequenceNodeImpl<UInt64>(data_type, argument_types, parameters, direction, base); if (timestamp_type.isDate()) return createAggregateFunctionSequenceNodeImpl<DataTypeDate::FieldType>(data_type, argument_types, parameters, direction, base); if (timestamp_type.isDateTime()) return createAggregateFunctionSequenceNodeImpl<DataTypeDateTime::FieldType>(data_type, argument_types, parameters, direction, base); throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Illegal type {} of first argument of aggregate function {}, must " "be Unsigned Number, Date, DateTime", argument_types.front().get()->getName(), name); } } void registerAggregateFunctionSequenceNextNode(AggregateFunctionFactory & factory) { AggregateFunctionProperties properties = { .returns_default_when_only_null = true, .is_order_dependent = false }; factory.registerFunction("sequenceNextNode", { createAggregateFunctionSequenceNode, properties }); } } ```
Lewis Darnell Tillman (born April 16, 1966) is a former professional American football running back in the National Football League. He played for seven seasons for the New York Giants and the Chicago Bears. He played college football at Jackson State University and was drafted in the fourth round of the 1989 NFL Draft. On January 31, 2012, it was announced that Tillman would be the new running backs coach for the Texas Southern Tigers. NFL Running Back 7yrs New York Giants 5 years (1989-1993) Chicago Bears 2 years (1994-1995) Tillman was drafted in the 4th round in 1989 by the NY Giants. He spent five years as a running back and special teams player for the Giants. He also was part the NY Giants Super Bowl Championship team in 1991. He spent two seasons with the Chicago Bears where he was the leading rusher in 1994. Prior to the NFL, Tillman enjoyed a great career at Jackson State University where he broke Walter Payton's school career rushing record with 3,989 yards. He was a two-time Kodak All-American and Walter Camp All-American. In addition to being named the SWAC Offensive Player of the Year in 1987, he won the MVP award in both the East-West Shrine and Blue-Gray All-Star games. Since retiring from the NFL, Tillman has coached for 18 years on the high school and collegiate level. References 1966 births Living people People from Hazlehurst, Mississippi American football running backs Jackson State Tigers football players New York Giants players Chicago Bears players
Drala may refer to: Drala, the Fijian name for Erythrina variegata Drala, a class of minor deity in Tibetan folk religion Drala, music composed to accompany hatha yoga
```smalltalk /* * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * * path_to_url * */ using System.Text; using Xunit; using Piranha.Extend; using Piranha.Models; using Piranha.Repositories; using Piranha.Runtime; using Piranha.Services; namespace Piranha.Tests; public class Fields : BaseTests { [FieldType(Name = "First", Shorthand = "1")] public class MyFirstField : Extend.Fields.SimpleField<string> { } [FieldType(Name = "Second")] public class MySecondField : Extend.Fields.SimpleField<string> { } [FieldType(Name = "Third")] public class MyThirdField : Extend.Fields.SimpleField<string> { } private readonly AppFieldList fields = new AppFieldList(); public enum MyEnum { Value1, Value2 } /// <summary> /// Sets up & initializes the tests. /// </summary> protected override void Init() { using (var api = CreateApi()) { Piranha.App.Init(api); Piranha.App.Fields.Register<MyFirstField>(); fields.Register<MyFirstField>(); fields.Register<MyThirdField>(); } } /// <summary> /// Cleans up any possible data and resources /// created by the test. /// </summary> protected override void Cleanup() { } [Fact] public void RegisterSelect() { Piranha.App.Fields.RegisterSelect<MyEnum>(); fields.RegisterSelect<MyEnum>(); } [Fact] public void GetByType() { var field = Piranha.App.Fields.GetByType(typeof(Extend.Fields.HtmlField)); Assert.NotNull(field); Assert.Equal("Html", field.Name); } [Fact] public void GetByTypeLocal() { var field = fields.GetByType(typeof(MyFirstField)); Assert.NotNull(field); Assert.Equal("First", field.Name); } [Fact] public void GetByTypeName() { var field = Piranha.App.Fields.GetByType(typeof(Extend.Fields.HtmlField).FullName); Assert.NotNull(field); Assert.Equal("Html", field.Name); } [Fact] public void GetByTypeNameLocal() { var field = fields.GetByType(typeof(MyFirstField).FullName); Assert.NotNull(field); Assert.Equal("First", field.Name); } [Fact] public void GetByShorthand() { var field = Piranha.App.Fields.GetByShorthand("Html"); Assert.NotNull(field); Assert.Equal("Html", field.Name); } [Fact] public void GetByShorthandLocal() { var field = fields.GetByShorthand("1"); Assert.NotNull(field); Assert.Equal("First", field.Name); } [Fact] public void Register() { var count = Piranha.App.Fields.Count(); Piranha.App.Fields.Register<MySecondField>(); Assert.Equal(count + 1, Piranha.App.Fields.Count()); } [Fact] public void RegisterLocal() { var count = fields.Count(); fields.Register<MySecondField>(); Assert.Equal(count + 1, fields.Count()); } [Fact] public void UnRegister() { var count = Piranha.App.Fields.Count(); Piranha.App.Fields.UnRegister<MyFirstField>(); Assert.Equal(count - 1, Piranha.App.Fields.Count()); } [Fact] public void UnRegisterLocal() { var count = fields.Count(); fields.UnRegister<MyThirdField>(); Assert.Equal(count - 1, fields.Count()); } [Fact] public void Enumerate() { foreach (var field in Piranha.App.Fields) { Assert.NotNull(field); } } [Fact] public void EnumerateLocal() { foreach (var field in fields) { Assert.NotNull(field); } } [Fact] public void CheckBoxFieldConversions() { var value = true; Piranha.Extend.Fields.CheckBoxField field = value; Assert.Equal(value, field.Value); } [Fact] public void CheckBoxFieldEquals() { var field1 = new Piranha.Extend.Fields.CheckBoxField { Value = true }; var field2 = new Piranha.Extend.Fields.CheckBoxField { Value = true }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void CheckBoxFieldNotEquals() { var field1 = new Piranha.Extend.Fields.CheckBoxField { Value = true }; var field2 = new Piranha.Extend.Fields.CheckBoxField { Value = false }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void ColorFieldConversions() { var inStr = "#007eaa"; Piranha.Extend.Fields.ColorField field = inStr; Assert.Equal(inStr, field.Value); string outStr = field; Assert.Equal(inStr, outStr); } [Fact] public void ColorFieldEquals() { var field1 = new Piranha.Extend.Fields.ColorField { Value = "#007eaa" }; var field2 = new Piranha.Extend.Fields.ColorField { Value = "#007eaa" }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void ColorFieldNotEquals() { var field1 = new Piranha.Extend.Fields.ColorField { Value = "#007eaa" }; var field2 = new Piranha.Extend.Fields.ColorField { Value = null }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void DateFieldConversions() { var now = DateTime.Now; Piranha.Extend.Fields.DateField field = now; Assert.Equal(now, field.Value); } [Fact] public void DateFieldEquals() { var field1 = new Piranha.Extend.Fields.DateField { Value = new DateTime(2018, 1, 1) }; var field2 = new Piranha.Extend.Fields.DateField { Value = new DateTime(2018, 1, 1) }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void DateFieldNotEquals() { var field1 = new Piranha.Extend.Fields.DateField { Value = new DateTime(2018, 1, 1) }; var field2 = new Piranha.Extend.Fields.DateField { Value = new DateTime(2017, 1, 1) }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void HtmlFieldConversions() { var str = "<p>This is a paragraph</p>"; Piranha.Extend.Fields.HtmlField field = str; Assert.Equal(str, field.Value); string output = field; Assert.Equal(str, output); } [Fact] public void HtmlFieldEquals() { var field1 = new Piranha.Extend.Fields.HtmlField { Value = "Sollicitudin Justo Tristique" }; var field2 = new Piranha.Extend.Fields.HtmlField { Value = "Sollicitudin Justo Tristique" }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void HtmlFieldNotEquals() { var field1 = new Piranha.Extend.Fields.HtmlField { Value = "Sollicitudin Justo Tristique" }; var field2 = new Piranha.Extend.Fields.HtmlField { Value = "Sollicitudin Tristique" }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void HtmlFieldTitle() { Piranha.Extend.Fields.HtmlField field = "<p>Html value</p>"; Assert.Equal("Html value", field.GetTitle()); } [Fact] public void HtmlFieldTitleMaxLength() { var sb = new StringBuilder(); for (var n = 0; n < 10; n++) { sb.Append("NineChars"); } Piranha.Extend.Fields.HtmlField field = sb.ToString(); Assert.Equal(43, field.GetTitle().Length); } [Fact] public void ImageFieldConversions() { var media = new Media { Id = Guid.NewGuid() }; Piranha.Extend.Fields.ImageField field = media; Assert.Equal(media.Id, field.Id.Value); } [Fact] public async Task ImageFieldInitMissing() { using (var api = CreateApi()) { var field = new Piranha.Extend.Fields.ImageField { Id = Guid.NewGuid() }; await field.Init(api); Assert.Null(field.Id); } } [Fact] public void ImageFieldEquals() { var field1 = new Piranha.Extend.Fields.ImageField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.ImageField { Id = field1.Id }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void ImageFieldNotEquals() { var field1 = new Piranha.Extend.Fields.ImageField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.ImageField { Id = null }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void DocumentFieldConversions() { var media = new Media { Id = Guid.NewGuid() }; Piranha.Extend.Fields.DocumentField field = media; Assert.Equal(media.Id, field.Id.Value); } [Fact] public async Task DocumentFieldInitMissing() { using (var api = CreateApi()) { var field = new Piranha.Extend.Fields.DocumentField { Id = Guid.NewGuid() }; await field.Init(api); Assert.Null(field.Id); } } [Fact] public void DocumentFieldEquals() { var field1 = new Piranha.Extend.Fields.DocumentField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.DocumentField { Id = field1.Id }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void DocumentFieldNotEquals() { var field1 = new Piranha.Extend.Fields.DocumentField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.DocumentField { Id = null }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void VideoFieldConversions() { var media = new Media { Id = Guid.NewGuid() }; Piranha.Extend.Fields.VideoField field = media; Assert.Equal(media.Id, field.Id.Value); } [Fact] public async Task VideoFieldInitMissing() { using (var api = CreateApi()) { var field = new Piranha.Extend.Fields.VideoField { Id = Guid.NewGuid() }; await field.Init(api); Assert.Null(field.Id); } } [Fact] public void VideoFieldEquals() { var field1 = new Piranha.Extend.Fields.VideoField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.VideoField { Id = field1.Id }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void VideoFieldNotEquals() { var field1 = new Piranha.Extend.Fields.VideoField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.VideoField { Id = null }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void AudioFieldConversions() { var media = new Media { Id = Guid.NewGuid() }; Piranha.Extend.Fields.AudioField field = media; Assert.Equal(media.Id, field.Id.Value); } [Fact] public async Task AudioFieldInitMissing() { using (var api = CreateApi()) { var field = new Piranha.Extend.Fields.AudioField { Id = Guid.NewGuid() }; await field.Init(api); Assert.Null(field.Id); } } [Fact] public void AudioFieldEquals() { var field1 = new Piranha.Extend.Fields.AudioField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.AudioField { Id = field1.Id }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void AudioFieldNotEquals() { var field1 = new Piranha.Extend.Fields.AudioField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.AudioField { Id = null }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void MediaFieldConversions() { var media = new Media { Id = Guid.NewGuid() }; Piranha.Extend.Fields.MediaField field = media; Assert.Equal(media.Id, field.Id.Value); } [Fact] public async Task MediaFieldInitMissing() { using (var api = CreateApi()) { var field = new Piranha.Extend.Fields.MediaField { Id = Guid.NewGuid() }; await field.Init(api); Assert.Null(field.Id); } } [Fact] public void MediaFieldEquals() { var field1 = new Piranha.Extend.Fields.MediaField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.MediaField { Id = field1.Id }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void MediaFieldNotEquals() { var field1 = new Piranha.Extend.Fields.MediaField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.MediaField { Id = null }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void ImageFieldConversionsNullImage() { var id = Guid.NewGuid(); Piranha.Extend.Fields.ImageField field = id; Assert.Equal(id, field.Id.Value); string url = field; Assert.Equal("", url); } [Fact] public void DocumentFieldConversionsNullDocument() { var id = Guid.NewGuid(); Piranha.Extend.Fields.DocumentField field = id; Assert.Equal(id, field.Id.Value); string url = field; Assert.Equal("", url); } [Fact] public void VideoFieldConversionsNullVideo() { var id = Guid.NewGuid(); Piranha.Extend.Fields.VideoField field = id; Assert.Equal(id, field.Id.Value); string url = field; Assert.Equal("", url); } [Fact] public void AudioFieldConversionsNullAudio() { var id = Guid.NewGuid(); Piranha.Extend.Fields.AudioField field = id; Assert.Equal(id, field.Id.Value); string url = field; Assert.Equal("", url); } [Fact] public void MediaFieldConversionsNullMedia() { var id = Guid.NewGuid(); Piranha.Extend.Fields.MediaField field = id; Assert.Equal(id, field.Id.Value); string url = field; Assert.Equal("", url); } [Fact] public void MarkdownFieldConversions() { var md = "This is a paragraph"; var html = Piranha.App.Markdown.Transform(md); Piranha.Extend.Fields.MarkdownField field = md; Assert.Equal(md, field.Value); string outputHtml = field; Assert.Equal(html, outputHtml); } [Fact] public void MarkdownFieldEquals() { var field1 = new Piranha.Extend.Fields.MarkdownField { Value = "Sollicitudin Justo Tristique" }; var field2 = new Piranha.Extend.Fields.MarkdownField { Value = "Sollicitudin Justo Tristique" }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void MarkdownFieldNotEquals() { var field1 = new Piranha.Extend.Fields.MarkdownField { Value = "Sollicitudin Justo Tristique" }; var field2 = new Piranha.Extend.Fields.MarkdownField { Value = "Sollicitudin Tristique" }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void NumberFieldConversions() { var number = 25; Piranha.Extend.Fields.NumberField field = number; Assert.Equal(number, field.Value); int? converted = field; Assert.True(converted.HasValue); Assert.Equal(25, converted.Value); } [Fact] public void NumberFieldEquals() { var field1 = new Piranha.Extend.Fields.NumberField { Value = 23 }; var field2 = new Piranha.Extend.Fields.NumberField { Value = 23 }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void NumberFieldNotEquals() { var field1 = new Piranha.Extend.Fields.NumberField { Value = 23 }; var field2 = new Piranha.Extend.Fields.NumberField { Value = null }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void PageFieldEquals() { var field1 = new Piranha.Extend.Fields.PageField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.PageField { Id = field1.Id }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void PageFieldNotEquals() { var field1 = new Piranha.Extend.Fields.PageField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.PageField { Id = null }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void PostFieldEquals() { var field1 = new Piranha.Extend.Fields.PostField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.PostField { Id = field1.Id }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void PostFieldNotEquals() { var field1 = new Piranha.Extend.Fields.PostField { Id = Guid.NewGuid() }; var field2 = new Piranha.Extend.Fields.PostField { Id = null }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void SelectFieldEquals() { var field1 = new Piranha.Extend.Fields.SelectField<MyEnum> { Value = MyEnum.Value1 }; var field2 = new Piranha.Extend.Fields.SelectField<MyEnum> { Value = MyEnum.Value1 }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void SelectFieldNotEquals() { var field1 = new Piranha.Extend.Fields.SelectField<MyEnum> { Value = MyEnum.Value1 }; var field2 = new Piranha.Extend.Fields.SelectField<MyEnum> { Value = MyEnum.Value2 }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void StringFieldConversions() { var inStr = "This is a string"; Piranha.Extend.Fields.StringField field = inStr; Assert.Equal(inStr, field.Value); string outStr = field; Assert.Equal(inStr, outStr); } [Fact] public void StringFieldEquals() { var field1 = new Piranha.Extend.Fields.StringField { Value = "Sollicitudin Justo Tristique" }; var field2 = new Piranha.Extend.Fields.StringField { Value = "Sollicitudin Justo Tristique" }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void StringFieldNotEquals() { var field1 = new Piranha.Extend.Fields.StringField { Value = "Sollicitudin Justo Tristique" }; var field2 = new Piranha.Extend.Fields.StringField { Value = "Sollicitudin Tristique" }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void TextFieldConversions() { var inStr = "This is a string"; Piranha.Extend.Fields.TextField field = inStr; Assert.Equal(inStr, field.Value); string outStr = field; Assert.Equal(inStr, outStr); } [Fact] public void TextFieldEquals() { var field1 = new Piranha.Extend.Fields.TextField { Value = "Sollicitudin Justo Tristique" }; var field2 = new Piranha.Extend.Fields.TextField { Value = "Sollicitudin Justo Tristique" }; Assert.True(field1 == field2); Assert.True(field1.Equals(field2)); Assert.True(field1.Equals((object)field2)); } [Fact] public void TextFieldNotEquals() { var field1 = new Piranha.Extend.Fields.TextField { Value = "Sollicitudin Justo Tristique" }; var field2 = new Piranha.Extend.Fields.TextField { Value = "Sollicitudin Tristique" }; Assert.True(field1 != field2); Assert.True(!field1.Equals(field2)); Assert.True(!field1.Equals((object)field2)); } [Fact] public void GetFieldTitleNull() { var field = new Piranha.Extend.Fields.TextField(); Assert.Null(field.GetTitle()); } [Fact] public void GetFieldTitle() { Piranha.Extend.Fields.TextField field = "String value"; Assert.Equal("String value", field.GetTitle()); } [Fact] public void GetFieldTitleMaxLength() { var sb = new StringBuilder(); for (var n = 0; n < 10; n++) { sb.Append("NineChars"); } Piranha.Extend.Fields.TextField field = sb.ToString(); Assert.Equal(43, field.GetTitle().Length); } [Fact] public void ReadonlyFieldConversions() { var value = "Value"; Piranha.Extend.Fields.ReadonlyField field = value; Assert.Equal(value, field.Value); string value2 = field; Assert.Equal(value, value2); } private IApi CreateApi() { var factory = new ContentFactory(services); var serviceFactory = new ContentServiceFactory(factory); var db = GetDb(); return new Api( factory, new AliasRepository(db), new ArchiveRepository(db), new ContentRepository(db, serviceFactory), new ContentGroupRepository(db), new ContentTypeRepository(db), new LanguageRepository(db), new Piranha.Repositories.MediaRepository(db), new PageRepository(db, serviceFactory), new PageTypeRepository(db), new ParamRepository(db), new PostRepository(db, serviceFactory), new PostTypeRepository(db), new SiteRepository(db, serviceFactory), new SiteTypeRepository(db) ); } } ```
```swift // Tests/SwiftProtobufTests/Test_TextFormat_Map_proto3.swift - Exercise proto3 text format coding // // // See LICENSE.txt for license information: // path_to_url // // your_sha256_hash------------- /// /// This is a set of tests for text format protobuf files. /// // your_sha256_hash------------- import Foundation import XCTest import SwiftProtobuf final class Test_TextFormat_Map_proto3: XCTestCase, PBTestHelpers { typealias MessageTestType = SwiftProtoTesting_TestMap func test_Int32Int32() { assertTextFormatEncode("map_int32_int32 {\n key: 1\n value: 2\n}\n") {(o: inout MessageTestType) in o.mapInt32Int32 = [1:2] } assertTextFormatDecodeSucceeds("map_int32_int32 {key: 1, value: 2}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("map_int32_int32 {key: 1; value: 2}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("map_int32_int32 {key:1 value:2}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("map_int32_int32 {key:1 value:2}\nmap_int32_int32 {key:3 value:4}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2, 3:4] } assertTextFormatDecodeSucceeds("map_int32_int32 [{key:1 value:2}, {key:3 value:4}]") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2, 3:4] } assertTextFormatDecodeSucceeds("map_int32_int32 [{key:1 value:2}];map_int32_int32 {key:3 value:4}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2, 3:4] } assertTextFormatDecodeFails("map_int32_int32 [{key:1 value:2},]") assertTextFormatDecodeFails("map_int32_int32 [{key:1 value:2}") assertTextFormatDecodeFails("map_int32_int32 [{key:1 value:2 nonsense:3}") assertTextFormatDecodeFails("map_int32_int32 {key:1}") assertTextFormatDecodeFails("map_int32_int32<") assertTextFormatDecodeFails("map_int32_int32{") assertTextFormatDecodeFails("1<") assertTextFormatDecodeFails("1{") assertTextFormatDecodeFails("1{1:1 2:2") assertTextFormatDecodeFails("1{1:1 2:") assertTextFormatDecodeFails("1{1:1 2") assertTextFormatDecodeFails("1{1:1") assertTextFormatDecodeFails("1{1:") assertTextFormatDecodeFails("1{1") } func test_Int32Int32_numbers() { assertTextFormatDecodeSucceeds("1 {\n key: 1\n value: 2\n}\n") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("1 {key: 1, value: 2}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("1 {key: 1; value: 2}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("1 {key:1 value:2}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("1 {key:1 value:2}\n1 {key:3 value:4}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2, 3:4] } assertTextFormatDecodeSucceeds("1 [{key:1 value:2}, {key:3 value:4}]") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2, 3:4] } assertTextFormatDecodeSucceeds("1 [{key:1 value:2}];1 {key:3 value:4}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2, 3:4] } assertTextFormatDecodeFails("1 [{key:1 value:2},]") assertTextFormatDecodeFails("1 [{key:1 value:2}") assertTextFormatDecodeFails("1 [{key:1 value:2 nonsense:3}") assertTextFormatDecodeFails("1 {key:1}") // Using numbers for "key" and "value" in the map entries. assertTextFormatDecodeSucceeds("1 {\n 1: 1\n 2: 2\n}\n") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("1 {1: 1, 2: 2}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("1 {1: 1; 2: 2}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("1 {1:1 2:2}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("1 {1:1 2:2}\n1 {1:3 2:4}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2, 3:4] } assertTextFormatDecodeSucceeds("1 [{1:1 2:2}, {1:3 2:4}]") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2, 3:4] } assertTextFormatDecodeSucceeds("1 [{1:1 2:2}];1 {1:3 2:4}") {(o: MessageTestType) in return o.mapInt32Int32 == [1:2, 3:4] } assertTextFormatDecodeFails("1 [{1:1 2:2},]") assertTextFormatDecodeFails("1 [{1:1 2:2}") assertTextFormatDecodeFails("1 [{1:1 2:2 3:3}") assertTextFormatDecodeFails("1 {1:1}") } func test_StringMessage() { let foo = SwiftProtoTesting_ForeignMessage.with {$0.c = 999} assertTextFormatEncode("map_string_foreign_message {\n key: \"foo\"\n value {\n c: 999\n }\n}\n") {(o: inout MessageTestType) in o.mapStringForeignMessage = ["foo": foo] } } func test_StringMessage_numbers() { let foo = SwiftProtoTesting_ForeignMessage.with {$0.c = 999} assertTextFormatDecodeSucceeds("18 {\n key: \"foo\"\n value {\n 1: 999\n }\n}\n") {(o: MessageTestType) in o.mapStringForeignMessage == ["foo": foo] } // Using numbers for "key" and "value" in the map entries. assertTextFormatDecodeSucceeds("18 {\n 1: \"foo\"\n 2 {\n 1: 999\n }\n}\n") {(o: MessageTestType) in o.mapStringForeignMessage == ["foo": foo] } } func test_Int32Int32_ignore_unknown_fields() { var options = TextFormatDecodingOptions() options.ignoreUnknownFields = true assertTextFormatDecodeSucceeds("map_int32_int32 {\n key: 1\n unknown: 6\n value: 2\n}\n", options: options) {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } do { let _ = try MessageTestType(textFormatString: "map_int32_int32 {\n key: 1\n [ext]: 7\n value: 2\n}\n", options: options) XCTFail("Should have failed") } catch TextFormatDecodingError.unknownField { // This is what should have happened. } catch { XCTFail("Unexpected error: \(error)") } options.ignoreUnknownFields = false options.ignoreUnknownExtensionFields = true assertTextFormatDecodeSucceeds("map_int32_int32 {\n key: 1\n [ext]: 6\n value: 2\n}\n", options: options) {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } do { let _ = try MessageTestType(textFormatString: "map_int32_int32 {\n key: 1\n unknown: 7\n value: 2\n}\n", options: options) XCTFail("Should have failed") } catch TextFormatDecodingError.unknownField { // This is what should have happened. } catch { XCTFail("Unexpected error: \(error)") } options.ignoreUnknownFields = true options.ignoreUnknownExtensionFields = true assertTextFormatDecodeSucceeds("map_int32_int32 {\n key: 1\n unknown: 6\n [ext]: 7\n value: 2\n}\n", options: options) {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("map_int32_int32 {unknown: 6, [ext]: 7, key: 1, value: 2}", options: options) {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("map_int32_int32 {key: 1; value: 2; unknown: 6; [ext]: 7}", options: options) {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } assertTextFormatDecodeSucceeds("map_int32_int32 {key:1 unknown: 6 [ext]: 7 value:2}", options: options) {(o: MessageTestType) in return o.mapInt32Int32 == [1:2] } } func test_StringMessage_ignore_unknown_fields() { var options = TextFormatDecodingOptions() options.ignoreUnknownFields = true let foo = SwiftProtoTesting_ForeignMessage.with {$0.c = 999} assertTextFormatDecodeSucceeds("map_string_foreign_message {\n key: \"foo\"\n unknown: 6\n value { c: 999 }\n}\n", options: options) {(o: MessageTestType) in o.mapStringForeignMessage == ["foo": foo] } do { let _ = try MessageTestType(textFormatString: "map_string_foreign_message {\n key: \"foo\"\n [ext]: 7\n value { c: 999 }\n}\n", options: options) XCTFail("Should have failed") } catch TextFormatDecodingError.unknownField { // This is what should have happened. } catch { XCTFail("Unexpected error: \(error)") } options.ignoreUnknownFields = false options.ignoreUnknownExtensionFields = true assertTextFormatDecodeSucceeds("map_string_foreign_message {\n key: \"foo\"\n [ext]: 7\n value { c: 999 }\n}\n", options: options) {(o: MessageTestType) in o.mapStringForeignMessage == ["foo": foo] } do { let _ = try MessageTestType(textFormatString: "map_string_foreign_message {\n key: \"foo\"\n unknown: 6\n value { c: 999 }\n}\n", options: options) XCTFail("Should have failed") } catch TextFormatDecodingError.unknownField { // This is what should have happened. } catch { XCTFail("Unexpected error: \(error)") } options.ignoreUnknownFields = true options.ignoreUnknownExtensionFields = true assertTextFormatDecodeSucceeds("map_string_foreign_message {\n key: \"foo\"\n unknown: 6\n [ext]: 7\n value { c: 999 }\n}\n", options: options) {(o: MessageTestType) in o.mapStringForeignMessage == ["foo": foo] } assertTextFormatDecodeSucceeds("map_string_foreign_message { unknown: 6, [ext]: 7, key: \"foo\", value { c: 999 } }", options: options) {(o: MessageTestType) in o.mapStringForeignMessage == ["foo": foo] } assertTextFormatDecodeSucceeds("map_string_foreign_message { key: \"foo\"; value { c: 999 }; unknown: 6; [ext]: 7 }", options: options) {(o: MessageTestType) in o.mapStringForeignMessage == ["foo": foo] } assertTextFormatDecodeSucceeds("map_string_foreign_message { key: \"foo\" value { c: 999 } unknown: 6 [ext]: 7 }", options: options) {(o: MessageTestType) in o.mapStringForeignMessage == ["foo": foo] } } func test_Int32Enum_ignore_unknown_fields() { var options = TextFormatDecodingOptions() options.ignoreUnknownFields = true assertTextFormatDecodeSucceeds("map_int32_enum {\n key: 1\n unknown: 6\n\n value: MAP_ENUM_BAR\n}\n", options: options) {(o: MessageTestType) in o.mapInt32Enum == [1: .bar] } do { let _ = try MessageTestType(textFormatString: "map_int32_enum {\n key: 1\n [ext]: 7\n value: MAP_ENUM_BAR\n}\n", options: options) XCTFail("Should have failed") } catch TextFormatDecodingError.unknownField { // This is what should have happened. } catch { XCTFail("Unexpected error: \(error)") } options.ignoreUnknownFields = false options.ignoreUnknownExtensionFields = true assertTextFormatDecodeSucceeds("map_int32_enum {\n key: 1\n [ext]: 7\n value: MAP_ENUM_BAR\n}\n", options: options) {(o: MessageTestType) in o.mapInt32Enum == [1: .bar] } do { let _ = try MessageTestType(textFormatString: "map_int32_enum {\n key: 1\n unknown: 6\n value: MAP_ENUM_BAR\n}\n", options: options) XCTFail("Should have failed") } catch TextFormatDecodingError.unknownField { // This is what should have happened. } catch { XCTFail("Unexpected error: \(error)") } options.ignoreUnknownFields = true options.ignoreUnknownExtensionFields = true assertTextFormatDecodeSucceeds("map_int32_enum {\n key: 1\n unknown: 6\n [ext]: 7\n value: MAP_ENUM_BAR\n}\n", options: options) {(o: MessageTestType) in o.mapInt32Enum == [1: .bar] } assertTextFormatDecodeSucceeds("map_int32_enum { unknown: 6, [ext]: 7, key: 1, value: MAP_ENUM_BAR }", options: options) {(o: MessageTestType) in o.mapInt32Enum == [1: .bar] } assertTextFormatDecodeSucceeds("map_int32_enum { key: 1; value: MAP_ENUM_BAR; unknown: 6; [ext]: 7 }", options: options) {(o: MessageTestType) in o.mapInt32Enum == [1: .bar] } assertTextFormatDecodeSucceeds("map_int32_enum { key: 1 value: MAP_ENUM_BAR unknown: 6 [ext]: 7 }", options: options) {(o: MessageTestType) in o.mapInt32Enum == [1: .bar] } } } ```
Komla Agbeli Gbedemah (17 June 1913 – 11 July 1998) was a Ghanaian politician and Minister for Finance in Ghana's Nkrumah government between 1954 and 1961. Known popularly as "Afro Gbede", he was an indigene of Anyako in the Volta Region of Ghana. Early life and career Komla Gbedemah was born on 17 June 1913 in Warri, Nigeria, of Ewe parentage. He attended Adisadel College in Cape Coast for his secondary education from 1925 to 1929 and Achimota College from 1929 to 1933. He became employed as a teacher at a school in the Akuapem District in the Eastern Region of Ghana. In 1939, he became a Science Master at Accra Academy in Jamestown. Alongside teaching, he engaged in the timber and confectionery business. In 1943, he quit his teaching role at Accra Academy to engage in the timber trade full-time. Political career Gbedemah was originally a member of the United Gold Coast Convention. He left with Dr Kwame Nkrumah to form the Convention People's Party (CPP). Gbedemah was an important member of the CPP because of his organizational ability. He was influential in getting Nkrumah elected to the Legislative Council on 8 February 1951 at the Elections for the Legislative Assembly. He organized Nkrumah's entire campaign while Nkrumah was still in prison, detained by the colonial government. Nkrumah duly won the Accra Central Municipal seat. This led to Nkrumah being released on 12 February 1951 and his being invited to form a government. Gbedemah is in some reports named as being the first to welcome Nkrumah after his release from Fort James prison. Gbedemah, who himself got elected into the Legislative Assembly, became the first Ghanaian Minister for Health and Labour in Nkrumah's government. In 1954, he became the Minister of Finance, a position he held for seven years. He was influential in getting an initially reluctant United States government to back the building of the Akosombo Dam. Later, as his relationship with Nkrumah deteriorated, Gbedemah was demoted by Nkrumah to the post of Minister of Health in May 1961. It is alleged by US sources that at a point, Gbedemah was considering the overthrow of Nkrumah. He is quoted as saying: "I would be sorry to have to do it but country has had enough of Nkrumah's arrogance, whims and madness." Nkrumah demanded Gbedemah's resignation in September 1961. Gbedemah was forced into exile later the same year, after worsening relations between him and Nkrumah over what he perceived to be Nkrumah's financial indiscipline. He is alleged to have fled as there were plans to place him under preventive detention. While in exile, he is known to have continued to lobby the US over the Akosombo dam project. Gbedemah formed and led the National Alliance of Liberals into the 1969 general election. His campaign slogan "Say it loud, I am black and proud!" was taken from the popular James Brown tune. After the election, Gbedemah was barred from taking his seat in parliament. This followed a Supreme Court ruling, upholding the NLC barring members of the CPP accused of financial crimes from holding public office for ten years. This decision led him to retire from active involvement in politics. From 1957 to 1961, Gbedemah served as President of the World Federalist Movement, an international non-governmental organization promoting federal world government. He was one of the signatories of the agreement to convene a convention for drafting a world constitution. As a result, for the first time in human history, a World Constituent Assembly convened to draft and adopt the Constitution for the Federation of Earth. Howard Johnson's restaurant incident In the United States, Gbedemah is most widely known from an incident on 10 October 1957 when U.S. President Dwight D. Eisenhower apologized to him after he was refused service in a Howard Johnson's restaurant in Dover, Delaware. Gbedemah told the staff: "The people here are of a lower social status than I am, but they can drink here and we can't. You can keep the orange juice and the change, but this is not the last you have heard of this." The incident resulted in Gbedemah being invited to breakfast at the White House. Positions For ministerial positions, see succession box. Leader, People's Movement for Freedom and Justice (1991 – ?) Founder and Leader, National Alliance of Liberals (1969) Member, Legislative Assembly, Ghana (1951 – ?) Manager and Editor, Accra Evening News (1949 – ?) Vice Chairman, Convention People's Party (1949 – ?) Works Gbedemah, K. A. It will not be "work and happiness for all"; an open letter being also an appeal to Dr. Kwame Nkrumah and comment on and criticism of the proposed new 7 year Ghana development plan. [n.p.], 1962. [32p]. Notes External Links 1913 births 1998 deaths Ghanaian MPs 1951–1954 Ghanaian MPs 1954–1956 Ghanaian MPs 1956–1965 Ghanaian MPs 1965–1966 Finance ministers of Ghana Health ministers of Ghana Labour ministers of Ghana Industry ministers of Ghana Trade ministers of Ghana United Gold Coast Convention politicians Convention People's Party (Ghana) politicians National Alliance of Liberals politicians Ewe people Ghanaian independence activists Alumni of Achimota School Alumni of Adisadel College World Constitutional Convention call signatories
```c /* * */ #include <errno.h> #include <zephyr/types.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #include <zephyr/sys/byteorder.h> #include <zephyr/kernel.h> #include <zephyr/settings/settings.h> #include <zephyr/bluetooth/hci.h> #include <zephyr/bluetooth/bluetooth.h> #include <zephyr/bluetooth/conn.h> #include <zephyr/bluetooth/l2cap.h> #include <zephyr/bluetooth/classic/a2dp_codec_sbc.h> #include <zephyr/bluetooth/classic/a2dp.h> #include <zephyr/bluetooth/classic/sdp.h> #include <zephyr/shell/shell.h> #include "bt.h" struct bt_a2dp *default_a2dp; static uint8_t a2dp_sink_sdp_registered; static uint8_t a2dp_source_sdp_registered; static uint8_t a2dp_initied; BT_A2DP_SBC_SINK_EP_DEFAULT(sink_sbc_endpoint); BT_A2DP_SBC_SOURCE_EP_DEFAULT(source_sbc_endpoint); struct bt_a2dp_codec_ie peer_sbc_capabilities; static struct bt_a2dp_ep peer_sbc_endpoint = { .codec_cap = &peer_sbc_capabilities, }; static struct bt_a2dp_ep *found_peer_sbc_endpoint; static struct bt_a2dp_ep *registered_sbc_endpoint; static struct bt_a2dp_stream sbc_stream; static struct bt_a2dp_stream_ops stream_ops; #if defined(CONFIG_BT_A2DP_SOURCE) static uint8_t media_data[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, }; #endif NET_BUF_POOL_DEFINE(a2dp_tx_pool, CONFIG_BT_MAX_CONN, BT_L2CAP_BUF_SIZE(CONFIG_BT_L2CAP_TX_MTU), CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL); static struct bt_sdp_attribute a2dp_sink_attrs[] = { BT_SDP_NEW_SERVICE, BT_SDP_LIST( BT_SDP_ATTR_SVCLASS_ID_LIST, BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 3), /* 35 03 */ BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE(BT_SDP_UUID16), /* 19 */ BT_SDP_ARRAY_16(BT_SDP_AUDIO_SINK_SVCLASS) /* 11 0B */ }, ) ), BT_SDP_LIST( BT_SDP_ATTR_PROTO_DESC_LIST, BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 16),/* 35 10 */ BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 6),/* 35 06 */ BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE(BT_SDP_UUID16), /* 19 */ BT_SDP_ARRAY_16(BT_SDP_PROTO_L2CAP) /* 01 00 */ }, { BT_SDP_TYPE_SIZE(BT_SDP_UINT16), /* 09 */ BT_SDP_ARRAY_16(BT_UUID_AVDTP_VAL) /* 00 19 */ }, ) }, { BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 6),/* 35 06 */ BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE(BT_SDP_UUID16), /* 19 */ BT_SDP_ARRAY_16(BT_UUID_AVDTP_VAL) /* 00 19 */ }, { BT_SDP_TYPE_SIZE(BT_SDP_UINT16), /* 09 */ BT_SDP_ARRAY_16(0X0100u) /* AVDTP version: 01 00 */ }, ) }, ) ), BT_SDP_LIST( BT_SDP_ATTR_PROFILE_DESC_LIST, BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 8), /* 35 08 */ BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 6), /* 35 06 */ BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE(BT_SDP_UUID16), /* 19 */ BT_SDP_ARRAY_16(BT_SDP_ADVANCED_AUDIO_SVCLASS) /* 11 0d */ }, { BT_SDP_TYPE_SIZE(BT_SDP_UINT16), /* 09 */ BT_SDP_ARRAY_16(0x0103U) /* 01 03 */ }, ) }, ) ), BT_SDP_SERVICE_NAME("A2DPSink"), BT_SDP_SUPPORTED_FEATURES(0x0001U), }; static struct bt_sdp_record a2dp_sink_rec = BT_SDP_RECORD(a2dp_sink_attrs); static struct bt_sdp_attribute a2dp_source_attrs[] = { BT_SDP_NEW_SERVICE, BT_SDP_LIST( BT_SDP_ATTR_SVCLASS_ID_LIST, BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 3), BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE(BT_SDP_UUID16), BT_SDP_ARRAY_16(BT_SDP_AUDIO_SOURCE_SVCLASS) }, ) ), BT_SDP_LIST( BT_SDP_ATTR_PROTO_DESC_LIST, BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 16), BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 6), BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE(BT_SDP_UUID16), BT_SDP_ARRAY_16(BT_SDP_PROTO_L2CAP) }, { BT_SDP_TYPE_SIZE(BT_SDP_UINT16), BT_SDP_ARRAY_16(BT_UUID_AVDTP_VAL) }, ) }, { BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 6), BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE(BT_SDP_UUID16), BT_SDP_ARRAY_16(BT_UUID_AVDTP_VAL) }, { BT_SDP_TYPE_SIZE(BT_SDP_UINT16), BT_SDP_ARRAY_16(0X0100u) }, ) }, ) ), BT_SDP_LIST( BT_SDP_ATTR_PROFILE_DESC_LIST, BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 8), BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 6), BT_SDP_DATA_ELEM_LIST( { BT_SDP_TYPE_SIZE(BT_SDP_UUID16), BT_SDP_ARRAY_16(BT_SDP_ADVANCED_AUDIO_SVCLASS) }, { BT_SDP_TYPE_SIZE(BT_SDP_UINT16), BT_SDP_ARRAY_16(0x0103U) }, ) }, ) ), BT_SDP_SERVICE_NAME("A2DPSink"), BT_SDP_SUPPORTED_FEATURES(0x0001U), }; static struct bt_sdp_record a2dp_source_rec = BT_SDP_RECORD(a2dp_source_attrs); static void shell_a2dp_print_capabilities(struct bt_a2dp_ep_info *ep_info) { uint8_t codec_type; uint8_t *codec_ie; uint16_t codec_ie_len; codec_type = ep_info->codec_type; codec_ie = ep_info->codec_cap.codec_ie; codec_ie_len = ep_info->codec_cap.len; shell_print(ctx_shell, "endpoint id: %d, %s, %s:", ep_info->sep_info.id, (ep_info->sep_info.tsep == BT_AVDTP_SINK) ? "(sink)" : "(source)", (ep_info->sep_info.inuse) ? "(in use)" : "(idle)"); if (BT_A2DP_SBC == codec_type) { shell_print(ctx_shell, " codec type: SBC"); if (BT_A2DP_SBC_IE_LENGTH != codec_ie_len) { shell_error(ctx_shell, " wrong sbc codec ie"); return; } shell_print(ctx_shell, " sample frequency:"); if (0U != (codec_ie[0U] & A2DP_SBC_SAMP_FREQ_16000)) { shell_print(ctx_shell, " 16000 "); } if (0U != (codec_ie[0U] & A2DP_SBC_SAMP_FREQ_32000)) { shell_print(ctx_shell, " 32000 "); } if (0U != (codec_ie[0U] & A2DP_SBC_SAMP_FREQ_44100)) { shell_print(ctx_shell, " 44100 "); } if (0U != (codec_ie[0U] & A2DP_SBC_SAMP_FREQ_48000)) { shell_print(ctx_shell, " 48000"); } shell_print(ctx_shell, " channel mode:"); if (0U != (codec_ie[0U] & A2DP_SBC_CH_MODE_MONO)) { shell_print(ctx_shell, " Mono "); } if (0U != (codec_ie[0U] & A2DP_SBC_CH_MODE_DUAL)) { shell_print(ctx_shell, " Dual "); } if (0U != (codec_ie[0U] & A2DP_SBC_CH_MODE_STREO)) { shell_print(ctx_shell, " Stereo "); } if (0U != (codec_ie[0U] & A2DP_SBC_CH_MODE_JOINT)) { shell_print(ctx_shell, " Joint-Stereo"); } /* Decode Support for Block Length */ shell_print(ctx_shell, " Block Length:"); if (0U != (codec_ie[1U] & A2DP_SBC_BLK_LEN_4)) { shell_print(ctx_shell, " 4 "); } if (0U != (codec_ie[1U] & A2DP_SBC_BLK_LEN_8)) { shell_print(ctx_shell, " 8 "); } if (0U != (codec_ie[1U] & A2DP_SBC_BLK_LEN_12)) { shell_print(ctx_shell, " 12 "); } if (0U != (codec_ie[1U] & A2DP_SBC_BLK_LEN_16)) { shell_print(ctx_shell, " 16"); } /* Decode Support for Subbands */ shell_print(ctx_shell, " Subbands:"); if (0U != (codec_ie[1U] & A2DP_SBC_SUBBAND_4)) { shell_print(ctx_shell, " 4 "); } if (0U != (codec_ie[1U] & A2DP_SBC_SUBBAND_8)) { shell_print(ctx_shell, " 8"); } /* Decode Support for Allocation Method */ shell_print(ctx_shell, " Allocation Method:"); if (0U != (codec_ie[1U] & A2DP_SBC_ALLOC_MTHD_SNR)) { shell_print(ctx_shell, " SNR "); } if (0U != (codec_ie[1U] & A2DP_SBC_ALLOC_MTHD_LOUDNESS)) { shell_print(ctx_shell, " Loudness"); } shell_print(ctx_shell, " Bitpool Range: %d - %d", codec_ie[2U], codec_ie[3U]); } else { shell_print(ctx_shell, " not SBC codecs"); } } void app_connected(struct bt_a2dp *a2dp, int err) { if (!err) { default_a2dp = a2dp; shell_print(ctx_shell, "a2dp connected"); } else { shell_print(ctx_shell, "a2dp connecting fail"); } } void app_disconnected(struct bt_a2dp *a2dp) { found_peer_sbc_endpoint = NULL; shell_print(ctx_shell, "a2dp disconnected"); } int app_config_req(struct bt_a2dp *a2dp, struct bt_a2dp_ep *ep, struct bt_a2dp_codec_cfg *codec_cfg, struct bt_a2dp_stream **stream, uint8_t *rsp_err_code) { bt_a2dp_stream_cb_register(&sbc_stream, &stream_ops); *stream = &sbc_stream; *rsp_err_code = 0; shell_print(ctx_shell, "receive requesting config and accept"); if (*rsp_err_code == 0) { uint32_t sample_rate; shell_print(ctx_shell, "SBC configure success"); sample_rate = bt_a2dp_sbc_get_sampling_frequency( (struct bt_a2dp_codec_sbc_params *)&codec_cfg->codec_config->codec_ie[0]); shell_print(ctx_shell, "sample rate %dHz", sample_rate); } else { shell_print(ctx_shell, "configure err"); } return 0; } void app_config_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code) { if (rsp_err_code == 0) { shell_print(ctx_shell, "success to configure"); } else { shell_print(ctx_shell, "fail to configure"); } } int app_establish_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code) { *rsp_err_code = 0; shell_print(ctx_shell, "receive requesting establishment and accept"); return 0; } void app_establish_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code) { if (rsp_err_code == 0) { shell_print(ctx_shell, "success to establish"); } else { shell_print(ctx_shell, "fail to establish"); } } int app_start_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code) { *rsp_err_code = 0; shell_print(ctx_shell, "receive requesting start and accept"); return 0; } void app_start_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code) { if (rsp_err_code == 0) { shell_print(ctx_shell, "success to start"); } else { shell_print(ctx_shell, "fail to start"); } } void stream_configured(struct bt_a2dp_stream *stream) { shell_print(ctx_shell, "stream configured"); } void stream_established(struct bt_a2dp_stream *stream) { shell_print(ctx_shell, "stream established"); } void stream_released(struct bt_a2dp_stream *stream) { shell_print(ctx_shell, "stream released"); } void stream_started(struct bt_a2dp_stream *stream) { shell_print(ctx_shell, "stream started"); } void sink_sbc_streamer_data(struct bt_a2dp_stream *stream, struct net_buf *buf, uint16_t seq_num, uint32_t ts) { uint8_t sbc_hdr; sbc_hdr = net_buf_pull_u8(buf); shell_print(ctx_shell, "received, num of frames: %d, data length:%d", (uint8_t)BT_A2DP_SBC_MEDIA_HDR_NUM_FRAMES_GET(sbc_hdr), buf->len); shell_print(ctx_shell, "data: %d, %d, %d, %d, %d, %d ......", buf->data[0], buf->data[1], buf->data[2], buf->data[3], buf->data[4], buf->data[5]); } void stream_recv(struct bt_a2dp_stream *stream, struct net_buf *buf, uint16_t seq_num, uint32_t ts) { sink_sbc_streamer_data(stream, buf, seq_num, ts); } struct bt_a2dp_cb a2dp_cb = { .connected = app_connected, .disconnected = app_disconnected, .config_req = app_config_req, .config_rsp = app_config_rsp, .establish_req = app_establish_req, .establish_rsp = app_establish_rsp, .release_req = NULL, .release_rsp = NULL, .start_req = app_start_req, .start_rsp = app_start_rsp, .suspend_req = NULL, .suspend_rsp = NULL, .reconfig_req = NULL, .reconfig_rsp = NULL, }; static int cmd_register_cb(const struct shell *sh, int32_t argc, char *argv[]) { int err = -1; if (a2dp_initied == 0) { a2dp_initied = 1; err = bt_a2dp_register_cb(&a2dp_cb); if (!err) { shell_print(sh, "success"); } else { shell_print(sh, "fail"); } } else { shell_print(sh, "already registered"); } return 0; } static int cmd_register_ep(const struct shell *sh, int32_t argc, char *argv[]) { int err = -1; const char *type; const char *action; if (a2dp_initied == 0) { shell_print(sh, "need to register a2dp connection callbacks"); return -ENOEXEC; } type = argv[1]; action = argv[2]; if (!strcmp(action, "sbc")) { if (!strcmp(type, "sink")) { if (a2dp_sink_sdp_registered == 0) { a2dp_sink_sdp_registered = 1; bt_sdp_register_service(&a2dp_sink_rec); } err = bt_a2dp_register_ep(&sink_sbc_endpoint, BT_AVDTP_AUDIO, BT_AVDTP_SINK); if (!err) { shell_print(sh, "SBC sink endpoint is registered"); registered_sbc_endpoint = &sink_sbc_endpoint; } } else if (!strcmp(type, "source")) { if (a2dp_source_sdp_registered == 0) { a2dp_source_sdp_registered = 1; bt_sdp_register_service(&a2dp_source_rec); } err = bt_a2dp_register_ep(&source_sbc_endpoint, BT_AVDTP_AUDIO, BT_AVDTP_SOURCE); if (!err) { shell_print(sh, "SBC source endpoint is registered"); registered_sbc_endpoint = &source_sbc_endpoint; } } else { shell_help(sh); return 0; } } else { shell_help(sh); return 0; } if (err) { shell_print(sh, "fail to register endpoint"); } return 0; } static int cmd_connect(const struct shell *sh, int32_t argc, char *argv[]) { if (a2dp_initied == 0) { shell_print(sh, "need to register a2dp connection callbacks"); return -ENOEXEC; } if (!default_conn) { shell_error(sh, "Not connected"); return -ENOEXEC; } default_a2dp = bt_a2dp_connect(default_conn); if (NULL == default_a2dp) { shell_error(sh, "fail to connect a2dp"); } return 0; } static int cmd_disconnect(const struct shell *sh, int32_t argc, char *argv[]) { if (a2dp_initied == 0) { shell_print(sh, "need to register a2dp connection callbacks"); return -ENOEXEC; } if (default_a2dp != NULL) { bt_a2dp_disconnect(default_a2dp); default_a2dp = NULL; } else { shell_error(sh, "a2dp is not connected"); } return 0; } void app_configured(int err) { if (err) { shell_print(ctx_shell, "configure fail"); } } static struct bt_a2dp_stream_ops stream_ops = { .configured = stream_configured, .established = stream_established, .released = stream_released, .started = stream_started, .suspended = NULL, .reconfigured = NULL, #if defined(CONFIG_BT_A2DP_SINK) .recv = stream_recv, #endif #if defined(CONFIG_BT_A2DP_SOURCE) .sent = NULL, #endif }; BT_A2DP_SBC_EP_CFG_DEFAULT(sbc_cfg_default, A2DP_SBC_SAMP_FREQ_44100); static int cmd_configure(const struct shell *sh, int32_t argc, char *argv[]) { int err; if (a2dp_initied == 0) { shell_print(sh, "need to register a2dp connection callbacks"); return -ENOEXEC; } if (default_a2dp != NULL) { if (registered_sbc_endpoint == NULL) { shell_error(sh, "no endpoint"); return 0; } if (found_peer_sbc_endpoint == NULL) { shell_error(sh, "don't find the peer sbc endpoint"); return 0; } bt_a2dp_stream_cb_register(&sbc_stream, &stream_ops); err = bt_a2dp_stream_config(default_a2dp, &sbc_stream, registered_sbc_endpoint, found_peer_sbc_endpoint, &sbc_cfg_default); if (err) { shell_error(sh, "fail to configure"); } } else { shell_error(sh, "a2dp is not connected"); } return 0; } static uint8_t bt_a2dp_discover_peer_endpoint_cb(struct bt_a2dp *a2dp, struct bt_a2dp_ep_info *info, struct bt_a2dp_ep **ep) { if (info != NULL) { shell_print(ctx_shell, "find one endpoint"); shell_a2dp_print_capabilities(info); if ((info->codec_type == BT_A2DP_SBC) && (ep != NULL)) { *ep = &peer_sbc_endpoint; found_peer_sbc_endpoint = &peer_sbc_endpoint; } } return BT_A2DP_DISCOVER_EP_CONTINUE; } static struct bt_avdtp_sep_info found_seps[5]; struct bt_a2dp_discover_param discover_param = { .cb = bt_a2dp_discover_peer_endpoint_cb, .seps_info = &found_seps[0], .sep_count = 5, }; static int cmd_get_peer_eps(const struct shell *sh, int32_t argc, char *argv[]) { if (a2dp_initied == 0) { shell_print(sh, "need to register a2dp connection callbacks"); return -ENOEXEC; } if (default_a2dp != NULL) { int err = bt_a2dp_discover(default_a2dp, &discover_param); if (err) { shell_error(sh, "discover fail"); } } else { shell_error(sh, "a2dp is not connected"); } return 0; } static int cmd_establish(const struct shell *sh, int32_t argc, char *argv[]) { if (a2dp_initied == 0) { shell_print(sh, "need to register a2dp connection callbacks"); return -ENOEXEC; } if (bt_a2dp_stream_establish(&sbc_stream) != 0) { shell_print(sh, "fail"); } return 0; } static int cmd_start(const struct shell *sh, int32_t argc, char *argv[]) { if (a2dp_initied == 0) { shell_print(sh, "need to register a2dp connection callbacks"); return -ENOEXEC; } if (bt_a2dp_stream_start(&sbc_stream) != 0) { shell_print(sh, "fail"); } return 0; } static int cmd_send_media(const struct shell *sh, int32_t argc, char *argv[]) { #if defined(CONFIG_BT_A2DP_SOURCE) struct net_buf *buf; int ret; if (a2dp_initied == 0) { shell_print(sh, "need to register a2dp connection callbacks"); return -ENOEXEC; } buf = net_buf_alloc(&a2dp_tx_pool, K_FOREVER); net_buf_reserve(buf, BT_A2DP_STREAM_BUF_RESERVE); /* num of frames is 1 */ net_buf_add_u8(buf, (uint8_t)BT_A2DP_SBC_MEDIA_HDR_ENCODE(1, 0, 0, 0)); net_buf_add_mem(buf, media_data, sizeof(media_data)); shell_print(sh, "num of frames: %d, data length: %d", 1u, sizeof(media_data)); shell_print(sh, "data: %d, %d, %d, %d, %d, %d ......", media_data[0], media_data[1], media_data[2], media_data[3], media_data[4], media_data[5]); ret = bt_a2dp_stream_send(&sbc_stream, buf, 0u, 0u); if (ret < 0) { printk(" Failed to send SBC audio data on streams(%d)\n", ret); net_buf_unref(buf); } #endif return 0; } #define HELP_NONE "[none]" SHELL_STATIC_SUBCMD_SET_CREATE(a2dp_cmds, SHELL_CMD_ARG(register_cb, NULL, "register a2dp connection callbacks", cmd_register_cb, 1, 0), SHELL_CMD_ARG(register_ep, NULL, "<type: sink or source> <value: sbc>", cmd_register_ep, 3, 0), SHELL_CMD_ARG(connect, NULL, HELP_NONE, cmd_connect, 1, 0), SHELL_CMD_ARG(disconnect, NULL, HELP_NONE, cmd_disconnect, 1, 0), SHELL_CMD_ARG(discover_peer_eps, NULL, HELP_NONE, cmd_get_peer_eps, 1, 0), SHELL_CMD_ARG(configure, NULL, HELP_NONE, cmd_configure, 1, 0), SHELL_CMD_ARG(establish, NULL, HELP_NONE, cmd_establish, 1, 0), SHELL_CMD_ARG(start, NULL, "\"start the default selected ep\"", cmd_start, 1, 0), SHELL_CMD_ARG(send_media, NULL, HELP_NONE, cmd_send_media, 1, 0), SHELL_SUBCMD_SET_END ); static int cmd_a2dp(const struct shell *sh, size_t argc, char **argv) { if (argc == 1) { shell_help(sh); /* sh returns 1 when help is printed */ return 1; } shell_error(sh, "%s unknown parameter: %s", argv[0], argv[1]); return -ENOEXEC; } SHELL_CMD_ARG_REGISTER(a2dp, &a2dp_cmds, "Bluetooth A2DP sh commands", cmd_a2dp, 1, 1); ```
```objective-c This file is part of the GNU IO Library. Written by Per Bothner <bothner@cygnus.com>. This library is free software; you can redistribute it and/or published by the Free Software Foundation; either version 2, 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 along with this library; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause the resulting executable to be covered by the GNU General other reasons why the executable file might be covered by the GNU #ifndef _IO_STDIO_H #define _IO_STDIO_H #include <_G_config.h> /* ALL of these should be defined in _G_config.h */ #define _IO_pos_t _G_fpos_t /* obsolete */ #define _IO_fpos_t _G_fpos_t #define _IO_fpos64_t _G_fpos64_t #define _IO_size_t _G_size_t #define _IO_ssize_t _G_ssize_t #define _IO_off_t _G_off_t #define _IO_off64_t _G_off64_t #define _IO_pid_t _G_pid_t #define _IO_uid_t _G_uid_t #define _IO_iconv_t _G_iconv_t #define _IO_HAVE_SYS_WAIT _G_HAVE_SYS_WAIT #define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE #define _IO_BUFSIZ _G_BUFSIZ #define _IO_va_list _G_va_list #define _IO_wint_t _G_wint_t #ifdef _G_NEED_STDARG_H /* This define avoids name pollution if we're using GNU stdarg.h */ # define __need___va_list # include <stdarg.h> # ifdef __GNUC_VA_LIST # undef _IO_va_list # define _IO_va_list __gnuc_va_list # endif /* __GNUC_VA_LIST */ #endif #ifndef __THROW # ifdef __cplusplus # define __THROW throw () # else # define __THROW # endif #endif /* not __THROW */ #ifndef __P # define __P(p) p __THROW #endif /* not __P */ #ifndef __PMT # define __PMT(p) p #endif /* not __PMT */ /* For backward compatibility */ #ifndef _PARAMS # define _PARAMS(protos) __P(protos) #endif /*!_PARAMS*/ #ifndef __STDC__ # ifndef const # define const # endif #endif #define _IO_UNIFIED_JUMPTABLES 1 #ifndef _G_HAVE_PRINTF_FP # define _IO_USE_DTOA 1 #endif #ifndef EOF # define EOF (-1) #endif #ifndef NULL # if defined __GNUG__ && \ (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) # define NULL (__null) # else # if !defined(__cplusplus) # define NULL ((void*)0) # else # define NULL (0) # endif # endif #endif #define _IOS_INPUT 1 #define _IOS_OUTPUT 2 #define _IOS_ATEND 4 #define _IOS_APPEND 8 #define _IOS_TRUNC 16 #define _IOS_NOCREATE 32 #define _IOS_NOREPLACE 64 #define _IOS_BIN 128 /* Magic numbers and bits for the _flags field. The magic numbers use the high-order bits of _flags; the remaining bits are available for variable flags. Note: The magic numbers must all be negative if stdio emulation is desired. */ #define _IO_MAGIC 0xFBAD0000 /* Magic number */ #define _OLD_STDIO_MAGIC 0xFABC0000 /* Emulate old stdio. */ #define _IO_MAGIC_MASK 0xFFFF0000 #define _IO_USER_BUF 1 /* User owns buffer; don't delete it on close. */ #define _IO_UNBUFFERED 2 #define _IO_NO_READS 4 /* Reading not allowed */ #define _IO_NO_WRITES 8 /* Writing not allowd */ #define _IO_EOF_SEEN 0x10 #define _IO_ERR_SEEN 0x20 #define _IO_DELETE_DONT_CLOSE 0x40 /* Don't call close(_fileno) on cleanup. */ #define _IO_LINKED 0x80 /* Set if linked (using _chain) to streambuf::_list_all.*/ #define _IO_IN_BACKUP 0x100 #define _IO_LINE_BUF 0x200 #define _IO_TIED_PUT_GET 0x400 /* Set if put and get pointer logicly tied. */ #define _IO_CURRENTLY_PUTTING 0x800 #define _IO_IS_APPENDING 0x1000 #define _IO_IS_FILEBUF 0x2000 #define _IO_BAD_SEEN 0x4000 #define _IO_USER_LOCK 0x8000 /* These are "formatting flags" matching the iostream fmtflags enum values. */ #define _IO_SKIPWS 01 #define _IO_LEFT 02 #define _IO_RIGHT 04 #define _IO_INTERNAL 010 #define _IO_DEC 020 #define _IO_OCT 040 #define _IO_HEX 0100 #define _IO_SHOWBASE 0200 #define _IO_SHOWPOINT 0400 #define _IO_UPPERCASE 01000 #define _IO_SHOWPOS 02000 #define _IO_SCIENTIFIC 04000 #define _IO_FIXED 010000 #define _IO_UNITBUF 020000 #define _IO_STDIO 040000 #define _IO_DONT_CLOSE 0100000 #define _IO_BOOLALPHA 0200000 struct _IO_jump_t; struct _IO_FILE; /* Handle lock. */ #ifdef _IO_MTSAFE_IO # if defined __GLIBC__ && __GLIBC__ >= 2 # if __GLIBC_MINOR__ == 0 # include <stdio-lock.h> # else # include <bits/stdio-lock.h> # endif # else /*# include <comthread.h>*/ # endif #else typedef void _IO_lock_t; #endif /* A streammarker remembers a position in a buffer. */ struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; /* If _pos >= 0 it points to _buf->Gbase()+_pos. FIXME comment */ /* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */ int _pos; #if 0 void set_streampos(streampos sp) { _spos = sp; } void set_offset(int offset) { _pos = offset; _spos = (streampos)(-2); } public: streammarker(streambuf *sb); ~streammarker(); int saving() { return _spos == -2; } int delta(streammarker&); int delta(); #endif }; /* This is the structure from the libstdc++ codecvt class. */ enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T) /* The order of the elements in the following struct must match the order of the virtual functions in the libstdc++ codecvt class. */ struct _IO_codecvt { void (*__codecvt_destr) (struct _IO_codecvt *); enum __codecvt_result (*__codecvt_do_out) (struct _IO_codecvt *, __c_mbstate_t *, const wchar_t *, const wchar_t *, const wchar_t **, char *, char *, char **); enum __codecvt_result (*__codecvt_do_unshift) (struct _IO_codecvt *, __c_mbstate_t *, char *, char *, char **); enum __codecvt_result (*__codecvt_do_in) (struct _IO_codecvt *, __c_mbstate_t *, const char *, const char *, const char **, wchar_t *, wchar_t *, wchar_t **); int (*__codecvt_do_encoding) (struct _IO_codecvt *); int (*__codecvt_do_always_noconv) (struct _IO_codecvt *); int (*__codecvt_do_length) (struct _IO_codecvt *, __c_mbstate_t *, const char *, const char *, _IO_size_t); int (*__codecvt_do_max_length) (struct _IO_codecvt *); _IO_iconv_t __cd_in; _IO_iconv_t __cd_out; }; /* Extra data for wide character streams. */ struct _IO_wide_data { wchar_t *_IO_read_ptr; /* Current read pointer */ wchar_t *_IO_read_end; /* End of get area. */ wchar_t *_IO_read_base; /* Start of putback+get area. */ wchar_t *_IO_write_base; /* Start of put area. */ wchar_t *_IO_write_ptr; /* Current put pointer. */ wchar_t *_IO_write_end; /* End of put area. */ wchar_t *_IO_buf_base; /* Start of reserve area. */ wchar_t *_IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ wchar_t *_IO_save_base; /* Pointer to start of non-current get area. */ wchar_t *_IO_backup_base; /* Pointer to first valid character of backup area */ wchar_t *_IO_save_end; /* Pointer to end of non-current get area. */ #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T) __c_mbstate_t _IO_state; __c_mbstate_t _IO_last_state; #endif struct _IO_codecvt _codecvt; wchar_t _shortbuf[1]; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T) struct _IO_jump_t *_wide_vtable; #endif }; #else /* !(defined _LIBC || defined _GLIBCPP_USE_WCHAR_T) */ /* Because _IO_no_init unconditionally takes a `_IO_wide_data*' as its last parameter we must still define this type. We intentionally leave it incomplete to prevent any use of this type when we are not supporting wide characters. */ struct _IO_wide_data; #endif /* !(defined _LIBC || defined _GLIBCPP_USE_WCHAR_T) */ struct _IO_FILE { int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ #define _IO_file_flags _flags /* The following pointers correspond to the C++ streambuf protocol. */ /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */ char* _IO_read_ptr; /* Current read pointer */ char* _IO_read_end; /* End of get area. */ char* _IO_read_base; /* Start of putback+get area. */ char* _IO_write_base; /* Start of put area. */ char* _IO_write_ptr; /* Current put pointer. */ char* _IO_write_end; /* End of put area. */ char* _IO_buf_base; /* Start of reserve area. */ char* _IO_buf_end; /* End of reserve area. */ /* The following fields are used to support backing up and undo. */ char *_IO_save_base; /* Pointer to start of non-current get area. */ char *_IO_backup_base; /* Pointer to first valid character of backup area */ char *_IO_save_end; /* Pointer to end of non-current get area. */ struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _blksize; _IO_off_t _old_offset; /* This used to be _offset but it's too small. */ #define __HAVE_COLUMN /* temporary */ /* 1+column number of pbase(); 0 is unknown. */ unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; /* char* _save_gptr; char* _save_egptr; */ _IO_lock_t *_lock; #ifdef _IO_USE_OLD_IO_FILE }; struct _IO_FILE_complete { struct _IO_FILE _file; #endif #if defined _G_IO_IO_FILE_VERSION && _G_IO_IO_FILE_VERSION == 0x20001 _IO_off64_t _offset; # if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T) /* Wide character stream stuff. */ struct _IO_codecvt *_codecvt; struct _IO_wide_data *_wide_data; # else void *__pad1; void *__pad2; # endif int _mode; /* Make sure we don't get into trouble again. */ char _unused2[15 * sizeof (int) - 2 * sizeof (void *)]; #endif }; #ifndef __cplusplus typedef struct _IO_FILE _IO_FILE; #endif struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; #ifndef _LIBC #define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_)) #define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_)) #define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_)) #else extern _IO_FILE *_IO_stdin; extern _IO_FILE *_IO_stdout; extern _IO_FILE *_IO_stderr; #endif /* Functions to do I/O and file management for a stream. */ /* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF. Return number of bytes read. */ typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); /* Write N bytes pointed to by BUF to COOKIE. Write all N bytes unless there is an error. Return number of bytes written, or -1 if there is an error without writing anything. If the file has been opened for append (__mode.__append set), then set the file pointer to the end of the file and then do the write; if not, just write at the current file pointer. */ typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, size_t __n); /* Move COOKIE's file position to *POS bytes from the beginning of the file (if W is SEEK_SET), the current position (if W is SEEK_CUR), or the end of the file (if W is SEEK_END). Set *POS to the new file position. Returns zero if successful, nonzero if not. */ typedef int __io_seek_fn (void *__cookie, _IO_off64_t *__pos, int __w); /* Close COOKIE. */ typedef int __io_close_fn (void *__cookie); #ifdef _GNU_SOURCE /* User-visible names for the above. */ typedef __io_read_fn cookie_read_function_t; typedef __io_write_fn cookie_write_function_t; typedef __io_seek_fn cookie_seek_function_t; typedef __io_close_fn cookie_close_function_t; /* The structure with the cookie function pointers. */ typedef struct { __io_read_fn *read; /* Read bytes. */ __io_write_fn *write; /* Write bytes. */ __io_seek_fn *seek; /* Seek/tell file position. */ __io_close_fn *close; /* Close file. */ } _IO_cookie_io_functions_t; typedef _IO_cookie_io_functions_t cookie_io_functions_t; struct _IO_cookie_file; /* Initialize one of those. */ extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write, void *__cookie, _IO_cookie_io_functions_t __fns); #endif #ifdef __cplusplus extern "C" { #endif extern int __underflow (_IO_FILE *) __THROW; extern int __uflow (_IO_FILE *) __THROW; extern int __overflow (_IO_FILE *, int) __THROW; extern _IO_wint_t __wunderflow (_IO_FILE *) __THROW; extern _IO_wint_t __wuflow (_IO_FILE *) __THROW; extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t) __THROW; #define _IO_getc_unlocked(_fp) \ ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end ? __uflow (_fp) \ : *(unsigned char *) (_fp)->_IO_read_ptr++) #define _IO_peekc_unlocked(_fp) \ ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end \ && __underflow (_fp) == EOF ? EOF \ : *(unsigned char *) (_fp)->_IO_read_ptr) #define _IO_putc_unlocked(_ch, _fp) \ (((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end) \ ? __overflow (_fp, (unsigned char) (_ch)) \ : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch))) #define _IO_getwc_unlocked(_fp) \ ((_fp)->_wide_data->_IO_read_ptr >= (_fp)->_wide_data->_IO_read_end \ ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++) #define _IO_putwc_unlocked(_wch, _fp) \ ((_fp)->_wide_data->_IO_write_ptr >= (_fp)->_wide_data->_IO_write_end \ ? __woverflow (_fp, _wch) \ : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch))) #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0) #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0) extern int _IO_getc (_IO_FILE *__fp) __THROW; extern int _IO_putc (int __c, _IO_FILE *__fp) __THROW; extern int _IO_feof (_IO_FILE *__fp) __THROW; extern int _IO_ferror (_IO_FILE *__fp) __THROW; extern int _IO_peekc_locked (_IO_FILE *__fp) __THROW; /* This one is for Emacs. */ #define _IO_PENDING_OUTPUT_COUNT(_fp) \ ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base) extern void _IO_flockfile (_IO_FILE *) __THROW; extern void _IO_funlockfile (_IO_FILE *) __THROW; extern int _IO_ftrylockfile (_IO_FILE *) __THROW; #ifdef _IO_MTSAFE_IO # define _IO_peekc(_fp) _IO_peekc_locked (_fp) #else # define _IO_peekc(_fp) _IO_peekc_unlocked (_fp) # define _IO_flockfile(_fp) /**/ # define _IO_funlockfile(_fp) /**/ # define _IO_ftrylockfile(_fp) /**/ # define _IO_cleanup_region_start(_fct, _fp) /**/ # define _IO_cleanup_region_end(_Doit) /**/ #endif /* !_IO_MTSAFE_IO */ extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, _IO_va_list, int *__restrict) __THROW; extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, _IO_va_list) __THROW; extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t) __THROW; extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t) __THROW; extern _IO_off64_t _IO_seekoff (_IO_FILE *, _IO_off64_t, int, int) __THROW; extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int) __THROW; extern void _IO_free_backup_area (_IO_FILE *) __THROW; #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T) extern _IO_wint_t _IO_getwc (_IO_FILE *__fp) __THROW; extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp) __THROW; extern int _IO_fwide (_IO_FILE *__fp, int __mode) __THROW; # if __GNUC__ >= 2 /* A special optimized version of the function above. It optimizes the case of initializing an unoriented byte stream. */ # define _IO_fwide(__fp, __mode) \ ({ int __result = (__mode); \ if (__result < 0) \ { \ if ((__fp)->_mode == 0) \ /* We know that all we have to do is to set the flag. */ \ (__fp)->_mode = -1; \ __result = (__fp)->_mode; \ } \ else \ __result = _IO_fwide (__fp, __result); \ __result; }) # endif extern int _IO_vfwscanf (_IO_FILE * __restrict, const wchar_t * __restrict, _IO_va_list, int *__restrict) __THROW; extern int _IO_vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict, _IO_va_list) __THROW; extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t) __THROW; extern void _IO_free_wbackup_area (_IO_FILE *) __THROW; #endif #ifdef __cplusplus } #endif #endif /* _IO_STDIO_H */ ```
```python from __future__ import division import numpy as np import pytest from numpy.testing import assert_almost_equal from mla.metrics.base import check_data, validate_input from mla.metrics.metrics import get_metric def test_data_validation(): with pytest.raises(ValueError): check_data([], 1) with pytest.raises(ValueError): check_data([1, 2, 3], [3, 2]) a, b = check_data([1, 2, 3], [3, 2, 1]) assert np.all(a == np.array([1, 2, 3])) assert np.all(b == np.array([3, 2, 1])) def metric(name): return validate_input(get_metric(name)) def test_classification_error(): f = metric("classification_error") assert f([1, 2, 3, 4], [1, 2, 3, 4]) == 0 assert f([1, 2, 3, 4], [1, 2, 3, 5]) == 0.25 assert f([1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 0, 0]) == (1.0 / 6) def test_absolute_error(): f = metric("absolute_error") assert f([3], [5]) == [2] assert f([-1], [-4]) == [3] def test_mean_absolute_error(): f = metric("mean_absolute_error") assert f([1, 2, 3], [1, 2, 3]) == 0 assert f([1, 2, 3], [3, 2, 1]) == 4 / 3 def test_squared_error(): f = metric("squared_error") assert f([1], [1]) == [0] assert f([3], [1]) == [4] def test_squared_log_error(): f = metric("squared_log_error") assert f([1], [1]) == [0] assert f([3], [1]) == [np.log(2) ** 2] assert f([np.exp(2) - 1], [np.exp(1) - 1]) == [1.0] def test_mean_squared_log_error(): f = metric("mean_squared_log_error") assert f([1, 2, 3], [1, 2, 3]) == 0 assert f([1, 2, 3, np.exp(1) - 1], [1, 2, 3, np.exp(2) - 1]) == 0.25 def test_root_mean_squared_log_error(): f = metric("root_mean_squared_log_error") assert f([1, 2, 3], [1, 2, 3]) == 0 assert f([1, 2, 3, np.exp(1) - 1], [1, 2, 3, np.exp(2) - 1]) == 0.5 def test_mean_squared_error(): f = metric("mean_squared_error") assert f([1, 2, 3], [1, 2, 3]) == 0 assert f(range(1, 5), [1, 2, 3, 6]) == 1 def test_root_mean_squared_error(): f = metric("root_mean_squared_error") assert f([1, 2, 3], [1, 2, 3]) == 0 assert f(range(1, 5), [1, 2, 3, 5]) == 0.5 def test_multiclass_logloss(): f = metric("logloss") assert_almost_equal(f([1], [1]), 0) assert_almost_equal(f([1, 1], [1, 1]), 0) assert_almost_equal(f([1], [0.5]), -np.log(0.5)) ```
```html <!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it 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 version 2 for more details (a copy is included in the LICENSE file that accompanied this code). 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. --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> Creates a skeleton VisualVM tab. </body> </html> ```
```xml declare module "react-native-background-fetch" { interface AbstractConfig { /** * [Android only] Set false to continue background-fetch events after user terminates the app. Default to true. */ stopOnTerminate?:boolean; /** * [Android only] Set true to initiate background-fetch events when the device is rebooted. Defaults to false. */ startOnBoot?:boolean; /** * [Android only] Set true to enable Headless mechanism for handling fetch events after app termination. */ enableHeadless?:boolean; /** * [Android only] */ forceAlarmManager?:boolean; /** * [Android only] Set detailed description of the kind of network your job requires. * * If your job doesn't need a network connection, you don't need to use this option, as the default is [[BackgroundFetch.NEWORK_TYPE_NONE]]. * * Calling this method defines network as a strict requirement for your job. If the network requested is not available your job will never run. */ requiredNetworkType?:NetworkType; /** * [Android only] Specify that to run this job, the device's battery level must not be low. * * This defaults to false. If true, the job will only run when the battery level is not low, which is generally the point where the user is given a "low battery" warning. */ requiresBatteryNotLow?:boolean; /** * [Android only] Specify that to run this job, the device's available storage must not be low. * * This defaults to false. If true, the job will only run when the device is not in a low storage state, which is generally the point where the user is given a "low storage" warning. */ requiresStorageNotLow?:boolean; /** * [Android only] Specify that to run this job, the device must be charging (or be a non-battery-powered device connected to permanent power, such as Android TV devices). This defaults to false. */ requiresCharging?:boolean; /** * [Android only] When set true, ensure that this job will not run if the device is in active use. * * The default state is false: that is, the for the job to be runnable even when someone is interacting with the device. * * This state is a loose definition provided by the system. In general, it means that the device is not currently being used interactively, and has not been in use for some time. As such, it is a good time to perform resource heavy jobs. Bear in mind that battery usage will still be attributed to your application, and surfaced to the user in battery stats. */ requiresDeviceIdle?:boolean; } interface TaskConfig extends AbstractConfig { /** * The name of the task. This will be used with [[BackgroundFetch.finish]] to signal task-completion. */ taskId:string; /** * The minimum interval in milliseconds to execute this task. */ delay:number; /** * Whether this task will continue executing or just a "one-shot". */ periodic?:boolean; /** * When set true, ensure that this job will run if the device has network connection. */ requiresNetworkConnectivity?:boolean; } interface BackgroundFetchConfig extends AbstractConfig { /** * The minimum interval in minutes to execute background fetch events. Defaults to 15 minutes. Minimum is 15 minutes. */ minimumFetchInterval?:number; } /** * | BackgroundFetchStatus | Description | * |------------------------------------|-------------------------------------------------| * | BackgroundFetch.STATUS_RESTRICTED | Background fetch updates are unavailable and the user cannot enable them again. For example, this status can occur when parental controls are in effect for the current user. | * | BackgroundFetch.STATUS_DENIED | The user explicitly disabled background behavior for this app or for the whole system. | * | BackgroundFetch.STATUS_AVAILABLE | Background fetch is available and enabled. | */ type BackgroundFetchStatus = 0 | 1 | 2; /** * | NetworkType | Description | * |---------------------------------------|---------------------------------------------------------------| * | BackgroundFetch.NETWORK_TYPE_NONE | This job doesn't care about network constraints, either any or none. | * | BackgroundFetch.NETWORK_TYPE_ANY | This job requires network connectivity. | * | BackgroundFetch.NETWORK_TYPE_CELLULAR | This job requires network connectivity that is a cellular network. | * | BackgroundFetch.NETWORK_TYPE_UNMETERED | This job requires network connectivity that is unmetered. | * | BackgroundFetch.NETWORK_TYPE_NOT_ROAMING | This job requires network connectivity that is not roaming. | */ type NetworkType = 0 | 1 | 2 | 3 | 4; export interface HeadlessEvent { /** * The name of the task. This will be used with [[BackgroundFetch.finish]] to signal task-completion. */ taskId: string; /** * Whether this event is a timeout event or not. If true stop all processing and call [[BackgroundFetch.finish]] immediately. */ timeout: boolean; } /** * BackgroundFetch is a module to receive periodic callbacks (min every 15 min) while your app is running in the background or terminated. */ export default class BackgroundFetch { /** * Background fetch updates are unavailable and the user cannot enable them again. For example, this status can occur when parental controls are in effect for the current user. */ static STATUS_RESTRICTED: BackgroundFetchStatus; /** * The user explicitly disabled background behavior for this app or for the whole system. */ static STATUS_DENIED: BackgroundFetchStatus; /** * Background fetch is available and enabled. */ static STATUS_AVAILABLE: BackgroundFetchStatus; /** * This job doesn't care about network constraints, either any or none. */ static NETWORK_TYPE_NONE: NetworkType; /** * This job requires network connectivity. */ static NETWORK_TYPE_ANY: NetworkType; /** * This job requires network connectivity that is a cellular network. */ static NETWORK_TYPE_CELLULAR: NetworkType; /** * This job requires network connectivity that is unmetered. */ static NETWORK_TYPE_UNMETERED: NetworkType; /** * This job requires network connectivity that is not roaming. */ static NETWORK_TYPE_NOT_ROAMING: NetworkType; /** * Initial configuration of BackgroundFetch, including config-options and Fetch-callback. The [[start]] method will automatically be executed. */ static configure(config:BackgroundFetchConfig, onEvent:(taskId:string) => void, onTimeout?:(taskId:string) => void):Promise<BackgroundFetchStatus>; /** * Add an extra fetch event listener in addition to the one initially provided to [[configure]]. * @event */ static scheduleTask(config:TaskConfig):Promise<boolean>; /** * Start subscribing to fetch events. */ static start():Promise<BackgroundFetchStatus>; /** * Stop subscribing to fetch events. */ static stop(taskId?:string):Promise<boolean>; /** * You must execute [[finish]] within your fetch-callback to signal completion of your task. */ static finish(taskId?:string):void; /** * Query the BackgroundFetch API status * * | BackgroundFetchStatus | Description | * |------------------------------------|-------------------------------------------------| * | BackgroundFetch.STATUS_RESTRICTED | Background fetch updates are unavailable and the user cannot enable them again. For example, this status can occur when parental controls are in effect for the current user. | * | BackgroundFetch.STATUS_DENIED | The user explicitly disabled background behavior for this app or for the whole system. | * | BackgroundFetch.STATUS_AVAILABLE | Background fetch is available and enabled. | */ static status(callback?:(status:BackgroundFetchStatus) => void):Promise<BackgroundFetchStatus>; /** * [Android only] Register a function to execute when the app is terminated. Requires stopOnTerminate: false. */ static registerHeadlessTask(task:(event:HeadlessEvent) => Promise<void>):void; } } ```
A by-election was held for the Australian House of Representatives seat of Cook on 21 May 1955. This was triggered by the death of Labor MP Tom Sheehan. The by-election was won by Labor candidate Jim Cope. The governing Liberal Party did not nominate a candidate, which resulted in Cope receiving over 85% of the first preference vote. Results References 1955 elections in Australia New South Wales federal by-elections
```xml <?xml version="1.0" encoding="UTF-8" ?> <!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. --> <!-- It contains information about your site's posts, pages, comments, categories, and other content. --> <!-- You may use this file to transfer that content from one site to another. --> <!-- NB: This file is not intended to serve as a complete backup of your blog. --> <!-- To import this information into a WordPress site follow these steps: --> <!-- 1. Log in to that site as an administrator. --> <!-- 2. Go to Tools: Import in the WordPress admin panel. --> <!-- 3. Install the "WordPress" importer from the list. --> <!-- 4. Activate & Run Importer. --> <!-- 5. Upload this file using the form provided on that page. --> <!-- 6. You will first be asked to map the authors in this export file to users --> <!-- on the site. For each author, you may choose to map to an --> <!-- existing user on the site or to create a new user. --> <!-- 7. WordPress will then import each of the posts, pages comments, categories, etc. --> <!-- contained in this file into your blog. --> <!-- generator="WordPress/3.1-alpha" created="2010-10-09 15:12" --> <rss version="2.0" xmlns:excerpt="path_to_url" xmlns:content="path_to_url" xmlns:wfw="path_to_url" xmlns:dc="path_to_url" xmlns:wp="path_to_url" > <notachanneltag> <title>WXR Test Data</title> <link>path_to_url <description>Blog with sample content for testing</description> <pubDate>Sat, 09 Oct 2010 15:12:29 +0000</pubDate> <language>en</language> <wp:wxr_version>abc</wp:wxr_version> <wp:base_site_url>path_to_url <wp:base_blog_url>path_to_url <wp:author><wp:author_login>john</wp:author_login><wp:author_email>johndoe@example.org</wp:author_email><wp:author_display_name><![CDATA[John Doe]]></wp:author_display_name><wp:author_first_name><![CDATA[John]]></wp:author_first_name><wp:author_last_name><![CDATA[Doe]]></wp:author_last_name></wp:author> <wp:category><wp:term_id>1</wp:term_id><wp:category_nicename>alpha</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[alpha]]></wp:cat_name></wp:category> <wp:category><wp:term_id>2</wp:term_id><wp:category_nicename>bar</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Bar]]></wp:cat_name></wp:category> <wp:category><wp:term_id>3</wp:term_id><wp:category_nicename>beta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[beta]]></wp:cat_name></wp:category> <wp:category><wp:term_id>4</wp:term_id><wp:category_nicename>delta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[delta]]></wp:cat_name></wp:category> <wp:category><wp:term_id>5</wp:term_id><wp:category_nicename>epsilon</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[epsilon]]></wp:cat_name></wp:category> <wp:category><wp:term_id>6</wp:term_id><wp:category_nicename>eta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[eta]]></wp:cat_name></wp:category> <wp:category><wp:term_id>7</wp:term_id><wp:category_nicename>foo</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Foo]]></wp:cat_name></wp:category> <wp:category><wp:term_id>8</wp:term_id><wp:category_nicename>foo-bar</wp:category_nicename><wp:category_parent>bar</wp:category_parent><wp:cat_name><![CDATA[Foo]]></wp:cat_name></wp:category> <wp:category><wp:term_id>9</wp:term_id><wp:category_nicename>gamma</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[gamma]]></wp:cat_name></wp:category> <wp:category><wp:term_id>10</wp:term_id><wp:category_nicename>iota</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[iota]]></wp:cat_name></wp:category> <wp:category><wp:term_id>11</wp:term_id><wp:category_nicename>kappa</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[kappa]]></wp:cat_name></wp:category> <wp:category><wp:term_id>12</wp:term_id><wp:category_nicename>lambda</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[lambda]]></wp:cat_name></wp:category> <wp:category><wp:term_id>13</wp:term_id><wp:category_nicename>level-1</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Level 1]]></wp:cat_name></wp:category> <wp:category><wp:term_id>14</wp:term_id><wp:category_nicename>level-2</wp:category_nicename><wp:category_parent>level-1</wp:category_parent><wp:cat_name><![CDATA[Level 2]]></wp:cat_name></wp:category> <wp:category><wp:term_id>15</wp:term_id><wp:category_nicename>level-3</wp:category_nicename><wp:category_parent>level-2</wp:category_parent><wp:cat_name><![CDATA[Level 3]]></wp:cat_name></wp:category> <wp:category><wp:term_id>16</wp:term_id><wp:category_nicename>parent</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[pArEnT]]></wp:cat_name></wp:category> <wp:category><wp:term_id>17</wp:term_id><wp:category_nicename>theta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[theta]]></wp:cat_name></wp:category> <wp:category><wp:term_id>18</wp:term_id><wp:category_nicename>uncategorized</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name></wp:category> <wp:category><wp:term_id>19</wp:term_id><wp:category_nicename>zeta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[zeta]]></wp:cat_name></wp:category> <wp:category><wp:term_id>20</wp:term_id><wp:category_nicename>also-level-3</wp:category_nicename><wp:category_parent>level-2</wp:category_parent><wp:cat_name><![CDATA[Also Level 3]]></wp:cat_name></wp:category> <wp:category><wp:term_id>21</wp:term_id><wp:category_nicename>child</wp:category_nicename><wp:category_parent>parent</wp:category_parent><wp:cat_name><![CDATA[CHILD]]></wp:cat_name></wp:category> <wp:tag><wp:term_id>22</wp:term_id><wp:tag_slug>clippable</wp:tag_slug><wp:tag_name><![CDATA[Clippable]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>23</wp:term_id><wp:tag_slug>deuterogamy</wp:tag_slug><wp:tag_name><![CDATA[Deuterogamy]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>24</wp:term_id><wp:tag_slug>entablement</wp:tag_slug><wp:tag_name><![CDATA[Entablement]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>25</wp:term_id><wp:tag_slug>intermembral</wp:tag_slug><wp:tag_name><![CDATA[Intermembral]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>26</wp:term_id><wp:tag_slug>masticatory</wp:tag_slug><wp:tag_name><![CDATA[Masticatory]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>27</wp:term_id><wp:tag_slug>obligato</wp:tag_slug><wp:tag_name><![CDATA[Obligato]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>28</wp:term_id><wp:tag_slug>occultation</wp:tag_slug><wp:tag_name><![CDATA[Occultation]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>29</wp:term_id><wp:tag_slug>onion</wp:tag_slug><wp:tag_name><![CDATA[Onion]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>30</wp:term_id><wp:tag_slug>pontonier</wp:tag_slug><wp:tag_name><![CDATA[Pontonier]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>31</wp:term_id><wp:tag_slug>rooftree</wp:tag_slug><wp:tag_name><![CDATA[Rooftree]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>32</wp:term_id><wp:tag_slug>saccule</wp:tag_slug><wp:tag_name><![CDATA[Saccule]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>33</wp:term_id><wp:tag_slug>salpa</wp:tag_slug><wp:tag_name><![CDATA[Salpa]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>34</wp:term_id><wp:tag_slug>tag-1</wp:tag_slug><wp:tag_name><![CDATA[tag 1]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>35</wp:term_id><wp:tag_slug>tag-2</wp:tag_slug><wp:tag_name><![CDATA[tag 2]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>36</wp:term_id><wp:tag_slug>tag-3</wp:tag_slug><wp:tag_name><![CDATA[tag 3]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>37</wp:term_id><wp:tag_slug>tag-4</wp:tag_slug><wp:tag_name><![CDATA[tag 4]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>38</wp:term_id><wp:tag_slug>tag-5</wp:tag_slug><wp:tag_name><![CDATA[tag 5]]></wp:tag_name></wp:tag> <wp:tag><wp:term_id>39</wp:term_id><wp:tag_slug>tentage</wp:tag_slug><wp:tag_name><![CDATA[Tentage]]></wp:tag_name></wp:tag> <wp:term><wp:term_id>40</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>bieup</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[bieup]]></wp:term_name></wp:term> <wp:term><wp:term_id>41</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>blah</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[blah]]></wp:term_name></wp:term> <wp:term><wp:term_id>42</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>digeut</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[digeut]]></wp:term_name></wp:term> <wp:term><wp:term_id>43</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>giyeok</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[giyeok]]></wp:term_name></wp:term> <wp:term><wp:term_id>44</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>halb</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[halb]]></wp:term_name></wp:term> <wp:term><wp:term_id>45</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>mieum</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[mieum]]></wp:term_name></wp:term> <wp:term><wp:term_id>46</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>nieun</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[nieun]]></wp:term_name></wp:term> <wp:term><wp:term_id>47</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>parent-2</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[Parent]]></wp:term_name></wp:term> <wp:term><wp:term_id>48</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>rieul</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[rieul]]></wp:term_name></wp:term> <wp:term><wp:term_id>49</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>siot</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[siot]]></wp:term_name></wp:term> <wp:term><wp:term_id>50</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>tax-1</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[TAX 1]]></wp:term_name></wp:term> <wp:term><wp:term_id>51</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>tax-2</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[TAX 2]]></wp:term_name></wp:term> <wp:term><wp:term_id>52</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>blah-halb</wp:term_slug><wp:term_parent>halb</wp:term_parent><wp:term_name><![CDATA[blah]]></wp:term_name></wp:term> <wp:term><wp:term_id>53</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>child-parent-2</wp:term_slug><wp:term_parent>parent-2</wp:term_parent><wp:term_name><![CDATA[chilD]]></wp:term_name></wp:term> </channel> </rss> ```
```xml import { Entity, OneToMany, PrimaryColumn, VirtualColumn, BaseEntity, } from "../../../../src" import Employee from "./Employee" @Entity({ name: "companies" }) export default class Company extends BaseEntity { @PrimaryColumn("varchar", { length: 50 }) name: string @VirtualColumn({ query: (alias) => `SELECT COUNT("name") FROM "employees" WHERE "companyName" = ${alias}.name`, }) totalEmployeesCount: number @OneToMany((type) => Employee, (employee) => employee.company) employees: Employee[] } ```
The Singh Krora or Karorsinghia Misl, also known as the Panjgarhia Misl, was a Sikh misl. History Sirdar Karora Singh Virk, resident of Barki (district Lahore) was the first chief of this Misl; earlier, Karora Singh was the deputy of the jatha led by Sirdar Sham Singh of village Narli (district Lahore); after the death of Sham Singh in 1739, Sirdar Karam Singh Uppal (of village Pechgarh) became the chief of this Jatha; he too died in early days of 1748 and Karora Singh became the chief of the Jatha. In March 1748, when the Misls were formed, his jatha became a Misl; then this jatha came to known as Karorsinghia Misl. Karora Singh had the command of 7-8 thousand horsemen; his first possessions were Hariana and Sham Churasi (in Hoshiarpur district); Karora Singh died in the Battle of Taravari in 1761. Karora Singh was succeeded by Baghel Singh Dhaliwal of Jhabal (district Amritsar); Baghel Singh was fond of adventures; he left the Majha area and launched his actions in Karnal, Saharanpur and other areas of Gang-Doab; he was one of those five generals who unfurled blue Khalsa flag on Red Fort at Delhi on the 11th of March 1783. Baghel Singh had an army of thirty thousand soldiers; the ground where his army used to pitch its tents is still known as Tees Hazari (literally: associated with thirty thousands). Baghel Singh died in 1802; he was succeeded by his wife Rattan Kaur. Leaders See also Kalsia State References Further reading Misls
```objective-c // // ConversationController.h // TUIKitDemo // // Created by kennethmiao on 2018/10/10. // /** IM Demo * * * * TUIKitIMSDK */ #import <UIKit/UIKit.h> @interface ConversationController : UIViewController /** * */ - (void)pushToChatViewController:(NSString *)groupID userID:(NSString *)userID; @end ```
```python from typing import Optional from office365.entity import Entity from office365.runtime.client_result import ClientResult from office365.runtime.queries.service_operation import ServiceOperationQuery from office365.runtime.types.collections import StringCollection class ApplicationTemplate(Entity): """Represents an application in the Azure AD application gallery.""" def instantiate(self, display_name): """ Add an instance of an application from the Azure AD application gallery into your directory. You can also use this API to instantiate non-gallery apps. Use the following ID for the applicationTemplate object: 8adf8e6e-67b2-4cf2-a259-e3dc5476c621. :param str display_name: Custom name of the application """ return_type = ClientResult(self.context) payload = {"displayName": display_name} qry = ServiceOperationQuery( self, "instantiate", None, payload, None, return_type ) self.context.add_query(qry) return return_type @property def display_name(self): # type: () -> Optional[str] """The name of the application.""" return self.properties.get("displayName", None) @property def categories(self): """ The list of categories for the application. Supported values can be: Collaboration, Business Management, Consumer, Content management, CRM, Data services, Developer services, E-commerce, Education, ERP, Finance, Health, Human resources, IT infrastructure, Mail, Management, Marketing, Media, Productivity, Project management, Telecommunications, Tools, Travel, and Web design & hosting. """ return self.properties.get("categories", StringCollection()) @property def supported_provisioning_types(self): """The list of provisioning modes supported by this application""" return self.properties.get("supportedProvisioningTypes", StringCollection()) @property def supported_single_signon_modes(self): """ The list of single sign-on modes supported by this application. The supported values are oidc, password, saml, and notSupported. """ return self.properties.get("supportedSingleSignOnModes", StringCollection()) ```
Idalus affinis is a moth of the family Erebidae. It was described by Rothschild in 1917. It is found in Brazil (Santa Catharina). References Natural History Museum Lepidoptera generic names catalog affinis Moths described in 1917
```python #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ TFC - Onion-routed, endpoint secure messaging system This file is part of TFC. TFC is free software: you can redistribute it and/or modify it under the terms TFC 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 along with TFC. If not, see <path_to_url """ import os import typing from typing import Iterable, Iterator, List, Optional, Sized from src.common.database import TFCDatabase from src.common.encoding import (bool_to_bytes, pub_key_to_onion_address, str_to_bytes, pub_key_to_short_address, bytes_to_bool, onion_address_to_pub_key, bytes_to_str) from src.common.exceptions import CriticalError from src.common.misc import ensure_dir, get_terminal_width, separate_headers, split_byte_string from src.common.output import clear_screen from src.common.statics import (CONTACT_LENGTH, CONTACT_LIST_INDENT, DIR_USER_DATA, DUMMY_CONTACT, DUMMY_NICK, ECDHE, ENCODED_BOOLEAN_LENGTH, FINGERPRINT_LENGTH, KEX_STATUS_HAS_RX_PSK, KEX_STATUS_LENGTH, KEX_STATUS_NONE, KEX_STATUS_NO_RX_PSK, KEX_STATUS_PENDING, KEX_STATUS_UNVERIFIED, KEX_STATUS_VERIFIED, LOCAL_ID, ONION_SERVICE_PUBLIC_KEY_LENGTH, PSK) if typing.TYPE_CHECKING: from src.common.db_masterkey import MasterKey from src.common.db_settings import Settings from cryptography.hazmat.primitives.asymmetric.x448 import X448PrivateKey class Contact(object): """\ Contact object contains contact data not related to key management and hash ratchet state: onion_pub_key: The public key of the contact's v3 Tor Onion Service. The Relay Program on user's Networked Computer uses this public key to anonymously discover the Onion Service and to authenticate the end-to-end encryption used between Relay Computers. Since Relay Program might run on an amnesic distro like Tails, the Transmitter and Receiver Programs handle long-term storage of the contact's Onion Service public key. All `onion_pub_key` variables across the codebase refer to the public key of a contact (never that of the user). nick: As per Zooko's triangle and Stiegler's Petname Systems, .onion names (i.e., TFC accounts) cannot be global, secure and memorable at the same time*. To deal with hard to remember accounts, in TFC contacts (and groups) are managed mostly with nicknames assigned by the user. The nickname must be unique among both contacts and groups so that single command `/msg <selection>` can select a specific contact or group. Some nicknames are reserved so that messages from contacts cannot be confused with system messages of Receiver Program. Nicknames also have a length limit of 254 chars. * path_to_url#Whyare.onionnamescreatedthatway TFC stores the 32-byte public key fingerprints of the ECDHE key exchange into the contact database. These values allow the user to verify at any time no MITM attack took place during the key exchange. When PSKs are used, a null-byte string is used as a placeholder value. tx_fingerprint: The user's fingerprint. This fingerprint is derived from the user's public key which means it's automatically authentic. During verification over an authenticated channel, the user reads this value to the contact out loud. rx_fingerprint: The purported fingerprint for the contact. This fingerprint depends on the public key received from the insecure network and therefore, it shouldn't be trusted implicitly. During verification over an authenticated channel, the contact reads their `tx_fingerprint` to the user out loud, and the user then compares it to this purported value. kex_status: This byte remembers the key exchange status of the contact. TFC stores the contact-specific settings to the contact database: log_messages: This setting defines whether the Receiver Program on Destination Computer writes the assembly packets of a successfully received message into a log file. When logging is enabled, Transmitter Program will also log assembly packets of sent messages to its log file. file_reception: This setting defines whether the Receiver Program accepts files sent by the contact. The setting has no effect on user's Transmitter Program. notifications: This setting defines whether, in situations where some other window is active, the Receiver Program displays a notification about the contact sending a new message to their window. The setting has no effect on user's Transmitter Program. tfc_private_key: This value is an ephemerally stored private key for situations where the user interrupts the key exchange. The purpose of the value is to prevent the user from generating different ECDHE values when re-selecting the contact to continue the key exchange. Note that once a shared key is derived from this private key (and contact's public key), it is discarded. New private key will thus be generated if the users decide to exchange new keys with each other. """ def __init__(self, onion_pub_key: bytes, nick: str, tx_fingerprint: bytes, rx_fingerprint: bytes, kex_status: bytes, log_messages: bool, file_reception: bool, notifications: bool ) -> None: """Create a new Contact object. `self.short_address` is the truncated version of the account used to identify TFC account in printed messages. """ self.onion_pub_key = onion_pub_key self.nick = nick self.tx_fingerprint = tx_fingerprint self.rx_fingerprint = rx_fingerprint self.kex_status = kex_status self.log_messages = log_messages self.file_reception = file_reception self.notifications = notifications self.onion_address = pub_key_to_onion_address(self.onion_pub_key) self.short_address = pub_key_to_short_address(self.onion_pub_key) self.tfc_private_key = None # type: Optional[X448PrivateKey] def serialize_c(self) -> bytes: """Return contact data as a constant length byte string. This function serializes the contact's data into a byte string that has the exact length of 3*32 + 4*1 + 1024 = 1124 bytes. The length is guaranteed regardless of the content or length of the attributes' values, including the contact's nickname. The purpose of the constant length serialization is to hide any metadata about the contact the ciphertext length of the contact database would reveal. """ return (self.onion_pub_key + self.tx_fingerprint + self.rx_fingerprint + self.kex_status + bool_to_bytes(self.log_messages) + bool_to_bytes(self.file_reception) + bool_to_bytes(self.notifications) + str_to_bytes(self.nick)) def uses_psk(self) -> bool: """\ Return True if the user and the contact are using pre-shared keys (PSKs), else False. When the user sets up pre-shared keys with the contact, the key exchange status can only have two specific values (that remember whether the PSK of the contact has been imported). That fact can be used to determine whether the keys with contact were pre-shared. """ return self.kex_status in [KEX_STATUS_NO_RX_PSK, KEX_STATUS_HAS_RX_PSK] class ContactList(Iterable[Contact], Sized): """\ ContactList object manages TFC's Contact objects and the storage of the objects in an encrypted database. The main purpose of this object is to manage the `self.contacts` list that contains TFC's contacts. The database is stored on disk in encrypted form. Prior to encryption, the database is padded with dummy contacts. The dummy contacts hide the number of actual contacts that would otherwise be revealed by the size of the encrypted database. As long as the user has less than 50 contacts, the database will effectively hide the actual number of contacts. The maximum number of contacts (and thus the size of the database) can be changed by editing the `max_number_of_contacts` setting. This can however, in theory, reveal to a physical attacker the user has more than 50 contacts. The ContactList object also provides handy methods with human- readable names for making queries to the database. """ def __init__(self, master_key: 'MasterKey', settings: 'Settings') -> None: """Create a new ContactList object.""" self.settings = settings self.contacts = [] # type: List[Contact] self.dummy_contact = self.generate_dummy_contact() self.file_name = f'{DIR_USER_DATA}{settings.software_operation}_contacts' self.database = TFCDatabase(self.file_name, master_key) ensure_dir(DIR_USER_DATA) if os.path.isfile(self.file_name): self._load_contacts() else: self.store_contacts() def __iter__(self) -> Iterator[Contact]: """Iterate over Contact objects in `self.contacts`.""" yield from self.contacts def __len__(self) -> int: """Return the number of contacts in `self.contacts`. The Contact object that represents the local key is left out of the calculation. """ return len(self.get_list_of_contacts()) def store_contacts(self, replace: bool = True) -> None: """Write the list of contacts to an encrypted database. This function will first create a list of contacts and dummy contacts. It will then serialize every Contact object on that list and join the constant length byte strings to form the plaintext that will be encrypted and stored in the database. By default, TFC has a maximum number of 50 contacts. In addition, the database stores the contact that represents the local key (used to encrypt commands from Transmitter to Receiver Program). The plaintext length of 51 serialized contacts is 51*1124 = 57364 bytes. The ciphertext includes a 24-byte nonce and a 16-byte tag, so the size of the final database is 57313 bytes. """ pt_bytes = b''.join([c.serialize_c() for c in self.contacts + self._dummy_contacts()]) self.database.store_database(pt_bytes, replace) def _load_contacts(self) -> None: """Load contacts from the encrypted database. This function first reads and decrypts the database content. It then splits the plaintext into a list of 1124-byte blocks: each block contains the serialized data of one contact. Next, the function will remove from the list all dummy contacts (that start with dummy contact's public key). The function will then populate the `self.contacts` list with Contact objects, the data of which is sliced and decoded from the dummy-free blocks. """ pt_bytes = self.database.load_database() blocks = split_byte_string(pt_bytes, item_len=CONTACT_LENGTH) df_blocks = [b for b in blocks if not b.startswith(self.dummy_contact.onion_pub_key)] for block in df_blocks: if len(block) != CONTACT_LENGTH: raise CriticalError("Invalid data in contact database.") (onion_pub_key, tx_fingerprint, rx_fingerprint, kex_status_byte, log_messages_byte, file_reception_byte, notifications_byte, nick_bytes) = separate_headers(block, [ONION_SERVICE_PUBLIC_KEY_LENGTH] + 2*[FINGERPRINT_LENGTH] + [KEX_STATUS_LENGTH] + 3*[ENCODED_BOOLEAN_LENGTH]) self.contacts.append(Contact(onion_pub_key =onion_pub_key, tx_fingerprint=tx_fingerprint, rx_fingerprint=rx_fingerprint, kex_status =kex_status_byte, log_messages =bytes_to_bool(log_messages_byte), file_reception=bytes_to_bool(file_reception_byte), notifications =bytes_to_bool(notifications_byte), nick =bytes_to_str(nick_bytes))) @staticmethod def generate_dummy_contact() -> Contact: """Generate a dummy Contact object. The dummy contact simplifies the code around the constant length serialization when the data is stored to, or read from the database. """ return Contact(onion_pub_key =onion_address_to_pub_key(DUMMY_CONTACT), nick =DUMMY_NICK, tx_fingerprint=bytes(FINGERPRINT_LENGTH), rx_fingerprint=bytes(FINGERPRINT_LENGTH), kex_status =KEX_STATUS_NONE, log_messages =False, file_reception=False, notifications =False) def _dummy_contacts(self) -> List[Contact]: """\ Generate a list of dummy contacts for database padding. The number of dummy contacts depends on the number of actual contacts. The additional contact (+1) is the local contact used to represent the presence of the local key on Transmitter Program's `input_loop` process side that does not have access to the KeyList database that contains the local key. """ number_of_contacts_to_store = self.settings.max_number_of_contacts + 1 number_of_dummies = number_of_contacts_to_store - len(self.contacts) return [self.dummy_contact] * number_of_dummies def add_contact(self, onion_pub_key: bytes, nick: str, tx_fingerprint: bytes, rx_fingerprint: bytes, kex_status: bytes, log_messages: bool, file_reception: bool, notifications: bool ) -> None: """\ Add a new contact to `self.contacts` list and write changes to the database. Because TFC's hardware separation prevents automated DH-ratchet, the only way for the users to re-negotiate new keys is to start a new session by re-adding the contact. If the contact is re-added, TFC will need to remove the existing Contact object before adding the new one. In such case, TFC will update the nick, kex status, and fingerprints, but it will keep the old logging, file reception, and notification settings of the contact (as opposed to using the defaults determined by TFC's Settings object). """ if self.has_pub_key(onion_pub_key): current_contact = self.get_contact_by_pub_key(onion_pub_key) log_messages = current_contact.log_messages file_reception = current_contact.file_reception notifications = current_contact.notifications self.remove_contact_by_pub_key(onion_pub_key) self.contacts.append(Contact(onion_pub_key, nick, tx_fingerprint, rx_fingerprint, kex_status, log_messages, file_reception, notifications)) self.store_contacts() def remove_contact_by_pub_key(self, onion_pub_key: bytes) -> None: """Remove the contact that has a matching Onion Service public key. If the contact was found and removed, write changes to the database. """ for i, c in enumerate(self.contacts): if c.onion_pub_key == onion_pub_key: del self.contacts[i] self.store_contacts() break def remove_contact_by_address_or_nick(self, selector: str) -> None: """Remove the contact that has a matching nick or Onion Service address. If the contact was found and removed, write changes to the database. """ for i, c in enumerate(self.contacts): if selector in [c.onion_address, c.nick]: del self.contacts[i] self.store_contacts() break def get_contact_by_pub_key(self, onion_pub_key: bytes) -> Contact: """\ Return the Contact object from `self.contacts` list that has the matching Onion Service public key. """ return next(c for c in self.contacts if onion_pub_key == c.onion_pub_key) def get_contact_by_address_or_nick(self, selector: str) -> Contact: """\ Return the Contact object from `self.contacts` list that has the matching nick or Onion Service address. """ return next(c for c in self.contacts if selector in [c.onion_address, c.nick]) def get_nick_by_pub_key(self, onion_pub_key: bytes) -> str: """Return nick of contact that has a matching Onion Service public key.""" return next(c.nick for c in self.contacts if onion_pub_key == c.onion_pub_key) def get_list_of_contacts(self) -> List[Contact]: """Return list of Contact objects in `self.contacts` list.""" return [c for c in self.contacts if c.onion_address != LOCAL_ID] def get_list_of_addresses(self) -> List[str]: """Return list of contacts' TFC accounts.""" return [c.onion_address for c in self.contacts if c.onion_address != LOCAL_ID] def get_list_of_nicks(self) -> List[str]: """Return list of contacts' nicks.""" return [c.nick for c in self.contacts if c.onion_address != LOCAL_ID] def get_list_of_pub_keys(self) -> List[bytes]: """Return list of contacts' public keys.""" return [c.onion_pub_key for c in self.contacts if c.onion_address != LOCAL_ID] def get_list_of_pending_pub_keys(self) -> List[bytes]: """Return list of public keys for contacts that haven't completed key exchange yet.""" return [c.onion_pub_key for c in self.contacts if c.kex_status == KEX_STATUS_PENDING] def get_list_of_existing_pub_keys(self) -> List[bytes]: """Return list of public keys for contacts with whom key exchange has been completed.""" return [c.onion_pub_key for c in self.get_list_of_contacts() if c.kex_status in [KEX_STATUS_UNVERIFIED, KEX_STATUS_VERIFIED, KEX_STATUS_HAS_RX_PSK, KEX_STATUS_NO_RX_PSK]] def contact_selectors(self) -> List[str]: """Return list of string-type UIDs that can be used to select a contact.""" return self.get_list_of_addresses() + self.get_list_of_nicks() def has_contacts(self) -> bool: """Return True if ContactList has any contacts, else False.""" return any(self.get_list_of_contacts()) def has_only_pending_contacts(self) -> bool: """Return True if ContactList only has pending contacts, else False.""" return all(c.kex_status == KEX_STATUS_PENDING for c in self.get_list_of_contacts()) def has_pub_key(self, onion_pub_key: bytes) -> bool: """Return True if contact with public key exists, else False.""" return onion_pub_key in self.get_list_of_pub_keys() def has_local_contact(self) -> bool: """Return True if the local key has been exchanged, else False.""" return any(c.onion_address == LOCAL_ID for c in self.contacts) def print_contacts(self) -> None: """Print the list of contacts. Neatly printed contact list allows easy contact management: It allows the user to check active logging, file reception and notification settings, as well as what key exchange was used and what is the state of that key exchange. The contact list also shows and what the account displayed by the Relay Program corresponds to what nick etc. """ # Initialize columns c1 = ['Contact'] c2 = ['Account'] c3 = ['Logging'] c4 = ['Notify'] c5 = ['Files '] c6 = ['Key Ex'] # Key exchange status dictionary kex_dict = {KEX_STATUS_PENDING: f"{ECDHE} (Pending)", KEX_STATUS_UNVERIFIED: f"{ECDHE} (Unverified)", KEX_STATUS_VERIFIED: f"{ECDHE} (Verified)", KEX_STATUS_NO_RX_PSK: f"{PSK} (No contact key)", KEX_STATUS_HAS_RX_PSK: PSK} # Populate columns with contact data for c in self.get_list_of_contacts(): c1.append(c.nick) c2.append(c.short_address) c3.append('Yes' if c.log_messages else 'No') c4.append('Yes' if c.notifications else 'No') c5.append('Accept' if c.file_reception else 'Reject') c6.append(kex_dict[c.kex_status]) # Calculate column widths c1w, c2w, c3w, c4w, c5w, = [max(len(v) for v in column) + CONTACT_LIST_INDENT for column in [c1, c2, c3, c4, c5]] # Align columns by adding whitespace between fields of each line lines = [f'{f1:{c1w}}{f2:{c2w}}{f3:{c3w}}{f4:{c4w}}{f5:{c5w}}{f6}' for f1, f2, f3, f4, f5, f6 in zip(c1, c2, c3, c4, c5, c6)] # Add a terminal-wide line between the column names and the data lines.insert(1, get_terminal_width() * '') # Print the contact list clear_screen() print('\n' + '\n'.join(lines) + '\n\n') ```
The Monadnock Ledger-Transcript is a twice-weekly newspaper based in Peterborough, New Hampshire, and covering the Monadnock Region. It was formed in September 2006, when the 50-year-old Monadnock Ledger bought the 150-year-old Peterborough Transcript. Both newspapers had published once a week. As of 2021, the Ledger-Transcript publishes print editions two days a week with a continuously updated website. It is owned by Newspapers of New England, Inc., a privately owned publisher of nine daily and weekly newspapers in Massachusetts and New Hampshire. In 2010, the Monadnock Ledger-Transcript was named the Newspaper of the Year by the New England Press Association. Peterborough Transcript The Peterborough Transcript was founded in 1849, and remained the only local weekly newspaper in Peterborough for more than a century. It was owned by the Cummings family from 1900 until September 2006, when it was bought by the competing Monadnock Ledger, and became part of the Monadnock Ledger-Transcript. In a story announcing the merger, then-publisher Joe Cummings described the paper's history: "John Miller and Kendall Scott founded the Transcript in 1849. Originally named the Contoocook Transcript, this newspaper was the fourth newspaper in Peterborough, the previous three having failed. In its first issue, the publishers stated, 'In commencing this enterprise, we frankly tell you that we have our doubts and fears in regard to its ultimate success.' "In 1900, George Cummings sold his soapstone quarry in Francestown to purchase the Transcript. It has been in the Cummings family ever since. Four generations have served as its publishers. After George, Paul Cummings Sr. served in that post, followed by his son Paul Jr., who took over the reins in 1946. Joe, Paul's son, presently serves as publisher." Monadnock Ledger The Monadnock Ledger started in the mid-1950s as a company newsletter for New Hampshire Ball Bearings. Richard Noyes converted the newsletter into a tabloid weekly based in Jaffrey and then into a full-size newspaper coming out twice a week, as the Jaffrey Ledger one day and the Peterborough Ledger some days later. It later changed to a weekly. The Ledger was bought by Newspapers of New England in 1986. References External links Monadnock Ledger-Transcript Newspapers published in New Hampshire
```html <!DOCTYPE HTML> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <title>Typescript | Here. There.</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=3, minimum-scale=1"> <meta name="author" content=""> <meta name="description" content="[2018.11.14 A typescript ] Typescript Typescript ??? Typescript !!!"> <link rel="alternate" href="/atom.xml" title="Here. There." type="application/atom+xml"> <link rel="icon" href="/img/favicon.ico"> <link rel="apple-touch-icon" href="/img/pacman.jpg"> <link rel="apple-touch-icon-precomposed" href="/img/pacman.jpg"> <link rel="stylesheet" href="/css/style.css"> <script type="text/javascript"> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?3d902de4a19cf2bf179534ffd2dd7b7f"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <meta name="generator" content="Hexo 6.3.0"></head> <body> <header> <div> <div id="imglogo"> <a href="/"><img src="/img/sun.png" alt="Here. There." title="Here. There."/></a> </div> <div id="textlogo"> <h1 class="site-name"><a href="/" title="Here. There.">Here. There.</a></h1> <h2 class="blog-motto">Love ice cream. Love sunshine. Love life. Love the world. Love myself. Love you.</h2> </div> <div class="navbar"><a class="navbutton navmobile" href="#" title=""> </a></div> <nav class="animated"> <ul> <li><a href="/"></a></li> <li><a target="_blank" rel="noopener" href="path_to_url"></a></li> <li><a href="/archives"></a></li> <li><a href="/categories"></a></li> <li><a href="path_to_url"></a></li> <li><a href="/about"></a></li> </ul> </nav> </div> </header> <div id="container"> <div id="main" class="post" itemscope itemprop="blogPost"> <article itemprop="articleBody"> <header class="article-info clearfix"> <h1 itemprop="name"> <a href="/2018/11/30/wxapp-typescript/" title="Typescript" itemprop="url">Typescript</a> </h1> <p class="article-author">By <a href="path_to_url" title=""></a> </p> <p class="article-time"> <time datetime="2018-11-30T14:36:46.000Z" itemprop="datePublished">2018-11-30</time> :<time datetime="2018-11-30T14:41:45.901Z" itemprop="dateModified">2018-11-30</time> </p> </header> <div class="article-content"> <div id="toc" class="toc-article"> <strong class="toc-title"></strong> <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%9C%9F%E5%BE%85%E5%B7%B2%E4%B9%85%E7%9A%84-Typescript"><span class="toc-number">1.</span> <span class="toc-text"> Typescript</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E7%94%A8-Typescript"><span class="toc-number">1.1.</span> <span class="toc-text"> Typescript</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%98%E9%87%8F%E7%B1%BB%E5%9E%8B%E4%B8%8D%E6%98%8E%E7%A1%AE"><span class="toc-number">1.1.1.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8E%A5%E5%8F%A3%E5%8D%8F%E8%AE%AE%E4%B8%8D%E7%AC%A6%E5%90%88"><span class="toc-number">1.1.2.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%80%E9%94%AE%E8%B0%83%E6%95%B4%E5%8D%8F%E8%AE%AE"><span class="toc-number">1.1.3.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%B7%A8%E8%BF%87-Babel-%E7%9B%B4%E6%8E%A5%E4%BD%BF%E7%94%A8-ES6-ES7%EF%BC%8C%E8%B7%A8%E8%BF%87-eslint-%E7%9B%B4%E6%8E%A5%E4%BD%BF%E7%94%A8-prettier"><span class="toc-number">1.1.4.</span> <span class="toc-text"> Babel ES6&#x2F;ES7 eslint prettier</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%B0%8F%E7%A8%8B%E5%BA%8F%E4%B8%8E-Typescript"><span class="toc-number">1.2.</span> <span class="toc-text"> Typescript</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Typescript-%E7%BC%96%E8%AF%91%E4%B8%8B%E5%B0%B1%E5%8F%AF%E4%BB%A5%E7%94%A8%EF%BC%9F"><span class="toc-number">1.2.1.</span> <span class="toc-text">Typescript </span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BC%80%E7%AE%B1%E5%8D%B3%E7%94%A8%E7%9A%84%E5%B0%9D%E9%B2%9C"><span class="toc-number">1.2.2.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%B0%83%E6%95%B4%E4%B8%8B%E4%BB%A3%E7%A0%81%E7%BB%93%E6%9E%84"><span class="toc-number">1.2.3.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%82%E8%80%83"><span class="toc-number">1.2.4.</span> <span class="toc-text"></span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BB%93%E6%9D%9F%E8%AF%AD"><span class="toc-number">1.3.</span> <span class="toc-text"></span></a></li></ol></li></ol> </div> <p>[2018.11.14 A typescript ] Typescript Typescript ??? Typescript !!!<br><span id="more"></span></p> <h1 id="-Typescript"><a href="#-Typescript" class="headerlink" title=" Typescript"></a> Typescript</h1><hr> <h2 id="-Typescript"><a href="#-Typescript" class="headerlink" title=" Typescript"></a> Typescript</h2><p> Typescript<a href="path_to_url">Typescript</a> Typescript </p> <p><strong>Typescript </strong></p> <p> demo store typescript xiachedan</p> <p> Typescript</p> <h3 id=""><a href="#" class="headerlink" title=""></a></h3><p></p> <figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> formGroups = <span class="variable language_">this</span>.<span class="property">currentStep</span>.<span class="property">formGroups</span>; <span class="comment">// formGroups [[], [], []] [&#123;&#125;, &#123;&#125;, &#123;&#125;]</span></span><br><span class="line"><span class="keyword">let</span> flattenFields = _.<span class="title function_">flatten</span>(formGroups); <span class="comment">// flatten [&#123;&#125;, &#123;&#125;, &#123;&#125;] </span></span><br><span class="line"></span><br><span class="line">flattenFields.<span class="title function_">forEach</span>(<span class="function"><span class="params">item</span> =&gt;</span> &#123;</span><br><span class="line"> <span class="keyword">if</span> (item.<span class="property">fields</span>) &#123; <span class="comment">// item.fields </span></span><br><span class="line"> flattenFields.<span class="title function_">push</span>(..._.<span class="title function_">values</span>(item.<span class="property">fields</span>)); <span class="comment">// values </span></span><br><span class="line"> &#125;</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure> <p> debug <br><img src="path_to_url" alt=""><br><img src="path_to_url" alt=""></p> <p></p> <figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"># </span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">values</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">.jpg</span><br><span class="line"></span><br><span class="line">item.fields</span><br><span class="line"></span><br><span class="line">.jpg* <span class="number">2</span></span><br></pre></td></tr></table></figure> <p> Typescript any </p> <p> any</p> <h3 id=""><a href="#" class="headerlink" title=""></a></h3><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">xxx</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">...</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">...</span><br></pre></td></tr></table></figure> <p> bug </p> <p> Typescript </p> <figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">interface</span> <span class="title class_">IDemoResponse</span> &#123;</span><br><span class="line"> <span class="attr">date</span>: <span class="built_in">string</span>;</span><br><span class="line"> <span class="attr">someNumber</span>: <span class="built_in">number</span>;</span><br><span class="line"> <span class="attr">otherThing</span>: <span class="built_in">any</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure> <p><strong>1. </strong>any</p> <p><img src="path_to_url" alt=""></p> <p><strong>2. </strong></p> <p><img src="path_to_url" alt=""></p> <p>~</p> <h3 id=""><a href="#" class="headerlink" title=""></a></h3><p></p> <p><code>date</code><code>day</code></p> <p><code>date</code></p> <p> Typescript ~</p> <p></p> <figure class="highlight ts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">interface</span> <span class="title class_">IDemoResponse</span> &#123;</span><br><span class="line"> <span class="attr">date</span>: <span class="built_in">string</span>;</span><br><span class="line"> <span class="attr">someNumber</span>: <span class="built_in">number</span>;</span><br><span class="line"> <span class="attr">otherThing</span>: <span class="built_in">any</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">const</span> <span class="attr">demoResponse</span>: <span class="title class_">IDemoResponse</span> = &#123;&#125; <span class="keyword">as</span> <span class="built_in">any</span>;</span><br><span class="line"><span class="keyword">const</span> date = demoResponse.<span class="property">date</span>; </span><br></pre></td></tr></table></figure> <p><strong>1. </strong></p> <p><img src="path_to_url" alt=""></p> <p><strong>2. F2</strong></p> <p><img src="path_to_url" alt=""></p> <p><strong>3. </strong></p> <p><img src="path_to_url" alt=""></p> <p>~~~</p> <h3 id="-Babel--ES6-ES7-eslint--prettier"><a href="#-Babel--ES6-ES7-eslint--prettier" class="headerlink" title=" Babel ES6/ES7 eslint prettier"></a> Babel ES6/ES7 eslint prettier</h3><p> ES6 <code>async/await</code> Babel </p> <p> Typescript Babel </p> <p><strong>Prettier</strong></p> <p> <a target="_blank" rel="noopener" href="path_to_url">prettier</a> </p> <ul> <li> eslint</li> <li></li> <li> standard</li> </ul> <p> Prettier Git commit Prettier Git </p> <h2 id="-Typescript"><a href="#-Typescript" class="headerlink" title=" Typescript"></a> Typescript</h2><h3 id="Typescript-"><a href="#Typescript-" class="headerlink" title="Typescript "></a>Typescript </h3><p> Javascript</p> <p> Typescript Typing </p> <p><img src="path_to_url" alt=""></p> <p> Typescript API ~</p> <p> API ~</p> <h3 id=""><a href="#" class="headerlink" title=""></a></h3><p></p> <ol> <li></li> </ol> <p><img src="path_to_url" alt=""></p> <ol start="2"> <li></li> </ol> <p><img src="path_to_url" alt="typing "></p> <p> package.json ts </p> <ol start="3"> <li></li> </ol> <p><img src="path_to_url" alt="emmmmm"></p> <p></p> <p>GG</p> <p><img src="path_to_url" alt=""></p> <p> Typescript ~</p> <h3 id=""><a href="#" class="headerlink" title=""></a></h3><p> less typescript<br><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">index.js</span><br><span class="line">index.ts</span><br><span class="line">index.json</span><br><span class="line">index.less</span><br><span class="line">index.wxss</span><br><span class="line">index.wxml</span><br></pre></td></tr></table></figure></p> <p> gulp~</p> <p><img src="path_to_url" alt=""></p> <p> prettier demo :<br><a target="_blank" rel="noopener" href="path_to_url">wxapp-typescript-demo</a></p> <p> typing any ~</p> <p><img src="path_to_url" alt="emmmm"></p> <h3 id=""><a href="#" class="headerlink" title=""></a></h3><ul> <li><a target="_blank" rel="noopener" href="path_to_url"></a></li> </ul> <h2 id=""><a href="#" class="headerlink" title=""></a></h2><hr> <p>Typescript <br><br><br><br><br><br></p> </div> <img src="path_to_url" width="200" height="200" style="display:block;margin: 0 auto;" /> <p style="text-align: center;margin-top: 10px;margin-bottom: 10px;">~</p> <p style="text-align: center;"><a target="_blank" rel="noopener" href="path_to_url">B: </a></p> <div class="article-content"> <p style="margin-top:50px;"> Github<a target="_blank" rel="noopener" href="path_to_url">path_to_url <br> <a href="path_to_url"></a> <br> <br> </p> </div> <div class="author-right"> <p></p> <p><a href="path_to_url">path_to_url <p></p> </div> <footer class="article-footer clearfix"> <div class="article-tags"> <span></span> <a href="/tags//"></a> </div> <div class="article-categories"> <span></span> <a class="article-category-link" href="/categories/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%8F%8C%E7%9A%AE%E5%A5%B6/"></a> </div> <div class="article-share" id="share"> <!-- JiaThis Button BEGIN --> <div class="jiathis_style_24x24"> <a class="jiathis_button_qzone"></a> <a class="jiathis_button_tsina"></a> <a class="jiathis_button_tqq"></a> <a class="jiathis_button_weixin"></a> <a class="jiathis_button_renren"></a> <a href="path_to_url" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a> </div> <script type="text/javascript"> var jiathis_config = {data_track_clickback:'true'}; </script> <script type="text/javascript" src="path_to_url" charset="utf-8"></script> <!-- JiaThis Button END --> </div> </footer> </article> <nav class="article-nav clearfix"> <div class="prev" > <a href="/2018/12/16/work-1-choice/" title=""> <strong>PREVIOUS:</strong><br/> <span> </span> </a> </div> <div class="next"> <a href="/2018/11/24/wxapp-multi-request/" title=""> <strong>NEXT:</strong><br/> <span> </span> </a> </div> </nav> <!-- `comments: false` --> <!-- --> </div> <div class="openaside"><a class="navbutton" href="#" title=""></a></div> <div id="toc" class="toc-aside"> <strong class="toc-title"></strong> <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%9C%9F%E5%BE%85%E5%B7%B2%E4%B9%85%E7%9A%84-Typescript"><span class="toc-number">1.</span> <span class="toc-text"> Typescript</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E7%94%A8-Typescript"><span class="toc-number">1.1.</span> <span class="toc-text"> Typescript</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%98%E9%87%8F%E7%B1%BB%E5%9E%8B%E4%B8%8D%E6%98%8E%E7%A1%AE"><span class="toc-number">1.1.1.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8E%A5%E5%8F%A3%E5%8D%8F%E8%AE%AE%E4%B8%8D%E7%AC%A6%E5%90%88"><span class="toc-number">1.1.2.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%80%E9%94%AE%E8%B0%83%E6%95%B4%E5%8D%8F%E8%AE%AE"><span class="toc-number">1.1.3.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%B7%A8%E8%BF%87-Babel-%E7%9B%B4%E6%8E%A5%E4%BD%BF%E7%94%A8-ES6-ES7%EF%BC%8C%E8%B7%A8%E8%BF%87-eslint-%E7%9B%B4%E6%8E%A5%E4%BD%BF%E7%94%A8-prettier"><span class="toc-number">1.1.4.</span> <span class="toc-text"> Babel ES6&#x2F;ES7 eslint prettier</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%B0%8F%E7%A8%8B%E5%BA%8F%E4%B8%8E-Typescript"><span class="toc-number">1.2.</span> <span class="toc-text"> Typescript</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Typescript-%E7%BC%96%E8%AF%91%E4%B8%8B%E5%B0%B1%E5%8F%AF%E4%BB%A5%E7%94%A8%EF%BC%9F"><span class="toc-number">1.2.1.</span> <span class="toc-text">Typescript </span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BC%80%E7%AE%B1%E5%8D%B3%E7%94%A8%E7%9A%84%E5%B0%9D%E9%B2%9C"><span class="toc-number">1.2.2.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%B0%83%E6%95%B4%E4%B8%8B%E4%BB%A3%E7%A0%81%E7%BB%93%E6%9E%84"><span class="toc-number">1.2.3.</span> <span class="toc-text"></span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%82%E8%80%83"><span class="toc-number">1.2.4.</span> <span class="toc-text"></span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BB%93%E6%9D%9F%E8%AF%AD"><span class="toc-number">1.3.</span> <span class="toc-text"></span></a></li></ol></li></ol> </div> <div id="asidepart"> <div class="closeaside"><a class="closebutton" href="#" title=""></a></div> <aside class="clearfix"> <div class="archiveslist"> <p class="asidetitle"></p> <ul class="archive-list"> <li class="archive-list-item"> <a class="archive-list-link" href="/2024/08/05/front-end-performance-task-schedule/" title="--">--...</a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/2024/07/17/front-end-performance-r-tree/" title="--R ">--R ...</a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/2024/06/04/front-end-performance-jank-heartbeat-monitor/" title="--">--...</a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/2024/05/02/front-end-performance-jank-detect/" title="--">--...</a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/2024/04/03/front-end-performance-long-task/" title=" 50 "> 50 ...</a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/2024/03/17/front-end-performance-metric/" title="--">--...</a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/2024/02/21/front-end-performance-about-performanceobserver/" title=" PerformanceObserver"> PerformanceObs...</a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/2024/01/21/front-end-performance-no-response-solution/" title="--">--...</a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/2023/12/25/learn-front-end-develop-from-interview/" title="">...</a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/2023/11/25/render-engine-element-and-event/" title="--8.">--8....</a> </li> </ul> </div> <div class="archiveslist"> <p class="asidetitle"><a href="/archives"></a></p> <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2024/08/"> 2024</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2024/07/"> 2024</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2024/06/"> 2024</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2024/05/"> 2024</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2024/04/"> 2024</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2024/03/"> 2024</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2024/02/"> 2024</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2024/01/"> 2024</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/12/"> 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/11/"> 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/10/"> 2023</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/09/"> 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/08/"> 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/07/"> 2023</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/06/"> 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/05/"> 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/04/"> 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/03/"> 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/01/"> 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/12/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/11/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/10/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/09/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/08/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/07/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/06/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/05/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/04/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/03/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/02/"> 2022</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/01/"> 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/12/"> 2021</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/11/"> 2021</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/10/"> 2021</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/09/"> 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/08/"> 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/07/"> 2021</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/06/"> 2021</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/05/"> 2021</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/04/"> 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/03/"> 2021</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/02/"> 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/01/"> 2021</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/11/"> 2020</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/10/"> 2020</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/08/"> 2020</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/07/"> 2020</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/06/"> 2020</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/"> 2020</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/03/"> 2020</a><span class="archive-list-count">7</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/02/"> 2020</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/12/"> 2019</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/11/"> 2019</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/10/"> 2019</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/09/"> 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/"> 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/07/"> 2019</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/"> 2019</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/05/"> 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/"> 2019</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/"> 2019</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/02/"> 2019</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/01/"> 2019</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/12/"> 2018</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/11/"> 2018</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/10/"> 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/09/"> 2018</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/08/"> 2018</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/07/"> 2018</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/06/"> 2018</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/05/"> 2018</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/04/"> 2018</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/03/"> 2018</a><span class="archive-list-count">7</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/02/"> 2018</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/01/"> 2018</a><span class="archive-list-count">9</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/12/"> 2017</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/11/"> 2017</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/10/"> 2017</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/09/"> 2017</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/08/"> 2017</a><span class="archive-list-count">11</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/07/"> 2017</a><span class="archive-list-count">9</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/06/"> 2017</a><span class="archive-list-count">10</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/05/"> 2017</a><span class="archive-list-count">15</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/04/"> 2017</a><span class="archive-list-count">7</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/03/"> 2017</a><span class="archive-list-count">10</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/02/"> 2017</a><span class="archive-list-count">41</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/01/"> 2017</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/12/"> 2016</a><span class="archive-list-count">7</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/11/"> 2016</a><span class="archive-list-count">9</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/10/"> 2016</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/09/"> 2016</a><span class="archive-list-count">7</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/08/"> 2016</a><span class="archive-list-count">9</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/07/"> 2016</a><span class="archive-list-count">14</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/06/"> 2016</a><span class="archive-list-count">9</span></li></ul> </div> <div class="archiveslist"> <p class="asidetitle"><a href="/categories"></a></p> <ul class="archive-list"> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/Angular/" title="Angular">Angular<sup>16</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/CSS/" title="CSS">CSS<sup>3</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/D3/" title="D3">D3<sup>8</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/angular2/" title="angular2">angular2<sup>25</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/angular/" title="angular">angular<sup>33</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/box2djs/" title="box2djs">box2djs<sup>34</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/cyclejs/" title="cyclejs">cyclejs<sup>8</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/jQuery/" title="jQuery">jQuery<sup>3</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/js/" title="js">js<sup>27</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/react/" title="react">react<sup>16</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/three-js/" title="three.js">three.js<sup>5</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/vue/" title="vue">vue<sup>30</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/webpack/" title="webpack">webpack<sup>9</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories/web/" title="web">web<sup>2</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>6</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>8</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>38</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>2</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>33</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>27</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>2</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>8</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>1</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>1</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/categories//" title=""><sup>7</sup></a> </li> </ul> </div> <div class="archiveslist"> <p class="asidetitle"></p> <ul class="archive-list"> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>50</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>6</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>16</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>1</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>22</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>24</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>80</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>2</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>121</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>9</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>2</sup></a> </li> <li class="archive-list-item"> <a class="archive-list-link" href="/tags//" title=""><sup>19</sup></a> </li> </ul> </div> <div class="archiveslist"> <p class="asidetitle"><a href="/archives">about</a></p> <ul class="archive-list"> <li class="archive-list-item"> <a>wangbeishan@163.com</a> <a target="_blank" rel="noopener" href="path_to_url">github.com/godbasin</a> </li> </ul> </div> <div class="rsspart"> <a href="/atom.xml" target="_blank" title="rss">RSS </a> </div> </aside> </div> </div> <footer><div id="footer" > <section class="info"> <p> ^_^ </p> </section> <p class="copyright">Powered by <a href="path_to_url" target="_blank" title="hexo">hexo</a> and Theme by <a href="path_to_url" target="_blank" title="Pacman">Pacman</a> 2024 <a href="path_to_url" target="_blank" title=""></a> </p> </div> </footer> <script src="/js/jquery-2.1.0.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.navbar').click(function(){ $('header nav').toggleClass('shownav'); }); var myWidth = 0; function getSize(){ if( typeof( window.innerWidth ) == 'number' ) { myWidth = window.innerWidth; } else if( document.documentElement && document.documentElement.clientWidth) { myWidth = document.documentElement.clientWidth; }; }; var m = $('#main'), a = $('#asidepart'), c = $('.closeaside'), o = $('.openaside'); $(window).resize(function(){ getSize(); if (myWidth >= 1024) { $('header nav').removeClass('shownav'); }else { m.removeClass('moveMain'); a.css('display', 'block').removeClass('fadeOut'); o.css('display', 'none'); $('#toc.toc-aside').css('display', 'none'); } }); c.click(function(){ a.addClass('fadeOut').css('display', 'none'); o.css('display', 'block').addClass('fadeIn'); m.addClass('moveMain'); }); o.click(function(){ o.css('display', 'none').removeClass('beforeFadeIn'); a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn'); m.removeClass('moveMain'); }); $(window).scroll(function(){ o.css("top",Math.max(80,260-$(this).scrollTop())); }); }); </script> <script type="text/javascript"> $(document).ready(function(){ var ai = $('.article-content>iframe'), ae = $('.article-content>embed'), t = $('#toc'), h = $('article h2') ah = $('article h2'), ta = $('#toc.toc-aside'), o = $('.openaside'), c = $('.closeaside'); if(ai.length>0){ ai.wrap('<div class="video-container" />'); }; if(ae.length>0){ ae.wrap('<div class="video-container" />'); }; if(ah.length==0){ t.css('display','none'); }else{ c.click(function(){ ta.css('display', 'block').addClass('fadeIn'); }); o.click(function(){ ta.css('display', 'none'); }); $(window).scroll(function(){ ta.css("top",Math.max(140,320-$(this).scrollTop())); }); }; }); </script> </body> </html> ```
```c++ #include "pch.h" #include "ReactPackageProvider.h" #include "NativeModules.h" using namespace winrt::Microsoft::ReactNative; namespace winrt::Example::implementation { void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept { AddAttributedModules(packageBuilder, true); } } // namespace winrt::Example::implementation ```
```php <?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\SignalRegistry; final class SignalRegistry { private $signalHandlers = []; public function __construct() { if (\function_exists('pcntl_async_signals')) { pcntl_async_signals(true); } } public function register(int $signal, callable $signalHandler): void { if (!isset($this->signalHandlers[$signal])) { $previousCallback = pcntl_signal_get_handler($signal); if (\is_callable($previousCallback)) { $this->signalHandlers[$signal][] = $previousCallback; } } $this->signalHandlers[$signal][] = $signalHandler; pcntl_signal($signal, [$this, 'handle']); } public static function isSupported(): bool { if (!\function_exists('pcntl_signal')) { return false; } if (\in_array('pcntl_signal', explode(',', \ini_get('disable_functions')))) { return false; } return true; } /** * @internal */ public function handle(int $signal): void { $count = \count($this->signalHandlers[$signal]); foreach ($this->signalHandlers[$signal] as $i => $signalHandler) { $hasNext = $i !== $count - 1; $signalHandler($signal, $hasNext); } } } ```
Abramowicz, Abramovich, Abramowitz, and Abramovitz are variant spellings of a name meaning "son of Abraham" among Slavic language speaking peoples; it is a common surname amongst Ashkenazi Jews, for whom it is commonly Hebraized to Ben-Avraham (Χ‘ΧŸ-אברהם) upon immigration to Israel. It was also one of the many surnames of which were historically given by the returning Crusaders to their children, in recognition of their father's visit to the Middle East. The surname Abramovich is not related to the Christian surname AbramoviΔ‡. Some people with these names include: Abramowicz (Polish) Lisa Abramowicz, American television and radio host Michel Abramowicz (1950-), French cinematographer Danny Abramowicz (1945-), American football player Halina Abramowicz, Professor of Physics, Tel Aviv University and Max Planck Institute Kazimierz Abramowicz (1889–1936), Polish mathematician Manuel Abramowicz (born 1967), Belgian reporter MichaΕ‚ Abramowicz (1884–1965), Russian and Soviet geologist Hirsz Abramowicz (1881–1960), prominent Yiddish historian and writer Yehuda Meir Abramowicz, (1914–2007), Israeli rabbi and politician Andrzej Abramowicz (died 1763) was a Polish-Lithuanian nobleman. Tomasz Abramowicz (born 15 February 1979 in EΕ‚k) is a Polish professional football player Witold Abramowicz, a Polish scientist Abramovich (: surname β€” Абра́мович: patronymic) Alexander Abramovich (Alexander "Sasha" Argov; 1914–95), Russian-born Israeli composer Boris Abramovich Berezovsky (1946–2013) Russian business oligarch, government official and mathematician. Daniel Abramovich Chwolson, Russian Jewish Orientalist David Abramovich Dragunsky (1910–1992) Gavril Abramovich Ilizarov (1921–1992), Soviet physician Luis Abramovich (born 1962), Argentine footballer Mario Abramovich (1926–2014), Argentine musician Roman Abramovich (born 1966), Russian billionaire and former owner of Chelsea Football Club Semyon Abramovich Furman (1920–1978), Soviet chessmaster Vsevolod Abramovich (1890–1913), Russian aviator Yuri Abramovich (1935–2017), Soviet/Russian aircraft pilot and Hero of Russia Vladimir Abramovich Rokhlin (1919–1984), mathematician Ary Abramovich Sternfeld (1905–1990), aerospace engineer David Abramovich Tyshler (1927–2014), Ukrainian/Soviet Olympic bronze medalist fencer Abramovitch Raphael Abramovitch (1880–1963), Russian socialist Abramovitz Max Abramovitz (1908–2004), American architect Moses Abramovitz (1912–2000), American economist and professor S. Y. Abramovitz aka Mendele Mocher Sforim (1836–1917), Jewish author from Belarus Abramowitz Chaim Zanvl Abramowitz (1902–1995), American Hasidic rebbe Dov Ber Abramowitz (1860–1926), American Rabbi Pinchas Abramowitz, (1909–1986), Israeli artist Milton Abramowitz (1915–1958), American mathematician Sid Abramowitz (1960-), American football player Morton I. Abramowitz (born 1933), American diplomat Yosef Abramowitz (born 1964), Israeli businessman See also AbramoviΔ‡ IbrahimoviΔ‡ References Belarusian-language surnames Ashkenazi surnames Polish-language surnames Slavic-language surnames Patronymic surnames
"Fable" is a song by Italian musician Robert Miles, released in May 1996 as the second single from his debut album, Dreamland (1996). The song features uncredited vocals from Fiorella Quinn. Like "Children", the single received universal acclaim. It was a hit in several countries, reaching number one in Italy and entering the top 10 in Austria, Belgium, Finland, France, Germany, Hungary, Iceland, Ireland, Italy, Spain, Switzerland and UK. In 1997, the song charted on the US Billboard Hot Dance Club Play chart, on which it peaked at number one for one week. Critical reception AllMusic editor Jose F. Promis wrote that the song "continues with the same formula he utilized in "Children", this time using ethereal female chant-like vocals (also included is an instrumental version of "Fable")." Larry Flick from Billboard noted that "on this third instrumental epic from the highly influential album "Dreamland" Miles continues to blend racing dance beats with new-age sweetened keyboards with a flair that is difficult to fully duplicate or describe. You simply have to let the melody wash over your senses, while the groove inspires your body to move." A reviewer from Music Week rated the song three out of five. The magazine's Alan Jones added, "Robert Miles follows his platinum single Children with Fable, another enchanting instrumental outing. It's a tad too similar, with the same throbbing NRGetic underpinning and lush strings with only the slight overlaid melody to distinguish it. Pleasant, easy listening and a hitβ€”but don't expect it to come near Children in the popularity stakes." Music video The accompanying music video for "Fable" was directed by Maria Mochnacz. In it, Robert Miles falls asleep on his sofa, in front of the television. On the wall behind him, three girls are performing a choreography of synchronized swimming. Track listings CD single Belgium "Fable" (radio edit) – 3:50 "Fable" (message radio edit) – 4:00 France "Fable" (message radio edit) – 4:08 "Fable" (radio edit) – 3:52 CD maxi France "Fable" (message radio edit) – 4:08 "Fable" (radio edit) – 3:52 "Fable" (extended version) – 7:12 "Fable" (extended message version) – 7:43 "Fable" (club mix) – 6:22 "Fable" (wake edit) – 4:42 "Fable" (psycho version) – 4:30 Germany "Fable" (radio edit) – 3:50 "Fable" (message radio edit) – 4:00 "Fable" (extended version) – 7:12 "Fable" (club mix) – 6:23 "Fable" (extended message version) – 7:43 "Fable" (psycho version - NRG mix) – 4:28 "Fable" (wake edit) – 4:44 Italy "Fable" (radio edit) – 3:56 "Fable" (message radio edit) – 4:11 "Fable" (extended version) – 7:12 "Fable" (message version) – 7:44 "Fable" (club version) – 6:22 "Fable" (wake-up version) – 4:44 "Fable" (psycho version) – 4:30 Netherlands "Fable" (radio edit) – 3:56 "Fable" (message radio) – 4:11 "Fable" (wake up version) – 4:30 "Fable" (extended version) – 7:12 UK "Fable" (radio edit) – 3:50 "Fable" (extended version) – 7:12 "Fable" (message radio edit) – 4:00 "Fable" (message version) – 7:30 "Fable" (club mix) – 6:15 "Fable" (wake up version) – 4:30 "Fable" (psycho version) – 4:20 12" maxi Belgium "Fable" (extended version) – 7:12 "Fable" (wake up version) – 4:30 "Fable" (message version) – 7:30 "Fable" (NRG mix) – 4:20 France "Fable" (extended version) – 7:12 "Fable" (wake up) – 4:44 "Fable" (message version) – 7:43 "Fable" (psycho version) – 4:28 Germany "Fable" (extended version) – 7:12 "Fable" (club version) – 6:23 "Fable" (message version) – 7:43 "Fable" (psycho version - NRG mix) – 4:28 "Fable" (wake up) – 4:44 Italy "Fable" (message version) – 7:43 "Fable" (psycho version - NRG mix) – 4:28 "Fable" (extended version) – 7:12 "Fable" (wake-up version) – 4:44 UK "Fable" (extended version) – 7:12 "Fable" (wake up version) – 4:30 "Fable" (extended message version) – 7:43 "Fable" (club mix) – 6:15 Double 12" France "Fable" (extended version) – 7:12 "Fable" (extended message version) – 7:43 "Fable" (wake up) – 4:42 "Fable" (psycho version) – 4:30 "Fable" (club mix) – 6:22 Germany "Fable" (extended version) – 7:12 "Fable" (club mix) – 6:23 "Fable" (extended message version) – 7:43 "Fable" (psycho version - NRG mix) – 4:28 "Fable" (wake up) – 4:44 Italy "Fable" (extended version) – 7:12 "Fable" (extended message version) – 7:43 "Wake Up" – 4:44 "Fable" (psycho version - NRG mix) – 4:28 "Fable" (club mix) – 6:23 Charts Weekly charts Year-end charts Certifications Release history References 1990s instrumentals 1996 singles 1996 songs Arista Records singles Deconstruction Records singles Electronic songs Robert Miles songs Number-one singles in Italy Songs written by Robert Miles
Byron (Barney) H. Adams (born March 24, 1939 in Syracuse, New York), is an entrepreneur, the founder of Adams Golf, inventor of the Tight Lies fairway wood, holder of several patents on golf products, author of The WOW Factor, and proponent of growing the game of golf. Biography Adams began playing golf at 14, caddying at Onondaga Country Club in Fayetteville, New York. Adams attended Clarkson College, now Clarkson University, on an athletic scholarship. He joined Sigma Delta, a local fraternity, and graduated in 1962 with a Business Management (BBA) degree. In 2012 Adams was inducted into the Sports Hall of Fame at Clarkson University. After graduation, Adams worked for Corning Glass in various engineering positions, and then entered the supermarket industry in Southern California as an independent sales representative. He then joined a Silicon Valley startup making microprocessors to reduce retail energy usage. In 1983 Adams joined Dave Pelz Golf in Abilene, Texas. Adams Golf When Dave Pelz Golf Golf Inc. went bankrupt, Adams bought the assets and started Adams Golf. Initially specializing in custom fitted golf clubs, the company rapidly expanded after the creation of the Adams Tight Lies fairway wood. In 1998 Adams Golf went public with an initial public offering underwritten by Lehman Brothers. Adams was selected as Manufacturing Entrepreneur of the Year by Ernst & Young in 1999. The 2010 Ernie Sabayrac Award for lifetime contribution to the golf industry was presented to Adams by the PGA of America. Adams has also been named an Honorary Member for Life by the PGA Southern California Section, Desert Chapter. Adams served as Chairman of the Board of Adams Golf until June 2012 when the company was purchased by TaylorMade-Adidas. The WOW Factor Adams book, The WOW Factor, is an insiders look at the golf industry and offers business advice to entrepreneurs. Adams continues to be an avid golfer, but now mainly pursues his hobby, saltwater fly fishing. Initiatives and Awards Since retirement Adams continues to write about golf including regular contributions to GolfWRx. A 2011 story culminated in the Tee It Forward movement, which he founded to help make the game more enjoyable by helping amateurs play from the distance that aligns with their abilities. He remains active with two charities, The Ryan Foundation benefiting MPS and Orphan Diseases, and Folds of Honor which supports military families. In 2012 Barney Adams was inducted into the Clarkson College Hall of Fame, and in 2022 he was inducted into the Texas Golf Hall of Fame for lifetime achievement in golf. Adams also created new shaft technology in 2022, with Breakthrough Golf Technology, bringing innovation to putter shafts. References External links Adams Golf. The WOW Factor, Sky Horse Publishing. Newport, John Paul (May 21, 2011). "Finding a Game for the Rest of Us" The Wall Street Journal. Dorman, Larry (July 10, 2011). "Par: Tailoring the Tees to the Players to Bring the Fun Back to Golf" The New York Times. Tee It Forward-Golf Channel's "Live from the U.S. Open" (June 14, 2011). . PGA Southern California Section. . GolfWRx The Ryan Foundation. Folds of Honor. Golfers from New York (state) Businesspeople from Syracuse, New York 1939 births Living people
```python """A tee implementation for xonsh.""" def tee(args, stdin, stdout, stderr): """A tee command for xonsh.""" mode = "w" if "-a" in args: args.remove("-a") mode = "a" if "--append" in args: args.remove("--append") mode = "a" if "--help" in args: print(TEE_HELP, file=stdout) return 0 if stdin is None: msg = "tee was not piped stdin, must have input stream to read from." print(msg, file=stderr) return 1 errors = False files = [] for i in args: if i == "-": files.append(stdout) else: try: files.append(open(i, mode)) except: print("tee: failed to open {}".format(i), file=stderr) errors = True files.append(stdout) while True: r = stdin.read(1024) if r == "": break for i in files: i.write(r) for i in files: if i != stdout: i.close() return int(errors) TEE_HELP = """This version of tee was written in Python for the xonsh project: path_to_url Based on tee from GNU coreutils: path_to_url Usage: tee [OPTION]... [FILE]... Copy standard input to each FILE, and also to standard output. -a, --append append to the given FILEs, do not overwrite --help display this help and exit If a FILE is -, copy again to standard output.""" # NOT IMPLEMENTED: # -i, --ignore-interrupts ignore interrupt signals ```