text
stringlengths
2
1.04M
meta
dict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-GB" xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Statistics of CCONJ in UD_Swedish_Sign_Language</title> <link rel="root" href=""/> <!-- for JS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/> <link rel="stylesheet" type="text/css" href="../../css/style.css"/> <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/> <link rel="stylesheet" type="text/css" href="../../css/hint.css"/> <script type="text/javascript" src="../../lib/ext/head.load.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script> <script>document.addEventListener("DOMContentLoaded", function(event) {anchors.add();});</script> <!-- Set up this custom Google search at https://cse.google.com/cse/business/settings?cx=001145188882102106025:dl1mehhcgbo --> <!-- DZ 2021-01-22: I am temporarily hiding the search field to find out whether it slows down loading of the title page. <script> (function() { var cx = '001145188882102106025:dl1mehhcgbo'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = 'https://cse.google.com/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); </script> --> <!-- <link rel="shortcut icon" href="favicon.ico"/> --> </head> <body> <div id="main" class="center"> <div id="hp-header"> <table width="100%"><tr><td width="50%"> <span class="header-text"><a href="http://universaldependencies.org/#language-">home</a></span> <span class="header-text"><a href="https://github.com/universaldependencies/docs/edit/pages-source/treebanks/swl_sslc/swl-pos-CCONJ.md" target="#">edit page</a></span> <span class="header-text"><a href="https://github.com/universaldependencies/docs/issues">issue tracker</a></span> </td><td> <gcse:search></gcse:search> </td></tr></table> </div> <hr/> <div class="v2complete"> This page pertains to UD version 2. </div> <div id="content"> <noscript> <div id="noscript"> It appears that you have Javascript disabled. Please consider enabling Javascript for this page to see the visualizations. </div> </noscript> <!-- The content may include scripts and styles, hence we must load the shared libraries before the content. --> <script type="text/javascript"> console.time('loading libraries'); var root = '../../'; // filled in by jekyll head.js( // External libraries // DZ: Copied from embedding.html. I don't know which one is needed for what, so I'm currently keeping them all. root + 'lib/ext/jquery.min.js', root + 'lib/ext/jquery.svg.min.js', root + 'lib/ext/jquery.svgdom.min.js', root + 'lib/ext/jquery.timeago.js', root + 'lib/ext/jquery-ui.min.js', root + 'lib/ext/waypoints.min.js', root + 'lib/ext/jquery.address.min.js' ); </script> <h2 id="treebank-statistics-ud_swedish_sign_language-pos-tags-cconj">Treebank Statistics: UD_Swedish_Sign_Language: POS Tags: <code class="language-plaintext highlighter-rouge">CCONJ</code></h2> <p>There are 1 <code class="language-plaintext highlighter-rouge">CCONJ</code> lemmas (9%), 6 <code class="language-plaintext highlighter-rouge">CCONJ</code> types (1%) and 13 <code class="language-plaintext highlighter-rouge">CCONJ</code> tokens (1%). Out of 11 observed tags, the rank of <code class="language-plaintext highlighter-rouge">CCONJ</code> is: 4 in number of lemmas, 10 in number of types and 11 in number of tokens.</p> <p>The 10 most frequent <code class="language-plaintext highlighter-rouge">CCONJ</code> lemmas: <em>_</em></p> <p>The 10 most frequent <code class="language-plaintext highlighter-rouge">CCONJ</code> types: <em>ORSAK, PLUS, MEN, OCH, OM@b, SOM(S)</em></p> <p>The 10 most frequent ambiguous lemmas: <em>_</em> (<tt><a href="swl-pos-VERB.html">VERB</a></tt> 648, <tt><a href="swl-pos-NOUN.html">NOUN</a></tt> 362, <tt><a href="swl-pos-PRON.html">PRON</a></tt> 177, <tt><a href="swl-pos-ADV.html">ADV</a></tt> 115, <tt><a href="swl-pos-X.html">X</a></tt> 98, <tt><a href="swl-pos-ADJ.html">ADJ</a></tt> 55, <tt><a href="swl-pos-INTJ.html">INTJ</a></tt> 47, <tt><a href="swl-pos-DET.html">DET</a></tt> 39, <tt><a href="swl-pos-NUM.html">NUM</a></tt> 31, <tt><a href="swl-pos-ADP.html">ADP</a></tt> 25, <tt><a href="swl-pos-CCONJ.html">CCONJ</a></tt> 13)</p> <p>The 10 most frequent ambiguous types:</p> <h2 id="morphology">Morphology</h2> <p>The form / lemma ratio of <code class="language-plaintext highlighter-rouge">CCONJ</code> is 6.000000 (the average of all parts of speech is 63.454545).</p> <p>The 1st highest number of forms (6) was observed with the lemma “_”: <em>MEN, OCH, OM@b, ORSAK, PLUS, SOM(S)</em>.</p> <p><code class="language-plaintext highlighter-rouge">CCONJ</code> does not occur with any features.</p> <h2 id="relations">Relations</h2> <p><code class="language-plaintext highlighter-rouge">CCONJ</code> nodes are attached to their parents using 5 different relations: <tt><a href="swl-dep-cc.html">cc</a></tt> (5; 38% instances), <tt><a href="swl-dep-mark.html">mark</a></tt> (4; 31% instances), <tt><a href="swl-dep-advmod.html">advmod</a></tt> (2; 15% instances), <tt><a href="swl-dep-case.html">case</a></tt> (1; 8% instances), <tt><a href="swl-dep-obl.html">obl</a></tt> (1; 8% instances)</p> <p>Parents of <code class="language-plaintext highlighter-rouge">CCONJ</code> nodes belong to 4 different parts of speech: <tt><a href="swl-pos-VERB.html">VERB</a></tt> (6; 46% instances), <tt><a href="swl-pos-NOUN.html">NOUN</a></tt> (5; 38% instances), <tt><a href="swl-pos-ADJ.html">ADJ</a></tt> (1; 8% instances), <tt><a href="swl-pos-PRON.html">PRON</a></tt> (1; 8% instances)</p> <p>12 (92%) <code class="language-plaintext highlighter-rouge">CCONJ</code> nodes are leaves.</p> <p>1 (8%) <code class="language-plaintext highlighter-rouge">CCONJ</code> nodes have one child.</p> <p>The highest child degree of a <code class="language-plaintext highlighter-rouge">CCONJ</code> node is 1.</p> <p>Children of <code class="language-plaintext highlighter-rouge">CCONJ</code> nodes are attached using 1 different relations: <tt><a href="swl-dep-case.html">case</a></tt> (1; 100% instances)</p> <p>Children of <code class="language-plaintext highlighter-rouge">CCONJ</code> nodes belong to 1 different parts of speech: <tt><a href="swl-pos-ADP.html">ADP</a></tt> (1; 100% instances)</p> </div> <!-- support for embedded visualizations --> <script type="text/javascript"> var root = '../../'; // filled in by jekyll head.js( // We assume that external libraries such as jquery.min.js have already been loaded outside! // (See _layouts/base.html.) // brat helper modules root + 'lib/brat/configuration.js', root + 'lib/brat/util.js', root + 'lib/brat/annotation_log.js', root + 'lib/ext/webfont.js', // brat modules root + 'lib/brat/dispatcher.js', root + 'lib/brat/url_monitor.js', root + 'lib/brat/visualizer.js', // embedding configuration root + 'lib/local/config.js', // project-specific collection data root + 'lib/local/collections.js', // Annodoc root + 'lib/annodoc/annodoc.js', // NOTE: non-local libraries 'https://spyysalo.github.io/conllu.js/conllu.js' ); var webFontURLs = [ // root + 'static/fonts/Astloch-Bold.ttf', root + 'static/fonts/PT_Sans-Caption-Web-Regular.ttf', root + 'static/fonts/Liberation_Sans-Regular.ttf' ]; var setupTimeago = function() { jQuery("time.timeago").timeago(); }; head.ready(function() { setupTimeago(); // mark current collection (filled in by Jekyll) Collections.listing['_current'] = ''; // perform all embedding and support functions Annodoc.activate(Config.bratCollData, Collections.listing); }); </script> <!-- google analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-55233688-1', 'auto'); ga('send', 'pageview'); </script> <div id="footer"> <p class="footer-text">&copy; 2014–2021 <a href="http://universaldependencies.org/introduction.html#contributors" style="color:gray">Universal Dependencies contributors</a>. Site powered by <a href="http://spyysalo.github.io/annodoc" style="color:gray">Annodoc</a> and <a href="http://brat.nlplab.org/" style="color:gray">brat</a></p>. </div> </div> </body> </html>
{ "content_hash": "d044491d550f0923294cf9eef61006b0", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 597, "avg_line_length": 50.689473684210526, "alnum_prop": 0.632748416571488, "repo_name": "UniversalDependencies/universaldependencies.github.io", "id": "61d6afac91d47840b6acb5336212b5803112c3e0", "size": "9637", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "treebanks/swl_sslc/swl-pos-CCONJ.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "64420" }, { "name": "HTML", "bytes": "383191916" }, { "name": "JavaScript", "bytes": "687350" }, { "name": "Perl", "bytes": "7788" }, { "name": "Python", "bytes": "21203" }, { "name": "Shell", "bytes": "7253" } ], "symlink_target": "" }
/* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * Copyright (c) 2011, 2012, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * * lnet/selftest/conctl.c * * Console framework rpcs * * Author: Liang Zhen <liang@whamcloud.com> */ #include "../../include/linux/libcfs/libcfs.h" #include "../../include/linux/lnet/lib-lnet.h" #include "timer.h" #include "conrpc.h" #include "console.h" void lstcon_rpc_stat_reply(struct lstcon_rpc_trans *, struct srpc_msg *, struct lstcon_node *, lstcon_trans_stat_t *); static void lstcon_rpc_done(struct srpc_client_rpc *rpc) { struct lstcon_rpc *crpc = (struct lstcon_rpc *)rpc->crpc_priv; LASSERT(crpc && rpc == crpc->crp_rpc); LASSERT(crpc->crp_posted && !crpc->crp_finished); spin_lock(&rpc->crpc_lock); if (!crpc->crp_trans) { /* * Orphan RPC is not in any transaction, * I'm just a poor body and nobody loves me */ spin_unlock(&rpc->crpc_lock); /* release it */ lstcon_rpc_put(crpc); return; } /* not an orphan RPC */ crpc->crp_finished = 1; if (!crpc->crp_stamp) { /* not aborted */ LASSERT(!crpc->crp_status); crpc->crp_stamp = cfs_time_current(); crpc->crp_status = rpc->crpc_status; } /* wakeup (transaction)thread if I'm the last RPC in the transaction */ if (atomic_dec_and_test(&crpc->crp_trans->tas_remaining)) wake_up(&crpc->crp_trans->tas_waitq); spin_unlock(&rpc->crpc_lock); } static int lstcon_rpc_init(struct lstcon_node *nd, int service, unsigned feats, int bulk_npg, int bulk_len, int embedded, struct lstcon_rpc *crpc) { crpc->crp_rpc = sfw_create_rpc(nd->nd_id, service, feats, bulk_npg, bulk_len, lstcon_rpc_done, (void *)crpc); if (!crpc->crp_rpc) return -ENOMEM; crpc->crp_trans = NULL; crpc->crp_node = nd; crpc->crp_posted = 0; crpc->crp_finished = 0; crpc->crp_unpacked = 0; crpc->crp_status = 0; crpc->crp_stamp = 0; crpc->crp_embedded = embedded; INIT_LIST_HEAD(&crpc->crp_link); atomic_inc(&console_session.ses_rpc_counter); return 0; } static int lstcon_rpc_prep(struct lstcon_node *nd, int service, unsigned feats, int bulk_npg, int bulk_len, struct lstcon_rpc **crpcpp) { struct lstcon_rpc *crpc = NULL; int rc; spin_lock(&console_session.ses_rpc_lock); crpc = list_first_entry_or_null(&console_session.ses_rpc_freelist, struct lstcon_rpc, crp_link); if (crpc) list_del_init(&crpc->crp_link); spin_unlock(&console_session.ses_rpc_lock); if (!crpc) { LIBCFS_ALLOC(crpc, sizeof(*crpc)); if (!crpc) return -ENOMEM; } rc = lstcon_rpc_init(nd, service, feats, bulk_npg, bulk_len, 0, crpc); if (!rc) { *crpcpp = crpc; return 0; } LIBCFS_FREE(crpc, sizeof(*crpc)); return rc; } void lstcon_rpc_put(struct lstcon_rpc *crpc) { struct srpc_bulk *bulk = &crpc->crp_rpc->crpc_bulk; int i; LASSERT(list_empty(&crpc->crp_link)); for (i = 0; i < bulk->bk_niov; i++) { if (!bulk->bk_iovs[i].kiov_page) continue; __free_page(bulk->bk_iovs[i].kiov_page); } srpc_client_rpc_decref(crpc->crp_rpc); if (crpc->crp_embedded) { /* embedded RPC, don't recycle it */ memset(crpc, 0, sizeof(*crpc)); crpc->crp_embedded = 1; } else { spin_lock(&console_session.ses_rpc_lock); list_add(&crpc->crp_link, &console_session.ses_rpc_freelist); spin_unlock(&console_session.ses_rpc_lock); } /* RPC is not alive now */ atomic_dec(&console_session.ses_rpc_counter); } static void lstcon_rpc_post(struct lstcon_rpc *crpc) { struct lstcon_rpc_trans *trans = crpc->crp_trans; LASSERT(trans); atomic_inc(&trans->tas_remaining); crpc->crp_posted = 1; sfw_post_rpc(crpc->crp_rpc); } static char * lstcon_rpc_trans_name(int transop) { if (transop == LST_TRANS_SESNEW) return "SESNEW"; if (transop == LST_TRANS_SESEND) return "SESEND"; if (transop == LST_TRANS_SESQRY) return "SESQRY"; if (transop == LST_TRANS_SESPING) return "SESPING"; if (transop == LST_TRANS_TSBCLIADD) return "TSBCLIADD"; if (transop == LST_TRANS_TSBSRVADD) return "TSBSRVADD"; if (transop == LST_TRANS_TSBRUN) return "TSBRUN"; if (transop == LST_TRANS_TSBSTOP) return "TSBSTOP"; if (transop == LST_TRANS_TSBCLIQRY) return "TSBCLIQRY"; if (transop == LST_TRANS_TSBSRVQRY) return "TSBSRVQRY"; if (transop == LST_TRANS_STATQRY) return "STATQRY"; return "Unknown"; } int lstcon_rpc_trans_prep(struct list_head *translist, int transop, struct lstcon_rpc_trans **transpp) { struct lstcon_rpc_trans *trans; if (translist) { list_for_each_entry(trans, translist, tas_link) { /* * Can't enqueue two private transaction on * the same object */ if ((trans->tas_opc & transop) == LST_TRANS_PRIVATE) return -EPERM; } } /* create a trans group */ LIBCFS_ALLOC(trans, sizeof(*trans)); if (!trans) return -ENOMEM; trans->tas_opc = transop; if (!translist) INIT_LIST_HEAD(&trans->tas_olink); else list_add_tail(&trans->tas_olink, translist); list_add_tail(&trans->tas_link, &console_session.ses_trans_list); INIT_LIST_HEAD(&trans->tas_rpcs_list); atomic_set(&trans->tas_remaining, 0); init_waitqueue_head(&trans->tas_waitq); spin_lock(&console_session.ses_rpc_lock); trans->tas_features = console_session.ses_features; spin_unlock(&console_session.ses_rpc_lock); *transpp = trans; return 0; } void lstcon_rpc_trans_addreq(struct lstcon_rpc_trans *trans, struct lstcon_rpc *crpc) { list_add_tail(&crpc->crp_link, &trans->tas_rpcs_list); crpc->crp_trans = trans; } void lstcon_rpc_trans_abort(struct lstcon_rpc_trans *trans, int error) { struct srpc_client_rpc *rpc; struct lstcon_rpc *crpc; struct lstcon_node *nd; list_for_each_entry(crpc, &trans->tas_rpcs_list, crp_link) { rpc = crpc->crp_rpc; spin_lock(&rpc->crpc_lock); if (!crpc->crp_posted || /* not posted */ crpc->crp_stamp) { /* rpc done or aborted already */ if (!crpc->crp_stamp) { crpc->crp_stamp = cfs_time_current(); crpc->crp_status = -EINTR; } spin_unlock(&rpc->crpc_lock); continue; } crpc->crp_stamp = cfs_time_current(); crpc->crp_status = error; spin_unlock(&rpc->crpc_lock); sfw_abort_rpc(rpc); if (error != -ETIMEDOUT) continue; nd = crpc->crp_node; if (cfs_time_after(nd->nd_stamp, crpc->crp_stamp)) continue; nd->nd_stamp = crpc->crp_stamp; nd->nd_state = LST_NODE_DOWN; } } static int lstcon_rpc_trans_check(struct lstcon_rpc_trans *trans) { if (console_session.ses_shutdown && !list_empty(&trans->tas_olink)) /* Not an end session RPC */ return 1; return !atomic_read(&trans->tas_remaining) ? 1 : 0; } int lstcon_rpc_trans_postwait(struct lstcon_rpc_trans *trans, int timeout) { struct lstcon_rpc *crpc; int rc; if (list_empty(&trans->tas_rpcs_list)) return 0; if (timeout < LST_TRANS_MIN_TIMEOUT) timeout = LST_TRANS_MIN_TIMEOUT; CDEBUG(D_NET, "Transaction %s started\n", lstcon_rpc_trans_name(trans->tas_opc)); /* post all requests */ list_for_each_entry(crpc, &trans->tas_rpcs_list, crp_link) { LASSERT(!crpc->crp_posted); lstcon_rpc_post(crpc); } mutex_unlock(&console_session.ses_mutex); rc = wait_event_interruptible_timeout(trans->tas_waitq, lstcon_rpc_trans_check(trans), cfs_time_seconds(timeout)); rc = (rc > 0) ? 0 : ((rc < 0) ? -EINTR : -ETIMEDOUT); mutex_lock(&console_session.ses_mutex); if (console_session.ses_shutdown) rc = -ESHUTDOWN; if (rc || atomic_read(&trans->tas_remaining)) { /* treat short timeout as canceled */ if (rc == -ETIMEDOUT && timeout < LST_TRANS_MIN_TIMEOUT * 2) rc = -EINTR; lstcon_rpc_trans_abort(trans, rc); } CDEBUG(D_NET, "Transaction %s stopped: %d\n", lstcon_rpc_trans_name(trans->tas_opc), rc); lstcon_rpc_trans_stat(trans, lstcon_trans_stat()); return rc; } static int lstcon_rpc_get_reply(struct lstcon_rpc *crpc, struct srpc_msg **msgpp) { struct lstcon_node *nd = crpc->crp_node; struct srpc_client_rpc *rpc = crpc->crp_rpc; struct srpc_generic_reply *rep; LASSERT(nd && rpc); LASSERT(crpc->crp_stamp); if (crpc->crp_status) { *msgpp = NULL; return crpc->crp_status; } *msgpp = &rpc->crpc_replymsg; if (!crpc->crp_unpacked) { sfw_unpack_message(*msgpp); crpc->crp_unpacked = 1; } if (cfs_time_after(nd->nd_stamp, crpc->crp_stamp)) return 0; nd->nd_stamp = crpc->crp_stamp; rep = &(*msgpp)->msg_body.reply; if (rep->sid.ses_nid == LNET_NID_ANY) nd->nd_state = LST_NODE_UNKNOWN; else if (lstcon_session_match(rep->sid)) nd->nd_state = LST_NODE_ACTIVE; else nd->nd_state = LST_NODE_BUSY; return 0; } void lstcon_rpc_trans_stat(struct lstcon_rpc_trans *trans, lstcon_trans_stat_t *stat) { struct lstcon_rpc *crpc; struct srpc_msg *rep; int error; LASSERT(stat); memset(stat, 0, sizeof(*stat)); list_for_each_entry(crpc, &trans->tas_rpcs_list, crp_link) { lstcon_rpc_stat_total(stat, 1); LASSERT(crpc->crp_stamp); error = lstcon_rpc_get_reply(crpc, &rep); if (error) { lstcon_rpc_stat_failure(stat, 1); if (!stat->trs_rpc_errno) stat->trs_rpc_errno = -error; continue; } lstcon_rpc_stat_success(stat, 1); lstcon_rpc_stat_reply(trans, rep, crpc->crp_node, stat); } if (trans->tas_opc == LST_TRANS_SESNEW && !stat->trs_fwk_errno) { stat->trs_fwk_errno = lstcon_session_feats_check(trans->tas_features); } CDEBUG(D_NET, "transaction %s : success %d, failure %d, total %d, RPC error(%d), Framework error(%d)\n", lstcon_rpc_trans_name(trans->tas_opc), lstcon_rpc_stat_success(stat, 0), lstcon_rpc_stat_failure(stat, 0), lstcon_rpc_stat_total(stat, 0), stat->trs_rpc_errno, stat->trs_fwk_errno); } int lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans, struct list_head __user *head_up, lstcon_rpc_readent_func_t readent) { struct list_head tmp; struct list_head __user *next; lstcon_rpc_ent_t *ent; struct srpc_generic_reply *rep; struct lstcon_rpc *crpc; struct srpc_msg *msg; struct lstcon_node *nd; long dur; struct timeval tv; int error; LASSERT(head_up); next = head_up; list_for_each_entry(crpc, &trans->tas_rpcs_list, crp_link) { if (copy_from_user(&tmp, next, sizeof(struct list_head))) return -EFAULT; if (tmp.next == head_up) return 0; next = tmp.next; ent = list_entry(next, lstcon_rpc_ent_t, rpe_link); LASSERT(crpc->crp_stamp); error = lstcon_rpc_get_reply(crpc, &msg); nd = crpc->crp_node; dur = (long)cfs_time_sub(crpc->crp_stamp, (unsigned long)console_session.ses_id.ses_stamp); jiffies_to_timeval(dur, &tv); if (copy_to_user(&ent->rpe_peer, &nd->nd_id, sizeof(lnet_process_id_t)) || copy_to_user(&ent->rpe_stamp, &tv, sizeof(tv)) || copy_to_user(&ent->rpe_state, &nd->nd_state, sizeof(nd->nd_state)) || copy_to_user(&ent->rpe_rpc_errno, &error, sizeof(error))) return -EFAULT; if (error) continue; /* RPC is done */ rep = (struct srpc_generic_reply *)&msg->msg_body.reply; if (copy_to_user(&ent->rpe_sid, &rep->sid, sizeof(lst_sid_t)) || copy_to_user(&ent->rpe_fwk_errno, &rep->status, sizeof(rep->status))) return -EFAULT; if (!readent) continue; error = readent(trans->tas_opc, msg, ent); if (error) return error; } return 0; } void lstcon_rpc_trans_destroy(struct lstcon_rpc_trans *trans) { struct srpc_client_rpc *rpc; struct lstcon_rpc *crpc; struct lstcon_rpc *tmp; int count = 0; list_for_each_entry_safe(crpc, tmp, &trans->tas_rpcs_list, crp_link) { rpc = crpc->crp_rpc; spin_lock(&rpc->crpc_lock); /* free it if not posted or finished already */ if (!crpc->crp_posted || crpc->crp_finished) { spin_unlock(&rpc->crpc_lock); list_del_init(&crpc->crp_link); lstcon_rpc_put(crpc); continue; } /* * rpcs can be still not callbacked (even LNetMDUnlink is * called) because huge timeout for inaccessible network, * don't make user wait for them, just abandon them, they * will be recycled in callback */ LASSERT(crpc->crp_status); crpc->crp_node = NULL; crpc->crp_trans = NULL; list_del_init(&crpc->crp_link); count++; spin_unlock(&rpc->crpc_lock); atomic_dec(&trans->tas_remaining); } LASSERT(!atomic_read(&trans->tas_remaining)); list_del(&trans->tas_link); if (!list_empty(&trans->tas_olink)) list_del(&trans->tas_olink); CDEBUG(D_NET, "Transaction %s destroyed with %d pending RPCs\n", lstcon_rpc_trans_name(trans->tas_opc), count); LIBCFS_FREE(trans, sizeof(*trans)); } int lstcon_sesrpc_prep(struct lstcon_node *nd, int transop, unsigned feats, struct lstcon_rpc **crpc) { struct srpc_mksn_reqst *msrq; struct srpc_rmsn_reqst *rsrq; int rc; switch (transop) { case LST_TRANS_SESNEW: rc = lstcon_rpc_prep(nd, SRPC_SERVICE_MAKE_SESSION, feats, 0, 0, crpc); if (rc) return rc; msrq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.mksn_reqst; msrq->mksn_sid = console_session.ses_id; msrq->mksn_force = console_session.ses_force; strlcpy(msrq->mksn_name, console_session.ses_name, sizeof(msrq->mksn_name)); break; case LST_TRANS_SESEND: rc = lstcon_rpc_prep(nd, SRPC_SERVICE_REMOVE_SESSION, feats, 0, 0, crpc); if (rc) return rc; rsrq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.rmsn_reqst; rsrq->rmsn_sid = console_session.ses_id; break; default: LBUG(); } return 0; } int lstcon_dbgrpc_prep(struct lstcon_node *nd, unsigned feats, struct lstcon_rpc **crpc) { struct srpc_debug_reqst *drq; int rc; rc = lstcon_rpc_prep(nd, SRPC_SERVICE_DEBUG, feats, 0, 0, crpc); if (rc) return rc; drq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.dbg_reqst; drq->dbg_sid = console_session.ses_id; drq->dbg_flags = 0; return rc; } int lstcon_batrpc_prep(struct lstcon_node *nd, int transop, unsigned feats, struct lstcon_tsb_hdr *tsb, struct lstcon_rpc **crpc) { struct lstcon_batch *batch; struct srpc_batch_reqst *brq; int rc; rc = lstcon_rpc_prep(nd, SRPC_SERVICE_BATCH, feats, 0, 0, crpc); if (rc) return rc; brq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.bat_reqst; brq->bar_sid = console_session.ses_id; brq->bar_bid = tsb->tsb_id; brq->bar_testidx = tsb->tsb_index; brq->bar_opc = transop == LST_TRANS_TSBRUN ? SRPC_BATCH_OPC_RUN : (transop == LST_TRANS_TSBSTOP ? SRPC_BATCH_OPC_STOP : SRPC_BATCH_OPC_QUERY); if (transop != LST_TRANS_TSBRUN && transop != LST_TRANS_TSBSTOP) return 0; LASSERT(!tsb->tsb_index); batch = (struct lstcon_batch *)tsb; brq->bar_arg = batch->bat_arg; return 0; } int lstcon_statrpc_prep(struct lstcon_node *nd, unsigned feats, struct lstcon_rpc **crpc) { struct srpc_stat_reqst *srq; int rc; rc = lstcon_rpc_prep(nd, SRPC_SERVICE_QUERY_STAT, feats, 0, 0, crpc); if (rc) return rc; srq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.stat_reqst; srq->str_sid = console_session.ses_id; srq->str_type = 0; /* XXX remove it */ return 0; } static lnet_process_id_packed_t * lstcon_next_id(int idx, int nkiov, lnet_kiov_t *kiov) { lnet_process_id_packed_t *pid; int i; i = idx / SFW_ID_PER_PAGE; LASSERT(i < nkiov); pid = (lnet_process_id_packed_t *)page_address(kiov[i].kiov_page); return &pid[idx % SFW_ID_PER_PAGE]; } static int lstcon_dstnodes_prep(struct lstcon_group *grp, int idx, int dist, int span, int nkiov, lnet_kiov_t *kiov) { lnet_process_id_packed_t *pid; struct lstcon_ndlink *ndl; struct lstcon_node *nd; int start; int end; int i = 0; LASSERT(dist >= 1); LASSERT(span >= 1); LASSERT(grp->grp_nnode >= 1); if (span > grp->grp_nnode) return -EINVAL; start = ((idx / dist) * span) % grp->grp_nnode; end = ((idx / dist) * span + span - 1) % grp->grp_nnode; list_for_each_entry(ndl, &grp->grp_ndl_list, ndl_link) { nd = ndl->ndl_node; if (i < start) { i++; continue; } if (i > (end >= start ? end : grp->grp_nnode)) break; pid = lstcon_next_id((i - start), nkiov, kiov); pid->nid = nd->nd_id.nid; pid->pid = nd->nd_id.pid; i++; } if (start <= end) /* done */ return 0; list_for_each_entry(ndl, &grp->grp_ndl_list, ndl_link) { if (i > grp->grp_nnode + end) break; nd = ndl->ndl_node; pid = lstcon_next_id((i - start), nkiov, kiov); pid->nid = nd->nd_id.nid; pid->pid = nd->nd_id.pid; i++; } return 0; } static int lstcon_pingrpc_prep(lst_test_ping_param_t *param, struct srpc_test_reqst *req) { struct test_ping_req *prq = &req->tsr_u.ping; prq->png_size = param->png_size; prq->png_flags = param->png_flags; /* TODO dest */ return 0; } static int lstcon_bulkrpc_v0_prep(lst_test_bulk_param_t *param, struct srpc_test_reqst *req) { struct test_bulk_req *brq = &req->tsr_u.bulk_v0; brq->blk_opc = param->blk_opc; brq->blk_npg = (param->blk_size + PAGE_SIZE - 1) / PAGE_SIZE; brq->blk_flags = param->blk_flags; return 0; } static int lstcon_bulkrpc_v1_prep(lst_test_bulk_param_t *param, struct srpc_test_reqst *req) { struct test_bulk_req_v1 *brq = &req->tsr_u.bulk_v1; brq->blk_opc = param->blk_opc; brq->blk_flags = param->blk_flags; brq->blk_len = param->blk_size; brq->blk_offset = 0; /* reserved */ return 0; } int lstcon_testrpc_prep(struct lstcon_node *nd, int transop, unsigned feats, struct lstcon_test *test, struct lstcon_rpc **crpc) { struct lstcon_group *sgrp = test->tes_src_grp; struct lstcon_group *dgrp = test->tes_dst_grp; struct srpc_test_reqst *trq; struct srpc_bulk *bulk; int i; int npg = 0; int nob = 0; int rc = 0; if (transop == LST_TRANS_TSBCLIADD) { npg = sfw_id_pages(test->tes_span); nob = !(feats & LST_FEAT_BULK_LEN) ? npg * PAGE_SIZE : sizeof(lnet_process_id_packed_t) * test->tes_span; } rc = lstcon_rpc_prep(nd, SRPC_SERVICE_TEST, feats, npg, nob, crpc); if (rc) return rc; trq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.tes_reqst; if (transop == LST_TRANS_TSBSRVADD) { int ndist = (sgrp->grp_nnode + test->tes_dist - 1) / test->tes_dist; int nspan = (dgrp->grp_nnode + test->tes_span - 1) / test->tes_span; int nmax = (ndist + nspan - 1) / nspan; trq->tsr_ndest = 0; trq->tsr_loop = nmax * test->tes_dist * test->tes_concur; } else { bulk = &(*crpc)->crp_rpc->crpc_bulk; for (i = 0; i < npg; i++) { int len; LASSERT(nob > 0); len = !(feats & LST_FEAT_BULK_LEN) ? PAGE_SIZE : min_t(int, nob, PAGE_SIZE); nob -= len; bulk->bk_iovs[i].kiov_offset = 0; bulk->bk_iovs[i].kiov_len = len; bulk->bk_iovs[i].kiov_page = alloc_page(GFP_KERNEL); if (!bulk->bk_iovs[i].kiov_page) { lstcon_rpc_put(*crpc); return -ENOMEM; } } bulk->bk_sink = 0; LASSERT(transop == LST_TRANS_TSBCLIADD); rc = lstcon_dstnodes_prep(test->tes_dst_grp, test->tes_cliidx++, test->tes_dist, test->tes_span, npg, &bulk->bk_iovs[0]); if (rc) { lstcon_rpc_put(*crpc); return rc; } trq->tsr_ndest = test->tes_span; trq->tsr_loop = test->tes_loop; } trq->tsr_sid = console_session.ses_id; trq->tsr_bid = test->tes_hdr.tsb_id; trq->tsr_concur = test->tes_concur; trq->tsr_is_client = (transop == LST_TRANS_TSBCLIADD) ? 1 : 0; trq->tsr_stop_onerr = !!test->tes_stop_onerr; switch (test->tes_type) { case LST_TEST_PING: trq->tsr_service = SRPC_SERVICE_PING; rc = lstcon_pingrpc_prep((lst_test_ping_param_t *) &test->tes_param[0], trq); break; case LST_TEST_BULK: trq->tsr_service = SRPC_SERVICE_BRW; if (!(feats & LST_FEAT_BULK_LEN)) { rc = lstcon_bulkrpc_v0_prep((lst_test_bulk_param_t *) &test->tes_param[0], trq); } else { rc = lstcon_bulkrpc_v1_prep((lst_test_bulk_param_t *) &test->tes_param[0], trq); } break; default: LBUG(); break; } return rc; } static int lstcon_sesnew_stat_reply(struct lstcon_rpc_trans *trans, struct lstcon_node *nd, struct srpc_msg *reply) { struct srpc_mksn_reply *mksn_rep = &reply->msg_body.mksn_reply; int status = mksn_rep->mksn_status; if (!status && (reply->msg_ses_feats & ~LST_FEATS_MASK)) { mksn_rep->mksn_status = EPROTO; status = EPROTO; } if (status == EPROTO) { CNETERR("session protocol error from %s: %u\n", libcfs_nid2str(nd->nd_id.nid), reply->msg_ses_feats); } if (status) return status; if (!trans->tas_feats_updated) { spin_lock(&console_session.ses_rpc_lock); if (!trans->tas_feats_updated) { /* recheck with lock */ trans->tas_feats_updated = 1; trans->tas_features = reply->msg_ses_feats; } spin_unlock(&console_session.ses_rpc_lock); } if (reply->msg_ses_feats != trans->tas_features) { CNETERR("Framework features %x from %s is different with features on this transaction: %x\n", reply->msg_ses_feats, libcfs_nid2str(nd->nd_id.nid), trans->tas_features); mksn_rep->mksn_status = EPROTO; status = EPROTO; } if (!status) { /* session timeout on remote node */ nd->nd_timeout = mksn_rep->mksn_timeout; } return status; } void lstcon_rpc_stat_reply(struct lstcon_rpc_trans *trans, struct srpc_msg *msg, struct lstcon_node *nd, lstcon_trans_stat_t *stat) { struct srpc_rmsn_reply *rmsn_rep; struct srpc_debug_reply *dbg_rep; struct srpc_batch_reply *bat_rep; struct srpc_test_reply *test_rep; struct srpc_stat_reply *stat_rep; int rc = 0; switch (trans->tas_opc) { case LST_TRANS_SESNEW: rc = lstcon_sesnew_stat_reply(trans, nd, msg); if (!rc) { lstcon_sesop_stat_success(stat, 1); return; } lstcon_sesop_stat_failure(stat, 1); break; case LST_TRANS_SESEND: rmsn_rep = &msg->msg_body.rmsn_reply; /* ESRCH is not an error for end session */ if (!rmsn_rep->rmsn_status || rmsn_rep->rmsn_status == ESRCH) { lstcon_sesop_stat_success(stat, 1); return; } lstcon_sesop_stat_failure(stat, 1); rc = rmsn_rep->rmsn_status; break; case LST_TRANS_SESQRY: case LST_TRANS_SESPING: dbg_rep = &msg->msg_body.dbg_reply; if (dbg_rep->dbg_status == ESRCH) { lstcon_sesqry_stat_unknown(stat, 1); return; } if (lstcon_session_match(dbg_rep->dbg_sid)) lstcon_sesqry_stat_active(stat, 1); else lstcon_sesqry_stat_busy(stat, 1); return; case LST_TRANS_TSBRUN: case LST_TRANS_TSBSTOP: bat_rep = &msg->msg_body.bat_reply; if (!bat_rep->bar_status) { lstcon_tsbop_stat_success(stat, 1); return; } if (bat_rep->bar_status == EPERM && trans->tas_opc == LST_TRANS_TSBSTOP) { lstcon_tsbop_stat_success(stat, 1); return; } lstcon_tsbop_stat_failure(stat, 1); rc = bat_rep->bar_status; break; case LST_TRANS_TSBCLIQRY: case LST_TRANS_TSBSRVQRY: bat_rep = &msg->msg_body.bat_reply; if (bat_rep->bar_active) lstcon_tsbqry_stat_run(stat, 1); else lstcon_tsbqry_stat_idle(stat, 1); if (!bat_rep->bar_status) return; lstcon_tsbqry_stat_failure(stat, 1); rc = bat_rep->bar_status; break; case LST_TRANS_TSBCLIADD: case LST_TRANS_TSBSRVADD: test_rep = &msg->msg_body.tes_reply; if (!test_rep->tsr_status) { lstcon_tsbop_stat_success(stat, 1); return; } lstcon_tsbop_stat_failure(stat, 1); rc = test_rep->tsr_status; break; case LST_TRANS_STATQRY: stat_rep = &msg->msg_body.stat_reply; if (!stat_rep->str_status) { lstcon_statqry_stat_success(stat, 1); return; } lstcon_statqry_stat_failure(stat, 1); rc = stat_rep->str_status; break; default: LBUG(); } if (!stat->trs_fwk_errno) stat->trs_fwk_errno = rc; } int lstcon_rpc_trans_ndlist(struct list_head *ndlist, struct list_head *translist, int transop, void *arg, lstcon_rpc_cond_func_t condition, struct lstcon_rpc_trans **transpp) { struct lstcon_rpc_trans *trans; struct lstcon_ndlink *ndl; struct lstcon_node *nd; struct lstcon_rpc *rpc; unsigned feats; int rc; /* Creating session RPG for list of nodes */ rc = lstcon_rpc_trans_prep(translist, transop, &trans); if (rc) { CERROR("Can't create transaction %d: %d\n", transop, rc); return rc; } feats = trans->tas_features; list_for_each_entry(ndl, ndlist, ndl_link) { rc = !condition ? 1 : condition(transop, ndl->ndl_node, arg); if (!rc) continue; if (rc < 0) { CDEBUG(D_NET, "Condition error while creating RPC for transaction %d: %d\n", transop, rc); break; } nd = ndl->ndl_node; switch (transop) { case LST_TRANS_SESNEW: case LST_TRANS_SESEND: rc = lstcon_sesrpc_prep(nd, transop, feats, &rpc); break; case LST_TRANS_SESQRY: case LST_TRANS_SESPING: rc = lstcon_dbgrpc_prep(nd, feats, &rpc); break; case LST_TRANS_TSBCLIADD: case LST_TRANS_TSBSRVADD: rc = lstcon_testrpc_prep(nd, transop, feats, (struct lstcon_test *)arg, &rpc); break; case LST_TRANS_TSBRUN: case LST_TRANS_TSBSTOP: case LST_TRANS_TSBCLIQRY: case LST_TRANS_TSBSRVQRY: rc = lstcon_batrpc_prep(nd, transop, feats, (struct lstcon_tsb_hdr *)arg, &rpc); break; case LST_TRANS_STATQRY: rc = lstcon_statrpc_prep(nd, feats, &rpc); break; default: rc = -EINVAL; break; } if (rc) { CERROR("Failed to create RPC for transaction %s: %d\n", lstcon_rpc_trans_name(transop), rc); break; } lstcon_rpc_trans_addreq(trans, rpc); } if (!rc) { *transpp = trans; return 0; } lstcon_rpc_trans_destroy(trans); return rc; } static void lstcon_rpc_pinger(void *arg) { struct stt_timer *ptimer = (struct stt_timer *)arg; struct lstcon_rpc_trans *trans; struct lstcon_rpc *crpc; struct srpc_msg *rep; struct srpc_debug_reqst *drq; struct lstcon_ndlink *ndl; struct lstcon_node *nd; int intv; int count = 0; int rc; /* * RPC pinger is a special case of transaction, * it's called by timer at 8 seconds interval. */ mutex_lock(&console_session.ses_mutex); if (console_session.ses_shutdown || console_session.ses_expired) { mutex_unlock(&console_session.ses_mutex); return; } if (!console_session.ses_expired && ktime_get_real_seconds() - console_session.ses_laststamp > (time64_t)console_session.ses_timeout) console_session.ses_expired = 1; trans = console_session.ses_ping; LASSERT(trans); list_for_each_entry(ndl, &console_session.ses_ndl_list, ndl_link) { nd = ndl->ndl_node; if (console_session.ses_expired) { /* idle console, end session on all nodes */ if (nd->nd_state != LST_NODE_ACTIVE) continue; rc = lstcon_sesrpc_prep(nd, LST_TRANS_SESEND, trans->tas_features, &crpc); if (rc) { CERROR("Out of memory\n"); break; } lstcon_rpc_trans_addreq(trans, crpc); lstcon_rpc_post(crpc); continue; } crpc = &nd->nd_ping; if (crpc->crp_rpc) { LASSERT(crpc->crp_trans == trans); LASSERT(!list_empty(&crpc->crp_link)); spin_lock(&crpc->crp_rpc->crpc_lock); LASSERT(crpc->crp_posted); if (!crpc->crp_finished) { /* in flight */ spin_unlock(&crpc->crp_rpc->crpc_lock); continue; } spin_unlock(&crpc->crp_rpc->crpc_lock); lstcon_rpc_get_reply(crpc, &rep); list_del_init(&crpc->crp_link); lstcon_rpc_put(crpc); } if (nd->nd_state != LST_NODE_ACTIVE) continue; intv = (jiffies - nd->nd_stamp) / msecs_to_jiffies(MSEC_PER_SEC); if (intv < nd->nd_timeout / 2) continue; rc = lstcon_rpc_init(nd, SRPC_SERVICE_DEBUG, trans->tas_features, 0, 0, 1, crpc); if (rc) { CERROR("Out of memory\n"); break; } drq = &crpc->crp_rpc->crpc_reqstmsg.msg_body.dbg_reqst; drq->dbg_sid = console_session.ses_id; drq->dbg_flags = 0; lstcon_rpc_trans_addreq(trans, crpc); lstcon_rpc_post(crpc); count++; } if (console_session.ses_expired) { mutex_unlock(&console_session.ses_mutex); return; } CDEBUG(D_NET, "Ping %d nodes in session\n", count); ptimer->stt_expires = ktime_get_real_seconds() + LST_PING_INTERVAL; stt_add_timer(ptimer); mutex_unlock(&console_session.ses_mutex); } int lstcon_rpc_pinger_start(void) { struct stt_timer *ptimer; int rc; LASSERT(list_empty(&console_session.ses_rpc_freelist)); LASSERT(!atomic_read(&console_session.ses_rpc_counter)); rc = lstcon_rpc_trans_prep(NULL, LST_TRANS_SESPING, &console_session.ses_ping); if (rc) { CERROR("Failed to create console pinger\n"); return rc; } ptimer = &console_session.ses_ping_timer; ptimer->stt_expires = ktime_get_real_seconds() + LST_PING_INTERVAL; stt_add_timer(ptimer); return 0; } void lstcon_rpc_pinger_stop(void) { LASSERT(console_session.ses_shutdown); stt_del_timer(&console_session.ses_ping_timer); lstcon_rpc_trans_abort(console_session.ses_ping, -ESHUTDOWN); lstcon_rpc_trans_stat(console_session.ses_ping, lstcon_trans_stat()); lstcon_rpc_trans_destroy(console_session.ses_ping); memset(lstcon_trans_stat(), 0, sizeof(lstcon_trans_stat_t)); console_session.ses_ping = NULL; } void lstcon_rpc_cleanup_wait(void) { struct lstcon_rpc_trans *trans; struct lstcon_rpc *crpc; struct lstcon_rpc *temp; struct list_head *pacer; struct list_head zlist; /* Called with hold of global mutex */ LASSERT(console_session.ses_shutdown); while (!list_empty(&console_session.ses_trans_list)) { list_for_each(pacer, &console_session.ses_trans_list) { trans = list_entry(pacer, struct lstcon_rpc_trans, tas_link); CDEBUG(D_NET, "Session closed, wakeup transaction %s\n", lstcon_rpc_trans_name(trans->tas_opc)); wake_up(&trans->tas_waitq); } mutex_unlock(&console_session.ses_mutex); CWARN("Session is shutting down, waiting for termination of transactions\n"); set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(cfs_time_seconds(1)); mutex_lock(&console_session.ses_mutex); } spin_lock(&console_session.ses_rpc_lock); lst_wait_until(!atomic_read(&console_session.ses_rpc_counter), console_session.ses_rpc_lock, "Network is not accessible or target is down, waiting for %d console RPCs to being recycled\n", atomic_read(&console_session.ses_rpc_counter)); list_add(&zlist, &console_session.ses_rpc_freelist); list_del_init(&console_session.ses_rpc_freelist); spin_unlock(&console_session.ses_rpc_lock); list_for_each_entry_safe(crpc, temp, &zlist, crp_link) { list_del(&crpc->crp_link); LIBCFS_FREE(crpc, sizeof(struct lstcon_rpc)); } } int lstcon_rpc_module_init(void) { INIT_LIST_HEAD(&console_session.ses_ping_timer.stt_list); console_session.ses_ping_timer.stt_func = lstcon_rpc_pinger; console_session.ses_ping_timer.stt_data = &console_session.ses_ping_timer; console_session.ses_ping = NULL; spin_lock_init(&console_session.ses_rpc_lock); atomic_set(&console_session.ses_rpc_counter, 0); INIT_LIST_HEAD(&console_session.ses_rpc_freelist); return 0; } void lstcon_rpc_module_fini(void) { LASSERT(list_empty(&console_session.ses_rpc_freelist)); LASSERT(!atomic_read(&console_session.ses_rpc_counter)); }
{ "content_hash": "dec762c0eab4a861a7677144b5098573", "timestamp": "", "source": "github", "line_count": 1375, "max_line_length": 105, "avg_line_length": 22.462545454545456, "alnum_prop": 0.6501975004856569, "repo_name": "AlbandeCrevoisier/ldd-athens", "id": "6f687581117deccec1d2635ac7bbc48f975147a8", "size": "31888", "binary": false, "copies": "42", "ref": "refs/heads/master", "path": "linux-socfpga/drivers/staging/lustre/lnet/selftest/conrpc.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "10184236" }, { "name": "Awk", "bytes": "40418" }, { "name": "Batchfile", "bytes": "81753" }, { "name": "C", "bytes": "566858455" }, { "name": "C++", "bytes": "21399133" }, { "name": "Clojure", "bytes": "971" }, { "name": "Cucumber", "bytes": "5998" }, { "name": "FORTRAN", "bytes": "11832" }, { "name": "GDB", "bytes": "18113" }, { "name": "Groff", "bytes": "2686457" }, { "name": "HTML", "bytes": "34688334" }, { "name": "Lex", "bytes": "56961" }, { "name": "Logos", "bytes": "133810" }, { "name": "M4", "bytes": "3325" }, { "name": "Makefile", "bytes": "1685015" }, { "name": "Objective-C", "bytes": "920162" }, { "name": "Perl", "bytes": "752477" }, { "name": "Perl6", "bytes": "3783" }, { "name": "Python", "bytes": "533352" }, { "name": "Shell", "bytes": "468244" }, { "name": "SourcePawn", "bytes": "2711" }, { "name": "UnrealScript", "bytes": "12824" }, { "name": "XC", "bytes": "33970" }, { "name": "XS", "bytes": "34909" }, { "name": "Yacc", "bytes": "113516" } ], "symlink_target": "" }
<!DOCTYPE HTML> <html> <head> <title>Opa sample for FormSamples</title> <script src="../../../../../../../../resources/sap/ui/thirdparty/qunit-2.js"></script> <link href="../../../../../../../../resources/sap/ui/thirdparty/qunit-2.css" rel="stylesheet"> <script src="../../../../../../../../resources/sap-ui-core.js" id="sap-ui-bootstrap" data-sap-ui-resourceroots='{ "sap.ui.layout.sample" : "../../", "sap.ui.demo.mock": "../../../../../../../../test-resources/sap/ui/documentation/sdk/" }' data-sap-ui-async="true" data-sample-component="sap.ui.layout.sample.SimpleForm354wideDual"> </script> <script src="../../tests/formTests.js"></script> <link href="../../tests/formTests.css" rel="stylesheet"> </head> <body> <div id="qunit"></div> <div id="qunit-fixture"></div> </body> </html>
{ "content_hash": "2864606ea293df93073c12d4fcc85945", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 97, "avg_line_length": 33.48, "alnum_prop": 0.5770609318996416, "repo_name": "SAP/openui5", "id": "51a5897aebc0d81558f21585e4e5041a01739e5b", "size": "837", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/sap.ui.layout/test/sap/ui/layout/demokit/sample/SimpleForm354wideDual/test/FormSampleJourney.qunit.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "294216" }, { "name": "Gherkin", "bytes": "17201" }, { "name": "HTML", "bytes": "6443688" }, { "name": "Java", "bytes": "83398" }, { "name": "JavaScript", "bytes": "109546491" }, { "name": "Less", "bytes": "8741757" }, { "name": "TypeScript", "bytes": "20918" } ], "symlink_target": "" }
import request from '@/utils/request' export function login(email, password) { return request({ url: '/auth/login', method: 'post', data: { email, password } }) } export function refreshToken() { return request({ url: '/auth/refresh', method: 'post' }) } export function getInfo(token) { return request({ url: '/user/current', method: 'get', params: { token } }) } export function logout(token) { return request({ url: '/auth/logout', method: 'post' }) }
{ "content_hash": "5d9fba3925347d0bf878431475d12083", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 40, "avg_line_length": 15.617647058823529, "alnum_prop": 0.583804143126177, "repo_name": "zgldh/scaffold", "id": "06e5773d6a5f0f418fa57a2c755f2533491b1680", "size": "531", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "frontend/src/api/login.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "56292" }, { "name": "PHP", "bytes": "516791" }, { "name": "Vue", "bytes": "250173" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <!-- From: file:/tmp/tmp-deduplicated8343575191335814618/blaze-out/gcc-4.X.Y-crosstool-v18-hybrid-grtev4-k8-opt/genfiles/java/com/google/android/gmscore/integ/client/places/res/values-et/strings.xml --> <eat-comment/> <string msgid="1303870564366209730" name="place_autocomplete_clear_button">"Otsingu kustutamine"</string> <string msgid="2809095107724486040" name="place_autocomplete_search_hint">"Otsing"</string> </resources>
{ "content_hash": "d5564f63118db00037ed2fbf1f373138", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 206, "avg_line_length": 70.71428571428571, "alnum_prop": 0.7515151515151515, "repo_name": "ntdan/CrazyChicken", "id": "994be839847591df1f2b23d747511343149b26ed", "size": "495", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/build/intermediates/exploded-aar/com.google.android.gms/play-services-places/9.4.0/res/values-et/values.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "835643" } ], "symlink_target": "" }
#region License // Distributed under the MIT License // ============================================================ // Copyright (c) 2019 Hotcakes Commerce, LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software // and associated documentation files (the "Software"), to deal in the Software without restriction, // including without limitation the rights to use, copy, modify, merge, publish, distribute, // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #endregion using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Security.Permissions; using Hotcakes.Commerce.Dnn.Web; namespace Hotcakes.Modules.ProductReviews { public partial class ProductReviewsView : HotcakesModuleBase { protected override string RenderView() { var slug = Request.Params["slug"]; if (!string.IsNullOrEmpty(slug)) { return MvcRenderingEngine.Render("ProductReviews", "Index", new {slug}); } if (!TabPermissionController.CanManagePage()) { if (PortalSettings.HomeTabId != Null.NullInteger) { if (PortalSettings.HomeTabId != PortalSettings.ActiveTab.TabID) { Response.Redirect(Globals.NavigateURL(PortalSettings.HomeTabId)); } } } return string.Empty; } } }
{ "content_hash": "cdc6fd795dbbffbb66488717cf9badc6", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 101, "avg_line_length": 39.892857142857146, "alnum_prop": 0.6521933751119069, "repo_name": "HotcakesCommerce/core", "id": "6ae29cf3955b8288a6f3a9cba385c1ceebbdc211", "size": "2236", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Website/DesktopModules/Hotcakes/ProductReviews/ProductReviewsView.ascx.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "2267142" }, { "name": "Batchfile", "bytes": "373" }, { "name": "C#", "bytes": "11194618" }, { "name": "CSS", "bytes": "1952419" }, { "name": "HTML", "bytes": "873593" }, { "name": "JavaScript", "bytes": "4896110" }, { "name": "Smalltalk", "bytes": "2410" }, { "name": "Visual Basic", "bytes": "16681" }, { "name": "XSLT", "bytes": "10409" } ], "symlink_target": "" }
package org.leguan.testproject.refactoring.steps.visibility; class ChangeVisibilityFieldPublic { public String publicField; }
{ "content_hash": "d239538cdf0004ca197fa80a75f2d2e4", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 60, "avg_line_length": 25.6, "alnum_prop": 0.84375, "repo_name": "moley/leguan", "id": "c56457218f5ba33259b7e61550bf7c3939a1e259", "size": "128", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "leguan-testprojects/testprojectJava/src/main/java/org/leguan/testproject/refactoring/steps/visibility/ChangeVisibilityFieldPublic.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "20530" }, { "name": "HTML", "bytes": "35444" }, { "name": "Java", "bytes": "2096474" }, { "name": "JavaScript", "bytes": "1240" }, { "name": "Shell", "bytes": "1844" }, { "name": "TypeScript", "bytes": "71940" } ], "symlink_target": "" }
.class final Landroid/bluetooth/le/AdvertiseData$1; .super Ljava/lang/Object; .source "AdvertiseData.java" # interfaces .implements Landroid/os/Parcelable$Creator; # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Landroid/bluetooth/le/AdvertiseData; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x8 name = null .end annotation .annotation system Ldalvik/annotation/Signature; value = { "Ljava/lang/Object;", "Landroid/os/Parcelable$Creator", "<", "Landroid/bluetooth/le/AdvertiseData;", ">;" } .end annotation # direct methods .method constructor <init>()V .locals 0 .prologue .line 176 invoke-direct {p0}, Ljava/lang/Object;-><init>()V return-void .end method # virtual methods .method public createFromParcel(Landroid/os/Parcel;)Landroid/bluetooth/le/AdvertiseData; .locals 16 .param p1, "in" # Landroid/os/Parcel; .prologue .line 184 new-instance v1, Landroid/bluetooth/le/AdvertiseData$Builder; invoke-direct {v1}, Landroid/bluetooth/le/AdvertiseData$Builder;-><init>()V .line 186 .local v1, "builder":Landroid/bluetooth/le/AdvertiseData$Builder; const-class v14, Landroid/os/ParcelUuid; invoke-virtual {v14}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader; move-result-object v14 move-object/from16 v0, p1 invoke-virtual {v0, v14}, Landroid/os/Parcel;->readArrayList(Ljava/lang/ClassLoader;)Ljava/util/ArrayList; move-result-object v13 .line 187 .local v13, "uuids":Ljava/util/List;, "Ljava/util/List<Landroid/os/ParcelUuid;>;" if-eqz v13, :cond_0 .line 188 invoke-interface {v13}, Ljava/util/List;->iterator()Ljava/util/Iterator; move-result-object v3 .local v3, "i$":Ljava/util/Iterator; :goto_0 invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z move-result v14 if-eqz v14, :cond_0 invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v12 check-cast v12, Landroid/os/ParcelUuid; .line 189 .local v12, "uuid":Landroid/os/ParcelUuid; invoke-virtual {v1, v12}, Landroid/bluetooth/le/AdvertiseData$Builder;->addServiceUuid(Landroid/os/ParcelUuid;)Landroid/bluetooth/le/AdvertiseData$Builder; goto :goto_0 .line 192 .end local v3 # "i$":Ljava/util/Iterator; .end local v12 # "uuid":Landroid/os/ParcelUuid; :cond_0 invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->readInt()I move-result v7 .line 193 .local v7, "manufacturerSize":I const/4 v2, 0x0 .local v2, "i":I :goto_1 if-ge v2, v7, :cond_2 .line 194 invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->readInt()I move-result v6 .line 195 .local v6, "manufacturerId":I invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->readInt()I move-result v14 const/4 v15, 0x1 if-ne v14, v15, :cond_1 .line 196 invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->readInt()I move-result v5 .line 197 .local v5, "manufacturerDataLength":I new-array v4, v5, [B .line 198 .local v4, "manufacturerData":[B move-object/from16 v0, p1 invoke-virtual {v0, v4}, Landroid/os/Parcel;->readByteArray([B)V .line 199 invoke-virtual {v1, v6, v4}, Landroid/bluetooth/le/AdvertiseData$Builder;->addManufacturerData(I[B)Landroid/bluetooth/le/AdvertiseData$Builder; .line 193 .end local v4 # "manufacturerData":[B .end local v5 # "manufacturerDataLength":I :cond_1 add-int/lit8 v2, v2, 0x1 goto :goto_1 .line 202 .end local v6 # "manufacturerId":I :cond_2 invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->readInt()I move-result v10 .line 203 .local v10, "serviceDataSize":I const/4 v2, 0x0 :goto_2 if-ge v2, v10, :cond_4 .line 204 const-class v14, Landroid/os/ParcelUuid; invoke-virtual {v14}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader; move-result-object v14 move-object/from16 v0, p1 invoke-virtual {v0, v14}, Landroid/os/Parcel;->readParcelable(Ljava/lang/ClassLoader;)Landroid/os/Parcelable; move-result-object v11 check-cast v11, Landroid/os/ParcelUuid; .line 206 .local v11, "serviceDataUuid":Landroid/os/ParcelUuid; invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->readInt()I move-result v14 const/4 v15, 0x1 if-ne v14, v15, :cond_3 .line 207 invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->readInt()I move-result v9 .line 208 .local v9, "serviceDataLength":I new-array v8, v9, [B .line 209 .local v8, "serviceData":[B move-object/from16 v0, p1 invoke-virtual {v0, v8}, Landroid/os/Parcel;->readByteArray([B)V .line 210 invoke-virtual {v1, v11, v8}, Landroid/bluetooth/le/AdvertiseData$Builder;->addServiceData(Landroid/os/ParcelUuid;[B)Landroid/bluetooth/le/AdvertiseData$Builder; .line 203 .end local v8 # "serviceData":[B .end local v9 # "serviceDataLength":I :cond_3 add-int/lit8 v2, v2, 0x1 goto :goto_2 .line 213 .end local v11 # "serviceDataUuid":Landroid/os/ParcelUuid; :cond_4 invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->readByte()B move-result v14 const/4 v15, 0x1 if-ne v14, v15, :cond_5 const/4 v14, 0x1 :goto_3 invoke-virtual {v1, v14}, Landroid/bluetooth/le/AdvertiseData$Builder;->setIncludeTxPowerLevel(Z)Landroid/bluetooth/le/AdvertiseData$Builder; .line 214 invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->readByte()B move-result v14 const/4 v15, 0x1 if-ne v14, v15, :cond_6 const/4 v14, 0x1 :goto_4 invoke-virtual {v1, v14}, Landroid/bluetooth/le/AdvertiseData$Builder;->setIncludeDeviceName(Z)Landroid/bluetooth/le/AdvertiseData$Builder; .line 215 invoke-virtual {v1}, Landroid/bluetooth/le/AdvertiseData$Builder;->build()Landroid/bluetooth/le/AdvertiseData; move-result-object v14 return-object v14 .line 213 :cond_5 const/4 v14, 0x0 goto :goto_3 .line 214 :cond_6 const/4 v14, 0x0 goto :goto_4 .end method .method public bridge synthetic createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object; .locals 1 .param p1, "x0" # Landroid/os/Parcel; .prologue .line 176 invoke-virtual {p0, p1}, Landroid/bluetooth/le/AdvertiseData$1;->createFromParcel(Landroid/os/Parcel;)Landroid/bluetooth/le/AdvertiseData; move-result-object v0 return-object v0 .end method .method public newArray(I)[Landroid/bluetooth/le/AdvertiseData; .locals 1 .param p1, "size" # I .prologue .line 179 new-array v0, p1, [Landroid/bluetooth/le/AdvertiseData; return-object v0 .end method .method public bridge synthetic newArray(I)[Ljava/lang/Object; .locals 1 .param p1, "x0" # I .prologue .line 176 invoke-virtual {p0, p1}, Landroid/bluetooth/le/AdvertiseData$1;->newArray(I)[Landroid/bluetooth/le/AdvertiseData; move-result-object v0 return-object v0 .end method
{ "content_hash": "fde7496af0c5cad00784232153c1a5c4", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 165, "avg_line_length": 23.848184818481847, "alnum_prop": 0.6695267091060061, "repo_name": "shumxin/FlymeOS_A5DUG", "id": "d91f83f04a542f22c554ce741a018282e0c0a47b", "size": "7226", "binary": false, "copies": "2", "ref": "refs/heads/lollipop-5.0", "path": "framework.jar.out/smali_classes2/android/bluetooth/le/AdvertiseData$1.smali", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "GLSL", "bytes": "1500" }, { "name": "HTML", "bytes": "96769" }, { "name": "Makefile", "bytes": "13678" }, { "name": "Shell", "bytes": "103420" }, { "name": "Smali", "bytes": "189389087" } ], "symlink_target": "" }
from base_classes.zoomdata_api_base import ZoomdataRequest from base_classes.zoomdata_api_impala import ImpalaConnection zoomdataBaseURL = raw_input("Enter the Zoomdata instance URL (https://<server>:<port>/zoomdata): ") adminUser = raw_input("Enter the Zoomdata administrator username (typically 'admin'): ") adminPassword = raw_input("Enter the password for the Zoomdata administrator: ") jdbc_url = raw_input("Enter the JDBC connection string for your Impala instance (i.e. jdbc:hive2://<server>:<port>/;auth=noSasl): ") connectionUser = raw_input("Enter the connection username (optional): ") if connectionUser != "": connectionPassword = raw_input("Enter the connection user's password (optional): ") else: connectionPassword = "" connectorTypeInput = raw_input("Is this connector an EDC? (yes or no): ") if connectorTypeInput.lower() == "yes": connectionTypeID = raw_input("Enter the connection type ID (required for EDC): ") else: connectionTypeID = "" debug = raw_input("Do you want to enable verbose output (debug mode; prints all API request data to the console)? (yes or no): ") connectionName = raw_input("Finally, enter a name for the new connection: ") # Create the Zoomdata server request zoomdataServerRequest = ZoomdataRequest(zoomdataBaseURL, adminUser, adminPassword) # Enable verbose output if desired if debug.lower() == "yes": zoomdataServerRequest.enableDebug() # Initialize the connection object connection = ImpalaConnection(connectionName, zoomdataServerRequest, jdbc_url, connectionUser, connectionPassword, connectionTypeID) # Finally, create the connection in Zoomdata connection.create() # Return the Zoomdata connection id of the newly created connection print "connection: "+connection.id # Uncomment the line below to delete the connection after creation (for testing purposes) #connection.delete()
{ "content_hash": "ce913b393a6b7e1b00a8c3ee7c76a92c", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 132, "avg_line_length": 54.26470588235294, "alnum_prop": 0.77289972899729, "repo_name": "Zoomdata/zoomdata-tools", "id": "d1e3d25fbce2ced4081af26b0593c339b39e83d6", "size": "1867", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "api-examples/impala/create_impala_connection.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "920" }, { "name": "Python", "bytes": "87797" }, { "name": "Shell", "bytes": "55778" } ], "symlink_target": "" }
<?php namespace Extia\Bundle\NotificationBundle\Notification; /** * Interface for app notifier */ interface NotifierInterface { /** * @return array all supported notif types */ public function getTypes(); /** * render a notification * @param string $type notif type * @param string $message template, controller or string * @param array $params template or controller parameters * @param string $rendreding rendering strategy * @return string html string of given notification */ public function render($type, $message, $params = array(), $rendering = 'flat'); /** * adds a new notification using session flashbag * @param string $type notif type * @param string $message template, controller or string * @param array $params template or controller parameters * @param string $rendreding rendering strategy */ public function add($type, $message, $params = array(), $rendering = 'flat'); /** * @param string $type * @return array rendered notifications */ public function get($type); /** * @return array all types rendered notifications */ public function all(); }
{ "content_hash": "b7411048038e30902348f826ed5ac133", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 84, "avg_line_length": 27.733333333333334, "alnum_prop": 0.6354166666666666, "repo_name": "Nyxis/Rhea", "id": "e7898e333a245cf111bbe47bf6de557a275c963c", "size": "1248", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/Extia/Bundle/NotificationBundle/Notification/NotifierInterface.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "35517" }, { "name": "JavaScript", "bytes": "10720" }, { "name": "PHP", "bytes": "512802" }, { "name": "Ruby", "bytes": "3448" } ], "symlink_target": "" }
import { Component, ViewEncapsulation, Input } from '@angular/core'; import { Subscription } from 'rxjs/Subscription'; import { ActivatedRoute, Params, Router } from '@angular/router' import { AbstractControl, Validators } from '@angular/forms'; import { SharedService } from '../../../../services/shared.service'; import { ProductTypeService } from '../../productType.service'; import 'rxjs/add/operator/take'; @Component({ selector: 'product-type-form', encapsulation: ViewEncapsulation.None, styleUrls: ['./productTypeForm.scss'], templateUrl: './productTypeForm.html', }) export class ProductTypeForm { JSON: any = JSON; productType: any = {}; constructor(protected service: ProductTypeService, private route: ActivatedRoute, private router: Router, private sharedService: SharedService) { } ngOnInit(): void { let id = this.route.snapshot.paramMap.get('id'); if (id) { this.service.get(+id).take(1).subscribe(productType => { if (productType) this.productType = productType; }); } } public save(productType: any): void { this.service.save(productType).subscribe( (data) => { this.sharedService.addMessage({ severity: 'info', summary: 'Success', detail: 'Operation Success' }); this.router.navigate(['/pages/productType/form/']); } ); } }
{ "content_hash": "ef019c8db0348a56ffba4ff47d9947a0", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 121, "avg_line_length": 34.023809523809526, "alnum_prop": 0.6368089573128062, "repo_name": "thilina01/kpi-client", "id": "1fac0428fdb2d999e4a01c2b9ce2344bdeefaea7", "size": "1429", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/pages/productType/components/productTypeForm/productTypeForm.component.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "52" }, { "name": "CSS", "bytes": "115830" }, { "name": "Dockerfile", "bytes": "381" }, { "name": "HTML", "bytes": "775116" }, { "name": "JavaScript", "bytes": "38435" }, { "name": "SCSS", "bytes": "109026" }, { "name": "Shell", "bytes": "269" }, { "name": "TypeScript", "bytes": "1428974" } ], "symlink_target": "" }
package fr.lteconsulting.activity.utils; import com.google.gwt.user.client.ui.IsWidget; import com.google.gwt.user.client.ui.Widget; /** * A basic activity controller with a default display layout. */ public class SimpleActivityController extends ActivityController implements IsWidget { public SimpleActivityController() { super( new ActivityLayoutPanel() ); } @Override public Widget asWidget() { return getDisplay().asWidget(); } }
{ "content_hash": "aa272ef92b46e38ba968f0df81f6d139", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 84, "avg_line_length": 21.476190476190474, "alnum_prop": 0.7649667405764967, "repo_name": "ltearno/activities", "id": "4cbc7ec93d12267ea5b7dc770c451cf1e8a34e81", "size": "451", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/fr/lteconsulting/activity/utils/SimpleActivityController.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "147" }, { "name": "Java", "bytes": "29003" } ], "symlink_target": "" }
//Title: Custom DropDown plugin by PC //Documentation: http://designwithpc.com/Plugins/ddslick //Author: PC //Website: http://designwithpc.com //Twitter: http://twitter.com/chaudharyp (function ($) { $.fn.ddslick = function (method) { if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { return methods.init.apply(this, arguments); } else { $.error('Method ' + method + ' does not exists.'); } }; var methods = {}, //Set defauls for the control defaults = { data: [], keepJSONItemsOnTop: false, width: 260, height: null, background: "#eee", selectText: "", defaultSelectedIndex: null, truncateDescription: true, imagePosition: "left", showSelectedHTML: true, clickOffToClose: true, onSelected: function () { } }, ddSelectHtml = '<div class="dd-select"><input class="dd-selected-value" type="hidden" /><a class="dd-selected"></a><span class="dd-pointer dd-pointer-down"></span></div>', ddOptionsHtml = '<ul class="dd-options"></ul>', //CSS for ddSlick ddslickCSS = '<style id="css-ddslick" type="text/css">' + '.dd-select{ border-radius:10px; border:solid 1px #ccc; position:relative; cursor:pointer; height:2rem; width:192px;}' + '.dd-desc { color:#aaa; display:block; overflow: hidden; font-weight:normal; line-height: 1.4em; }' + '.dd-selected{ overflow:hidden; display:block; padding:5px; font-weight:bold; font-size:1rem}' + '.dd-pointer{ width:0; height:0; position:absolute; right:10px; top:50%; margin-top:-3px;}' + '.dd-pointer-down{ border:solid 5px transparent; border-top:solid 5px #000; }' + '.dd-pointer-up{border:solid 5px transparent !important; border-bottom:solid 5px #000 !important; margin-top:-8px;}' + '.dd-options{width:192px; border-radius:10px; border:solid 1px #ccc; border-top:none; list-style:none; box-shadow:0px 1px 5px #ddd; display:none; position:absolute; z-index:2000; margin:0; padding:0;background:#fff; overflow:auto;}' + '.dd-option{ padding:10px; display:block; border-bottom:solid 1px #ddd; overflow:hidden; text-decoration:none; color:#333; cursor:pointer;-webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out;-o-transition: all 0.25s ease-in-out;-ms-transition: all 0.25s ease-in-out; }' + '.dd-options > li:last-child > .dd-option{ border-bottom:none;}' + '.dd-option:hover{ background:#f3f3f3; color:#000;}' + '.dd-selected-description-truncated { text-overflow: ellipsis; white-space:nowrap; }' + '.dd-option-selected { background:#f6f6f6; }' + '.dd-option-image, .dd-selected-image { vertical-align:middle; float:left; margin-right:5px; max-width:64px;}' + '.dd-image-right { float:right; margin-right:15px; margin-left:5px;}' + '.dd-container{ position:relative;}​ .dd-selected-text { font-weight:bold}​</style>'; //CSS styles are only added once. if ($('#css-ddslick').length <= 0) { $(ddslickCSS).appendTo('head'); } //Public methods methods.init = function (options) { //Preserve the original defaults by passing an empty object as the target var options = $.extend({}, defaults, options); //Apply on all selected elements return this.each(function () { var obj = $(this), data = obj.data('ddslick'); //If the plugin has not been initialized yet if (!data) { var ddSelect = [], ddJson = options.data; //Get data from HTML select options obj.find('option').each(function () { var $this = $(this), thisData = $this.data(); ddSelect.push({ text: $.trim($this.text()), value: $this.val(), selected: $this.is(':selected'), description: thisData.description, imageSrc: thisData.imagesrc //keep it lowercase for HTML5 data-attributes }); }); //Update Plugin data merging both HTML select data and JSON data for the dropdown if (options.keepJSONItemsOnTop) $.merge(options.data, ddSelect); else options.data = $.merge(ddSelect, options.data); //Replace HTML select with empty placeholder, keep the original var original = obj, placeholder = $('<div id="' + obj.attr('id') + '"></div>'); obj.replaceWith(placeholder); obj = placeholder; //Add classes and append ddSelectHtml & ddOptionsHtml to the container obj.addClass('dd-container').append(ddSelectHtml).append(ddOptionsHtml); //Get newly created ddOptions and ddSelect to manipulate var ddSelect = obj.find('.dd-select'), ddOptions = obj.find('.dd-options'); //Set widths //ddOptions.css({ width: options.width }); //ddSelect.css({ width: options.width, background: options.background }); //obj.css({ width: options.width }); //Set height if (options.height != null) ddOptions.css({ height: options.height, overflow: 'auto' }); //Add ddOptions to the container. Replace with template engine later. $.each(options.data, function (index, item) { if (item.selected) options.defaultSelectedIndex = index; ddOptions.append('<li>' + '<a class="dd-option">' + (item.value ? ' <input class="dd-option-value" type="hidden" value="' + item.value + '" />' : '') + (item.imageSrc ? ' <img class="dd-option-image' + (options.imagePosition == "right" ? ' dd-image-right' : '') + '" src="' + item.imageSrc + '" />' : '') + (item.text ? ' <label class="dd-option-text">' + item.text + '</label>' : '') + (item.description ? ' <small class="dd-option-description dd-desc">' + item.description + '</small>' : '') + '</a>' + '</li>'); }); //Save plugin data. var pluginData = { settings: options, original: original, selectedIndex: -1, selectedItem: null, selectedData: null } obj.data('ddslick', pluginData); //Check if needs to show the select text, otherwise show selected or default selection if (options.selectText.length > 0 && options.defaultSelectedIndex == null) { obj.find('.dd-selected').html(options.selectText); } else { var index = (options.defaultSelectedIndex != null && options.defaultSelectedIndex >= 0 && options.defaultSelectedIndex < options.data.length) ? options.defaultSelectedIndex : 0; selectIndex(obj, index); } //EVENTS //Displaying options obj.find('.dd-select').on('click.ddslick', function () { open(obj); }); //Selecting an option obj.find('.dd-option').on('click.ddslick', function () { selectIndex(obj, $(this).closest('li').index()); }); //Click anywhere to close if (options.clickOffToClose) { ddOptions.addClass('dd-click-off-close'); obj.on('click.ddslick', function (e) { e.stopPropagation(); }); $('body').on('click', function () { $('.dd-click-off-close').slideUp(50).siblings('.dd-select').find('.dd-pointer').removeClass('dd-pointer-up'); }); } } }); }; //Public method to select an option by its index methods.select = function (options) { return this.each(function () { if (options.index) selectIndex($(this), options.index); }); } //Public method to open drop down methods.open = function () { return this.each(function () { var $this = $(this), pluginData = $this.data('ddslick'); //Check if plugin is initialized if (pluginData) open($this); }); }; //Public method to close drop down methods.close = function () { return this.each(function () { var $this = $(this), pluginData = $this.data('ddslick'); //Check if plugin is initialized if (pluginData) close($this); }); }; //Public method to destroy. Unbind all events and restore the original Html select/options methods.destroy = function () { return this.each(function () { var $this = $(this), pluginData = $this.data('ddslick'); //Check if already destroyed if (pluginData) { var originalElement = pluginData.original; $this.removeData('ddslick').unbind('.ddslick').replaceWith(originalElement); } }); } //Private: Select index function selectIndex(obj, index) { //Get plugin data var pluginData = obj.data('ddslick'); //Get required elements var ddSelected = obj.find('.dd-selected'), ddSelectedValue = ddSelected.siblings('.dd-selected-value'), ddOptions = obj.find('.dd-options'), ddPointer = ddSelected.siblings('.dd-pointer'), selectedOption = obj.find('.dd-option').eq(index), selectedLiItem = selectedOption.closest('li'), settings = pluginData.settings, selectedData = pluginData.settings.data[index]; //Highlight selected option obj.find('.dd-option').removeClass('dd-option-selected'); selectedOption.addClass('dd-option-selected'); //Update or Set plugin data with new selection pluginData.selectedIndex = index; pluginData.selectedItem = selectedLiItem; pluginData.selectedData = selectedData; //If set to display to full html, add html if (settings.showSelectedHTML) { ddSelected.html( (selectedData.imageSrc ? '<img class="dd-selected-image' + (settings.imagePosition == "right" ? ' dd-image-right' : '') + '" src="' + selectedData.imageSrc + '" />' : '') + (selectedData.text ? '<label class="dd-selected-text">' + selectedData.text + '</label>' : '') + (selectedData.description ? '<small class="dd-selected-description dd-desc' + (settings.truncateDescription ? ' dd-selected-description-truncated' : '') + '" >' + selectedData.description + '</small>' : '') ); } //Else only display text as selection else ddSelected.html(selectedData.text); //Updating selected option value ddSelectedValue.val(selectedData.value); //BONUS! Update the original element attribute with the new selection pluginData.original.val(selectedData.value); obj.data('ddslick', pluginData); //Close options on selection close(obj); //Adjust appearence for selected option adjustSelectedHeight(obj); //Callback function on selection if (typeof settings.onSelected == 'function') { settings.onSelected.call(this, pluginData); } } //Private: Close the drop down options function open(obj) { var $this = obj.find('.dd-select'), ddOptions = $this.siblings('.dd-options'), ddPointer = $this.find('.dd-pointer'), wasOpen = ddOptions.is(':visible'); //Close all open options (multiple plugins) on the page $('.dd-click-off-close').not(ddOptions).slideUp(50); $('.dd-pointer').removeClass('dd-pointer-up'); if (wasOpen) { ddOptions.slideUp('fast'); ddPointer.removeClass('dd-pointer-up'); } else { ddOptions.slideDown('fast'); ddPointer.addClass('dd-pointer-up'); } //Fix text height (i.e. display title in center), if there is no description adjustOptionsHeight(obj); } //Private: Close the drop down options function close(obj) { //Close drop down and adjust pointer direction obj.find('.dd-options').slideUp(50); obj.find('.dd-pointer').removeClass('dd-pointer-up').removeClass('dd-pointer-up'); } //Private: Adjust appearence for selected option (move title to middle), when no desripction function adjustSelectedHeight(obj) { //Get height of dd-selected var lSHeight = obj.find('.dd-select').css('height'); //Check if there is selected description var descriptionSelected = obj.find('.dd-selected-description'); var imgSelected = obj.find('.dd-selected-image'); if (descriptionSelected.length <= 0 && imgSelected.length > 0) { obj.find('.dd-selected-text').css('lineHeight', lSHeight); } } //Private: Adjust appearence for drop down options (move title to middle), when no desripction function adjustOptionsHeight(obj) { obj.find('.dd-option').each(function () { var $this = $(this); var lOHeight = $this.css('height'); var descriptionOption = $this.find('.dd-option-description'); var imgOption = obj.find('.dd-option-image'); if (descriptionOption.length <= 0 && imgOption.length > 0) { $this.find('.dd-option-text').css('lineHeight', lOHeight); } }); } })(jQuery);
{ "content_hash": "737efda2a37244db5a54ff6dd1419fdd", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 316, "avg_line_length": 44.606606606606604, "alnum_prop": 0.5360845563484583, "repo_name": "Leonmey/Colour-Contrast-Tool", "id": "ccf7eed04590581dbc62660953e131f686fe1058", "size": "14860", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jquery.ddslick.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8831" }, { "name": "HTML", "bytes": "4661" }, { "name": "JavaScript", "bytes": "98591" } ], "symlink_target": "" }
import React, { PropTypes } from 'react'; import CSSModules from 'react-css-modules'; import CheckboxGroup from '../CheckboxGroup'; /** * The RadioGroup component is a wrapper around the CheckboxGroup component, all the props that apply to the CheckboxGroup, apply to this one. */ function RadioGroup(props: Object) { return <CheckboxGroup {...props} required allowMultiple={false}>{props.children}</CheckboxGroup>; } export default RadioGroup;
{ "content_hash": "3b1ee7dfefd751060e3e8d5b1eb5481a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 142, "avg_line_length": 34.76923076923077, "alnum_prop": 0.7588495575221239, "repo_name": "emsiengineering/emsi-ui", "id": "cf3d08055e027dff89fa0fbc2e21647359483a71", "size": "452", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/RadioGroup/radio-group.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "45190" }, { "name": "HTML", "bytes": "489" }, { "name": "JavaScript", "bytes": "113272" } ], "symlink_target": "" }
namespace shell { class PlatformView; class Rasterizer { public: virtual ~Rasterizer(); virtual void Setup(PlatformView* platform_view, ftl::Closure rasterizer_continuation, ftl::AutoResetWaitableEvent* setup_completion_event) = 0; virtual void Clear(SkColor color) = 0; virtual void Teardown( ftl::AutoResetWaitableEvent* teardown_completion_event) = 0; virtual ftl::WeakPtr<Rasterizer> GetWeakRasterizerPtr() = 0; virtual flow::LayerTree* GetLastLayerTree() = 0; virtual void Draw( ftl::RefPtr<flutter::Pipeline<flow::LayerTree>> pipeline) = 0; // Implemented by each GPU backend. static std::unique_ptr<Rasterizer> Create(); }; } // namespace shell #endif // SHELL_COMMON_RASTERIZER_H_
{ "content_hash": "45c1d2fd8c773bf3a5b1c1248ebea9d7", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 78, "avg_line_length": 25, "alnum_prop": 0.6864516129032258, "repo_name": "mpcomplete/flutter_engine", "id": "4c5619ccb20d6919f061453dc0c00b6ff0d5cbe2", "size": "1297", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "shell/common/rasterizer.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "34442" }, { "name": "C++", "bytes": "5438177" }, { "name": "Dart", "bytes": "243224" }, { "name": "Groff", "bytes": "26536" }, { "name": "Java", "bytes": "130430" }, { "name": "Objective-C", "bytes": "20143" }, { "name": "Objective-C++", "bytes": "106698" }, { "name": "Python", "bytes": "20148" }, { "name": "Shell", "bytes": "2577" } ], "symlink_target": "" }
<?php //GENERATEUR DE PAGE 'DECONNEXION' global $_wome; global $_options; global $_user; global $datetime; //deconnexion par default si page précédente bookino if($_wome['depuis_site']){ //supprime et met a jour DELETE('connexions', ['idUtilisateur'=>$_user['id']]); setcookie($_options['cookie_account'], '', time()+0, '/'); UPDATE('utilisateurs', ['id'=>$_user['id']], ['enligne'=>'0', 'date_activite'=>$datetime]); session_destroy(); $_user = ['connecte'=>false]; list($_user['groupes'], $_user['groupe']) = lister_groupes($_user); //redirige rediriger(url('CONNEXION')); }else{ rediriger(url('ADMIN')); }; ?>
{ "content_hash": "92ff49914de5f60fdcb2845715d51013", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 93, "avg_line_length": 26.115384615384617, "alnum_prop": 0.5905743740795287, "repo_name": "ncoden/Bookino", "id": "90b2ccaa812ff9efe5eb9834f3d96dce0b51af93", "size": "681", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bookino.org/pages/deconnexion.php", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "120" }, { "name": "CSS", "bytes": "82934" }, { "name": "JavaScript", "bytes": "125583" }, { "name": "PHP", "bytes": "198705" } ], "symlink_target": "" }
module Crawler module Refresher class RedirectCache # 4 redirect/hr 24hrs a day for 6 days PERSIST_AFTER = 4 * 24 * 6 attr_reader :redirects def initialize(feed_id) @feed_id = feed_id end def save(redirects) @redirects = redirects Cache.write(stable_key, {to: @redirects.last.to}) if redirect_stable? end def redirect_stable? return false if @redirects.empty? return false unless @redirects.all?(&:permanent?) Cache.increment(counter_key, options: {expires_in: 72 * 60 * 60}) > PERSIST_AFTER end def read @read ||= Cache.read(stable_key)[:to] end def delete Cache.delete(stable_key) end def counter_key @counter_key ||= begin "refresher_redirect_tmp_" + Digest::SHA1.hexdigest(@redirects.map(&:cache_key).join) end end def stable_key @stable_key ||= begin "refresher_redirect_stable_#{@feed_id}" end end end class Redirect PERMANENT_REDIRECTS = [301, 308].to_set.freeze attr_reader :from, :to def initialize(feed_id, status:, from:, to:) @feed_id = feed_id @status = status @from = from @to = to end def permanent? PERMANENT_REDIRECTS.include?(@status) end def cache_key @cache_key ||= Digest::SHA1.hexdigest([@feed_id, @status, @from, @to].join) end end end end
{ "content_hash": "0cf4af69599dcd96a77bb3e9977b5e63", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 94, "avg_line_length": 22.55223880597015, "alnum_prop": 0.5651886168100596, "repo_name": "feedbin/refresher", "id": "11672ebfb6ecde7e8237f269ce462180542ab8c4", "size": "1542", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/crawler/refresher/redirect_cache.rb", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "290" }, { "name": "Procfile", "bytes": "952" }, { "name": "Ruby", "bytes": "77177" }, { "name": "Shell", "bytes": "28" } ], "symlink_target": "" }
'use strict'; var express = require('express'); var controller = require('./dealer.controller'); var router = express.Router(); router.get('/', controller.index); router.get('/:id', controller.show); router.post('/', controller.create); router.put('/:id', controller.upsert); router.patch('/:id', controller.patch); router.delete('/:id', controller.destroy); module.exports = router;
{ "content_hash": "3aef1a4fba53564e57ba9725a74c0e1d", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 48, "avg_line_length": 25.866666666666667, "alnum_prop": 0.6984536082474226, "repo_name": "malikariful/crm_planning_designing", "id": "318494ff2917d8820ee3a3ccbb5ee6319d9deb9d", "size": "388", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/api/dealer/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "24139" }, { "name": "CSS", "bytes": "23684" }, { "name": "HTML", "bytes": "166647" }, { "name": "JavaScript", "bytes": "403114" } ], "symlink_target": "" }
#include "sky/engine/config.h" #include "sky/engine/wtf/ArrayBufferView.h" #include "sky/engine/wtf/ArrayBuffer.h" namespace WTF { ArrayBufferView::ArrayBufferView(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset) : m_byteOffset(byteOffset) , m_isNeuterable(true) , m_buffer(buffer) , m_prevView(0) , m_nextView(0) { m_baseAddress = m_buffer ? (static_cast<char*>(m_buffer->data()) + m_byteOffset) : 0; if (m_buffer) m_buffer->addView(this); } ArrayBufferView::~ArrayBufferView() { if (m_buffer) m_buffer->removeView(this); } void ArrayBufferView::neuter() { m_buffer = nullptr; m_byteOffset = 0; } const char* ArrayBufferView::typeName() { switch (type()) { case TypeInt8: return "Int8"; break; case TypeUint8: return "UInt8"; break; case TypeUint8Clamped: return "UInt8Clamped"; break; case TypeInt16: return "Int16"; break; case TypeUint16: return "UInt16"; break; case TypeInt32: return "Int32"; break; case TypeUint32: return "Uint32"; break; case TypeFloat32: return "Float32"; break; case TypeFloat64: return "Float64"; break; case TypeDataView: return "DataView"; break; } ASSERT_NOT_REACHED(); return "Unknown"; } }
{ "content_hash": "4353b94d29cd512a2ee700b317ba0457", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 89, "avg_line_length": 19.89041095890411, "alnum_prop": 0.5730027548209367, "repo_name": "collinjackson/mojo", "id": "0c39220e6aba27e2b3853e2c552bc2ee0de03f93", "size": "2802", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sky/engine/wtf/ArrayBufferView.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Bison", "bytes": "31162" }, { "name": "C", "bytes": "1870198" }, { "name": "C++", "bytes": "36473977" }, { "name": "CSS", "bytes": "1897" }, { "name": "Dart", "bytes": "508640" }, { "name": "Go", "bytes": "181090" }, { "name": "Groff", "bytes": "29030" }, { "name": "HTML", "bytes": "6258864" }, { "name": "Java", "bytes": "1187123" }, { "name": "JavaScript", "bytes": "204155" }, { "name": "Makefile", "bytes": "402" }, { "name": "Objective-C", "bytes": "74603" }, { "name": "Objective-C++", "bytes": "370763" }, { "name": "Protocol Buffer", "bytes": "1048" }, { "name": "Python", "bytes": "5515876" }, { "name": "Shell", "bytes": "143302" }, { "name": "nesC", "bytes": "18347" } ], "symlink_target": "" }
package com.ragebox.bombframework.bwt; import java.awt.geom.Rectangle2D; import java.util.LinkedList; import com.ragebox.bombframework.bwt.event.BTAnimationListener; import com.ragebox.bombframework.bwt.event.BTHitboxListener; import com.ragebox.bombframework.bwt.event.BTKeyboardEvent; import com.ragebox.bombframework.bwt.event.BTKeyboardListener; import com.ragebox.bombframework.bwt.strategy.render.*; import com.ragebox.bombframework.bwt.strategy.update.*; public abstract class BTAbstractComponent extends BTAbstractGraphicObject { protected boolean focused; protected boolean visible; protected boolean accelerating; protected boolean blinking; protected boolean fading; protected boolean rotating; protected boolean scaling; protected boolean translating; protected float x; protected float y; protected float width; protected float height; // Début des chaînes de stratégies protected BTFirstUpdateStrategy firstUpdateStrategy; protected BTFirstRenderStrategy firstRenderStrategy; // Stratégies de mises à jour protected BTBlinkStrategy blinkStrategy; protected BTFadeStrategy fadeStrategy; protected BTNoUpdateStrategy noUpdateStrategy; protected BTRotationStrategy rotationStrategy; protected BTScalingStrategy scalingStrategy; protected BTTranslationStrategy translationStrategy; protected BTUpdateStrategy updateStrategy; // Stratégies de rendu protected BTNoRenderStrategy noRenderStrategy; protected BTRenderStrategy renderStrategy; // Stratégie des hitbox protected BTCheckHitboxStrategy checkHitboxStrategy; // Liste de stratégies de rendu INUTILE protected LinkedList<BTAnimationListener> listAnimationListeners; protected LinkedList<BTHitboxListenerContainer> listHitboxListenerContainers; protected LinkedList<BTKeyboardListener> listKeyboardListeners; // Focus multiples protected LinkedList<Integer> listFocusId; protected Rectangle2D hitbox; protected BTAbstractComponent(float x, float y, float width, float height) { this.x = x; this.y = y; this.width = width; this.height = height; focused = false; visible = true; hitbox = new Rectangle2D.Float(x, y, width, height); firstUpdateStrategy = new BTFirstUpdateStrategy(this); firstRenderStrategy = new BTFirstRenderStrategy(this); blinkStrategy = new BTBlinkStrategy(this); fadeStrategy = new BTFadeStrategy(this); noUpdateStrategy = new BTNoUpdateStrategy(this); rotationStrategy = new BTRotationStrategy(this); scalingStrategy = new BTScalingStrategy(this); translationStrategy = new BTTranslationStrategy(this); updateStrategy = new BTUpdateStrategy(this); noRenderStrategy = new BTNoRenderStrategy(this); renderStrategy = new BTRenderStrategy(this); listAnimationListeners = new LinkedList<BTAnimationListener>(); listHitboxListenerContainers = new LinkedList<BTHitboxListenerContainer>(); listKeyboardListeners = new LinkedList<BTKeyboardListener>(); listFocusId = new LinkedList<Integer>(); checkHitboxStrategy = new BTCheckHitboxStrategy(this, listHitboxListenerContainers); firstUpdateStrategy.addUpdateStrategy(updateStrategy); firstRenderStrategy.addRenderStrategy(renderStrategy); } public void addKeyboardListener(BTKeyboardListener listener) { listKeyboardListeners.add(listener); } public void removeKeyboardListener(BTKeyboardListener listener) { listKeyboardListeners.remove(listener); } public void processKeyboardEvent(BTKeyboardEvent event) { int id = event.getID(); switch (id) { case BTKeyboardEvent.KEY_PRESSED: for (BTKeyboardListener listener : listKeyboardListeners) { listener.keyPressed(event); } break; case BTKeyboardEvent.KEY_RELEASED: for (BTKeyboardListener listener : listKeyboardListeners) { listener.keyReleased(event); } break; } } // TODO Implémenter une liste de focus plutôt qu'un booléen public void setFocus(int focusId, boolean focused) { if (focused) { listFocusId.add(focusId); BTAnimatedImage image = BTKeyboardFocusManager.getFocusImage(focusId); if (image != null) { image.setX(x - 50); image.setY(y); } BTKeyboardFocusManager.addFocusedComponent(focusId, this); } else { listFocusId.remove((Integer) focusId); BTKeyboardFocusManager.removeFocusedComponent(focusId, this); } this.focused = !listFocusId.isEmpty(); } public void removeAllFocus() { for (Integer focusId : listFocusId) { BTKeyboardFocusManager.removeFocusedComponent(focusId, this); } listFocusId.clear(); this.focused = false; } public void giveFocus(int focusId, BTAbstractComponent component) { setFocus(focusId, false); component.setFocus(focusId, true); } public float getX() { return x; } public void setX(float x) { this.x = x; hitbox.setRect(this.x, y, width, height); } public float getY() { return y; } public void setY(float y) { this.y = y; hitbox.setRect(x, this.y, width, height); } public void translateX(float x) { this.x += x; hitbox.setRect(this.x, y, width + x, height); } public void translateY(float y) { this.y += y; hitbox.setRect(x, this.y, width, height + y); } public void translate(float x, float y) { translateX(x); translateY(y); } public boolean isVisible() { return visible; } public void setVisible(boolean visible) { this.visible = visible; if (visible) { firstRenderStrategy.changeLastStrategy(renderStrategy); } else { firstRenderStrategy.changeLastStrategy(noRenderStrategy); } } public Rectangle2D getHitbox() { return hitbox; } public void addAnimationListener(BTAnimationListener listener) { listAnimationListeners.addFirst(listener); } public void removeAnimationListener(BTAnimationListener listener) { listAnimationListeners.remove(listener); } public void addHitboxListener(Rectangle2D hitbox, BTHitboxListener listener) { if (listHitboxListenerContainers.size() == 0) { firstRenderStrategy.addRenderStrategy(checkHitboxStrategy); } listHitboxListenerContainers.addFirst(new BTHitboxListenerContainer( hitbox, listener)); } public void removeHitboxListener(Rectangle2D hitbox, BTHitboxListener listener) { boolean found = false; int listenerId = 0; while (!found && listenerId < listHitboxListenerContainers.size()) { BTHitboxListenerContainer container = listHitboxListenerContainers .get(listenerId); if (hitbox.equals(container.hitbox) && listener.equals(container.listener)) { found = true; } else { ++listenerId; } } if (found) { listHitboxListenerContainers.remove(listenerId); if (listHitboxListenerContainers.size() == 0) { endCheckHitbox(); } } } @Override public void update(int deltaTime) { firstUpdateStrategy.executeUpdate(deltaTime); } @Override public void render() { firstRenderStrategy.executeRender(); } /*---------------------------------------------------------------------------*\ | *| | Animations *| | *| \*---------------------------------------------------------------------------*/ // Clignements public void blinkOverTime(int delay, int time) { verifyBlinkPresence(); blinkStrategy.setBlink(delay, time); } public void blinkOverTime(int delay, int time, int id) { verifyBlinkPresence(); blinkStrategy.setBlink(delay, time, id); } public void incBlinkOverTime(int delay, int time) { verifyBlinkPresence(); blinkStrategy.addBlink(delay, time); } public void incBlinkOverTime(int delay, int time, int id) { verifyBlinkPresence(); blinkStrategy.addBlink(delay, time, id); } private void verifyBlinkPresence() { if (!blinking) { firstUpdateStrategy.addUpdateStrategy(blinkStrategy); blinking = true; } } // Estompages public void fadeOverTime(float coeffOpacity, int time) { verifyFadePresence(); fadeStrategy.setFade(coeffOpacity, time); } public void fadeOverTime(float coeffOpacity, int time, int id) { verifyFadePresence(); fadeStrategy.setFade(coeffOpacity, time, id); } public void incFadeOverTime(float coeffOpacity, int time) { verifyFadePresence(); fadeStrategy.addFade(coeffOpacity, time); } public void incFadeOverTime(float coeffOpacity, int time, int id) { verifyFadePresence(); fadeStrategy.addFade(coeffOpacity, time, id); } private void verifyFadePresence() { if (!fading) { firstUpdateStrategy.addUpdateStrategy(fadeStrategy); fading = true; } } // Rotations public void rotateOverTime(int degree, int time) { verifyRotatePresence(); rotationStrategy.setRotate(degree, time); } public void rotateOverTime(int degree, int time, int id) { verifyRotatePresence(); rotationStrategy.setRotate(degree, time, id); } public void incRotateOverTime(int degree, int time) { verifyRotatePresence(); rotationStrategy.addRotate(degree, time); } public void incRotateOverTime(int degree, int time, int id) { verifyRotatePresence(); rotationStrategy.addRotate(degree, time, id); } private void verifyRotatePresence() { if (!rotating) { firstUpdateStrategy.addUpdateStrategy(rotationStrategy); rotating = true; } } // Agrandissements public void scaleOverTime(float scaleX, float scaleY, int time) { verifyScalePresence(); scalingStrategy.setScale(scaleX, scaleY, time); } public void scaleOverTime(float scaleX, float scaleY, int time, int id) { verifyScalePresence(); scalingStrategy.setScale(scaleX, scaleY, time, id); } public void incScaleOverTime(float scaleX, float scaleY, int time) { verifyScalePresence(); scalingStrategy.addScale(scaleX, scaleY, time); } public void incScaleOverTime(float scaleX, float scaleY, int time, int id) { verifyScalePresence(); scalingStrategy.addScale(scaleX, scaleY, time, id); } private void verifyScalePresence() { if (!scaling) { firstUpdateStrategy.addUpdateStrategy(scalingStrategy); scaling = true; } } // Translations public void translateOverTime(float translateX, float translateY, int time) { verifyTranslatePresence(); translationStrategy.setTranslate(translateX, translateY, time); } public void translateOverTime(float translateX, float translateY, int time, int id) { verifyTranslatePresence(); translationStrategy.setTranslate(translateX, translateY, time, id); } public void incTranslateOverTime(float translateX, float translateY, int time) { verifyTranslatePresence(); translationStrategy.addTranslate(translateX, translateY, time); } public void incTranslateOverTime(float translateX, float translateY, int time, int id) { verifyTranslatePresence(); translationStrategy.addTranslate(translateX, translateY, time, id); } private void verifyTranslatePresence() { if (!translating) { firstUpdateStrategy.addUpdateStrategy(translationStrategy); translating = true; } } // Méthodes pour les stratégies lorsqu'elles finissent public void endBlink() { firstUpdateStrategy.removeUpdateStrategy(blinkStrategy); blinking = false; } public void endFade() { firstUpdateStrategy.removeUpdateStrategy(fadeStrategy); fading = false; } public void endRotation() { firstUpdateStrategy.removeUpdateStrategy(rotationStrategy); rotating = false; } public void endScaling() { firstUpdateStrategy.removeUpdateStrategy(scalingStrategy); scaling = false; } public void endTranslation() { firstUpdateStrategy.removeUpdateStrategy(translationStrategy); translating = false; } public void endCheckHitbox() { firstRenderStrategy.removeRenderStrategy(checkHitboxStrategy); } // Méthodes overridables pour gérer les boucles d'animations public void notifyAccelerationFinished(int id) { for (BTAnimationListener listener : listAnimationListeners) { listener.accelerationFinished(id); } } public void notifyBlinkFinished(int id) { for (BTAnimationListener listener : listAnimationListeners) { listener.blinkFinished(id); } } public void notifyFadeFinished(int id) { for (BTAnimationListener listener : listAnimationListeners) { listener.fadeFinished(id); } } public void notifyRotationFinished(int id) { for (BTAnimationListener listener : listAnimationListeners) { listener.rotationFinished(id); } } public void notifyScalingFinished(int id) { for (BTAnimationListener listener : listAnimationListeners) { listener.scalingFinished(id); } } public void notifyTranslationFinished(int id) { for (BTAnimationListener listener : listAnimationListeners) { listener.translationFinished(id); } } // Hitbox events public void notifyHitboxIntersected(Rectangle2D otherHitbox) { for (BTHitboxListenerContainer container : listHitboxListenerContainers) { if (container.hitbox.equals(otherHitbox)) { container.listener.hitboxIntersected(); } } } /*---------------------------------------------------------------------------*\ | *| | Inner classes *| | *| \*---------------------------------------------------------------------------*/ public class BTHitboxListenerContainer { private Rectangle2D hitbox; private BTHitboxListener listener; BTHitboxListenerContainer(Rectangle2D hitbox, BTHitboxListener listener) { this.hitbox = hitbox; this.listener = listener; } public Rectangle2D getHitbox() { return hitbox; } public BTHitboxListener getListener() { return listener; } } }
{ "content_hash": "a2133c1f33084196773634c0926606c8", "timestamp": "", "source": "github", "line_count": 545, "max_line_length": 86, "avg_line_length": 25.6, "alnum_prop": 0.7069954128440367, "repo_name": "theragebox/bombjammers", "id": "fbac0b85501d87b9956465f3cef877032885a203", "size": "13952", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bombjammers/src/com/ragebox/bombframework/bwt/BTAbstractComponent.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "151008" } ], "symlink_target": "" }
package cn.vfire.framework.spring.mvc.model; import javax.validation.constraints.NotNull; import org.hibernate.validator.constraints.NotBlank; import lombok.Getter; import lombok.Setter; public class UserModel { @Setter private String username; @NotBlank(message="密码不能为空") @Getter @Setter private String password; @Getter @Setter private int numbcode; @NotNull(message = "用户名不能为空") public String getUsername() { return username; } @Override public String toString() { return String.format("username=%s,password=%s,numbcode=%d", this.username, this.password, this.numbcode); } }
{ "content_hash": "58e352134a5b7334b567ae4872b6a842", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 107, "avg_line_length": 18.941176470588236, "alnum_prop": 0.7080745341614907, "repo_name": "vfire-app/total.framework", "id": "257c7544349b31ec7f1a96350d903fe5f0af5914", "size": "670", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_total/framework.spring/src/main/java/cn/vfire/framework/spring/mvc/model/UserModel.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "133" }, { "name": "HTML", "bytes": "7828" }, { "name": "Java", "bytes": "309014" } ], "symlink_target": "" }
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" /> <link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/> <link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/> <!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]--> <style type="text/css" media="all"> @import url('../../../../../style.css'); @import url('../../../../../tree.css'); </style> <script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script> <script src="../../../../../package-nodes-tree.js" type="text/javascript"></script> <script src="../../../../../clover-tree.js" type="text/javascript"></script> <script src="../../../../../clover.js" type="text/javascript"></script> <script src="../../../../../clover-descriptions.js" type="text/javascript"></script> <script src="../../../../../cloud.js" type="text/javascript"></script> <title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title> </head> <body> <div id="page"> <header id="header" role="banner"> <nav class="aui-header aui-dropdown2-trigger-group" role="navigation"> <div class="aui-header-inner"> <div class="aui-header-primary"> <h1 id="logo" class="aui-header-logo aui-header-logo-clover"> <a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a> </h1> </div> <div class="aui-header-secondary"> <ul class="aui-nav"> <li id="system-help-menu"> <a class="aui-nav-link" title="Open online documentation" target="_blank" href="http://openclover.org/documentation"> <span class="aui-icon aui-icon-small aui-iconfont-help">&#160;Help</span> </a> </li> </ul> </div> </div> </nav> </header> <div class="aui-page-panel"> <div class="aui-page-panel-inner"> <div class="aui-page-panel-nav aui-page-panel-nav-clover"> <div class="aui-page-header-inner" style="margin-bottom: 20px;"> <div class="aui-page-header-image"> <a href="http://cardatechnologies.com" target="_top"> <div class="aui-avatar aui-avatar-large aui-avatar-project"> <div class="aui-avatar-inner"> <img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/> </div> </div> </a> </div> <div class="aui-page-header-main" > <h1> <a href="http://cardatechnologies.com" target="_top"> ABA Route Transit Number Validator 1.0.1-SNAPSHOT </a> </h1> </div> </div> <nav class="aui-navgroup aui-navgroup-vertical"> <div class="aui-navgroup-inner"> <ul class="aui-nav"> <li class=""> <a href="../../../../../dashboard.html">Project overview</a> </li> </ul> <div class="aui-nav-heading packages-nav-heading"> <strong>Packages</strong> </div> <div class="aui-nav project-packages"> <form method="get" action="#" class="aui package-filter-container"> <input type="text" autocomplete="off" class="package-filter text" placeholder="Type to filter packages..." name="package-filter" id="package-filter" title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/> </form> <p class="package-filter-no-results-message hidden"> <small>No results found.</small> </p> <div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator"> <div class="packages-tree-container"></div> <div class="clover-packages-lozenges"></div> </div> </div> </div> </nav> </div> <section class="aui-page-panel-content"> <div class="aui-page-panel-content-clover"> <div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs"> <li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li> <li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li> <li><a href="test-Test_AbaRouteValidator_11.html">Class Test_AbaRouteValidator_11</a></li> </ol></div> <h1 class="aui-h2-clover"> Test testAbaNumberCheck_22599_good </h1> <table class="aui"> <thead> <tr> <th>Test</th> <th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th> <th><label title="When the test execution was started">Start time</label></th> <th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th> <th><label title="A failure or error message if the test is not successful.">Message</label></th> </tr> </thead> <tbody> <tr> <td> <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_11.html?line=3640#src-3640" >testAbaNumberCheck_22599_good</a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:40:19 </td> <td> 0.0 </td> <td> <div></div> <div class="errorMessage"></div> </td> </tr> </tbody> </table> <div>&#160;</div> <table class="aui aui-table-sortable"> <thead> <tr> <th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th> <th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_22599_good</th> </tr> </thead> <tbody> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=20970#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a> </td> <td> <span class="sortValue">0.7352941</span>73.5% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td> </tr> </tbody> </table> </div> <!-- class="aui-page-panel-content-clover" --> <footer id="footer" role="contentinfo"> <section class="footer-body"> <ul> <li> Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1 on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT. </li> </ul> <ul> <li>OpenClover is free and open-source software. </li> </ul> </section> </footer> </section> <!-- class="aui-page-panel-content" --> </div> <!-- class="aui-page-panel-inner" --> </div> <!-- class="aui-page-panel" --> </div> <!-- id="page" --> </body> </html>
{ "content_hash": "e3d2f688c2dd45d8e31383787fe66409", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 297, "avg_line_length": 43.91866028708134, "alnum_prop": 0.5096415731561172, "repo_name": "dcarda/aba.route.validator", "id": "272f8aa21c1734c804be40447b73eea55b7a880e", "size": "9179", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_11_testAbaNumberCheck_22599_good_g6i.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "18715254" } ], "symlink_target": "" }
import { Component, Directive, ViewEncapsulation, HostBinding, Input, Output, AfterViewInit, OnChanges, SimpleChanges, ElementRef, ViewChild, EventEmitter, } from '@angular/core'; @Component({ selector: 'expandable-list', styleUrls: ['./expandable-list.css'], template: `<ng-content></ng-content>`, encapsulation: ViewEncapsulation.None, }) export class ExpandableListComponent { } /** * Directive whose purpose is to add the mat- CSS styling to this selector. */ @Directive({ selector: 'expandable-list', host: { '[class.expandable-list]': 'true' } }) export class ExpandableListStyler { } @Directive({ selector: 'expandable-list-divider', host: { '[class.expandable-list-divider]': 'true' } }) export class ExpandableListDividerStyler { } @Component({ selector: 'expandable-list-item', host: { '[class.expandable-list-item]': 'true', }, templateUrl: './expandable-list-item.html', encapsulation: ViewEncapsulation.None, }) export class ExpandableListItemComponent implements AfterViewInit, OnChanges { public marginTop: string; @Input('isExpanded') get isExpanded() { return this.expanded; } set isExpanded(value: boolean) { this.expanded = (value !== null && `${value}` !== 'false') ? true : false; } @Input('disabled') get disabled() { return this.isDisabled; } set disabled(value: boolean) { this.isDisabled = (value !== null && `${value}` !== 'false') ? true : null; } @Output() public onExpanded: EventEmitter<boolean>; private elHeight: number; @ViewChild('contentEl') private elementView: ElementRef; @HostBinding('attr.disabled') private isDisabled: boolean; @HostBinding('attr.is-expanded') private expanded: boolean = false; public ngAfterViewInit() { this.elHeight = this.elementView.nativeElement.offsetHeight; } constructor() { this.onExpanded = new EventEmitter<boolean>(); } public ngOnChanges(changes: SimpleChanges) { if ('isExpanded' in changes) { this.updateMarginTop(); } } public onClick() { if (this.disabled) { return; } this.isExpanded = !this.isExpanded; this.updateMarginTop(); } private updateMarginTop() { if (!this.isExpanded) { this.marginTop = `-${this.elHeight}px`; } else { this.marginTop = '0'; } this.onExpanded.emit(this.isExpanded); } }
{ "content_hash": "21cb71e837b30e302e838593ddaefa84", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 20.878260869565217, "alnum_prop": 0.663890045814244, "repo_name": "andreasonny83/angular2-expandable-list", "id": "67ee26bffe2ddecac873526a22202ed7f38ffe41", "size": "2551", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/expandable-list.component.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4303" }, { "name": "HTML", "bytes": "1148" }, { "name": "JavaScript", "bytes": "11557" }, { "name": "TypeScript", "bytes": "9452" } ], "symlink_target": "" }
require 'bundler' if ENV['CI'] Bundler.require(:default, :test) else Bundler.require(:default, :test, :debug) end
{ "content_hash": "323e18649e086e3e746948f213d3ee14", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 42, "avg_line_length": 17, "alnum_prop": 0.6974789915966386, "repo_name": "outoftime/cequel", "id": "2e788c2535ef4ce1939777b7758b92b293cd096a", "size": "119", "binary": false, "copies": "2", "ref": "refs/heads/1.0", "path": "spec/environment.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "319905" } ], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Lecidea thallicola A. Massal. ### Remarks null
{ "content_hash": "cc8fda9926bd1538cc54d6e2e334d1c1", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 29, "avg_line_length": 10.307692307692308, "alnum_prop": 0.7014925373134329, "repo_name": "mdoering/backbone", "id": "ee9f0844f533d05c1273be87fcdac1da6b3c6ddb", "size": "194", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Ramalinaceae/Scutula/Scutula thallicola/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
Ansible Role para instalar o [DBeaver](https://github.com/dbeaver/dbeaver), com pacote apt oficial baixado do projeto. ## Variáveis * `dbeaver_version`: Versão do DBeaver a ser instalada. ## Tags - `dbeaver`: aplica todo o role. ## Compatibilidade - Debian Buster - Debian Bullseye
{ "content_hash": "7449fdc9d76ef71b0c9000ae7a538e11", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 90, "avg_line_length": 19.2, "alnum_prop": 0.7361111111111112, "repo_name": "zanardo/ansible-roles", "id": "50571f274abf59e362e5be257d56a8127e6e40a6", "size": "301", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dbeaver/README.md", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Jinja", "bytes": "4624" }, { "name": "Makefile", "bytes": "76" }, { "name": "Python", "bytes": "2142" }, { "name": "Shell", "bytes": "46" } ], "symlink_target": "" }
package com.futurefactory.model.value.company; import lombok.Data; import javax.persistence.Column; import javax.persistence.Embeddable; import java.io.Serializable; /** * 기업 재무 정보 PK * Created by kolian on 2017. 4. 17.. */ @Data @Embeddable public class FinancePk implements Serializable { @Column(name = "company_id", nullable = false) private int companyId; @Column(name = "quarterOfYear", nullable = false) private String quarterOfYear; }
{ "content_hash": "9525aba4e5cc4a39ae8ba7294251a88b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 53, "avg_line_length": 23.25, "alnum_prop": 0.7333333333333333, "repo_name": "Future-Factory/future-web", "id": "2e5a24b630c9c58c8b208474fe4cad00c272b032", "size": "477", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/futurefactory/model/value/company/FinancePk.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "14250" }, { "name": "JavaScript", "bytes": "2906" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="pl"> <head> <!-- Generated by javadoc --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class com.google.code.play.ConfigurationParser (Maven Plugin for Play! Framework 1.0.0-beta8 API)</title> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.google.code.play.ConfigurationParser (Maven Plugin for Play! Framework 1.0.0-beta8 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../com/google/code/play/package-summary.html">Package</a></li> <li><a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/google/code/play/class-use/ConfigurationParser.html" target="_top">Frames</a></li> <li><a href="ConfigurationParser.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class com.google.code.play.ConfigurationParser" class="title">Uses of Class<br>com.google.code.play.ConfigurationParser</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="com.google.code.play"> <!-- --> </a> <h3>Uses of <a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a> in <a href="../../../../../com/google/code/play/package-summary.html">com.google.code.play</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../com/google/code/play/package-summary.html">com.google.code.play</a> that return <a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a></code></td> <td class="colLast"><span class="typeNameLabel">AbstractPlayWarMojo.</span><code><span class="memberNameLink"><a href="../../../../../com/google/code/play/AbstractPlayWarMojo.html#getConfiguration--">getConfiguration</a></span>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a></code></td> <td class="colLast"><span class="typeNameLabel">AbstractPlayDistMojo.</span><code><span class="memberNameLink"><a href="../../../../../com/google/code/play/AbstractPlayDistMojo.html#getConfiguration--">getConfiguration</a></span>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a></code></td> <td class="colLast"><span class="typeNameLabel">AbstractPlayMojo.</span><code><span class="memberNameLink"><a href="../../../../../com/google/code/play/AbstractPlayMojo.html#getConfiguration-java.lang.String-">getConfiguration</a></span>(<a href="http://download.oracle.com/javase/5/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;playId)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../com/google/code/play/package-summary.html">com.google.code.play</a> with parameters of type <a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>protected <a href="http://download.oracle.com/javase/5/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://download.oracle.com/javase/5/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">AbstractDependencyProcessingPlayMojo.</span><code><span class="memberNameLink"><a href="../../../../../com/google/code/play/AbstractDependencyProcessingPlayMojo.html#getProvidedModuleNames-com.google.code.play.ConfigurationParser-java.lang.String-boolean-">getProvidedModuleNames</a></span>(<a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a>&nbsp;configParser, <a href="http://download.oracle.com/javase/5/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;playId, boolean&nbsp;forceProdMode)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="http://download.oracle.com/javase/5/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><span class="typeNameLabel">AbstractPlayStartServerMojo.</span><code><span class="memberNameLink"><a href="../../../../../com/google/code/play/AbstractPlayStartServerMojo.html#getRootUrl-com.google.code.play.ConfigurationParser-">getRootUrl</a></span>(<a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a>&nbsp;configParser)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="http://play1-maven-plugin.github.io/external-apidocs/org/apache/ant/ant/1.9.4/org/apache/tools/ant/taskdefs/Java.html?is-external=true" title="class or interface in org.apache.tools.ant.taskdefs">Java</a></code></td> <td class="colLast"><span class="typeNameLabel">AbstractPlayStartServerMojo.</span><code><span class="memberNameLink"><a href="../../../../../com/google/code/play/AbstractPlayStartServerMojo.html#getStartServerTask-com.google.code.play.ConfigurationParser-java.lang.String-java.io.File-boolean-">getStartServerTask</a></span>(<a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a>&nbsp;configParser, <a href="http://download.oracle.com/javase/5/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;playId, <a href="http://download.oracle.com/javase/5/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;logFile, boolean&nbsp;spawn)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="http://play1-maven-plugin.github.io/external-apidocs/org/apache/ant/ant/1.9.4/org/apache/tools/ant/taskdefs/Java.html?is-external=true" title="class or interface in org.apache.tools.ant.taskdefs">Java</a></code></td> <td class="colLast"><span class="typeNameLabel">AbstractPlayServerMojo.</span><code><span class="memberNameLink"><a href="../../../../../com/google/code/play/AbstractPlayServerMojo.html#prepareAntJavaTask-com.google.code.play.ConfigurationParser-java.lang.String-boolean-">prepareAntJavaTask</a></span>(<a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a>&nbsp;configParser, <a href="http://download.oracle.com/javase/5/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;playId, boolean&nbsp;fork)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="http://play1-maven-plugin.github.io/external-apidocs/org/codehaus/plexus/plexus-archiver/3.0.3/org/codehaus/plexus/archiver/zip/ZipArchiver.html?is-external=true" title="class or interface in org.codehaus.plexus.archiver.zip">ZipArchiver</a></code></td> <td class="colLast"><span class="typeNameLabel">AbstractPlayDistMojo.</span><code><span class="memberNameLink"><a href="../../../../../com/google/code/play/AbstractPlayDistMojo.html#prepareArchiver-com.google.code.play.ConfigurationParser-">prepareArchiver</a></span>(<a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a>&nbsp;configParser)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="http://play1-maven-plugin.github.io/external-apidocs/org/codehaus/plexus/plexus-archiver/3.0.3/org/codehaus/plexus/archiver/war/WarArchiver.html?is-external=true" title="class or interface in org.codehaus.plexus.archiver.war">WarArchiver</a></code></td> <td class="colLast"><span class="typeNameLabel">AbstractPlayWarMojo.</span><code><span class="memberNameLink"><a href="../../../../../com/google/code/play/AbstractPlayWarMojo.html#prepareArchiver-com.google.code.play.ConfigurationParser-boolean-">prepareArchiver</a></span>(<a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">ConfigurationParser</a>&nbsp;configParser, boolean&nbsp;addWarDirectory)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../com/google/code/play/package-summary.html">Package</a></li> <li><a href="../../../../../com/google/code/play/ConfigurationParser.html" title="class in com.google.code.play">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/google/code/play/class-use/ConfigurationParser.html" target="_top">Frames</a></li> <li><a href="ConfigurationParser.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2010&#x2013;2016. All rights reserved.</small></p> </body> </html>
{ "content_hash": "a19a043b606de5fae17e9951eea22b7c", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 490, "avg_line_length": 66.55329949238579, "alnum_prop": 0.6844634276561665, "repo_name": "play1-maven-plugin/play1-maven-plugin.github.io", "id": "1f224c62d4ef9c013ca83f25d1f4bdf15907a413", "size": "13111", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "play1-maven-plugin/1.0.0-beta8/play-maven-plugin/apidocs/com/google/code/play/class-use/ConfigurationParser.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "245466" }, { "name": "HTML", "bytes": "161333450" }, { "name": "JavaScript", "bytes": "11578" } ], "symlink_target": "" }
package com.agiledropzone.batchtester.tools; /** * Classe simpliste de gestion d'un timer.<br> * Si le timer a été lancé, soit il est réinitialisé par un appel à reset(), * soit la méthode timeout() est invoqué.<br> * Dans un tel cas, le thread appelant est convié par l'appel à interrupt().<br> * L'appelant doit donc considérer l'opportunité de tester régulièrement * Thread.currentThread().isInterrupted().<br> * <br> * La durée du timer est exprimé ici en secondes. */ public class SimpleTimer extends Thread { /** Fréquence de contrôle du timeout */ protected int rate = 100; /** * Thread auquel nous allons transmettre le time-out. Volatile : pour * assurer la coordination des threads */ private volatile Thread parentThread; /** Durée du timeout */ private int length; /** Temps écoulé depuis le démarrage du timer */ private int elapsedTime; /** Opération soumise au timer */ private String operation; /** * @param parentThread * Thread soumis au timer * @param length * Durée du timer (en secondes !!!) * @param operation * Libellé identifiant l'opération en cours soumise au timer */ public SimpleTimer(Thread parentThread, int length, String operation) { this.parentThread = parentThread; this.length = length * 1000; this.operation = operation; this.elapsedTime = 0; this.setDaemon(true); this.setName(operation); } /** Réinitialisation du timer */ public synchronized void reset() { elapsedTime = -1; } /** * Lancement du timer <br> * Cette méthode est invoquée par timer.start(). */ @Override public void run() { // On boucle jusqu'à l'écoulement du timer ou son intérruption // volontaire for (;;) { // Mise en sommeil du timer try { Thread.sleep(rate); } catch (InterruptedException ioe) { continue; } // La lecture et mise à jour de elapsedTime est soumises à une // synchro synchronized (this) { if (elapsedTime == -1) break; elapsedTime += rate; if (elapsedTime > length) { timeout(); break; } } } } /** * Déclenchement de l'opération attendu sur le timeout.<br> * Ici, nous invitons poliment le thread appelant à s'interrompre à travers * un appel à interrupt(). */ public void timeout() { System.err.println("Time-out sur [" + operation + "]"); parentThread.interrupt(); } public String toString() { StringBuilder sb = new StringBuilder("SimpleTimer [operation="); sb.append(operation).append(","); sb.append("length=").append(length).append(","); sb.append("parentThread=").append(parentThread.getName()).append("]"); return sb.toString(); } }
{ "content_hash": "a0a42a950716079652c08a1ea488b9b2", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 80, "avg_line_length": 30.826923076923077, "alnum_prop": 0.5595757953836556, "repo_name": "AgileDropZone/batchtester", "id": "c18a6eabcfbb44e5fbb3e3408344f42250a89382", "size": "3245", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/agiledropzone/batchtester/tools/SimpleTimer.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "1013" }, { "name": "Java", "bytes": "42788" }, { "name": "Shell", "bytes": "780" } ], "symlink_target": "" }
<?php class RemindersController extends Controller { public function __construct() { $this->beforeFilter('guest'); } /** * Display the password reminder view. * * @return Response */ public function getRemind() { return View::make('password.remind'); } /** * Handle a POST request to remind a user of their password. * * @return Response */ public function postRemind() { switch ($response = Password::remind(Input::only('email'), function ($message) { $message->subject('Password Reminder'); })) { case Password::INVALID_USER: return Redirect::back()->with('error', Lang::get($response)); case Password::REMINDER_SENT: return Redirect::back()->with('status', Lang::get($response)); } } /** * Display the password reset view for the given token. * * @param string $token * @return Response */ public function getReset($token = null) { if (is_null($token)) App::abort(404); return View::make('password.reset')->with('token', $token); } /** * Handle a POST request to reset a user's password. * * @return Response */ public function postReset() { $credentials = Input::only('email', 'password', 'password_confirmation', 'token'); $response = Password::reset($credentials, function ($user, $password) { $user->password = Hash::make($password); $user->save(); }); switch ($response) { case Password::INVALID_PASSWORD: case Password::INVALID_TOKEN: case Password::INVALID_USER: return Redirect::back()->with('error', Lang::get($response))->withInput(); case Password::PASSWORD_RESET: return Redirect::route('user.signin')->with('success', Lang::get('login.reset_success')); } } }
{ "content_hash": "ff4c2672f0e880b268b3633eccd0bea3", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 105, "avg_line_length": 29.169014084507044, "alnum_prop": 0.5335586673104781, "repo_name": "TransComics/TransBubbles", "id": "4a41c076207436baa79033c775772de05ebfd227", "size": "2071", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "app/controllers/RemindersController.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "356" }, { "name": "CSS", "bytes": "15219" }, { "name": "JavaScript", "bytes": "744969" }, { "name": "PHP", "bytes": "1123895" } ], "symlink_target": "" }
package cc.siara.csv_ml; import java.io.StringReader; import java.io.StringWriter; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Document; import org.xml.sax.InputSource; /** * All miscellaneous static utility functions * * @author Arundale R. * @since 1.0 */ public class Util { /** * Creates a Document object from initial XML given. This is required as it * is not possible to instantiate a W3C Document interface using new. * * @param xml_str * @return */ public static Document parseXMLToDOM(String xml_str) { Document doc = null; try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); doc = factory.newDocumentBuilder() .parse(new InputSource(new StringReader(xml_str))); } catch (Exception e) { e.printStackTrace(); } return doc; } /** * Converts W3C Document object to XML String * * @param doc * Document object * @param isPretty * Whether to indent and add new lines * @return XML String */ public static String docToString(Document doc, boolean isPretty) { try { Transformer transformer = TransformerFactory.newInstance() .newTransformer(); if (isPretty) { transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty( "{http://xml.apache.org/xslt}indent-amount", "2"); } StreamResult result = new StreamResult(new StringWriter()); DOMSource source = new DOMSource(doc); transformer.transform(source, result); String xmlString = result.getWriter().toString(); return xmlString; } catch (Exception e) { e.printStackTrace(); } return null; } /** * Removes the last number from current sequence path and returns it. If the * path is 1.2.1, then this method returns 1.2. * * Before removing, it extracts the last number as cur_sibling and * increments it, so that it can be used to form the next path * * @param cur_sequence_path * Path from which to remove * @param csv_ml_schema * From directive - whether schema is present or not */ public static int removeFromSeqPath(StringBuffer cur_sequence_path, String csv_ml_schema, String csv_ml_node_name, int cur_sibling) { int idx = cur_sequence_path.lastIndexOf("."); if (idx == -1) { cur_sequence_path.setLength(0); // If no schema or no node name indicator is present // no siblings would be present // In other words, increment cur_sibling // only if schema is present or node_name indicator // is present. if (!csv_ml_schema.equals("no_schema") || csv_ml_node_name.equals("with_node_name")) cur_sibling++; } else { // Same logic as above, except in this case, // sibling is extracted from the given path. if (!csv_ml_schema.equals("no_schema") || csv_ml_node_name.equals("with_node_name")) cur_sibling = 1 + Integer.parseInt(cur_sequence_path.substring( idx + 1).trim()); cur_sequence_path.setLength(idx); } return cur_sibling; } /** * Removes the last node from current path and returns it. If the path is * a.b.c, then this method returns a.b. * * @param cur_path */ public static void removeFromPath(StringBuffer cur_path) { int idx = cur_path.lastIndexOf("."); if (idx == -1) cur_path.setLength(0); else cur_path.setLength(idx); } /** * Appends number to current sequence path. If the path is 1.2, then this * method returns 1.2.1 * * @param cur_sequence_path * The path to which number to be appended * @param cur_sibling * The number to be appended */ public static void addToSeqPath(StringBuffer cur_sequence_path, int cur_sibling) { if (cur_sequence_path.length() > 0) { cur_sequence_path.append("."); } cur_sequence_path.append(cur_sibling); } /** * Appends node_name to current path. If the path is abc.pqr and node name * is xyz then this method makes it abc.pqr.xyz * * @param cur_path * The path to which to append * @param node_name * The node_name to append */ public static void addToPath(StringBuffer cur_path, String node_name) { if (cur_path.length() > 0) { cur_path.append("."); } cur_path.append(node_name); } /** * Checks whether encoding is necessary and encodes by enclosing in double * quotes, in which case, any double quotes appearing in data need to be * escaped. * * @param value * @return */ public static String encodeToCSVText(String value) { if (value == null) return value; if (value.indexOf(',') != -1 || value.indexOf('\n') != -1 || value.indexOf("/*") != -1) { if (value.indexOf('"') != -1) value = value.replace("\"", "\"\""); value = ("\"" + value + "\""); } return value; } }
{ "content_hash": "e97e1d3e4b48697aaaaddc614b35232d", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 86, "avg_line_length": 33.41340782122905, "alnum_prop": 0.5699715766594216, "repo_name": "siara-cc/csv_ml", "id": "9cd011dfcac09227527db26d75f6713bdd004762", "size": "6616", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/cc/siara/csv_ml/Util.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "52240" }, { "name": "Java", "bytes": "127252" } ], "symlink_target": "" }
layout: page title: Boyer Media Trade Fair date: 2016-05-24 author: Anthony Hayes tags: weekly links, java status: published summary: Duis eget nisl molestie, imperdiet est. banner: images/banner/meeting-01.jpg booking: startDate: 12/28/2017 endDate: 01/02/2018 ctyhocn: AVLRRHX groupCode: BMTF published: true --- Integer venenatis elit elementum commodo pharetra. Duis arcu tellus, placerat eget est sed, facilisis lacinia est. Mauris semper scelerisque volutpat. Phasellus id diam lacus. Aenean non mollis justo. Proin condimentum blandit erat, commodo euismod mauris porttitor nec. Praesent aliquet finibus tellus sit amet vestibulum. Pellentesque eleifend finibus sapien non finibus. Suspendisse justo augue, bibendum suscipit convallis a, ornare vitae eros. Vestibulum ligula eros, scelerisque non sollicitudin vestibulum, cursus rutrum arcu. Pellentesque lorem eros, tincidunt vitae metus vitae, ultrices convallis orci. Suspendisse facilisis sollicitudin ipsum, in viverra enim volutpat ac. Integer ut felis eget lectus aliquet ullamcorper eget eu nisi. Sed at cursus diam, non consectetur est. * Proin varius ipsum non enim dapibus accumsan * Cras sit amet orci id dolor tincidunt placerat. Vestibulum a dapibus nulla. Vestibulum ut finibus velit. Vivamus a felis finibus, rhoncus orci sodales, gravida urna. Maecenas ultricies orci et auctor fermentum. Suspendisse blandit, dui vel elementum scelerisque, nibh sem sodales leo, ac convallis nulla justo in metus. Aliquam sed justo sed dui sagittis eleifend eget quis odio. Pellentesque eget dolor aliquam, interdum felis eu, luctus lectus. Morbi consectetur tempor efficitur. Suspendisse sodales velit sed bibendum mollis. Nulla maximus aliquet libero sed rutrum. Ut vel elementum ipsum. Vestibulum vitae eleifend tellus. Nullam condimentum ultricies diam auctor euismod. Sed rhoncus tellus elit, eu maximus nunc commodo et. Maecenas dignissim efficitur molestie. Aliquam sit amet mi urna.
{ "content_hash": "2de968ee7168ea2d8aa87bbd83a8d5b4", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 787, "avg_line_length": 93.28571428571429, "alnum_prop": 0.8162327718223583, "repo_name": "KlishGroup/prose-pogs", "id": "78e8a79d1d0e76147660af3b9be8d886f20c60a5", "size": "1963", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "pogs/A/AVLRRHX/BMTF/index.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package main import ( "context" "time" "github.com/uber/jaeger-lib/metrics" "go.uber.org/zap" "github.com/jaegertracing/jaeger/model" cascfg "github.com/jaegertracing/jaeger/pkg/cassandra/config" cSpanStore "github.com/jaegertracing/jaeger/plugin/storage/cassandra/spanstore" "github.com/jaegertracing/jaeger/storage/spanstore" ) var logger, _ = zap.NewDevelopment() // TODO: this is going morph into a load testing framework for cassandra 3.7 func main() { noScope := metrics.NullFactory cConfig := &cascfg.Configuration{ Servers: []string{"127.0.0.1"}, ConnectionsPerHost: 10, Timeout: time.Millisecond * 750, ProtoVersion: 4, Keyspace: "jaeger_v1_test", } cqlSession, err := cConfig.NewSession(logger) if err != nil { logger.Fatal("Cannot create Cassandra session", zap.Error(err)) } spanStore := cSpanStore.NewSpanWriter(cqlSession, time.Hour*12, noScope, logger) spanReader := cSpanStore.NewSpanReader(cqlSession, noScope, logger) ctx := context.Background() if err = spanStore.WriteSpan(ctx, getSomeSpan()); err != nil { logger.Fatal("Failed to save", zap.Error(err)) } else { logger.Info("Saved span", zap.String("spanID", getSomeSpan().SpanID.String())) } s := getSomeSpan() trace, err := spanReader.GetTrace(ctx, s.TraceID) if err != nil { logger.Fatal("Failed to read", zap.Error(err)) } else { logger.Info("Loaded trace", zap.Any("trace", trace)) } tqp := &spanstore.TraceQueryParameters{ ServiceName: "someServiceName", StartTimeMin: time.Now().Add(time.Hour * -1), StartTimeMax: time.Now().Add(time.Hour), } logger.Info("Check main query") queryAndPrint(ctx, spanReader, tqp) tqp.OperationName = "opName" logger.Info("Check query with operation") queryAndPrint(ctx, spanReader, tqp) tqp.Tags = map[string]string{ "someKey": "someVal", } logger.Info("Check query with operation name and tags") queryAndPrint(ctx, spanReader, tqp) tqp.DurationMin = 0 tqp.DurationMax = time.Hour tqp.Tags = map[string]string{} logger.Info("check query with duration") queryAndPrint(ctx, spanReader, tqp) } func queryAndPrint(ctx context.Context, spanReader *cSpanStore.SpanReader, tqp *spanstore.TraceQueryParameters) { traces, err := spanReader.FindTraces(ctx, tqp) if err != nil { logger.Fatal("Failed to query", zap.Error(err)) } else { logger.Info("Found trace(s)", zap.Any("traces", traces)) } } func getSomeProcess() *model.Process { processTagVal := "indexMe" return &model.Process{ ServiceName: "someServiceName", Tags: model.KeyValues{ model.String("processTagKey", processTagVal), }, } } func getSomeSpan() *model.Span { traceID := model.NewTraceID(1, 2) return &model.Span{ TraceID: traceID, SpanID: model.NewSpanID(3), OperationName: "opName", References: model.MaybeAddParentSpanID(traceID, 4, getReferences()), Flags: model.Flags(uint32(5)), StartTime: time.Now(), Duration: 50000 * time.Microsecond, Tags: getTags(), Logs: getLogs(), Process: getSomeProcess(), } } func getReferences() []model.SpanRef { return []model.SpanRef{ { RefType: model.ChildOf, TraceID: model.NewTraceID(1, 1), SpanID: model.NewSpanID(4), }, } } func getTags() model.KeyValues { someVal := "someVal" return model.KeyValues{ model.String("someKey", someVal), } } func getLogs() []model.Log { logTag := "this is a msg" return []model.Log{ { Timestamp: time.Now(), Fields: model.KeyValues{ model.String("event", logTag), }, }, } }
{ "content_hash": "213566704e4a5bff74ef6b5f02c7b21b", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 113, "avg_line_length": 26.496296296296297, "alnum_prop": 0.6843723790886217, "repo_name": "uber/jaeger", "id": "0cdfab8ef09c763367bc7c369e1ccfd843a95810", "size": "4220", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "plugin/storage/cassandra/savetracetest/main.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "976954" }, { "name": "HTML", "bytes": "97" }, { "name": "Makefile", "bytes": "8774" }, { "name": "Python", "bytes": "4935" }, { "name": "Shell", "bytes": "9356" } ], "symlink_target": "" }
<div ng-controller="FormController as ctrl" layout="row" ng-cloak> <md-content flex class="md-padding"> <form ng-submit="$event.preventDefault()"> <md-autocomplete ng-disabled="ctrl.isDisabled" md-no-cache="ctrl.noCache" md-selected-item="ctrl.selectedItem" md-search-text-change="ctrl.searchTextChange(ctrl.searchText)" md-search-text="ctrl.searchText" md-selected-item-change="ctrl.selectedItemChange(item)" md-items="item in ctrl.querySearch(ctrl.searchText)" md-item-text="item.display" md-min-length="1" placeholder="What is your favorite US state?"> <md-item-template> <span md-highlight-text="ctrl.searchText" md-highlight-flags="^i">{{item.display}}</span> </md-item-template> <md-not-found> No states matching <b>"{{ctrl.searchText}}"</b> were found. <a ng-click="ctrl.newState(ctrl.searchText)">Create a new one!</a> </md-not-found> </md-autocomplete> <br/> <md-checkbox ng-model="ctrl.simulateQuery">Simulate query for results?</md-checkbox> <md-checkbox ng-model="ctrl.noCache">Disable caching of queries?</md-checkbox> <md-checkbox ng-model="ctrl.isDisabled">Disable the input?</md-checkbox> </form> </md-content> </div>
{ "content_hash": "c2d220636c2f75a899a5f616f8e2efd5", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 105, "avg_line_length": 51.206896551724135, "alnum_prop": 0.5723905723905723, "repo_name": "M6C/angular-material-start", "id": "2f8428d7288ea1170d41165da05fc36457f95a06", "size": "1485", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "appFormAdvert.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10137" }, { "name": "HTML", "bytes": "45536" }, { "name": "JavaScript", "bytes": "130230" } ], "symlink_target": "" }
mutable struct MCEuropeanEngine{S <: AbstractBlackScholesProcess, RSG <: AbstractRandomSequenceGenerator} <: MCVanillaEngine{S, RSG} process::S timeSteps::Int timeStepsPerYear::Int requiredSamples::Int maxSamples::Int requiredTolerance::Float64 brownianBridge::Bool seed::Int # mcSimulation::MCSimulation{RSG, T} antitheticVariate::Bool rsg::RSG end function MCEuropeanEngine(process::S; timeSteps::Int = -1, timeStepsPerYear::Int = -1, brownianBridge::Bool = false, antitheticVariate::Bool = false, requiredSamples::Int = -1, requiredTolerance::Float64 = -1.0, maxSamples::Int = typemax(Int), seed::Int = 1, rsg::RSG = InverseCumulativeRSG(seed)) where {S <: AbstractBlackScholesProcess, RSG <: AbstractRandomSequenceGenerator} # build mc sim # mcSim = MCSimulation{RSG, SingleVariate}(antitheticVariate, false, rsg, SingleVariate()) return MCEuropeanEngine{S, RSG}(process, timeSteps, timeStepsPerYear, requiredSamples, maxSamples, requiredTolerance, brownianBridge, seed, antitheticVariate, rsg) end struct EuropeanPathPricer{P <: PlainVanillaPayoff} <: AbstractPathPricer payoff::P discount::Float64 end EuropeanPathPricer(optionType::OT, strike::Float64, disc::Float64) where {OT <: OptionType} = EuropeanPathPricer(PlainVanillaPayoff{OT}(optionType, strike), disc) (pricer::EuropeanPathPricer)(path::Path) = pricer.payoff(path[end]) * pricer.discount function time_grid(pe::MCVanillaEngine, opt::VanillaOption) lastExerciseDate = opt.exercise.dates[end] t = get_time(pe.process, lastExerciseDate) if pe.timeSteps != -1 return TimeGrid(t, pe.timeSteps) elseif pe.timeStepsPerYear != -1 steps = round(Int, floor(pe.timeStepsPerYear * t)) return TimeGrid(t, max(steps, 1)) else error("time steps not specified") end end function path_generator(pe::MCVanillaEngine, opt::VanillaOption) dimensions = get_factors(pe.process) grid = time_grid(pe, opt) init_sequence_generator!(pe.rsg, dimensions * (length(grid.times) - 1)) return PathGenerator(pe.process, grid, pe.rsg, pe.brownianBridge) end function path_pricer(pe::MCEuropeanEngine, opt::VanillaOption) payoff = opt.payoff process = pe.process return EuropeanPathPricer(payoff.optionType, payoff.strike, discount(process.riskFreeRate, time_grid(pe, opt)[end])) end function _calculate!(pe::MCVanillaEngine, opt::VanillaOption) mcSim = MCSimulation(pe, false, opt, SingleVariate()) _calculate!(mcSim, pe.requiredTolerance, pe.requiredSamples, pe.maxSamples) opt.results.value = stats_mean(mcSim.mcModel.sampleAccumulator) return pe, opt end
{ "content_hash": "783cd7194707ffb47614460e8e698a75", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 165, "avg_line_length": 40, "alnum_prop": 0.743560606060606, "repo_name": "pazzo83/JQuantLib", "id": "297d53285ce3736d802716a4a10740aeb04f4459", "size": "2640", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/pricing_engines/vanilla/mc_european_engine.jl", "mode": "33188", "license": "mit", "language": [ { "name": "Julia", "bytes": "523174" } ], "symlink_target": "" }
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char *buffer = NULL; size_t size1; size_t size2; FILE *filedes; filedes = fopen("out.txt", "w+"); if (filedes == NULL){ printf("Could not open file\n"); } /* A total of 6 characters including the null byte can be copied into buffer */ size1 = 6; buffer = (char *)calloc( 1, size1); if (buffer == NULL) { printf("Could not allocate memory\n"); } /* Copies 8 characters of the alphabet string into the buffer. Note that byte 5 is a null byte here. */ buffer[0]= 'a'; buffer[1]= 'b'; buffer[2]= 'c'; buffer[3]= 'd'; buffer[4]= '\0'; buffer[5]= 'f'; buffer[6]= 'g'; buffer[7]= 'p'; /* Despite the null byte being there at byte 5, fwrite ignores it and just copies 8 bytes into buffer and hence out.txt. Verify this using wc -c out.txt or hexdump -C out.txt */ size2= 8; /* Always set the amount to write based on the size of the buffer you are writing */ //size2= strlen(buffer)+1; fwrite(buffer, 1, size2, filedes); free(buffer); buffer = NULL; fclose(filedes); /* This could be a problem IF there is some program which reads the file and uses all of the information inside to do something with it but ignores the null character. */ }
{ "content_hash": "be5662f0a9593e82d9d6546db844fb46", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 140, "avg_line_length": 26.547169811320753, "alnum_prop": 0.5891968727789624, "repo_name": "arvinddoraiswamy/Csec", "id": "00cd0373fd6108b4a88f918298e5756aef860d81", "size": "1407", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cert_c_coding_standard/9_fileIO/18/fio18.c", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "36420" } ], "symlink_target": "" }
<?php return [ /* |-------------------------------------------------------------------------- | Strings Language Lines |-------------------------------------------------------------------------- | | The following language lines are used in strings throughout the system. | Regardless where it is placed, a string can be listed here so it is easily | found in a intuitive way. | */ 'backend' => [ 'access' => [ 'users' => [ 'delete_user_confirm' => "Sei sicuro di voler eliminare definitivamente questo utente? Ovunque ci sia un riferimento a questo utente all'interno dell'applicazione si vedrà un errore. Procedi a tuo rischio e pericolo, non si potrà annullare questa operazione.", 'if_confirmed_off' => '(Se non è confermato)', 'restore_user_confirm' => "Ripristinare l'utente al suo stato originario?", ], ], 'dashboard' => [ 'title' => 'Dashboard Amministrazione', 'welcome' => 'Benvenuto', ], 'general' => [ 'all_rights_reserved' => 'Tutti i diritti riservati.', 'are_you_sure' => 'Sei sicuro?', 'boilerplate_link' => 'Laravel 5 Boilerplate', 'continue' => 'Continua', 'member_since' => 'Membro dal', 'minutes' => ' minutes', 'search_placeholder' => 'Cerca...', 'timeout' => 'You were automatically logged out for security reasons since you had no activity in ', 'see_all' => [ 'messages' => 'Visualizza tutti i messaggi', 'notifications' => 'Visualizza tutte', 'tasks' => 'Visualizza tutti i compiti', ], 'status' => [ 'online' => 'Online', 'offline' => 'Offline', ], 'you_have' => [ 'messages' => '{0} Non hai messaggi|{1} Hai un messaggio|[2,Inf] Hai :number messaggi', 'notifications' => '{0} Non hai notifiche|{1} Hai una notifica|[2,Inf] Hai :number notifiche', 'tasks' => '{0} Non hai compiti|{1} Hai un compito|[2,Inf] Hai :number compiti', ], ], 'search' => [ 'empty' => 'Please enter a search term.', 'incomplete' => 'You must write your own search logic for this system.', 'title' => 'Search Results', 'results' => 'Search Results for :query', ], 'welcome' => '<p>Quello che vedi è il tema CoreUI sviluppato da <a href="https://coreui.io/" target="_blank">creativeLabs</a>. Si tratta di una versione ridotta al minimo che include solo gli stili e gli script necessari per il funzionamento. Scarica la versione completa per aggiungere componenti alla dashboard.</p> <p>Tutte le funzioni che vedi sono simulate, ad eccezione della <strong>Gestione utenti</strong> sulla sinistra. Questo modello comprende una libreria completa per il controllo degli accessi tramite utenti/ruoli/permessi.</p> <p>Questo si tratta comunque di un work-in-progress, perciò ci potrebbero essere dei bug o altri problemi che non ho ancora risolto. Farò del mio meglio per risolverli mano a mano che riceverò le segnalazioni.</p> <p>Spero che tu gradisca quanto lavoro e impegno ho messo in questo progetto. Per cortesia vai su <a href="https://github.com/rappasoft/laravel-5-boilerplate" target="_blank">GitHub</a> per ulteriori informazioni e per segnalare qualsiasi <a href="https://github.com/rappasoft/Laravel-5-Boilerplate/issues" target="_blank">problema</a>.</p> <p><strong>This project is very demanding to keep up with given the rate at which the master Laravel branch changes, so any help is appreciated.</strong></p> <p>- Anthony Rappa</p>', ], 'emails' => [ 'auth' => [ 'account_confirmed' => 'Your account has been confirmed.', 'error' => 'Whoops!', 'greeting' => 'Hello!', 'regards' => 'Regards,', 'trouble_clicking_button' => 'If you’re having trouble clicking the ":action_text" button, copy and paste the URL below into your web browser:', 'thank_you_for_using_app' => 'Thank you for using our application!', 'password_reset_subject' => 'Il tuo link per il reset della password', 'password_cause_of_email' => 'You are receiving this email because we received a password reset request for your account.', 'password_if_not_requested' => 'If you did not request a password reset, no further action is required.', 'reset_password' => 'Clicca qui per resettare la tua password', 'click_to_confirm' => 'Clicca qui per confermare il tuo account:', ], 'contact' => [ 'email_body_title' => 'You have a new contact form request: Below are the details:', 'subject' => 'A new :app_name contact form submission!', ], ], 'frontend' => [ 'test' => 'Test', 'tests' => [ 'based_on' => [ 'permission' => 'Basato su permessi - ', 'role' => 'Basato su ruoli - ', ], 'js_injected_from_controller' => 'Javascript iniettato da un controller', 'using_blade_extensions' => 'Usando estensioni Blade', 'using_access_helper' => [ 'array_permissions' => "Si sta usando l'Access Helper con un array di nomi o ID di permessi, l'utente li deve possedere tutti.", 'array_permissions_not' => "Si sta usando l'Access Helper con un array di nomi o ID di permessi, l'utente non li deve possedere tutti.", 'array_roles' => "Si sta usando l'Access Helper con un array di nomi o ID di ruoli, l'utente li deve possedere tutti.", 'array_roles_not' => "Si sta usando l'Access Helper con un array di nomi o ID di ruoli, l'utente non li deve possedere tutti.", 'permission_id' => "Si sta usando l'Access Helper con un ID di permesso", 'permission_name' => "Si sta usando l'Access Helper con un nome di permesso", 'role_id' => "Si sta usando l'Access Helper con un ID di ruolo", 'role_name' => "Si sta usando l'Access Helper con un nome di ruolo", ], 'view_console_it_works' => 'Apri la console Javascript del browser, dovresti vedere \'it works!\' generato da FrontendController@index', 'you_can_see_because' => 'Puoi vedere questo perché il tuo ruolo è \':role\'!', 'you_can_see_because_permission' => 'Puoi vedere questo perché hai il permesso \':permission\'!', ], 'general' => [ 'joined' => 'Joined', ], 'user' => [ 'change_email_notice' => 'If you change your e-mail you will be logged out until you confirm your new e-mail address.', 'email_changed_notice' => 'You must confirm your new e-mail address before you can log in again.', 'profile_updated' => 'Profilo aggiornato con successo.', 'password_updated' => 'Password aggiornata con successo.', ], 'welcome_to' => 'Benvenuto su :place', ], ];
{ "content_hash": "58e958ef8b1868eacbfb08d51dec1da7", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 277, "avg_line_length": 52.291666666666664, "alnum_prop": 0.5569721115537849, "repo_name": "openadult/oats", "id": "d508d8be923786e58d196c7bdc31bdc645009625", "size": "7542", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "resources/lang/it/strings.php", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "1018" }, { "name": "HTML", "bytes": "125384" }, { "name": "PHP", "bytes": "1222130" }, { "name": "Vue", "bytes": "380" } ], "symlink_target": "" }
module Clamp module Option module Parsing protected def parse_options while remaining_arguments.first =~ /\A-/ switch = remaining_arguments.shift break if switch == "--" case switch when /\A(-\w)(.+)\z/m # combined short options switch = $1 if find_option(switch).flag? remaining_arguments.unshift("-" + $2) else remaining_arguments.unshift($2) end when /\A(--[^=]+)=(.*)\z/m switch = $1 remaining_arguments.unshift($2) end option = find_option(switch) value = option.extract_value(switch, remaining_arguments) begin option.of(self).take(value) rescue ArgumentError => e signal_usage_error Clamp.message(:option_argument_error, :switch => switch, :message => e.message) end end # Fill in gap from environment self.class.recognised_options.each do |option| option.of(self).default_from_environment end # Verify that all required options are present self.class.recognised_options.each do |option| # If this option is required and the value is nil, there's an error. if option.required? and send(option.attribute_name).nil? if option.environment_variable message = Clamp.message(:option_or_env_required, :option => option.switches.first, :env => option.environment_variable) else message = Clamp.message(:option_required, :option => option.switches.first) end signal_usage_error message end end end private def find_option(switch) self.class.find_option(switch) || signal_usage_error(Clamp.message(:unrecognised_option, :switch => switch)) end end end end
{ "content_hash": "ca47557841f9abc2474d557440b68948", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 133, "avg_line_length": 28.61764705882353, "alnum_prop": 0.566289825282631, "repo_name": "playtimestudios/admin_bounds", "id": "bb7b41cd231d38ff9bdb3d106a773f9c76992f11", "size": "1946", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rails_engine/vendor/bundle/gems/clamp-1.0.0/lib/clamp/option/parsing.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "686" }, { "name": "HTML", "bytes": "4883" }, { "name": "JavaScript", "bytes": "596" }, { "name": "Ruby", "bytes": "29014" } ], "symlink_target": "" }
static inline int64_t GetPerformanceCounter() { int64_t nCounter = 0; #ifdef WIN32 QueryPerformanceCounter((LARGE_INTEGER*)&nCounter); #else timeval t; gettimeofday(&t, NULL); nCounter = (int64_t)(t.tv_sec * 1000000 + t.tv_usec); #endif return nCounter; } void RandAddSeed() { // Seed with CPU performance counter int64_t nCounter = GetPerformanceCounter(); RAND_add(&nCounter, sizeof(nCounter), 1.5); memory_cleanse((void*)&nCounter, sizeof(nCounter)); } void RandAddSeedPerfmon() { RandAddSeed(); #ifdef WIN32 // Don't need this on Linux, OpenSSL automatically uses /dev/urandom // Seed with the entire set of perfmon data // This can take up to 2 seconds, so only do it every 10 minutes static int64_t nLastPerfmon; if (GetTime() < nLastPerfmon + 10 * 60) return; nLastPerfmon = GetTime(); std::vector<unsigned char> vData(250000, 0); long ret = 0; unsigned long nSize = 0; const size_t nMaxSize = 10000000; // Bail out at more than 10MB of performance data while (true) { nSize = vData.size(); ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, begin_ptr(vData), &nSize); if (ret != ERROR_MORE_DATA || vData.size() >= nMaxSize) break; vData.resize(std::max((vData.size() * 3) / 2, nMaxSize)); // Grow size of buffer exponentially } RegCloseKey(HKEY_PERFORMANCE_DATA); if (ret == ERROR_SUCCESS) { RAND_add(begin_ptr(vData), nSize, nSize / 100.0); memory_cleanse(begin_ptr(vData), nSize); LogPrint("rand", "%s: %lu bytes\n", __func__, nSize); } else { static bool warned = false; // Warn only once if (!warned) { LogPrintf("%s: Warning: RegQueryValueExA(HKEY_PERFORMANCE_DATA) failed with code %i\n", __func__, ret); warned = true; } } #endif } void GetRandBytes(unsigned char* buf, int num) { if (RAND_bytes(buf, num) != 1) { LogPrintf("%s: OpenSSL RAND_bytes() failed with error: %s\n", __func__, ERR_error_string(ERR_get_error(), NULL)); assert(false); } } uint64_t GetRand(uint64_t nMax) { if (nMax == 0) return 0; // The range of the random source must be a multiple of the modulus // to give every possible output value an equal possibility uint64_t nRange = (std::numeric_limits<uint64_t>::max() / nMax) * nMax; uint64_t nRand = 0; do { GetRandBytes((unsigned char*)&nRand, sizeof(nRand)); } while (nRand >= nRange); return (nRand % nMax); } int GetRandInt(int nMax) { return GetRand(nMax); } uint256 GetRandHash() { uint256 hash; GetRandBytes((unsigned char*)&hash, sizeof(hash)); return hash; } uint32_t insecure_rand_Rz = 11; uint32_t insecure_rand_Rw = 11; void seed_insecure_rand(bool fDeterministic) { // The seed values have some unlikely fixed points which we avoid. if (fDeterministic) { insecure_rand_Rz = insecure_rand_Rw = 11; } else { uint32_t tmp; do { GetRandBytes((unsigned char*)&tmp, 4); } while (tmp == 0 || tmp == 0x9068ffffU); insecure_rand_Rz = tmp; do { GetRandBytes((unsigned char*)&tmp, 4); } while (tmp == 0 || tmp == 0x464fffffU); insecure_rand_Rw = tmp; } }
{ "content_hash": "b07618f82dc294a15d55ef15a9459d96", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 121, "avg_line_length": 29.104347826086958, "alnum_prop": 0.6124887959366597, "repo_name": "vericoin/vericoin-core", "id": "be707bf4d9b815cab5e2827680522d906da6fff0", "size": "3959", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/random.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "415522" }, { "name": "C++", "bytes": "3775139" }, { "name": "CSS", "bytes": "1127" }, { "name": "HTML", "bytes": "50621" }, { "name": "Java", "bytes": "2100" }, { "name": "M4", "bytes": "134402" }, { "name": "Makefile", "bytes": "89021" }, { "name": "Objective-C", "bytes": "2023" }, { "name": "Objective-C++", "bytes": "7243" }, { "name": "Protocol Buffer", "bytes": "2309" }, { "name": "Python", "bytes": "453747" }, { "name": "QMake", "bytes": "2019" }, { "name": "Roff", "bytes": "19809" }, { "name": "Shell", "bytes": "38074" } ], "symlink_target": "" }
import { ReactElement } from 'react'; import { PageLoaderContainer } from './styles'; export default function PageLoader(): ReactElement { return <PageLoaderContainer className="page-loader" />; }
{ "content_hash": "081abebeaae00a81093ab5af4df866ea", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 57, "avg_line_length": 33.333333333333336, "alnum_prop": 0.745, "repo_name": "BrianLusina/brianlusina.github.io", "id": "5d46e28bddd5490e88545d9c88656a77398a473a", "size": "200", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/components/loaders/PageLoader/PageLoader.tsx", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2200" }, { "name": "Dockerfile", "bytes": "732" }, { "name": "HTML", "bytes": "2216" }, { "name": "JavaScript", "bytes": "105169" }, { "name": "Makefile", "bytes": "2123" }, { "name": "SCSS", "bytes": "48101" }, { "name": "Shell", "bytes": "348" }, { "name": "TypeScript", "bytes": "55937" } ], "symlink_target": "" }
from django import template register = template.Library() @register.simple_tag def navactive(request, urls): if request.resolver_match.url_name in urls.split(): return "active" return ""
{ "content_hash": "369bbc8ec4a91d9199341c22521afb4b", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 55, "avg_line_length": 20.6, "alnum_prop": 0.7038834951456311, "repo_name": "althalus/knotcrafters", "id": "096f2a21c05e0e2cfb710dd0837881cba4860277", "size": "206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "knotdirectory/knotdirectory/knots/templatetags/navtags.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "39" }, { "name": "JavaScript", "bytes": "45" }, { "name": "Python", "bytes": "80618" }, { "name": "Shell", "bytes": "5120" } ], "symlink_target": "" }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = blurTouchActionReducer; var _actionTypes = require('../../action-types'); var _actionTypes2 = _interopRequireDefault(_actionTypes); var _updateField = require('../../utils/update-field'); var _updateField2 = _interopRequireDefault(_updateField); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function blurTouchActionReducer(state, action, localPath) { if (action.type !== _actionTypes2.default.SET_UNTOUCHED) { return state; } return (0, _updateField2.default)(state, localPath, function () { return { focus: false, touched: false }; }); }
{ "content_hash": "2ddda50da868c19e02099409b09be9c5", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 95, "avg_line_length": 25.03448275862069, "alnum_prop": 0.6845730027548209, "repo_name": "ngocson8b/6jar", "id": "f0ddf018c20547d1d9a28c5404b659cf3b6f063e", "size": "726", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/assets/js/node_modules/react-redux-form/lib/reducers/form/untouch-action-reducer.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "2045" }, { "name": "CSS", "bytes": "3756" }, { "name": "HTML", "bytes": "179" }, { "name": "JavaScript", "bytes": "7738004" }, { "name": "PHP", "bytes": "137074" } ], "symlink_target": "" }
.section-heading{ }
{ "content_hash": "d1db7e2aee622be16c836d306910bfe0", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 17, "avg_line_length": 6.666666666666667, "alnum_prop": 0.7, "repo_name": "UQdeco2800/farmsim", "id": "b19fde7ad3174ea52d1491c46e550eb5487a9864", "size": "20", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "farmsim/src/main/resources/css/animalProcessing.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "29871" }, { "name": "Java", "bytes": "1242714" } ], "symlink_target": "" }
'use strict'; import gulp from 'gulp'; import sass from 'gulp-sass'; import autoprefixer from 'gulp-autoprefixer'; import paths from '../config'; gulp.task('build:css', () => { return gulp.src(paths.source.scss) .pipe(sass()) .pipe(autoprefixer()) .pipe(gulp.dest(paths.build.css)); });
{ "content_hash": "2a9fc11305f20a34d8812477cec79caf", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 45, "avg_line_length": 23.307692307692307, "alnum_prop": 0.6633663366336634, "repo_name": "bbesmanoff/qdb-3.0", "id": "b6d54aa1fad014666a63cd07e8d3b5db5a0277c1", "size": "303", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gulp/tasks/css.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "186" }, { "name": "JavaScript", "bytes": "3543" } ], "symlink_target": "" }
package org.apache.hyracks.maven.plugin; import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; /** * @goal start-nc */ public class HyracksNCStartMojo extends AbstractHyracksServerMojo { private static final String HYRACKS_NC_SCRIPT = "bin" + File.separator + "hyracksnc"; /** * @parameter * @required */ private String nodeId; /** * @parameter * @required */ private String ccHost; /** * @parameter */ private int ccPort; /** * @parameter * @required */ private String dataIpAddress; @Override public void execute() throws MojoExecutionException, MojoFailureException { StringBuilder cmdLineBuffer = new StringBuilder(); cmdLineBuffer.append(" -cc-host ").append(ccHost); cmdLineBuffer.append(" -data-ip-address ").append(dataIpAddress); cmdLineBuffer.append(" -node-id ").append(nodeId); cmdLineBuffer.append(" -cluster-net-ip-address 127.0.0.1"); cmdLineBuffer.append(" -result-ip-address 127.0.0.1"); if (ccPort != 0) { cmdLineBuffer.append(" -cc-port ").append(ccPort); } String args = cmdLineBuffer.toString(); final Process proc = launch(new File(hyracksServerHome, makeScriptName(HYRACKS_NC_SCRIPT)), args, workingDir); HyracksServiceRegistry.INSTANCE.addServiceProcess(proc); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } } }
{ "content_hash": "1a0b4cdb7d75309b5bcd136e113e84bb", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 118, "avg_line_length": 27.75862068965517, "alnum_prop": 0.6341614906832298, "repo_name": "kisskys/incubator-asterixdb-hyracks", "id": "1f0e6408c731812c5f2d23d59f7907718bbd73be", "size": "2417", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "hyracks/hyracks-maven-plugins/hyracks-virtualcluster-maven-plugin/src/main/java/org/apache/hyracks/maven/plugin/HyracksNCStartMojo.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2606" }, { "name": "CSS", "bytes": "893" }, { "name": "HTML", "bytes": "8762" }, { "name": "Java", "bytes": "8406768" }, { "name": "JavaScript", "bytes": "24904" }, { "name": "Shell", "bytes": "16545" } ], "symlink_target": "" }
#if defined(_MSC_VER) #pragma once #endif #ifndef PBRT_INTEGRATORS_IGI_H #define PBRT_INTEGRATORS_IGI_H // integrators/igi.h* #include "pbrt.h" #include "integrator.h" // IGIIntegrator Local Structures struct VirtualLight { VirtualLight() { } VirtualLight(const Point &pp, const Normal &nn, const Spectrum &c, float reps) : p(pp), n(nn), pathContrib(c), rayEpsilon(reps) { } Point p; Normal n; Spectrum pathContrib; float rayEpsilon; }; // IGIIntegrator Declarations class IGIIntegrator : public SurfaceIntegrator { public: // IGIIntegrator Public Methods ~IGIIntegrator(); Spectrum Li(const Scene *scene, const Renderer *renderer, const RayDifferential &ray, const Intersection &isect, const Sample *sample, RNG &rng, MemoryArena &arena) const; void RequestSamples(Sampler *sampler, Sample *sample, const Scene *scene); void Preprocess(const Scene *, const Camera *, const Renderer *); IGIIntegrator(uint32_t nl, uint32_t ns, float rrt, int maxd, float gl, int ng) { nLightPaths = RoundUpPow2(nl); nLightSets = RoundUpPow2(ns); rrThreshold = rrt; maxSpecularDepth = maxd; virtualLights.resize(nLightSets); gLimit = gl; nGatherSamples = ng; lightSampleOffsets = NULL; bsdfSampleOffsets = NULL; } private: // IGIIntegrator Private Data // Declare sample parameters for light source sampling LightSampleOffsets *lightSampleOffsets; BSDFSampleOffsets *bsdfSampleOffsets; uint32_t nLightPaths, nLightSets; float gLimit; int nGatherSamples; float rrThreshold; int maxSpecularDepth; int vlSetOffset; BSDFSampleOffsets gatherSampleOffset; vector<vector<VirtualLight> > virtualLights; }; IGIIntegrator *CreateIGISurfaceIntegrator(const ParamSet &params); #endif // PBRT_INTEGRATORS_IGI_H
{ "content_hash": "52e3fa5a6060896a1506caa34960e8db", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 84, "avg_line_length": 27.6231884057971, "alnum_prop": 0.6899265477439664, "repo_name": "kayarre/reconbench", "id": "58668fe0d08048ceaa8f895cfd5843d957602e48", "size": "2773", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "pbrt/src/integrators/igi.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "177" }, { "name": "C", "bytes": "1190231" }, { "name": "C++", "bytes": "4851751" }, { "name": "DTrace", "bytes": "10764" }, { "name": "LLVM", "bytes": "5603" }, { "name": "Makefile", "bytes": "38172" }, { "name": "Objective-C", "bytes": "4751" }, { "name": "Perl", "bytes": "1051" }, { "name": "Python", "bytes": "18247" }, { "name": "Shell", "bytes": "13676" }, { "name": "SourcePawn", "bytes": "4431" }, { "name": "Yacc", "bytes": "18321" } ], "symlink_target": "" }
#ifndef SMTEXTURETEXT2COLLECTOR_H #define SMTEXTURETEXT2COLLECTOR_H /**************************************************************************/ #include <vector> #include <Inventor/elements/SoSubElement.h> #include <Inventor/elements/SoElement.h> #include <Inventor/SbColor4f.h> #include <SmallChange/nodes/SmTextureFont.h> #include <SmallChange/nodes/SmTextureText2.h> class SMALLCHANGE_DLL_API SmTextureText2CollectorElement : public SoElement { typedef SoElement inherited; SO_ELEMENT_HEADER(SmTextureText2CollectorElement); public: static void initClass(void); protected: virtual ~SmTextureText2CollectorElement(); public: typedef struct { SbString text; const SmTextureFont::FontImage * font; SbVec3f worldpos; float maxdist; SbColor4f color; SmTextureText2::Justification justification; SmTextureText2::VerticalJustification vjustification; } TextItem; virtual void init(SoState * state); static void startCollecting(SoState * state, const bool storeitems = true); static void add(SoState * state, const SbString & text, const SmTextureFont::FontImage * font, const SbVec3f & worldpos, const float maxdist, const SbColor4f & color, SmTextureText2::Justification j, SmTextureText2::VerticalJustification vj); static const std::vector <TextItem> & finishCollecting(SoState * state); static bool isCollecting(SoState * state); virtual SbBool matches(const SoElement * elt) const; virtual SoElement * copyMatchInfo(void) const; private: bool collecting; bool storeitems; std::vector <TextItem> items; }; /**************************************************************************/ #include <Inventor/nodes/SoSubNode.h> #include <Inventor/nodes/SoSeparator.h> #include <Inventor/fields/SoSFBool.h> #include <SmallChange/basic.h> class SMALLCHANGE_DLL_API SmTextureText2Collector : public SoSeparator { typedef SoSeparator inherited; SO_NODE_HEADER(SmTextureText2Collector); public: SoSFBool depthMask; static void initClass(void); SmTextureText2Collector(void); virtual void GLRenderBelowPath(SoGLRenderAction * action); virtual void GLRenderInPath(SoGLRenderAction * action); protected: virtual ~SmTextureText2Collector(); virtual void renderText(SoGLRenderAction * action, const std::vector<SmTextureText2CollectorElement::TextItem> &); }; /**************************************************************************/ #endif // SMTEXTURETEXT2COLLECTOR_H
{ "content_hash": "e7079565d4053640be404c34a6bf5fbe", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 89, "avg_line_length": 27.65934065934066, "alnum_prop": 0.6893126738180373, "repo_name": "Alexpux/SmallChange", "id": "19d96ab232c064eb74b0fb8040cefdc99f1414db", "size": "2517", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/SmallChange/nodes/SmTextureText2Collector.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "56274" }, { "name": "C++", "bytes": "1210626" }, { "name": "Objective-C", "bytes": "27524" }, { "name": "Perl", "bytes": "215" }, { "name": "Shell", "bytes": "261395" } ], "symlink_target": "" }
var requireHapiRoutes = require('require-hapiroutes'); module.exports = requireHapiRoutes(module);
{ "content_hash": "d13c83a0015a25421fc7304ebbacd727", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 54, "avg_line_length": 49, "alnum_prop": 0.8163265306122449, "repo_name": "rapsli/pmgraph", "id": "1b649970df66c2fc62a006fd473a56b84a1e79a5", "size": "98", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "routes/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "952" }, { "name": "HTML", "bytes": "15262" }, { "name": "JavaScript", "bytes": "35131" }, { "name": "Shell", "bytes": "1259" } ], "symlink_target": "" }
import RPi.GPIO as GPIO import time PIN_NUM = 12 GPIO.setmode(GPIO.BOARD) GPIO.setup(PIN_NUM,GPIO.OUT) p = GPIO.PWM(PIN_NUM,0.5) p.start(50) raw_input("Press Enter to stop:") p.stop() GPIO.cleanup()
{ "content_hash": "b47d727021764818e7777fe1752e9d1d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 33, "avg_line_length": 15.538461538461538, "alnum_prop": 0.7079207920792079, "repo_name": "swkim01/RPi.GPIO-OdroidC1", "id": "1dc3768fa1cc03c8d12777730b4e2f44ddd5fbc3", "size": "224", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/pwm_test.py", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "97929" }, { "name": "C++", "bytes": "6025" }, { "name": "Python", "bytes": "28718" } ], "symlink_target": "" }
<?php class Dotdigitalgroup_Email_Block_Adminhtml_Dashboard extends Mage_Adminhtml_Block_Dashboard_Bar { /** * Set the template. */ public function _construct() { parent::_construct(); $this->setTemplate('connector/dashboard/accountbar.phtml'); } /** * Prepare the layout. * * @return Mage_Core_Block_Abstract|void * @throws Exception */ protected function _prepareLayout() { $website = 0; //request store param if ($store = $this->getRequest()->getParam('store')) { $website = Mage::app()->getStore($store)->getWebsite(); //website param } elseif ($this->getRequest()->getParam('website')) { $website = $this->getRequest()->getParam('website'); } $apiUsername = Mage::helper('ddg')->getApiUsername($website); $apiPassword = Mage::helper('ddg')->getApiPassword($website); //api get account info $data = Mage::getModel('ddg_automation/apiconnector_client') ->setApiUsername($apiUsername) ->setApiPassword($apiPassword) ->getAccountInfo(); //check if properties for the data exists if (isset($data->properties)) { foreach ($data->properties as $one) { //add total for the api calls $this->addTotal($this->__($one->name), $one->value, true); } } } }
{ "content_hash": "3dadaa26eb69843b1e73647908467b06", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 74, "avg_line_length": 27.185185185185187, "alnum_prop": 0.5544959128065395, "repo_name": "adeelq/dotmailer-magento-extension", "id": "c15ee00e369758e00384e27ebca20863eeb7bb2f", "size": "1468", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code/Dotdigitalgroup/Email/Block/Adminhtml/Dashboard.php", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "1878" }, { "name": "HTML", "bytes": "75616" }, { "name": "JavaScript", "bytes": "74342" }, { "name": "PHP", "bytes": "1221182" }, { "name": "XSLT", "bytes": "33245" } ], "symlink_target": "" }
const util = require('util'); const Base = require('./Base.js'); var Control = function (params, states, subControls) { this.id = 'control-'+params.type+'-'+params.uuidAction; this.name = params.name; this.type = params.type; this.uuidAction = params.uuidAction; this.defaultRating = params.defaultRating; this.isSecured = params.isSecured; this.room = params.room; this.category = params.cat; this.states = states; this.details = params.details; this.statistic = params.statistic; this.subControls = subControls; Base.apply(this); this._register_events(); }; util.inherits(Control, Base); Control.prototype.register_state_events = function() { var that = this; if (this.states){ Object.keys(this.states.items).forEach(function(item){ this.states.items[item].on('update',function(uuid, value, source){ that.emit('update', uuid, value, source); that.emit('state_update', that); }); }, this); } }; Control.prototype._register_events = function() { var that = this; this.register_state_events(); if (this.subControls){ Object.keys(this.subControls.items).forEach(function(item){ this.subControls.items[item].on('update',function(uuid, value, source){ that.emit('update', uuid, value, source); }); }, this); } }; Control.prototype.get_state = function () { var output_states = {}; if (this.states){ Object.keys(this.states.items).forEach(function(item){ output_states[item] = this.states.items[item].value; }, this); } return output_states; }; module.exports = Control;
{ "content_hash": "e66f43b2e03ddda42394d0ae122b5f46", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 83, "avg_line_length": 29.322033898305083, "alnum_prop": 0.6161849710982659, "repo_name": "alladdin/node-lox-structure-file", "id": "be1c8ca8023f1c91910d05f875ead30a83fcbd60", "size": "1730", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/Structure/Control.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "24434" } ], "symlink_target": "" }
#ifndef ANDROID_HWUI_VERTEX_BUFFER_H #define ANDROID_HWUI_VERTEX_BUFFER_H #include <algorithm> namespace android { namespace uirenderer { class VertexBuffer { public: enum MeshFeatureFlags { kNone = 0, kAlpha = 1 << 0, kIndices = 1 << 1, }; VertexBuffer() : mBuffer(nullptr) , mIndices(nullptr) , mVertexCount(0) , mIndexCount(0) , mAllocatedVertexCount(0) , mAllocatedIndexCount(0) , mByteCount(0) , mMeshFeatureFlags(kNone) , mReallocBuffer(nullptr) , mCleanupMethod(nullptr) , mCleanupIndexMethod(nullptr) {} ~VertexBuffer() { if (mCleanupMethod) mCleanupMethod(mBuffer); if (mCleanupIndexMethod) mCleanupIndexMethod(mIndices); } /** This should be the only method used by the Tessellator. Subsequent calls to alloc will allocate space within the first allocation (useful if you want to eventually allocate multiple regions within a single VertexBuffer, such as with PathTessellator::tessellateLines()) */ template <class TYPE> TYPE* alloc(int vertexCount) { if (mVertexCount) { TYPE* reallocBuffer = (TYPE*)mReallocBuffer; // already have allocated the buffer, re-allocate space within if (mReallocBuffer != mBuffer) { // not first re-allocation, leave space for degenerate triangles to separate strips reallocBuffer += 2; } mReallocBuffer = reallocBuffer + vertexCount; return reallocBuffer; } mAllocatedVertexCount = vertexCount; mVertexCount = vertexCount; mByteCount = mVertexCount * sizeof(TYPE); mReallocBuffer = mBuffer = (void*)new TYPE[vertexCount]; mCleanupMethod = &(cleanup<TYPE>); return (TYPE*)mBuffer; } template <class TYPE> TYPE* allocIndices(int indexCount) { mAllocatedIndexCount = indexCount; mIndexCount = indexCount; mIndices = (void*)new TYPE[indexCount]; mCleanupIndexMethod = &(cleanup<TYPE>); return (TYPE*)mIndices; } template <class TYPE> void copyInto(const VertexBuffer& srcBuffer, float xOffset, float yOffset) { int verticesToCopy = srcBuffer.getVertexCount(); TYPE* dst = alloc<TYPE>(verticesToCopy); TYPE* src = (TYPE*)srcBuffer.getBuffer(); for (int i = 0; i < verticesToCopy; i++) { TYPE::copyWithOffset(&dst[i], src[i], xOffset, yOffset); } } /** * Brute force bounds computation, used only if the producer of this * vertex buffer can't determine bounds more simply/efficiently */ template <class TYPE> void computeBounds(int vertexCount = 0) { if (!mVertexCount) { mBounds.setEmpty(); return; } // default: compute over every vertex if (vertexCount == 0) vertexCount = mVertexCount; TYPE* current = (TYPE*)mBuffer; TYPE* end = current + vertexCount; mBounds.set(current->x, current->y, current->x, current->y); for (; current < end; current++) { mBounds.expandToCover(current->x, current->y); } } const void* getBuffer() const { return mBuffer; } const void* getIndices() const { return mIndices; } const Rect& getBounds() const { return mBounds; } unsigned int getVertexCount() const { return mVertexCount; } unsigned int getSize() const { return mByteCount; } unsigned int getIndexCount() const { return mIndexCount; } void updateIndexCount(unsigned int newCount) { mIndexCount = std::min(newCount, mAllocatedIndexCount); } void updateVertexCount(unsigned int newCount) { mVertexCount = std::min(newCount, mAllocatedVertexCount); } MeshFeatureFlags getMeshFeatureFlags() const { return mMeshFeatureFlags; } void setMeshFeatureFlags(int flags) { mMeshFeatureFlags = static_cast<MeshFeatureFlags>(flags); } void setBounds(Rect bounds) { mBounds = bounds; } template <class TYPE> void createDegenerateSeparators(int allocSize) { TYPE* end = (TYPE*)mBuffer + mVertexCount; for (TYPE* degen = (TYPE*)mBuffer + allocSize; degen < end; degen += 2 + allocSize) { memcpy(degen, degen - 1, sizeof(TYPE)); memcpy(degen + 1, degen + 2, sizeof(TYPE)); } } private: template <class TYPE> static void cleanup(void* buffer) { delete[] (TYPE*)buffer; } Rect mBounds; void* mBuffer; void* mIndices; unsigned int mVertexCount; unsigned int mIndexCount; unsigned int mAllocatedVertexCount; unsigned int mAllocatedIndexCount; unsigned int mByteCount; MeshFeatureFlags mMeshFeatureFlags; void* mReallocBuffer; // used for multi-allocation void (*mCleanupMethod)(void*); void (*mCleanupIndexMethod)(void*); }; }; // namespace uirenderer }; // namespace android #endif // ANDROID_HWUI_VERTEX_BUFFER_H
{ "content_hash": "337128b3e31f0ad9dc31a0a04ee568a7", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 99, "avg_line_length": 30.718562874251496, "alnum_prop": 0.6247563352826511, "repo_name": "xorware/android_frameworks_base", "id": "bdb5b7b381bf81b53cf783d008bc128ddd9cfdca", "size": "5749", "binary": false, "copies": "1", "ref": "refs/heads/n", "path": "libs/hwui/VertexBuffer.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "167132" }, { "name": "C++", "bytes": "7092455" }, { "name": "GLSL", "bytes": "20654" }, { "name": "HTML", "bytes": "224185" }, { "name": "Java", "bytes": "78926513" }, { "name": "Makefile", "bytes": "420231" }, { "name": "Python", "bytes": "42309" }, { "name": "RenderScript", "bytes": "153826" }, { "name": "Shell", "bytes": "21079" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in Revision of the lichen genus Sphaerophorus (Michigan) 175 (1974) #### Original name Pleurocybe patagonica C.W. Dodge ### Remarks null
{ "content_hash": "25c2b8e30e55be038b5bff706a55873e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 64, "avg_line_length": 17, "alnum_prop": 0.7375565610859729, "repo_name": "mdoering/backbone", "id": "a994d545b8c2128ba7e3cdf533a7aa56b08439cc", "size": "292", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Sphaerophoraceae/Bunodophoron/Bunodophoron patagonicum/ Syn. Sphaerophorus patagonicus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
/** * Inline development version. Only to be used while developing since it uses document.write to load scripts. */ /*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ /*globals $code */ (function(exports) { "use strict"; var html = "", baseDir; var modules = {}, exposedModules = [], moduleCount = 0; var scripts = document.getElementsByTagName('script'); for (var i = 0; i < scripts.length; i++) { var src = scripts[i].src; if (src.indexOf('/plugin.dev.js') != -1) { baseDir = src.substring(0, src.lastIndexOf('/')); } } function require(ids, callback) { var module, defs = []; for (var i = 0; i < ids.length; ++i) { module = modules[ids[i]] || resolve(ids[i]); if (!module) { throw 'module definition dependecy not found: ' + ids[i]; } defs.push(module); } callback.apply(null, defs); } function resolve(id) { var target = exports; var fragments = id.split(/[.\/]/); for (var fi = 0; fi < fragments.length; ++fi) { if (!target[fragments[fi]]) { return; } target = target[fragments[fi]]; } return target; } function register(id) { var target = exports; var fragments = id.split(/[.\/]/); for (var fi = 0; fi < fragments.length - 1; ++fi) { if (target[fragments[fi]] === undefined) { target[fragments[fi]] = {}; } target = target[fragments[fi]]; } target[fragments[fragments.length - 1]] = modules[id]; } function define(id, dependencies, definition) { if (typeof id !== 'string') { throw 'invalid module definition, module id must be defined and be a string'; } if (dependencies === undefined) { throw 'invalid module definition, dependencies must be specified'; } if (definition === undefined) { throw 'invalid module definition, definition function must be specified'; } require(dependencies, function() { modules[id] = definition.apply(null, arguments); }); if (--moduleCount === 0) { for (var i = 0; i < exposedModules.length; i++) { register(exposedModules[i]); } } } function expose(ids) { exposedModules = ids; } function writeScripts() { document.write(html); } function load(path) { html += '<script type="text/javascript" src="' + baseDir + '/' + path + '"></script>\n'; moduleCount++; } // Expose globally exports.define = define; exports.require = require; expose(["tinymce/pasteplugin/Utils","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks","tinymce/pasteplugin/Plugin"]); load('classes/Utils.js'); load('classes/Clipboard.js'); load('classes/WordFilter.js'); load('classes/Quirks.js'); load('classes/Plugin.js'); writeScripts(); })(this); // $hash: 2ed3f236ed86bb232191bb65a107358a
{ "content_hash": "070f3b0c3c806101cccedb57c65815e1", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 162, "avg_line_length": 23.133333333333333, "alnum_prop": 0.6412103746397695, "repo_name": "yurchakaleksey/BlogProject", "id": "204fb4c47bb95af452bdb64e175de700d661f39e", "size": "2776", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "BlogSolution/BlogProject/Scripts/tiny_mce/plugins/paste/plugin.dev.js", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "102" }, { "name": "C#", "bytes": "50438" }, { "name": "CSS", "bytes": "141926" }, { "name": "JavaScript", "bytes": "2233618" }, { "name": "PHP", "bytes": "25856" }, { "name": "Pascal", "bytes": "1877" }, { "name": "PowerShell", "bytes": "3137" } ], "symlink_target": "" }
#include <linux/module.h> #include <linux/pci.h> #include <linux/device.h> #include "internal.h" static struct dw_dma_platform_data dw_pci_pdata = { .is_private = 1, .chan_allocation_order = CHAN_ALLOCATION_ASCENDING, .chan_priority = CHAN_PRIORITY_ASCENDING, }; static int dw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid) { struct dw_dma_chip *chip; struct dw_dma_platform_data *pdata = (void *)pid->driver_data; int ret; ret = pcim_enable_device(pdev); if (ret) return ret; ret = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev)); if (ret) { dev_err(&pdev->dev, "I/O memory remapping failed\n"); return ret; } pci_set_master(pdev); pci_try_set_mwi(pdev); ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); if (ret) return ret; ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); if (ret) return ret; chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); if (!chip) return -ENOMEM; chip->dev = &pdev->dev; chip->regs = pcim_iomap_table(pdev)[0]; chip->irq = pdev->irq; ret = dw_dma_probe(chip, pdata); if (ret) return ret; pci_set_drvdata(pdev, chip); return 0; } static void dw_pci_remove(struct pci_dev *pdev) { struct dw_dma_chip *chip = pci_get_drvdata(pdev); int ret; ret = dw_dma_remove(chip); if (ret) dev_warn(&pdev->dev, "can't remove device properly: %d\n", ret); } #ifdef CONFIG_PM_SLEEP static int dw_pci_suspend_late(struct device *dev) { struct pci_dev *pci = to_pci_dev(dev); struct dw_dma_chip *chip = pci_get_drvdata(pci); return dw_dma_disable(chip); }; static int dw_pci_resume_early(struct device *dev) { struct pci_dev *pci = to_pci_dev(dev); struct dw_dma_chip *chip = pci_get_drvdata(pci); return dw_dma_enable(chip); }; #endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops dw_pci_dev_pm_ops = { SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_pci_suspend_late, dw_pci_resume_early) }; static const struct pci_device_id dw_pci_id_table[] = { /* Medfield */ { PCI_VDEVICE(INTEL, 0x0827), (kernel_ulong_t)&dw_pci_pdata }, { PCI_VDEVICE(INTEL, 0x0830), (kernel_ulong_t)&dw_pci_pdata }, /* BayTrail */ { PCI_VDEVICE(INTEL, 0x0f06), (kernel_ulong_t)&dw_pci_pdata }, { PCI_VDEVICE(INTEL, 0x0f40), (kernel_ulong_t)&dw_pci_pdata }, /* Braswell */ { PCI_VDEVICE(INTEL, 0x2286), (kernel_ulong_t)&dw_pci_pdata }, { PCI_VDEVICE(INTEL, 0x22c0), (kernel_ulong_t)&dw_pci_pdata }, /* Haswell */ { PCI_VDEVICE(INTEL, 0x9c60), (kernel_ulong_t)&dw_pci_pdata }, { } }; MODULE_DEVICE_TABLE(pci, dw_pci_id_table); static struct pci_driver dw_pci_driver = { .name = "dw_dmac_pci", .id_table = dw_pci_id_table, .probe = dw_pci_probe, .remove = dw_pci_remove, .driver = { .pm = &dw_pci_dev_pm_ops, }, }; module_pci_driver(dw_pci_driver); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller PCI driver"); MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
{ "content_hash": "966d7a66bc551f021d1c74c5c9650b8f", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 78, "avg_line_length": 23.238095238095237, "alnum_prop": 0.6680327868852459, "repo_name": "publicloudapp/csrutil", "id": "b144706b3d857443945f58a2d0d3fb23a98e74cf", "size": "3287", "binary": false, "copies": "1151", "ref": "refs/heads/master", "path": "linux-4.3/drivers/dma/dw/pci.c", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "3984" }, { "name": "Awk", "bytes": "29136" }, { "name": "C", "bytes": "532969471" }, { "name": "C++", "bytes": "3352303" }, { "name": "Clojure", "bytes": "1489" }, { "name": "Cucumber", "bytes": "4701" }, { "name": "Groff", "bytes": "46775" }, { "name": "Lex", "bytes": "55199" }, { "name": "Makefile", "bytes": "1576284" }, { "name": "Objective-C", "bytes": "521540" }, { "name": "Perl", "bytes": "715196" }, { "name": "Perl6", "bytes": "3783" }, { "name": "Python", "bytes": "273092" }, { "name": "Shell", "bytes": "343618" }, { "name": "SourcePawn", "bytes": "4687" }, { "name": "UnrealScript", "bytes": "12797" }, { "name": "XS", "bytes": "1239" }, { "name": "Yacc", "bytes": "114559" } ], "symlink_target": "" }
using System; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; using Azure.ResourceManager.Sql.Models; namespace Azure.ResourceManager.Sql { public partial class SyncGroupData : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); if (Optional.IsDefined(Sku)) { writer.WritePropertyName("sku"); writer.WriteObjectValue(Sku); } writer.WritePropertyName("properties"); writer.WriteStartObject(); if (Optional.IsDefined(Interval)) { writer.WritePropertyName("interval"); writer.WriteNumberValue(Interval.Value); } if (Optional.IsDefined(ConflictResolutionPolicy)) { writer.WritePropertyName("conflictResolutionPolicy"); writer.WriteStringValue(ConflictResolutionPolicy.Value.ToString()); } if (Optional.IsDefined(SyncDatabaseId)) { writer.WritePropertyName("syncDatabaseId"); writer.WriteStringValue(SyncDatabaseId); } if (Optional.IsDefined(HubDatabaseUserName)) { writer.WritePropertyName("hubDatabaseUserName"); writer.WriteStringValue(HubDatabaseUserName); } if (Optional.IsDefined(HubDatabasePassword)) { writer.WritePropertyName("hubDatabasePassword"); writer.WriteStringValue(HubDatabasePassword); } if (Optional.IsDefined(Schema)) { writer.WritePropertyName("schema"); writer.WriteObjectValue(Schema); } if (Optional.IsDefined(IsConflictLoggingEnabled)) { writer.WritePropertyName("enableConflictLogging"); writer.WriteBooleanValue(IsConflictLoggingEnabled.Value); } if (Optional.IsDefined(ConflictLoggingRetentionInDays)) { writer.WritePropertyName("conflictLoggingRetentionInDays"); writer.WriteNumberValue(ConflictLoggingRetentionInDays.Value); } if (Optional.IsDefined(UsePrivateLinkConnection)) { writer.WritePropertyName("usePrivateLinkConnection"); writer.WriteBooleanValue(UsePrivateLinkConnection.Value); } writer.WriteEndObject(); writer.WriteEndObject(); } internal static SyncGroupData DeserializeSyncGroupData(JsonElement element) { Optional<SqlSku> sku = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional<SystemData> systemData = default; Optional<int> interval = default; Optional<DateTimeOffset> lastSyncTime = default; Optional<SyncConflictResolutionPolicy> conflictResolutionPolicy = default; Optional<ResourceIdentifier> syncDatabaseId = default; Optional<string> hubDatabaseUserName = default; Optional<string> hubDatabasePassword = default; Optional<SyncGroupState> syncState = default; Optional<SyncGroupSchema> schema = default; Optional<bool> enableConflictLogging = default; Optional<int> conflictLoggingRetentionInDays = default; Optional<bool> usePrivateLinkConnection = default; Optional<string> privateEndpointName = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = SqlSku.DeserializeSqlSku(property.Value); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = new ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("systemData")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } systemData = JsonSerializer.Deserialize<SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("interval")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } interval = property0.Value.GetInt32(); continue; } if (property0.NameEquals("lastSyncTime")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } lastSyncTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("conflictResolutionPolicy")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } conflictResolutionPolicy = new SyncConflictResolutionPolicy(property0.Value.GetString()); continue; } if (property0.NameEquals("syncDatabaseId")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } syncDatabaseId = new ResourceIdentifier(property0.Value.GetString()); continue; } if (property0.NameEquals("hubDatabaseUserName")) { hubDatabaseUserName = property0.Value.GetString(); continue; } if (property0.NameEquals("hubDatabasePassword")) { hubDatabasePassword = property0.Value.GetString(); continue; } if (property0.NameEquals("syncState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } syncState = new SyncGroupState(property0.Value.GetString()); continue; } if (property0.NameEquals("schema")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } schema = SyncGroupSchema.DeserializeSyncGroupSchema(property0.Value); continue; } if (property0.NameEquals("enableConflictLogging")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } enableConflictLogging = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("conflictLoggingRetentionInDays")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } conflictLoggingRetentionInDays = property0.Value.GetInt32(); continue; } if (property0.NameEquals("usePrivateLinkConnection")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } usePrivateLinkConnection = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("privateEndpointName")) { privateEndpointName = property0.Value.GetString(); continue; } } continue; } } return new SyncGroupData(id, name, type, systemData.Value, sku.Value, Optional.ToNullable(interval), Optional.ToNullable(lastSyncTime), Optional.ToNullable(conflictResolutionPolicy), syncDatabaseId.Value, hubDatabaseUserName.Value, hubDatabasePassword.Value, Optional.ToNullable(syncState), schema.Value, Optional.ToNullable(enableConflictLogging), Optional.ToNullable(conflictLoggingRetentionInDays), Optional.ToNullable(usePrivateLinkConnection), privateEndpointName.Value); } } }
{ "content_hash": "405215484ad24e505517c8798281e041", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 488, "avg_line_length": 46.34817813765182, "alnum_prop": 0.4692522711390636, "repo_name": "Azure/azure-sdk-for-net", "id": "1fada160637e31835ba728b8bcb29df65fecc8eb", "size": "11586", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SyncGroupData.Serialization.cs", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
 #pragma once #include <aws/ssm-contacts/SSMContacts_EXPORTS.h> #include <aws/ssm-contacts/SSMContactsRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace SSMContacts { namespace Model { /** */ class AWS_SSMCONTACTS_API ListContactChannelsRequest : public SSMContactsRequest { public: ListContactChannelsRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "ListContactChannels"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>The Amazon Resource Name (ARN) of the contact. </p> */ inline const Aws::String& GetContactId() const{ return m_contactId; } /** * <p>The Amazon Resource Name (ARN) of the contact. </p> */ inline bool ContactIdHasBeenSet() const { return m_contactIdHasBeenSet; } /** * <p>The Amazon Resource Name (ARN) of the contact. </p> */ inline void SetContactId(const Aws::String& value) { m_contactIdHasBeenSet = true; m_contactId = value; } /** * <p>The Amazon Resource Name (ARN) of the contact. </p> */ inline void SetContactId(Aws::String&& value) { m_contactIdHasBeenSet = true; m_contactId = std::move(value); } /** * <p>The Amazon Resource Name (ARN) of the contact. </p> */ inline void SetContactId(const char* value) { m_contactIdHasBeenSet = true; m_contactId.assign(value); } /** * <p>The Amazon Resource Name (ARN) of the contact. </p> */ inline ListContactChannelsRequest& WithContactId(const Aws::String& value) { SetContactId(value); return *this;} /** * <p>The Amazon Resource Name (ARN) of the contact. </p> */ inline ListContactChannelsRequest& WithContactId(Aws::String&& value) { SetContactId(std::move(value)); return *this;} /** * <p>The Amazon Resource Name (ARN) of the contact. </p> */ inline ListContactChannelsRequest& WithContactId(const char* value) { SetContactId(value); return *this;} /** * <p>The pagination token to continue to the next page of results.</p> */ inline const Aws::String& GetNextToken() const{ return m_nextToken; } /** * <p>The pagination token to continue to the next page of results.</p> */ inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; } /** * <p>The pagination token to continue to the next page of results.</p> */ inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; } /** * <p>The pagination token to continue to the next page of results.</p> */ inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); } /** * <p>The pagination token to continue to the next page of results.</p> */ inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); } /** * <p>The pagination token to continue to the next page of results.</p> */ inline ListContactChannelsRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;} /** * <p>The pagination token to continue to the next page of results.</p> */ inline ListContactChannelsRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;} /** * <p>The pagination token to continue to the next page of results.</p> */ inline ListContactChannelsRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;} /** * <p>The maximum number of contact channels per page.</p> */ inline int GetMaxResults() const{ return m_maxResults; } /** * <p>The maximum number of contact channels per page.</p> */ inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; } /** * <p>The maximum number of contact channels per page.</p> */ inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; } /** * <p>The maximum number of contact channels per page.</p> */ inline ListContactChannelsRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;} private: Aws::String m_contactId; bool m_contactIdHasBeenSet; Aws::String m_nextToken; bool m_nextTokenHasBeenSet; int m_maxResults; bool m_maxResultsHasBeenSet; }; } // namespace Model } // namespace SSMContacts } // namespace Aws
{ "content_hash": "57f68f405e0fe856e47197d83e8424dc", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 122, "avg_line_length": 33.02, "alnum_prop": 0.6684837472239047, "repo_name": "cedral/aws-sdk-cpp", "id": "3430b1b250e7eb02d90bd52b281334538ef4f044", "size": "5072", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "aws-cpp-sdk-ssm-contacts/include/aws/ssm-contacts/model/ListContactChannelsRequest.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "294220" }, { "name": "C++", "bytes": "428637022" }, { "name": "CMake", "bytes": "862025" }, { "name": "Dockerfile", "bytes": "11688" }, { "name": "HTML", "bytes": "7904" }, { "name": "Java", "bytes": "352201" }, { "name": "Python", "bytes": "106761" }, { "name": "Shell", "bytes": "10891" } ], "symlink_target": "" }
/*! * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=b3e201f5cb6b2a891ed7) * Config saved to config.json and https://gist.github.com/b3e201f5cb6b2a891ed7 */ .btn-default, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger { text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); } .btn-default:active, .btn-primary:active, .btn-success:active, .btn-info:active, .btn-warning:active, .btn-danger:active, .btn-default.active, .btn-primary.active, .btn-success.active, .btn-info.active, .btn-warning.active, .btn-danger.active { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn:active, .btn.active { background-image: none; } .btn-default { background-image: -webkit-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); background-image: -o-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); background-image: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); background-repeat: repeat-x; border-color: #dbdbdb; text-shadow: 0 1px 0 #fff; border-color: #ccc; } .btn-default:hover, .btn-default:focus { background-color: #e0e0e0; background-position: 0 -15px; } .btn-default:active, .btn-default.active { background-color: #e0e0e0; border-color: #dbdbdb; } .btn-default:disabled, .btn-default[disabled] { background-color: #e0e0e0; background-image: none; } .btn-primary { background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%); background-image: -o-linear-gradient(top, #428bca 0%, #2d6ca2 100%); background-image: linear-gradient(to bottom, #428bca 0%, #2d6ca2 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); background-repeat: repeat-x; border-color: #2b669a; } .btn-primary:hover, .btn-primary:focus { background-color: #2d6ca2; background-position: 0 -15px; } .btn-primary:active, .btn-primary.active { background-color: #2d6ca2; border-color: #2b669a; } .btn-primary:disabled, .btn-primary[disabled] { background-color: #2d6ca2; background-image: none; } .btn-success { background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%); background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%); background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); background-repeat: repeat-x; border-color: #3e8f3e; } .btn-success:hover, .btn-success:focus { background-color: #419641; background-position: 0 -15px; } .btn-success:active, .btn-success.active { background-color: #419641; border-color: #3e8f3e; } .btn-success:disabled, .btn-success[disabled] { background-color: #419641; background-image: none; } .btn-info { background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); background-repeat: repeat-x; border-color: #28a4c9; } .btn-info:hover, .btn-info:focus { background-color: #2aabd2; background-position: 0 -15px; } .btn-info:active, .btn-info.active { background-color: #2aabd2; border-color: #28a4c9; } .btn-info:disabled, .btn-info[disabled] { background-color: #2aabd2; background-image: none; } .btn-warning { background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); background-repeat: repeat-x; border-color: #e38d13; } .btn-warning:hover, .btn-warning:focus { background-color: #eb9316; background-position: 0 -15px; } .btn-warning:active, .btn-warning.active { background-color: #eb9316; border-color: #e38d13; } .btn-warning:disabled, .btn-warning[disabled] { background-color: #eb9316; background-image: none; } .btn-danger { background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%); background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%); background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); background-repeat: repeat-x; border-color: #b92c28; } .btn-danger:hover, .btn-danger:focus { background-color: #c12e2a; background-position: 0 -15px; } .btn-danger:active, .btn-danger.active { background-color: #c12e2a; border-color: #b92c28; } .btn-danger:disabled, .btn-danger[disabled] { background-color: #c12e2a; background-image: none; } .thumbnail, .img-thumbnail { -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); background-color: #e8e8e8; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); background-image: -o-linear-gradient(top, #428bca 0%, #357ebd 100%); background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); background-color: #357ebd; } .navbar-default { background-image: -webkit-linear-gradient(top, #ffffff 0%, #f8f8f8 100%); background-image: -o-linear-gradient(top, #ffffff 0%, #f8f8f8 100%); background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); border-radius: 4px; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); } .navbar-default .navbar-nav > .active > a { background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%); background-image: -o-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%); background-image: linear-gradient(to bottom, #ebebeb 0%, #f3f3f3 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0); -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); } .navbar-brand, .navbar-nav > li > a { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); } .navbar-inverse { background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222222 100%); background-image: -o-linear-gradient(top, #3c3c3c 0%, #222222 100%); background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .navbar-inverse .navbar-nav > .active > a { background-image: -webkit-linear-gradient(top, #222222 0%, #282828 100%); background-image: -o-linear-gradient(top, #222222 0%, #282828 100%); background-image: linear-gradient(to bottom, #222222 0%, #282828 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0); -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); } .navbar-inverse .navbar-brand, .navbar-inverse .navbar-nav > li > a { text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .navbar-static-top, .navbar-fixed-top, .navbar-fixed-bottom { border-radius: 0; } .alert { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2); -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); } .alert-success { background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); border-color: #b2dba1; } .alert-info { background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%); background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); border-color: #9acfea; } .alert-warning { background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); border-color: #f5e79e; } .alert-danger { background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); border-color: #dca7a7; } .progress { background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); } .progress-bar { background-image: -webkit-linear-gradient(top, #428bca 0%, #3071a9 100%); background-image: -o-linear-gradient(top, #428bca 0%, #3071a9 100%); background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0); } .progress-bar-success { background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%); background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); } .progress-bar-info { background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); } .progress-bar-warning { background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); } .progress-bar-danger { background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%); background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); } .progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .list-group { border-radius: 4px; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { text-shadow: 0 -1px 0 #3071a9; background-image: -webkit-linear-gradient(top, #428bca 0%, #3278b3 100%); background-image: -o-linear-gradient(top, #428bca 0%, #3278b3 100%); background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0); border-color: #3278b3; } .panel { -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); } .panel-default > .panel-heading { background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); } .panel-primary > .panel-heading { background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); background-image: -o-linear-gradient(top, #428bca 0%, #357ebd 100%); background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); } .panel-success > .panel-heading { background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); } .panel-info > .panel-heading { background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); } .panel-warning > .panel-heading { background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); } .panel-danger > .panel-heading { background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%); background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); } .well { background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); border-color: #dcdcdc; -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); }
{ "content_hash": "956ee58a5117f7910789d8b03640fbba", "timestamp": "", "source": "github", "line_count": 411, "max_line_length": 208, "avg_line_length": 43.89537712895377, "alnum_prop": 0.7180865805664874, "repo_name": "jcalixte/Protimbre", "id": "5a4adf52a201c163c363b42ad19b7cc32203a166", "size": "18209", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/css/css/bootstrap-theme.css", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "2643" }, { "name": "CSS", "bytes": "192094" }, { "name": "HTML", "bytes": "2109838" }, { "name": "JavaScript", "bytes": "290493" }, { "name": "PHP", "bytes": "159478" }, { "name": "Ruby", "bytes": "861" } ], "symlink_target": "" }
package org.springframework.web.client; public class RestTemplate { public <T> T getForObject(java.lang.String url, java.lang.Class<T> responseType, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> T getForObject(java.lang.String url, java.lang.Class<T> responseType, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> T getForObject(java.net.URI url, java.lang.Class<T> responseType) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> getForEntity(java.lang.String url, java.lang.Class<T> responseType, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> getForEntity(java.lang.String url, java.lang.Class<T> responseType, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> getForEntity(java.net.URI url, java.lang.Class<T> responseType) throws org.springframework.web.client.RestClientException { return null; } public org.springframework.http.HttpHeaders headForHeaders(java.lang.String url, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public org.springframework.http.HttpHeaders headForHeaders(java.lang.String url, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public org.springframework.http.HttpHeaders headForHeaders(java.net.URI url) throws org.springframework.web.client.RestClientException { return null; } public java.net.URI postForLocation(java.lang.String url, java.lang.Object request, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public java.net.URI postForLocation(java.lang.String url, java.lang.Object request, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public java.net.URI postForLocation(java.net.URI url, java.lang.Object request) throws org.springframework.web.client.RestClientException { return null; } public <T> T postForObject(java.lang.String url, java.lang.Object request, java.lang.Class<T> responseType, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> T postForObject(java.lang.String url, java.lang.Object request, java.lang.Class<T> responseType, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> T postForObject(java.net.URI url, java.lang.Object request, java.lang.Class<T> responseType) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> postForEntity(java.lang.String url, java.lang.Object request, java.lang.Class<T> responseType, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> postForEntity(java.lang.String url, java.lang.Object request, java.lang.Class<T> responseType, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> postForEntity(java.net.URI url, java.lang.Object request, java.lang.Class<T> responseType) throws org.springframework.web.client.RestClientException { return null; } public void put(java.lang.String url, java.lang.Object request, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { } public void put(java.lang.String url, java.lang.Object request, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { } public void put(java.net.URI url, java.lang.Object request) throws org.springframework.web.client.RestClientException { } public <T> T patchForObject(java.lang.String url, java.lang.Object request, java.lang.Class<T> responseType, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> T patchForObject(java.lang.String url, java.lang.Object request, java.lang.Class<T> responseType, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> T patchForObject(java.net.URI url, java.lang.Object request, java.lang.Class<T> responseType) throws org.springframework.web.client.RestClientException { return null; } public void delete(java.lang.String url, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { } public void delete(java.lang.String url, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { } public void delete(java.net.URI url) throws org.springframework.web.client.RestClientException { } public java.util.Set<org.springframework.http.HttpMethod> optionsForAllow(java.lang.String url, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public java.util.Set<org.springframework.http.HttpMethod> optionsForAllow(java.lang.String url, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public java.util.Set<org.springframework.http.HttpMethod> optionsForAllow(java.net.URI url) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> exchange(java.lang.String url, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, java.lang.Class<T> responseType, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> exchange(java.lang.String url, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, java.lang.Class<T> responseType, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> exchange(java.net.URI url, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, java.lang.Class<T> responseType) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> exchange(java.lang.String url, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, org.springframework.core.ParameterizedTypeReference<T> responseType, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> exchange(java.lang.String url, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, org.springframework.core.ParameterizedTypeReference<T> responseType, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> exchange(java.net.URI url, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, org.springframework.core.ParameterizedTypeReference<T> responseType) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> exchange( org.springframework.http.RequestEntity<?> requestEntity, java.lang.Class<T> responseType) throws org.springframework.web.client.RestClientException { return null; } public <T> org.springframework.http.ResponseEntity<T> exchange( org.springframework.http.RequestEntity<?> requestEntity, org.springframework.core.ParameterizedTypeReference<T> responseType) throws org.springframework.web.client.RestClientException { return null; } public <T> T execute(java.lang.String url, org.springframework.http.HttpMethod method, org.springframework.web.client.RequestCallback requestCallback, org.springframework.web.client.ResponseExtractor<T> responseExtractor, java.lang.Object... uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> T execute(java.lang.String url, org.springframework.http.HttpMethod method, org.springframework.web.client.RequestCallback requestCallback, org.springframework.web.client.ResponseExtractor<T> responseExtractor, java.util.Map<java.lang.String, ?> uriVariables) throws org.springframework.web.client.RestClientException { return null; } public <T> T execute(java.net.URI url, org.springframework.http.HttpMethod method, org.springframework.web.client.RequestCallback requestCallback, org.springframework.web.client.ResponseExtractor<T> responseExtractor) throws org.springframework.web.client.RestClientException { return null; } protected <T> T doExecute(java.net.URI url, org.springframework.http.HttpMethod method, org.springframework.web.client.RequestCallback requestCallback, org.springframework.web.client.ResponseExtractor<T> responseExtractor) throws org.springframework.web.client.RestClientException { return null; } protected void handleResponse(java.net.URI url, org.springframework.http.HttpMethod method, org.springframework.http.client.ClientHttpResponse response) throws java.io.IOException { } }
{ "content_hash": "71b540ddb63d8e558ea38f6b39ac9a92", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 120, "avg_line_length": 47.620253164556964, "alnum_prop": 0.7100832890306574, "repo_name": "github/codeql", "id": "79f8feaa4aa1a341346d708b947215022430b096", "size": "11286", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "java/ql/test/stubs/springframework-5.3.8/org/springframework/web/client/RestTemplate.java", "mode": "33188", "license": "mit", "language": [ { "name": "ASP.NET", "bytes": "3739" }, { "name": "Batchfile", "bytes": "3534" }, { "name": "C", "bytes": "410440" }, { "name": "C#", "bytes": "21146000" }, { "name": "C++", "bytes": "1352639" }, { "name": "CMake", "bytes": "1809" }, { "name": "CodeQL", "bytes": "32583145" }, { "name": "Dockerfile", "bytes": "496" }, { "name": "EJS", "bytes": "1478" }, { "name": "Emacs Lisp", "bytes": "3445" }, { "name": "Go", "bytes": "697562" }, { "name": "HTML", "bytes": "58008" }, { "name": "Handlebars", "bytes": "1000" }, { "name": "Java", "bytes": "5417683" }, { "name": "JavaScript", "bytes": "2432320" }, { "name": "Kotlin", "bytes": "12163740" }, { "name": "Lua", "bytes": "13113" }, { "name": "Makefile", "bytes": "8631" }, { "name": "Mustache", "bytes": "17025" }, { "name": "Nunjucks", "bytes": "923" }, { "name": "Perl", "bytes": "1941" }, { "name": "PowerShell", "bytes": "1295" }, { "name": "Python", "bytes": "1649035" }, { "name": "RAML", "bytes": "2825" }, { "name": "Ruby", "bytes": "299268" }, { "name": "Rust", "bytes": "234024" }, { "name": "Shell", "bytes": "23973" }, { "name": "Smalltalk", "bytes": "23" }, { "name": "Starlark", "bytes": "27062" }, { "name": "Swift", "bytes": "204309" }, { "name": "Thrift", "bytes": "3020" }, { "name": "TypeScript", "bytes": "219623" }, { "name": "Vim Script", "bytes": "1949" }, { "name": "Vue", "bytes": "2881" } ], "symlink_target": "" }
/** */ package visualizacionMetricas3; import org.eclipse.emf.common.util.EList; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Arco</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link visualizacionMetricas3.Arco#getTarget <em>Target</em>}</li> * <li>{@link visualizacionMetricas3.Arco#getTipos <em>Tipos</em>}</li> * <li>{@link visualizacionMetricas3.Arco#getSource <em>Source</em>}</li> * </ul> * </p> * * @see visualizacionMetricas3.VisualizacionMetricas3Package#getArco() * @model * @generated */ public interface Arco extends Medible { /** * Returns the value of the '<em><b>Target</b></em>' reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Target</em>' reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Target</em>' reference. * @see #setTarget(Elemento) * @see visualizacionMetricas3.VisualizacionMetricas3Package#getArco_Target() * @model required="true" * @generated */ Elemento getTarget(); /** * Sets the value of the '{@link visualizacionMetricas3.Arco#getTarget <em>Target</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Target</em>' reference. * @see #getTarget() * @generated */ void setTarget(Elemento value); /** * Returns the value of the '<em><b>Tipos</b></em>' reference list. * The list contents are of type {@link visualizacionMetricas3.TipoRelacion}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Tipos</em>' reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Tipos</em>' reference list. * @see visualizacionMetricas3.VisualizacionMetricas3Package#getArco_Tipos() * @model required="true" * @generated */ EList<TipoRelacion> getTipos(); /** * Returns the value of the '<em><b>Source</b></em>' reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Source</em>' reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Source</em>' reference. * @see #setSource(Elemento) * @see visualizacionMetricas3.VisualizacionMetricas3Package#getArco_Source() * @model required="true" * @generated */ Elemento getSource(); /** * Sets the value of the '{@link visualizacionMetricas3.Arco#getSource <em>Source</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Source</em>' reference. * @see #getSource() * @generated */ void setSource(Elemento value); } // Arco
{ "content_hash": "df29e996f55856e858ab14773147713d", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 100, "avg_line_length": 30.24468085106383, "alnum_prop": 0.6422792824481182, "repo_name": "lfmendivelso10/AppModernization", "id": "0ae561a03a0d2abcb4c763cfaf2250d9e2d08e9d", "size": "2843", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "source/i1/VisualizacionMetricas3/src/visualizacionMetricas3/Arco.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1018" }, { "name": "Java", "bytes": "4283110" } ], "symlink_target": "" }
module.exports = header: 'JMX Exporter Zookeeper Check', handler: ({options}) -> ## Check Port @connection.assert header: 'TCP' servers: options.wait.jmx retry: 3 sleep: 3000
{ "content_hash": "4682834c201ceb7f103473f6cfa289a7", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 84, "avg_line_length": 24.333333333333332, "alnum_prop": 0.5844748858447488, "repo_name": "ryba-io/ryba", "id": "0055b38f8cdf9ef8ee232d231591a48600012da7", "size": "248", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/storage/prometheus/jmx_exporters/zookeeper/check.coffee.md", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1369" }, { "name": "CoffeeScript", "bytes": "3043018" }, { "name": "Dockerfile", "bytes": "9195" }, { "name": "JavaScript", "bytes": "589" }, { "name": "Jinja", "bytes": "1829220" }, { "name": "PHP", "bytes": "61968" }, { "name": "Perl", "bytes": "2767" }, { "name": "Python", "bytes": "16567" }, { "name": "Shell", "bytes": "278026" }, { "name": "XSLT", "bytes": "548" } ], "symlink_target": "" }
namespace ash { namespace { const gfx::ImageSkia* GetImageForResourceId(int resource_id) { ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); return bundle.GetImageNamed(resource_id).ToImageSkia(); } } // namespace // static const char TrayPopupHeaderButton::kViewClassName[] = "tray/TrayPopupHeaderButton"; TrayPopupHeaderButton::TrayPopupHeaderButton(views::ButtonListener* listener, const gfx::ImageSkia& icon, int accessible_name_id) : views::ToggleImageButton(listener) { Initialize(icon, accessible_name_id); } TrayPopupHeaderButton::TrayPopupHeaderButton(views::ButtonListener* listener, int enabled_resource_id, int disabled_resource_id, int enabled_resource_id_hover, int disabled_resource_id_hover, int accessible_name_id) : views::ToggleImageButton(listener) { Initialize(*GetImageForResourceId(enabled_resource_id), accessible_name_id); ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); SetToggledImage(views::Button::STATE_NORMAL, bundle.GetImageNamed(disabled_resource_id).ToImageSkia()); SetImage(views::Button::STATE_HOVERED, *bundle.GetImageNamed(enabled_resource_id_hover).ToImageSkia()); SetToggledImage( views::Button::STATE_HOVERED, bundle.GetImageNamed(disabled_resource_id_hover).ToImageSkia()); } TrayPopupHeaderButton::~TrayPopupHeaderButton() {} const char* TrayPopupHeaderButton::GetClassName() const { return kViewClassName; } gfx::Size TrayPopupHeaderButton::GetPreferredSize() const { int size = GetTrayConstant(TRAY_POPUP_ITEM_MIN_HEIGHT); return gfx::Size(size, size); } void TrayPopupHeaderButton::StateChanged() { if (state() == STATE_HOVERED || state() == STATE_PRESSED) { set_background(views::Background::CreateSolidBackground( kTrayPopupHoverBackgroundColor)); } else { set_background(nullptr); } SchedulePaint(); } void TrayPopupHeaderButton::Initialize(const gfx::ImageSkia& icon, int accessible_name_id) { ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); SetImage(views::Button::STATE_NORMAL, icon); SetImageAlignment(views::ImageButton::ALIGN_CENTER, views::ImageButton::ALIGN_MIDDLE); SetAccessibleName(bundle.GetLocalizedString(accessible_name_id)); SetFocusForPlatform(); SetFocusPainter(views::Painter::CreateSolidFocusPainter( kFocusBorderColor, gfx::Insets(1, 2, 2, 3))); } } // namespace ash
{ "content_hash": "fe566c3017e7a039cdc8c26282e5b4df", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 78, "avg_line_length": 37.42666666666667, "alnum_prop": 0.651585322408265, "repo_name": "google-ar/WebARonARCore", "id": "576ec92e3e73d70329387d554b9fba8c3a99cdd9", "size": "3234", "binary": false, "copies": "1", "ref": "refs/heads/webarcore_57.0.2987.5", "path": "ash/common/system/tray/tray_popup_header_button.cc", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace SharpRL.Examples.TicTacToe { /// <summary> /// Represents a Tic-tac-toe game /// </summary> public partial class TicTacToeGame : Form { private PictureBox[,] tiles; private GameMode gameMode = GameMode.RL; private RLGame rlGame; private Game minimaxGame; private bool isOver = false; /// <summary> /// The game mode /// </summary> public enum GameMode { RL, Minimax } /// <summary> /// Represents a RL based game /// </summary> private class RLGame { public BoardAgent Agent { get; set; } public BoardEnvironment Environment { get; set; } } /// <summary> /// Creates a new Tic-tac-toe game /// </summary> public TicTacToeGame() { InitializeComponent(); this.tiles = new PictureBox[3, 3]; this.tiles[0, 0] = this.pos11Box; this.tiles[0, 1] = this.pos12Box; this.tiles[0, 2] = this.pos13Box; this.tiles[1, 0] = this.pos21Box; this.tiles[1, 1] = this.pos22Box; this.tiles[1, 2] = this.pos23Box; this.tiles[2, 0] = this.pos31Box; this.tiles[2, 1] = this.pos32Box; this.tiles[2, 2] = this.pos33Box; switch (this.gameMode) { case GameMode.RL: this.CreateRLGame(); break; case GameMode.Minimax: this.CreateMinimaxGame(); break; } this.StartGame(); this.ResetButton.Click += (sender, e) => { this.StartGame(); }; for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { int posX = x; int posY = y; this.tiles[x, y].Click += (sender, e) => { if (!this.isOver) { switch (this.gameMode) { case GameMode.RL: this.MakeRLMove(posX, posY); break; case GameMode.Minimax: this.MakeMinimaxMove(posX, posY); break; } } }; } } } /// <summary> /// Creates a RL based game /// </summary> private void CreateRLGame() { this.rlGame = new RLGame(); this.rlGame.Environment = new BoardEnvironment(new Configuration(50000)); this.rlGame.Environment.TrainingStrategy = new MinimaxStrategy(); this.rlGame.Agent = new BoardAgent(BoardTileType.Circle); this.rlGame.Environment.AddAgent(this.rlGame.Agent); this.rlGame.Environment.Initialize(); this.Train(this.rlGame.Environment); this.rlGame.Agent.Learner.FollowPolicy = true; this.rlGame.Environment.TrainingStrategy = null; } /// <summary> /// Creates a minimax based game /// </summary> private void CreateMinimaxGame() { this.minimaxGame = new Game(); } /// <summary> /// Starts the game /// </summary> private void StartGame() { this.isOver = false; this.StatusLabel.Text = "Playing."; switch (this.gameMode) { case GameMode.RL: this.rlGame.Environment.Reset(0); this.rlGame.Environment.Update(0); break; case GameMode.Minimax: this.minimaxGame = new Game(); break; } this.DrawWorld(); } /// <summary> /// Makes a move in a RL based game /// </summary> /// <param name="x">The x position</param> /// <param name="y">The y position</param> private void MakeRLMove(int x, int y) { if (this.rlGame.Environment.Place(x, y, BoardTileType.Cross)) { var winner = this.rlGame.Environment.IsOver(); //Only make a move if the player did not win if (winner == null) { if (this.rlGame.Environment.Update(0)) { winner = this.rlGame.Environment.IsOver(); } } if (winner != null) { this.GameOver(winner.Value); } this.DrawWorld(); } } /// <summary> /// Makes a move in a minimax based game /// </summary> /// <param name="x">The x position</param> /// <param name="y">The y position</param> private void MakeMinimaxMove(int x, int y) { if (this.minimaxGame.Move(x, y)) { var winner = this.minimaxGame.GetWinner(); //Only make a move if the player did not win if (winner == null) { this.minimaxGame.ComputerMove(); winner = this.minimaxGame.GetWinner(); } if (winner != null) { this.GameOver(winner.Value); } this.DrawWorld(); } } /// <summary> /// Marks that the game is over /// </summary> /// <param name="winner">The winner</param> private void GameOver(GameWinner winner) { this.isOver = true; switch (winner) { case GameWinner.Tie: this.StatusLabel.Text = "The game is over. It's a tie."; break; case GameWinner.Cross: this.StatusLabel.Text = "The game is over. Cross wins."; break; case GameWinner.Circle: this.StatusLabel.Text = "The game is over. Circle wins."; break; } } /// <summary> /// Trains the environment /// </summary> /// <param name="environment">The environment</param> private void Train(BoardEnvironment environment) { for (int episode = 0; episode < environment.Config.MaxEpisodes; episode++) { environment.Reset(episode); while (true) { if (environment.Update(episode)) { break; } } } } /// <summary> /// Draws the world /// </summary> private void DrawWorld() { switch (this.gameMode) { case GameMode.Minimax: this.DrawWorld(this.minimaxGame.Board); break; case GameMode.RL: this.DrawWorld(this.rlGame.Environment.Board); break; } } /// <summary> /// Draws the world /// </summary> /// <param name="board">The board</param> private void DrawWorld(Board board) { foreach (var tile in board.GetTiles()) { var pictureBox = this.tiles[tile.X, tile.Y]; switch (tile.TileType) { case BoardTileType.Empty: pictureBox.Image = new Bitmap(Properties.Resources.Empty); break; case BoardTileType.Cross: pictureBox.Image = new Bitmap(Properties.Resources.Cross ); break; case BoardTileType.Circle: pictureBox.Image = new Bitmap(Properties.Resources.Circle); break; } } } } }
{ "content_hash": "dbe0d0e28243d8631665eb5a2a4df297", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 77, "avg_line_length": 21.422145328719722, "alnum_prop": 0.6112098207074786, "repo_name": "svenslaggare/SharpRL", "id": "0c17151ae25565d4e588d681fd1facf7de57847d", "size": "6193", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SharpRL.Examples/TicTacToe/TicTacToeGame.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "117220" } ], "symlink_target": "" }
@interface DGSuffcientInfoModel : NSObject @property (nonatomic, copy)NSString *card; @property (nonatomic, copy)NSString *handle; @property (nonatomic, copy)NSString *money; @property (nonatomic, copy)NSString *nickname; @property (nonatomic, copy)NSString *operate; @property (nonatomic, copy)NSString *operatePeople; @property (nonatomic, copy)NSString *rechargeTime; @property (nonatomic, copy)NSString *userId; @end @interface DGSuffcientModel : NSObject @property (nonatomic, copy)NSString *status; @property (nonatomic, strong)NSArray *text; @end
{ "content_hash": "8af3bde15acbb59bd1b10a9ce92bfce0", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 51, "avg_line_length": 34.75, "alnum_prop": 0.7877697841726619, "repo_name": "littleHH/DigsGold", "id": "bd8aaab59e55f61d5c72c42e1e30140164e624c1", "size": "732", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DigGold/DigGold/Classes/Home(首页)/Model/Sufficient/DGSuffcientModel.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "9915" }, { "name": "HTML", "bytes": "4556" }, { "name": "Objective-C", "bytes": "3991911" }, { "name": "Ruby", "bytes": "562" }, { "name": "Shell", "bytes": "11434" } ], "symlink_target": "" }
import {Services} from '../../../src/services'; import {dict} from '../../../src/utils/object'; import {getMode} from '../../../src/mode'; import {isExperimentOn} from '../../../src/experiments'; import {iterateCursor, templateContentClone} from '../../../src/dom'; import {parse as mustacheParse, render as mustacheRender, setUnescapedSanitizer} from '../../../third_party/mustache/mustache'; import {purifyHtml, purifyTagsForTripleMustache} from '../../../src/purifier'; /** * Implements an AMP template for Mustache.js. * See {@link https://github.com/janl/mustache.js/}. * * @private Visible for testing. * @extends {BaseTemplate$$module$src$service$template_impl} */ export class AmpMustache extends AMP.BaseTemplate { /** * @param {!Element} element * @param {!Window} win */ constructor(element, win) { super(element, win); // Unescaped templating (triple mustache) has a special, strict sanitizer. setUnescapedSanitizer(value => purifyTagsForTripleMustache(value, this.win.document)); } /** @override */ compileCallback() { // If viewer is renderTemplate capable, skip the handling of the mustache // templates as its rendering is managed by the viewer. This template will // only be responsible for sanitizing and inserting it into the DOM. if (this.viewerCanRenderTemplates()) { return; } /** @private @const {!JsonObject} */ this.nestedTemplates_ = dict(); const content = templateContentClone(this.element); this.processNestedTemplates_(content); const container = this.element.ownerDocument.createElement('div'); container.appendChild(content); /** @private @const {string} */ this.template_ = container./*OK*/innerHTML; mustacheParse(this.template_, /* tags */ undefined); } /** * Stores and replaces nested templates with custom triple-mustache pointers. * * This prevents the outer-most template from replacing variables in nested * templates. Note that this constrains nested template markup to the more * restrictive sanitization rules of triple-mustache. * * @param {!DocumentFragment} content */ processNestedTemplates_(content) { const templates = content.querySelectorAll('template'); iterateCursor(templates, (template, index) => { const key = `__AMP_NESTED_TEMPLATE_${index}`; // Store the nested template markup, keyed by index. this.nestedTemplates_[key] = template./*OK*/outerHTML; // Replace the markup with a pointer. const pointer = this.element.ownerDocument.createTextNode(`{{{${key}}}}`); template.parentNode.replaceChild(pointer, template); }); } /** @override */ setHtml(html) { return this.purifyAndSetHtml_(html); } /** @override */ render(data) { let mustacheData = data; // Also render any nested templates. if (typeof data === 'object') { mustacheData = Object.assign({}, data, this.nestedTemplates_); } const html = mustacheRender(this.template_, mustacheData, /* partials */ undefined); return this.purifyAndSetHtml_(html); } /** * * @param {string} html * @private */ purifyAndSetHtml_(html) { const diffing = isExperimentOn(self, 'amp-list-diffing'); const body = purifyHtml(html, diffing); // TODO(choumx): Remove innerHTML usage once DOMPurify bug is fixed. // https://github.com/cure53/DOMPurify/pull/295 const root = this.win.document.createElement('div'); root./*OK*/innerHTML = body./*OK*/innerHTML; return this.unwrap(root); } } // First, unregister template with same type to avoid "Duplicate template type" // error due to multiple versions of amp-mustache in the same unit test run. // This is due to transpilation of test code to ES5 which uses require() and, // unlike import, causes side effects (AMP.registerTemplate) to be run. // For unit tests, it doesn't actually matter which version of amp-mustache is // registered. Integration tests should only have one script version included. if (getMode().test) { Services.templatesFor(window).unregisterTemplate('amp-mustache'); } AMP.registerTemplate('amp-mustache', AmpMustache);
{ "content_hash": "7ec187ad9b0a560bfb03957c79d86f54", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 80, "avg_line_length": 35.5, "alnum_prop": 0.6860825972785868, "repo_name": "yieldbot/amphtml", "id": "401a6450bb039fe44be6f3a004f5b77f7f81d40c", "size": "4816", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "extensions/amp-mustache/0.2/amp-mustache.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "368336" }, { "name": "Go", "bytes": "7459" }, { "name": "HTML", "bytes": "1463881" }, { "name": "Java", "bytes": "37149" }, { "name": "JavaScript", "bytes": "12909950" }, { "name": "Python", "bytes": "72953" }, { "name": "Shell", "bytes": "15122" }, { "name": "Yacc", "bytes": "22627" } ], "symlink_target": "" }
<!doctype html> <html class="fixed"> <head> <!-- Basic --> <meta charset="UTF-8"> <meta name="keywords" content="HTML5 Admin Template" /> <meta name="description" content="Porto Admin - Responsive HTML5 Template"> <meta name="author" content="okler.net"> <!-- Mobile Metas --> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <!-- Web Fonts --> <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css"> <!-- Vendor CSS --> <link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.css" /> <link rel="stylesheet" href="assets/vendor/font-awesome/css/font-awesome.css" /> <link rel="stylesheet" href="assets/vendor/magnific-popup/magnific-popup.css" /> <link rel="stylesheet" href="assets/vendor/bootstrap-datepicker/css/datepicker3.css" /> <!-- Theme CSS --> <link rel="stylesheet" href="assets/stylesheets/theme.css" /> <!-- Theme Custom CSS --> <link rel="stylesheet" href="assets/stylesheets/theme-custom.css"> <!-- Head Libs --> <script src="assets/vendor/modernizr/modernizr.js"></script> </head> <body> <!-- start: page --> <section class="body-sign body-locked"> <div class="center-sign"> <div class="panel panel-sign"> <div class="panel-body"> <form action="index.html"> <div class="current-user text-center"> <img src="assets/images/!logged-user.jpg" alt="John Doe" class="img-circle user-image" /> <h2 class="user-name text-dark m-none">John Doe</h2> <p class="user-email m-none">johndoe@okler.com</p> </div> <div class="form-group mb-lg"> <div class="input-group input-group-icon"> <input id="pwd" type="password" class="form-control input-lg" placeholder="Password" /> <span class="input-group-addon"> <span class="icon icon-lg"> <i class="fa fa-lock"></i> </span> </span> </div> </div> <div class="row"> <div class="col-xs-6"> <p class="mt-xs mb-none"> <a href="#">Not John Doe?</a> </p> </div> <div class="col-xs-6 text-right"> <button type="submit" class="btn btn-primary">Unlock</button> </div> </div> </form> </div> </div> </div> </section> <!-- end: page --> <!-- Vendor --> <script src="assets/vendor/jquery/jquery.js"></script> <script src="assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script> <script src="assets/vendor/jquery-cookie/jquery.cookie.js"></script> <script src="assets/vendor/style-switcher/style.switcher.js"></script> <script src="assets/vendor/bootstrap/js/bootstrap.js"></script> <script src="assets/vendor/nanoscroller/nanoscroller.js"></script> <script src="assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script> <script src="assets/vendor/magnific-popup/magnific-popup.js"></script> <script src="assets/vendor/jquery-placeholder/jquery.placeholder.js"></script> <!-- Theme Base, Components and Settings --> <script src="assets/javascripts/theme.js"></script> <!-- Theme Custom --> <script src="assets/javascripts/theme.custom.js"></script> <!-- Theme Initialization Files --> <script src="assets/javascripts/theme.init.js"></script> <!-- Analytics to Track Preview Website --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-42715764-8', 'auto'); ga('send', 'pageview'); </script> </body> </html>
{ "content_hash": "575f8a86c69619c1204af21182c1b562", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 656, "avg_line_length": 44.54022988505747, "alnum_prop": 0.6343225806451613, "repo_name": "newset/theme", "id": "166f2ad15f2c035dc6efb6ba3e8455c23ffeb015", "size": "3875", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "backend/normal/Porto/pages-lock-screen.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "18948543" }, { "name": "CoffeeScript", "bytes": "16726" }, { "name": "HTML", "bytes": "177338000" }, { "name": "Handlebars", "bytes": "277664" }, { "name": "JavaScript", "bytes": "49675136" }, { "name": "PHP", "bytes": "238820" }, { "name": "Ruby", "bytes": "902" }, { "name": "Shell", "bytes": "616" } ], "symlink_target": "" }
[![Build Status](https://travis-ci.org/nDmitry/grunt-postcss.png?branch=master)](https://travis-ci.org/nDmitry/grunt-postcss) [![Dependency Status](https://david-dm.org/nDmitry/grunt-postcss.png)](https://david-dm.org/nDmitry/grunt-postcss) > Apply several post-processors to your CSS using [PostCSS](https://github.com/postcss/postcss). ## Getting Started This plugin requires Grunt `~0.4.0` If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: ```shell npm install grunt-postcss --save-dev ``` Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: ```js grunt.loadNpmTasks('grunt-postcss'); ``` ## Usage ``` $ npm install grunt-postcss pixrem autoprefixer-core cssnano ``` ```js grunt.initConfig({ postcss: { options: { map: true, // inline sourcemaps // or map: { inline: false, // save all sourcemaps as separate files... annotation: 'dist/css/maps/' // ...to the specified directory }, processors: [ require('pixrem')(), // add fallbacks for rem units require('autoprefixer-core')({browsers: 'last 2 versions'}), // add vendor prefixes require('cssnano')() // minify the result ] }, dist: { src: 'css/*.css' } } }); ``` ## Options ### Post-processors options ```js require('postcss-plugin')({option: value}) ``` ### Plugin options #### options.processors Type: `Array` Default value: `[]` An array of PostCSS compatible post-processors. #### options.map Type: `Boolean|Object` Default value: `false` If the `map` option isn't defined or is set to `false`, PostCSS won't create or update sourcemaps. If `true` is specified, PostCSS will try to locate a sourcemap from a previous compilation step using an annotation comment (e.g. from Sass) and create a new sourcemap based on the found one (or just create a new inlined sourcemap). The created sourcemap can be either a separate file or an inlined map depending on what the previous sourcemap was. You can gain more control over sourcemap generation by assigning an object to the `map` option: * `prev` (string or `false`): a path to a directory where a previous sourcemap is (e.g. `path/`). By default, PostCSS will try to find a previous sourcemap using a path from the annotation comment (or using the annotation comment itself if the map is inlined). You can also set this option to `false` to delete the previous sourcemap. * `inline` (boolean): whether a sourcemap will be inlined or not. By default, it will be the same as a previous sourcemap or inlined. * `annotation` (boolean or string): by default, PostCSS will always add annotation comments with a path to a sourcemap file unless it is inlined or the input CSS does not have an annotation comment. PostCSS presumes that you want to save sourcemaps next to your output CSS files, but you can override this behavior and set a path to a directory as a string value for the option. * `sourcesContent` (boolean): whether original file contents (e.g. Sass sources) will be included to a sourcemap. By default, it's `true` unless a sourcemap from a previous compilation step has the original contents missing. #### options.diff Type: `Boolean|String` Default value: `false` Set it to `true` if you want to get a patch file: ```js options: { diff: true // or 'custom/path/to/file.css.patch' } ``` You can also specify a path where you want the file to be saved. #### options.syntax, options.parser, options.stringifier Options to control [PostCSS custom syntaxes](https://github.com/postcss/postcss#custom-syntaxes). ```js options: { parser: require('postcss-safe-parser') // instead of a removed `safe` option } ``` ```js options: { syntax: require('postcss-scss') // work with SCSS directly } ``` ## Why would I use this? Unlike the traditional approach with separate plugins, grunt-postcss allows you to parse and save CSS only once applying all post-processors in memory and thus reducing your build time. PostCSS is also a simple tool for writing your own CSS post-processors. ## How to migrate from grunt-autoprefixer? Autoprefixer is a PostCSS plugin, so first replace `grunt-autoprefixer` with `grunt-postcss` and `autoprefixer-core` plugin. ``` $ npm remove --save-dev grunt-autoprefixer $ npm install --save-dev grunt-postcss autoprefixer-core ``` Assuming you have a config like this: ``` autoprefixer: { options: { map: true, browsers: ['last 1 version'] }, dist: { src: '...' } } ``` Replace it with: ``` postcss: { options: { map: true, processors: [ require('autoprefixer-core')({browsers: ['last 1 version']}) ] }, dist: { src: '...' } } ``` `browsers`, `cascade` and `remove` options are plugin-specific, so we pass them as an argument while require the plugin.
{ "content_hash": "9e046be61c6a67f42a79d193977834bf", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 378, "avg_line_length": 33.174193548387095, "alnum_prop": 0.7102294826915597, "repo_name": "sparanoid/grunt-postcss", "id": "ae4e34eca956b5c7333467c433473e729d169828", "size": "5158", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "191" }, { "name": "JavaScript", "bytes": "11258" } ], "symlink_target": "" }
package org.apache.shardingsphere.elasticjob.cloud.console.controller; import org.apache.shardingsphere.elasticjob.cloud.console.AbstractCloudControllerTest; import org.apache.shardingsphere.elasticjob.cloud.console.HttpTestUtil; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppJsonConstants; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJsonConstants; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; import java.util.Collections; import java.util.HashMap; import java.util.Map; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) public class CloudAppControllerTest extends AbstractCloudControllerTest { private static final String YAML = "appCacheEnable: true\n" + "appName: test_app\n" + "appURL: http://localhost/app.jar\n" + "bootstrapScript: bin/start.sh\n" + "cpuCount: 1.0\n" + "eventTraceSamplingCount: 0\n" + "memoryMB: 128.0\n"; @Test public void assertRegister() { when(getRegCenter().isExisted("/config/app/test_app")).thenReturn(false); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(200)); verify(getRegCenter()).persist("/config/app/test_app", YAML); } @Test public void assertRegisterWithExistedName() { when(getRegCenter().isExisted("/config/app/test_app")).thenReturn(false); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(200)); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(500)); } @Test public void assertRegisterWithBadRequest() { assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", "\"{\"appName\":\"wrong_job\"}"), is(500)); } @Test public void assertUpdate() { when(getRegCenter().isExisted("/config/app/test_app")).thenReturn(true); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); assertThat(HttpTestUtil.put("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(200)); verify(getRegCenter()).update("/config/app/test_app", YAML); } @Test public void assertDetail() { when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/test_app"), is(CloudAppJsonConstants.getAppJson("test_app"))); verify(getRegCenter()).get("/config/app/test_app"); } @Test public void assertDetailWithNotExistedJob() { Map<String, String> content = new HashMap<>(1); content.put("appName", ""); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/notExistedJobName", content), is("")); } @Test public void assertFindAllJobs() { when(getRegCenter().isExisted("/config/app")).thenReturn(true); when(getRegCenter().getChildrenKeys("/config/app")).thenReturn(Collections.singletonList("test_app")); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/list"), is("[" + CloudAppJsonConstants.getAppJson("test_app") + "]")); verify(getRegCenter()).isExisted("/config/app"); verify(getRegCenter()).getChildrenKeys("/config/app"); verify(getRegCenter()).get("/config/app/test_app"); } @Test public void assertDeregister() { when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); assertThat(HttpTestUtil.delete("http://127.0.0.1:19000/api/app/test_app"), is(200)); verify(getRegCenter()).get("/config/app/test_app"); } @Test public void assertIsDisabled() { when(getRegCenter().isExisted("/state/disable/app/test_app")).thenReturn(true); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/test_app/disable"), is("true")); } @Test public void assertDisable() { when(getRegCenter().isExisted("/config/job")).thenReturn(true); when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app/test_app/disable"), is(200)); verify(getRegCenter()).get("/config/app/test_app"); verify(getRegCenter()).persist("/state/disable/app/test_app", "test_app"); } @Test public void assertEnable() { when(getRegCenter().isExisted("/config/job")).thenReturn(true); when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app/test_app/enable"), is(200)); verify(getRegCenter()).get("/config/app/test_app"); verify(getRegCenter()).remove("/state/disable/app/test_app"); } }
{ "content_hash": "75e468e411b6551eb4f9a0ea5aeed9a5", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 138, "avg_line_length": 49.12396694214876, "alnum_prop": 0.6805181695827726, "repo_name": "dangdangdotcom/elastic-job", "id": "6cb3bfdf2c96e2a5c0539e4f7ed430defed309b9", "size": "6745", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import React from 'react'; const IssuesLink = () => ( <div className="flex flex-wrap justify-center content-center text-center"> <div className="text-hack-fg light-mode:text-hack-dark-title pb-4"> Look at the following{' '} <a href="https://github.com/search?q=label:hacktoberfest+state:open+type:issue" target="_blank" rel="noopener noreferrer" > issues </a>{' '} and get hacking! </div> </div> ); export default IssuesLink;
{ "content_hash": "6c13f400ead9dc869a80e93127005459", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 84, "avg_line_length": 26.42105263157895, "alnum_prop": 0.6115537848605578, "repo_name": "jenkoian/hacktoberfest-checker", "id": "d1b1787bdfc167372295405a7db38930ef9f8415", "size": "502", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/pages/User/components/PullRequests/IssuesLink.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "26793" }, { "name": "Dockerfile", "bytes": "425" }, { "name": "HTML", "bytes": "4875" }, { "name": "JavaScript", "bytes": "47135" }, { "name": "Procfile", "bytes": "49" }, { "name": "Shell", "bytes": "721" }, { "name": "TypeScript", "bytes": "26499" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <site> <feature url="features/githubgist-eclipse-plugin.feature_0.0.0.jar" id="githubgist-eclipse-plugin.feature" version="0.0.0"> <category name="githubgist-eclipse-plugin"/> </feature> <feature url="features/githubgist-eclipse-plugin.feature.source_0.0.0.jar" id="githubgist-eclipse-plugin.feature.source" version="0.0.0"> <category name="githubgist-eclipse-plugin Developer Resources"/> </feature> </site>
{ "content_hash": "6b08eee797aeb34ced9bb100b2a08f24", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 140, "avg_line_length": 52, "alnum_prop": 0.7222222222222222, "repo_name": "cslysy/githubgist-eclipse-plugin", "id": "fde4d2fb902b610d838e22080b4c27b20fd9f86e", "size": "468", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "githubgist-eclipse-plugin.site/category.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2961" } ], "symlink_target": "" }
setTimeout(function() { console.log("world"); },1000); console.log("Hello");
{ "content_hash": "092b6ad68919bb611041cb504e203b27", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 23, "avg_line_length": 19.25, "alnum_prop": 0.6753246753246753, "repo_name": "ederign/kindergarten", "id": "e40558b95e9c276559f5776d511b638fdc6e9290", "size": "77", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node/introduction/timeout.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "461" }, { "name": "HTML", "bytes": "9390" }, { "name": "Java", "bytes": "30222" }, { "name": "JavaScript", "bytes": "318121" }, { "name": "Scheme", "bytes": "6194" } ], "symlink_target": "" }
package manager import ( "fmt" "log" "net/url" "regexp" "time" "github.com/kubernetes/deployment-manager/common" "github.com/kubernetes/deployment-manager/manager/repository" "github.com/kubernetes/deployment-manager/registry" ) // Manager manages a persistent set of Deployments. type Manager interface { // Deployments ListDeployments() ([]common.Deployment, error) GetDeployment(name string) (*common.Deployment, error) CreateDeployment(t *common.Template) (*common.Deployment, error) DeleteDeployment(name string, forget bool) (*common.Deployment, error) PutDeployment(name string, t *common.Template) (*common.Deployment, error) // Manifests ListManifests(deploymentName string) (map[string]*common.Manifest, error) GetManifest(deploymentName string, manifest string) (*common.Manifest, error) Expand(t *common.Template) (*common.Manifest, error) // Types ListTypes() []string ListInstances(typeName string) []*common.TypeInstance // Registries ListRegistries() ([]*common.Registry, error) CreateRegistry(pr *common.Registry) error GetRegistry(name string) (*common.Registry, error) DeleteRegistry(name string) error // Registry Types ListRegistryTypes(registryName string, regex *regexp.Regexp) ([]registry.Type, error) GetDownloadURLs(registryName string, t registry.Type) ([]*url.URL, error) // Credentials CreateCredential(name string, c *common.RegistryCredential) error GetCredential(name string) (*common.RegistryCredential, error) } type manager struct { expander Expander deployer Deployer repository repository.Repository registryProvider registry.RegistryProvider service common.RegistryService credentialProvider common.CredentialProvider } // NewManager returns a new initialized Manager. func NewManager(expander Expander, deployer Deployer, repository repository.Repository, registryProvider registry.RegistryProvider, service common.RegistryService, credentialProvider common.CredentialProvider) Manager { return &manager{expander, deployer, repository, registryProvider, service, credentialProvider} } // ListDeployments returns the list of deployments func (m *manager) ListDeployments() ([]common.Deployment, error) { l, err := m.repository.ListDeployments() if err != nil { return nil, err } return l, nil } // GetDeployment retrieves the configuration stored for a given deployment // as well as the current configuration from the cluster. func (m *manager) GetDeployment(name string) (*common.Deployment, error) { d, err := m.repository.GetDeployment(name) if err != nil { return nil, err } return d, nil } // ListManifests retrieves the manifests for a given deployment // of each of the deployments in the repository and returns the deployments. func (m *manager) ListManifests(deploymentName string) (map[string]*common.Manifest, error) { l, err := m.repository.ListManifests(deploymentName) if err != nil { return nil, err } return l, nil } // GetManifest retrieves the specified manifest for a given deployment func (m *manager) GetManifest(deploymentName string, manifestName string) (*common.Manifest, error) { d, err := m.repository.GetManifest(deploymentName, manifestName) if err != nil { return nil, err } return d, nil } // CreateDeployment expands the supplied template, creates the resulting // configuration in the cluster, creates a new deployment that tracks it, // and stores the deployment in the repository. Returns the deployment. func (m *manager) CreateDeployment(t *common.Template) (*common.Deployment, error) { log.Printf("Creating deployment: %s", t.Name) _, err := m.repository.CreateDeployment(t.Name) if err != nil { log.Printf("CreateDeployment failed %v", err) return nil, err } manifest, err := m.createManifest(t) if err != nil { log.Printf("Manifest creation failed: %v", err) m.repository.SetDeploymentState(t.Name, failState(err)) return nil, err } if err := m.repository.AddManifest(t.Name, manifest); err != nil { log.Printf("AddManifest failed %v", err) m.repository.SetDeploymentState(t.Name, failState(err)) return nil, err } actualConfig, err := m.deployer.CreateConfiguration(manifest.ExpandedConfig) if err != nil { // Deployment failed, mark as failed log.Printf("CreateConfiguration failed: %v", err) m.repository.SetDeploymentState(t.Name, failState(err)) // If we failed before being able to create some of the resources, then // return the failure as such. Otherwise, we're going to add the manifest // and hence resource specific errors down below. if actualConfig == nil { return nil, err } } else { // May be errors in the resources themselves. errs := getResourceErrors(actualConfig) if len(errs) > 0 { e := fmt.Errorf("Found resource errors during deployment: %v", errs) m.repository.SetDeploymentState(t.Name, failState(e)) return nil, e } m.repository.SetDeploymentState(t.Name, &common.DeploymentState{Status: common.DeployedStatus}) } // Update the manifest with the actual state of the reified resources manifest.ExpandedConfig = actualConfig if err := m.repository.SetManifest(t.Name, manifest); err != nil { log.Printf("SetManifest failed %v", err) m.repository.SetDeploymentState(t.Name, failState(err)) return nil, err } // Finally update the type instances for this deployment. m.addTypeInstances(t.Name, manifest.Name, manifest.Layout) return m.repository.GetValidDeployment(t.Name) } func (m *manager) createManifest(t *common.Template) (*common.Manifest, error) { et, err := m.expander.ExpandTemplate(t) if err != nil { log.Printf("Expansion failed %v", err) return nil, err } return &common.Manifest{ Name: generateManifestName(), Deployment: t.Name, InputConfig: t, ExpandedConfig: et.Config, Layout: et.Layout, }, nil } func (m *manager) addTypeInstances(deploymentName string, manifestName string, layout *common.Layout) { m.repository.ClearTypeInstances(deploymentName) instances := make(map[string][]*common.TypeInstance) for i, r := range layout.Resources { addTypeInstances(&instances, r, deploymentName, manifestName, fmt.Sprintf("$.resources[%d]", i)) } m.repository.SetTypeInstances(deploymentName, instances) } func addTypeInstances(instances *map[string][]*common.TypeInstance, r *common.LayoutResource, deploymentName string, manifestName string, jsonPath string) { // Add this resource. inst := &common.TypeInstance{ Name: r.Name, Type: r.Type, Deployment: deploymentName, Manifest: manifestName, Path: jsonPath, } (*instances)[r.Type] = append((*instances)[r.Type], inst) // Add all sub resources if they exist. for i, sr := range r.Resources { addTypeInstances(instances, sr, deploymentName, manifestName, fmt.Sprintf("%s.resources[%d]", jsonPath, i)) } } // DeleteDeployment deletes the configuration for the deployment with // the supplied identifier from the cluster.repository. If forget is true, then // the deployment is removed from the repository. Otherwise, it is marked // as deleted and retained. func (m *manager) DeleteDeployment(name string, forget bool) (*common.Deployment, error) { log.Printf("Deleting deployment: %s", name) d, err := m.repository.GetValidDeployment(name) if err != nil { return nil, err } // If there's a latest manifest, delete the underlying resources. latest, err := m.repository.GetLatestManifest(name) if err != nil { m.repository.SetDeploymentState(name, failState(err)) return nil, err } if latest != nil { log.Printf("Deleting resources from the latest manifest") // Clear previous state. for _, r := range latest.ExpandedConfig.Resources { r.State = nil } if _, err := m.deployer.DeleteConfiguration(latest.ExpandedConfig); err != nil { log.Printf("Failed to delete resources from the latest manifest: %v", err) m.repository.SetDeploymentState(name, failState(err)) return nil, err } // Create an empty manifest since resources have been deleted. err = m.repository.AddManifest(name, &common.Manifest{Deployment: name, Name: generateManifestName()}) if err != nil { log.Printf("Failed to add empty manifest") m.repository.SetDeploymentState(name, failState(err)) return nil, err } } d, err = m.repository.DeleteDeployment(name, forget) if err != nil { return nil, err } // Finally remove the type instances for this deployment. m.repository.ClearTypeInstances(name) return d, nil } // PutDeployment replaces the configuration of the deployment with // the supplied identifier in the cluster, and returns the deployment. func (m *manager) PutDeployment(name string, t *common.Template) (*common.Deployment, error) { _, err := m.repository.GetValidDeployment(name) if err != nil { return nil, err } manifest, err := m.createManifest(t) if err != nil { log.Printf("Manifest creation failed: %v", err) m.repository.SetDeploymentState(name, failState(err)) return nil, err } actualConfig, err := m.deployer.PutConfiguration(manifest.ExpandedConfig) if err != nil { m.repository.SetDeploymentState(name, failState(err)) return nil, err } manifest.ExpandedConfig = actualConfig err = m.repository.AddManifest(t.Name, manifest) if err != nil { m.repository.SetDeploymentState(name, failState(err)) return nil, err } // Finally update the type instances for this deployment. m.addTypeInstances(t.Name, manifest.Name, manifest.Layout) return m.repository.GetValidDeployment(t.Name) } func (m *manager) Expand(t *common.Template) (*common.Manifest, error) { et, err := m.expander.ExpandTemplate(t) if err != nil { log.Printf("Expansion failed %v", err) return nil, err } return &common.Manifest{ ExpandedConfig: et.Config, Layout: et.Layout, }, nil } func (m *manager) ListTypes() []string { return m.repository.ListTypes() } func (m *manager) ListInstances(typeName string) []*common.TypeInstance { return m.repository.GetTypeInstances(typeName) } // ListRegistries returns the list of registries func (m *manager) ListRegistries() ([]*common.Registry, error) { return m.service.List() } func (m *manager) CreateRegistry(pr *common.Registry) error { return m.service.Create(pr) } func (m *manager) GetRegistry(name string) (*common.Registry, error) { return m.service.Get(name) } func (m *manager) DeleteRegistry(name string) error { return m.service.Delete(name) } func generateManifestName() string { return fmt.Sprintf("manifest-%d", time.Now().UTC().UnixNano()) } func failState(e error) *common.DeploymentState { return &common.DeploymentState{ Status: common.FailedStatus, Errors: []string{e.Error()}, } } func getResourceErrors(c *common.Configuration) []string { var errs []string for _, r := range c.Resources { if r.State.Status == common.Failed { errs = append(errs, r.State.Errors...) } } return errs } // ListRegistryTypes lists types in a given registry whose string values // conform to the supplied regular expression, or all types, if the regular // expression is nil. func (m *manager) ListRegistryTypes(registryName string, regex *regexp.Regexp) ([]registry.Type, error) { r, err := m.registryProvider.GetRegistryByName(registryName) if err != nil { return nil, err } return r.ListTypes(regex) } // GetDownloadURLs returns the URLs required to download the contents // of a given type in a given registry. func (m *manager) GetDownloadURLs(registryName string, t registry.Type) ([]*url.URL, error) { r, err := m.registryProvider.GetRegistryByName(registryName) if err != nil { return nil, err } return r.GetDownloadURLs(t) } // CreateCredential creates a credential that can be used to authenticate to registry func (m *manager) CreateCredential(name string, c *common.RegistryCredential) error { return m.credentialProvider.SetCredential(name, c) } func (m *manager) GetCredential(name string) (*common.RegistryCredential, error) { return m.credentialProvider.GetCredential(name) }
{ "content_hash": "3a1127ed79d8fcc2f6f8bcd8ca0d7a87", "timestamp": "", "source": "github", "line_count": 390, "max_line_length": 156, "avg_line_length": 30.897435897435898, "alnum_prop": 0.7350207468879668, "repo_name": "gaocegege/deployment-manager", "id": "c5116499ff2e58c80048782793e3ce0891320ffd", "size": "12639", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "manager/manager/manager.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "260939" }, { "name": "HTML", "bytes": "5828" }, { "name": "Makefile", "bytes": "6106" }, { "name": "Python", "bytes": "80658" }, { "name": "Shell", "bytes": "2347" } ], "symlink_target": "" }
""" tokeniser.py Created by Thomas Mangin on 2015-06-05. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from exabgp.configuration.core.format import tokens from collections import deque class Tokeniser (object): class Iterator (object): fname = '' # This is ok to have a unique value as API parser do not use files def __init__ (self): self.next = deque() self.tokens = [] self.generator = iter([]) def replenish (self, content): self.next.clear() self.tokens = content self.generator = iter(content) return self def clear (self): self.replenish([]) def __call__ (self): if self.next: return self.next.popleft() try: return self.generator.next() except StopIteration: return '' def peek (self): try: peaked = self.generator.next() self.next.append(peaked) return peaked except StopIteration: return '' @staticmethod def _off (): raise StopIteration() def __init__ (self, scope, error, logger): self.scope = scope self.error = error self.logger = logger self.finished = False self.number = 0 self.line = [] self.iterate = Tokeniser.Iterator() self.end = '' self.index_column = 0 self.index_line = 0 self.fname = '' self.type = 'unset' self._tokens = Tokeniser._off self._next = None self._data = None def clear (self): self.finished = False self.number = 0 self.line = [] self.iterate.clear() self.end = '' self.index_column = 0 self.index_line = 0 self.fname = '' self.type = 'unset' if self._data: self._set(self._data) def params (self): if len(self.line) <= 2: return '' if self.end in ('{','}',';'): return "'%s'" % "' '".join(self.line[1:-1]) return "'%s'" % "' '".join(self.line[1:]) def _tokenise (self,iterator): for self.line,parsed in tokens(iterator): if not parsed: continue # ignore # lines # set Location information yield [word for x,word in parsed] def _set (self, function): try: self._tokens = function self._next = self._tokens.next() except IOError,exc: error = str(exc) if error.count(']'): self.error.set(error.split(']')[1].strip()) else: self.error.set(error) self._tokens = Tokeniser._off self._next = [] return self.error.set('issue setting the configuration parser') except StopIteration: self._tokens = Tokeniser._off self._next = [] return self.error.set('issue setting the configuration parser, no data') return True def set_file (self, data): def _source (fname): with open(fname,'r') as fileobject: def formated (): while True: line = fileobject.next().rstrip() self.index_line += 1 while line.endswith('\\'): line = line[:-1] + fileobject.next().rstrip() self.index_line += 1 yield line for _ in self._tokenise(formated()): yield _ self.type = 'file' self.Iterator.fname = data return self._set(_source(data)) def set_text (self, data): def _source (data): for _ in self._tokenise(data.split('\n')): yield _ self.type = 'text' return self._set(_source(data)) def set_api (self, line): return self._set(self._tokenise(iter([line]))) def __call__ (self): self.number += 1 try: self.line, self._next = self._next, self._tokens.next() self.end = self.line[-1] except StopIteration: if not self.finished: self.finished = True self.line, self._next = self._next, [] self.end = self.line[-1] else: self.line = [] self.end = '' # should we raise a Location if called with no more data ? self.iterate.replenish(self.line[:-1]) return self.line
{ "content_hash": "562ce3451bd5367a4230e5251b5e9169", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 80, "avg_line_length": 22.732919254658384, "alnum_prop": 0.6254098360655738, "repo_name": "earies/exabgp", "id": "e61a813cc3ced0dfeb717f276afd85d96323da49", "size": "3678", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "lib/exabgp/configuration/core/tokeniser.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Perl", "bytes": "1516" }, { "name": "Python", "bytes": "1164419" }, { "name": "Shell", "bytes": "17891" } ], "symlink_target": "" }
package de.tudarmstadt.ukp.experiments.web.comments.createdebate; import java.io.IOException; import java.io.InputStream; /** * General interface for debate parsing * <p/> * (c) 2015 Ivan Habernal */ public interface DebateParser { /** * Parses the debate * * @param inputStream input stream * @return debate with arguments or {@code null} if the input stream contains no debate (e.g., * another type of html site, etc.) or the debate is not parseable * @throws IOException */ Debate parseDebate(InputStream inputStream) throws IOException; }
{ "content_hash": "1e01b1c873ad0fc2ef272cae59ec608e", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 98, "avg_line_length": 24.24, "alnum_prop": 0.6815181518151815, "repo_name": "habernal/emnlp2015", "id": "62fbbb15cd0a71c4c801f7d50aeacd8f00e34503", "size": "1271", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code/experiments/src/main/java/de/tudarmstadt/ukp/experiments/web/comments/createdebate/DebateParser.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1379" }, { "name": "Java", "bytes": "663878" }, { "name": "Python", "bytes": "189666" }, { "name": "Ruby", "bytes": "81060" }, { "name": "Shell", "bytes": "315" } ], "symlink_target": "" }
package com.gcalsync.component; import javax.microedition.lcdui.*; import com.gcalsync.cal.gcal.GCalClient; import com.gcalsync.cal.gcal.GCalEvent; import com.gcalsync.log.*; import com.gcalsync.cal.*; /** * Public class responsible for drawing the Commit screen and displaying the * status of uploads/downloads. * <p> * <ol> * <li>The Preview screen displays events that are available for upload/download.</li> * <li>The user selects "Commit" from the Preview screen to write events to the * device or to the calendar.</li> * <li>The application draws the Commit screen in response to the user selecting "Commit".</li> * </ol> * * <p> * * This class is also responsible for displaying the results of download/upload events, * initiating upload/download events, and instantiation of a new instance of the * CommitEngine class that handles the download/upload of events. * <p> * This class uses the MVCComponent base class to retrieve, draw, and update screens.<br> * * * @author * @see <code>CommitEngine<code/> for code in this class that was commented out and moved * to com.gcalsync.cal.CommitEngine. */ public class CommitComponent extends MVCComponent implements Runnable, StatusLogger { Form form; GCalClient gCalClient; //PhoneCalClient phoneCalClient; GCalEvent[] uploads; GCalEvent[] downloads; /** * Constructor */ public CommitComponent(GCalClient gcal) { gCalClient = gcal; } /** * Gets the <code>Displayable</code> object to be displayed for * this component * * @returns <code>Displayable</code> */ public Displayable getDisplayable() {return this.form;} /** * Initializes the model before creating the view */ protected void initModel() {} /** * Updates the view after it is created */ protected void updateView() {} /** * Creates the view */ protected void createView() { this.form = new Form("Commit"); this.form.addCommand(new Command("OK", Command.EXIT, 2)); } /** * Appends a message to the current form <br> * Displays the statistics (results) of the uploads and * downloads that occurred during the commit event * * @param message (results of commit event)to be displayed */ public void update(String message) { form.append(message + "\n"); } /** * Replaces the last message on the form with a new message * * @param message to be displayed */ public void updateMinor(String message) { form.delete(form.size() - 1); form.append(message + "\n"); } /** * Processes menu commands <br> * If the user presses the Exit button, show the login screen * * @param c command to execute * @param d <code>Displayable</code> from which the command * originates */ public void commandAction(Command c, Displayable d) { try { if (c.getCommandType() == Command.EXIT) { Components.login.showScreen(); } }catch(Exception e) { ErrorHandler.showError(e); } } /** * Updates screen and begins processing events to be * downloaded/uploaded */ public void handle() throws Exception { try { showScreen(); new Thread(this).start(); }catch(Exception e) { throw new GCalException(CommitComponent.class, "handle", e); } } /** * Entry point for new thread */ public void run() { try { /*phoneCalClient = new PhoneCalClient(); //update Google Calendar with any upload events processUploadEvents(); //update phone with downloaded events processDownloadEvents(); Store.getTimestamps().lastSync = System.currentTimeMillis(); Store.saveTimestamps(); */ CommitEngine commitEngine = new CommitEngine(); //<int[]> is called from the CommitEngine class that processes the statistics //to display on this screen int[] commnitStatistics = commitEngine.commitSync(this.uploads, this.downloads, this.gCalClient, this.form); this.form.append(new Spacer(getDisplayable().getWidth(), 20)); //creates the message that displays the results of commit events on the screen //message displayed through the <code>update</code> method update("GCal: " + gCalClient.createdCount + " new, " + gCalClient.updatedCount + " updated, " + gCalClient.removedCount + " removed events"); update("Phone: " + commnitStatistics[0] + " new, " + commnitStatistics[1] + " updated, " + commnitStatistics[2] + " removed events"); //phoneCalClient.close(); } catch (Exception e) { ErrorHandler.showError(e.getMessage(), e); } } /** * Uploads events to Google Calendar */ /*void processUploadEvents() { String gCalId; try { if (this.uploads != null && this.uploads.length > 0) { //update("Uploading " + this.uploads.length + " event" + ((this.uploads.length > 1)?"s":"") + " to Google..."); gCalClient.setForm(this.form); for (int i=0; i<this.uploads.length; i++) { if(this.uploads[i].eventIsToBeUpdated) { gCalClient.updateEvent(this.uploads[i]); } else { gCalId = gCalClient.createEvent(this.uploads[i]); //update the phone event with the gCalId if(this.uploads[i].uid == null) { IdCorrelation idCorrelation = new IdCorrelation(); idCorrelation.phoneCalId = this.uploads[i].phoneCalId; idCorrelation.gCalId = gCalId; Store.addCorrelation(idCorrelation); } } } } } catch (Exception e) { update("Failed Google update: " + e); //#ifdef DEBUG_ERR //# System.err.println("Failed Google update: " + e); //#endif } }*/ /** * Saves events to phone calendar */ /* void processDownloadEvents() { Options options; Merger merger; Hashtable phoneEventsByGcalId; Enumeration phoneEvents; Event phoneEvent; String gcalId; String startDate; String endDate; long now; long startDateLong; long endDateLong; try { if (this.downloads != null && this.downloads.length > 0) { options = Store.getOptions(); now = System.currentTimeMillis(); startDate = DateUtil.longToIsoDate(now, 0 - options.pastDays); endDate = DateUtil.longToIsoDate(now, options.futureDays); startDateLong = DateUtil.isoDateToLong(startDate); endDateLong = DateUtil.isoDateToLong(endDate) + DateUtil.DAY; // want all events starting before midnigth on endDate phoneEvents = phoneCalClient.getPhoneEvents(startDateLong, endDateLong); phoneEventsByGcalId = new Hashtable(); merger = new Merger(phoneCalClient, gCalClient); //enumerate all GCal events in the phone's calendar while (phoneEvents.hasMoreElements()) { phoneEvent = (Event)phoneEvents.nextElement(); gcalId = phoneCalClient.getGCalId(phoneEvent); if (gcalId != null) phoneEventsByGcalId.put(gcalId, phoneEvent); } for (int i=0; i<this.downloads.length; i++) { //find the downloaded event in the phone's GCal event list. //if the event doesn't exist, then <phoneEvent> is null and //the event will be added to the phone's calendar phoneEvent = (Event)phoneEventsByGcalId.remove(this.downloads[i].uid); //update/add the downloaded event merger.mergeEvents(phoneEvent, this.downloads[i], this.form); } } } catch (Exception e) {e.printStackTrace(); update("Failed phone update: " + e); //#ifdef DEBUG_ERR //# System.err.println("Failed phone update: " + e); //#endif } }*/ /** * Sets the events to be uploaded/downloaded. * This method copies array values from <GCalEvent[]> source arrays. * The uploads and downloads arrays are called to the CommitEngine.java class * by the <code>processUploadEvents</code> and the <code>processDownloadEvents</code> methods * to write records to the Google Calendar or to the Device. * * @param uploads is the destination array for upload events - * array values were copied from <GCalEvent[]> source array * @param downloads is the destination array for download events - * array values were copied from <GCalEvent[]> source array */ public void setEvents(GCalEvent[] uploads, GCalEvent[] downloads) throws Exception { try { if (uploads != null) { this.uploads = new GCalEvent[uploads.length]; System.arraycopy(uploads, 0, this.uploads, 0, uploads.length); } if (downloads != null) { this.downloads = new GCalEvent[downloads.length]; System.arraycopy(downloads, 0, this.downloads, 0, downloads.length); } }catch(Exception e) { throw new GCalException("CommitComponent", "setEvents", e); } } }
{ "content_hash": "27e2df9b19ad5e0941b291cd4bc72c78", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 154, "avg_line_length": 37.339285714285715, "alnum_prop": 0.5530368244858919, "repo_name": "static-void/gcalsync2-0", "id": "792875d096ac7fe44e2a48201f44f47c6b97845d", "size": "11206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/gcalsync/component/CommitComponent.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "362940" }, { "name": "Makefile", "bytes": "11563" } ], "symlink_target": "" }
ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
{ "content_hash": "cbe0bf504020c6e0102de8016a6d5819", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 23, "avg_line_length": 9.076923076923077, "alnum_prop": 0.6779661016949152, "repo_name": "mdoering/backbone", "id": "39c920ff5d6790fa635813c760981fbdee82f060", "size": "186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Rhodophyta/Florideophyceae/Corallinales/Corallinaceae/Lithophyllum/Lithophyllum lithophylloides/Lithophyllum lithophylloides lithophylloides/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package io.divide.client.android; import android.app.Activity; import android.content.Context; import android.os.Bundle; import io.divide.client.BackendServices; import io.divide.client.BackendUser; import io.divide.client.auth.LoginListener; /** * The AuthUtils activity. * * Called by the AuthUtils and in charge of identifying the user. * * It sends back to the AuthUtils the result. */ public class AuthActivity extends Activity { public static final String EXTRA_TITLE = "title_extra_key"; public static final String EXTRA_ENABLE_ANONYMOUS_LOGIN = "enable_anonymous_login_key"; /** * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String title = this.getIntent().getStringExtra(EXTRA_TITLE); if(title == null) title = getApplicationName(this); boolean enableAnonymous = this.getIntent().getBooleanExtra(EXTRA_ENABLE_ANONYMOUS_LOGIN,false); CredentialView credentialView = new CredentialView(this,title); if(enableAnonymous)credentialView.enableAnonymousLogin(); setContentView(credentialView); BackendServices.addLoginListener(new LoginListener() { @Override public void onNext(BackendUser backendUser) { if(backendUser != null){ AuthActivity.this.finish(); } } }); this.closeOptionsMenu(); } private static String getApplicationName(Context context) { int stringId = context.getApplicationInfo().labelRes; return context.getString(stringId); } }
{ "content_hash": "86161ae99347fe5d763e0572619974ba", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 103, "avg_line_length": 30.509090909090908, "alnum_prop": 0.6883194278903456, "repo_name": "HiddenStage/divide", "id": "ae879aa186b965ce29dc1820e09f5e7d25c9d9a4", "size": "2272", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Client/android-client/src/main/java/io/divide/client/android/AuthActivity.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "733" }, { "name": "CSS", "bytes": "89" }, { "name": "Java", "bytes": "682273" }, { "name": "Shell", "bytes": "664" } ], "symlink_target": "" }
using namespace json_spirit; using namespace std; class CTxDump { public: CBlockIndex *pindex; int64 nValue; bool fSpent; CWalletTx* ptx; int nOut; CTxDump(CWalletTx* ptx = NULL, int nOut = -1) { pindex = NULL; nValue = 0; fSpent = false; this->ptx = ptx; this->nOut = nOut; } }; Value importprivkey(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 3) throw runtime_error( "importprivkey <c-noteprivkey> [label] [rescan=true]\n" "Adds a private key (as returned by dumpprivkey) to your wallet."); string strSecret = params[0].get_str(); string strLabel = ""; if (params.size() > 1) strLabel = params[1].get_str(); // Whether to perform rescan after import bool fRescan = true; if (params.size() > 2) fRescan = params[2].get_bool(); CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(strSecret); if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key"); CKey key; bool fCompressed; CSecret secret = vchSecret.GetSecret(fCompressed); key.SetSecret(secret, fCompressed); CKeyID vchAddress = key.GetPubKey().GetID(); { LOCK2(cs_main, pwalletMain->cs_wallet); pwalletMain->MarkDirty(); pwalletMain->SetAddressBookName(vchAddress, strLabel); if (!pwalletMain->AddKey(key)) throw JSONRPCError(RPC_WALLET_ERROR, "Error adding key to wallet"); if (fRescan) { pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true); pwalletMain->ReacceptWalletTransactions(); } } return Value::null; } Value dumpprivkey(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "dumpprivkey <c-noteaddress>\n" "Reveals the private key corresponding to <c-noteaddress>."); string strAddress = params[0].get_str(); CBitcoinAddress address; if (!address.SetString(strAddress)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid C-Note address"); CKeyID keyID; if (!address.GetKeyID(keyID)) throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key"); CSecret vchSecret; bool fCompressed; if (!pwalletMain->GetSecret(keyID, vchSecret, fCompressed)) throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + strAddress + " is not known"); return CBitcoinSecret(vchSecret, fCompressed).ToString(); }
{ "content_hash": "0ce0a2bc227be08b7924f44cd31dc842", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 104, "avg_line_length": 30.069767441860463, "alnum_prop": 0.6349574632637278, "repo_name": "cnote-coin/cnote", "id": "6066a122756853ecc1bf284fc6190b004732e524", "size": "2954", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/rpcdump.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "482152" }, { "name": "C++", "bytes": "2555998" }, { "name": "CSS", "bytes": "1127" }, { "name": "Makefile", "bytes": "8683" }, { "name": "Objective-C", "bytes": "1080" }, { "name": "Objective-C++", "bytes": "6310" }, { "name": "Shell", "bytes": "8483" }, { "name": "TypeScript", "bytes": "5343050" } ], "symlink_target": "" }
phpunit --no-globals-backup ./tests
{ "content_hash": "5c823b9a3a7b9d1da28295c6565c52b8", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 35, "avg_line_length": 35, "alnum_prop": 0.7714285714285715, "repo_name": "andychase/gab", "id": "d03aa526ee053d83853d5a4b5dcf986e9d65d66e", "size": "35", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test.bat", "mode": "33261", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "817" }, { "name": "Batchfile", "bytes": "114" }, { "name": "CSS", "bytes": "39163" }, { "name": "HTML", "bytes": "11191" }, { "name": "Java", "bytes": "14870" }, { "name": "JavaScript", "bytes": "73800" }, { "name": "PHP", "bytes": "1657326" }, { "name": "Ruby", "bytes": "1286" }, { "name": "Shell", "bytes": "2983" }, { "name": "Smarty", "bytes": "31390" } ], "symlink_target": "" }
<html> <head> <title>Ogre::ParticleSystem::CmdQuota Class Reference - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link type="text/css" rel="stylesheet" href="doxygen.css"> <link type="text/css" rel="stylesheet" href="tabs.css"> </head> <body> <!-- Generated by Doxygen 1.7.6.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespaceOgre.html">Ogre</a> </li> <li class="navelem"><a class="el" href="classOgre_1_1ParticleSystem.html">ParticleSystem</a> </li> <li class="navelem"><a class="el" href="classOgre_1_1ParticleSystem_1_1CmdQuota.html">CmdQuota</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title">Ogre::ParticleSystem::CmdQuota Class Reference</div> </div> </div><!--header--> <div class="contents"> <!-- doxytag: class="Ogre::ParticleSystem::CmdQuota" --><!-- doxytag: inherits="Ogre::ParamCommand" --> <p>Command object for quota (see <a class="el" href="classOgre_1_1ParamCommand.html" title="Abstract class which is command object which gets/sets parameters.">ParamCommand</a>). <a href="classOgre_1_1ParticleSystem_1_1CmdQuota.html#details">More...</a></p> <p><code>#include &lt;<a class="el" href="OgreParticleSystem_8h_source.html">OgreParticleSystem.h</a>&gt;</code></p> <div class="dynheader"> Inheritance diagram for Ogre::ParticleSystem::CmdQuota:</div> <div class="dyncontent"> <div class="center"><img src="classOgre_1_1ParticleSystem_1_1CmdQuota__inherit__graph.gif" border="0" usemap="#Ogre_1_1ParticleSystem_1_1CmdQuota_inherit__map" alt="Inheritance graph"/></div> <map name="Ogre_1_1ParticleSystem_1_1CmdQuota_inherit__map" id="Ogre_1_1ParticleSystem_1_1CmdQuota_inherit__map"> <area shape="rect" id="node2" href="classOgre_1_1ParamCommand.html" title="Abstract class which is command object which gets/sets parameters." alt="" coords="37,5,192,35"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classOgre_1_1ParticleSystem_1_1CmdQuota-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceOgre.html#af73bbdc8bed8a3e6fcd56bb8fa188c45">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classOgre_1_1ParticleSystem_1_1CmdQuota.html#acdf31edfef7c836c6742c5ca4d3a2a21">doGet</a> (const void *target) const </td></tr> <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classOgre_1_1ParticleSystem_1_1CmdQuota.html#a51c2f33b145b8ab3c9bbaa651330032c">doSet</a> (void *target, const <a class="el" href="namespaceOgre.html#af73bbdc8bed8a3e6fcd56bb8fa188c45">String</a> &amp;val)</td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Command object for quota (see <a class="el" href="classOgre_1_1ParamCommand.html" title="Abstract class which is command object which gets/sets parameters.">ParamCommand</a>). </p> <p>Definition at line <a class="el" href="OgreParticleSystem_8h_source.html#l00071">71</a> of file <a class="el" href="OgreParticleSystem_8h_source.html">OgreParticleSystem.h</a>.</p> </div><hr/><h2>Member Function Documentation</h2> <a class="anchor" id="acdf31edfef7c836c6742c5ca4d3a2a21"></a><!-- doxytag: member="Ogre::ParticleSystem::CmdQuota::doGet" ref="acdf31edfef7c836c6742c5ca4d3a2a21" args="(const void *target) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="namespaceOgre.html#af73bbdc8bed8a3e6fcd56bb8fa188c45">String</a> <a class="el" href="classOgre_1_1ParticleSystem_1_1CmdQuota.html#acdf31edfef7c836c6742c5ca4d3a2a21">Ogre::ParticleSystem::CmdQuota::doGet</a> </td> <td>(</td> <td class="paramtype">const void *&#160;</td> <td class="paramname"><em>target</em></td><td>)</td> <td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Implements <a class="el" href="classOgre_1_1ParamCommand.html#ae47ea550693403baebbcde11c59e074f">Ogre::ParamCommand</a>.</p> </div> </div> <a class="anchor" id="a51c2f33b145b8ab3c9bbaa651330032c"></a><!-- doxytag: member="Ogre::ParticleSystem::CmdQuota::doSet" ref="a51c2f33b145b8ab3c9bbaa651330032c" args="(void *target, const String &amp;val)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classOgre_1_1ParticleSystem_1_1CmdQuota.html#a51c2f33b145b8ab3c9bbaa651330032c">Ogre::ParticleSystem::CmdQuota::doSet</a> </td> <td>(</td> <td class="paramtype">void *&#160;</td> <td class="paramname"><em>target</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="namespaceOgre.html#af73bbdc8bed8a3e6fcd56bb8fa188c45">String</a> &amp;&#160;</td> <td class="paramname"><em>val</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Implements <a class="el" href="classOgre_1_1ParamCommand.html#ad69d7e3ca3959f0ab2e84137f621ca6a">Ogre::ParamCommand</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="OgreParticleSystem_8h_source.html">OgreParticleSystem.h</a></li> </ul> </div><!-- contents --> <hr> <p> Copyright &copy; 2012 Torus Knot Software Ltd<br /> <!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.<br/> <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <Work rdf:about=""> <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> </Work> <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> --> Last modified Sun Sep 2 2012 07:27:33 </p> </body> </html>
{ "content_hash": "e21cec398d3048eb47b6aa8ee3699d49", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 481, "avg_line_length": 60.84444444444444, "alnum_prop": 0.6748234721207694, "repo_name": "Kanma/Ogre", "id": "5d271aa028bd3d62f99bd42d89adc1284efeacad", "size": "8214", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Docs/api/html/classOgre_1_1ParticleSystem_1_1CmdQuota.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2141984" }, { "name": "C++", "bytes": "13610649" }, { "name": "CSS", "bytes": "24100" }, { "name": "Objective-C", "bytes": "86240" }, { "name": "Objective-C++", "bytes": "79422" }, { "name": "Shell", "bytes": "701" }, { "name": "TeX", "bytes": "43359" } ], "symlink_target": "" }
package fr.efrei.smash.client; import java.util.List; import java.util.Vector; import javax.swing.table.AbstractTableModel; import fr.efrei.smash.lib.School; public abstract class PersonTable extends AbstractTableModel { private static final long serialVersionUID = -3984716463944172470L; protected School school; protected SmashClient parent; protected String[] header = { "Course", "Professor", "Grade", "Follow" }; protected List<List<Object>> data = new Vector<List<Object>>(); public PersonTable(School school, SmashClient parent) { super(); this.school = school; this.parent = parent; } protected abstract void parseData(); public void clearData() { data = new Vector<List<Object>>(); } @Override public int getColumnCount() { return header.length; } public String getColumnName(int col) { return header[col]; } @Override public int getRowCount() { return data.size(); } @Override public Object getValueAt(int row, int col) { try { return data.get(row).get(col); } catch (Exception e) { return null; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public Class getColumnClass(int c) { Object type = getValueAt(0, c); if (type != null) return type.getClass(); return Object.class; } }
{ "content_hash": "f87212a2fc73d4cabbb0bf304e270b94", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 74, "avg_line_length": 20.43548387096774, "alnum_prop": 0.7063930544593529, "repo_name": "jexhson/smash", "id": "0c5cee7afa8f0110ba308bfbd7a517bcfcbab91d", "size": "1267", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "smash-client/src/main/java/fr/efrei/smash/client/PersonTable.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "103881" }, { "name": "TeX", "bytes": "14829" } ], "symlink_target": "" }
var csrftoken = $('meta[name=csrf-token]').attr('content'); $.ajaxSetup({ beforeSend: function(xhr, settings) { if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)) { xhr.setRequestHeader("X-CSRFToken", csrftoken); } } }); $(document).ready(function(){ // initial check to see if user is logged in or not updateAuthStatus(); // setup logged in view $('#logged-in-view button').click(function(){ logout() .done(function(response){ showLoggedout() }).fail(function(response){ showLoggedIn(); }); }); // setup signup view $('#signup-view #signup-form').submit(function(e) { e.preventDefault(); var form = $(this); var signupData = extractFormInput(form); signup(signupData) .done(function(response){ alert('You just created a new user'); form.trigger('reset'); updateAuthStatus(); }).fail(function(response){ alert('Something went wrong'); }); }); }); // helpers function updateAuth() { verifyAuth() .done(function(response){ showLoggedIn(response.data.user_name) }).fail(function(response){ showLoggedout() }); } function extractFormInput(form) { var inputs = form.serializeArray(); var data = {}; $.each(inputs, function(index, input) { data[input.name] = input.value; }); return data; } function showLoggedIn(username) { // show logged in view and show username $("#logged-in-view span").text(username); $("#logged-out-view").addClass('hidden'); $("#logged-in-view").removeClass('hidden'); } function showLoggedout() { // show logged out view $("#logged-out-view").removeClass('hidden'); $("#logged-in-view").addClass('hidden'); } // API calls function verifyAuth(callback) { var url = '/auth/verify_auth'; return $.get(url); } function login(loginData){ var url = '/auth/login'; return $.post(url, loginData); } function logout() { var url = '/auth/logout'; return $.post(url); } function signup(signupData) { var url = '/auth/signup'; return $.post(url, signupData); }
{ "content_hash": "a05b3eb48ec0b377d743b030c198e25a", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 65, "avg_line_length": 23.56382978723404, "alnum_prop": 0.5896162528216704, "repo_name": "cameronobrien/WorkOutYourWorkout", "id": "9334c5b96fb68d1a29b773b5f6e70455625af8bf", "size": "2254", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/static/js/main.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "11538" }, { "name": "JavaScript", "bytes": "5755" }, { "name": "Python", "bytes": "10982" } ], "symlink_target": "" }
'use strict'; /****************** * Dependencies * ******************/ var exec = require('child_process').exec; var Promise = require('promise'); var log = require('../logger'); /************* * Exports * *************/ module.exports = function(context) { if (context.settings.versioning) { return new Promise(function(resolve) { exec('git rev-parse --short HEAD', function(err, stdout) { var version = stdout.trim(); if (err) { log('Git', err, 'error'); resolve(context); return; } context.version = version; resolve(context); log('Git', 'Version ' + version); }); }); } else { return Promise.resolve(context); } };
{ "content_hash": "adb5ace47fb1288ac8f28e560d55df9d", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 70, "avg_line_length": 22.81081081081081, "alnum_prop": 0.4419431279620853, "repo_name": "richielokay/richielokay.com", "id": "8696e41cfe27f7e2d4745de4d897d794b74b7866", "size": "844", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/build/include-version.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "319" }, { "name": "Handlebars", "bytes": "2614" }, { "name": "JavaScript", "bytes": "83509" } ], "symlink_target": "" }
/* * File: Parser.cpp * Author: Arthur Lisek-Koper <deathvango@gmail.com> * * Created on December 30, 2014, 5:54 PM */ #include "Parser.hpp" #include "ObjectDataParser.hpp" #include "StringUtils.hpp" Parser::Parser() : //Retreive the initial command from the line. eg. NAME, SIZE, etc. e_mGetCommand( "\\s*([A-Z\\?]+|\\:\\:)(.*)?" ), //Check if a given line contains only whitespace. e_mCheckemptyLine( "\\s*(\\n|\\r)" ), //If value is a string of characters, then retrieve the alpha-numerical //string. Only takes characters A-z, 0-9, '-', '_'. e_mGetString( "\\s*([A-Za-z0-9\\-_]*)" ), mODataPath ("object/objectdata.dat") { } bool isWhitespace( std::string line ); void Parser::loadFromFile( ) { mFilepath = __DATA_FILEPATH; std::string absODataLoc = mFilepath + '/' + __OBJECT_DATA_DAT_PATH; //open objectdata file. std::ifstream objectIdFile(absODataLoc.c_str()); if ( !objectIdFile.is_open() ) { Error::sendMsg<std::string>( absODataLoc ); Error::handleError(__INFO, "Given file could not be opened."); } //Holds information of the current line in the file. char p_line[128]; //step through each line in the object data file for ( size_t line_num = 1; objectIdFile.getline(p_line, 128) != nullptr; ++line_num ) { //use Error::sendMessage() for handling line # in file; parseObjectData(std::string(p_line)); } objectIdFile.close(); } void Parser::parseObjectData( std::string objectId ) { std::string idPath = getString( objectId ); idPath = mFilepath + "/" + __OBJECT_PATH + "/" + idPath + __FILE_EXT; std::ifstream objectDataFile(idPath); if ( !objectDataFile.is_open() ) { Error::sendMsg<std::string>( idPath ); Error::handleError(__INFO, "Given file could not be opened."); } char p_line[128]; //loop through the data file and extract the commands. for ( size_t line_num = 0; objectDataFile.getline(p_line, 128) != nullptr; ++line_num ) { boost::cmatch what; //if regex finds a command, then handle it. if ( boost::regex_match(p_line, what, e_mGetCommand) ) { objComType objCom = strToCom(what[1].str()); handleObjectDataCommand(objCom, what[2].str()); } else if ( isWhitespace(std::string(p_line)) ) { //the line is only whitespace, so simply do nothing and //move on in the loop. } else { //An Error has occured. Error::sendMsg<std::string>( idPath ); Error::sendMsg<std::string, int>( "Encountered in given file on line: ", line_num ); Error::sendMsg<std::string>( "Command given: " + std::string( p_line ) ); //regex could not parse the file correctly. Error::handleError(__INFO, "REGEX error."); } } ObjectDataParser::loadObject(mCommandList, mFilepath); objectDataFile.close(); mCommandList.clear(); } void Parser::handleObjectDataCommand( const objComType com, const std::string val ) { switch ( com ) { case objComType::UNKNOWN: Error::handleError(__INFO, "Could not identify the given command."); break; case objComType::COMMENT: break; default: mCommandList.pushBack(com, val); break; } } objComType Parser::strToCom( std::string command ) { if ( command.compare("ID") == 0 ) { return objComType::ID; } else if ( command.compare("NAME") == 0 ) { return objComType::NAME; } else if ( command.compare("TYPE") == 0 ) { return objComType::TYPE; } else if ( command.compare("::") == 0 ) { return objComType::COMMENT; } else if ( command.compare("LOAD") == 0 ) { return objComType::LOAD; } else if ( command.compare("SPRITE?") == 0 ) { return objComType::SPRITE; } else if ( command.compare("INTERACT?") == 0 ) { return objComType::INTERACT; } else if ( command.compare("SIZE") == 0 ) { return objComType::SIZE; } else if ( command.compare("SPEED") == 0 ) { return objComType::SPEED; } else if ( command.compare("COUNT") == 0 ) { return objComType::COUNT; } else if ( command.compare("SHAPE") == 0 ) { return objComType::SHAPE; } else if ( command.compare("TERTYPE") == 0 ) { return objComType::TERRAIN_TYPE; } else { Error::sendMsg<std::string>( "Command string: " + command ); return objComType::UNKNOWN; } } std::string Parser::getString( std::string input ) { std::string trimmed_input = StringUtils::trimLine( input ); std::string rex_expr = "([A-Za-z0-9_]+)"; boost::regex e_Expr( rex_expr ); boost::smatch what; if ( boost::regex_match( trimmed_input, what, e_Expr ) ) { return what[1].str(); } else { Error::sendMsg<std::string>( "Given String: " + input ); Error::handleError( __INFO, "REGEX ERROR: unexpected data when parsing string." ); return ""; } } bool isWhitespace( std::string line ) { boost::regex e_IsSpace( "(\\s*)" ); boost::smatch what; std::string temp_str = line; if ( temp_str.empty() ) { StringUtils::trimLine( std::string( line ) ); } return ( boost::regex_match( line, what, e_IsSpace) || temp_str.empty() ) ? true : false; }
{ "content_hash": "1315089358b70e83db6d9c9d80b07036", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 96, "avg_line_length": 22.195219123505975, "alnum_prop": 0.5718901453957996, "repo_name": "deathvango/cppsidescroller", "id": "5033c4b43367cbb5ed49a8ca2a495b70e6282413", "size": "5571", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/parsing/Parser.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "156353" } ], "symlink_target": "" }
// // CookieViewController.m // LayZhangDemo // // Created by LayZhang on 2017/8/4. // Copyright © 2017年 Zhanglei. All rights reserved. // #import "CookieViewController.h" #import "CountDownButton.h" #import "LoginInputView.h" @interface CookieViewController () @end @implementation CookieViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self createNavBarWithTitle:@"CookieDemo" withLeft:[UIImage imageNamed:@"icon_back"]]; // CountDownButton *countDownButton = [[CountDownButton alloc] init]; CountDownButton *countDownButton = [CountDownButton instanceWithBegin:^(CountDownButton *countDownButton) { // countDownButton.enabled = NO; [countDownButton startCountDownWithSecond:10]; } couting:^NSString *(CountDownButton *countDownButton, NSUInteger second) { NSString *title = [NSString stringWithFormat:@"剩余%zd秒",second]; NSLog(@"%@", title); return title; } finished:^NSString *(CountDownButton *countDownButton, NSUInteger second) { countDownButton.enabled = YES; return @"点击重新获取"; }]; [countDownButton setFrame:CGRectMake(100, 100, 200, 200)]; [self.view addSubview:countDownButton]; [countDownButton setBackgroundColor:[UIColor redColor]]; LoginInputView *login = [LoginInputView instanceWithImageName:@"icon_back"]; login.frame = CGRectMake(20 , 20, 200 , 30); [self.view addSubview:login]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void)dealloc { } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end
{ "content_hash": "05b3d701498684887ba330e2be359e47", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 111, "avg_line_length": 28.885714285714286, "alnum_prop": 0.7012858555885262, "repo_name": "LayZhangGitHub/LayZhangDemo", "id": "9b029c6449c7999f725ab3bba4fb68f65ad95204", "size": "2043", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LayZhangDemo/LayZhangDemo/class/MainDemo/CookieDemo/CookieViewController.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "4268" }, { "name": "Objective-C", "bytes": "2326575" }, { "name": "Ruby", "bytes": "1096" }, { "name": "Shell", "bytes": "11689" }, { "name": "Swift", "bytes": "5136" } ], "symlink_target": "" }
/* * This Test case makes use of some examples from * * "Learning SPARQL - Querying and Updating with SPARQL 1.1" by Bob DuCharme * * Publisher: O'Reilly * Author: Bob DuCharme * ISBN: 978-1-449-37143-2 * http://www.learningsparql.com/ * http://shop.oreilly.com/product/0636920030829.do * * We warmly appreciate and thank the author and O'Reilly for such permission. * */ package org.gazzax.labs.solrdf.integration.sparql; import static org.gazzax.labs.solrdf.MisteryGuest.misteryGuest; import org.gazzax.labs.solrdf.integration.IntegrationTestSupertypeLayer; import org.junit.Test; /** * Querying string literals with diacritics or angle brackets yields no result. * * @author Andrea Gazzarini * @since 1.0 * @see */ public class Issue112_ITCase extends IntegrationTestSupertypeLayer { @Test public void deleteEverything() throws Exception { executeUpdate(misteryGuest("issue_112_delete_all.ru", "faceting_test_dataset.nt")); } @Test public void deleteEverythingAboutAResource() throws Exception { executeUpdate(misteryGuest("issue_112_delete_resource.ru", "faceting_test_dataset.nt")); } @Test public void deleteEverythingWithDateObject() throws Exception { executeUpdate(misteryGuest("issue_112_delete_resources_with_a_date_object.ru", "faceting_test_dataset.nt")); } @Test public void deleteWithDateSelector() throws Exception { executeUpdate(misteryGuest("issue_112_delete_with_a_date_selector.ru", "faceting_test_dataset.nt")); } @Test public void insertDateTimeAndDeleteEverything() throws Exception { executeUpdate(misteryGuest("issue_112_insert_with_datetime.ru")); executeUpdate(misteryGuest("issue_112_delete_all.ru")); } @Override protected String examplesDirectory() { return "src/test/resources/sample_data"; } }
{ "content_hash": "7f2b43282864313dd0e48e22b98992d2", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 111, "avg_line_length": 30.05, "alnum_prop": 0.7515252357182474, "repo_name": "agazzarini/SolRDF", "id": "4e28666a6ea08efc48caf53fea357b8e6c243d8f", "size": "1803", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "solrdf/solrdf-integration-tests/src/test/java/org/gazzax/labs/solrdf/integration/sparql/Issue112_ITCase.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "665" }, { "name": "Java", "bytes": "295996" }, { "name": "JavaScript", "bytes": "4056" }, { "name": "Python", "bytes": "3078" }, { "name": "Ruby", "bytes": "11685" }, { "name": "Web Ontology Language", "bytes": "186845" }, { "name": "XSLT", "bytes": "1584" } ], "symlink_target": "" }
Welcome to Hy's documentation! ============================== .. image:: _static/hy_logo-smaller.png :alt: Hy logo :align: left Welcome to `Hy <https://github.com/paultag/hy>`_! Hy is a wonderful dialect of Lisp that's embedded in Python. Since Hy transforms its lisp code into the python Abstract Syntax Tree, you have the whole beautiful world of python at your fingertips, in lisp form! Meet our mascot, "Cuddles": .. image:: http://fc07.deviantart.net/fs70/i/2013/138/f/0/cuddles_the_hacker_by_doctormo-d65l7lq.png :alt: Paul riding cuddles into the distance .. Our old ascii art mascot version .. Retained as an easter egg for those who read the docs via .rst! .. .. LET'S CUDDLEFISH .. ______ .. _.----'#' # ' .. ,' #' ,# ; .. (' (w) _,-'_/ .. /// / /'.____.' .. \|\||/ Read more about Hy in these docs! We're also on IRC! Join `#hy on irc.freenode.net <http://webchat.freenode.net/?channels=hy>`_! Documentation Index =================== Contents: .. toctree:: :maxdepth: 3 quickstart tutorial hacking language/index
{ "content_hash": "da9a1a2e9012be8f5df047566e8cd0fa", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 100, "avg_line_length": 21.764705882352942, "alnum_prop": 0.6027027027027027, "repo_name": "nathancahill/hy", "id": "47f1f110429ecdd2b9a21e5d4f9a94b8df82858d", "size": "1110", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/index.rst", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
#include <gtest/gtest.h> #include <arrayfire.h> #include <af/dim4.hpp> #include <af/traits.hpp> #include <af/compatible.h> #include <string> #include <vector> #include <cmath> #include <testHelpers.hpp> #include <typeinfo> using std::string; using std::vector; using std::abs; using af::dim4; typedef struct { float f[5]; unsigned d[8]; } feat_desc_t; typedef struct { float f[5]; } feat_t; typedef struct { unsigned d[8]; } desc_t; static bool feat_cmp(feat_desc_t i, feat_desc_t j) { for (int k = 0; k < 5; k++) if (i.f[k] != j.f[k]) return (i.f[k] < j.f[k]); return true; } static void array_to_feat_desc(vector<feat_desc_t>& feat, float* x, float* y, float* score, float* ori, float* size, unsigned* desc, unsigned nfeat) { feat.resize(nfeat); for (size_t i = 0; i < feat.size(); i++) { feat[i].f[0] = x[i]; feat[i].f[1] = y[i]; feat[i].f[2] = score[i]; feat[i].f[3] = ori[i]; feat[i].f[4] = size[i]; for (unsigned j = 0; j < 8; j++) feat[i].d[j] = desc[i * 8 + j]; } } static void array_to_feat_desc(vector<feat_desc_t>& feat, float* x, float* y, float* score, float* ori, float* size, vector<vector<unsigned> >& desc, unsigned nfeat) { feat.resize(nfeat); for (size_t i = 0; i < feat.size(); i++) { feat[i].f[0] = x[i]; feat[i].f[1] = y[i]; feat[i].f[2] = score[i]; feat[i].f[3] = ori[i]; feat[i].f[4] = size[i]; for (unsigned j = 0; j < 8; j++) feat[i].d[j] = desc[i][j]; } } static void split_feat_desc(vector<feat_desc_t>& fd, vector<feat_t>& f, vector<desc_t>& d) { f.resize(fd.size()); d.resize(fd.size()); for (size_t i = 0; i < fd.size(); i++) { f[i].f[0] = fd[i].f[0]; f[i].f[1] = fd[i].f[1]; f[i].f[2] = fd[i].f[2]; f[i].f[3] = fd[i].f[3]; f[i].f[4] = fd[i].f[4]; for (unsigned j = 0; j < 8; j++) d[i].d[j] = fd[i].d[j]; } } static unsigned popcount(unsigned x) { x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0F0F0F0F; x = x + (x >> 8); x = x + (x >> 16); return x & 0x0000003F; } bool compareHamming(int data_size, unsigned *cpu, unsigned *gpu, unsigned thr = 1) { bool ret = true; for(int i=0;i<data_size;i++) { unsigned x = (cpu[i] ^ gpu[i]); if(popcount(x) > thr) { ret = false; std::cout<<std::endl<<"@compareHamming: first mismatch."<<std::endl; std::cout<<"(cpu,gpu,cpu-gpu)["<<i<<"] : {"<<cpu[i]<<","<<gpu[i]<<","<<cpu[i]-gpu[i]<<"}"<<std::endl; std::cout<<std::endl; break; } } return ret; } template<typename T> class ORB : public ::testing::Test { public: virtual void SetUp() {} }; typedef ::testing::Types<float, double> TestTypes; TYPED_TEST_CASE(ORB, TestTypes); template<typename T> void orbTest(string pTestFile) { if (noDoubleTests<T>()) return; if (noImageIOTests()) return; vector<dim4> inDims; vector<string> inFiles; vector<vector<float> > goldFeat; vector<vector<unsigned> > goldDesc; readImageFeaturesDescriptors<unsigned>(pTestFile, inDims, inFiles, goldFeat, goldDesc); size_t testCount = inDims.size(); for (size_t testId=0; testId<testCount; ++testId) { af_array inArray_f32 = 0; af_array inArray = 0; af_array desc = 0; af_features feat; inFiles[testId].insert(0,string(TEST_DIR"/orb/")); ASSERT_EQ(AF_SUCCESS, af_load_image(&inArray_f32, inFiles[testId].c_str(), false)); ASSERT_EQ(AF_SUCCESS, conv_image<T>(&inArray, inArray_f32)); ASSERT_EQ(AF_SUCCESS, af_orb(&feat, &desc, inArray, 20.0f, 400, 1.2f, 8, true)); dim_t n = 0; af_array x, y, score, orientation, size; ASSERT_EQ(AF_SUCCESS, af_get_features_num(&n, feat)); ASSERT_EQ(AF_SUCCESS, af_get_features_xpos(&x, feat)); ASSERT_EQ(AF_SUCCESS, af_get_features_ypos(&y, feat)); ASSERT_EQ(AF_SUCCESS, af_get_features_score(&score, feat)); ASSERT_EQ(AF_SUCCESS, af_get_features_orientation(&orientation, feat)); ASSERT_EQ(AF_SUCCESS, af_get_features_size(&size, feat)); float * outX = new float[n]; float * outY = new float[n]; float * outScore = new float[n]; float * outOrientation = new float[n]; float * outSize = new float[n]; dim_t descSize; ASSERT_EQ(AF_SUCCESS, af_get_elements(&descSize, desc)); unsigned * outDesc = new unsigned[descSize]; ASSERT_EQ(AF_SUCCESS, af_get_data_ptr((void*)outX, x)); ASSERT_EQ(AF_SUCCESS, af_get_data_ptr((void*)outY, y)); ASSERT_EQ(AF_SUCCESS, af_get_data_ptr((void*)outScore, score)); ASSERT_EQ(AF_SUCCESS, af_get_data_ptr((void*)outOrientation, orientation)); ASSERT_EQ(AF_SUCCESS, af_get_data_ptr((void*)outSize, size)); ASSERT_EQ(AF_SUCCESS, af_get_data_ptr((void*)outDesc, desc)); vector<feat_desc_t> out_feat_desc; array_to_feat_desc(out_feat_desc, outX, outY, outScore, outOrientation, outSize, outDesc, n); vector<feat_desc_t> gold_feat_desc; array_to_feat_desc(gold_feat_desc, &goldFeat[0].front(), &goldFeat[1].front(), &goldFeat[2].front(), &goldFeat[3].front(), &goldFeat[4].front(), goldDesc, goldFeat[0].size()); std::sort(out_feat_desc.begin(), out_feat_desc.end(), feat_cmp); std::sort(gold_feat_desc.begin(), gold_feat_desc.end(), feat_cmp); vector<feat_t> out_feat; vector<desc_t> v_out_desc; vector<feat_t> gold_feat; vector<desc_t> v_gold_desc; split_feat_desc(out_feat_desc, out_feat, v_out_desc); split_feat_desc(gold_feat_desc, gold_feat, v_gold_desc); for (int elIter = 0; elIter < (int)n; elIter++) { ASSERT_EQ(out_feat[elIter].f[0], gold_feat[elIter].f[0]) << "at: " << elIter << std::endl; ASSERT_EQ(out_feat[elIter].f[1], gold_feat[elIter].f[1]) << "at: " << elIter << std::endl; ASSERT_LE(fabs(out_feat[elIter].f[2] - gold_feat[elIter].f[2]), 1e-3) << "at: " << elIter << std::endl; ASSERT_LE(fabs(out_feat[elIter].f[3] - gold_feat[elIter].f[3]), 1e-3) << "at: " << elIter << std::endl; ASSERT_LE(fabs(out_feat[elIter].f[4] - gold_feat[elIter].f[4]), 1e-3) << "at: " << elIter << std::endl; } // TODO: improve distance for single/double-precision interchangeability EXPECT_TRUE(compareHamming(descSize, (unsigned*)&v_out_desc[0], (unsigned*)&v_gold_desc[0], 3)); ASSERT_EQ(AF_SUCCESS, af_release_array(inArray)); ASSERT_EQ(AF_SUCCESS, af_release_array(inArray_f32)); ASSERT_EQ(AF_SUCCESS, af_release_array(x)); ASSERT_EQ(AF_SUCCESS, af_release_array(y)); ASSERT_EQ(AF_SUCCESS, af_release_array(score)); ASSERT_EQ(AF_SUCCESS, af_release_array(orientation)); ASSERT_EQ(AF_SUCCESS, af_release_array(size)); ASSERT_EQ(AF_SUCCESS, af_release_array(desc)); delete[] outX; delete[] outY; delete[] outScore; delete[] outOrientation; delete[] outSize; delete[] outDesc; } } TYPED_TEST(ORB, Square) { orbTest<TypeParam>(string(TEST_DIR"/orb/square.test")); } TYPED_TEST(ORB, Lena) { orbTest<TypeParam>(string(TEST_DIR"/orb/lena.test")); } ///////////////////////////////////// CPP //////////////////////////////// // TEST(ORB, CPP) { if (noDoubleTests<float>()) return; if (noImageIOTests()) return; vector<dim4> inDims; vector<string> inFiles; vector<vector<float> > goldFeat; vector<vector<unsigned> > goldDesc; readImageFeaturesDescriptors<unsigned>(string(TEST_DIR"/orb/square.test"), inDims, inFiles, goldFeat, goldDesc); inFiles[0].insert(0,string(TEST_DIR"/orb/")); af::array in = af::loadImage(inFiles[0].c_str(), false); af::features feat; af::array desc; af::orb(feat, desc, in, 20.0f, 400, 1.2f, 8, true); float * outX = new float[feat.getNumFeatures()]; float * outY = new float[feat.getNumFeatures()]; float * outScore = new float[feat.getNumFeatures()]; float * outOrientation = new float[feat.getNumFeatures()]; float * outSize = new float[feat.getNumFeatures()]; unsigned * outDesc = new unsigned[desc.elements()]; feat.getX().host(outX); feat.getY().host(outY); feat.getScore().host(outScore); feat.getOrientation().host(outOrientation); feat.getSize().host(outSize); desc.host(outDesc); vector<feat_desc_t> out_feat_desc; array_to_feat_desc(out_feat_desc, outX, outY, outScore, outOrientation, outSize, outDesc, feat.getNumFeatures()); vector<feat_desc_t> gold_feat_desc; array_to_feat_desc(gold_feat_desc, &goldFeat[0].front(), &goldFeat[1].front(), &goldFeat[2].front(), &goldFeat[3].front(), &goldFeat[4].front(), goldDesc, goldFeat[0].size()); std::sort(out_feat_desc.begin(), out_feat_desc.end(), feat_cmp); std::sort(gold_feat_desc.begin(), gold_feat_desc.end(), feat_cmp); vector<feat_t> out_feat; vector<desc_t> v_out_desc; vector<feat_t> gold_feat; vector<desc_t> v_gold_desc; split_feat_desc(out_feat_desc, out_feat, v_out_desc); split_feat_desc(gold_feat_desc, gold_feat, v_gold_desc); for (int elIter = 0; elIter < (int)feat.getNumFeatures(); elIter++) { ASSERT_EQ(out_feat[elIter].f[0], gold_feat[elIter].f[0]) << "at: " << elIter << std::endl; ASSERT_EQ(out_feat[elIter].f[1], gold_feat[elIter].f[1]) << "at: " << elIter << std::endl; ASSERT_LE(fabs(out_feat[elIter].f[2] - gold_feat[elIter].f[2]), 1e-3) << "at: " << elIter << std::endl; ASSERT_LE(fabs(out_feat[elIter].f[3] - gold_feat[elIter].f[3]), 1e-3) << "at: " << elIter << std::endl; ASSERT_LE(fabs(out_feat[elIter].f[4] - gold_feat[elIter].f[4]), 1e-3) << "at: " << elIter << std::endl; } // TODO: improve distance for single/double-precision interchangeability EXPECT_TRUE(compareHamming(desc.elements(), (unsigned*)&v_out_desc[0], (unsigned*)&v_gold_desc[0], 3)); delete[] outX; delete[] outY; delete[] outScore; delete[] outOrientation; delete[] outSize; delete[] outDesc; }
{ "content_hash": "7b9404ddec2c13a2b41d7c165f4eac4e", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 183, "avg_line_length": 34.613861386138616, "alnum_prop": 0.5751334858886347, "repo_name": "munnybearz/arrayfire", "id": "66d7fda7891f13711e7b0a1c1f9dfd323dbdb1da", "size": "10819", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/orb.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "440967" }, { "name": "C++", "bytes": "5359408" }, { "name": "CMake", "bytes": "193960" }, { "name": "Cuda", "bytes": "242173" }, { "name": "Shell", "bytes": "2275" } ], "symlink_target": "" }
package org.eclipse.lsp4j; /** * Since 3.16.0 */ public final class SemanticTokenModifiers { private SemanticTokenModifiers() { } public static final String Declaration = "declaration"; public static final String Definition = "definition"; public static final String Readonly = "readonly"; public static final String Static = "static"; public static final String Deprecated = "deprecated"; public static final String Abstract = "abstract"; public static final String Async = "async"; public static final String Modification = "modification"; public static final String Documentation = "documentation"; public static final String DefaultLibrary = "defaultLibrary"; }
{ "content_hash": "23c56711f4ce1d06e9eaf653dfb4c654", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 65, "avg_line_length": 23.516129032258064, "alnum_prop": 0.7160493827160493, "repo_name": "smarr/SOMns-vscode", "id": "a920c550445244189abcc27d404a41637a863a26", "size": "1134", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/org.eclipse.lsp4j/org/eclipse/lsp4j/SemanticTokenModifiers.java", "mode": "33188", "license": "mit", "language": [ { "name": "ANTLR", "bytes": "12820" }, { "name": "Java", "bytes": "1782848" }, { "name": "Shell", "bytes": "182" }, { "name": "Slash", "bytes": "241" }, { "name": "TypeScript", "bytes": "26804" }, { "name": "Vim Script", "bytes": "3730" }, { "name": "Xtend", "bytes": "197426" } ], "symlink_target": "" }
All notable changes to this add-on will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## Unreleased ## [0.1.1] - 2022-02-15 ### Fixed - Fix the downloaded version of the Eval Villain Firefox extension. ## [0.1.0] - 2022-02-10 ### Added - Link to the blog post in the help. ### Changed - Updated with new version of Eval Villain. - Update minimum ZAP version to 2.11.1. ## [0.0.1] - 2021-12-01 - First version. [0.1.1]: https://github.com/zaproxy/zap-extensions/releases/evalvillain-v0.1.1 [0.1.0]: https://github.com/zaproxy/zap-extensions/releases/evalvillain-v0.1.0 [0.0.1]: https://github.com/zaproxy/zap-extensions/releases/evalvillain-v0.0.1
{ "content_hash": "b4ce1c635b1187638518bdf555992809", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 80, "avg_line_length": 26.666666666666668, "alnum_prop": 0.7069444444444445, "repo_name": "denniskniep/zap-extensions", "id": "2ba62dbe85808f2a5a0fd93861057e64182e8569", "size": "732", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "addOns/evalvillain/CHANGELOG.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "50766" }, { "name": "Groovy", "bytes": "29975" }, { "name": "HTML", "bytes": "14402916" }, { "name": "Haskell", "bytes": "2591946" }, { "name": "Java", "bytes": "15880552" }, { "name": "JavaScript", "bytes": "220737" }, { "name": "Kotlin", "bytes": "120709" }, { "name": "Python", "bytes": "27312" }, { "name": "Ruby", "bytes": "16548" }, { "name": "XSLT", "bytes": "9433" } ], "symlink_target": "" }
<?php namespace CruiseBundle\Repository; /** * DiscountDocumentTypeRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class DiscountDocumentTypeRepository extends \Doctrine\ORM\EntityRepository { }
{ "content_hash": "93608ff1c0962fdb3333ef455f45cbb3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 75, "avg_line_length": 20.46153846153846, "alnum_prop": 0.7819548872180451, "repo_name": "dimadmb/vodohod", "id": "e8b74c815f437b5d765801233dc8c7e87f956404", "size": "266", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/CruiseBundle/Repository/DiscountDocumentTypeRepository.php", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "1008479" }, { "name": "HTML", "bytes": "91482" }, { "name": "JavaScript", "bytes": "2783247" }, { "name": "PHP", "bytes": "488689" } ], "symlink_target": "" }
namespace p05___BookLibrary { using System; using System.Collections.Generic; using System.Linq; public class BookLibrary { public static void Main() { int numberOfBooks = int.Parse(Console.ReadLine()); var library = new List<Books>(); for (int i = 0; i < numberOfBooks; i++) { var bookInput = Console.ReadLine().Split(); var BookInfo = new Books { Title = bookInput[0], Author = bookInput[1], Publisher = bookInput[2], ReleaseDate = bookInput[3], ISBNNumber = int.Parse(bookInput[4]), Price = double.Parse(bookInput[5]) }; library.Add(BookInfo); } var authors = new Dictionary<string, double>(); foreach (var book in library) { if (!authors.ContainsKey(book.Author)) { authors[book.Author] = 0; } authors[book.Author] += book.Price; } var result = authors. OrderByDescending(x => x.Value). ThenBy(x => x.Key); foreach (var item in result) { Console.WriteLine($"{item.Key} -> {item.Value}"); } } } }
{ "content_hash": "64d2d8d8979cb8bb22c2a9082bcad162", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 65, "avg_line_length": 26.796296296296298, "alnum_prop": 0.4388389771941949, "repo_name": "LevonTopakbashyan/SoftUni", "id": "fd858a4eb8b01f4b624548893eed773ae0dbfd1d", "size": "1449", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "C# - Fundamentals/10. ObjectsAndClasses - Exercises/p05 - BookLibrary/BookLibrary.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "233830" }, { "name": "Java", "bytes": "36308" } ], "symlink_target": "" }
package com.intellij.ide.actions; import com.intellij.internal.statistic.eventLog.events.EventPair; import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.impl.FusAwareAction; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.project.ProjectManagerListener; import com.intellij.openapi.ui.ShadowAction; import com.intellij.openapi.util.NlsActions; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.wm.*; import com.intellij.openapi.wm.ex.ToolWindowEx; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; import java.util.Collections; import java.util.List; public abstract class ResizeToolWindowAction extends AnAction implements DumbAware, FusAwareAction { private ToolWindow myLastWindow; private ToolWindowManager myLastManager; protected JLabel myScrollHelper; private ToolWindow myToolWindow; private boolean myListenerInstalled; protected ResizeToolWindowAction() { } protected ResizeToolWindowAction(@NlsActions.ActionText String text) { super(text); } protected ResizeToolWindowAction(@NlsActions.ActionText String text, @NlsActions.ActionDescription String description, Icon icon) { super(text, description, icon); } protected ResizeToolWindowAction(@NotNull ToolWindow toolWindow, @NonNls String originalAction, JComponent component) { myToolWindow = toolWindow; new ShadowAction(this, ActionManager.getInstance().getAction(originalAction), component, toolWindow.getDisposable()); } @Override public final void update(@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null || e.getData(CommonDataKeys.HOST_EDITOR) != null) { setDisabled(e); return; } if (!myListenerInstalled) { myListenerInstalled = true; ApplicationManager.getApplication().getMessageBus().connect().subscribe(ProjectManager.TOPIC, new ProjectManagerListener() { @Override public void projectClosed(@NotNull Project project) { setDisabled(null); } }); } Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (owner == null) { setDisabled(e); return; } Window windowAncestor = SwingUtilities.getWindowAncestor(owner); if (windowAncestor instanceof JWindow) windowAncestor = windowAncestor.getOwner();//SearchEverywhere popup case if (!(windowAncestor instanceof IdeFrame) || windowAncestor instanceof IdeFrame.Child) { setDisabled(e); return; } ToolWindowManager mgr = ToolWindowManager.getInstance(project); ToolWindow window = getToolWindow(project); if (window != null) { if (!window.isAvailable() || !window.isVisible() || window.getType() == ToolWindowType.FLOATING || window.getType() == ToolWindowType.WINDOWED) { setDisabled(e); return; } update(e, window, mgr); if (e.getPresentation().isEnabled()) { myLastWindow = window; myLastManager = mgr; } else { setDisabled(e); } } else { setDisabled(e); } } @Nullable private ToolWindow getToolWindow(@NotNull Project project) { if (myToolWindow != null) { return myToolWindow; } ToolWindowManager manager = ToolWindowManager.getInstance(project); String id = manager.getLastActiveToolWindowId(); if (id != null) { return manager.getToolWindow(id); } return null; } private void setDisabled(@Nullable AnActionEvent e) { if (e != null) { e.getPresentation().setEnabledAndVisible(false); } myLastWindow = null; myLastManager = null; myToolWindow = null; } protected abstract void update(AnActionEvent event, ToolWindow window, ToolWindowManager mgr); @Override public final void actionPerformed(@NotNull AnActionEvent e) { actionPerformed(e, myLastWindow, myLastManager); } @Override public @NotNull List<EventPair<?>> getAdditionalUsageData(@NotNull AnActionEvent event) { Project project = event.getProject(); if (project != null) { ToolWindow toolWindow = getToolWindow(project); if (toolWindow != null) { return Collections.singletonList(ToolwindowFusEventFields.TOOLWINDOW.with(toolWindow.getId())); } } return Collections.emptyList(); } @Nullable private ToolWindowScrollable getScrollable(ToolWindow toolWindow, boolean isHorizontalStretchingOffered) { Component eachComponent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); ToolWindowScrollable scrollable = null; while (eachComponent != null) { if (!SwingUtilities.isDescendingFrom(eachComponent, toolWindow.getComponent())) { break; } if (eachComponent instanceof ToolWindowScrollable) { ToolWindowScrollable eachScrollable = (ToolWindowScrollable)eachComponent; if (isHorizontalStretchingOffered) { if (eachScrollable.isHorizontalScrollingNeeded()) { scrollable = eachScrollable; break; } } else { if (eachScrollable.isVerticalScrollingNeeded()) { scrollable = eachScrollable; break; } } } eachComponent = eachComponent.getParent(); } if (scrollable == null) { scrollable = new DefaultToolWindowScrollable(); } if (isHorizontalStretchingOffered && scrollable.isHorizontalScrollingNeeded() || !isHorizontalStretchingOffered && scrollable.isVerticalScrollingNeeded()) { return scrollable; } return null; } protected abstract void actionPerformed(AnActionEvent e, ToolWindow toolWindow, ToolWindowManager toolWindowManager); protected void stretch(ToolWindow wnd, boolean isHorizontalStretching, boolean isIncrementAction) { ToolWindowScrollable scrollable = getScrollable(wnd, isHorizontalStretching); if (scrollable == null) return; ToolWindowAnchor anchor = wnd.getAnchor(); if (isHorizontalStretching && !anchor.isHorizontal()) { incWidth(wnd, scrollable.getNextHorizontalScroll(), (anchor == ToolWindowAnchor.LEFT) == isIncrementAction); } else if (!isHorizontalStretching && anchor.isHorizontal()) { incHeight(wnd, scrollable.getNextVerticalScroll(), (anchor == ToolWindowAnchor.TOP) != isIncrementAction); } } private static void incWidth(ToolWindow wnd, int value, boolean isPositive) { ((ToolWindowEx)wnd).stretchWidth(isPositive ? value : -value); } private static void incHeight(ToolWindow wnd, int value, boolean isPositive) { ((ToolWindowEx)wnd).stretchHeight(isPositive ? value : -value); } public static class Left extends ResizeToolWindowAction { public Left() { } public Left(@NlsActions.ActionText String text) { super(text); } public Left(@NlsActions.ActionText String text, @NlsActions.ActionDescription String description, Icon icon) { super(text, description, icon); } public Left(@NotNull ToolWindow toolWindow, JComponent c) { super(toolWindow, "ResizeToolWindowLeft", c); } @Override protected void update(AnActionEvent event, ToolWindow window, ToolWindowManager mgr) { event.getPresentation().setEnabled(!window.getAnchor().isHorizontal()); } @Override protected void actionPerformed(AnActionEvent e, ToolWindow toolWindow, ToolWindowManager toolWindowManager) { stretch(toolWindow, true, false); } } public static class Right extends ResizeToolWindowAction { public Right() { } public Right(@NlsActions.ActionText String text) { super(text); } public Right(@NlsActions.ActionText String text, @NlsActions.ActionDescription String description, Icon icon) { super(text, description, icon); } public Right(ToolWindow toolWindow, JComponent c) { super(toolWindow, "ResizeToolWindowRight", c); } @Override protected void update(AnActionEvent event, ToolWindow window, ToolWindowManager mgr) { event.getPresentation().setEnabled(!window.getAnchor().isHorizontal()); } @Override protected void actionPerformed(AnActionEvent e, ToolWindow toolWindow, ToolWindowManager toolWindowManager) { stretch(toolWindow, true, true); } } public static class Up extends ResizeToolWindowAction { public Up() { } public Up(@NlsActions.ActionText String text) { super(text); } public Up(@NlsActions.ActionText String text, @NlsActions.ActionDescription String description, Icon icon) { super(text, description, icon); } public Up(ToolWindow toolWindow, JComponent c) { super(toolWindow, "ResizeToolWindowUp", c); } @Override protected void update(AnActionEvent event, ToolWindow window, ToolWindowManager mgr) { event.getPresentation().setEnabled(window.getAnchor().isHorizontal()); } @Override protected void actionPerformed(AnActionEvent e, ToolWindow toolWindow, ToolWindowManager toolWindowManager) { stretch(toolWindow, false, true); } } public static class Down extends ResizeToolWindowAction { public Down() { } public Down(@NlsActions.ActionText String text) { super(text); } public Down(@NlsActions.ActionText String text, @NlsActions.ActionDescription String description, Icon icon) { super(text, description, icon); } public Down(ToolWindow toolWindow, JComponent c) { super(toolWindow, "ResizeToolWindowDown", c); } @Override protected void update(AnActionEvent event, ToolWindow window, ToolWindowManager mgr) { event.getPresentation().setEnabled(window.getAnchor().isHorizontal()); } @Override protected void actionPerformed(AnActionEvent e, ToolWindow toolWindow, ToolWindowManager toolWindowManager) { stretch(toolWindow, false, false); } } private class DefaultToolWindowScrollable implements ToolWindowScrollable { @Override public boolean isHorizontalScrollingNeeded() { return true; } @Override public int getNextHorizontalScroll() { return getReferenceSize().width * Registry.intValue("ide.windowSystem.hScrollChars"); } @Override public boolean isVerticalScrollingNeeded() { return true; } @Override public int getNextVerticalScroll() { return getReferenceSize().height * Registry.intValue("ide.windowSystem.vScrollChars"); } } private Dimension getReferenceSize() { if (myScrollHelper == null) { if (SwingUtilities.isEventDispatchThread()) { myScrollHelper = new JLabel("W"); //NON-NLS } else { return new Dimension(1, 1); } } return myScrollHelper.getPreferredSize(); } }
{ "content_hash": "5b4143648d5d37f74f241cd0c8bc250a", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 151, "avg_line_length": 31.51675977653631, "alnum_prop": 0.7119560400602677, "repo_name": "zdary/intellij-community", "id": "b304f3e97cf49db3690e94a6c4a1fc398c4ecdde", "size": "11424", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "platform/platform-impl/src/com/intellij/ide/actions/ResizeToolWindowAction.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<# .SYNOPSIS Apply the Defender exclusions based on recommendations by Microsoft .DESCRIPTION Apply the Defender exclusions based on recommendations by Microsoft, Some additional Controlled Folder Access Allowed Applications will be added as well .EXAMPLE PS C:\> Optimize-MicrosoftDefenderExclusions.ps1 .NOTES Do not just use set-mppreference here, this might remove any existing exclusions. Might be the right thing to do, but with add-mppreference you append to the list (if exists). Changelog: 1.0.4: Reformated 1.0.3: Add ControlledFolderAccessAllowedApplications handling 1.0.2: First real release 1.0.0: Intital beta version Version 1.0.4 .LINK http://enatec.io .LINK https://support.microsoft.com/en-ie/help/822158/virus-scanning-recommendations-for-enterprise-computers-that-are-runni .LINK https://docs.microsoft.com/en-us/powershell/module/defender/add-mppreference .LINK https://docs.microsoft.com/en-us/powershell/module/defender/set-mppreference #> [CmdletBinding(ConfirmImpact = 'Medium', SupportsShouldProcess)] param () begin { Write-Output -InputObject 'Apply the Defender exclusions based on recommendations by Microsoft' #region $SCT = 'SilentlyContinue' #endregion if (Get-Command -Name 'Set-MpPreference' -ErrorAction $SCT) { $null = (Set-MpPreference -EnableControlledFolderAccess Disabled -Force -ErrorAction $SCT) } #region DefaultExclusions $ExcludePathList = @( "$env:windir\SoftwareDistribution\DataStore\Datastore.edb", "$env:windir\SoftwareDistribution\DataStore\Logs\Edb*.jrs", "$env:windir\SoftwareDistribution\DataStore\Logs\Edb.chk", "$env:windir\SoftwareDistribution\DataStore\Logs\Tmp.edb", "$env:windir\Security\Database\*.edb", "$env:windir\Security\Database\*.sdb", "$env:windir\Security\Database\*.log", "$env:windir\Security\Database\*.chk", "$env:windir\Security\Database\*.jrs", "$env:windir\Security\Database\*.xml", "$env:windir\Security\Database\*.csv", "$env:windir\Security\Database\*.cmtx", "$env:windir\System32\GroupPolicy\Machine\Registry.pol", "$env:windir\System32\GroupPolicy\Machine\Registry.tmp", "$env:windir\System32\GroupPolicy\User\Registry.pol", "$env:windir\System32\GroupPolicy\User\Registry.tmp", "$env:ProgramData\ntuser.pol", "$env:ProgramData\chocolatey\lib\sysinternals\tools\*.exe" ) #endregion DefaultExclusions #region AdExclusions # Turn off scanning of Active Directory and Active Directory-related files # Exclude the Main NTDS database files. $DSADatabaseFile = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters' $DSADatabaseFilePath = ('Registry::' + $DSADatabaseFile) $paramTestPath = @{ Path = $DSADatabaseFilePath ErrorAction = $SCT } if (Test-Path @paramTestPath) { $paramGetItemProperty = @{ Path = $DSADatabaseFilePath ErrorAction = $SCT } $DSADatabaseFileValue = (Get-ItemProperty @paramGetItemProperty | Select-Object -ExpandProperty 'DSA Database file') if ($DSADatabaseFileValue) { $ExcludePathList += ($DSADatabaseFileValue) $ExcludePathList += ($DSADatabaseFileValue).Replace('.dit', '.pat') } } else { Write-Verbose -Message 'No NTDS database files to exclude' } # Exclude the Active Directory transaction log files. $DatabaseLogFiles = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters' $DatabaseLogFilesPath = ('Registry::' + $DatabaseLogFiles) $paramTestPath = @{ Path = $DatabaseLogFilesPath ErrorAction = $SCT } if (Test-Path @paramTestPath) { $paramGetItemProperty = @{ Path = $DatabaseLogFilesPath ErrorAction = $SCT } $DatabaseLogFilesPathValue = (Get-ItemProperty @paramGetItemProperty | Select-Object -ExpandProperty 'Database Log Files Path') if ($DatabaseLogFilesPathValue) { $ExcludePathList += ($DatabaseLogFilesPathValue + '\EDB*.log') $ExcludePathList += ($DatabaseLogFilesPathValue + '\Res*.log') $ExcludePathList += ($DatabaseLogFilesPathValue + '\Edb*.jrs') $ExcludePathList += ($DatabaseLogFilesPathValue + '\Ntds.pat') } } else { Write-Verbose -Message 'No Active Directory transaction log files to exclude' } # Exclude the files in the NTDS Working folder $DSAWorkingDir = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters' $DSAWorkingDirPath = ('Registry::' + $DSAWorkingDir) $paramTestPath = @{ Path = $DSAWorkingDirPath ErrorAction = $SCT } if (Test-Path @paramTestPath) { $paramGetItemProperty = @{ Path = $DSAWorkingDirPath ErrorAction = $SCT } $DSAWorkingDirValue = (Get-ItemProperty @paramGetItemProperty | Select-Object -ExpandProperty 'DSA Working Directory') if ($DSAWorkingDirValue) { $ExcludePathList += ($DSAWorkingDirValue + '\Temp.edb') $ExcludePathList += ($DSAWorkingDirValue + '\Edb.chk') } } else { Write-Verbose -Message 'No NTDS Working folder to exclude' } #endregion AdExclusions #region SysVolExclusions # Turn off scanning of SYSVOL files # Turn off scanning of files in the File Replication Service (FRS) Working folder $SysVolWorkingDir = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NtFrs\Parameters' $SysVolWorkingDirPath = ('Registry::' + $SysVolWorkingDir) $paramTestPath = @{ Path = $SysVolWorkingDirPath ErrorAction = $SCT } if (Test-Path @paramTestPath) { $paramGetItemProperty = @{ Path = $SysVolWorkingDirPath ErrorAction = $SCT } $SysVolWorkingDirValue = (Get-ItemProperty @paramGetItemProperty | Select-Object -ExpandProperty 'Working Directory') if ($SysVolWorkingDirValue) { $ExcludePathList += ($SysVolWorkingDirValue + '\jet\sys\edb.chk') $ExcludePathList += ($SysVolWorkingDirValue + '\jet\Ntfrs.jdb') $ExcludePathList += ($SysVolWorkingDirValue + '\jet\log\*.log') } } else { Write-Verbose -Message 'No File Replication Service Working folder to exclude' } # Turn off scanning of files in the File Replication Service Database Log files $SysVolDBLogFileDir = 'HKEY_LOCAL_MACHINE\SYSTEM\Currentcontrolset\Services\Ntfrs\Parameters' $SysVolDBLogFileDirPath = ('Registry::' + $SysVolDBLogFileDir) if (Test-Path -Path $SysVolDBLogFileDirPath -ErrorAction $SCT) { $paramGetItemProperty = @{ Path = $SysVolWorkingDirPath ErrorAction = $SCT } $SysVolDBLogFileDirValue = (Get-ItemProperty @paramGetItemProperty | Select-Object -ExpandProperty 'Working Directory') if ($SysVolDBLogFileDirValue) { $ExcludePathList += ($SysVolDBLogFileDirValue + '\Jet\Log\Edb*.jrs') } else { if ($SysVolWorkingDirValue) { $ExcludePathList += ($SysVolWorkingDirValue + '\jet\Log\Edb*.log') } } } else { Write-Verbose -Message 'No File Replication Service Database Log files to exclude' } #endregion SysVolExclusions #region DhcpExclusions # Turn off scanning of DHCP files $DhcpFiles = 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\DHCPServer\Parameters' $DhcpFilesPath = ('Registry::' + $DhcpFiles) $paramTestPath = @{ Path = $DhcpFilesPath ErrorAction = $SCT } if (Test-Path @paramTestPath) { $paramGetItemProperty = @{ Path = $DhcpFilesPath ErrorAction = $SCT } $DhcpDatabasePathValue = (Get-ItemProperty @paramGetItemProperty | Select-Object -ExpandProperty 'DatabasePath') if ($DhcpDatabasePathValue) { $ExcludePathList += ($DhcpDatabasePathValue + '\*.mdb') $ExcludePathList += ($DhcpDatabasePathValue + '\*.pat') $ExcludePathList += ($DhcpDatabasePathValue + '\*.chk') $ExcludePathList += ($DhcpDatabasePathValue + '\*.edb') } $paramGetItemProperty = @{ Path = $DhcpFilesPath ErrorAction = $SCT } $DhcpLogFilePathValue = (Get-ItemProperty @paramGetItemProperty | Select-Object -ExpandProperty 'DhcpLogFilePath') if (($DhcpLogFilePathValue) -and ($DhcpLogFilePathValue -ne $DhcpDatabasePathValue)) { $ExcludePathList += ($DhcpLogFilePathValue + '\*.log') } else { $ExcludePathList += ($DhcpDatabasePathValue + '\*.log') } $paramGetItemProperty = @{ Path = $DhcpFilesPath ErrorAction = $SCT } $DhcpBackupDatabasePathValue = (Get-ItemProperty @paramGetItemProperty | Select-Object -ExpandProperty 'BackupDatabasePath') if ($DhcpBackupDatabasePathValue) { $ExcludePathList += ($DhcpBackupDatabasePathValue + '\new\*.mdb') $ExcludePathList += ($DhcpBackupDatabasePathValue + '\new\*.pat') $ExcludePathList += ($DhcpBackupDatabasePathValue + '\new\*.chk') $ExcludePathList += ($DhcpBackupDatabasePathValue + '\new\*.edb') $ExcludePathList += ($DhcpBackupDatabasePathValue + '\new\*.log') } } else { Write-Verbose -Message 'No DHCP Server Directory found' } #endregion DhcpExclusions #region DnsExclusions $DnsServerDir = "$env:windir\System32\dns" $paramTestPath = @{ Path = $DnsServerDir ErrorAction = $SCT } if (Test-Path @paramTestPath) { $ExcludePathList += ($DnsServerDir + '\*.log') $ExcludePathList += ($DnsServerDir + '\*.dns') $ExcludePathList += ($DnsServerDir + '\BOOT') $DnsBackupServerDir = ($DnsServerDir + '\backup') $paramTestPath = @{ Path = $DnsBackupServerDir ErrorAction = $SCT } if (Test-Path @paramTestPath) { $ExcludePathList += ($DnsBackupServerDir + '\*.log') $ExcludePathList += ($DnsBackupServerDir + '\*.dns') $ExcludePathList += ($DnsBackupServerDir + '\BOOT') } } else { Write-Verbose -Message 'No DNS Server Directory found' } #endregion DnsExclusions #region WinsExclusions $WinsServerDir = "$env:windir\System32\Wins" $paramTestPath = @{ Path = $WinsServerDir ErrorAction = $SCT } if (Test-Path @paramTestPath) { Write-Warning -Message 'WINS is still installed on this system!' -WarningAction Continue $ExcludePathList += ($WinsServerDir + '\*.chk') $ExcludePathList += ($WinsServerDir + '\*.log') $ExcludePathList += ($WinsServerDir + '\*.mdb') } else { Write-Verbose -Message 'No WINS Server Directory found' } #endregion WinsExclusions } process { if ($pscmdlet.ShouldProcess($ExcludePathList, 'Exclude from Microsoft Defender Scanning')) { # Loop over the list we created foreach ($ExcludePath in $ExcludePathList) { try { # Splat the parameters for Add-MpPreference $SplatAddMpPreference = @{ ExclusionPath = $ExcludePath Force = $true ErrorAction = 'Stop' WarningAction = 'Continue' } $null = (Add-MpPreference @SplatAddMpPreference) } catch { #region ErrorHandler # get error record [Management.Automation.ErrorRecord]$e = $_ # retrieve information about runtime error $info = @{ Exception = $e.Exception.Message Reason = $e.CategoryInfo.Reason Target = $e.CategoryInfo.TargetName Script = $e.InvocationInfo.ScriptName Line = $e.InvocationInfo.ScriptLineNumber Column = $e.InvocationInfo.OffsetInLine } # Error Stack $info | Out-String | Write-Verbose # Just display the info on continue with the rest of the list Write-Warning -Message ($info.Exception) -ErrorAction Continue -WarningAction Continue # Cleanup $info = $null $e = $null #endregion ErrorHandler } } } if ($pscmdlet.ShouldProcess($ExcludePathList, 'Tweak Controlled Folder AccessAllowed Applications')) { $paramGetMpPreference = @{ ErrorAction = $SCT } $CurrentAllowedApplications = ((Get-MpPreference @paramGetMpPreference).ControlledFolderAccessAllowedApplications) # Prevent issues with missing allowed applications if (-not ($CurrentAllowedApplications)) { # New installations might not have allowed applications, let us create an empty object $CurrentAllowedApplications = @() } $AllowedApplications = @( 'C:\Program Files (x86)\KeePass Password Safe 2\KeePass.exe' 'C:\Program Files\Intel\Intel(R) Rapid Storage Technology\IAStorDataMgrSvc.exe' 'C:\ProgramData\chocolatey\lib\vlc\tools\vlc-*-win64_x64.exe' 'C:\swsetup\SP*\HPImageAssistant.dll' 'C:\Users\*\AppData\Local\Programs\Mark Text\Mark Text.exe' 'C:\Users\*\AppData\Local\Temp\chocolatey\is-*.tmp\WinSCP-*-Setup.tmp' 'C:\Windows\explorer.exe' 'C:\Windows\System32\svchost.exe' 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe' ) $AllowedApplications | ForEach-Object -Process { if (-not ($CurrentAllowedApplications.Contains($_))) { # Not the fasted way, but this will work just fine $CurrentAllowedApplications += $_ } } try { # Apply the new (merged) allowed application list to the Defender Controlled Folder Access Allowed feature $paramAddMpPreference = @{ ControlledFolderAccessAllowedApplications = $CurrentAllowedApplications Force = $true ErrorAction = 'Stop' } $null = (Add-MpPreference @paramAddMpPreference) } catch { Write-Warning -Message 'Unable to modify the allow list...' } } } end { if (Get-Command -Name 'Set-MpPreference' -ErrorAction $SCT) { $null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction $SCT) } } #region LICENSE <# BSD 3-Clause License Copyright (c) 2021, enabling Technology All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder 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 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #> #endregion LICENSE #region DISCLAIMER <# DISCLAIMER: - Use at your own risk, etc. - This is open-source software, if you find an issue try to fix it yourself. There is no support and/or warranty in any kind - This is a third-party Software - The developer of this Software is NOT sponsored by or affiliated with Microsoft Corp (MSFT) or any of its subsidiaries in any way - The Software is not supported by Microsoft Corp (MSFT) - By using the Software, you agree to the License, Terms, and any Conditions declared and described above - If you disagree with any of the Terms, and any Conditions declared: Just delete it and build your own solution #> #endregion DISCLAIMER
{ "content_hash": "7157a6dc6e7bf4dfc5e6d2c00640d563", "timestamp": "", "source": "github", "line_count": 471, "max_line_length": 755, "avg_line_length": 35.89171974522293, "alnum_prop": 0.6562555456965394, "repo_name": "jhochwald/PowerShell-collection", "id": "e18caf1353b4c946875542e8fbab0569cf55255f", "size": "16949", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "Windows10-Bootstrapper/sources/$OEM$/$1/scripts/PowerShell/Optimize-MicrosoftDefenderExclusions.ps1", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "232763" }, { "name": "PowerShell", "bytes": "2682849" } ], "symlink_target": "" }
still heavy with the news about the orlando club shooting. ...watched [women in revolt](women_in_revolt.md) last night. heavy. awkward. didn't specifically see sissy spacek. exercise videoz and parallel beatz have been slowly coming together the wedge between ontology and epistemology other \#TODOz: revision of korn's [fagget](fagget.md) <https://www.tdcj.state.tx.us/death_row/dr_executed_offenders.html> <https://en.wikipedia.org/wiki/Andy_Warhol> <http://www.filmreference.com/Directors-Mi-Pe/Morrissey-Paul.html> <http://www.imdb.com/title/tt0066482/plotsummary?ref_=tt_ov_pl> <https://en.wikipedia.org/wiki/Women_in_Revolt> <http://web.archive.org/web/20021220181151/http://www.dollsoup.co.uk/revolt.htm> <https://en.wikipedia.org/wiki/Sissy_Spacek> <https://books.google.com/books?id=OmBQv6Ib6tgC&pg=PT103&lpg=PT103&dq=sissy+spacek+%22women+in+revolt%22&source=bl&ots>=-iSzQm_9Ui&sig=1gmU6RT7c4gfwoiSAuMh9YatRH8&hl=en&sa=X&ved=0ahUKEwipl4XOz6jNAhVDwWMKHRjBCYcQ6AEIODAE\#v=onepage&q=sissy%20spacek%20%22women%20in%20revolt%22&f=false Sunday, April 10, 1977 control. control of self. schizophrenic. desiring machine. paranoia machine. using anesthetic to disable socially programmed movements/responses. but finding it hard to get doctor to administer. correlates visually to illness. dana michel yellow towel <https://vimeo.com/69939175> [text to speech 2016-6-14-15-33](/text_to_speech_2016-6-14-15-33.md) what to post online. fresh air. walkz.
{ "content_hash": "10d75f0aca50bc4686dba57e78bfe570", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 283, "avg_line_length": 36.825, "alnum_prop": 0.778682959945689, "repo_name": "lacunaclub/wiki", "id": "882250c66072ef6ff801ae9addfca876d6b904c1", "size": "1506", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pages/performance_writing_6-14-2016.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "93" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("15BitsExchange(advanced)")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("15BitsExchange(advanced)")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("0a20b646-b942-409b-bc2a-06a7b0a143b6")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "60e929ff727e3dd06de3bf71195e33e1", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 39.47222222222222, "alnum_prop": 0.7466572836030964, "repo_name": "Maindfield/03-Operators-And-Expressions", "id": "08d4a26d918a10a799bc685de90419083cf25a4f", "size": "1424", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "15BitsExchange(advanced)/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "39886" } ], "symlink_target": "" }
#ifndef N_TEST_H #define N_TEST_H #include "atest.h" #include "atcheck.h" #include "common/errors.h" #define DESTRUCTOR(NAME) at_destructor(NAME) #define CONSTRUCTOR(NAME) at_constructor(NAME) #define SETUP(NAME) at_setup(NAME) #define TEARDOWN(NAME) at_teardown(NAME) #define TEST(NAME) at_test(NAME) #define DD_TEST(NM, ITER, IT, IN) at_data_driven_test(NM, ITER, IT, IN) #define ASSERT(CHECK) at_assert(CHECK) #define ERROR(MSG, DISPOSE) at_error(MSG, DISPOSE) /* Helper functions. */ AtCheckResult is_error(const char* expr, NError* err, const char* type_name); AtCheckResult is_error_type(const char* expr, NError* err, NErrorType* type_name); /* Checks used during the tests. */ #define EQ_PTR(VALUE, EXPECTED) AT_EQ_PTR(VALUE, EXPECTED) #define IS_NULL(VALUE) AT_IS_NULL(VALUE) #define IS_TRUE(VALUE) AT_IS_TRUE(VALUE) #define IS_ERROR(VALUE, ERROR) is_error(#VALUE, &VALUE, ERROR) #define IS_ERROR_TYPE(VAL, ERR) is_error_type(#VAL, &VAL, ERR) #define IS_OK(VALUE) IS_ERROR_TYPE(VALUE, NULL) #define EQ_STR(VALUE, EXPECTED) AT_EQ_STR(VALUE, EXPECTED) #define EQ_INT(VALUE, EXPECTED) AT_EQ_INT(VALUE, EXPECTED) #define EQ_UINT(VALUE, EXPECTED) AT_EQ_UINT(VALUE, EXPECTED) #define EQ_LONG(VALUE, EXPECTED) AT_EQ_LONG(VALUE, EXPECTED) #define TEST_RUNNER(NAME, TESTS, CR, DR, SU, TD) \ int main(int argc, char** argv) { \ AtTest** _tests = tests; \ AtStreamReporter* reporter = NULL; \ AtSuite* suite = \ at_new_suite(NAME, CR, DR, SU, TD); \ \ while (*_tests) { \ at_add_test(suite, *_tests); \ _tests++; \ } \ \ if (argc > 1) { \ const char* file_name = argv[1]; \ reporter = at_new_stream_reporter(file_name); \ } \ \ at_run_suite(suite, (AtReporter*) reporter); \ return 0; \ } typedef struct { const char* contents; void (*clean_up)(const char*); } NtTestMessage; NtTestMessage NT_MAKE_MODULE_INIT_ERROR_MSG(NError* error); #define NT_INITIALIZE_MODULE(MOD_INIT_FUNC) do { \ NError ERR = n_error_ok(); \ MOD_INIT_FUNC(&ERR); \ if (!n_is_ok(&ERR)) { \ NtTestMessage msg = NT_MAKE_MODULE_INIT_ERROR_MSG(&ERR); \ n_destroy_error(&ERR); \ ERROR(msg.contents, msg.clean_up); \ } \ } while(0) #endif /* N_TEST_H */
{ "content_hash": "059fdb218796d3b26e6a58fdd79e9c1c", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 71, "avg_line_length": 37.08139534883721, "alnum_prop": 0.46252743806836, "repo_name": "alexandream/nuvm", "id": "b344acf0d63d9531a05b74a45cbc8e3812e103c5", "size": "3189", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/test.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "234175" }, { "name": "C++", "bytes": "9138" }, { "name": "Makefile", "bytes": "2023" }, { "name": "Shell", "bytes": "3376" } ], "symlink_target": "" }
from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from horizon import api from horizon import exceptions from horizon import tabs class OverviewTab(tabs.Tab): name = _("Overview") slug = "overview" template_name = ("nova/images_and_snapshots/snapshots/" "_detail_overview.html") def get_context_data(self, request): snapshot_id = self.tab_group.kwargs['snapshot_id'] try: snapshot = api.nova.volume_snapshot_get(request, snapshot_id) volume = api.nova.volume_get(request, snapshot.volume_id) volume.display_name = None except: redirect = reverse('horizon:nova:images_and_snapshots:index') exceptions.handle(self.request, _('Unable to retrieve snapshot details.'), redirect=redirect) return {'snapshot': snapshot, 'volume': volume} class SnapshotDetailTabs(tabs.TabGroup): slug = "snapshot_details" tabs = (OverviewTab,)
{ "content_hash": "ce7c3d7ffbf39cdea88311e44b6dc432", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 73, "avg_line_length": 34.0625, "alnum_prop": 0.6211009174311927, "repo_name": "vbannai/disk-qos-horizon", "id": "6aa87877d52c82cb6cd4968264fcd7228808fbc2", "size": "1740", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "horizon/dashboards/nova/images_and_snapshots/volume_snapshots/tabs.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "234763" }, { "name": "Python", "bytes": "1188959" }, { "name": "Shell", "bytes": "11808" } ], "symlink_target": "" }
"use strict";//Just don't cross the streams!! String.prototype.trim = function () { return this.replace(/^\s*/, "").replace(/\s*$/, ""); }
{ "content_hash": "a09bcd50d8b42f79274d44fcab854683", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 56, "avg_line_length": 28.8, "alnum_prop": 0.5902777777777778, "repo_name": "scirelli/jssnakes", "id": "865ba43f91b64d413bf3ae3e4829df559265298b", "size": "144", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/extras-string.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6030" }, { "name": "HTML", "bytes": "7018" }, { "name": "JavaScript", "bytes": "14793" }, { "name": "PHP", "bytes": "88" }, { "name": "Vim script", "bytes": "10759" } ], "symlink_target": "" }
package org.fluentjava.iwant.api.zip; import java.io.File; import java.io.InputStream; import java.util.Arrays; import java.util.List; import org.apache.tools.ant.taskdefs.Expand; import org.fluentjava.iwant.api.model.Path; import org.fluentjava.iwant.api.model.Target; import org.fluentjava.iwant.api.model.TargetEvaluationContext; public class Unzipped extends Target { private final Path from; public Unzipped(String name, Path from) { super(name); this.from = from; } public static UnzippedSpex with() { return new UnzippedSpex(); } public static class UnzippedSpex { private String name; private Path from; public Unzipped end() { return new Unzipped(name, from); } public UnzippedSpex name(String name) { this.name = name; return this; } public UnzippedSpex from(Path from) { this.from = from; return this; } } @Override public InputStream content(TargetEvaluationContext ctx) throws Exception { throw new UnsupportedOperationException("TODO test and implement"); } @Override public List<Path> ingredients() { return Arrays.asList(from); } @Override public void path(TargetEvaluationContext ctx) throws Exception { File dest = ctx.cached(this); unzipTo(ctx.cached(from), dest); } public static void unzipTo(File from, File to) { Expand untar = new Expand(); untar.setDest(to); untar.setSrc(from); untar.execute(); } @Override public String contentDescriptor() { return getClass().getCanonicalName() + ":" + ingredients(); } public Path from() { return from; } }
{ "content_hash": "248ef88064cd4714b38f4242395efbb2", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 75, "avg_line_length": 19.37037037037037, "alnum_prop": 0.7202039515615042, "repo_name": "wipu/iwant", "id": "64f3e492b379de1ed51c8db112cc7552a2399558", "size": "1569", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "essential/iwant-api-zip/src/main/java/org/fluentjava/iwant/api/zip/Unzipped.java", "mode": "33188", "license": "mit", "language": [ { "name": "Asymptote", "bytes": "1632" }, { "name": "CSS", "bytes": "1002" }, { "name": "HTML", "bytes": "193697" }, { "name": "Java", "bytes": "1253244" }, { "name": "Scala", "bytes": "260" }, { "name": "Shell", "bytes": "74333" } ], "symlink_target": "" }