text
stringlengths
2
1.04M
meta
dict
// copyright 2013 github.com/jestan (Jestan Nirojan), 2016 nqzero - offered under the MIT License // jestan relicensed under mit from apache 2.0 in commit 6257a448d74616b4c2bc3a7d3cdf354de39165d7 package kilim.plugins; import kilim.tools.Weaver; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import java.io.File; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; /** * maven plugin for ahead-of-time weaving of class files */ @Mojo(name = "weave", defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES, requiresDependencyResolution=ResolutionScope.RUNTIME) public class KilimMavenPlugin extends AbstractMojo { /** additional arguments to pass to the weaver */ @Parameter(defaultValue="-q", property = "kilim.args", required = false) private String args; /** location of the class files */ @Parameter(defaultValue = "${project.build.outputDirectory}", property = "kilim.in", required = true) private File in; /** location of the test class files */ @Parameter(defaultValue = "${project.build.testOutputDirectory}", property = "kilim.tin", required = true) private File tin; /** destination for the woven class files */ @Parameter(defaultValue = "${project.build.outputDirectory}", property = "kilim.out", required = true) private File out; /** destination for the woven test class files */ @Parameter(defaultValue = "${project.build.testOutputDirectory}", property = "kilim.tout", required = true) private File tout; @Parameter( defaultValue = "${project}", readonly = true, required = true ) private MavenProject project; public void execute() throws MojoExecutionException { try { String indir = in.getAbsolutePath(); String tindir = tin.getAbsolutePath(); String outdir = out.getAbsolutePath(); String toutdir = tout.getAbsolutePath(); { getLog().debug("kilim weaver input/output dirs are: " + indir + ", " + outdir); String [] roots = project.getCompileClasspathElements().toArray(new String[0]); Weaver.outputDir = outdir; getLog().debug("plugin.args: " + args); if (args != null && args.length() > 0) { Weaver.parseArgs(args.split(" ")); } int err = Weaver.doMain(new String []{ indir },roots); getLog().debug("kilim weaver done"); if (err > 0) throw new MojoExecutionException("Error while weaving the classes"); } { getLog().debug("kilim weaver test input/output dirs are: " + tindir + ", " + toutdir); String [] troots = project.getTestClasspathElements().toArray(new String[0]); Weaver.outputDir = toutdir; int err = Weaver.doMain(new String []{ tindir },troots); getLog().debug("kilim weaver done - tests"); if (err > 0) throw new MojoExecutionException("Error while weaving the test classes"); } } catch (Exception e) { throw new MojoExecutionException("Error while weaving the classes", e); } } }
{ "content_hash": "a6622ea14913d83f06870512ae0377e7", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 111, "avg_line_length": 41.44705882352941, "alnum_prop": 0.6383763837638377, "repo_name": "nqzero/kilim", "id": "4a219ee97ee1e44b546f23f16669420699abc6d4", "size": "3523", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/kilim/plugins/KilimMavenPlugin.java", "mode": "33188", "license": "mit", "language": [ { "name": "Erlang", "bytes": "5499" }, { "name": "Haskell", "bytes": "1248" }, { "name": "Jasmin", "bytes": "9664" }, { "name": "Java", "bytes": "835010" }, { "name": "Ragel", "bytes": "10971" }, { "name": "Scala", "bytes": "6479" }, { "name": "Shell", "bytes": "1486" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <script src="resources/SVGTestCase.js"></script> <script src="../../resources/js-test.js"></script> <script src="../../paint/invalidation/resources/text-based-repaint.js"></script> </head> <body onload="runRepaintTest()"> <h1>SVG 1.1 dynamic update tests</h1> <p id="description"></p> <div id="console"></div> <script src="script-tests/SVGCursorElement-svgdom-x-prop.js"></script> </body> </html>
{ "content_hash": "124eb64a00fc473acde90314ee7a2d44", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 80, "avg_line_length": 32.714285714285715, "alnum_prop": 0.6855895196506551, "repo_name": "Samsung/ChromiumGStreamerBackend", "id": "9822b54e3a30d5654d01bab04e80b9598e9a564a", "size": "458", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "third_party/WebKit/LayoutTests/svg/dynamic-updates/SVGCursorElement-svgdom-x-prop.html", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.10"/> <title>EIT: Class Members</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">EIT </div> <div id="projectbrief">The EIT Generic movement platform documentation for the DatabaseHandler</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.10 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Packages</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> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li class="current"><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="navrow3" class="tabs2"> <ul class="tablist"> <li class="current"><a href="functions.html"><span>All</span></a></li> <li><a href="functions_func.html"><span>Functions</span></a></li> <li><a href="functions_vars.html"><span>Variables</span></a></li> </ul> </div> <div id="navrow4" class="tabs3"> <ul class="tablist"> <li><a href="functions.html#index__"><span>_</span></a></li> <li><a href="functions_a.html#index_a"><span>a</span></a></li> <li><a href="functions_b.html#index_b"><span>b</span></a></li> <li><a href="functions_c.html#index_c"><span>c</span></a></li> <li><a href="functions_d.html#index_d"><span>d</span></a></li> <li><a href="functions_e.html#index_e"><span>e</span></a></li> <li><a href="functions_f.html#index_f"><span>f</span></a></li> <li><a href="functions_g.html#index_g"><span>g</span></a></li> <li><a href="functions_j.html#index_j"><span>j</span></a></li> <li><a href="functions_l.html#index_l"><span>l</span></a></li> <li><a href="functions_m.html#index_m"><span>m</span></a></li> <li><a href="functions_n.html#index_n"><span>n</span></a></li> <li><a href="functions_o.html#index_o"><span>o</span></a></li> <li class="current"><a href="functions_p.html#index_p"><span>p</span></a></li> <li><a href="functions_r.html#index_r"><span>r</span></a></li> <li><a href="functions_s.html#index_s"><span>s</span></a></li> <li><a href="functions_t.html#index_t"><span>t</span></a></li> <li><a href="functions_u.html#index_u"><span>u</span></a></li> <li><a href="functions_v.html#index_v"><span>v</span></a></li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('functions_p.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="contents"> <div class="textblock">Here is a list of all class members with links to the classes they belong to:</div> <h3><a class="anchor" id="index_p"></a>- p -</h3><ul> <li>password : <a class="el" href="classmodels_1_1_user_class_1_1_user_class.html#a632b49bc8db78aa521ce1a302f3a4542">models.UserClass.UserClass</a> </li> <li>patientConditionID : <a class="el" href="classmodels_1_1_patient_condition_class_1_1_patient_condition_class.html#ad6824462419f027ad65851396e299c52">models.PatientConditionClass.PatientConditionClass</a> </li> <li>patientConditionIDs : <a class="el" href="classmodels_1_1_rehabilitation_set_class_1_1_rehabilitation_set_class.html#a30df23269250383985e726993367a78a">models.RehabilitationSetClass.RehabilitationSetClass</a> </li> <li>patientEngine : <a class="el" href="classdatabase__handler_1_1_database_handler.html#a777ab1ede9a96d7f8fcb3247f422445d">database_handler.DatabaseHandler</a> </li> <li>patientID : <a class="el" href="classmodels_1_1_patient_class_1_1_patient_class.html#ae2d903d179f5a1cbf8b8a54fab808ad0">models.PatientClass.PatientClass</a> </li> <li>patientIDs : <a class="el" href="classmodels_1_1_user_class_1_1_user_class.html#a9353c7eabd6dffb97bbc30feef490436">models.UserClass.UserClass</a> </li> <li>patientInformationID : <a class="el" href="classmodels_1_1_patient_information_class_1_1_patient_information_class.html#a6120ec5a717e88d3d1eb1419e78da56e">models.PatientInformationClass.PatientInformationClass</a> , <a class="el" href="classmodels_1_1_rehabilitation_set_class_1_1_rehabilitation_set_class.html#a31f82c5d968e5f76a306acd5a53ed244">models.RehabilitationSetClass.RehabilitationSetClass</a> </li> <li>patientSession : <a class="el" href="classdatabase__handler_1_1_database_handler.html#ad05351e0981efa5ebcd57d2ed496d809">database_handler.DatabaseHandler</a> </li> <li>permissionLevel : <a class="el" href="classmodels_1_1_user_group_class_1_1_user_group_class.html#a1ff9ce4aab3b328a871c6f00ffcbee0b">models.UserGroupClass.UserGroupClass</a> </li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li> </ul> </div> </body> </html>
{ "content_hash": "bf08f10bbf4d356e3ab849ebd8dc82b1", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 192, "avg_line_length": 46.18131868131868, "alnum_prop": 0.664128494943486, "repo_name": "improve-project/platform", "id": "41ed9f67b0f88ed8171d5f174698745b0840e76b", "size": "8405", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/database_handler/functions_p.html", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "554005" } ], "symlink_target": "" }
package org.apache.sysml.runtime.matrix.operators; import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.functionobjects.GreaterThan; import org.apache.sysml.runtime.functionobjects.GreaterThanEquals; import org.apache.sysml.runtime.functionobjects.LessThan; import org.apache.sysml.runtime.functionobjects.LessThanEquals; import org.apache.sysml.runtime.functionobjects.ValueFunction; public class RightScalarOperator extends ScalarOperator { private static final long serialVersionUID = 5148300801904349919L; public RightScalarOperator(ValueFunction p, double cst) { super(p, cst); } @Override public double executeScalar(double in) throws DMLRuntimeException { return fn.execute(in, _constant); } @Override public void setConstant(double cst) { super.setConstant(cst); //enable conditionally sparse safe operations if( (fn instanceof GreaterThan && _constant>=0) || (fn instanceof GreaterThanEquals && _constant>0) || (fn instanceof LessThan && _constant<=0) || (fn instanceof LessThanEquals && _constant<0)) { sparseSafe = true; } } }
{ "content_hash": "ae14fdd983424b15d9effeacf403f314", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 68, "avg_line_length": 26.209302325581394, "alnum_prop": 0.7675244010647737, "repo_name": "Myasuka/systemml", "id": "3a4c481d8b7de5acad7583b4cb64b747a97b9eb6", "size": "1936", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/org/apache/sysml/runtime/matrix/operators/RightScalarOperator.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "57702" }, { "name": "Batchfile", "bytes": "36911" }, { "name": "CSS", "bytes": "7073" }, { "name": "HTML", "bytes": "560180" }, { "name": "Java", "bytes": "18805881" }, { "name": "JavaScript", "bytes": "5957" }, { "name": "Python", "bytes": "14649" }, { "name": "R", "bytes": "838387" }, { "name": "Shell", "bytes": "192241" }, { "name": "TeX", "bytes": "285436" } ], "symlink_target": "" }
layout: page title: Acting subtitle: Coming soon... --- To be edited.
{ "content_hash": "f72fee669c50a4ce50c050257bb9fc92", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 24, "avg_line_length": 11.833333333333334, "alnum_prop": 0.6901408450704225, "repo_name": "paulhendricks/kylehendershot.com", "id": "b4b5ea0a665ff7e9b7a4abfcd86091a740694002", "size": "75", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "acting.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "23179" }, { "name": "HTML", "bytes": "5635" } ], "symlink_target": "" }
/** * @file Driver for DesignWare PWM driver. * * The timer IP block can act as both timer and PWM. Under PWM mode, each port * has two registers to specify how long to stay low, and how long to stay high. * Care must be taken so that PWM and timer functions are not both enabled * on one port. * * The set of registers for each timer repeats every 0x14. * However, the load count 2 starts at 0xB0, and repeats every 0x04. * Accessing load count 2 registers, thus, requires some special treatment. */ #include <nanokernel.h> #include <pwm.h> /* Register for component version */ #define REG_COMP_VER 0xAC /* Timer Load Count register, for pin to stay low. */ #define REG_TMR_LOAD_CNT 0x00 /* Control for timer */ #define REG_TMR_CTRL 0x08 /* Offset from Timer 1 Load Count address * for other timers. (e.g. Timer 2 address +0x14, * timer 3 address + 0x28, etc.) * * This also applies to other registers for * different timers (except load count 2). */ #define REG_OFFSET 0x14 /* Timer Load Count 2 register, for pin to stay high. */ #define REG_TMR_LOAD_CNT2 0xB0 /* Offset from Timer 1 Load Count 2 address * for other timers. (e.g. Timer 2 address +0x04, * timer 3 address + 0x08, etc.) */ #define REG_OFFSET_LOAD_CNT2 0x04 /* Default for control register: * PWM mode, interrupt masked, user-defined count mode, but disabled */ #define TIMER_INIT_CTRL 0x0E struct pwm_dw_config { /** Base address of registers */ uint32_t addr; /** Number of ports */ uint32_t num_ports; }; /** * Find the base address for each timer * * @param dev Device struct * @param timer Which timer * * @return The base address of that particular timer */ static inline int pwm_dw_timer_base_addr(struct device *dev, uint32_t timer) { struct pwm_dw_config * const cfg = (struct pwm_dw_config *)dev->config->config_info; return (cfg->addr + (timer * REG_OFFSET)); } /** * Find the load count 2 address for each timer * * @param dev Device struct * @param timer Which timer * * @return The load count 2 address of that particular timer */ static inline int pwm_dw_timer_ldcnt2_addr(struct device *dev, uint32_t timer) { struct pwm_dw_config * const cfg = (struct pwm_dw_config *)dev->config->config_info; return (cfg->addr + REG_TMR_LOAD_CNT2 + (timer * REG_OFFSET_LOAD_CNT2)); } static int pwm_dw_configure(struct device *dev, int access_op, uint32_t pwm, int flags) { ARG_UNUSED(dev); ARG_UNUSED(access_op); ARG_UNUSED(pwm); ARG_UNUSED(flags); return DEV_OK; } static int __set_one_port(struct device *dev, uint32_t pwm, uint32_t on, uint32_t off) { uint32_t reg_addr; reg_addr = pwm_dw_timer_base_addr(dev, pwm); /* Disable timer to prevent any output */ sys_write32(TIMER_INIT_CTRL, (reg_addr + REG_TMR_CTRL)); if ((off == 0) || (on == 0)) { /* stop PWM if so specified */ return DEV_OK; } /* write timer for pin to stay low */ sys_write32(off, (reg_addr + REG_TMR_LOAD_CNT)); /* write timer for pin to stay high */ sys_write32(on, pwm_dw_timer_ldcnt2_addr(dev, pwm)); /* Enable timer so it starts running and counting */ sys_write32((TIMER_INIT_CTRL | 0x01), (reg_addr + REG_TMR_CTRL)); return DEV_OK; } /** * Set the duration for on/off timer of PWM. * * This sets the duration for the pin to low or high. * * Assumes a nominal system clock of 32MHz, each count of on/off represents * 31.25ns (e.g. on == 2 means the pin stays high for 62.5ns). * The duration of 1 count depends on system clock. Refer to the hardware * manual for more information. * * @param dev Device struct * @param access_op whether to set one pin or all * @param pwm Which PWM port to set, 0 if addressing all * @param on Duration for pin to stay high (must be >= 2) * @param off Duration for pin to stay low (must be >= 2) * * @return DEV_OK */ static int pwm_dw_set_values(struct device *dev, int access_op, uint32_t pwm, uint32_t on, uint32_t off) { struct pwm_dw_config * const cfg = (struct pwm_dw_config *)dev->config->config_info; int i; switch (access_op) { case PWM_ACCESS_BY_PIN: /* make sure the PWM port exists */ if (pwm >= cfg->num_ports) { return DEV_FAIL; } return __set_one_port(dev, pwm, on, off); case PWM_ACCESS_ALL: for (i = 0; i < cfg->num_ports; i++) { __set_one_port(dev, i, on, off); } return DEV_OK; } return DEV_INVALID_OP; } static int pwm_dw_set_duty_cycle(struct device *dev, int access_op, uint32_t pwm, uint8_t duty) { /* The IP block does not natively support duty cycle settings. * So need to use set_values(). **/ ARG_UNUSED(dev); ARG_UNUSED(access_op); ARG_UNUSED(pwm); ARG_UNUSED(duty); return DEV_INVALID_OP; } static int pwm_dw_suspend(struct device *dev) { ARG_UNUSED(dev); return DEV_INVALID_OP; } static int pwm_dw_resume(struct device *dev) { ARG_UNUSED(dev); return DEV_INVALID_OP; } static struct pwm_driver_api pwm_dw_drv_api_funcs = { .config = pwm_dw_configure, .set_values = pwm_dw_set_values, .set_duty_cycle = pwm_dw_set_duty_cycle, .suspend = pwm_dw_suspend, .resume = pwm_dw_resume, }; /** * @brief Initialization function of PCA9685 * * @param dev Device struct * @return DEV_OK if successful, failed otherwise. */ int pwm_dw_init(struct device *dev) { dev->driver_api = &pwm_dw_drv_api_funcs; return DEV_OK; } /* Initialization for PWM_DW */ #if defined(CONFIG_PWM_DW) #include <device.h> #include <init.h> static struct pwm_dw_config pwm_dw_cfg = { .addr = CONFIG_PWM_DW_BASE_ADDR, .num_ports = CONFIG_PWM_DW_NUM_PORTS, }; DEVICE_INIT(pwm_dw_0, CONFIG_PWM_DW_DEV_NAME, pwm_dw_init, NULL, &pwm_dw_cfg, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); #endif /* CONFIG_PWM_DW */
{ "content_hash": "54a7a5550a45b4341361abcbd30aa049", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 80, "avg_line_length": 23.9163179916318, "alnum_prop": 0.677221833449965, "repo_name": "coldnew/zephyr-project-fork", "id": "83f1e27c8a2261661037405d885c7e1035bbe406", "size": "6321", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "drivers/pwm/pwm_dw.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "160327" }, { "name": "Batchfile", "bytes": "28019" }, { "name": "C", "bytes": "6069127" }, { "name": "C++", "bytes": "213558" }, { "name": "Lex", "bytes": "11196" }, { "name": "Makefile", "bytes": "132066" }, { "name": "Objective-C", "bytes": "1912" }, { "name": "Perl", "bytes": "213268" }, { "name": "Python", "bytes": "109645" }, { "name": "Shell", "bytes": "44817" }, { "name": "Yacc", "bytes": "15396" } ], "symlink_target": "" }
package org.nick.wwwjdic.ocr; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.List; import android.hardware.Camera; import android.hardware.Camera.Size; public class ReflectionUtils { private static Method Parameters_getSupportedPreviewSizes; private static Method Parameters_getSupportedPictureSizes; private static Method Parameters_getFlashMode; private static Method Parameters_setFlashMode; static { initCompatibility(); }; private ReflectionUtils() { } private static void initCompatibility() { try { Parameters_getSupportedPreviewSizes = Camera.Parameters.class .getMethod("getSupportedPreviewSizes", new Class[] {}); Parameters_getSupportedPictureSizes = Camera.Parameters.class .getMethod("getSupportedPictureSizes", new Class[] {}); Parameters_getFlashMode = Camera.Parameters.class.getMethod( "getFlashMode", new Class[] {}); Parameters_setFlashMode = Camera.Parameters.class.getMethod( "setFlashMode", String.class); } catch (NoSuchMethodException nsme) { } } @SuppressWarnings("unchecked") public static List<Size> getSupportedPreviewSizes(Camera.Parameters p) { try { if (Parameters_getSupportedPreviewSizes != null) { return (List<Size>) Parameters_getSupportedPreviewSizes .invoke(p); } else { return null; } } catch (InvocationTargetException ite) { Throwable cause = ite.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new RuntimeException(ite); } } catch (IllegalAccessException ie) { return null; } } @SuppressWarnings("unchecked") public static List<Size> getSupportedPictureSizes(Camera.Parameters p) { try { if (Parameters_getSupportedPictureSizes != null) { return (List<Size>) Parameters_getSupportedPictureSizes .invoke(p); } else { return null; } } catch (InvocationTargetException ite) { Throwable cause = ite.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new RuntimeException(ite); } } catch (IllegalAccessException ie) { return null; } } public static String getFlashMode(Camera.Parameters p) { try { if (Parameters_getFlashMode != null) { return (String) Parameters_getFlashMode.invoke(p); } else { return null; } } catch (InvocationTargetException ite) { Throwable cause = ite.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new RuntimeException(ite); } } catch (IllegalAccessException ie) { return null; } } public static void setFlashMode(Camera.Parameters p, String flashMode) { try { if (Parameters_setFlashMode != null) { Parameters_setFlashMode.invoke(p, flashMode); } } catch (InvocationTargetException ite) { Throwable cause = ite.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new RuntimeException(ite); } } catch (IllegalAccessException ie) { } } }
{ "content_hash": "9d9f421cab1ab115006d0fdcbc008c90", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 76, "avg_line_length": 34.104838709677416, "alnum_prop": 0.5670371246157484, "repo_name": "nelenkov/wwwjdic", "id": "2f159dfd067a60137b071fcc4ad796ce011d56ac", "size": "4229", "binary": false, "copies": "1", "ref": "refs/heads/2.0", "path": "wwwjdic/src/org/nick/wwwjdic/ocr/ReflectionUtils.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1892" }, { "name": "HTML", "bytes": "3428" }, { "name": "Java", "bytes": "836625" }, { "name": "JavaScript", "bytes": "6763" } ], "symlink_target": "" }
#include <linux/sched.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/string.h> #include <linux/types.h> #include <linux/highmem.h> #include <linux/dma-mapping.h> #include <asm/tlbflush.h> /* * This address range defaults to a value that is safe for all * platforms which currently set CONFIG_NOT_COHERENT_CACHE. It * can be further configured for specific applications under * the "Advanced Setup" menu. -Matt */ #define CONSISTENT_BASE (CONFIG_CONSISTENT_START) #define CONSISTENT_END (CONFIG_CONSISTENT_START + CONFIG_CONSISTENT_SIZE) #define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT) /* * This is the page table (2MB) covering uncached, DMA consistent allocations */ static pte_t *consistent_pte; static DEFINE_SPINLOCK(consistent_lock); /* * VM region handling support. * * This should become something generic, handling VM region allocations for * vmalloc and similar (ioremap, module space, etc). * * I envisage vmalloc()'s supporting vm_struct becoming: * * struct vm_struct { * struct vm_region region; * unsigned long flags; * struct page **pages; * unsigned int nr_pages; * unsigned long phys_addr; * }; * * get_vm_area() would then call vm_region_alloc with an appropriate * struct vm_region head (eg): * * struct vm_region vmalloc_head = { * .vm_list = LIST_HEAD_INIT(vmalloc_head.vm_list), * .vm_start = VMALLOC_START, * .vm_end = VMALLOC_END, * }; * * However, vmalloc_head.vm_start is variable (typically, it is dependent on * the amount of RAM found at boot time.) I would imagine that get_vm_area() * would have to initialise this each time prior to calling vm_region_alloc(). */ struct vm_region { struct list_head vm_list; unsigned long vm_start; unsigned long vm_end; }; static struct vm_region consistent_head = { .vm_list = LIST_HEAD_INIT(consistent_head.vm_list), .vm_start = CONSISTENT_BASE, .vm_end = CONSISTENT_END, }; static struct vm_region * vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp) { unsigned long addr = head->vm_start, end = head->vm_end - size; unsigned long flags; struct vm_region *c, *new; new = kmalloc(sizeof(struct vm_region), gfp); if (!new) goto out; spin_lock_irqsave(&consistent_lock, flags); list_for_each_entry(c, &head->vm_list, vm_list) { if ((addr + size) < addr) goto nospc; if ((addr + size) <= c->vm_start) goto found; addr = c->vm_end; if (addr > end) goto nospc; } found: /* * Insert this entry _before_ the one we found. */ list_add_tail(&new->vm_list, &c->vm_list); new->vm_start = addr; new->vm_end = addr + size; spin_unlock_irqrestore(&consistent_lock, flags); return new; nospc: spin_unlock_irqrestore(&consistent_lock, flags); kfree(new); out: return NULL; } static struct vm_region *vm_region_find(struct vm_region *head, unsigned long addr) { struct vm_region *c; list_for_each_entry(c, &head->vm_list, vm_list) { if (c->vm_start == addr) goto out; } c = NULL; out: return c; } /* * Allocate DMA-coherent memory space and return both the kernel remapped * virtual and bus address for that space. */ void * __dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp) { struct page *page; struct vm_region *c; unsigned long order; u64 mask = 0x00ffffff, limit; /* ISA default */ if (!consistent_pte) { printk(KERN_ERR "%s: not initialised\n", __func__); dump_stack(); return NULL; } size = PAGE_ALIGN(size); limit = (mask + 1) & ~mask; if ((limit && size >= limit) || size >= (CONSISTENT_END - CONSISTENT_BASE)) { printk(KERN_WARNING "coherent allocation too big (requested %#x mask %#Lx)\n", size, mask); return NULL; } order = get_order(size); if (mask != 0xffffffff) gfp |= GFP_DMA; page = alloc_pages(gfp, order); if (!page) goto no_page; /* * Invalidate any data that might be lurking in the * kernel direct-mapped region for device DMA. */ { unsigned long kaddr = (unsigned long)page_address(page); memset(page_address(page), 0, size); flush_dcache_range(kaddr, kaddr + size); } /* * Allocate a virtual address in the consistent mapping region. */ c = vm_region_alloc(&consistent_head, size, gfp & ~(__GFP_DMA | __GFP_HIGHMEM)); if (c) { unsigned long vaddr = c->vm_start; pte_t *pte = consistent_pte + CONSISTENT_OFFSET(vaddr); struct page *end = page + (1 << order); split_page(page, order); /* * Set the "dma handle" */ *handle = page_to_bus(page); do { BUG_ON(!pte_none(*pte)); SetPageReserved(page); set_pte_at(&init_mm, vaddr, pte, mk_pte(page, pgprot_noncached(PAGE_KERNEL))); page++; pte++; vaddr += PAGE_SIZE; } while (size -= PAGE_SIZE); /* * Free the otherwise unused pages. */ while (page < end) { __free_page(page); page++; } return (void *)c->vm_start; } if (page) __free_pages(page, order); no_page: return NULL; } EXPORT_SYMBOL(__dma_alloc_coherent); /* * free a page as defined by the above mapping. */ void __dma_free_coherent(size_t size, void *vaddr) { struct vm_region *c; unsigned long flags, addr; pte_t *ptep; size = PAGE_ALIGN(size); spin_lock_irqsave(&consistent_lock, flags); c = vm_region_find(&consistent_head, (unsigned long)vaddr); if (!c) goto no_area; if ((c->vm_end - c->vm_start) != size) { printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n", __func__, c->vm_end - c->vm_start, size); dump_stack(); size = c->vm_end - c->vm_start; } ptep = consistent_pte + CONSISTENT_OFFSET(c->vm_start); addr = c->vm_start; do { pte_t pte = ptep_get_and_clear(&init_mm, addr, ptep); unsigned long pfn; ptep++; addr += PAGE_SIZE; if (!pte_none(pte) && pte_present(pte)) { pfn = pte_pfn(pte); if (pfn_valid(pfn)) { struct page *page = pfn_to_page(pfn); ClearPageReserved(page); __free_page(page); continue; } } printk(KERN_CRIT "%s: bad page in kernel page table\n", __func__); } while (size -= PAGE_SIZE); flush_tlb_kernel_range(c->vm_start, c->vm_end); list_del(&c->vm_list); spin_unlock_irqrestore(&consistent_lock, flags); kfree(c); return; no_area: spin_unlock_irqrestore(&consistent_lock, flags); printk(KERN_ERR "%s: trying to free invalid coherent area: %p\n", __func__, vaddr); dump_stack(); } EXPORT_SYMBOL(__dma_free_coherent); /* * Initialise the consistent memory allocation. */ static int __init dma_alloc_init(void) { pgd_t *pgd; pud_t *pud; pmd_t *pmd; pte_t *pte; int ret = 0; do { pgd = pgd_offset(&init_mm, CONSISTENT_BASE); pud = pud_alloc(&init_mm, pgd, CONSISTENT_BASE); pmd = pmd_alloc(&init_mm, pud, CONSISTENT_BASE); if (!pmd) { printk(KERN_ERR "%s: no pmd tables\n", __func__); ret = -ENOMEM; break; } WARN_ON(!pmd_none(*pmd)); pte = pte_alloc_kernel(pmd, CONSISTENT_BASE); if (!pte) { printk(KERN_ERR "%s: no pte tables\n", __func__); ret = -ENOMEM; break; } consistent_pte = pte; } while (0); return ret; } core_initcall(dma_alloc_init); /* * make an area consistent. */ void __dma_sync(void *vaddr, size_t size, int direction) { unsigned long start = (unsigned long)vaddr; unsigned long end = start + size; switch (direction) { case DMA_NONE: BUG(); case DMA_FROM_DEVICE: /* invalidate only */ invalidate_dcache_range(start, end); break; case DMA_TO_DEVICE: /* writeback only */ clean_dcache_range(start, end); break; case DMA_BIDIRECTIONAL: /* writeback and invalidate */ flush_dcache_range(start, end); break; } } EXPORT_SYMBOL(__dma_sync); #ifdef CONFIG_HIGHMEM /* * __dma_sync_page() implementation for systems using highmem. * In this case, each page of a buffer must be kmapped/kunmapped * in order to have a virtual address for __dma_sync(). This must * not sleep so kmap_atomic()/kunmap_atomic() are used. * * Note: yes, it is possible and correct to have a buffer extend * beyond the first page. */ static inline void __dma_sync_page_highmem(struct page *page, unsigned long offset, size_t size, int direction) { size_t seg_size = min((size_t)(PAGE_SIZE - offset), size); size_t cur_size = seg_size; unsigned long flags, start, seg_offset = offset; int nr_segs = 1 + ((size - seg_size) + PAGE_SIZE - 1)/PAGE_SIZE; int seg_nr = 0; local_irq_save(flags); do { start = (unsigned long)kmap_atomic(page + seg_nr, KM_PPC_SYNC_PAGE) + seg_offset; /* Sync this buffer segment */ __dma_sync((void *)start, seg_size, direction); kunmap_atomic((void *)start, KM_PPC_SYNC_PAGE); seg_nr++; /* Calculate next buffer segment size */ seg_size = min((size_t)PAGE_SIZE, size - cur_size); /* Add the segment size to our running total */ cur_size += seg_size; seg_offset = 0; } while (seg_nr < nr_segs); local_irq_restore(flags); } #endif /* CONFIG_HIGHMEM */ /* * __dma_sync_page makes memory consistent. identical to __dma_sync, but * takes a struct page instead of a virtual address */ void __dma_sync_page(struct page *page, unsigned long offset, size_t size, int direction) { #ifdef CONFIG_HIGHMEM __dma_sync_page_highmem(page, offset, size, direction); #else unsigned long start = (unsigned long)page_address(page) + offset; __dma_sync((void *)start, size, direction); #endif } EXPORT_SYMBOL(__dma_sync_page);
{ "content_hash": "c96f09fd7502b17a855d266c58ac32f6", "timestamp": "", "source": "github", "line_count": 398, "max_line_length": 83, "avg_line_length": 23.522613065326635, "alnum_prop": 0.652531510361034, "repo_name": "ut-osa/laminar", "id": "6656d47841d06e02ae07d794349075dd30794ecb", "size": "10294", "binary": false, "copies": "68", "ref": "refs/heads/master", "path": "linux-2.6.22.6/arch/powerpc/lib/dma-noncoherent.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "4526" }, { "name": "Assembly", "bytes": "7753785" }, { "name": "Awk", "bytes": "5239" }, { "name": "Bison", "bytes": "75151" }, { "name": "C", "bytes": "209779557" }, { "name": "C++", "bytes": "5954668" }, { "name": "CSS", "bytes": "11885" }, { "name": "Java", "bytes": "12132154" }, { "name": "Makefile", "bytes": "731243" }, { "name": "Objective-C", "bytes": "564040" }, { "name": "Perl", "bytes": "196100" }, { "name": "Python", "bytes": "11786" }, { "name": "Ruby", "bytes": "3219" }, { "name": "Scala", "bytes": "12158" }, { "name": "Scilab", "bytes": "22980" }, { "name": "Shell", "bytes": "205177" }, { "name": "TeX", "bytes": "62636" }, { "name": "UnrealScript", "bytes": "20822" }, { "name": "XSLT", "bytes": "6544" } ], "symlink_target": "" }
package com.elderbyte.vidada.domain.tags.definitions; import com.elderbyte.vidada.domain.tags.Tag; import com.elderbyte.vidada.domain.tags.ontology.model.*; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import javax.swing.text.html.Option; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.*; import java.util.regex.Pattern; public class TagDefinitionFormatParser { public TagDefinitionFormatParser(){ } /*************************************************************************** * * * Public API * * * **************************************************************************/ public TagDefinitionData parse(File file) throws IOException, ParseException{ return parse(FileUtils.readFileToString(file)); } public TagDefinitionData parse(InputStream is) throws IOException, ParseException{ return parse(IOUtils.toString(is, "UTF-8")); } public TagDefinitionData parse(String strdefinition) throws ParseException { TagDefinitionData definition = new TagDefinitionData(); List<Token> tokens = tokenize(strdefinition); boolean indeclList = false; Node leftTag = null; Predicate relation = null; for (Token token : tokens) { if(token.type == TokenType.NEWLINE) continue; if(token.type == TokenType.DECL_LIST){ // new declaration starts // init the new one leftTag = null; relation = null; indeclList = true; continue; } if(indeclList){ if(token.type == TokenType.LITERAL_STRING){ Node rightTag = asTagNode(token.value) .orElse(null); if(rightTag != null){ if(leftTag != null){ // Create relation if(relation != null){ definition.add( new Statement(leftTag, relation, rightTag)); }else{ // we have a tag list without relations, add it to the current group. definition.add(leftTag); definition.add(rightTag); } } leftTag = rightTag; } }else if (token.type == TokenType.OPERATOR_SUPERCLASS_OF) { relation = Predicate.SuperClassOf; }else if(token.type == TokenType.OPERATOR_SUBCLASS_OF){ relation = Predicate.SubClassOf; }else if (token.type == TokenType.OPERATOR_SAME_AS) { relation = Predicate.SameAs; } } } return definition; } /*************************************************************************** * * * Private implementation * * * **************************************************************************/ private Optional<Node> asTagNode(String tag){ return Tag.buildTag(tag) .map(t -> new LiteralNode(t.getName())); } private List<Token> tokenize(String definition) throws ParseException{ List<Token> tokens = new ArrayList<>(); String[] lines = definition.split("\\r?\\n"); for (String lineStr : lines) { if(lineStr.trim().startsWith("#")) continue; // Skip Comment // tokenize the line String[] words = lineStr.split(" "); for (String word : words) { TokenType tokenType = isSimpleToken(word); if(tokenType == TokenType.NONE){ // Not a simple token if(isLiteralString(word)) tokenType = TokenType.LITERAL_STRING; else { throw new ParseException("Illegal charachter in token '" + word + "'"); } } tokens.add(new Token(tokenType, word)); } tokens.add(Token.NEWLINE); } return tokens; } static private Pattern literalStringPattern = Pattern.compile("[a-zA-Z0-9\\.]"); private boolean isLiteralString(String word) { return literalStringPattern.matcher(word).find(); } private TokenType isSimpleToken(String word){ TokenType type = simpleTokenMap.get(word); if(type == null) type = TokenType.NONE; return type; } /*************************************************************************** * * * Inner classes * * * **************************************************************************/ public static class ParseException extends Exception { public ParseException(String message){ super(message); } } private static final Map<String, TokenType> simpleTokenMap = new HashMap<>(); static { for (TokenType type : TokenType.values()) { simpleTokenMap.put(type.symbol, type); } } private static class Token { final static Token NEWLINE = new Token(TokenType.NEWLINE, ""); final TokenType type; final String value; public Token(TokenType type, String value) { super(); this.type = type; this.value = value; } public TokenType getType() { return type; } public String getValue() { return value; } @Override public String toString(){ return "["+type+": '"+getValue()+"']"; } } private enum TokenType { NONE(""), NEWLINE(""), LITERAL_STRING(""), OPERATOR_SUPERCLASS_OF(">"), OPERATOR_SUBCLASS_OF("<"), OPERATOR_SAME_AS("="), DECL_LIST(":"); String symbol; TokenType(String symbol){ this.symbol = symbol; } } }
{ "content_hash": "2a704f64bd26c5a6682805df4ecb8390", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 86, "avg_line_length": 26.682242990654206, "alnum_prop": 0.5246935201401051, "repo_name": "Vidada-Project/Vidada-Server", "id": "98a58de4d98f65234cc57b4bd92d752181098108", "size": "5710", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vidada-server/src/main/java/com/elderbyte/vidada/domain/tags/definitions/TagDefinitionFormatParser.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "24139" }, { "name": "CSS", "bytes": "5448" }, { "name": "HTML", "bytes": "45802" }, { "name": "Java", "bytes": "633267" }, { "name": "JavaScript", "bytes": "111686" } ], "symlink_target": "" }
{% extends 'libya_site/staff.html' %} {% load i18n %} {% block content %} <h1 class="page-width cushion">{% trans "Upload new registration centers" %}</h1> <div class="milk"> <div class="page-width cushion"> <form class="two-thirds" method="post" action="{% url 'upload-centers-csv' %}" enctype="multipart/form-data" novalidate> {% csrf_token %} <label for="id_registry_number">{{ form.csv.label }}:</label> {{ form.csv }} {% if form.csv.errors %} {{ form.csv.errors }} {% endif %} <div class="helptext"> {% url 'download-centers-csv' as download_csv_url %} {% blocktrans trimmed %} <p>CSV File Requirements</p> <ul> <li>Please ensure the file is saved in UTF-8 encoding as a CSV file.</li> <li>You must include column headers in the file.</li> <li>The file must include all of the following columns in this order: <pre>{{ csv_columns }}</pre> </li> <li>Please double-check your file before uploading.</li> <li>Download the <a href="{{ download_csv_url }}">current file of registration centers</a>.</li> </ul> {% endblocktrans %} </div> <div class="spacer"></div> <button class="success" type="submit">{% trans 'Upload' %}</button> <a class="button inverse right" href="{% url 'browse_registrationcenters' %}">{% trans "Cancel" %}</a> </form> </div> </div> {% endblock %}
{ "content_hash": "fc975e463349fb5b6a56262dac0bbbff", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 126, "avg_line_length": 37.11904761904762, "alnum_prop": 0.5471456061577935, "repo_name": "SmartElect/SmartElect", "id": "38c54a91bfa48c8a5f9eef7e2a101e54cc078679", "size": "1559", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "register/templates/register/upload_centers_csv.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "43928" }, { "name": "HTML", "bytes": "175822" }, { "name": "JavaScript", "bytes": "475284" }, { "name": "Python", "bytes": "1848271" }, { "name": "Shell", "bytes": "1834" } ], "symlink_target": "" }
go-slugification ================ [![Build Status](https://travis-ci.org/rhinoman/go-slugification.svg?branch=master)](https://travis-ci.org/rhinoman/go-slugification) Description ----------- Creates Slugified versions of strings suitable for use in URLs Installation ------------ ``` go get github.com/rhinoman/go-slugification ``` Usage ----- ```go import "github.com/rhinoman/go-slugification" ... slugification.Slugify("Page Title") //Returns "page-title" ```
{ "content_hash": "683df45c640a17b32387b6e7c34ab1fa", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 133, "avg_line_length": 16.928571428571427, "alnum_prop": 0.679324894514768, "repo_name": "rhinoman/wikifeat", "id": "283f4e1c9b42f4d6bc46a06a9fc7209032706ef7", "size": "474", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "vendor/github.com/rhinoman/go-slugification/README.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "103" }, { "name": "Go", "bytes": "357684" }, { "name": "HTML", "bytes": "7282" }, { "name": "JavaScript", "bytes": "13408" }, { "name": "Python", "bytes": "120508" }, { "name": "Shell", "bytes": "3120" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0) on Wed Aug 13 15:01:43 EDT 2014 --> <title>OrderItemsList</title> <meta name="date" content="2014-08-13"> <link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="OrderItemsList"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/OrderItem.html" title="class in gov.va.med.lom.javaBroker.rpc.lists.models"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/Person.html" title="class in gov.va.med.lom.javaBroker.rpc.lists.models"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?gov/va/med/lom/javaBroker/rpc/lists/models/OrderItemsList.html" target="_top">Frames</a></li> <li><a href="OrderItemsList.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">gov.va.med.lom.javaBroker.rpc.lists.models</div> <h2 title="Class OrderItemsList" class="title">Class OrderItemsList</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li><a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html" title="class in gov.va.med.lom.javaBroker.rpc">gov.va.med.lom.javaBroker.rpc.BaseBean</a></li> <li> <ul class="inheritance"> <li>gov.va.med.lom.javaBroker.rpc.lists.models.OrderItemsList</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Serializable</dd> </dl> <hr> <br> <pre>public class <span class="strong">OrderItemsList</span> extends <a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html" title="class in gov.va.med.lom.javaBroker.rpc">BaseBean</a> implements java.io.Serializable</pre> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../../serialized-form.html#gov.va.med.lom.javaBroker.rpc.lists.models.OrderItemsList">Serialized Form</a></dd></dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/OrderItemsList.html#OrderItemsList()">OrderItemsList</a></strong>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</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> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/OrderItem.html" title="class in gov.va.med.lom.javaBroker.rpc.lists.models">OrderItem</a>[]</code></td> <td class="colLast"><code><strong><a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/OrderItemsList.html#getOrderItems()">getOrderItems</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/OrderItemsList.html#setOrderItems(gov.va.med.lom.javaBroker.rpc.lists.models.OrderItem[])">setOrderItems</a></strong>(<a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/OrderItem.html" title="class in gov.va.med.lom.javaBroker.rpc.lists.models">OrderItem</a>[]&nbsp;orderItems)</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_gov.va.med.lom.javaBroker.rpc.BaseBean"> <!-- --> </a> <h3>Methods inherited from class&nbsp;gov.va.med.lom.javaBroker.rpc.<a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html" title="class in gov.va.med.lom.javaBroker.rpc">BaseBean</a></h3> <code><a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html#getDfn()">getDfn</a>, <a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html#getDuz()">getDuz</a>, <a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html#getIen()">getIen</a>, <a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html#getRpcResult()">getRpcResult</a>, <a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html#setDfn(java.lang.String)">setDfn</a>, <a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html#setDuz(java.lang.String)">setDuz</a>, <a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html#setIen(java.lang.String)">setIen</a>, <a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/BaseBean.html#setRpcResult(java.lang.String)">setRpcResult</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="OrderItemsList()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>OrderItemsList</h4> <pre>public&nbsp;OrderItemsList()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getOrderItems()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOrderItems</h4> <pre>public&nbsp;<a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/OrderItem.html" title="class in gov.va.med.lom.javaBroker.rpc.lists.models">OrderItem</a>[]&nbsp;getOrderItems()</pre> </li> </ul> <a name="setOrderItems(gov.va.med.lom.javaBroker.rpc.lists.models.OrderItem[])"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>setOrderItems</h4> <pre>public&nbsp;void&nbsp;setOrderItems(<a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/OrderItem.html" title="class in gov.va.med.lom.javaBroker.rpc.lists.models">OrderItem</a>[]&nbsp;orderItems)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/OrderItem.html" title="class in gov.va.med.lom.javaBroker.rpc.lists.models"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../../../../gov/va/med/lom/javaBroker/rpc/lists/models/Person.html" title="class in gov.va.med.lom.javaBroker.rpc.lists.models"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?gov/va/med/lom/javaBroker/rpc/lists/models/OrderItemsList.html" target="_top">Frames</a></li> <li><a href="OrderItemsList.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "12d6a1e9d53cf894cebca5388a5c6efc", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 896, "avg_line_length": 42.22105263157895, "alnum_prop": 0.6060001662095903, "repo_name": "VHAINNOVATIONS/AVS", "id": "565a304b4b52b81b2d6d197ae0149f6a39ca702f", "size": "12033", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ll-javaBroker/docs/gov/va/med/lom/javaBroker/rpc/lists/models/OrderItemsList.html", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "97314" }, { "name": "Elixir", "bytes": "758" }, { "name": "Java", "bytes": "3765290" }, { "name": "JavaScript", "bytes": "5395171" }, { "name": "Pascal", "bytes": "17829" }, { "name": "Shell", "bytes": "10984" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "53a3c9d9a30afa9b17744384c9f7f1ed", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "97539c0ac3ec3d934b42add23df00ad265e807af", "size": "190", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Psathyrostachys/Psathyrostachys juncea/ Syn. Elymus desertorum latifolius/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
var lib = __dirname + '/../lib'; var Protocol = require(lib + '/protocol/protocol'); var Packets = require(lib + '/protocol/packets'); var PacketWriter = require(lib + '/protocol/PacketWriter'); var options = { rows : 100000, bufferSize : 64 * 1024, }; console.error('Config:', options); function createBuffers() { process.stderr.write('Creating row buffers ... '); var number = 1; var id = 0; var start = Date.now(); var buffers = [ createPacketBuffer(number++, new Packets.ResultSetHeaderPacket({fieldCount: 2})), createPacketBuffer(number++, new Packets.FieldPacket({catalog: 'foo', name: 'id'})), createPacketBuffer(number++, new Packets.FieldPacket({catalog: 'foo', name: 'text'})), createPacketBuffer(number++, new Packets.EofPacket()), ]; for (var i = 0; i < options.rows; i++) { buffers.push(createRowDataPacketBuffer(id++, number++)); } buffers.push(createPacketBuffer(number++, new Packets.EofPacket)); buffers = mergeBuffers(buffers); var bytes = buffers.reduce(function(bytes, buffer) { return bytes + buffer.length; }, 0); var mb = (bytes / 1024 / 1024).toFixed(2) console.error('%s buffers (%s mb) in %s ms', buffers.length, mb, (Date.now() - start)); return buffers; } function createPacketBuffer(number, packet) { var writer = new PacketWriter(number % 256); packet.write(writer); return writer.toBuffer(); } function createRowDataPacketBuffer(id, number) { var writer = new PacketWriter(number++ % 256); writer.writeLengthCodedString(id); writer.writeLengthCodedString('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has sur'); return writer.toBuffer(); } function mergeBuffers(buffers) { var mergeBuffer = new Buffer(options.bufferSize); var mergeBuffers = []; var offset = 0; for (var i = 0; i < buffers.length; i++) { var buffer = buffers[i]; var bytesRemaining = mergeBuffer.length - offset; if (buffer.length < bytesRemaining) { buffer.copy(mergeBuffer, offset); offset += buffer.length; } else { buffer.copy(mergeBuffer, offset, 0, bytesRemaining); mergeBuffers.push(mergeBuffer); mergeBuffer = new Buffer(options.bufferSize); buffer.copy(mergeBuffer, 0, bytesRemaining); offset = buffer.length - bytesRemaining; } } if (offset > 0) { mergeBuffers.push(mergeBuffer.slice(0, offset)); } return mergeBuffers; } function benchmark(buffers) { var protocol = new Protocol(); protocol._handshakeInitializationPacket = true; protocol.query({typeCast: false, sql: 'SELECT ...'}); var start = +new Date; for (var i = 0; i < buffers.length; i++) { protocol.write(buffers[i]); } var duration = Date.now() - start; var hz = Math.round(options.rows / (duration / 1000)); console.log(hz); } var buffers = createBuffers(); while (true) { benchmark(buffers); }
{ "content_hash": "3aa32f839d2c4d38256914a6d3a7799e", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 293, "avg_line_length": 28.55045871559633, "alnum_prop": 0.6699871465295629, "repo_name": "Mobinet113/GraffitiGrid", "id": "3e1c9a097c9c6573bd03b4674443d0d50fbfcad2", "size": "3112", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "node_modules/mysql/benchmark/parse-100k-blog-rows.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "19653" }, { "name": "JavaScript", "bytes": "124739" }, { "name": "PHP", "bytes": "9412" } ], "symlink_target": "" }
Benchmark and Testing for nodeGame. ## Overview The benchmark script reads settings from a config file, starts the nodeGame server, connects a number of PhantomJS clients to the specified channel and lets them play. While playing, the script collects statistics about the number and the timing of all exchanged messages, and also about CPU and memory usage (if the dependency `psutil` is installed). When all games are finished, all statistics are saved to csv files, as specified in the settings. If an automated test script is defined by the `package.json` file inside the game directory, such a test-script will executed and the results displayed on screen. ## Usage 1. Create a copy of the file `config-sample.ini` with name `config.ini` 2. Edit `config.ini` with the correct settings for your environment (see below) 3. Run the benchmark either with `python run_benchmark.py` or simply with `./run_benchamrk.py` ### config.ini This file needs to define the following variables. Note that it is possible to refer to variables defined in other sections via `${SECTION_NAME:VAR_NAME}` syntax. ```ini [General Settings] game: ultimatum ; This is the directories section. ; All of these directories need to exist. [Directories] nodegame_dir: ~/nodegame benchmark_dir: ${nodegame_dir}/node_modules/nodegame-benchmark client_dir: ${nodegame_dir}/node_modules/nodegame-client server_dir: ${nodegame_dir}/node_modules/nodegame-server game_dir: ${nodegame_dir}/games/${General Settings:game} ; This is the directory where stdout and stderr logs will be written. log_dir: ${benchmark_dir}/log ; This is the directory where data in csv format will be written. csv_dir: ${benchmark_dir}/csv ; This folder contains the launcher of the benchmark. launcher_dir: ${nodegame_dir}/test ; This folder determines the "current working directory" of the launcher. launcher_cwd: ${nodegame_dir} ; This folder contains the logs of messages. msg_log_dir: ${nodegame_dir}/log ; This folder is the current working directory of the test that sanitizes ; benchmark results. test_cwd: ${game_dir} ; This is the files section. ; All of these files need to exist. [Files] ; This is where the values of the [Client Variables] section are written. client_var_file: ${Directories:client_dir}/lib/modules/variables.js ; This is where the values of the [Server Variables] section are written. server_var_file: ${Directories:server_dir}/conf/servernode.js ; This file contains the messages received and sent by the server. server_msg_file: ${Directories:msg_log_dir}/messages.log ; These files specify the launcher and its settings file. launcher_file: ${Directories:launcher_dir}/launcher-autoplay.js launcher_settings_file: ${Directories:game_dir}/test/settings.js [Client Variables] rel_msg_var: k.reliableMessaging rel_retry_var: k.reliableRetryInterval [Server Variables] rel_msg_var: servernode.reliableMessaging rel_retry_var: servernode.reliableRetryInterval ; The settings specified here will be written to the launcher_settings_file [Launcher Settings] ; sioTransports are not working in Express 4 at the moment. ; sioTransports: ["websocket", "flashsocket", "htmlfile", "xhr-polling", ; "jsonp-polling"] ``` ## Options for run_benchmark ``` $ ./run_benchmark.py --help usage: run_benchmark.py [-h] -c CONFIG [-n NUM_CONNS [NUM_CONNS ...]] [-r] [-nr] [-t TIMEOUTS [TIMEOUTS ...]] Execute nodegame benchmark and write benchmark data to csv file. optional arguments: -h, --help show this help message and exit -c CONFIG, --config CONFIG Benchmark configuration file in INI format containing variables that likely do not change between benchmarks. -n NUM_CONNS [NUM_CONNS ...], --num_conns NUM_CONNS [NUM_CONNS ...] Number of simultaneous connections to consider for the benchmark, can be a list. -r, --reliable Boolean flag to turn on reliable messaging. -nr, --no_run Boolean flag to disable launching the game. Will just process existing log files. -t TIMEOUTS [TIMEOUTS ...], --timeouts TIMEOUTS [TIMEOUTS ...] Timeouts to consider for the benchmark when reliable messaging is used, can be a list. ``` ## File format of metrics.csv `metrics.csv` defines the following data headers: - `id`: Unix timestamp of the experiment in milliseconds. It is very unlikely that two different runs have the same timestamp, hence the use as an identifier is justified. - `machine`: Name of the current machine as reported by Python's [`platform.platform()`](https://docs.python.org/3.4/library/platform.html#platform.platform). - `num_conns`: Number of simultaneous connections during this run of the experiment. This is the number specified by the `-n` flag. - `is_reliable`: Reports whether reliable messaging was turned on or off. This is specified by the presence or absence of the `-r` flag. - `timeout`: Reports the timeout used during the current run. Only meaningful if reliable messaging was turned on. Controlled via the `-t` flag. - `benchmark_ret_code`: Return code of the benchmark process. A number different from 0 indicates that there was a problem. - `test_ret_code`: Return code of the test process. A number different from 0 indicates that there was a problem. - `cpu_time_user`: User CPU time as reported by [`psutil.Process.cpu_times()`](https://pythonhosted.org/psutil/#psutil.Process.cpu_times). This time also includes CPU time spent by children processes of the current process. - `cpu_time_system`: System CPU time as reported by [`psutil.Process.cpu_times()`](https://pythonhosted.org/psutil/#psutil.Process.cpu_times). This time also includes CPU time spent by children processes of the current process. - `mem_info_rss`: Resident Set Size (RSS) usage as reported by [`psutil.Process.memory_info()`](https://pythonhosted.org/psutil/#psutil.Process.memory_info). This usage also includes memory usage by children processes of the current process. - `mem_info_vms`: Virtual Memory Size (VMS) usage as reported by [`psutil.Process.memory_info()`](https://pythonhosted.org/psutil/#psutil.Process.memory_info). This usage also includes memory usage by children processes of the current process. - `avg_client_time`: When reliable messaging is enabled, this is the average time to process a client message. Time is measured as the duration between receiving a client message and sending the corresponding ACK message. Currently this is only measured on the server and hence is not meaningful. - `avg_server_time`: When reliable messaging is enabled, this is the average time for a round trip for messages from the server. The duration reported is the difference between sending a message from a server and receiving the ACK for it. ## Example Runs Reads the config file and run 1 benchmark where there is 1 game: ./run_benchmark.py -c config.json -n 1 Here we consider 1, 2, 4 and 8 simultaneous connections, reliable messaging to be activated, and timeouts of 1000, 2000 and 4000 milliseconds. ./run_benchmark.py -c config.json -n 1 2 4 8 -r -t 1000 2000 4000 ## Requirements and Dependencies To be able to report CPU and memory usage, `run_benchmark.py` relies on the third party module `psutil`. You should be able to install it via: pip install psutil See [this manual](https://github.com/giampaolo/psutil/blob/master/INSTALL.rst) for further help. Furthermore the script relies on features on included with Python 2.7, so please make sure to have a recent Python installation available. ## License [MIT](LICENSE)
{ "content_hash": "a647d903f2f28c3385922873db140a3a", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 96, "avg_line_length": 40.23857868020305, "alnum_prop": 0.7214583070518481, "repo_name": "nodeGame/nodegame-benchmark", "id": "22671f6222a2c0eb2df99d6adc230a980f3d1866", "size": "7956", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "3915" }, { "name": "Python", "bytes": "29282" } ], "symlink_target": "" }
[Source code of released version](https://github.com/meteor/meteor/tree/master/packages/oauth1) | [Source code of development version](https://github.com/meteor/meteor/tree/devel/packages/oauth1) *** Common functionality for OAuth 1 clients. See the [project page](https://www.meteor.com/accounts) on Meteor Accounts for more details.
{ "content_hash": "f7e7755dc536744c1071f65c6757e913", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 195, "avg_line_length": 55.833333333333336, "alnum_prop": 0.7850746268656716, "repo_name": "Hansoft/meteor", "id": "3b3205f286d4b58583e5080a40b36aa347d97be3", "size": "344", "binary": false, "copies": "14", "ref": "refs/heads/fav-96944", "path": "packages/oauth1/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "6635" }, { "name": "C", "bytes": "235849" }, { "name": "C#", "bytes": "21958" }, { "name": "C++", "bytes": "203156" }, { "name": "CSS", "bytes": "39463" }, { "name": "CoffeeScript", "bytes": "34256" }, { "name": "HTML", "bytes": "147018" }, { "name": "JavaScript", "bytes": "5528500" }, { "name": "PowerShell", "bytes": "7750" }, { "name": "Python", "bytes": "10313" }, { "name": "Shell", "bytes": "41497" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using NUnit.Framework; using OpenQA.Selenium; using OpenQA.Selenium.Firefox; using OpenQA.Selenium.Support.UI; namespace WebAddressBookTests { public class HelperBase { protected IWebDriver driver; protected ApplicationManager manager; public HelperBase(ApplicationManager manager) { this.manager = manager; this.driver = manager.Driver; } public void Type(By locator, string text) { if (text != null) { driver.FindElement(locator).Clear(); driver.FindElement(locator).SendKeys(text); } } public bool IsElementPresent(By by) { try { driver.FindElement(by); return true; } catch { return false; } } } }
{ "content_hash": "10c47a3913ef63f14ef039920576a9b8", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 59, "avg_line_length": 22.47826086956522, "alnum_prop": 0.5444874274661509, "repo_name": "Nasts/charp_training_pam", "id": "b064e5c082de65b90f2b9dfc5130c227f4e5054f", "size": "1036", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "addressbook-web-tests/addressbook-web-tests/appmanager/HelperBase.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "20445" } ], "symlink_target": "" }
package com.pozirk.ads.admob; import com.adobe.fre.FREContext; import com.adobe.fre.FREExtension; import com.pozirk.ads.admob.context.ExtensionContext; public class Extension implements FREExtension { public FREContext createContext(String contextType) { return new ExtensionContext(); } public void dispose() { } public void initialize() { } }
{ "content_hash": "faec7989d7bfa964d2c14fcfcd823a42", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 53, "avg_line_length": 16.130434782608695, "alnum_prop": 0.7439353099730458, "repo_name": "pozirk/ANEAdMob", "id": "75d5c4e0624666dfb258ce275b5916111d34f74c", "size": "992", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "android/AdMob/app/src/main/java/com/pozirk/ads/admob/Extension.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ActionScript", "bytes": "10453" }, { "name": "Batchfile", "bytes": "2122" }, { "name": "Java", "bytes": "43672" } ], "symlink_target": "" }
package org.apache.ctakes.ytex.kernel; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.InvalidPropertiesFormatException; import java.util.Properties; import java.util.SortedMap; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; import javax.sql.DataSource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.PreparedStatementCreator; import org.springframework.jdbc.core.RowCallbackHandler; import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; public class AbstractBagOfWordsExporter { protected SimpleJdbcTemplate simpleJdbcTemplate; protected JdbcTemplate jdbcTemplate; protected PlatformTransactionManager transactionManager; protected TransactionTemplate txNew; public PlatformTransactionManager getTransactionManager() { return transactionManager; } public void setTransactionManager( PlatformTransactionManager transactionManager) { this.transactionManager = transactionManager; txNew = new TransactionTemplate(transactionManager); txNew.setPropagationBehavior(TransactionTemplate.PROPAGATION_REQUIRES_NEW); } public AbstractBagOfWordsExporter() { super(); } public void setDataSource(DataSource ds) { this.jdbcTemplate = new JdbcTemplate(ds); this.simpleJdbcTemplate = new SimpleJdbcTemplate(ds); } public DataSource getDataSource(DataSource ds) { return this.jdbcTemplate.getDataSource(); } /** * * @param sql * result 1st column: instance id, 2nd column: word, 3rd column: * numeric word value * @param instanceNumericWords * map of instance id - [map word - word value] to be populated */ protected void getNumericInstanceWords(final String sql, final BagOfWordsData bagOfWordsData) { txNew.execute(new TransactionCallback<Object>() { @Override public Object doInTransaction(TransactionStatus txStatus) { jdbcTemplate.query(new PreparedStatementCreator() { @Override public PreparedStatement createPreparedStatement( Connection conn) throws SQLException { return conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); } }, new RowCallbackHandler() { @Override public void processRow(ResultSet rs) throws SQLException { int instanceId = rs.getInt(1); String word = rs.getString(2); double wordValue = rs.getDouble(3); addNumericWordToInstance(bagOfWordsData, instanceId, word, wordValue); } }); return null; } }); } protected void addNumericWordToInstance(BagOfWordsData bagOfWordsData, int instanceId, String word, double wordValue) { // add the numeric word to the map of words for this document SortedMap<String, Double> words = bagOfWordsData .getInstanceNumericWords().get(instanceId); if (words == null) { words = new TreeMap<String, Double>(); bagOfWordsData.getInstanceNumericWords().put(instanceId, words); } words.put(word, wordValue); bagOfWordsData.getNumericWords().add(word); // increment the length of the document by the wordValue Integer docLength = bagOfWordsData.getDocLengthMap().get(instanceId); if (docLength == null) { docLength = 0; } bagOfWordsData.getDocLengthMap().put(instanceId, (docLength + (int) wordValue)); // add to the number of docs that have the word Integer docsWithWord = bagOfWordsData.getIdfMap().get(word); if (docsWithWord == null) { docsWithWord = 0; } bagOfWordsData.getIdfMap().put(word, docsWithWord + 1); } protected void addNominalWordToInstance(BagOfWordsData bagOfWordsData, int instanceId, String word, String wordValue) { SortedMap<String, String> instanceWords = bagOfWordsData .getInstanceNominalWords().get(instanceId); SortedSet<String> wordValueSet = bagOfWordsData .getNominalWordValueMap().get(word); if (instanceWords == null) { instanceWords = new TreeMap<String, String>(); bagOfWordsData.getInstanceNominalWords().put(instanceId, instanceWords); } if (wordValueSet == null) { wordValueSet = new TreeSet<String>(); bagOfWordsData.getNominalWordValueMap().put(word, wordValueSet); } // add the word-value for the instance instanceWords.put(word, wordValue); // add the value to the set of valid values wordValueSet.add(wordValue); } /** * * @param sql * result set has 3 columns. 1st column - integer - instance id. * 2nd column - word. 3rd column - word value. * @param instanceWordMap * map of instance id to word-word value. * @param wordValueMap * map of word to valid values for the word. * @return populate maps with results of query. */ protected void getNominalInstanceWords(final String sql, final BagOfWordsData bagOfWordsData) { txNew.execute(new TransactionCallback<Object>() { @Override public Object doInTransaction(TransactionStatus txStatus) { jdbcTemplate.query(new PreparedStatementCreator() { @Override public PreparedStatement createPreparedStatement( Connection conn) throws SQLException { return conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); } }, new RowCallbackHandler() { @Override public void processRow(ResultSet rs) throws SQLException { int instanceId = rs.getInt(1); String word = rs.getString(2); String wordValue = rs.getString(3); addNominalWordToInstance(bagOfWordsData, instanceId, word, wordValue); } }); return null; } }); } protected void loadProperties(String propertyFile, Properties props) throws FileNotFoundException, IOException, InvalidPropertiesFormatException { InputStream in = null; try { in = new FileInputStream(propertyFile); if (propertyFile.endsWith(".xml")) props.loadFromXML(in); else props.load(in); } finally { if (in != null) { in.close(); } } } protected void loadData(BagOfWordsData bagOfWordsData, String instanceNumericWordQuery, String instanceNominalWordQuery, BagOfWordsDecorator bDecorator) { if (instanceNumericWordQuery.trim().length() > 0) this.getNumericInstanceWords(instanceNumericWordQuery, bagOfWordsData); // added to support adding gram matrix index in GramMatrixExporter // TODO fix this // currently not using weka gram matrix // if (bDecorator != null) // bDecorator.decorateNumericInstanceWords( // bagOfWordsData.getInstanceNumericWords(), // bagOfWordsData.getNumericWords()); // if (instanceNominalWordQuery.trim().length() > 0) // this.getNominalInstanceWords(instanceNominalWordQuery, // bagOfWordsData); // if (bDecorator != null) // bDecorator.decorateNominalInstanceWords( // bagOfWordsData.getInstanceNominalWords(), // bagOfWordsData.getNominalWordValueMap()); } }
{ "content_hash": "1d4028516627082ac25f151951bad067", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 77, "avg_line_length": 32.06521739130435, "alnum_prop": 0.7366779661016949, "repo_name": "TCU-MI/ctakes", "id": "0d31fa3f89ca76be651f75184d923389156bc66f", "size": "8183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ctakes-ytex/src/main/java/org/apache/ctakes/ytex/kernel/AbstractBagOfWordsExporter.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "23017" }, { "name": "Bluespec", "bytes": "3571" }, { "name": "CSS", "bytes": "2714" }, { "name": "Groovy", "bytes": "31169" }, { "name": "HTML", "bytes": "28750" }, { "name": "Java", "bytes": "6437520" }, { "name": "PLSQL", "bytes": "4571" }, { "name": "Perl", "bytes": "1610" }, { "name": "SQLPL", "bytes": "26511" }, { "name": "Shell", "bytes": "5446" }, { "name": "XSLT", "bytes": "1909" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ ~ WSO2 Inc. licenses this file to you under the Apache License, ~ Version 2.0 (the "License"); you may not use this file except ~ in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, ~ software distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the License for the ~ specific language governing permissions and limitations ~ under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>org.wso2.carbon.analytics-common</groupId> <artifactId>event-output-adapters</artifactId> <version>2.0.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>org.wso2.carbon.event.output.adapter.ui</artifactId> <packaging>bundle</packaging> <name>WSO2 Carbon - Event Output UI Adapter Module</name> <description>org.wso2.carbon.event.output.adapter.ui provides the back-end functionality of ui event adapter </description> <url>http://wso2.org</url> <dependencies> <dependency> <groupId>org.wso2.carbon.analytics-common</groupId> <artifactId>org.wso2.carbon.event.output.adapter.core</artifactId> </dependency> <dependency> <groupId>org.wso2.carbon</groupId> <artifactId>org.wso2.carbon.logging</artifactId> </dependency> <dependency> <groupId>org.wso2.carbon</groupId> <artifactId>org.wso2.carbon.core</artifactId> </dependency> <dependency> <groupId>javax.websocket</groupId> <artifactId>javax.websocket-api</artifactId> </dependency> <dependency> <groupId>org.wso2.carbon.analytics-common</groupId> <artifactId>org.wso2.carbon.databridge.commons</artifactId> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-scr-plugin</artifactId> <executions> <execution> <id>generate-scr-descriptor</id> <goals> <goal>scr</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> <Bundle-Name>${project.artifactId}</Bundle-Name> <Private-Package> org.wso2.carbon.event.output.adapter.ui.internal, org.wso2.carbon.event.output.adapter.ui.internal.* </Private-Package> <Export-Package> !org.wso2.carbon.event.output.adapter.ui.internal, !org.wso2.carbon.event.output.adapter.ui.internal.*, org.wso2.carbon.event.output.adapter.ui.* </Export-Package> <Import-Package> org.wso2.carbon.event.output.adapter.core.*, javax.xml.namespace; version=0.0.0, *;resolution:=optional, </Import-Package> <DynamicImport-Package>*</DynamicImport-Package> </instructions> </configuration> </plugin> </plugins> </build> </project>
{ "content_hash": "13dd3f0214d8ed5fe6caa161274334b8", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 201, "avg_line_length": 40.49122807017544, "alnum_prop": 0.5571923743500866, "repo_name": "manoramahp/carbon-analytics-common", "id": "3fdc7d2ba3967765c670b94a59128e098f94752c", "size": "4616", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "components/event-publisher/event-output-adapters/org.wso2.carbon.event.output.adapter.ui/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "20552" }, { "name": "HTML", "bytes": "35860" }, { "name": "Java", "bytes": "3392600" }, { "name": "JavaScript", "bytes": "182430" }, { "name": "Thrift", "bytes": "6297" } ], "symlink_target": "" }
using System.Globalization; namespace Imgix_Dotnet.Operations.PixelDensity { /// <summary> /// ImgixImage extension methods that set pixel density related parameters on the Url. /// </summary> public static class PixelDensityExtensions { /// <summary> /// /// </summary> /// <param name="image">The image to transform</param> /// <param name="value"> /// Value: less than 8 /// </param> /// <returns></returns> public static ImgixImage DPR(this ImgixImage image, double value) => image.AddParameter("dpr", value.ToString(CultureInfo.InvariantCulture)); } }
{ "content_hash": "c286409861b74e18e5fc6260c959b697", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 90, "avg_line_length": 31.904761904761905, "alnum_prop": 0.6014925373134329, "repo_name": "estei/Imgix-Dotnet", "id": "cfe4a3984b476c041e276591168d9aed332d84a0", "size": "672", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Imgix-Dotnet/Operations/PixelDensity/PixelDensityExtensions.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "84" }, { "name": "C#", "bytes": "158868" }, { "name": "PowerShell", "bytes": "834" } ], "symlink_target": "" }
C++ library to help you handle dates from the Gregorian Calendar. Programming with dates should be almost as simple and easy as programming with strings and integers. Applications with lots of date-time related computations can be simplified significantly by having a robust set of operators and calculation capabilities. ## dateformat Functionalities The `dateformat` class defines the format in which a date is output or input. ### Accepted Date Formats: #### Date Formats: * **`"0"`**: No date provided. For output only. * **`"d"`**: Single digit date in one digit *(9)*, Double Digit date in two digits *(25)*. * **`"dd"`**: All dates in two digits. Single digit dates with leading 0 *(09, 25)*. #### Month Format: * **`"0"`**: Full names of months *(February, November)*. For output only. * **`"m"`**: Single digit month in one digit *(2)*, Double Digit month in two digits *(11)*. * **`"mm"`**: All months in two digits. Single digit months with leading 0 *(02, 11)*. * **`"mmm"`**: First three letters of month name *(Feb, Nov)*. For output only. #### Year Format: * **`"0"`**: No year provided. For output only. * **`"yy"`**: Year in last two digits *(61, 16)*. * **`"yyyy"`**: Year in four digits *(1961, 2016)*. ### Constructors * `DateFormat (const char* dateFormat, const char* monthFormat, const char* yearFormat)` - Three C-strings format with Date Format, Month Format, and Year Format provided. `DateFormat format ("d", "mm", "yyyy")`. * `DateFormat (const char* format)` - Single C-string format where Date Format, Month Format, and Year Format are separated by ’-’. `DateFormat format ("d-mm-yyyy")`. * `DateFormat ()` - Creates default `DateFormat` - "dd-mmm-yy". ### Methods * `char* get_dateFormat () const` - Get Date Format. * `char* get_monthFormat () const` - Get Month Format. * `char* get_yearFormat () const` - Get Year Format. ### Usage with `date` Class To define the format in which `Date` objects are input and output, set the value of the static `format` member as follows: ```cpp DateFormat form ("dd-mm-yyyy"); Date::setFormat (form); ``` ## date Functionalities The `date` class gives functionalities to use dates and perform operation on them, in C++ programs. ### Date Data Types * `Day` - `DXX` representing the XXth Day of the Month, (`D28`, 28th), (`D01`, 1st). * `Month` - `MXX` representing the XXth Month of the Year, (`M09`, September). * `Year` - Unsigned Integer values. * `WeekDay` - `Mon` representing Monday. * `WeekNumber` - `WXX` representing the XXth Week of the Year, (`W34`, Week Number 34). ### Constructors * `Date (Day d, Month m, Year y)` - Construct a Date from (d, m, y) values. * `Date (const char* date)` - Date in string format - parsed as specified by static `format` member. * `Date ()` - Default Constructor - construct Today's date. * `Date (const Date&)` - Copy Constructor. ### Methods #### Arithmetic Operators ```cpp Date example_date (D25, M05, 2015); ``` * `Date& operator++ ()` - Next day (`++example_date` gives 26th March, 2015). * `Date& operator++ (int)` - Same day next week (`example_date++` gives 1st April, 2015). * `Date& operator-- ()` - Previous day (`--example_date` gives 24th March, 2015). * `Date& operator-- (int)` - Same day previous week (`example_date--` gives 18th March, 2015). * `unsigned int operator- (const Date& otherDate)` - Number of days between `otherDate` and current date. (`Date (D22, M04, 2015) - Date (D22, M05, 2015)` will return 30). * `Date operator+ (int noOfDays)` - Day `noOfDays` after (before) the current date. Ahead or behind current date depends on sign of `noOfDays`. #### Relational Operators The following operators can be used to compare dates: ```cpp bool operator== (const Date& otherDate); bool operator!= (const Date& otherDate); bool operator< (const Date& otherDate); bool operator<= (const Date& otherDate); bool operator> (const Date& otherDate); bool operator>= (const Date& otherDate); ``` For example, `Date () >= Date (D01, M01, 2016)` will return `true`. #### Casting Operators * `operator WeekNumber () const` - Cast to the week number of the year in which the current date falls. * `operator Month () const` - Cast to the month of the year in which the current date falls. * `operator WeekDay () const` - Cast to the day of the week of the current date. #### Date Format Setting * `static void setFormat (DateFormat&)` - Set/Change Input/Output `DateFormat` for dates. * `static DateFormat& getFormat ()` - Get Input/Output `DateFormat` for dates. #### Global Methods * `ostream& operator<< (ostream&, const Date&)` - Output dates as per the `format`. ```cpp Date test_date (D28, M03, 2005); std::cout << test_date; ``` * `istream& operator>> (istream&, Date&)` - Input dates as per the `format`. ```cpp Date test_date (D28, M03, 2005); std::cin >> test_date; ``` #### Other Methods * `Date& operator= (const Date&)` - Assignment operator for Date objects. * `bool leapYear () const` - Check if the year of the current date is a leap year.
{ "content_hash": "c34a3c4fb336f89649d5973a8ebc22a8", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 321, "avg_line_length": 38.93798449612403, "alnum_prop": 0.6812661755922755, "repo_name": "Avikalp7/Date-Class", "id": "462ae2c2856bfde5c5375cc26d91052e4ce71701", "size": "5040", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "67093" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="he" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About OraCoin</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;OraCoin&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2017 The OraCoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or &lt;a href=&quot;http://www.opensource.org/licenses/mit-license.php&quot;&gt;http://www.opensource.org/licenses/mit-license.php&lt;/a&gt;. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (&lt;a href=&quot;https://www.openssl.org/&quot;&gt;https://www.openssl.org/&lt;/a&gt;) and cryptographic software written by Eric Young (&lt;a href=&quot;mailto:eay@cryptsoft.com&quot;&gt;eay@cryptsoft.com&lt;/a&gt;) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>לחץ לחיצה כפולה לערוך כתובת או תוית</translation> </message> <message> <location line="+24"/> <source>Create a new address</source> <translation>יצירת כתובת חדשה</translation> </message> <message> <location line="+10"/> <source>Copy the currently selected address to the system clipboard</source> <translation>העתק את הכתובת המסומנת ללוח העריכה</translation> </message> <message> <location line="-7"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-43"/> <source>These are your OraCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>&amp;Copy Address</source> <translation>העתק כתובת</translation> </message> <message> <location line="+7"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign a message to prove you own a OraCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Delete the currently selected address from the list</source> <translation>מחק את הכתובת שנבחרה מהרשימה</translation> </message> <message> <location line="-10"/> <source>Verify a message to ensure it was signed with a specified OraCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Delete</source> <translation>&amp;מחק</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+66"/> <source>Copy &amp;Label</source> <translation>העתק תוית</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>עריכה</translation> </message> <message> <location line="+248"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>קובץ מופרד בפסיקים (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+145"/> <source>Label</source> <translation>תוית</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>כתובת</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(ללא תוית)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>שיח סיסמא</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>הכנס סיסמה</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>סיסמה חדשה</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>חזור על הסיסמה החדשה</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+38"/> <source>Encrypt wallet</source> <translation>הצפן ארנק</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>הפעולה הזו דורשת את סיסמת הארנק שלך בשביל לפתוח את הארנק.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>פתיחת ארנק</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>הפעולה הזו דורשת את סיסמת הארנק שלך בשביל לפענח את הארנק.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>פענוח ארנק</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>שינוי סיסמה</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>הכנס את הסיסמות הישנה והחדשה לארנק.</translation> </message> <message> <location line="+45"/> <source>Confirm wallet encryption</source> <translation>אשר הצפנת ארנק</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>האם אתה בטוח שברצונך להצפין את הארנק?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>חשוב! כל גיבוי קודם שעשית לארנק שלך יש להחליף עם קובץ הארנק המוצפן שזה עתה נוצר. מסיבות אבטחה, גיבויים קודמים של קובץ הארנק הלא-מוצפן יהפכו לחסרי שימוש ברגע שתתחיל להשתמש בארנק החדש המוצפן.</translation> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>זהירות: מקש Caps Lock מופעל!</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>הארנק הוצפן</translation> </message> <message> <location line="-140"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>OraCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>הצפנת הארנק נכשלה</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>הצפנת הארנק נכשלה עקב שגיאה פנימית. הארנק שלך לא הוצפן.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>הסיסמות שניתנו אינן תואמות.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>פתיחת הארנק נכשלה</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>הסיסמה שהוכנסה לפענוח הארנק שגויה.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>פענוח הארנק נכשל</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>סיסמת הארנק שונתה בהצלחה.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+297"/> <source>Sign &amp;message...</source> <translation>חתום על הודעה</translation> </message> <message> <location line="-64"/> <source>Show general overview of wallet</source> <translation>הצג סקירה כללית של הארנק</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;פעולות</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>דפדף בהיסטוריית הפעולות</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-18"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>E&amp;xit</source> <translation>י&amp;ציאה</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>סגור תוכנה</translation> </message> <message> <location line="+4"/> <source>Show information about OraCoin</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>אודות Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>הצג מידע על Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;אפשרויות</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>הצפן ארנק</translation> </message> <message> <location line="+2"/> <source>&amp;Backup Wallet...</source> <translation>גיבוי ארנק</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>שנה סיסמא</translation> </message> <message> <location line="+9"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-55"/> <source>Send coins to a OraCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>Modify configuration options for OraCoin</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Backup wallet to another location</source> <translation>גיבוי הארנק למקום אחר</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>שנה את הסיסמה להצפנת הארנק</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>חלון ניפוי</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>פתח את לוח הבקרה לאבחון וניפוי</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>אמת הודעה...</translation> </message> <message> <location line="-214"/> <location line="+555"/> <source>OraCoin</source> <translation type="unfinished"/> </message> <message> <location line="-555"/> <source>Wallet</source> <translation>ארנק</translation> </message> <message> <location line="+193"/> <source>&amp;About OraCoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>הצג / הסתר</translation> </message> <message> <location line="+8"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>&amp;File</source> <translation>&amp;קובץ</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>ה&amp;גדרות</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;עזרה</translation> </message> <message> <location line="+17"/> <source>Tabs toolbar</source> <translation>סרגל כלים טאבים</translation> </message> <message> <location line="+46"/> <location line="+9"/> <source>[testnet]</source> <translation>[רשת-בדיקה]</translation> </message> <message> <location line="+0"/> <location line="+58"/> <source>OraCoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+70"/> <source>%n active connection(s) to OraCoin network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+488"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message> <location line="-812"/> <source>&amp;Dashboard</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+277"/> <source>Up to date</source> <translation>עדכני</translation> </message> <message> <location line="+43"/> <source>Catching up...</source> <translation>מתעדכן...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>פעולה שנשלחה</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>פעולה שהתקבלה</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>תאריך: %1 כמות: %2 סוג: %3 כתובת: %4</translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid OraCoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Wallet is &lt;b&gt;not encrypted&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>הארנק &lt;b&gt;מוצפן&lt;/b&gt; וכרגע &lt;b&gt;פתוח&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>הארנק &lt;b&gt;מוצפן&lt;/b&gt; וכרגע &lt;b&gt;נעול&lt;/b&gt;</translation> </message> <message> <location line="+24"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+91"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="-429"/> <location line="+433"/> <source>%n hour(s)</source> <translation><numerusform>%n שעה</numerusform><numerusform>%n שעות</numerusform></translation> </message> <message> <location line="-456"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+27"/> <location line="+433"/> <source>%n day(s)</source> <translation><numerusform>%n יום</numerusform><numerusform>%n ימים</numerusform></translation> </message> <message numerus="yes"> <location line="-429"/> <location line="+6"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+0"/> <source>%1 and %2</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+0"/> <source>%n year(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+324"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+104"/> <source>A fatal error occurred. OraCoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+119"/> <source>Network Alert</source> <translation>אזעקת רשת</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation>כמות:</translation> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation>בייטים:</translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>כמות:</translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation>תשלום:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+493"/> <source>no</source> <translation>לא</translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation>לאחר עמלה:</translation> </message> <message> <location line="+35"/> <source>Change:</source> <translation>שינוי:</translation> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation>(מחק)(בחר) הכל</translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation>מצב עץ</translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation>מצר רשימה</translation> </message> <message> <location line="+45"/> <source>Amount</source> <translation>כמות</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>כתובת</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>תאריך</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation>אישורים</translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>מאושר</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation>קדימות</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="-456"/> <source>Copy address</source> <translation>העתק כתובת</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>העתק תוית</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>העתק כמות</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>העתק מזהה פעולה</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation>העתק כמות</translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation>העתק מחיר</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+423"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation>כן</translation> </message> <message> <location line="+9"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <location line="+58"/> <source>(no label)</source> <translation>(ללא תוית)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation>עודף מ־%1 (%2)</translation> </message> <message> <location line="+1"/> <source>(change)</source> <translation>(עודף)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>ערוך כתובת</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>ת&amp;וית</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;כתובת</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>כתובת חדשה לקבלה</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>כתובת חדשה לשליחה</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>ערוך כתובת לקבלה</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>ערוך כתובת לשליחה</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>הכתובת שהכנסת &quot;%1&quot; כבר נמצאת בפנקס הכתובות.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid OraCoin address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>פתיחת הארנק נכשלה.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>יצירת מפתח חדש נכשלה.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+426"/> <location line="+12"/> <source>OraCoin-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>אפשרויות</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>ראשי</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>שלם &amp;עמלת פעולה</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start OraCoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start OraCoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>רשת</translation> </message> <message> <location line="+6"/> <source>Automatically open the OraCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>מיפוי פורט באמצעות UPnP</translation> </message> <message> <location line="+19"/> <source>Proxy &amp;IP:</source> <translation>כתובת IP של פרוקסי:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>פורט:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>הפורט של הפרוקסי (למשל 9050)</translation> </message> <message> <location line="-57"/> <source>Connect to the OraCoin network through a SOCKS5 proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS5 proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+90"/> <source>&amp;Window</source> <translation>חלון</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>הצג סמל מגש בלבד לאחר מזעור החלון.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>מ&amp;זער למגש במקום לשורת המשימות</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>מזער את התוכנה במקום לצאת ממנה כשהחלון נסגר. כשאפשרות זו פעילה, התוכנה תיסגר רק לאחר בחירת יציאה מהתפריט.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>מזער בעת סגירה</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>תצוגה</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>שפת ממשק המשתמש:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting OraCoin.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>יחידת מדידה להצגת כמויות:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>בחר את ברירת המחדל ליחידת החלוקה אשר תוצג בממשק ובעת שליחת מטבעות.</translation> </message> <message> <location line="+9"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use black visual theme (requires restart)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>אישור</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>ביטול</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+47"/> <source>default</source> <translation>ברירת מחדל</translation> </message> <message> <location line="+147"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting OraCoin.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>כתובת הפרוקסי שסופקה אינה תקינה.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>טופס</translation> </message> <message> <location line="+46"/> <location line="+247"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the OraCoin network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-173"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-113"/> <source>Wallet</source> <translation>ארנק</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>היתרה הזמינה הנוכחית</translation> </message> <message> <location line="+80"/> <source>Immature:</source> <translation>לא בשל:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>מאזן שנכרה וטרם הבשיל</translation> </message> <message> <location line="+23"/> <source>Total:</source> <translation>סך הכול:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation>סך כל היתרה הנוכחית שלך</translation> </message> <message> <location line="+50"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;פעולות אחרונות&lt;/b&gt;</translation> </message> <message> <location line="-118"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-32"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>לא מסונכרן</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start oracoin: click-to-pay handler</source> <translation type="unfinished"/> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>שם ממשק</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <source>N/A</source> <translation>N/A</translation> </message> <message> <location line="-194"/> <source>Client version</source> <translation>גרסת ממשק</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>מידע</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>משתמש ב-OpenSSL גרסה</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>זמן אתחול</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>רשת</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>מספר חיבורים</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>שרשרת הבלוקים</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>מספר הבלוקים הנוכחי</translation> </message> <message> <location line="+197"/> <source>&amp;Network Traffic</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Clear</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Totals</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <location filename="../rpcconsole.cpp" line="+352"/> <source>In:</source> <translation type="unfinished"/> </message> <message> <location line="+80"/> <location filename="../rpcconsole.cpp" line="+1"/> <source>Out:</source> <translation type="unfinished"/> </message> <message> <location line="-383"/> <source>Last block time</source> <translation>זמן הבלוק האחרון</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>פתח</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the OraCoin-Qt help message to get a list with possible OraCoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>לוח בקרה</translation> </message> <message> <location line="-237"/> <source>Build date</source> <translation>תאריך בניה</translation> </message> <message> <location line="-104"/> <source>OraCoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>OraCoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+256"/> <source>Debug log file</source> <translation>קובץ יומן ניפוי</translation> </message> <message> <location line="+7"/> <source>Open the OraCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>נקה לוח בקרה</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-28"/> <source>Welcome to the OraCoin RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>השתמש בחיצים למעלה ולמטה כדי לנווט בהיסטוריה, ו- &lt;b&gt;Ctrl-L&lt;/b&gt; כדי לנקות את המסך.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>הקלד &lt;b&gt;help&lt;/b&gt; בשביל סקירה של הפקודות הזמינות.</translation> </message> <message> <location line="+134"/> <source>%1 B</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 KB</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 MB</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 GB</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>%1 m</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>%1 h</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 h %2 m</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+179"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>שלח מטבעות</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation>ה</translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation>נבחר אוטומאטית</translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation>אין מספיק כספים!</translation> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation>כמות:</translation> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation>בייטים:</translation> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>כמות:</translation> </message> <message> <location line="+54"/> <source>Fee:</source> <translation>תשלום:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation>לאחר עמלה:</translation> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>שלח למספר מקבלים בו-זמנית</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>הוסף מקבל</translation> </message> <message> <location line="+16"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>נקה הכל</translation> </message> <message> <location line="+24"/> <source>Balance:</source> <translation>יתרה:</translation> </message> <message> <location line="+47"/> <source>Confirm the send action</source> <translation>אשר את פעולת השליחה</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>שלח</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-171"/> <source>Enter a OraCoin address (e.g. ofWk4whr8ZLeZJZHCNTUXPoAJCEnXR4C1h)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation>העתק כמות</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>העתק כמות</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation>העתק מחיר</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+85"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>אשר שליחת מטבעות</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>כתובת המקבל אינה תקינה, אנא בדוק שנית.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>הכמות לשלם חייבת להיות גדולה מ-0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>הכמות עולה על המאזן שלך.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>הכמות הכוללת, ובכללה עמלת פעולה בסך %1, עולה על המאזן שלך.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>כתובת כפולה נמצאה, ניתן לשלוח לכל כתובת רק פעם אחת בכל פעולת שליחה.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+241"/> <source>WARNING: Invalid OraCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(ללא תוית)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>כ&amp;מות:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>שלם &amp;ל:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. ofWk4whr8ZLeZJZHCNTUXPoAJCEnXR4C1h)</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>הכנס תוית לכתובת הזאת כדי להכניס לפנקס הכתובות</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>ת&amp;וית:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>הדבר כתובת מהלוח</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a OraCoin address (e.g. ofWk4whr8ZLeZJZHCNTUXPoAJCEnXR4C1h)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>חתימות - חתום או אמת הודעה</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>חתום על הו&amp;דעה</translation> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>אתה יכול לחתום על הודעות עם הכתובות שלך כדי להוכיח שהן בבעלותך. היזהר לא לחתום על משהו מעורפל, שכן התקפות פישינג עשויות לגרום לך בעורמה למסור את זהותך. חתום רק על אמרות מפורטות לחלוטין שאתה מסכים עימן.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. ofWk4whr8ZLeZJZHCNTUXPoAJCEnXR4C1h)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>הדבק כתובת מהלוח</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>הכנס כאן את ההודעה שעליך ברצונך לחתום</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>העתק את החתימה הנוכחית ללוח המערכת</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this OraCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>אפס את כל שדות החתימה על הודעה</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>נקה הכל</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>אמת הודעה</translation> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>הכנס למטה את הכתובת החותמת, ההודעה (ודא שאתה מעתיק מעברי שורה, רווחים, טאבים וכו&apos; באופן מדויק) והחתימה כדי לאמת את ההודעה. היזהר לא לפרש את החתימה כיותר ממה שמופיע בהודעה החתומה בעצמה, כדי להימנע מליפול קורבן למתקפת איש-באמצע.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. ofWk4whr8ZLeZJZHCNTUXPoAJCEnXR4C1h)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified OraCoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>אפס את כל שדות אימות הודעה</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a OraCoin address (e.g. ofWk4whr8ZLeZJZHCNTUXPoAJCEnXR4C1h)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>לחץ &quot;חתום על ההודעה&quot; כדי לחולל חתימה</translation> </message> <message> <location line="+3"/> <source>Enter OraCoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+85"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>הכתובת שהוכנסה אינה תקינה.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>אנא בדוק את הכתובת ונסה שנית.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>הכתובת שהוכנסה אינה מתייחסת למפתח.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>פתיחת הארנק בוטלה.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>המפתח הפרטי עבור הכתובת שהוכנסה אינו זמין.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>החתימה על ההודעה נכשלה.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>ההודעה נחתמה.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>לא ניתן לפענח את החתימה.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>אנא בדוק את החתימה ונסה שנית.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>החתימה לא תואמת את תקציר ההודעה.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>אימות ההודעה נכשל.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>ההודעה אומתה.</translation> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <location filename="../trafficgraphwidget.cpp" line="+75"/> <source>KB/s</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+25"/> <source>Open until %1</source> <translation>פתוח עד %1</translation> </message> <message> <location line="+6"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1/מנותק</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/ממתין לאישור</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 אישורים</translation> </message> <message> <location line="+17"/> <source>Status</source> <translation>מצב</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, הופץ דרך צומת אחד</numerusform><numerusform>, הופץ דרך %n צמתים</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>תאריך</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>מקור</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>נוצר</translation> </message> <message> <location line="+5"/> <location line="+13"/> <source>From</source> <translation>מאת</translation> </message> <message> <location line="+1"/> <location line="+19"/> <location line="+58"/> <source>To</source> <translation>אל</translation> </message> <message> <location line="-74"/> <location line="+2"/> <source>own address</source> <translation>כתובת עצמית</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>תוית</translation> </message> <message> <location line="+34"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>זיכוי</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>מבשיל בעוד בלוק אחד</numerusform><numerusform>מבשיל בעוד %n בלוקים</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>לא התקבל</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>חיוב</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>עמלת פעולה</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>כמות נקיה</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>הודעה</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>הערה</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>זיהוי פעולה</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>מידע ניפוי</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>פעולה</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>קלטים</translation> </message> <message> <location line="+21"/> <source>Amount</source> <translation>כמות</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>אמת</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>שקר</translation> </message> <message> <location line="-202"/> <source>, has not been successfully broadcast yet</source> <translation>, טרם שודר בהצלחה</translation> </message> <message numerus="yes"> <location line="-36"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+67"/> <source>unknown</source> <translation>לא ידוע</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>פרטי הפעולה</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>חלונית זו מציגה תיאור מפורט של הפעולה</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+231"/> <source>Date</source> <translation>תאריך</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>סוג</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>כתובת</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>כמות</translation> </message> <message> <location line="+52"/> <source>Open until %1</source> <translation>פתוח עד %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>מאושר (%1 אישורים)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation><numerusform>פתח למשך בלוק %n יותר</numerusform><numerusform>פתח למשך %n בלוקים נוספים</numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>הבלוק הזה לא נקלט על ידי אף צומת אחר, וכנראה לא יתקבל!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>נוצר אך לא התקבל</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>התקבל עם</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>התקבל מאת</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>נשלח ל</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>תשלום לעצמך</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>נכרה</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <location line="+194"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>מצב הפעולה. השהה את הסמן מעל שדה זה כדי לראות את מספר האישורים.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>התאריך והשעה בה הפעולה הזאת התקבלה.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>סוג הפעולה.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>כתובת היעד של הפעולה.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>הכמות שהתווספה או הוסרה מהיתרה.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+54"/> <location line="+17"/> <source>All</source> <translation>הכל</translation> </message> <message> <location line="-16"/> <source>Today</source> <translation>היום</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>השבוע</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>החודש</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>החודש שעבר</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>השנה</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>טווח...</translation> </message> <message> <location line="+12"/> <source>Received with</source> <translation>התקבל עם</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>נשלח ל</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>לעצמך</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>נכרה</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>אחר</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>הכנס כתובת או תוית לחפש</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>כמות מזערית</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>העתק כתובת</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>העתק תוית</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>העתק כמות</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>העתק מזהה פעולה</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>ערוך תוית</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>הצג פרטי פעולה</translation> </message> <message> <location line="+138"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>קובץ מופרד בפסיקים (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>מאושר</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>תאריך</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>סוג</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>תוית</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>כתובת</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>כמות</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>מזהה</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation>טווח:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>אל</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+212"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+8"/> <source>OraCoin version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>שימוש:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or oracoind</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>רשימת פקודות</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>קבל עזרה עבור פקודה</translation> </message> <message> <location line="+1"/> <source>Options:</source> <translation>אפשרויות:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: oracoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: oracoind.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>ציין תיקיית נתונים</translation> </message> <message> <location line="+163"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=oracoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;OraCoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="-161"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>קבע את גודל המטמון של מסד הנתונים במגהבייט (ברירת מחדל: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Listen for connections on &lt;port&gt; (default: 15556 or testnet: 25556)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>החזק לכל היותר &lt;n&gt; חיבורים לעמיתים (ברירת מחדל: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>התחבר לצומת כדי לדלות כתובות עמיתים, ואז התנתק</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>ציין את הכתובת הפומבית שלך</translation> </message> <message> <location line="+4"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Always query for peer addresses via DNS lookup (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>סף להתנתקות מעמיתים הנוהגים שלא כהלכה (ברירת מחדל: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>מספר שניות למנוע מעמיתים הנוהגים שלא כהלכה מלהתחבר מחדש (ברירת מחדל: 86400)</translation> </message> <message> <location line="+153"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>אירעה שגיאה בעת הגדרת פורט RPC %u להאזנה ב-IPv4: %s</translation> </message> <message> <location line="-126"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15555 or testnet: 25555)</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Accept command line and JSON-RPC commands</source> <translation>קבל פקודות משורת הפקודה ו- JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Run in the background as a daemon and accept commands</source> <translation>רוץ ברקע כדימון וקבל פקודות</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>השתמש ברשת הבדיקה</translation> </message> <message> <location line="-23"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>קבל חיבורים מבחוץ (ברירת מחדל: 1 ללא -proxy או -connect)</translation> </message> <message> <location line="+160"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>אירעה שגיאה בעת הגדרת פורט RPC %u להאזנה ב-IPv6, נסוג ל-IPv4: %s</translation> </message> <message> <location line="-84"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>אזהרה: -paytxfee נקבע לערך מאד גבוה! זוהי עמלת הפעולה שתשלם אם אתה שולח פעולה.</translation> </message> <message> <location line="+46"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong OraCoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>אזהרה: שגיאה בקריאת wallet.dat! כל המתפחות נקראו באופן תקין, אך נתוני הפעולות או ספר הכתובות עלולים להיות חסרים או שגויים.</translation> </message> <message> <location line="-16"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>אזהרה: קובץ wallet.dat מושחת, המידע חולץ! קובץ wallet.dat המקורח נשמר כ - wallet.{timestamp}.bak ב - %s; אם המאזן או הפעולות שגויים עליך לשחזר גיבוי.</translation> </message> <message> <location line="-31"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>נסה לשחזר מפתחות פרטיים מקובץ wallet.dat מושחת.</translation> </message> <message> <location line="+5"/> <source>Block creation options:</source> <translation>אפשרויות יצירת בלוק:</translation> </message> <message> <location line="-66"/> <source>Connect only to the specified node(s)</source> <translation>התחבר רק לצמתים המצוינים</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>גלה את כתובת ה-IP העצמית (ברירת מחדל: 1 כשמאזינים וללא -externalip)</translation> </message> <message> <location line="+97"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>האזנה נכשלה בכל פורט. השתמש ב- -listen=0 אם ברצונך בכך.</translation> </message> <message> <location line="-2"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-85"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>חוצץ קבלה מירבי לכל חיבור, &lt;n&gt;*1000 בתים (ברירת מחדל: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>חוצץ שליחה מירבי לכל חיבור, &lt;n&gt;*1000 בתים (ברירת מחדל: 1000)</translation> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>התחבר רק לצמתים ברשת &lt;net&gt; (IPv4, IPv6 או Tor)</translation> </message> <message> <location line="+30"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>SSL options: (see the Oracoin wiki for SSL setup instructions)</source> <translation>אפשרויות SSL: (ראה את הויקי של ביטקוין עבור הוראות הגדרת SSL)</translation> </message> <message> <location line="-34"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>שלח מידע דיבאג ועקבה לקונסולה במקום לקובץ debug.log</translation> </message> <message> <location line="+33"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>קבע את גודל הבלוק המינימלי בבתים (ברירת מחדל: 0)</translation> </message> <message> <location line="-33"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>כווץ את קובץ debug.log בהפעלת הקליינט (ברירת מחדל: 1 ללא -debug)</translation> </message> <message> <location line="-41"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>ציין הגבלת זמן לחיבור במילישניות (ברירת מחדל: 5000)</translation> </message> <message> <location line="+28"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>השתמש ב-UPnP כדי למפות את הפורט להאזנה (ברירת מחדל: 0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>השתמש ב-UPnP כדי למפות את הפורט להאזנה (ברירת מחדל: 1 בעת האזנה)</translation> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Username for JSON-RPC connections</source> <translation>שם משתמש לחיבורי JSON-RPC</translation> </message> <message> <location line="+50"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+43"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>אזהרה: הגרסה הזאת מיושנת, יש צורך בשדרוג!</translation> </message> <message> <location line="-23"/> <source>wallet.dat corrupt, salvage failed</source> <translation>קובץ wallet.dat מושחת, החילוץ נכשל</translation> </message> <message> <location line="-55"/> <source>Password for JSON-RPC connections</source> <translation>סיסמה לחיבורי JSON-RPC</translation> </message> <message> <location line="-47"/> <source>Connect through SOCKS5 proxy</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Output debugging information (default: 0, supplying &lt;category&gt; is optional)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>If &lt;category&gt; is not supplied, output all debugging information.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&lt;category&gt; can be:</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>אפשר חיבורי JSON-RPC מכתובת האינטרנט המצוינת</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>שלח פקודות לצומת ב-&lt;ip&gt; (ברירת מחדל: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Wait for RPC server to start</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>בצע פקודה זו כשהבלוק הטוב ביותר משתנה (%s בפקודה יוחלף בגיבוב הבלוק)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>בצע פקודה כאשר פעולת ארנק משתנה (%s ב cmd יוחלף ב TxID)</translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>שדרג את הארנק לפורמט העדכני</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>קבע את גודל המאגר ל -&lt;n&gt; (ברירת מחדל: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>סרוק מחדש את שרשרת הבלוקים למציאת פעולות חסרות בארנק</translation> </message> <message> <location line="+3"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Keep at most &lt;n&gt; MiB of unconnectable blocks in memory (default: %u)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>השתמש ב-OpenSSL (https( עבור חיבורי JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>קובץ תעודת שרת (ברירת מחדל: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>מפתח פרטי של השרת (ברירת מחדל: server.pem)</translation> </message> <message> <location line="+5"/> <source>Error: Unsupported argument -socks found. Setting SOCKS version isn&apos;t possible anymore, only SOCKS5 proxies are supported.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Initialization sanity check failed. OraCoin is shutting down.</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="-135"/> <source>This help message</source> <translation>הודעת העזרה הזו</translation> </message> <message> <location line="+100"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>לא מסוגל לקשור ל-%s במחשב זה (הקשירה החזירה שגיאה %d, %s)</translation> </message> <message> <location line="-136"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>אפשר בדיקת DNS עבור -addnode, -seednode ו- -connect</translation> </message> <message> <location line="+121"/> <source>Loading addresses...</source> <translation>טוען כתובות...</translation> </message> <message> <location line="-10"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>שגיאה בטעינת הקובץ wallet.dat: הארנק מושחת</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of OraCoin</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart OraCoin to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>שגיאה בטעינת הקובץ wallet.dat</translation> </message> <message> <location line="-15"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>כתובת -proxy לא תקינה: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>רשת לא ידועה צוינה ב- -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="+3"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>לא מסוגל לפתור כתובת -bind: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>לא מסוגל לפתור כתובת -externalip: &apos;%s&apos;</translation> </message> <message> <location line="-22"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>כמות לא תקינה עבור -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+59"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>כמות לא תקינה</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>אין מספיק כספים</translation> </message> <message> <location line="-41"/> <source>Loading block index...</source> <translation>טוען את אינדקס הבלוקים...</translation> </message> <message> <location line="-105"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>הוסף צומת להתחברות ונסה לשמור את החיבור פתוח</translation> </message> <message> <location line="+131"/> <source>Unable to bind to %s on this computer. OraCoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-108"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>How many blocks to check at startup (default: 500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. OraCoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Loading wallet...</source> <translation>טוען ארנק...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>לא יכול להוריד דרגת הארנק</translation> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>לא יכול לכתוב את כתובת ברירת המחדל</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>סורק מחדש...</translation> </message> <message> <location line="+2"/> <source>Done loading</source> <translation>טעינה הושלמה</translation> </message> <message> <location line="+33"/> <source>To use the %s option</source> <translation>להשתמש באפשרות %s</translation> </message> <message> <location line="-27"/> <source>Error</source> <translation>שגיאה</translation> </message> <message> <location line="+22"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>עליך לקבוע rpcpassword=yourpassword בקובץ ההגדרות: %s אם הקובץ אינו קיים, צור אותו עם הרשאות קריאה לבעלים בלבד.</translation> </message> </context> </TS>
{ "content_hash": "3d455e32c3ec870631d3c9870279ef26", "timestamp": "", "source": "github", "line_count": 3227, "max_line_length": 395, "avg_line_length": 34.63309575457081, "alnum_prop": 0.5980887787331896, "repo_name": "Oracoin-Project/Oracoin", "id": "d3843f8d69de05ffb07739b8f760b4db3d4e5c0f", "size": "117722", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_he.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "51312" }, { "name": "C", "bytes": "31757" }, { "name": "C++", "bytes": "2507457" }, { "name": "CSS", "bytes": "1127" }, { "name": "HTML", "bytes": "50621" }, { "name": "Makefile", "bytes": "12037" }, { "name": "NSIS", "bytes": "5914" }, { "name": "Objective-C", "bytes": "1052" }, { "name": "Objective-C++", "bytes": "6310" }, { "name": "Python", "bytes": "52480" }, { "name": "QMake", "bytes": "13870" }, { "name": "Shell", "bytes": "9246" } ], "symlink_target": "" }
<?php namespace Genesis\SQLExtension\Context\Exceptions; use Exception as BaseException; use Genesis\SQLExtension\Context\Representations\Entity; class UpdateException extends BaseException { const CODE = 0; /** * @param string $dataProperty The property that was not found. * @param BaseException $e The original exception. */ public function __construct(Entity $entity, BaseException $e) { $message = "Unable to update data on table '{$entity->getEntityName()}', Error " . $e->getMessage(); parent::__construct($message, self::CODE, $e); } }
{ "content_hash": "7f57b68946547ade889f6346656e4389", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 108, "avg_line_length": 28.523809523809526, "alnum_prop": 0.6844741235392321, "repo_name": "forceedge01/genesis-behat-sql-extension", "id": "d437ee146ad6abcc66afcd090ded68e7fc220f64", "size": "599", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Context/Exceptions/UpdateException.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "68396" }, { "name": "Shell", "bytes": "3227" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=1024, user-scalable=no"> <title>Docker</title> <!-- Required stylesheet --> <link rel="stylesheet" media="screen" href="core/deck.core.css"> <!-- Extension CSS files go here. Remove or add as needed. --> <link rel="stylesheet" media="screen" href="extensions/goto/deck.goto.css"> <link rel="stylesheet" media="screen" href="extensions/menu/deck.menu.css"> <link rel="stylesheet" media="screen" href="extensions/navigation/deck.navigation.css"> <link rel="stylesheet" media="screen" href="extensions/status/deck.status.css"> <link rel="stylesheet" media="screen" href="extensions/scale/deck.scale.css"> <!-- Style theme. More available in /themes/style/ or create your own. --> <link rel="stylesheet" media="screen" href="themes/style/web-2.0.css"> <!-- Transition theme. More available in /themes/transition/ or create your own. --> <link rel="stylesheet" media="screen" href="themes/transition/horizontal-slide.css"> <!-- Basic black and white print styles --> <link rel="stylesheet" media="print" href="core/print.css"> <!-- Required Modernizr file --> <script src="modernizr.custom.js"></script> </head> <body> <div class="deck-container"> <!-- Begin slides. Just make elements with a class of slide. --> <section class="slide"> <img src="img/docker-logo.png" /> <h2 align="center">The Linux container engine</h2> </section> <section class="slide"> <h2>Iniciemos con un cuento...</h2> <div class="slide"> <p align="center">En un reino muy lejano tenían un problema...</p> <img src="img/farfaraway.jpg" /> </div> </section> <section class="slide"> <h2>Iniciemos con un cuento...</h2> <p align="center">todos en el reino querían transportar desde inocentes animalitos...</p> <img src="img/burro.jpg" /> </section> <section class="slide"> <h2>Iniciemos con un cuento...</h2> <img src="img/superdestructoresespaciales.jpg" style="width: 700px;"/> <p align="center">hasta destructores estelares.</p> <p class="slide" align="center" style="font-size: 50px;"> Pero nadie sabía como.</p> </section> <section class="slide"> <h2>Iniciemos con un cuento...</h2> <div class="slide"> <p align="center">El rey estaba desesperado, porque no sabía como llegarían<br>los destructores estelares que compró por Mercado libre,<br>ya que UPS no llegaba hasta su reino, y FedEx llegaba solamente mediante el uso de mulas.</p> <img src="img/rey-enano.jpg" /> </div> <div class="slide"> <p align="center">Pero que llegó el apuesto principe...</p> <img src="img/Prince Charming.jpg" /> </div> </section> <section class="slide"> <h2>Iniciemos con un cuento...</h2> <img src="img/container.jpg" style="width: 700px;"/> <p align="center">El principe les dijo que usando contenedores estandar podrian facilmente<br>transportar sus naves, ya fuera en camiones, barcos, burros<br>o incluso la Death Star, y que transportarlos, cambiar de transporte y guardarlos seria muy facil.</p> </section> <section class="slide"> <h2>Problema resuelto...</h2> <img src="img/prince-problem-solved.jpg" style="width: 700px;"/> <p align="center">Vamonos al Sume para celebrarlo.</p> </section> <section class="slide"> <img src="img/docker-logo.png" /> <h2 align="center">The Linux container engine</h2> </section> <section class="slide"> <h2>¿Que es docker?</h2> <ul> <li class="slide">Un proyecto Open-Source que busca crear contenedores ligeros y autosuficientes de cualquier aplicacion.</li> <li class="slide">El mismo contenedor con el que el programador trabaja y testea en su laptop, puede correr en produccion.</li> <li class="slide">Puede ejecutarse en una VM, bare metal, clusters, nubes publicas, etc.</li> </ul> </section> <section class="slide"> <img src="img/noposguau.jpg" style="zoom: 3;"/> </section> <section class="slide"> <h2 align="center">Instalación</h2> <ul class="slide">Como son varias cosillas, les recomiendo que visiten https://www.docker.io/gettingstarted/. ¿Porque? <ul class="slide"><h2>Varia un poco por las dependencias del sistema.</h2> <li class="slide">Kernel v3.8</li> <li class="slide">Iptables v1.4+</li> <li class="slide">Git 1.7+</li> <li class="slide">Procps/ps</li> <li class="slide">XZ Utils v4.9+</li> <li class="slide">Tener una jerarquía de <a href="https://github.com/tianon/cgroupfs-mount">cgroupfs</a> instalada apropiadamente.<br><strong>WTF is this?</strong> Un mecanismo de control del kernel y uso de sus recursos en grupos de tareas.</li> </ul> <li class="slide">Si usas DigitalOcean, ya tiene un droplet con ubuntu y docker preinstalado</li> <li class="slide">Yo baje un binario xD</li> </ul> </section> <section class="slide"> <img src="img/ver-sangre.jpg" style="zoom: 3;"/> </section> <section class="slide"> <h2>Primeros pasos...</h2> <pre>./docker -d &"</pre> <pre>./docker run ubuntu "/bin/echo hello world"</pre> <ul class="slide"><h2>¿Que paso?</h2> <li class="slide">Iniciamos el demonio docker.</li> <li class="slide">Descargo una imagen base del <a href="https://index.docker.io/">Docker Index</a></li> <li class="slide">Se le asignó un sistema de archivos</li> <li class="slide">Se le montó una capa de lectura/escritura</li> <li class="slide">Se le asignó una interfas de red</li> <li class="slide">Se le asignó una IP, para eso de la NAT</li> <li class="slide">Se ejecuto el proceso que le pedi</li> <li class="slide">Se mostró el resultado en nustra terminal.</li> </ul> </section> <section class="slide"> <h2>No es una virtualizacion mas...</h2> <ul class="slide"><h2>juay de rito?</h2> <li class="slide">Los procesos comparten el kernel del host</li> <li class="slide">No hay emulacion de dispositivos</li> <li class="slide">No hay secuencia de booteo</li> <ul class="slide">Arquitecturas y plataformas entre Host y contenedores deben coincidir. <ul>¿Donde queda la portabilidad? <li>¬.¬ no lo alcanze a investigar xD</li> </ul> </ul> </ul> </section> <section class="slide"> <h2>Preguntas?</h2> </section> <section class="slide"> <h2>Referencias</h2> <ul> <li>https://www.docker.io/gettingstarted/</li> <li>https://wiki.debian.org/HowToUpgradeKernel</li> <li></li> <li></li> <li></li> </ul> </section> <!-- End slides. --> <!-- Begin extension snippets. Add or remove as needed. --> <!-- deck.navigation snippet --> <div aria-role="navigation"> <a href="#" class="deck-prev-link" title="Previous">&#8592;</a> <a href="#" class="deck-next-link" title="Next">&#8594;</a> </div> <!-- deck.status snippet --> <p class="deck-status" aria-role="status"> <span class="deck-status-current"></span> / <span class="deck-status-total"></span> </p> <!-- deck.goto snippet --> <form action="." method="get" class="goto-form"> <label for="goto-slide">Go to slide:</label> <input type="text" name="slidenum" id="goto-slide" list="goto-datalist"> <datalist id="goto-datalist"></datalist> <input type="submit" value="Go"> </form> <!-- End extension snippets. --> </div> <!-- Required JS files. --> <script src="jquery.min.js"></script> <script src="core/deck.core.js"></script> <!-- Extension JS files. Add or remove as needed. --> <script src="extensions/menu/deck.menu.js"></script> <script src="extensions/goto/deck.goto.js"></script> <script src="extensions/status/deck.status.js"></script> <script src="extensions/navigation/deck.navigation.js"></script> <script src="extensions/scale/deck.scale.js"></script> <!-- Initialize the deck. You can put this in an external file if desired. --> <script> $(function() { $.deck('.slide'); }); </script> </body> </html>
{ "content_hash": "1d2182193bea1a99ed6571296a557fbb", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 265, "avg_line_length": 39.35813953488372, "alnum_prop": 0.6277475774048689, "repo_name": "carlosroh/docker_talk_con_10_porciento_mas_memes..._remasterizado", "id": "4910a16394863e248788199d84f07d98cf5e301d", "size": "8482", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "56046" }, { "name": "JavaScript", "bytes": "156348" } ], "symlink_target": "" }
include_recipe 'windows' registry_key 'HKLM\Software\Policies\Microsoft\Internet Explorer\Main' do values [{ name: 'DisableFirstRunCustomize', type: :dword, data: 1 }] action :create recursive true end
{ "content_hash": "3c828f112ef1854adae51e56ba1bdafe", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 73, "avg_line_length": 30, "alnum_prop": 0.7523809523809524, "repo_name": "valyukov/internet-explorer-cookbook", "id": "b71f671d05fc5778c3339c022af8ede38e630d62", "size": "210", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "recipes/disable_first_run_customize.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "5620" } ], "symlink_target": "" }
from collections import namedtuple import numpy as np from pgmpy.extern.six.moves import map State = namedtuple('State', ['var', 'state']) def cartesian(arrays, out=None): """Generate a cartesian product of input arrays. Parameters ---------- arrays : list of array-like 1-D arrays to form the cartesian product of. out : ndarray Array to place the cartesian product in. Returns ------- out : ndarray 2-D array of shape (M, len(arrays)) containing cartesian products formed of input arrays. Examples -------- >>> cartesian(([1, 2, 3], [4, 5], [6, 7])) array([[1, 4, 6], [1, 4, 7], [1, 5, 6], [1, 5, 7], [2, 4, 6], [2, 4, 7], [2, 5, 6], [2, 5, 7], [3, 4, 6], [3, 4, 7], [3, 5, 6], [3, 5, 7]]) """ arrays = [np.asarray(x) for x in arrays] shape = (len(x) for x in arrays) dtype = arrays[0].dtype ix = np.indices(shape) ix = ix.reshape(len(arrays), -1).T if out is None: out = np.empty_like(ix, dtype=dtype) for n, arr in enumerate(arrays): out[:, n] = arrays[n][ix[:, n]] return out def sample_discrete(values, weights, size=1): """ Generate a sample of given size, given a probability mass function. Parameters ---------- values: numpy.array: Array of all possible values that the random variable can take. weights: numpy.array or list of numpy.array: Array(s) representing the PMF of the random variable. size: int: Size of the sample to be generated. Returns ------- numpy.array: of values of the random variable sampled from the given PMF. Example ------- >>> import numpy as np >>> from pgmpy.utils.mathext import sample_discrete >>> values = np.array(['v_0', 'v_1', 'v_2']) >>> probabilities = np.array([0.2, 0.5, 0.3]) >>> sample_discrete(values, probabilities, 10) array(['v_1', 'v_1', 'v_0', 'v_1', 'v_2', 'v_0', 'v_1', 'v_1', 'v_1', 'v_2'], dtype='<U3') """ weights = np.array(weights) if weights.ndim == 1: return np.random.choice(values, size=size, p=weights) else: return np.fromiter(map(lambda t: np.random.choice(values, p=t), weights), dtype='int')
{ "content_hash": "d20a0ae415f4adb4592228b5c3cccadd", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 102, "avg_line_length": 26.48314606741573, "alnum_prop": 0.5447602885023335, "repo_name": "anaviltripathi/pgmpy", "id": "0c404457909432e43cba6a6ed9a9d0eef555132e", "size": "2357", "binary": false, "copies": "3", "ref": "refs/heads/dev", "path": "pgmpy/utils/mathext.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "908645" }, { "name": "Shell", "bytes": "1026" } ], "symlink_target": "" }
using UnityEngine; using System; using LuaInterface; using SLua; using System.Collections.Generic; public class Lua_UnityEngine_Collision : LuaObject { [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static public int constructor(IntPtr l) { try { UnityEngine.Collision o; o=new UnityEngine.Collision(); pushValue(l,true); pushValue(l,o); return 2; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static public int get_relativeVelocity(IntPtr l) { try { UnityEngine.Collision self=(UnityEngine.Collision)checkSelf(l); pushValue(l,true); pushValue(l,self.relativeVelocity); return 2; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static public int get_rigidbody(IntPtr l) { try { UnityEngine.Collision self=(UnityEngine.Collision)checkSelf(l); pushValue(l,true); pushValue(l,self.rigidbody); return 2; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static public int get_collider(IntPtr l) { try { UnityEngine.Collision self=(UnityEngine.Collision)checkSelf(l); pushValue(l,true); pushValue(l,self.collider); return 2; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static public int get_transform(IntPtr l) { try { UnityEngine.Collision self=(UnityEngine.Collision)checkSelf(l); pushValue(l,true); pushValue(l,self.transform); return 2; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static public int get_gameObject(IntPtr l) { try { UnityEngine.Collision self=(UnityEngine.Collision)checkSelf(l); pushValue(l,true); pushValue(l,self.gameObject); return 2; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static public int get_contacts(IntPtr l) { try { UnityEngine.Collision self=(UnityEngine.Collision)checkSelf(l); pushValue(l,true); pushValue(l,self.contacts); return 2; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static public int get_impulse(IntPtr l) { try { UnityEngine.Collision self=(UnityEngine.Collision)checkSelf(l); pushValue(l,true); pushValue(l,self.impulse); return 2; } catch(Exception e) { return error(l,e); } } static public void reg(IntPtr l) { getTypeTable(l,"UnityEngine.Collision"); addMember(l,"relativeVelocity",get_relativeVelocity,null,true); addMember(l,"rigidbody",get_rigidbody,null,true); addMember(l,"collider",get_collider,null,true); addMember(l,"transform",get_transform,null,true); addMember(l,"gameObject",get_gameObject,null,true); addMember(l,"contacts",get_contacts,null,true); addMember(l,"impulse",get_impulse,null,true); createTypeMetatable(l,constructor, typeof(UnityEngine.Collision)); } }
{ "content_hash": "d137b7df123d14ba6f85d38a45b1d509", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 68, "avg_line_length": 26.52173913043478, "alnum_prop": 0.7173770491803279, "repo_name": "insthync/asset-bundle-with-slua", "id": "6b435b825fe5d5967addb177d306a6b46cc83491", "size": "3052", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Assets/Slua/LuaObject/Unity/Lua_UnityEngine_Collision.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1023" }, { "name": "C#", "bytes": "3209512" }, { "name": "Lua", "bytes": "1112" }, { "name": "Makefile", "bytes": "1448" }, { "name": "Shell", "bytes": "641" } ], "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("09.TriangleFormation")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("09.TriangleFormation")] [assembly: AssemblyCopyright("Copyright © 2017")] [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("8763aa85-93d5-4a26-9f9c-f452b9c9f559")] // 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": "d46cd9d54f2b730f5154fbb580648d3d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 39.25, "alnum_prop": 0.7466383581033262, "repo_name": "NikolaySpasov/Softuni", "id": "50a9330ad64347ecfa1527277f759827690330cb", "size": "1416", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Programming Fundamentals/02.ProgramFundamDataTypesAndVariables-Exer/09.TriangleFormation/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1159007" } ], "symlink_target": "" }
"""The rescue mode extension.""" from oslo.config import cfg import webob from webob import exc from nova.api.openstack import common from nova.api.openstack import extensions as exts from nova.api.openstack import wsgi from nova import compute from nova import exception from nova.i18n import _ from nova import utils CONF = cfg.CONF authorize = exts.extension_authorizer('compute', 'rescue') class RescueController(wsgi.Controller): def __init__(self, ext_mgr, *args, **kwargs): super(RescueController, self).__init__(*args, **kwargs) self.compute_api = compute.API() self.ext_mgr = ext_mgr def _get_instance(self, context, instance_id, want_objects=False): try: return self.compute_api.get(context, instance_id, want_objects=want_objects) except exception.InstanceNotFound: msg = _("Server not found") raise exc.HTTPNotFound(explanation=msg) @wsgi.action('rescue') def _rescue(self, req, id, body): """Rescue an instance.""" context = req.environ["nova.context"] authorize(context) if body['rescue'] and 'adminPass' in body['rescue']: password = body['rescue']['adminPass'] else: password = utils.generate_password() instance = self._get_instance(context, id, want_objects=True) try: rescue_image_ref = None if self.ext_mgr.is_loaded("os-extended-rescue-with-image"): if body['rescue'] and 'rescue_image_ref' in body['rescue']: rescue_image_ref = body['rescue']['rescue_image_ref'] self.compute_api.rescue(context, instance, rescue_password=password, rescue_image_ref=rescue_image_ref) except exception.InstanceIsLocked as e: raise exc.HTTPConflict(explanation=e.format_message()) except exception.InstanceInvalidState as state_error: common.raise_http_conflict_for_instance_invalid_state(state_error, 'rescue', id) except exception.InvalidVolume as volume_error: raise exc.HTTPConflict(explanation=volume_error.format_message()) except exception.InstanceNotRescuable as non_rescuable: raise exc.HTTPBadRequest( explanation=non_rescuable.format_message()) return {'adminPass': password} @wsgi.action('unrescue') def _unrescue(self, req, id, body): """Unrescue an instance.""" context = req.environ["nova.context"] authorize(context) instance = self._get_instance(context, id, want_objects=True) try: self.compute_api.unrescue(context, instance) except exception.InstanceIsLocked as e: raise exc.HTTPConflict(explanation=e.format_message()) except exception.InstanceInvalidState as state_error: common.raise_http_conflict_for_instance_invalid_state(state_error, 'unrescue', id) return webob.Response(status_int=202) class Rescue(exts.ExtensionDescriptor): """Instance rescue mode.""" name = "Rescue" alias = "os-rescue" namespace = "http://docs.openstack.org/compute/ext/rescue/api/v1.1" updated = "2011-08-18T00:00:00Z" def get_controller_extensions(self): controller = RescueController(self.ext_mgr) extension = exts.ControllerExtension(self, 'servers', controller) return [extension]
{ "content_hash": "bcc6fe4f57e4ebb3cc5f08ac2e076b6a", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 79, "avg_line_length": 38.56842105263158, "alnum_prop": 0.6108078602620087, "repo_name": "maelnor/nova", "id": "3c9fb34f19a22ba86469ebfb992bd657c3df5b5c", "size": "4269", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "nova/api/openstack/compute/contrib/rescue.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "15078191" }, { "name": "Shell", "bytes": "18352" } ], "symlink_target": "" }
from __future__ import with_statement from winsys import registry, accounts new_key = registry.copy (r"HKLM\Software\Python", r"HKLM\Software\WinsysPython") try: with new_key.security () as sec: sec.break_inheritance (copy_first=False) sec.dacl += [ ("Users", "R", "ALLOW"), (accounts.me (), "F", "ALLOW"), ] sec.dump () finally: print "***" new_key.security ().dump ()
{ "content_hash": "e0b9ccca5d513de51e4c19b12d699146", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 80, "avg_line_length": 24.941176470588236, "alnum_prop": 0.5966981132075472, "repo_name": "one2pret/winsys", "id": "dcdccf3323851feaf56e2b5ed30d5a73bb7dc210", "size": "424", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/cookbook/registry/copy_key.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "500016" }, { "name": "Shell", "bytes": "61" } ], "symlink_target": "" }
// Template Source: BaseEntity.java.tt // ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.models; import com.microsoft.graph.serializer.ISerializer; import com.microsoft.graph.serializer.IJsonBackedObject; import com.microsoft.graph.serializer.AdditionalDataManager; import java.util.EnumSet; import com.google.gson.JsonObject; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import javax.annotation.Nullable; import javax.annotation.Nonnull; // **NOTE** This file was generated by a tool and any changes will be overwritten. /** * The class for the Modified Property. */ public class ModifiedProperty implements IJsonBackedObject { /** the OData type of the object as returned by the service */ @SerializedName("@odata.type") @Expose @Nullable public String oDataType; private transient AdditionalDataManager additionalDataManager = new AdditionalDataManager(this); @Override @Nonnull public final AdditionalDataManager additionalDataManager() { return additionalDataManager; } /** * The Display Name. * Indicates the property name of the target attribute that was changed. */ @SerializedName(value = "displayName", alternate = {"DisplayName"}) @Expose @Nullable public String displayName; /** * The New Value. * Indicates the updated value for the propery. */ @SerializedName(value = "newValue", alternate = {"NewValue"}) @Expose @Nullable public String newValue; /** * The Old Value. * Indicates the previous value (before the update) for the property. */ @SerializedName(value = "oldValue", alternate = {"OldValue"}) @Expose @Nullable public String oldValue; /** * Sets the raw JSON object * * @param serializer the serializer * @param json the JSON object to set this object to */ public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { } }
{ "content_hash": "169895b535c09b7d77c4ea340287469f", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 152, "avg_line_length": 30.233766233766232, "alnum_prop": 0.6615120274914089, "repo_name": "microsoftgraph/msgraph-sdk-java", "id": "fb3837395af54f110dd3386e4fc51ee950bb6231", "size": "2328", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "src/main/java/com/microsoft/graph/models/ModifiedProperty.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "27286837" }, { "name": "PowerShell", "bytes": "5635" } ], "symlink_target": "" }
#ifndef WABT_WAT_WRITER_H_ #define WABT_WAT_WRITER_H_ #include "wabt/common.h" namespace wabt { struct Module; class Stream; struct WriteWatOptions { bool fold_exprs = false; // Write folded expressions. bool inline_export = false; bool inline_import = false; }; Result WriteWat(Stream*, const Module*, const WriteWatOptions&); } // namespace wabt #endif /* WABT_WAT_WRITER_H_ */
{ "content_hash": "127f5d30624f5b37b6a5ffcafa0023a1", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 64, "avg_line_length": 17.26086956521739, "alnum_prop": 0.7052896725440806, "repo_name": "WebAssembly/wabt", "id": "a56c7ab32fbd6a96ce5decf4cb08cea466dc924f", "size": "1020", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "include/wabt/wat-writer.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "91989" }, { "name": "C++", "bytes": "1929701" }, { "name": "CMake", "bytes": "24045" }, { "name": "JavaScript", "bytes": "13972" }, { "name": "Lua", "bytes": "3580" }, { "name": "Makefile", "bytes": "5846" }, { "name": "Python", "bytes": "128032" }, { "name": "Shell", "bytes": "5754" }, { "name": "WebAssembly", "bytes": "1721" } ], "symlink_target": "" }
// Copyright 2012 Mozilla Corporation. All rights reserved. // This code is governed by the license found in the LICENSE file. /*--- es5id: 11.3.2_1_a_L15 description: > Tests that the function returned by Intl.NumberFormat.prototype.format meets the requirements for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg includes: [testBuiltInObject.js] ---*/ testBuiltInObject(new Intl.NumberFormat().format, true, false, [], 1);
{ "content_hash": "24fb89bc1ceed6d92ff0da590c0710bc", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 70, "avg_line_length": 34.93333333333333, "alnum_prop": 0.7538167938931297, "repo_name": "baslr/ArangoDB", "id": "cdfcf105284265b422ffc686945cbc9f6ee380a9", "size": "524", "binary": false, "copies": "3", "ref": "refs/heads/3.1-silent", "path": "3rdParty/V8/V8-5.0.71.39/test/test262/data/test/intl402/NumberFormat/prototype/format/11.3.2_1_a_L15.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ada", "bytes": "89080" }, { "name": "Assembly", "bytes": "391227" }, { "name": "Awk", "bytes": "4272" }, { "name": "Batchfile", "bytes": "62892" }, { "name": "C", "bytes": "7932707" }, { "name": "C#", "bytes": "96430" }, { "name": "C++", "bytes": "284363933" }, { "name": "CLIPS", "bytes": "5291" }, { "name": "CMake", "bytes": "681903" }, { "name": "CSS", "bytes": "1036656" }, { "name": "CWeb", "bytes": "174166" }, { "name": "Cuda", "bytes": "52444" }, { "name": "DIGITAL Command Language", "bytes": "259402" }, { "name": "Emacs Lisp", "bytes": "14637" }, { "name": "Fortran", "bytes": "1856" }, { "name": "Groovy", "bytes": "131" }, { "name": "HTML", "bytes": "2318016" }, { "name": "Java", "bytes": "2325801" }, { "name": "JavaScript", "bytes": "67878359" }, { "name": "LLVM", "bytes": "24129" }, { "name": "Lex", "bytes": "1231" }, { "name": "Lua", "bytes": "16189" }, { "name": "M4", "bytes": "600550" }, { "name": "Makefile", "bytes": "509612" }, { "name": "Max", "bytes": "36857" }, { "name": "Module Management System", "bytes": "1545" }, { "name": "NSIS", "bytes": "28404" }, { "name": "Objective-C", "bytes": "19321" }, { "name": "Objective-C++", "bytes": "2503" }, { "name": "PHP", "bytes": "98503" }, { "name": "Pascal", "bytes": "145688" }, { "name": "Perl", "bytes": "720157" }, { "name": "Perl 6", "bytes": "9918" }, { "name": "Python", "bytes": "5859911" }, { "name": "QMake", "bytes": "16692" }, { "name": "R", "bytes": "5123" }, { "name": "Rebol", "bytes": "354" }, { "name": "Roff", "bytes": "1010686" }, { "name": "Ruby", "bytes": "922159" }, { "name": "SAS", "bytes": "1847" }, { "name": "Scheme", "bytes": "10604" }, { "name": "Shell", "bytes": "511077" }, { "name": "Swift", "bytes": "116" }, { "name": "Tcl", "bytes": "1172" }, { "name": "TeX", "bytes": "32117" }, { "name": "Vim script", "bytes": "4075" }, { "name": "Visual Basic", "bytes": "11568" }, { "name": "XSLT", "bytes": "551977" }, { "name": "Yacc", "bytes": "53005" } ], "symlink_target": "" }
set -e MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd ${MY_DIR} if [[ -z `which ruby` ]]; then echo "Please ensure ruby is installed and in your path" && exit 1 fi if [[ -z `which curl` ]]; then echo "Please ensure the command line utility curl is installed and in your path" && exit 1 fi if [[ ! -z `uname -a | grep Linux` ]] && [[ -z `which apt-get` ]]; then echo "Unfortunately, this project is only setup for aptitude based linuxes. You'll have to open this file (${BASH_SOURCE}) and ensure all apt-get calls are adjusted to your package manager." && exit 1 fi if [[ ! -z `uname -a | grep Darwin` ]] && [[ -z `which brew` ]]; then echo "Installing brew..." ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" fi if [[ -z `( (which javac &> /dev/null) && javac -version 2>&1) | grep "1.8"` ]]; then echo "Installing JVM 1.8..." if [[ ! -z `uname -a | grep Darwin` ]]; then (brew --version > /dev/null) && (brew tap caskroom/cask > /dev/null) && (brew install brew-cask > /dev/null) && (brew cask install java) fi if [[ ! -z `uname -a | grep Linux` ]]; then (apt-get install python-software-properties) && (add-apt-repository ppa:webupd8team/java) && (apt-get update) && (apt-get install -y oracle-java8-installer) fi fi mkdir -p ${MY_DIR}/bin mkdir -p ${MY_DIR}/tmp mkdir -p ${MY_DIR}/lib if [[ ! -f ${MY_DIR}/bin/lein ]]; then echo "Installing local lein..." curl --silent "https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein" > ${MY_DIR}/bin/lein fi chmod +x ${MY_DIR}/bin/lein ${MY_DIR}/bin/lein &> /dev/null echo "Installing dependencies..." ${MY_DIR}/bin/lein deps &> /dev/null
{ "content_hash": "bd00b32afc5da4ab9025c6729918bf7d", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 202, "avg_line_length": 38.61363636363637, "alnum_prop": 0.6362566215420836, "repo_name": "espaco-guerra/engine-server", "id": "2b56ca9b56bdaceebc4b74db8383f391273c0b69", "size": "1719", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "setup.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Clojure", "bytes": "25184" }, { "name": "HTML", "bytes": "1050" }, { "name": "Shell", "bytes": "1867" } ], "symlink_target": "" }
<!DOCTYPE html><html><head><meta charset="utf-8" /> <meta http-equiv="refresh" content="0;url=/place/sudan/" /> </head></html>
{ "content_hash": "32f8b90e9caa18233fa4b872dd0d79ac", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 59, "avg_line_length": 42, "alnum_prop": 0.6587301587301587, "repo_name": "okfn/opendataindex-2015", "id": "44ea8c7eab97eb6ba524a2c1e4f3907561521590", "size": "126", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "country/overview/Sudan/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "277465" }, { "name": "HTML", "bytes": "169425658" }, { "name": "JavaScript", "bytes": "37060" } ], "symlink_target": "" }
@implementation JCMappingModelCacheTests - (void)setUp { entity = [[FauxEntityDescription entityDescriptionWithName:@"TestValidMappingModel"] retain]; NSBundle *bundle = [NSBundle bundleForClass:[self class]]; mappingModel = [[JCMappingModel mappingModelForEntity:entity bundle:bundle] retain]; } - (void)tearDown { [entity release]; entity = nil; [mappingModel release]; mappingModel = nil; } - (void)testObjectCaching { STAssertEqualObjects(mappingModel, [[JCMappingModelCache defaultCache] mappingModelForEntity:entity], @"Mapping model cache should store mapping model after using mappingModelWithEntity:"); } - (void)testClearingCache { JCClearMapCache(); STAssertNil([[JCMappingModelCache defaultCache] mappingModelForEntity:entity], @"Mapping model cache should clear all mapping models after using clearCache"); } @end
{ "content_hash": "37706b729e62f1fa2cfe4d0ec2e7d7c2", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 190, "avg_line_length": 26.75, "alnum_prop": 0.7768691588785047, "repo_name": "ellneal/CoreData-JSON", "id": "4b2fbeb3f7aa1b5eb4ab921ea971f6aa5b72f68a", "size": "2632", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/LogicTests/JCMappingModelCacheTests.m", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C++", "bytes": "27796" }, { "name": "Objective-C", "bytes": "331004" } ], "symlink_target": "" }
package com.cocos2dj.protocol; public interface INodePool { public void pushPoolNode(INode node); }
{ "content_hash": "411588c8f6f71fce9f26b4233137e4a9", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 38, "avg_line_length": 15, "alnum_prop": 0.7714285714285715, "repo_name": "mingwuyun/cocos2d-java", "id": "2d1fc7ad354c0464f62290e981fc419670b24ec0", "size": "105", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/cocos2dj/protocol/INodePool.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "GLSL", "bytes": "24974" }, { "name": "Java", "bytes": "1219185" } ], "symlink_target": "" }
package Battleships.exception; /* * Author: Michael * Created: 11 November 2004 19:53:55 * Modified: 11 November 2004 19:53:55 */ @SuppressWarnings("serial") public class PositionExceedsBoardException extends RuntimeException { public PositionExceedsBoardException() { } PositionExceedsBoardException(String reason) { super(reason); } }
{ "content_hash": "a2b2ac8974b692a1c060037ac6a19ab1", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 69, "avg_line_length": 20.5, "alnum_prop": 0.7235772357723578, "repo_name": "scvetkovski/Software-Design-Patterns", "id": "4002c277c91eb8224ab0285c631ed15c2353346e", "size": "369", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Battleships/exception/PositionExceedsBoardException.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "151381" } ], "symlink_target": "" }
import test class HelloTest(test.Base): def test_hi(self): self.assertTrue(True)
{ "content_hash": "7cea45741f83b16f993da287571721e9", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 29, "avg_line_length": 18.8, "alnum_prop": 0.6702127659574468, "repo_name": "JakeWharton/mkvdts2ac3", "id": "3888b4afbbc6665c4d9b979a63ed733c11082d04", "size": "94", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/hello.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "595" }, { "name": "Python", "bytes": "1871" }, { "name": "Shell", "bytes": "22467" } ], "symlink_target": "" }
package stringmanipulation.controller; public class Runner { public static void main(String[] args) { StringCommands myProgram = new StringCommands(); System.out.println(myProgram.orToOur("flavor")); WordReverser myReverser = new WordReverser(); System.out.println(myReverser.reverse("George")); } }
{ "content_hash": "4eafb70619fd413ebf3e7cb61aff6d58", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 51, "avg_line_length": 22.785714285714285, "alnum_prop": 0.7398119122257053, "repo_name": "ayusufji/JavaWorkspace", "id": "f0a570488ea5554437d6fcdb733d56dbff102556", "size": "319", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "StringManipulation/src/stringmanipulation/controller/Runner.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4173" }, { "name": "HTML", "bytes": "152122" }, { "name": "Java", "bytes": "48771" } ], "symlink_target": "" }
import Component from '@ember/component'; export default Component.extend({ setCodeBlockHeight() { const h = this.$('.additional-logging-configuration-content').height() + 12; this.$('.logging-format pre').height(h + 'px'); }, outputTagsChanged: function() { this.setCodeBlockHeight(); }.observes('model.outputTags'), });
{ "content_hash": "67d43307ff2254efbd38f31a450a40b4", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 80, "avg_line_length": 28.666666666666668, "alnum_prop": 0.6773255813953488, "repo_name": "pengjiang80/ui", "id": "bf0b39d8b6f9098abefc1a85716374835c386423", "size": "344", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/logging/addon/components/logging/form-log-format/component.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "157884" }, { "name": "HTML", "bytes": "739881" }, { "name": "JavaScript", "bytes": "1407771" }, { "name": "Shell", "bytes": "11290" }, { "name": "Standard ML", "bytes": "1205" } ], "symlink_target": "" }
'use strict'; // Base import 'vs/base/common/strings'; import 'vs/base/common/errors'; // Editor import 'vs/editor/contrib/accessibility/browser/accessibility'; import 'vs/editor/contrib/defineKeybinding/browser/defineKeybinding'; import 'vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes'; import 'vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard'; import 'vs/editor/browser/editor.all'; // Menus/Actions import 'vs/platform/actions/browser/menusExtensionPoint'; // Workbench import 'vs/workbench/browser/actions/toggleActivityBarVisibility'; import 'vs/workbench/browser/actions/toggleStatusbarVisibility'; import 'vs/workbench/browser/actions/toggleSidebarVisibility'; import 'vs/workbench/browser/actions/toggleSidebarPosition'; import 'vs/workbench/browser/actions/toggleEditorLayout'; import 'vs/workbench/browser/actions/toggleZenMode'; import 'vs/workbench/parts/preferences/browser/preferences.contribution'; import 'vs/workbench/browser/actions/configureLocale'; import 'vs/workbench/parts/quickopen/browser/quickopen.contribution'; import 'vs/workbench/browser/parts/editor/editorPicker'; import 'vs/workbench/parts/files/browser/explorerViewlet'; import 'vs/workbench/parts/files/browser/fileActions.contribution'; import 'vs/workbench/parts/files/browser/files.contribution'; import 'vs/workbench/parts/files/electron-browser/electronFileActions.contribution'; import 'vs/workbench/parts/backup/common/backup.contribution'; import 'vs/workbench/parts/search/browser/search.contribution'; import 'vs/workbench/parts/search/browser/searchViewlet'; // can be packaged separately import 'vs/workbench/parts/search/browser/openAnythingHandler'; // can be packaged separately import 'vs/workbench/parts/scm/electron-browser/scm.contribution'; import 'vs/workbench/parts/scm/electron-browser/scmViewlet'; // can be packaged separately import 'vs/workbench/parts/git/electron-browser/git.contribution'; import 'vs/workbench/parts/git/browser/gitQuickOpen'; import 'vs/workbench/parts/git/browser/gitActions.contribution'; import 'vs/workbench/parts/git/browser/gitViewlet'; // can be packaged separately import 'vs/workbench/parts/debug/electron-browser/debug.contribution'; import 'vs/workbench/parts/debug/electron-browser/repl'; import 'vs/workbench/parts/debug/browser/debugEditorActions'; import 'vs/workbench/parts/debug/browser/debugViewlet'; // can be packaged separately import 'vs/workbench/parts/markers/markers.contribution'; import 'vs/workbench/parts/markers/browser/markersPanel'; // can be packaged separately import 'vs/workbench/parts/html/browser/html.contribution'; import 'vs/workbench/parts/walkThrough/electron-browser/walkThrough.contribution'; import 'vs/workbench/parts/extensions/electron-browser/extensions.contribution'; import 'vs/workbench/parts/extensions/browser/extensionsQuickOpen'; import 'vs/workbench/parts/extensions/electron-browser/extensionsViewlet'; // can be packaged separately import 'vs/workbench/parts/welcomePage/electron-browser/welcomePage.contribution'; import 'vs/workbench/parts/explorers/browser/treeExplorer.contribution'; import 'vs/workbench/parts/explorers/browser/treeExplorerViewlet'; // can be packaged separately import 'vs/workbench/parts/output/browser/output.contribution'; import 'vs/workbench/parts/output/browser/outputPanel'; // can be packaged separately import 'vs/workbench/parts/terminal/electron-browser/terminal.contribution'; import 'vs/workbench/parts/terminal/electron-browser/terminalPanel'; // can be packaged separately import 'vs/workbench/electron-browser/workbench'; import 'vs/workbench/parts/trust/electron-browser/trust.contribution'; import 'vs/workbench/parts/tasks/electron-browser/task.contribution'; import 'vs/workbench/parts/emmet/browser/emmet.browser.contribution'; import 'vs/workbench/parts/emmet/node/emmet.contribution'; // Code Editor enhacements import 'vs/workbench/parts/codeEditor/codeEditor.contribution'; import 'vs/workbench/parts/execution/electron-browser/execution.contribution'; import 'vs/workbench/parts/execution/electron-browser/terminal.contribution'; import 'vs/workbench/parts/snippets/electron-browser/snippets.contribution'; import 'vs/workbench/parts/themes/electron-browser/themes.contribution'; import 'vs/workbench/parts/feedback/electron-browser/feedback.contribution'; import 'vs/workbench/parts/welcome/electron-browser/gettingStarted.contribution'; import 'vs/workbench/parts/update/electron-browser/update.contribution'; import 'vs/workbench/parts/nps/electron-browser/nps.contribution'; import 'vs/workbench/parts/cli/electron-browser/cli.contribution'; import 'vs/workbench/api/node/extHost.contribution'; import 'vs/workbench/electron-browser/main.contribution'; import 'vs/workbench/electron-browser/main'; import 'vs/workbench/parts/themes/test/electron-browser/themes.test.contribution'; import 'vs/workbench/parts/watermark/electron-browser/watermark'; import 'vs/workbench/parts/welcomeOverlay/browser/welcomeOverlay';
{ "content_hash": "333fd6f299483bb30f3dbe54956ce394", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 104, "avg_line_length": 43.46551724137931, "alnum_prop": 0.8228877429591432, "repo_name": "charlespierce/vscode", "id": "439cccc17e6e8217b0b7810ac2b16502fde4eb7e", "size": "5393", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/vs/workbench/electron-browser/workbench.main.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4294" }, { "name": "C", "bytes": "818" }, { "name": "C#", "bytes": "1152" }, { "name": "C++", "bytes": "1000" }, { "name": "CSS", "bytes": "487600" }, { "name": "Clojure", "bytes": "1206" }, { "name": "CoffeeScript", "bytes": "590" }, { "name": "F#", "bytes": "634" }, { "name": "GLSL", "bytes": "330" }, { "name": "Go", "bytes": "613" }, { "name": "Groovy", "bytes": "3928" }, { "name": "HTML", "bytes": "32855" }, { "name": "Inno Setup", "bytes": "106295" }, { "name": "Java", "bytes": "599" }, { "name": "JavaScript", "bytes": "3026177" }, { "name": "Lua", "bytes": "252" }, { "name": "Makefile", "bytes": "553" }, { "name": "Objective-C", "bytes": "1387" }, { "name": "PHP", "bytes": "802" }, { "name": "Perl", "bytes": "857" }, { "name": "Perl6", "bytes": "1065" }, { "name": "PowerShell", "bytes": "1432" }, { "name": "Python", "bytes": "2119" }, { "name": "R", "bytes": "362" }, { "name": "Ruby", "bytes": "1703" }, { "name": "Rust", "bytes": "532" }, { "name": "Shell", "bytes": "10086" }, { "name": "Swift", "bytes": "220" }, { "name": "TypeScript", "bytes": "11539315" }, { "name": "Visual Basic", "bytes": "893" } ], "symlink_target": "" }
(function( window ) { var QUnit, assert, config, onErrorFnPrev, testId = 0, fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""), toString = Object.prototype.toString, hasOwn = Object.prototype.hasOwnProperty, // Keep a local reference to Date (GH-283) Date = window.Date, defined = { setTimeout: typeof window.setTimeout !== "undefined", sessionStorage: (function() { var x = "qunit-test-string"; try { sessionStorage.setItem( x, x ); sessionStorage.removeItem( x ); return true; } catch( e ) { return false; } }()) }, /** * Provides a normalized error string, correcting an issue * with IE 7 (and prior) where Error.prototype.toString is * not properly implemented * * Based on http://es5.github.com/#x15.11.4.4 * * @param {String|Error} error * @return {String} error message */ errorString = function( error ) { var name, message, errorString = error.toString(); if ( errorString.substring( 0, 7 ) === "[object" ) { name = error.name ? error.name.toString() : "Error"; message = error.message ? error.message.toString() : ""; if ( name && message ) { return name + ": " + message; } else if ( name ) { return name; } else if ( message ) { return message; } else { return "Error"; } } else { return errorString; } }, /** * Makes a clone of an object using only Array or Object as base, * and copies over the own enumerable properties. * * @param {Object} obj * @return {Object} New object with only the own properties (recursively). */ objectValues = function( obj ) { // Grunt 0.3.x uses an older version of jshint that still has jshint/jshint#392. /*jshint newcap: false */ var key, val, vals = QUnit.is( "array", obj ) ? [] : {}; for ( key in obj ) { if ( hasOwn.call( obj, key ) ) { val = obj[key]; vals[key] = val === Object(val) ? objectValues(val) : val; } } return vals; }; function Test( settings ) { extend( this, settings ); this.assertions = []; this.testNumber = ++Test.count; } Test.count = 0; Test.prototype = { init: function() { var a, b, li, tests = id( "qunit-tests" ); if ( tests ) { b = document.createElement( "strong" ); b.innerHTML = this.nameHtml; // `a` initialized at top of scope a = document.createElement( "a" ); a.innerHTML = "Rerun"; a.href = QUnit.url({ testNumber: this.testNumber }); li = document.createElement( "li" ); li.appendChild( b ); li.appendChild( a ); li.className = "running"; li.id = this.id = "qunit-test-output" + testId++; tests.appendChild( li ); } }, setup: function() { if ( this.module !== config.previousModule ) { if ( config.previousModule ) { runLoggingCallbacks( "moduleDone", QUnit, { name: config.previousModule, failed: config.moduleStats.bad, passed: config.moduleStats.all - config.moduleStats.bad, total: config.moduleStats.all }); } config.previousModule = this.module; config.moduleStats = { all: 0, bad: 0 }; runLoggingCallbacks( "moduleStart", QUnit, { name: this.module }); } else if ( config.autorun ) { runLoggingCallbacks( "moduleStart", QUnit, { name: this.module }); } config.current = this; this.testEnvironment = extend({ setup: function() {}, teardown: function() {} }, this.moduleTestEnvironment ); this.started = +new Date(); runLoggingCallbacks( "testStart", QUnit, { name: this.testName, module: this.module }); // allow utility functions to access the current test environment // TODO why?? QUnit.current_testEnvironment = this.testEnvironment; if ( !config.pollution ) { saveGlobal(); } if ( config.notrycatch ) { this.testEnvironment.setup.call( this.testEnvironment ); return; } try { this.testEnvironment.setup.call( this.testEnvironment ); } catch( e ) { QUnit.pushFailure( "Setup failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); } }, run: function() { config.current = this; var running = id( "qunit-testresult" ); if ( running ) { running.innerHTML = "Running: <br/>" + this.nameHtml; } if ( this.async ) { QUnit.stop(); } this.callbackStarted = +new Date(); if ( config.notrycatch ) { this.callback.call( this.testEnvironment, QUnit.assert ); this.callbackRuntime = +new Date() - this.callbackStarted; return; } try { this.callback.call( this.testEnvironment, QUnit.assert ); this.callbackRuntime = +new Date() - this.callbackStarted; } catch( e ) { this.callbackRuntime = +new Date() - this.callbackStarted; QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + ( e.message || e ), extractStacktrace( e, 0 ) ); // else next test will carry the responsibility saveGlobal(); // Restart the tests if they're blocking if ( config.blocking ) { QUnit.start(); } } }, teardown: function() { config.current = this; if ( config.notrycatch ) { if ( typeof this.callbackRuntime === "undefined" ) { this.callbackRuntime = +new Date() - this.callbackStarted; } this.testEnvironment.teardown.call( this.testEnvironment ); return; } else { try { this.testEnvironment.teardown.call( this.testEnvironment ); } catch( e ) { QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); } } checkPollution(); }, finish: function() { config.current = this; if ( config.requireExpects && this.expected === null ) { QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack ); } else if ( this.expected !== null && this.expected !== this.assertions.length ) { QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack ); } else if ( this.expected === null && !this.assertions.length ) { QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack ); } var i, assertion, a, b, time, li, ol, test = this, good = 0, bad = 0, tests = id( "qunit-tests" ); this.runtime = +new Date() - this.started; config.stats.all += this.assertions.length; config.moduleStats.all += this.assertions.length; if ( tests ) { ol = document.createElement( "ol" ); ol.className = "qunit-assert-list"; for ( i = 0; i < this.assertions.length; i++ ) { assertion = this.assertions[i]; li = document.createElement( "li" ); li.className = assertion.result ? "pass" : "fail"; li.innerHTML = assertion.message || ( assertion.result ? "okay" : "failed" ); ol.appendChild( li ); if ( assertion.result ) { good++; } else { bad++; config.stats.bad++; config.moduleStats.bad++; } } // store result when possible if ( QUnit.config.reorder && defined.sessionStorage ) { if ( bad ) { sessionStorage.setItem( "qunit-test-" + this.module + "-" + this.testName, bad ); } else { sessionStorage.removeItem( "qunit-test-" + this.module + "-" + this.testName ); } } if ( bad === 0 ) { addClass( ol, "qunit-collapsed" ); } // `b` initialized at top of scope b = document.createElement( "strong" ); b.innerHTML = this.nameHtml + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>"; addEvent(b, "click", function() { var next = b.parentNode.lastChild, collapsed = hasClass( next, "qunit-collapsed" ); ( collapsed ? removeClass : addClass )( next, "qunit-collapsed" ); }); addEvent(b, "dblclick", function( e ) { var target = e && e.target ? e.target : window.event.srcElement; if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) { target = target.parentNode; } if ( window.location && target.nodeName.toLowerCase() === "strong" ) { window.location = QUnit.url({ testNumber: test.testNumber }); } }); // `time` initialized at top of scope time = document.createElement( "span" ); time.className = "runtime"; time.innerHTML = this.runtime + " ms"; // `li` initialized at top of scope li = id( this.id ); li.className = bad ? "fail" : "pass"; li.removeChild( li.firstChild ); a = li.firstChild; li.appendChild( b ); li.appendChild( a ); li.appendChild( time ); li.appendChild( ol ); } else { for ( i = 0; i < this.assertions.length; i++ ) { if ( !this.assertions[i].result ) { bad++; config.stats.bad++; config.moduleStats.bad++; } } } runLoggingCallbacks( "testDone", QUnit, { name: this.testName, module: this.module, failed: bad, passed: this.assertions.length - bad, total: this.assertions.length, duration: this.runtime }); QUnit.reset(); config.current = undefined; }, queue: function() { var bad, test = this; synchronize(function() { test.init(); }); function run() { // each of these can by async synchronize(function() { test.setup(); }); synchronize(function() { test.run(); }); synchronize(function() { test.teardown(); }); synchronize(function() { test.finish(); }); } // `bad` initialized at top of scope // defer when previous test run passed, if storage is available bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem( "qunit-test-" + this.module + "-" + this.testName ); if ( bad ) { run(); } else { synchronize( run, true ); } } }; // Root QUnit object. // `QUnit` initialized at top of scope QUnit = { // call on start of module test to prepend name to all tests module: function( name, testEnvironment ) { config.currentModule = name; config.currentModuleTestEnvironment = testEnvironment; config.modules[name] = true; }, asyncTest: function( testName, expected, callback ) { if ( arguments.length === 2 ) { callback = expected; expected = null; } QUnit.test( testName, expected, callback, true ); }, test: function( testName, expected, callback, async ) { var test, nameHtml = "<span class='test-name'>" + escapeText( testName ) + "</span>"; if ( arguments.length === 2 ) { callback = expected; expected = null; } if ( config.currentModule ) { nameHtml = "<span class='module-name'>" + escapeText( config.currentModule ) + "</span>: " + nameHtml; } test = new Test({ nameHtml: nameHtml, testName: testName, expected: expected, async: async, callback: callback, module: config.currentModule, moduleTestEnvironment: config.currentModuleTestEnvironment, stack: sourceFromStacktrace( 2 ) }); if ( !validTest( test ) ) { return; } test.queue(); }, // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. expect: function( asserts ) { if (arguments.length === 1) { config.current.expected = asserts; } else { return config.current.expected; } }, start: function( count ) { // QUnit hasn't been initialized yet. // Note: RequireJS (et al) may delay onLoad if ( config.semaphore === undefined ) { QUnit.begin(function() { // This is triggered at the top of QUnit.load, push start() to the event loop, to allow QUnit.load to finish first setTimeout(function() { QUnit.start( count ); }); }); return; } config.semaphore -= count || 1; // don't start until equal number of stop-calls if ( config.semaphore > 0 ) { return; } // ignore if start is called more often then stop if ( config.semaphore < 0 ) { config.semaphore = 0; QUnit.pushFailure( "Called start() while already started (QUnit.config.semaphore was 0 already)", null, sourceFromStacktrace(2) ); return; } // A slight delay, to avoid any current callbacks if ( defined.setTimeout ) { window.setTimeout(function() { if ( config.semaphore > 0 ) { return; } if ( config.timeout ) { clearTimeout( config.timeout ); } config.blocking = false; process( true ); }, 13); } else { config.blocking = false; process( true ); } }, stop: function( count ) { config.semaphore += count || 1; config.blocking = true; if ( config.testTimeout && defined.setTimeout ) { clearTimeout( config.timeout ); config.timeout = window.setTimeout(function() { QUnit.ok( false, "Test timed out" ); config.semaphore = 1; QUnit.start(); }, config.testTimeout ); } } }; // `assert` initialized at top of scope // Asssert helpers // All of these must either call QUnit.push() or manually do: // - runLoggingCallbacks( "log", .. ); // - config.current.assertions.push({ .. }); // We attach it to the QUnit object *after* we expose the public API, // otherwise `assert` will become a global variable in browsers (#341). assert = { /** * Asserts rough true-ish result. * @name ok * @function * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); */ ok: function( result, msg ) { if ( !config.current ) { throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) ); } result = !!result; var source, details = { module: config.current.module, name: config.current.testName, result: result, message: msg }; msg = escapeText( msg || (result ? "okay" : "failed" ) ); msg = "<span class='test-message'>" + msg + "</span>"; if ( !result ) { source = sourceFromStacktrace( 2 ); if ( source ) { details.source = source; msg += "<table><tr class='test-source'><th>Source: </th><td><pre>" + escapeText( source ) + "</pre></td></tr></table>"; } } runLoggingCallbacks( "log", QUnit, details ); config.current.assertions.push({ result: result, message: msg }); }, /** * Assert that the first two arguments are equal, with an optional message. * Prints out both actual and expected values. * @name equal * @function * @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" ); */ equal: function( actual, expected, message ) { /*jshint eqeqeq:false */ QUnit.push( expected == actual, actual, expected, message ); }, /** * @name notEqual * @function */ notEqual: function( actual, expected, message ) { /*jshint eqeqeq:false */ QUnit.push( expected != actual, actual, expected, message ); }, /** * @name propEqual * @function */ propEqual: function( actual, expected, message ) { actual = objectValues(actual); expected = objectValues(expected); QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); }, /** * @name notPropEqual * @function */ notPropEqual: function( actual, expected, message ) { actual = objectValues(actual); expected = objectValues(expected); QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); }, /** * @name deepEqual * @function */ deepEqual: function( actual, expected, message ) { QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); }, /** * @name notDeepEqual * @function */ notDeepEqual: function( actual, expected, message ) { QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); }, /** * @name strictEqual * @function */ strictEqual: function( actual, expected, message ) { QUnit.push( expected === actual, actual, expected, message ); }, /** * @name notStrictEqual * @function */ notStrictEqual: function( actual, expected, message ) { QUnit.push( expected !== actual, actual, expected, message ); }, "throws": function( block, expected, message ) { var actual, expectedOutput = expected, ok = false; // 'expected' is optional if ( typeof expected === "string" ) { message = expected; expected = null; } config.current.ignoreGlobalErrors = true; try { block.call( config.current.testEnvironment ); } catch (e) { actual = e; } config.current.ignoreGlobalErrors = false; if ( actual ) { // we don't want to validate thrown error if ( !expected ) { ok = true; expectedOutput = null; // expected is a regexp } else if ( QUnit.objectType( expected ) === "regexp" ) { ok = expected.test( errorString( actual ) ); // expected is a constructor } else if ( actual instanceof expected ) { ok = true; // expected is a validation function which returns true is validation passed } else if ( expected.call( {}, actual ) === true ) { expectedOutput = null; ok = true; } QUnit.push( ok, actual, expectedOutput, message ); } else { QUnit.pushFailure( message, null, 'No exception was thrown.' ); } } }; /** * @deprecate since 1.8.0 * Kept assertion helpers in root for backwards compatibility. */ extend( QUnit, assert ); /** * @deprecated since 1.9.0 * Kept root "raises()" for backwards compatibility. * (Note that we don't introduce assert.raises). */ QUnit.raises = assert[ "throws" ]; /** * @deprecated since 1.0.0, replaced with error pushes since 1.3.0 * Kept to avoid TypeErrors for undefined methods. */ QUnit.equals = function() { QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" ); }; QUnit.same = function() { QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" ); }; // We want access to the constructor's prototype (function() { function F() {} F.prototype = QUnit; QUnit = new F(); // Make F QUnit's constructor so that we can add to the prototype later QUnit.constructor = F; }()); /** * Config object: Maintain internal state * Later exposed as QUnit.config * `config` initialized at top of scope */ config = { // The queue of tests to run queue: [], // block until document ready blocking: true, // when enabled, show only failing tests // gets persisted through sessionStorage and can be changed in UI via checkbox hidepassed: false, // by default, run previously failed tests first // very useful in combination with "Hide passed tests" checked reorder: true, // by default, modify document.title when suite is done altertitle: true, // when enabled, all tests must call expect() requireExpects: false, // add checkboxes that are persisted in the query-string // when enabled, the id is set to `true` as a `QUnit.config` property urlConfig: [ { id: "noglobals", label: "Check for Globals", tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings." }, { id: "notrycatch", label: "No try-catch", tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings." } ], // Set of all modules. modules: {}, // logging callback queues begin: [], done: [], log: [], testStart: [], testDone: [], moduleStart: [], moduleDone: [] }; // Export global variables, unless an 'exports' object exists, // in that case we assume we're in CommonJS (dealt with on the bottom of the script) if ( typeof exports === "undefined" ) { extend( window, QUnit ); // Expose QUnit object window.QUnit = QUnit; } // Initialize more QUnit.config and QUnit.urlParams (function() { var i, location = window.location || { search: "", protocol: "file:" }, params = location.search.slice( 1 ).split( "&" ), length = params.length, urlParams = {}, current; if ( params[ 0 ] ) { for ( i = 0; i < length; i++ ) { current = params[ i ].split( "=" ); current[ 0 ] = decodeURIComponent( current[ 0 ] ); // allow just a key to turn on a flag, e.g., test.html?noglobals current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; urlParams[ current[ 0 ] ] = current[ 1 ]; } } QUnit.urlParams = urlParams; // String search anywhere in moduleName+testName config.filter = urlParams.filter; // Exact match of the module name config.module = urlParams.module; config.testNumber = parseInt( urlParams.testNumber, 10 ) || null; // Figure out if we're running the tests from a server or not QUnit.isLocal = location.protocol === "file:"; }()); // Extend QUnit object, // these after set here because they should not be exposed as global functions extend( QUnit, { assert: assert, config: config, // Initialize the configuration options init: function() { extend( config, { stats: { all: 0, bad: 0 }, moduleStats: { all: 0, bad: 0 }, started: +new Date(), updateRate: 1000, blocking: false, autostart: true, autorun: false, filter: "", queue: [], semaphore: 1 }); var tests, banner, result, qunit = id( "qunit" ); if ( qunit ) { qunit.innerHTML = "<h1 id='qunit-header'>" + escapeText( document.title ) + "</h1>" + "<h2 id='qunit-banner'></h2>" + "<div id='qunit-testrunner-toolbar'></div>" + "<h2 id='qunit-userAgent'></h2>" + "<ol id='qunit-tests'></ol>"; } tests = id( "qunit-tests" ); banner = id( "qunit-banner" ); result = id( "qunit-testresult" ); if ( tests ) { tests.innerHTML = ""; } if ( banner ) { banner.className = ""; } if ( result ) { result.parentNode.removeChild( result ); } if ( tests ) { result = document.createElement( "p" ); result.id = "qunit-testresult"; result.className = "result"; tests.parentNode.insertBefore( result, tests ); result.innerHTML = "Running...<br/>&nbsp;"; } }, // Resets the test setup. Useful for tests that modify the DOM. reset: function() { var fixture = id( "qunit-fixture" ); if ( fixture ) { fixture.innerHTML = config.fixture; } }, // Trigger an event on an element. // @example triggerEvent( document.body, "click" ); triggerEvent: function( elem, type, event ) { if ( document.createEvent ) { event = document.createEvent( "MouseEvents" ); event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, 0, 0, 0, 0, 0, false, false, false, false, 0, null); elem.dispatchEvent( event ); } else if ( elem.fireEvent ) { elem.fireEvent( "on" + type ); } }, // Safe object type checking is: function( type, obj ) { return QUnit.objectType( obj ) === type; }, objectType: function( obj ) { if ( typeof obj === "undefined" ) { return "undefined"; // consider: typeof null === object } if ( obj === null ) { return "null"; } var match = toString.call( obj ).match(/^\[object\s(.*)\]$/), type = match && match[1] || ""; switch ( type ) { case "Number": if ( isNaN(obj) ) { return "nan"; } return "number"; case "String": case "Boolean": case "Array": case "Date": case "RegExp": case "Function": return type.toLowerCase(); } if ( typeof obj === "object" ) { return "object"; } return undefined; }, push: function( result, actual, expected, message ) { if ( !config.current ) { throw new Error( "assertion outside test context, was " + sourceFromStacktrace() ); } var output, source, details = { module: config.current.module, name: config.current.testName, result: result, message: message, actual: actual, expected: expected }; message = escapeText( message ) || ( result ? "okay" : "failed" ); message = "<span class='test-message'>" + message + "</span>"; output = message; if ( !result ) { expected = escapeText( QUnit.jsDump.parse(expected) ); actual = escapeText( QUnit.jsDump.parse(actual) ); output += "<table><tr class='test-expected'><th>Expected: </th><td><pre>" + expected + "</pre></td></tr>"; if ( actual !== expected ) { output += "<tr class='test-actual'><th>Result: </th><td><pre>" + actual + "</pre></td></tr>"; output += "<tr class='test-diff'><th>Diff: </th><td><pre>" + QUnit.diff( expected, actual ) + "</pre></td></tr>"; } source = sourceFromStacktrace(); if ( source ) { details.source = source; output += "<tr class='test-source'><th>Source: </th><td><pre>" + escapeText( source ) + "</pre></td></tr>"; } output += "</table>"; } runLoggingCallbacks( "log", QUnit, details ); config.current.assertions.push({ result: !!result, message: output }); }, pushFailure: function( message, source, actual ) { if ( !config.current ) { throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) ); } var output, details = { module: config.current.module, name: config.current.testName, result: false, message: message }; message = escapeText( message ) || "error"; message = "<span class='test-message'>" + message + "</span>"; output = message; output += "<table>"; if ( actual ) { output += "<tr class='test-actual'><th>Result: </th><td><pre>" + escapeText( actual ) + "</pre></td></tr>"; } if ( source ) { details.source = source; output += "<tr class='test-source'><th>Source: </th><td><pre>" + escapeText( source ) + "</pre></td></tr>"; } output += "</table>"; runLoggingCallbacks( "log", QUnit, details ); config.current.assertions.push({ result: false, message: output }); }, url: function( params ) { params = extend( extend( {}, QUnit.urlParams ), params ); var key, querystring = "?"; for ( key in params ) { if ( !hasOwn.call( params, key ) ) { continue; } querystring += encodeURIComponent( key ) + "=" + encodeURIComponent( params[ key ] ) + "&"; } return window.location.protocol + "//" + window.location.host + window.location.pathname + querystring.slice( 0, -1 ); }, extend: extend, id: id, addEvent: addEvent // load, equiv, jsDump, diff: Attached later }); /** * @deprecated: Created for backwards compatibility with test runner that set the hook function * into QUnit.{hook}, instead of invoking it and passing the hook function. * QUnit.constructor is set to the empty F() above so that we can add to it's prototype here. * Doing this allows us to tell if the following methods have been overwritten on the actual * QUnit object. */ extend( QUnit.constructor.prototype, { // Logging callbacks; all receive a single argument with the listed properties // run test/logs.html for any related changes begin: registerLoggingCallback( "begin" ), // done: { failed, passed, total, runtime } done: registerLoggingCallback( "done" ), // log: { result, actual, expected, message } log: registerLoggingCallback( "log" ), // testStart: { name } testStart: registerLoggingCallback( "testStart" ), // testDone: { name, failed, passed, total, duration } testDone: registerLoggingCallback( "testDone" ), // moduleStart: { name } moduleStart: registerLoggingCallback( "moduleStart" ), // moduleDone: { name, failed, passed, total } moduleDone: registerLoggingCallback( "moduleDone" ) }); if ( typeof document === "undefined" || document.readyState === "complete" ) { config.autorun = true; } QUnit.load = function() { runLoggingCallbacks( "begin", QUnit, {} ); // Initialize the config, saving the execution queue var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxesContainer, urlConfigCheckboxes, moduleFilter, numModules = 0, moduleFilterHtml = "", urlConfigHtml = "", oldconfig = extend( {}, config ); QUnit.init(); extend(config, oldconfig); config.blocking = false; len = config.urlConfig.length; for ( i = 0; i < len; i++ ) { val = config.urlConfig[i]; if ( typeof val === "string" ) { val = { id: val, label: val, tooltip: "[no tooltip available]" }; } config[ val.id ] = QUnit.urlParams[ val.id ]; urlConfigHtml += "<input id='qunit-urlconfig-" + escapeText( val.id ) + "' name='" + escapeText( val.id ) + "' type='checkbox'" + ( config[ val.id ] ? " checked='checked'" : "" ) + " title='" + escapeText( val.tooltip ) + "'><label for='qunit-urlconfig-" + escapeText( val.id ) + "' title='" + escapeText( val.tooltip ) + "'>" + val.label + "</label>"; } moduleFilterHtml += "<label for='qunit-modulefilter'>Module: </label><select id='qunit-modulefilter' name='modulefilter'><option value='' " + ( config.module === undefined ? "selected='selected'" : "" ) + ">< All Modules ></option>"; for ( i in config.modules ) { if ( config.modules.hasOwnProperty( i ) ) { numModules += 1; moduleFilterHtml += "<option value='" + escapeText( encodeURIComponent(i) ) + "' " + ( config.module === i ? "selected='selected'" : "" ) + ">" + escapeText(i) + "</option>"; } } moduleFilterHtml += "</select>"; // `userAgent` initialized at top of scope userAgent = id( "qunit-userAgent" ); if ( userAgent ) { userAgent.innerHTML = navigator.userAgent; } // `banner` initialized at top of scope banner = id( "qunit-header" ); if ( banner ) { banner.innerHTML = "<a href='" + QUnit.url({ filter: undefined, module: undefined, testNumber: undefined }) + "'>" + banner.innerHTML + "</a> "; } // `toolbar` initialized at top of scope toolbar = id( "qunit-testrunner-toolbar" ); if ( toolbar ) { // `filter` initialized at top of scope filter = document.createElement( "input" ); filter.type = "checkbox"; filter.id = "qunit-filter-pass"; addEvent( filter, "click", function() { var tmp, ol = document.getElementById( "qunit-tests" ); if ( filter.checked ) { ol.className = ol.className + " hidepass"; } else { tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; ol.className = tmp.replace( / hidepass /, " " ); } if ( defined.sessionStorage ) { if (filter.checked) { sessionStorage.setItem( "qunit-filter-passed-tests", "true" ); } else { sessionStorage.removeItem( "qunit-filter-passed-tests" ); } } }); if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem( "qunit-filter-passed-tests" ) ) { filter.checked = true; // `ol` initialized at top of scope ol = document.getElementById( "qunit-tests" ); ol.className = ol.className + " hidepass"; } toolbar.appendChild( filter ); // `label` initialized at top of scope label = document.createElement( "label" ); label.setAttribute( "for", "qunit-filter-pass" ); label.setAttribute( "title", "Only show tests and assertons that fail. Stored in sessionStorage." ); label.innerHTML = "Hide passed tests"; toolbar.appendChild( label ); urlConfigCheckboxesContainer = document.createElement("span"); urlConfigCheckboxesContainer.innerHTML = urlConfigHtml; urlConfigCheckboxes = urlConfigCheckboxesContainer.getElementsByTagName("input"); // For oldIE support: // * Add handlers to the individual elements instead of the container // * Use "click" instead of "change" // * Fallback from event.target to event.srcElement addEvents( urlConfigCheckboxes, "click", function( event ) { var params = {}, target = event.target || event.srcElement; params[ target.name ] = target.checked ? true : undefined; window.location = QUnit.url( params ); }); toolbar.appendChild( urlConfigCheckboxesContainer ); if (numModules > 1) { moduleFilter = document.createElement( 'span' ); moduleFilter.setAttribute( 'id', 'qunit-modulefilter-container' ); moduleFilter.innerHTML = moduleFilterHtml; addEvent( moduleFilter.lastChild, "change", function() { var selectBox = moduleFilter.getElementsByTagName("select")[0], selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value); window.location = QUnit.url( { module: ( selectedModule === "" ) ? undefined : selectedModule } ); }); toolbar.appendChild(moduleFilter); } } // `main` initialized at top of scope main = id( "qunit-fixture" ); if ( main ) { config.fixture = main.innerHTML; } if ( config.autostart ) { QUnit.start(); } }; addEvent( window, "load", QUnit.load ); // `onErrorFnPrev` initialized at top of scope // Preserve other handlers onErrorFnPrev = window.onerror; // Cover uncaught exceptions // Returning true will surpress the default browser handler, // returning false will let it run. window.onerror = function ( error, filePath, linerNr ) { var ret = false; if ( onErrorFnPrev ) { ret = onErrorFnPrev( error, filePath, linerNr ); } // Treat return value as window.onerror itself does, // Only do our handling if not surpressed. if ( ret !== true ) { if ( QUnit.config.current ) { if ( QUnit.config.current.ignoreGlobalErrors ) { return true; } QUnit.pushFailure( error, filePath + ":" + linerNr ); } else { QUnit.test( "global failure", extend( function() { QUnit.pushFailure( error, filePath + ":" + linerNr ); }, { validTest: validTest } ) ); } return false; } return ret; }; function done() { config.autorun = true; // Log the last module results if ( config.currentModule ) { runLoggingCallbacks( "moduleDone", QUnit, { name: config.currentModule, failed: config.moduleStats.bad, passed: config.moduleStats.all - config.moduleStats.bad, total: config.moduleStats.all }); } var i, key, banner = id( "qunit-banner" ), tests = id( "qunit-tests" ), runtime = +new Date() - config.started, passed = config.stats.all - config.stats.bad, html = [ "Tests completed in ", runtime, " milliseconds.<br/>", "<span class='passed'>", passed, "</span> assertions of <span class='total'>", config.stats.all, "</span> passed, <span class='failed'>", config.stats.bad, "</span> failed." ].join( "" ); if ( banner ) { banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" ); } if ( tests ) { id( "qunit-testresult" ).innerHTML = html; } if ( config.altertitle && typeof document !== "undefined" && document.title ) { // show ✖ for good, ✔ for bad suite result in title // use escape sequences in case file gets loaded with non-utf-8-charset document.title = [ ( config.stats.bad ? "\u2716" : "\u2714" ), document.title.replace( /^[\u2714\u2716] /i, "" ) ].join( " " ); } // clear own sessionStorage items if all tests passed if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { // `key` & `i` initialized at top of scope for ( i = 0; i < sessionStorage.length; i++ ) { key = sessionStorage.key( i++ ); if ( key.indexOf( "qunit-test-" ) === 0 ) { sessionStorage.removeItem( key ); } } } // scroll back to top to show results if ( window.scrollTo ) { window.scrollTo(0, 0); } runLoggingCallbacks( "done", QUnit, { failed: config.stats.bad, passed: passed, total: config.stats.all, runtime: runtime }); } /** @return Boolean: true if this test should be ran */ function validTest( test ) { var include, filter = config.filter && config.filter.toLowerCase(), module = config.module && config.module.toLowerCase(), fullName = (test.module + ": " + test.testName).toLowerCase(); // Internally-generated tests are always valid if ( test.callback && test.callback.validTest === validTest ) { delete test.callback.validTest; return true; } if ( config.testNumber ) { return test.testNumber === config.testNumber; } if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) { return false; } if ( !filter ) { return true; } include = filter.charAt( 0 ) !== "!"; if ( !include ) { filter = filter.slice( 1 ); } // If the filter matches, we need to honour include if ( fullName.indexOf( filter ) !== -1 ) { return include; } // Otherwise, do the opposite return !include; } // so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions) // Later Safari and IE10 are supposed to support error.stack as well // See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack function extractStacktrace( e, offset ) { offset = offset === undefined ? 3 : offset; var stack, include, i; if ( e.stacktrace ) { // Opera return e.stacktrace.split( "\n" )[ offset + 3 ]; } else if ( e.stack ) { // Firefox, Chrome stack = e.stack.split( "\n" ); if (/^error$/i.test( stack[0] ) ) { stack.shift(); } if ( fileName ) { include = []; for ( i = offset; i < stack.length; i++ ) { if ( stack[ i ].indexOf( fileName ) !== -1 ) { break; } include.push( stack[ i ] ); } if ( include.length ) { return include.join( "\n" ); } } return stack[ offset ]; } else if ( e.sourceURL ) { // Safari, PhantomJS // hopefully one day Safari provides actual stacktraces // exclude useless self-reference for generated Error objects if ( /qunit.js$/.test( e.sourceURL ) ) { return; } // for actual exceptions, this is useful return e.sourceURL + ":" + e.line; } } function sourceFromStacktrace( offset ) { try { throw new Error(); } catch ( e ) { return extractStacktrace( e, offset ); } } /** * Escape text for attribute or text content. */ function escapeText( s ) { if ( !s ) { return ""; } s = s + ""; // Both single quotes and double quotes (for attributes) return s.replace( /['"<>&]/g, function( s ) { switch( s ) { case '\'': return '&#039;'; case '"': return '&quot;'; case '<': return '&lt;'; case '>': return '&gt;'; case '&': return '&amp;'; } }); } function synchronize( callback, last ) { config.queue.push( callback ); if ( config.autorun && !config.blocking ) { process( last ); } } function process( last ) { function next() { process( last ); } var start = new Date().getTime(); config.depth = config.depth ? config.depth + 1 : 1; while ( config.queue.length && !config.blocking ) { if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) { config.queue.shift()(); } else { window.setTimeout( next, 13 ); break; } } config.depth--; if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { done(); } } function saveGlobal() { config.pollution = []; if ( config.noglobals ) { for ( var key in window ) { // in Opera sometimes DOM element ids show up here, ignore them if ( !hasOwn.call( window, key ) || /^qunit-test-output/.test( key ) ) { continue; } config.pollution.push( key ); } } } function checkPollution() { var newGlobals, deletedGlobals, old = config.pollution; saveGlobal(); newGlobals = diff( config.pollution, old ); if ( newGlobals.length > 0 ) { QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") ); } deletedGlobals = diff( old, config.pollution ); if ( deletedGlobals.length > 0 ) { QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") ); } } // returns a new Array with the elements that are in a but not in b function diff( a, b ) { var i, j, result = a.slice(); for ( i = 0; i < result.length; i++ ) { for ( j = 0; j < b.length; j++ ) { if ( result[i] === b[j] ) { result.splice( i, 1 ); i--; break; } } } return result; } function extend( a, b ) { for ( var prop in b ) { if ( b[ prop ] === undefined ) { delete a[ prop ]; // Avoid "Member not found" error in IE8 caused by setting window.constructor } else if ( prop !== "constructor" || a !== window ) { a[ prop ] = b[ prop ]; } } return a; } /** * @param {HTMLElement} elem * @param {string} type * @param {Function} fn */ function addEvent( elem, type, fn ) { // Standards-based browsers if ( elem.addEventListener ) { elem.addEventListener( type, fn, false ); // IE } else { elem.attachEvent( "on" + type, fn ); } } /** * @param {Array|NodeList} elems * @param {string} type * @param {Function} fn */ function addEvents( elems, type, fn ) { var i = elems.length; while ( i-- ) { addEvent( elems[i], type, fn ); } } function hasClass( elem, name ) { return (" " + elem.className + " ").indexOf(" " + name + " ") > -1; } function addClass( elem, name ) { if ( !hasClass( elem, name ) ) { elem.className += (elem.className ? " " : "") + name; } } function removeClass( elem, name ) { var set = " " + elem.className + " "; // Class name may appear multiple times while ( set.indexOf(" " + name + " ") > -1 ) { set = set.replace(" " + name + " " , " "); } // If possible, trim it for prettiness, but not neccecarily elem.className = window.jQuery ? jQuery.trim( set ) : ( set.trim ? set.trim() : set ); } function id( name ) { return !!( typeof document !== "undefined" && document && document.getElementById ) && document.getElementById( name ); } function registerLoggingCallback( key ) { return function( callback ) { config[key].push( callback ); }; } // Supports deprecated method of completely overwriting logging callbacks function runLoggingCallbacks( key, scope, args ) { var i, callbacks; if ( QUnit.hasOwnProperty( key ) ) { QUnit[ key ].call(scope, args ); } else { callbacks = config[ key ]; for ( i = 0; i < callbacks.length; i++ ) { callbacks[ i ].call( scope, args ); } } } // Test for equality any JavaScript type. // Author: Philippe Rathé <prathe@gmail.com> QUnit.equiv = (function() { // Call the o related callback with the given arguments. function bindCallbacks( o, callbacks, args ) { var prop = QUnit.objectType( o ); if ( prop ) { if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) { return callbacks[ prop ].apply( callbacks, args ); } else { return callbacks[ prop ]; // or undefined } } } // the real equiv function var innerEquiv, // stack to decide between skip/abort functions callers = [], // stack to avoiding loops from circular referencing parents = [], getProto = Object.getPrototypeOf || function ( obj ) { return obj.__proto__; }, callbacks = (function () { // for string, boolean, number and null function useStrictEquality( b, a ) { /*jshint eqeqeq:false */ if ( b instanceof a.constructor || a instanceof b.constructor ) { // to catch short annotaion VS 'new' annotation of a // declaration // e.g. var i = 1; // var j = new Number(1); return a == b; } else { return a === b; } } return { "string": useStrictEquality, "boolean": useStrictEquality, "number": useStrictEquality, "null": useStrictEquality, "undefined": useStrictEquality, "nan": function( b ) { return isNaN( b ); }, "date": function( b, a ) { return QUnit.objectType( b ) === "date" && a.valueOf() === b.valueOf(); }, "regexp": function( b, a ) { return QUnit.objectType( b ) === "regexp" && // the regex itself a.source === b.source && // and its modifers a.global === b.global && // (gmi) ... a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky; }, // - skip when the property is a method of an instance (OOP) // - abort otherwise, // initial === would have catch identical references anyway "function": function() { var caller = callers[callers.length - 1]; return caller !== Object && typeof caller !== "undefined"; }, "array": function( b, a ) { var i, j, len, loop; // b could be an object literal here if ( QUnit.objectType( b ) !== "array" ) { return false; } len = a.length; if ( len !== b.length ) { // safe and faster return false; } // track reference to avoid circular references parents.push( a ); for ( i = 0; i < len; i++ ) { loop = false; for ( j = 0; j < parents.length; j++ ) { if ( parents[j] === a[i] ) { loop = true;// dont rewalk array } } if ( !loop && !innerEquiv(a[i], b[i]) ) { parents.pop(); return false; } } parents.pop(); return true; }, "object": function( b, a ) { var i, j, loop, // Default to true eq = true, aProperties = [], bProperties = []; // comparing constructors is more strict than using // instanceof if ( a.constructor !== b.constructor ) { // Allow objects with no prototype to be equivalent to // objects with Object as their constructor. if ( !(( getProto(a) === null && getProto(b) === Object.prototype ) || ( getProto(b) === null && getProto(a) === Object.prototype ) ) ) { return false; } } // stack constructor before traversing properties callers.push( a.constructor ); // track reference to avoid circular references parents.push( a ); for ( i in a ) { // be strict: don't ensures hasOwnProperty // and go deep loop = false; for ( j = 0; j < parents.length; j++ ) { if ( parents[j] === a[i] ) { // don't go down the same path twice loop = true; } } aProperties.push(i); // collect a's properties if (!loop && !innerEquiv( a[i], b[i] ) ) { eq = false; break; } } callers.pop(); // unstack, we are done parents.pop(); for ( i in b ) { bProperties.push( i ); // collect b's properties } // Ensures identical properties name return eq && innerEquiv( aProperties.sort(), bProperties.sort() ); } }; }()); innerEquiv = function() { // can take multiple arguments var args = [].slice.apply( arguments ); if ( args.length < 2 ) { return true; // end transition } return (function( a, b ) { if ( a === b ) { return true; // catch the most you can } else if ( a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || QUnit.objectType(a) !== QUnit.objectType(b) ) { return false; // don't lose time with error prone cases } else { return bindCallbacks(a, callbacks, [ b, a ]); } // apply transition with (1..n) arguments }( args[0], args[1] ) && arguments.callee.apply( this, args.splice(1, args.length - 1 )) ); }; return innerEquiv; }()); /** * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | * http://flesler.blogspot.com Licensed under BSD * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 * * @projectDescription Advanced and extensible data dumping for Javascript. * @version 1.0.0 * @author Ariel Flesler * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} */ QUnit.jsDump = (function() { function quote( str ) { return '"' + str.toString().replace( /"/g, '\\"' ) + '"'; } function literal( o ) { return o + ""; } function join( pre, arr, post ) { var s = jsDump.separator(), base = jsDump.indent(), inner = jsDump.indent(1); if ( arr.join ) { arr = arr.join( "," + s + inner ); } if ( !arr ) { return pre + post; } return [ pre, inner + arr, base + post ].join(s); } function array( arr, stack ) { var i = arr.length, ret = new Array(i); this.up(); while ( i-- ) { ret[i] = this.parse( arr[i] , undefined , stack); } this.down(); return join( "[", ret, "]" ); } var reName = /^function (\w+)/, jsDump = { // type is used mostly internally, you can fix a (custom)type in advance parse: function( obj, type, stack ) { stack = stack || [ ]; var inStack, res, parser = this.parsers[ type || this.typeOf(obj) ]; type = typeof parser; inStack = inArray( obj, stack ); if ( inStack !== -1 ) { return "recursion(" + (inStack - stack.length) + ")"; } if ( type === "function" ) { stack.push( obj ); res = parser.call( this, obj, stack ); stack.pop(); return res; } return ( type === "string" ) ? parser : this.parsers.error; }, typeOf: function( obj ) { var type; if ( obj === null ) { type = "null"; } else if ( typeof obj === "undefined" ) { type = "undefined"; } else if ( QUnit.is( "regexp", obj) ) { type = "regexp"; } else if ( QUnit.is( "date", obj) ) { type = "date"; } else if ( QUnit.is( "function", obj) ) { type = "function"; } else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) { type = "window"; } else if ( obj.nodeType === 9 ) { type = "document"; } else if ( obj.nodeType ) { type = "node"; } else if ( // native arrays toString.call( obj ) === "[object Array]" || // NodeList objects ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) ) ) { type = "array"; } else if ( obj.constructor === Error.prototype.constructor ) { type = "error"; } else { type = typeof obj; } return type; }, separator: function() { return this.multiline ? this.HTML ? "<br />" : "\n" : this.HTML ? "&nbsp;" : " "; }, // extra can be a number, shortcut for increasing-calling-decreasing indent: function( extra ) { if ( !this.multiline ) { return ""; } var chr = this.indentChar; if ( this.HTML ) { chr = chr.replace( /\t/g, " " ).replace( / /g, "&nbsp;" ); } return new Array( this._depth_ + (extra||0) ).join(chr); }, up: function( a ) { this._depth_ += a || 1; }, down: function( a ) { this._depth_ -= a || 1; }, setParser: function( name, parser ) { this.parsers[name] = parser; }, // The next 3 are exposed so you can use them quote: quote, literal: literal, join: join, // _depth_: 1, // This is the list of parsers, to modify them, use jsDump.setParser parsers: { window: "[Window]", document: "[Document]", error: function(error) { return "Error(\"" + error.message + "\")"; }, unknown: "[Unknown]", "null": "null", "undefined": "undefined", "function": function( fn ) { var ret = "function", // functions never have name in IE name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1]; if ( name ) { ret += " " + name; } ret += "( "; ret = [ ret, QUnit.jsDump.parse( fn, "functionArgs" ), "){" ].join( "" ); return join( ret, QUnit.jsDump.parse(fn,"functionCode" ), "}" ); }, array: array, nodelist: array, "arguments": array, object: function( map, stack ) { var ret = [ ], keys, key, val, i; QUnit.jsDump.up(); keys = []; for ( key in map ) { keys.push( key ); } keys.sort(); for ( i = 0; i < keys.length; i++ ) { key = keys[ i ]; val = map[ key ]; ret.push( QUnit.jsDump.parse( key, "key" ) + ": " + QUnit.jsDump.parse( val, undefined, stack ) ); } QUnit.jsDump.down(); return join( "{", ret, "}" ); }, node: function( node ) { var len, i, val, open = QUnit.jsDump.HTML ? "&lt;" : "<", close = QUnit.jsDump.HTML ? "&gt;" : ">", tag = node.nodeName.toLowerCase(), ret = open + tag, attrs = node.attributes; if ( attrs ) { for ( i = 0, len = attrs.length; i < len; i++ ) { val = attrs[i].nodeValue; // IE6 includes all attributes in .attributes, even ones not explicitly set. // Those have values like undefined, null, 0, false, "" or "inherit". if ( val && val !== "inherit" ) { ret += " " + attrs[i].nodeName + "=" + QUnit.jsDump.parse( val, "attribute" ); } } } ret += close; // Show content of TextNode or CDATASection if ( node.nodeType === 3 || node.nodeType === 4 ) { ret += node.nodeValue; } return ret + open + "/" + tag + close; }, // function calls it internally, it's the arguments part of the function functionArgs: function( fn ) { var args, l = fn.length; if ( !l ) { return ""; } args = new Array(l); while ( l-- ) { // 97 is 'a' args[l] = String.fromCharCode(97+l); } return " " + args.join( ", " ) + " "; }, // object calls it internally, the key part of an item in a map key: quote, // function calls it internally, it's the content of the function functionCode: "[code]", // node calls it internally, it's an html attribute value attribute: quote, string: quote, date: quote, regexp: literal, number: literal, "boolean": literal }, // if true, entities are escaped ( <, >, \t, space and \n ) HTML: false, // indentation unit indentChar: " ", // if true, items in a collection, are separated by a \n, else just a space. multiline: true }; return jsDump; }()); // from jquery.js function inArray( elem, array ) { if ( array.indexOf ) { return array.indexOf( elem ); } for ( var i = 0, length = array.length; i < length; i++ ) { if ( array[ i ] === elem ) { return i; } } return -1; } /* * Javascript Diff Algorithm * By John Resig (http://ejohn.org/) * Modified by Chu Alan "sprite" * * Released under the MIT license. * * More Info: * http://ejohn.org/projects/javascript-diff-algorithm/ * * Usage: QUnit.diff(expected, actual) * * QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over" */ QUnit.diff = (function() { /*jshint eqeqeq:false, eqnull:true */ function diff( o, n ) { var i, ns = {}, os = {}; for ( i = 0; i < n.length; i++ ) { if ( ns[ n[i] ] == null ) { ns[ n[i] ] = { rows: [], o: null }; } ns[ n[i] ].rows.push( i ); } for ( i = 0; i < o.length; i++ ) { if ( os[ o[i] ] == null ) { os[ o[i] ] = { rows: [], n: null }; } os[ o[i] ].rows.push( i ); } for ( i in ns ) { if ( !hasOwn.call( ns, i ) ) { continue; } if ( ns[i].rows.length === 1 && os[i] !== undefined && os[i].rows.length === 1 ) { n[ ns[i].rows[0] ] = { text: n[ ns[i].rows[0] ], row: os[i].rows[0] }; o[ os[i].rows[0] ] = { text: o[ os[i].rows[0] ], row: ns[i].rows[0] }; } } for ( i = 0; i < n.length - 1; i++ ) { if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null && n[ i + 1 ] == o[ n[i].row + 1 ] ) { n[ i + 1 ] = { text: n[ i + 1 ], row: n[i].row + 1 }; o[ n[i].row + 1 ] = { text: o[ n[i].row + 1 ], row: i + 1 }; } } for ( i = n.length - 1; i > 0; i-- ) { if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null && n[ i - 1 ] == o[ n[i].row - 1 ]) { n[ i - 1 ] = { text: n[ i - 1 ], row: n[i].row - 1 }; o[ n[i].row - 1 ] = { text: o[ n[i].row - 1 ], row: i - 1 }; } } return { o: o, n: n }; } return function( o, n ) { o = o.replace( /\s+$/, "" ); n = n.replace( /\s+$/, "" ); var i, pre, str = "", out = diff( o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/) ), oSpace = o.match(/\s+/g), nSpace = n.match(/\s+/g); if ( oSpace == null ) { oSpace = [ " " ]; } else { oSpace.push( " " ); } if ( nSpace == null ) { nSpace = [ " " ]; } else { nSpace.push( " " ); } if ( out.n.length === 0 ) { for ( i = 0; i < out.o.length; i++ ) { str += "<del>" + out.o[i] + oSpace[i] + "</del>"; } } else { if ( out.n[0].text == null ) { for ( n = 0; n < out.o.length && out.o[n].text == null; n++ ) { str += "<del>" + out.o[n] + oSpace[n] + "</del>"; } } for ( i = 0; i < out.n.length; i++ ) { if (out.n[i].text == null) { str += "<ins>" + out.n[i] + nSpace[i] + "</ins>"; } else { // `pre` initialized at top of scope pre = ""; for ( n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++ ) { pre += "<del>" + out.o[n] + oSpace[n] + "</del>"; } str += " " + out.n[i].text + nSpace[i] + pre; } } } return str; }; }()); // for CommonJS enviroments, export everything if ( typeof exports !== "undefined" ) { extend( exports, QUnit ); } // get at whatever the global object is, like window in browsers }( (function() {return this;}.call()) ));
{ "content_hash": "e85b4ffba3ed9906a56f9d03092999c4", "timestamp": "", "source": "github", "line_count": 2144, "max_line_length": 179, "avg_line_length": 26.43516791044776, "alnum_prop": 0.5987261146496815, "repo_name": "chrismichaelscott/iugo", "id": "94c0f99583bd9dcd147512d56d4bae9959713eca", "size": "56898", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tests/qunit.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4671" }, { "name": "JavaScript", "bytes": "93060" } ], "symlink_target": "" }
package com.intel.analytics.bigdl.models.resnet import com.intel.analytics.bigdl.nn.{CrossEntropyCriterion, Module} import com.intel.analytics.bigdl._ import com.intel.analytics.bigdl.models.resnet.ResNet.{DatasetType, ShortcutType} import com.intel.analytics.bigdl.optim._ import com.intel.analytics.bigdl.utils.{Engine, LoggerFilter, T, Table} import org.apache.log4j.{Level, Logger} import org.apache.spark.SparkContext import com.intel.analytics.bigdl.tensor.TensorNumericMath.TensorNumeric._ object Train { LoggerFilter.redirectSparkInfoLogs() Logger.getLogger("com.intel.analytics.bigdl.optim").setLevel(Level.INFO) import Utils._ def cifar10Decay(epoch: Int): Double = if (epoch >= 122) 2.0 else if (epoch >= 81) 1.0 else 0.0 def main(args: Array[String]): Unit = { trainParser.parse(args, new TrainParams()).map(param => { val conf = Engine.createSparkConf().setAppName("Train ResNet on Cifar10") // Will throw exception without this config when has only one executor .set("spark.rpc.message.maxSize", "200") val sc = new SparkContext(conf) Engine.init val batchSize = param.batchSize val (imageSize, lrSchedule, maxEpoch, dataSet) = (32, DatasetType.CIFAR10, param.nepochs, Cifar10DataSet) val trainDataSet = dataSet.trainDataSet(param.folder, sc, imageSize, batchSize) val validateSet = dataSet.valDataSet(param.folder, sc, imageSize, batchSize) val shortcut: ShortcutType = param.shortcutType match { case "A" => ShortcutType.A case "B" => ShortcutType.B case _ => ShortcutType.C } val model = if (param.modelSnapshot.isDefined) { Module.load[Float](param.modelSnapshot.get) } else { val curModel = ResNet(classNum = param.classes, T("shortcutType" -> shortcut, "depth" -> param.depth, "optnet" -> param.optnet)) if (param.optnet) { ResNet.shareGradInput(curModel) } ResNet.modelInit(curModel) curModel } val optimMethod = if (param.stateSnapshot.isDefined) { OptimMethod.load[Float](param.stateSnapshot.get) } else { new SGD[Float](learningRate = param.learningRate, learningRateDecay = 0.0, weightDecay = param.weightDecay, momentum = param.momentum, dampening = param.dampening, nesterov = param.nesterov, learningRateSchedule = SGD.EpochDecay(cifar10Decay)) } val optimizer = Optimizer( model = model, dataset = trainDataSet, criterion = new CrossEntropyCriterion[Float]() ) if (param.checkpoint.isDefined) { optimizer.setCheckpoint(param.checkpoint.get, Trigger.everyEpoch) } optimizer .setOptimMethod(optimMethod) .setValidation(Trigger.everyEpoch, validateSet, Array(new Top1Accuracy[Float])) .setEndWhen(Trigger.maxEpoch(maxEpoch)) .optimize() sc.stop() }) } }
{ "content_hash": "9012fe78ee1f26e2ab7bc89dab660a16", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 98, "avg_line_length": 35.082352941176474, "alnum_prop": 0.6733735747820255, "repo_name": "122689305/BigDL", "id": "711f9e955b41a016ac2aab746d7f5bcef85dbbcf", "size": "3583", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "spark/dl/src/main/scala/com/intel/analytics/bigdl/models/resnet/Train.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "6829" }, { "name": "Lua", "bytes": "1904" }, { "name": "Python", "bytes": "310320" }, { "name": "RobotFramework", "bytes": "10583" }, { "name": "Scala", "bytes": "3128936" }, { "name": "Shell", "bytes": "28478" } ], "symlink_target": "" }
C# based application for sql script generation
{ "content_hash": "8e3bbdcc5c5d7d692c31c9f221914d8d", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 46, "avg_line_length": 48, "alnum_prop": 0.8125, "repo_name": "MJWherry/SQLScriptGenerator", "id": "e2b029b4b4e4d661a99326d3a97ac3219fce9ec0", "size": "70", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "70774" } ], "symlink_target": "" }
export * from './collapsible-item/collapsible-item.component'; export * from './collapsible.component';
{ "content_hash": "63db2ce4e9fc927a7b4d956fa551a988", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 62, "avg_line_length": 52, "alnum_prop": 0.7596153846153846, "repo_name": "hiagodotme/ng2-materialize", "id": "7249f418c2a870f1dd2e1666059f0c66fb0fbde3", "size": "104", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/collapsible/index.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "11475" }, { "name": "HTML", "bytes": "223744" }, { "name": "JavaScript", "bytes": "8272" }, { "name": "TypeScript", "bytes": "552798" } ], "symlink_target": "" }
<?php namespace MyEvents\MainBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Organisation * * @ORM\Table(name="organisation", uniqueConstraints={@ORM\UniqueConstraint(name="uq_organisation_utilisateur_manifestation", columns={"utilisateur", "manifestation"})})) * @ORM\Entity(repositoryClass="OrganisationRepository") */ class Organisation { /** * @var integer * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var Utilisateur * @ORM\ManyToOne(targetEntity="Utilisateur", cascade={"persist"}, inversedBy="organisations") * @ORM\JoinColumn(name="utilisateur", referencedColumnName="id", nullable=false) */ private $utilisateur; /** * @var Manifestation * @ORM\ManyToOne(targetEntity="Manifestation", cascade={"persist"}, inversedBy="organisations") * @ORM\JoinColumn(name="manifestation", referencedColumnName="id", nullable=false) */ private $manifestation; /** * @var Marqueur * @ORM\ManyToOne(targetEntity="Marqueur", cascade={"persist"}, inversedBy="organisations") * @ORM\JoinColumn(name="marqueur", referencedColumnName="id") */ private $marqueur; /** * Get id * @return integer */ public function getId() { return $this->id; } /** * Set utilisateur * @param Utilisateur $utilisateur * @return Organisation */ public function setUtilisateur(Utilisateur $utilisateur) { $this->utilisateur = $utilisateur; $utilisateur->addOrganisation($this); return $this; } /** * Get utilisateur * @return Utilisateur */ public function getUtilisateur() { return $this->utilisateur; } /** * Set manifestation * @param Manifestation $manifestation * @return Organisation */ public function setManifestation(Manifestation $manifestation) { $this->manifestation = $manifestation; $manifestation->addOrganisation($this); return $this; } /** * Get manifestation * @return Manifestation */ public function getManifestation() { return $this->manifestation; } /** * Set marqueur * @param Marqueur $marqueur * @return Organisation */ public function setMarqueur(Marqueur $marqueur = null) { $this->marqueur = $marqueur; $marqueur->addOrganisation($this); return $this; } /** * Get marqueur * @return Marqueur */ public function getMarqueur() { return $this->marqueur; } }
{ "content_hash": "2e7c05daeaf8e10473ba0cfdc17ae984", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 170, "avg_line_length": 21.81651376146789, "alnum_prop": 0.6888141295206055, "repo_name": "mneute/my-events", "id": "c945b6a7548a97b2759e046a088c574e4bc45ef8", "size": "2378", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/MyEvents/MainBundle/Entity/Organisation.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4915" }, { "name": "JavaScript", "bytes": "80191" }, { "name": "PHP", "bytes": "98460" } ], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in in Gaudichaud-Beaupré, Voy. Uranie. Bot. 200 (1827) #### Original name Sticta gaudichaudiana Pers. ### Remarks null
{ "content_hash": "add27ff49c680e7eadd04d0eeb3c50c4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 51, "avg_line_length": 13.76923076923077, "alnum_prop": 0.7150837988826816, "repo_name": "mdoering/backbone", "id": "504d2eec276600d9e00d087806146689b55dc4e4", "size": "231", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Lecanoromycetes/Peltigerales/Lobariaceae/Sticta/Sticta gaudichaudiana/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.droidcon.snaphack.key; /** * Created by tmaslon on 8/25/2016. */ import java.io.IOException; import java.security.InvalidKeyException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.UnrecoverableEntryException; import java.security.cert.CertificateException; import java.security.interfaces.RSAPublicKey; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import android.util.Log; import com.droidcon.snaphack.cryptography.CryptoUtils; import com.droidcon.snaphack.manager.KeyManager; import org.spongycastle.crypto.AsymmetricBlockCipher; import org.spongycastle.crypto.CipherParameters; import org.spongycastle.crypto.InvalidCipherTextException; public class AndroidRsaEngine implements AsymmetricBlockCipher { private static final String TAG = AndroidRsaEngine.class.getSimpleName(); private static final boolean DEBUG = false; private Cipher cipher; private final String keyAlias; private KeyStore keyStore; private PrivateKey privateKey; private RSAPublicKey publicKey; private boolean forEncryption; private CipherParameters params; public AndroidRsaEngine(String keyAlias) { this.keyAlias = keyAlias; try { if(KeyManager.IS_M){ this.cipher = Cipher.getInstance("RSA/NONE/OAEPWithSHA-1AndMGF1Padding"); }else { this.cipher = Cipher.getInstance("RSA/NONE/NoPadding"); } this.keyStore = KeyStore.getInstance("AndroidKeyStore"); keyStore.load(null); java.security.KeyStore.Entry keyEntry = keyStore.getEntry( this.keyAlias, null); publicKey = (RSAPublicKey) ((java.security.KeyStore.PrivateKeyEntry) keyEntry) .getCertificate().getPublicKey(); privateKey = ((java.security.KeyStore.PrivateKeyEntry) keyEntry).getPrivateKey(); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (NoSuchPaddingException e) { throw new RuntimeException(e); } catch (KeyStoreException e) { throw new RuntimeException(e); } catch (CertificateException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } catch (UnrecoverableEntryException e) { throw new RuntimeException(e); } } @Override public int getInputBlockSize() { int bitSize = publicKey.getModulus().bitLength(); if (forEncryption) { return (bitSize + 7) / 8 - 1; } else { return (bitSize + 7) / 8; } } @Override public int getOutputBlockSize() { int bitSize = publicKey.getModulus().bitLength(); if (forEncryption) { return (bitSize + 7) / 8; } else { return (bitSize + 7) / 8 - 1; } } @Override public void init(boolean forEncryption, CipherParameters param) { this.forEncryption = forEncryption; if (DEBUG) { Log.d(TAG, "forEncryption: " + forEncryption); } this.params = param; if (DEBUG) { Log.d(TAG, "CipherParameters: " + param); } try { if (forEncryption) { cipher.init(Cipher.ENCRYPT_MODE,publicKey); } else { cipher.init(Cipher.DECRYPT_MODE,privateKey); } } catch (InvalidKeyException e) { throw new RuntimeException(e); } } public byte[] encrypt_decrypt(byte[] in, int inOff, int inLen) throws InvalidCipherTextException { try { byte[] result = cipher.doFinal(in, inOff, inLen); return result; } catch (IllegalBlockSizeException e) { throw new InvalidCipherTextException("Illegal block size: " + e.getMessage()); } catch (BadPaddingException e) { throw new InvalidCipherTextException("Bad padding: " + e.getMessage()); } }; @Override public byte[] processBlock(byte[] in, int inOff, int inLen) throws InvalidCipherTextException { try { String inputStr = CryptoUtils.toHex(in); if (DEBUG) { Log.d(TAG, "processBlock() INPUT: " + inputStr); } byte[] result = cipher.doFinal(in, inOff, inLen); String outputStr = CryptoUtils.toHex(result); if (DEBUG) { Log.d(TAG, "processBlock() OUTPUT: " + outputStr); } byte[] converted = convertOutput(result); String convertedStr = CryptoUtils.toHex(converted); if (DEBUG) { Log.d(TAG, "processBlock() CONVERTED: " + convertedStr); } return converted; } catch (IllegalBlockSizeException e) { throw new InvalidCipherTextException("Illegal block size: " + e.getMessage()); } catch (BadPaddingException e) { throw new InvalidCipherTextException("Bad padding: " + e.getMessage()); } } // from BC's RSACoreEngine public byte[] convertOutput(byte[] output) { if (forEncryption) { if (output[0] == 0 && output.length > getOutputBlockSize()) // have ended up with an extra zero byte, copy down. { byte[] tmp = new byte[output.length - 1]; System.arraycopy(output, 1, tmp, 0, tmp.length); return tmp; } if (output.length < getOutputBlockSize()) // have ended up with less bytes than normal, lengthen { byte[] tmp = new byte[getOutputBlockSize()]; System.arraycopy(output, 0, tmp, tmp.length - output.length, output.length); return tmp; } } else { if (output[0] == 0) // have ended up with an extra zero byte, copy down. { byte[] tmp = new byte[output.length - 1]; System.arraycopy(output, 1, tmp, 0, tmp.length); return tmp; } } return output; } }
{ "content_hash": "837de10f9a3030bb74b157c32fc4f29a", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 124, "avg_line_length": 33.4228855721393, "alnum_prop": 0.5727895206906818, "repo_name": "tomek2k4/android-keygen-test", "id": "c64db7cf00bce769f975a8c885a876d27443e5fa", "size": "6718", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/droidcon/snaphack/key/AndroidRsaEngine.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "57464" } ], "symlink_target": "" }
require 'spec_helper' module Spec module Mocks describe Mock do treats_method_missing_as_private :subject => Mock.new, :noop => false before(:each) do @mock = mock("test mock") end after(:each) do @mock.rspec_reset end describe "deprecated #stub_everything method" do before(:each) do Kernel.stub!(:warn) end it "creates a mock that behaves as a null object" do stub_everything.should be_null_object end it "provides deprecation warning" do Kernel.should_receive(:warn).with(/DEPRECATION: stub_everything.* is deprecated./) stub_everything end end it "should report line number of expectation of unreceived message" do expected_error_line = __LINE__; @mock.should_receive(:wont_happen).with("x", 3) begin @mock.rspec_verify violated rescue MockExpectationError => e # NOTE - this regexp ended w/ $, but jruby adds extra info at the end of the line e.backtrace[0].should match(/#{File.basename(__FILE__)}:#{expected_error_line}/) end end it "should report line number of expectation of unreceived message after #should_receive after similar stub" do @mock.stub!(:wont_happen) expected_error_line = __LINE__; @mock.should_receive(:wont_happen).with("x", 3) begin @mock.rspec_verify violated rescue MockExpectationError => e # NOTE - this regexp ended w/ $, but jruby adds extra info at the end of the line e.backtrace[0].should match(/#{File.basename(__FILE__)}:#{expected_error_line}/) end end it "should pass when not receiving message specified as not to be received" do @mock.should_not_receive(:not_expected) @mock.rspec_verify end it "should pass when receiving message specified as not to be received with different args" do @mock.should_not_receive(:message).with("unwanted text") @mock.should_receive(:message).with("other text") @mock.message "other text" @mock.rspec_verify end it "should fail when receiving message specified as not to be received" do @mock.should_not_receive(:not_expected) lambda { @mock.not_expected violated }.should raise_error(MockExpectationError, "Mock \"test mock\" expected :not_expected with (no args) 0 times, but received it once") end it "should fail when receiving message specified as not to be received with args" do @mock.should_not_receive(:not_expected).with("unexpected text") lambda { @mock.not_expected("unexpected text") violated }.should raise_error(MockExpectationError, "Mock \"test mock\" expected :not_expected with (\"unexpected text\") 0 times, but received it once") end it "should pass when receiving message specified as not to be received with wrong args" do @mock.should_not_receive(:not_expected).with("unexpected text") @mock.not_expected "really unexpected text" @mock.rspec_verify end it "should allow block to calculate return values" do @mock.should_receive(:something).with("a","b","c").and_return { |a,b,c| c+b+a } @mock.something("a","b","c").should == "cba" @mock.rspec_verify end it "should allow parameter as return value" do @mock.should_receive(:something).with("a","b","c").and_return("booh") @mock.something("a","b","c").should == "booh" @mock.rspec_verify end it "should return nil if no return value set" do @mock.should_receive(:something).with("a","b","c") @mock.something("a","b","c").should be_nil @mock.rspec_verify end it "should raise exception if args don't match when method called" do @mock.should_receive(:something).with("a","b","c").and_return("booh") lambda { @mock.something("a","d","c") violated }.should raise_error(MockExpectationError, "Mock \"test mock\" received :something with unexpected arguments\n expected: (\"a\", \"b\", \"c\")\n got: (\"a\", \"d\", \"c\")") end it "should raise exception if args don't match when method called even when the method is stubbed" do @mock.stub!(:something) @mock.should_receive(:something).with("a","b","c") lambda { @mock.something("a","d","c") @mock.rspec_verify }.should raise_error(MockExpectationError, "Mock \"test mock\" received :something with unexpected arguments\n expected: (\"a\", \"b\", \"c\")\n got: ([\"a\", \"d\", \"c\"])") end it "should raise exception if args don't match when method called even when using null_object" do @mock = mock("test mock", :null_object => true) @mock.should_receive(:something).with("a","b","c") lambda { @mock.something("a","d","c") @mock.rspec_verify }.should raise_error(MockExpectationError, "Mock \"test mock\" received :something with unexpected arguments\n expected: (\"a\", \"b\", \"c\")\n got: ([\"a\", \"d\", \"c\"])") end it "should fail if unexpected method called" do lambda { @mock.something("a","b","c") violated }.should raise_error(MockExpectationError, "Mock \"test mock\" received unexpected message :something with (\"a\", \"b\", \"c\")") end it "should use block for expectation if provided" do @mock.should_receive(:something) do | a, b | a.should == "a" b.should == "b" "booh" end @mock.something("a", "b").should == "booh" @mock.rspec_verify end it "should fail if expectation block fails" do @mock.should_receive(:something) {| bool | bool.should be_true} lambda { @mock.something false }.should raise_error(MockExpectationError, /Mock "test mock" received :something but passed block failed with: expected true, got false/) end it "should fail right away when method defined as never is received" do @mock.should_receive(:not_expected).never lambda { @mock.not_expected }.should raise_error(MockExpectationError, "Mock \"test mock\" expected :not_expected with (no args) 0 times, but received it once") end it "should eventually fail when method defined as never is received" do @mock.should_receive(:not_expected).never lambda { @mock.not_expected }.should raise_error(MockExpectationError, "Mock \"test mock\" expected :not_expected with (no args) 0 times, but received it once") end it "should raise when told to" do @mock.should_receive(:something).and_raise(RuntimeError) lambda do @mock.something end.should raise_error(RuntimeError) end it "should raise passed an Exception instance" do error = RuntimeError.new("error message") @mock.should_receive(:something).and_raise(error) lambda { @mock.something }.should raise_error(RuntimeError, "error message") end it "should raise RuntimeError with passed message" do @mock.should_receive(:something).and_raise("error message") lambda { @mock.something }.should raise_error(RuntimeError, "error message") end it "should not raise when told to if args dont match" do @mock.should_receive(:something).with(2).and_raise(RuntimeError) lambda { @mock.something 1 }.should raise_error(MockExpectationError) end it "should throw when told to" do @mock.should_receive(:something).and_throw(:blech) lambda { @mock.something }.should throw_symbol(:blech) end it "should raise when explicit return and block constrained" do lambda { @mock.should_receive(:fruit) do |colour| :strawberry end.and_return :apple }.should raise_error(AmbiguousReturnError) end it "should ignore args on any args" do @mock.should_receive(:something).at_least(:once).with(any_args) @mock.something @mock.something 1 @mock.something "a", 2 @mock.something [], {}, "joe", 7 @mock.rspec_verify end it "should fail on no args if any args received" do @mock.should_receive(:something).with(no_args()) lambda { @mock.something 1 }.should raise_error(MockExpectationError, "Mock \"test mock\" received :something with unexpected arguments\n expected: (no args)\n got: (1)") end it "should fail when args are expected but none are received" do @mock.should_receive(:something).with(1) lambda { @mock.something }.should raise_error(MockExpectationError, "Mock \"test mock\" received :something with unexpected arguments\n expected: (1)\n got: (no args)") end it "should return value from block by default" do @mock.stub!(:method_that_yields).and_yield @mock.method_that_yields { :returned_obj }.should == :returned_obj @mock.rspec_verify end it "should yield 0 args to blocks that take a variable number of arguments" do @mock.should_receive(:yield_back).with(no_args()).once.and_yield a = nil @mock.yield_back {|*x| a = x} a.should == [] @mock.rspec_verify end it "should yield 0 args multiple times to blocks that take a variable number of arguments" do @mock.should_receive(:yield_back).once.with(no_args()).once.and_yield. and_yield a = nil b = [] @mock.yield_back {|*a| b << a} b.should == [ [], [] ] @mock.rspec_verify end it "should yield one arg to blocks that take a variable number of arguments" do @mock.should_receive(:yield_back).with(no_args()).once.and_yield(99) a = nil @mock.yield_back {|*x| a = x} a.should == [99] @mock.rspec_verify end it "should yield one arg 3 times consecutively to blocks that take a variable number of arguments" do @mock.should_receive(:yield_back).once.with(no_args()).once.and_yield(99). and_yield(43). and_yield("something fruity") a = nil b = [] @mock.yield_back {|*a| b << a} b.should == [[99], [43], ["something fruity"]] @mock.rspec_verify end it "should yield many args to blocks that take a variable number of arguments" do @mock.should_receive(:yield_back).with(no_args()).once.and_yield(99, 27, "go") a = nil @mock.yield_back {|*x| a = x} a.should == [99, 27, "go"] @mock.rspec_verify end it "should yield many args 3 times consecutively to blocks that take a variable number of arguments" do @mock.should_receive(:yield_back).once.with(no_args()).once.and_yield(99, :green, "go"). and_yield("wait", :amber). and_yield("stop", 12, :red) a = nil b = [] @mock.yield_back {|*a| b << a} b.should == [[99, :green, "go"], ["wait", :amber], ["stop", 12, :red]] @mock.rspec_verify end it "should yield single value" do @mock.should_receive(:yield_back).with(no_args()).once.and_yield(99) a = nil @mock.yield_back {|x| a = x} a.should == 99 @mock.rspec_verify end it "should yield single value 3 times consecutively" do @mock.should_receive(:yield_back).once.with(no_args()).once.and_yield(99). and_yield(43). and_yield("something fruity") a = nil b = [] @mock.yield_back {|a| b << a} b.should == [99, 43, "something fruity"] @mock.rspec_verify end it "should yield two values" do @mock.should_receive(:yield_back).with(no_args()).once.and_yield('wha', 'zup') a, b = nil @mock.yield_back {|x,y| a=x; b=y} a.should == 'wha' b.should == 'zup' @mock.rspec_verify end it "should yield two values 3 times consecutively" do @mock.should_receive(:yield_back).once.with(no_args()).once.and_yield('wha', 'zup'). and_yield('not', 'down'). and_yield(14, 65) a, b = nil c = [] @mock.yield_back {|a,b| c << [a, b]} c.should == [['wha', 'zup'], ['not', 'down'], [14, 65]] @mock.rspec_verify end it "should fail when calling yielding method with wrong arity" do @mock.should_receive(:yield_back).with(no_args()).once.and_yield('wha', 'zup') lambda { @mock.yield_back {|a|} }.should raise_error(MockExpectationError, "Mock \"test mock\" yielded |\"wha\", \"zup\"| to block with arity of 1") end it "should fail when calling yielding method consecutively with wrong arity" do @mock.should_receive(:yield_back).once.with(no_args()).once.and_yield('wha', 'zup'). and_yield('down'). and_yield(14, 65) lambda { a, b = nil c = [] @mock.yield_back {|a,b| c << [a, b]} }.should raise_error(MockExpectationError, "Mock \"test mock\" yielded |\"down\"| to block with arity of 2") end it "should fail when calling yielding method without block" do @mock.should_receive(:yield_back).with(no_args()).once.and_yield('wha', 'zup') lambda { @mock.yield_back }.should raise_error(MockExpectationError, "Mock \"test mock\" asked to yield |[\"wha\", \"zup\"]| but no block was passed") end it "should be able to mock send" do @mock.should_receive(:send).with(any_args) @mock.send 'hi' @mock.rspec_verify end it "should be able to raise from method calling yielding mock" do @mock.should_receive(:yield_me).and_yield 44 lambda { @mock.yield_me do |x| raise "Bang" end }.should raise_error(StandardError, "Bang") @mock.rspec_verify end it "should clear expectations after verify" do @mock.should_receive(:foobar) @mock.foobar @mock.rspec_verify lambda { @mock.foobar }.should raise_error(MockExpectationError, "Mock \"test mock\" received unexpected message :foobar with (no args)") end it "should restore objects to their original state on rspec_reset" do mock = mock("this is a mock") mock.should_receive(:blah) mock.rspec_reset mock.rspec_verify #should throw if reset didn't work end it "should work even after method_missing starts raising NameErrors instead of NoMethodErrors" do # Object#method_missing throws either NameErrors or NoMethodErrors. # # On a fresh ruby program Object#method_missing: # * raises a NoMethodError when called directly # * raises a NameError when called indirectly # # Once Object#method_missing has been called at least once (on any object) # it starts behaving differently: # * raises a NameError when called directly # * raises a NameError when called indirectly # # There was a bug in Mock#method_missing that relied on the fact # that calling Object#method_missing directly raises a NoMethodError. # This example tests that the bug doesn't exist anymore. # Ensures that method_missing always raises NameErrors. a_method_that_doesnt_exist rescue @mock.should_receive(:foobar) @mock.foobar @mock.rspec_verify lambda { @mock.foobar }.should_not raise_error(NameError) lambda { @mock.foobar }.should raise_error(MockExpectationError) end it "should temporarily replace a method stub on a mock" do @mock.stub!(:msg).and_return(:stub_value) @mock.should_receive(:msg).with(:arg).and_return(:mock_value) @mock.msg(:arg).should equal(:mock_value) @mock.msg.should equal(:stub_value) @mock.msg.should equal(:stub_value) @mock.rspec_verify end it "should not require a different signature to replace a method stub" do @mock.stub!(:msg).and_return(:stub_value) @mock.should_receive(:msg).and_return(:mock_value) @mock.msg(:arg).should equal(:mock_value) @mock.msg.should equal(:stub_value) @mock.msg.should equal(:stub_value) @mock.rspec_verify end it "should raise an error when a previously stubbed method has a negative expectation" do @mock.stub!(:msg).and_return(:stub_value) @mock.should_not_receive(:msg).and_return(:mock_value) lambda {@mock.msg(:arg)}.should raise_error(MockExpectationError) end it "should temporarily replace a method stub on a non-mock" do non_mock = Object.new non_mock.stub!(:msg).and_return(:stub_value) non_mock.should_receive(:msg).with(:arg).and_return(:mock_value) non_mock.msg(:arg).should equal(:mock_value) non_mock.msg.should equal(:stub_value) non_mock.msg.should equal(:stub_value) non_mock.rspec_verify end it "should return the stubbed value when no new value specified" do @mock.stub!(:msg).and_return(:stub_value) @mock.should_receive(:msg) @mock.msg.should equal(:stub_value) @mock.rspec_verify end it "should not mess with the stub's yielded values when also mocked" do @mock.stub!(:yield_back).and_yield(:stub_value) @mock.should_receive(:yield_back).and_yield(:mock_value) @mock.yield_back{|v| v.should == :mock_value } @mock.yield_back{|v| v.should == :stub_value } @mock.rspec_verify end it "should yield multiple values after a similar stub" do File.stub!(:open).and_yield(:stub_value) File.should_receive(:open).and_yield(:first_call).and_yield(:second_call) yielded_args = [] File.open {|v| yielded_args << v } yielded_args.should == [:first_call, :second_call] File.open {|v| v.should == :stub_value } File.rspec_verify end it "should assign stub return values" do mock = Mock.new('name', :message => :response) mock.message.should == :response end end describe "a mock message receiving a block" do before(:each) do @mock = mock("mock") @calls = 0 end def add_call @calls = @calls + 1 end it "should call the block after #should_receive" do @mock.should_receive(:foo) { add_call } @mock.foo @calls.should == 1 end it "should call the block after #should_receive after a similar stub" do @mock.stub!(:foo).and_return(:bar) @mock.should_receive(:foo) { add_call } @mock.foo @calls.should == 1 end it "should call the block after #once" do @mock.should_receive(:foo).once { add_call } @mock.foo @calls.should == 1 end it "should call the block after #twice" do @mock.should_receive(:foo).twice { add_call } @mock.foo @mock.foo @calls.should == 2 end it "should call the block after #times" do @mock.should_receive(:foo).exactly(10).times { add_call } (1..10).each { @mock.foo } @calls.should == 10 end it "should call the block after #any_number_of_times" do @mock.should_receive(:foo).any_number_of_times { add_call } (1..7).each { @mock.foo } @calls.should == 7 end it "should call the block after #ordered" do @mock.should_receive(:foo).ordered { add_call } @mock.should_receive(:bar).ordered { add_call } @mock.foo @mock.bar @calls.should == 2 end end describe 'string representation generated by #to_s' do it 'should not contain < because that might lead to invalid HTML in some situations' do mock = mock("Dog") valid_html_str = "#{mock}" valid_html_str.should_not include('<') end end describe "mock created with no name" do it "should not use a name in a failure message" do mock = mock() expect {mock.foo}.to raise_error(/Mock received/) end it "should respond to initially stubbed methods" do mock = mock(:foo => "woo", :bar => "car") mock.foo.should == "woo" mock.bar.should == "car" end end describe "==" do it "sends '== self' to the comparison object" do first = mock('first') second = mock('second') first.should_receive(:==).with(second) second == first end end end end
{ "content_hash": "fcc291b692bf0ddafd1529a3b0994e52", "timestamp": "", "source": "github", "line_count": 594, "max_line_length": 190, "avg_line_length": 36.754208754208754, "alnum_prop": 0.5748900696225724, "repo_name": "AMEE/provenance.prototype", "id": "9c636a338f35198132498fb7cf5c41c62418dd3d", "size": "21832", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "vendor/plugins/rspec/spec/spec/mocks/mock_spec.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "7734" }, { "name": "JavaScript", "bytes": "22980" }, { "name": "Ruby", "bytes": "120587" } ], "symlink_target": "" }
<?PHP $this->load->view("includes/Administration/header"); $this->load->view("includes/Administration/sidebar"); ?> <body> <div class="content-wrapper"> <section class="content"> <div class="row"> <div class="col-md-12"> <!--<a href="AddRestaurant.html" class="btn bg-gray-light2">&lt; &nbsp;Back to Add Restaurant</a>--> <div class="clear_h10"></div> <h4 class="border_bottom">Lists - Food Category Setup</h4> <div class="clear_h10"></div> <h4>CUISINE</h4> <div class="table-responsive"> <table class="table table_design tbl" style="width:60%;"> <tbody> <?php foreach($cuisine_list as $cu => $cuisine): ?> <tr> <td><?php echo ucwords($cuisine->name); ?></td> <td align="right"><a href="/delete_cuisine/<?php echo $cuisine->id; ?>" class="delete">x</a></td> </tr> <?php endforeach; ?> </tbody></table> </div> <form action="" method="post"> <input id="Text1" type="text" class="pad7" required name="cuisineName"> <!--&nbsp; &nbsp; <a href="" class="btn bg-gray-light2"><span class="add_sign">+</span> Add</a>--> <div class="clear_h10"></div> <button type="submit" class="btn bg-green" name="btncuisine">Save</button> </form> <div class="clear_h20"></div> <h4>FOOD TYPE</h4> <div class="table-responsive"> <table class="table table_design tbl" style="width:60%;"> <tbody> <?php foreach($foodtype as $food => $fType): ?> <tr><td><?php echo $fType->food_title; ?></td> <td align="right"><a href="/delete_foodtype/<?php echo $fType->id; ?>" class="delete">x</a></td></tr> <?php endforeach; ?> </tbody></table> </div> <form action="" method="post"> <input id="Text2" type="text" class="pad7" name="foodtype"> <!--&nbsp; &nbsp; <a href="" class="btn bg-gray-light2"><span class="add_sign">+</span> Add</a>--> <div class="clear_h10"></div> <button type="submit" class="btn bg-green" name="btnfood">Save</button> </form> <div class="clear_h20"></div> <h4>RESTAURANT CATEGORY</h4> <div class="table-responsive"> <table class="table table_design tbl" style="width:60%;"> <tbody> <?php foreach($seocategory as $seocat => $cat): ?> <tr><td><?php echo $cat->name; ?></td> <td align="right"><a href="/delete_seo_category/<?php echo $cat->id; ?>" class="delete">x</a></td></tr> <?php endforeach; ?> </tbody></table> </div> <form action="" method="post"> <input id="Text3" type="text" class="pad7" name="category"> <!--&nbsp; &nbsp; <a href="" class="btn bg-gray-light2"><span class="add_sign">+</span> Add</a>--> <div class="clear_h10"></div> <button type="submit" class="btn bg-green" name="btncat">Save</button> </form> </div> </div> </section> </div><!-- /.content-wrapper --> <?PHP $this->load->view("includes/Administration/footer"); ?>
{ "content_hash": "03e2f07364f7a08118e83d882682dc60", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 127, "avg_line_length": 41.84848484848485, "alnum_prop": 0.4093651943036447, "repo_name": "emelyan1987/FoodDelivery", "id": "2db5bddc695537bc5eb85307c04392fa96b5d569", "size": "4143", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/Administration/cuisine_setup.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "729" }, { "name": "C", "bytes": "2283" }, { "name": "CSS", "bytes": "2392582" }, { "name": "HTML", "bytes": "8836277" }, { "name": "JavaScript", "bytes": "17152069" }, { "name": "Makefile", "bytes": "5081" }, { "name": "PHP", "bytes": "10816993" }, { "name": "Python", "bytes": "11585" }, { "name": "Shell", "bytes": "4440" } ], "symlink_target": "" }
//===--------------------------- Unwind-EHABI.cpp -------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // // Implements ARM zero-cost C++ exceptions // //===----------------------------------------------------------------------===// #include "Unwind-EHABI.h" #if defined(_LIBUNWIND_ARM_EHABI) #include <inttypes.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "config.h" #include "libunwind.h" #include "libunwind_ext.h" #include "unwind.h" namespace { // Strange order: take words in order, but inside word, take from most to least // signinficant byte. uint8_t getByte(const uint32_t* data, size_t offset) { const uint8_t* byteData = reinterpret_cast<const uint8_t*>(data); #ifdef __LITTLE_ENDIAN__ return byteData[(offset & ~(size_t)0x03) + (3 - (offset & (size_t)0x03))]; #else return byteData[offset]; #endif } const char* getNextWord(const char* data, uint32_t* out) { *out = *reinterpret_cast<const uint32_t*>(data); return data + 4; } const char* getNextNibble(const char* data, uint32_t* out) { *out = *reinterpret_cast<const uint16_t*>(data); return data + 2; } struct Descriptor { // See # 9.2 typedef enum { SU16 = 0, // Short descriptor, 16-bit entries LU16 = 1, // Long descriptor, 16-bit entries LU32 = 3, // Long descriptor, 32-bit entries RESERVED0 = 4, RESERVED1 = 5, RESERVED2 = 6, RESERVED3 = 7, RESERVED4 = 8, RESERVED5 = 9, RESERVED6 = 10, RESERVED7 = 11, RESERVED8 = 12, RESERVED9 = 13, RESERVED10 = 14, RESERVED11 = 15 } Format; // See # 9.2 typedef enum { CLEANUP = 0x0, FUNC = 0x1, CATCH = 0x2, INVALID = 0x4 } Kind; }; _Unwind_Reason_Code ProcessDescriptors( _Unwind_State state, _Unwind_Control_Block* ucbp, struct _Unwind_Context* context, Descriptor::Format format, const char* descriptorStart, uint32_t flags) { // EHT is inlined in the index using compact form. No descriptors. #5 if (flags & 0x1) return _URC_CONTINUE_UNWIND; // TODO: We should check the state here, and determine whether we need to // perform phase1 or phase2 unwinding. (void)state; const char* descriptor = descriptorStart; uint32_t descriptorWord; getNextWord(descriptor, &descriptorWord); while (descriptorWord) { // Read descriptor based on # 9.2. uint32_t length; uint32_t offset; switch (format) { case Descriptor::LU32: descriptor = getNextWord(descriptor, &length); descriptor = getNextWord(descriptor, &offset); case Descriptor::LU16: descriptor = getNextNibble(descriptor, &length); descriptor = getNextNibble(descriptor, &offset); default: assert(false); return _URC_FAILURE; } // See # 9.2 table for decoding the kind of descriptor. It's a 2-bit value. Descriptor::Kind kind = static_cast<Descriptor::Kind>((length & 0x1) | ((offset & 0x1) << 1)); // Clear off flag from last bit. length &= ~1u; offset &= ~1u; uintptr_t scopeStart = ucbp->pr_cache.fnstart + offset; uintptr_t scopeEnd = scopeStart + length; uintptr_t pc = _Unwind_GetIP(context); bool isInScope = (scopeStart <= pc) && (pc < scopeEnd); switch (kind) { case Descriptor::CLEANUP: { // TODO(ajwong): Handle cleanup descriptors. break; } case Descriptor::FUNC: { // TODO(ajwong): Handle function descriptors. break; } case Descriptor::CATCH: { // Catch descriptors require gobbling one more word. uint32_t landing_pad; descriptor = getNextWord(descriptor, &landing_pad); if (isInScope) { // TODO(ajwong): This is only phase1 compatible logic. Implement // phase2. landing_pad = signExtendPrel31(landing_pad & ~0x80000000); if (landing_pad == 0xffffffff) { return _URC_HANDLER_FOUND; } else if (landing_pad == 0xfffffffe) { return _URC_FAILURE; } else { /* bool is_reference_type = landing_pad & 0x80000000; void* matched_object; if (__cxxabiv1::__cxa_type_match( ucbp, reinterpret_cast<const std::type_info *>(landing_pad), is_reference_type, &matched_object) != __cxxabiv1::ctm_failed) return _URC_HANDLER_FOUND; */ _LIBUNWIND_ABORT("Type matching not implemented"); } } break; } default: _LIBUNWIND_ABORT("Invalid descriptor kind found."); } getNextWord(descriptor, &descriptorWord); } return _URC_CONTINUE_UNWIND; } static _Unwind_Reason_Code unwindOneFrame(_Unwind_State state, _Unwind_Control_Block* ucbp, struct _Unwind_Context* context) { // Read the compact model EHT entry's header # 6.3 const uint32_t* unwindingData = ucbp->pr_cache.ehtp; assert((*unwindingData & 0xf0000000) == 0x80000000 && "Must be a compact entry"); Descriptor::Format format = static_cast<Descriptor::Format>((*unwindingData & 0x0f000000) >> 24); const char *lsda = reinterpret_cast<const char *>(_Unwind_GetLanguageSpecificData(context)); // Handle descriptors before unwinding so they are processed in the context // of the correct stack frame. _Unwind_Reason_Code result = ProcessDescriptors(state, ucbp, context, format, lsda, ucbp->pr_cache.additional); if (result != _URC_CONTINUE_UNWIND) return result; if (__unw_step(reinterpret_cast<unw_cursor_t *>(context)) != UNW_STEP_SUCCESS) return _URC_FAILURE; return _URC_CONTINUE_UNWIND; } // Generates mask discriminator for _Unwind_VRS_Pop, e.g. for _UVRSC_CORE / // _UVRSD_UINT32. uint32_t RegisterMask(uint8_t start, uint8_t count_minus_one) { return ((1U << (count_minus_one + 1)) - 1) << start; } // Generates mask discriminator for _Unwind_VRS_Pop, e.g. for _UVRSC_VFP / // _UVRSD_DOUBLE. uint32_t RegisterRange(uint8_t start, uint8_t count_minus_one) { return ((uint32_t)start << 16) | ((uint32_t)count_minus_one + 1); } } // end anonymous namespace /** * Decodes an EHT entry. * * @param data Pointer to EHT. * @param[out] off Offset from return value (in bytes) to begin interpretation. * @param[out] len Number of bytes in unwind code. * @return Pointer to beginning of unwind code. */ extern "C" const uint32_t* decode_eht_entry(const uint32_t* data, size_t* off, size_t* len) { if ((*data & 0x80000000) == 0) { // 6.2: Generic Model // // EHT entry is a prel31 pointing to the PR, followed by data understood // only by the personality routine. Fortunately, all existing assembler // implementations, including GNU assembler, LLVM integrated assembler, // and ARM assembler, assume that the unwind opcodes come after the // personality rountine address. *off = 1; // First byte is size data. *len = (((data[1] >> 24) & 0xff) + 1) * 4; data++; // Skip the first word, which is the prel31 offset. } else { // 6.3: ARM Compact Model // // EHT entries here correspond to the __aeabi_unwind_cpp_pr[012] PRs indeded // by format: Descriptor::Format format = static_cast<Descriptor::Format>((*data & 0x0f000000) >> 24); switch (format) { case Descriptor::SU16: *len = 4; *off = 1; break; case Descriptor::LU16: case Descriptor::LU32: *len = 4 + 4 * ((*data & 0x00ff0000) >> 16); *off = 2; break; default: return nullptr; } } return data; } _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_VRS_Interpret(_Unwind_Context *context, const uint32_t *data, size_t offset, size_t len) { bool wrotePC = false; bool finish = false; while (offset < len && !finish) { uint8_t byte = getByte(data, offset++); if ((byte & 0x80) == 0) { uint32_t sp; _Unwind_VRS_Get(context, _UVRSC_CORE, UNW_ARM_SP, _UVRSD_UINT32, &sp); if (byte & 0x40) sp -= (((uint32_t)byte & 0x3f) << 2) + 4; else sp += ((uint32_t)byte << 2) + 4; _Unwind_VRS_Set(context, _UVRSC_CORE, UNW_ARM_SP, _UVRSD_UINT32, &sp); } else { switch (byte & 0xf0) { case 0x80: { if (offset >= len) return _URC_FAILURE; uint32_t registers = (((uint32_t)byte & 0x0f) << 12) | (((uint32_t)getByte(data, offset++)) << 4); if (!registers) return _URC_FAILURE; if (registers & (1 << 15)) wrotePC = true; _Unwind_VRS_Pop(context, _UVRSC_CORE, registers, _UVRSD_UINT32); break; } case 0x90: { uint8_t reg = byte & 0x0f; if (reg == 13 || reg == 15) return _URC_FAILURE; uint32_t sp; _Unwind_VRS_Get(context, _UVRSC_CORE, UNW_ARM_R0 + reg, _UVRSD_UINT32, &sp); _Unwind_VRS_Set(context, _UVRSC_CORE, UNW_ARM_SP, _UVRSD_UINT32, &sp); break; } case 0xa0: { uint32_t registers = RegisterMask(4, byte & 0x07); if (byte & 0x08) registers |= 1 << 14; _Unwind_VRS_Pop(context, _UVRSC_CORE, registers, _UVRSD_UINT32); break; } case 0xb0: { switch (byte) { case 0xb0: finish = true; break; case 0xb1: { if (offset >= len) return _URC_FAILURE; uint8_t registers = getByte(data, offset++); if (registers & 0xf0 || !registers) return _URC_FAILURE; _Unwind_VRS_Pop(context, _UVRSC_CORE, registers, _UVRSD_UINT32); break; } case 0xb2: { uint32_t addend = 0; uint32_t shift = 0; // This decodes a uleb128 value. while (true) { if (offset >= len) return _URC_FAILURE; uint32_t v = getByte(data, offset++); addend |= (v & 0x7f) << shift; if ((v & 0x80) == 0) break; shift += 7; } uint32_t sp; _Unwind_VRS_Get(context, _UVRSC_CORE, UNW_ARM_SP, _UVRSD_UINT32, &sp); sp += 0x204 + (addend << 2); _Unwind_VRS_Set(context, _UVRSC_CORE, UNW_ARM_SP, _UVRSD_UINT32, &sp); break; } case 0xb3: { uint8_t v = getByte(data, offset++); _Unwind_VRS_Pop(context, _UVRSC_VFP, RegisterRange(static_cast<uint8_t>(v >> 4), v & 0x0f), _UVRSD_VFPX); break; } case 0xb4: case 0xb5: case 0xb6: case 0xb7: return _URC_FAILURE; default: _Unwind_VRS_Pop(context, _UVRSC_VFP, RegisterRange(8, byte & 0x07), _UVRSD_VFPX); break; } break; } case 0xc0: { switch (byte) { #if defined(__ARM_WMMX) case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: _Unwind_VRS_Pop(context, _UVRSC_WMMXD, RegisterRange(10, byte & 0x7), _UVRSD_DOUBLE); break; case 0xc6: { uint8_t v = getByte(data, offset++); uint8_t start = static_cast<uint8_t>(v >> 4); uint8_t count_minus_one = v & 0xf; if (start + count_minus_one >= 16) return _URC_FAILURE; _Unwind_VRS_Pop(context, _UVRSC_WMMXD, RegisterRange(start, count_minus_one), _UVRSD_DOUBLE); break; } case 0xc7: { uint8_t v = getByte(data, offset++); if (!v || v & 0xf0) return _URC_FAILURE; _Unwind_VRS_Pop(context, _UVRSC_WMMXC, v, _UVRSD_DOUBLE); break; } #endif case 0xc8: case 0xc9: { uint8_t v = getByte(data, offset++); uint8_t start = static_cast<uint8_t>(((byte == 0xc8) ? 16 : 0) + (v >> 4)); uint8_t count_minus_one = v & 0xf; if (start + count_minus_one >= 32) return _URC_FAILURE; _Unwind_VRS_Pop(context, _UVRSC_VFP, RegisterRange(start, count_minus_one), _UVRSD_DOUBLE); break; } default: return _URC_FAILURE; } break; } case 0xd0: { if (byte & 0x08) return _URC_FAILURE; _Unwind_VRS_Pop(context, _UVRSC_VFP, RegisterRange(8, byte & 0x7), _UVRSD_DOUBLE); break; } default: return _URC_FAILURE; } } } if (!wrotePC) { uint32_t lr; _Unwind_VRS_Get(context, _UVRSC_CORE, UNW_ARM_LR, _UVRSD_UINT32, &lr); _Unwind_VRS_Set(context, _UVRSC_CORE, UNW_ARM_IP, _UVRSD_UINT32, &lr); } return _URC_CONTINUE_UNWIND; } extern "C" _LIBUNWIND_EXPORT _Unwind_Reason_Code __aeabi_unwind_cpp_pr0(_Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context) { return unwindOneFrame(state, ucbp, context); } extern "C" _LIBUNWIND_EXPORT _Unwind_Reason_Code __aeabi_unwind_cpp_pr1(_Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context) { return unwindOneFrame(state, ucbp, context); } extern "C" _LIBUNWIND_EXPORT _Unwind_Reason_Code __aeabi_unwind_cpp_pr2(_Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context) { return unwindOneFrame(state, ucbp, context); } static _Unwind_Reason_Code unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) { // EHABI #7.3 discusses preserving the VRS in a "temporary VRS" during // phase 1 and then restoring it to the "primary VRS" for phase 2. The // effect is phase 2 doesn't see any of the VRS manipulations from phase 1. // In this implementation, the phases don't share the VRS backing store. // Instead, they are passed the original |uc| and they create a new VRS // from scratch thus achieving the same effect. __unw_init_local(cursor, uc); // Walk each frame looking for a place to stop. for (bool handlerNotFound = true; handlerNotFound;) { // See if frame has code to run (has personality routine). unw_proc_info_t frameInfo; if (__unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): __unw_get_proc_info " "failed => _URC_FATAL_PHASE1_ERROR", static_cast<void *>(exception_object)); return _URC_FATAL_PHASE1_ERROR; } // When tracing, print state information. if (_LIBUNWIND_TRACING_UNWINDING) { char functionBuf[512]; const char *functionName = functionBuf; unw_word_t offset; if ((__unw_get_proc_name(cursor, functionBuf, sizeof(functionBuf), &offset) != UNW_ESUCCESS) || (frameInfo.start_ip + offset > frameInfo.end_ip)) functionName = ".anonymous."; unw_word_t pc; __unw_get_reg(cursor, UNW_REG_IP, &pc); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): pc=0x%" PRIxPTR ", start_ip=0x%" PRIxPTR ", func=%s, " "lsda=0x%" PRIxPTR ", personality=0x%" PRIxPTR, static_cast<void *>(exception_object), pc, frameInfo.start_ip, functionName, frameInfo.lsda, frameInfo.handler); } // If there is a personality routine, ask it if it will want to stop at // this frame. if (frameInfo.handler != 0) { _Unwind_Personality_Fn p = (_Unwind_Personality_Fn)(long)(frameInfo.handler); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): calling personality function %p", static_cast<void *>(exception_object), reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(p))); struct _Unwind_Context *context = (struct _Unwind_Context *)(cursor); exception_object->pr_cache.fnstart = frameInfo.start_ip; exception_object->pr_cache.ehtp = (_Unwind_EHT_Header *)frameInfo.unwind_info; exception_object->pr_cache.additional = frameInfo.flags; _Unwind_Reason_Code personalityResult = (*p)(_US_VIRTUAL_UNWIND_FRAME, exception_object, context); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): personality result %d start_ip %x ehtp %p " "additional %x", static_cast<void *>(exception_object), personalityResult, exception_object->pr_cache.fnstart, static_cast<void *>(exception_object->pr_cache.ehtp), exception_object->pr_cache.additional); switch (personalityResult) { case _URC_HANDLER_FOUND: // found a catch clause or locals that need destructing in this frame // stop search and remember stack pointer at the frame handlerNotFound = false; // p should have initialized barrier_cache. EHABI #7.3.5 _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND", static_cast<void *>(exception_object)); return _URC_NO_REASON; case _URC_CONTINUE_UNWIND: _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND", static_cast<void *>(exception_object)); // continue unwinding break; // EHABI #7.3.3 case _URC_FAILURE: return _URC_FAILURE; default: // something went wrong _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR", static_cast<void *>(exception_object)); return _URC_FATAL_PHASE1_ERROR; } } } return _URC_NO_REASON; } static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object, bool resume) { // See comment at the start of unwind_phase1 regarding VRS integrity. __unw_init_local(cursor, uc); _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)", static_cast<void *>(exception_object)); int frame_count = 0; // Walk each frame until we reach where search phase said to stop. while (true) { // Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException or _Unwind_Resume). // // Resume only ever makes sense for 1 frame. _Unwind_State state = resume ? _US_UNWIND_FRAME_RESUME : _US_UNWIND_FRAME_STARTING; if (resume && frame_count == 1) { // On a resume, first unwind the _Unwind_Resume() frame. The next frame // is now the landing pad for the cleanup from a previous execution of // phase2. To continue unwindingly correctly, replace VRS[15] with the // IP of the frame that the previous run of phase2 installed the context // for. After this, continue unwinding as if normal. // // See #7.4.6 for details. __unw_set_reg(cursor, UNW_REG_IP, exception_object->unwinder_cache.reserved2); resume = false; } // Get info about this frame. unw_word_t sp; unw_proc_info_t frameInfo; __unw_get_reg(cursor, UNW_REG_SP, &sp); if (__unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING( "unwind_phase2(ex_ojb=%p): __unw_get_proc_info " "failed => _URC_FATAL_PHASE2_ERROR", static_cast<void *>(exception_object)); return _URC_FATAL_PHASE2_ERROR; } // When tracing, print state information. if (_LIBUNWIND_TRACING_UNWINDING) { char functionBuf[512]; const char *functionName = functionBuf; unw_word_t offset; if ((__unw_get_proc_name(cursor, functionBuf, sizeof(functionBuf), &offset) != UNW_ESUCCESS) || (frameInfo.start_ip + offset > frameInfo.end_ip)) functionName = ".anonymous."; _LIBUNWIND_TRACE_UNWINDING( "unwind_phase2(ex_ojb=%p): start_ip=0x%" PRIxPTR ", func=%s, sp=0x%" PRIxPTR ", " "lsda=0x%" PRIxPTR ", personality=0x%" PRIxPTR "", static_cast<void *>(exception_object), frameInfo.start_ip, functionName, sp, frameInfo.lsda, frameInfo.handler); } // If there is a personality routine, tell it we are unwinding. if (frameInfo.handler != 0) { _Unwind_Personality_Fn p = (_Unwind_Personality_Fn)(long)(frameInfo.handler); struct _Unwind_Context *context = (struct _Unwind_Context *)(cursor); // EHABI #7.2 exception_object->pr_cache.fnstart = frameInfo.start_ip; exception_object->pr_cache.ehtp = (_Unwind_EHT_Header *)frameInfo.unwind_info; exception_object->pr_cache.additional = frameInfo.flags; _Unwind_Reason_Code personalityResult = (*p)(state, exception_object, context); switch (personalityResult) { case _URC_CONTINUE_UNWIND: // Continue unwinding _LIBUNWIND_TRACE_UNWINDING( "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND", static_cast<void *>(exception_object)); // EHABI #7.2 if (sp == exception_object->barrier_cache.sp) { // Phase 1 said we would stop at this frame, but we did not... _LIBUNWIND_ABORT("during phase1 personality function said it would " "stop here, but now in phase2 it did not stop here"); } break; case _URC_INSTALL_CONTEXT: _LIBUNWIND_TRACE_UNWINDING( "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT", static_cast<void *>(exception_object)); // Personality routine says to transfer control to landing pad. // We may get control back if landing pad calls _Unwind_Resume(). if (_LIBUNWIND_TRACING_UNWINDING) { unw_word_t pc; __unw_get_reg(cursor, UNW_REG_IP, &pc); __unw_get_reg(cursor, UNW_REG_SP, &sp); _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering " "user code with ip=0x%" PRIxPTR ", sp=0x%" PRIxPTR, static_cast<void *>(exception_object), pc, sp); } { // EHABI #7.4.1 says we need to preserve pc for when _Unwind_Resume // is called back, to find this same frame. unw_word_t pc; __unw_get_reg(cursor, UNW_REG_IP, &pc); exception_object->unwinder_cache.reserved2 = (uint32_t)pc; } __unw_resume(cursor); // __unw_resume() only returns if there was an error. return _URC_FATAL_PHASE2_ERROR; // # EHABI #7.4.3 case _URC_FAILURE: abort(); default: // Personality routine returned an unknown result code. _LIBUNWIND_DEBUG_LOG("personality function returned unknown result %d", personalityResult); return _URC_FATAL_PHASE2_ERROR; } } frame_count++; } // Clean up phase did not resume at the frame that the search phase // said it would... return _URC_FATAL_PHASE2_ERROR; } /// Called by __cxa_throw. Only returns if there is a fatal error. _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception *exception_object) { _LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)", static_cast<void *>(exception_object)); unw_context_t uc; unw_cursor_t cursor; __unw_getcontext(&uc); // This field for is for compatibility with GCC to say this isn't a forced // unwind. EHABI #7.2 exception_object->unwinder_cache.reserved1 = 0; // phase 1: the search phase _Unwind_Reason_Code phase1 = unwind_phase1(&uc, &cursor, exception_object); if (phase1 != _URC_NO_REASON) return phase1; // phase 2: the clean up phase return unwind_phase2(&uc, &cursor, exception_object, false); } _LIBUNWIND_EXPORT void _Unwind_Complete(_Unwind_Exception* exception_object) { // This is to be called when exception handling completes to give us a chance // to perform any housekeeping. EHABI #7.2. But we have nothing to do here. (void)exception_object; } /// When _Unwind_RaiseException() is in phase2, it hands control /// to the personality function at each frame. The personality /// may force a jump to a landing pad in that function, the landing /// pad code may then call _Unwind_Resume() to continue with the /// unwinding. Note: the call to _Unwind_Resume() is from compiler /// geneated user code. All other _Unwind_* routines are called /// by the C++ runtime __cxa_* routines. /// /// Note: re-throwing an exception (as opposed to continuing the unwind) /// is implemented by having the code call __cxa_rethrow() which /// in turn calls _Unwind_Resume_or_Rethrow(). _LIBUNWIND_EXPORT void _Unwind_Resume(_Unwind_Exception *exception_object) { _LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)", static_cast<void *>(exception_object)); unw_context_t uc; unw_cursor_t cursor; __unw_getcontext(&uc); // _Unwind_RaiseException on EHABI will always set the reserved1 field to 0, // which is in the same position as private_1 below. // TODO(ajwong): Who wronte the above? Why is it true? unwind_phase2(&uc, &cursor, exception_object, true); // Clients assume _Unwind_Resume() does not return, so all we can do is abort. _LIBUNWIND_ABORT("_Unwind_Resume() can't return"); } /// Called by personality handler during phase 2 to get LSDA for current frame. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { unw_cursor_t *cursor = (unw_cursor_t *)context; unw_proc_info_t frameInfo; uintptr_t result = 0; if (__unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS) result = (uintptr_t)frameInfo.lsda; _LIBUNWIND_TRACE_API( "_Unwind_GetLanguageSpecificData(context=%p) => 0x%llx", static_cast<void *>(context), (long long)result); return result; } static uint64_t ValueAsBitPattern(_Unwind_VRS_DataRepresentation representation, void* valuep) { uint64_t value = 0; switch (representation) { case _UVRSD_UINT32: case _UVRSD_FLOAT: memcpy(&value, valuep, sizeof(uint32_t)); break; case _UVRSD_VFPX: case _UVRSD_UINT64: case _UVRSD_DOUBLE: memcpy(&value, valuep, sizeof(uint64_t)); break; } return value; } _LIBUNWIND_EXPORT _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, uint32_t regno, _Unwind_VRS_DataRepresentation representation, void *valuep) { _LIBUNWIND_TRACE_API("_Unwind_VRS_Set(context=%p, regclass=%d, reg=%d, " "rep=%d, value=0x%llX)", static_cast<void *>(context), regclass, regno, representation, ValueAsBitPattern(representation, valuep)); unw_cursor_t *cursor = (unw_cursor_t *)context; switch (regclass) { case _UVRSC_CORE: if (representation != _UVRSD_UINT32 || regno > 15) return _UVRSR_FAILED; return __unw_set_reg(cursor, (unw_regnum_t)(UNW_ARM_R0 + regno), *(unw_word_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; case _UVRSC_VFP: if (representation != _UVRSD_VFPX && representation != _UVRSD_DOUBLE) return _UVRSR_FAILED; if (representation == _UVRSD_VFPX) { // Can only touch d0-15 with FSTMFDX. if (regno > 15) return _UVRSR_FAILED; __unw_save_vfp_as_X(cursor); } else { if (regno > 31) return _UVRSR_FAILED; } return __unw_set_fpreg(cursor, (unw_regnum_t)(UNW_ARM_D0 + regno), *(unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; #if defined(__ARM_WMMX) case _UVRSC_WMMXC: if (representation != _UVRSD_UINT32 || regno > 3) return _UVRSR_FAILED; return __unw_set_reg(cursor, (unw_regnum_t)(UNW_ARM_WC0 + regno), *(unw_word_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; case _UVRSC_WMMXD: if (representation != _UVRSD_DOUBLE || regno > 31) return _UVRSR_FAILED; return __unw_set_fpreg(cursor, (unw_regnum_t)(UNW_ARM_WR0 + regno), *(unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; #else case _UVRSC_WMMXC: case _UVRSC_WMMXD: break; #endif } _LIBUNWIND_ABORT("unsupported register class"); } static _Unwind_VRS_Result _Unwind_VRS_Get_Internal(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, uint32_t regno, _Unwind_VRS_DataRepresentation representation, void *valuep) { unw_cursor_t *cursor = (unw_cursor_t *)context; switch (regclass) { case _UVRSC_CORE: if (representation != _UVRSD_UINT32 || regno > 15) return _UVRSR_FAILED; return __unw_get_reg(cursor, (unw_regnum_t)(UNW_ARM_R0 + regno), (unw_word_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; case _UVRSC_VFP: if (representation != _UVRSD_VFPX && representation != _UVRSD_DOUBLE) return _UVRSR_FAILED; if (representation == _UVRSD_VFPX) { // Can only touch d0-15 with FSTMFDX. if (regno > 15) return _UVRSR_FAILED; __unw_save_vfp_as_X(cursor); } else { if (regno > 31) return _UVRSR_FAILED; } return __unw_get_fpreg(cursor, (unw_regnum_t)(UNW_ARM_D0 + regno), (unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; #if defined(__ARM_WMMX) case _UVRSC_WMMXC: if (representation != _UVRSD_UINT32 || regno > 3) return _UVRSR_FAILED; return __unw_get_reg(cursor, (unw_regnum_t)(UNW_ARM_WC0 + regno), (unw_word_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; case _UVRSC_WMMXD: if (representation != _UVRSD_DOUBLE || regno > 31) return _UVRSR_FAILED; return __unw_get_fpreg(cursor, (unw_regnum_t)(UNW_ARM_WR0 + regno), (unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; #else case _UVRSC_WMMXC: case _UVRSC_WMMXD: break; #endif } _LIBUNWIND_ABORT("unsupported register class"); } _LIBUNWIND_EXPORT _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, uint32_t regno, _Unwind_VRS_DataRepresentation representation, void *valuep) { _Unwind_VRS_Result result = _Unwind_VRS_Get_Internal(context, regclass, regno, representation, valuep); _LIBUNWIND_TRACE_API("_Unwind_VRS_Get(context=%p, regclass=%d, reg=%d, " "rep=%d, value=0x%llX, result = %d)", static_cast<void *>(context), regclass, regno, representation, ValueAsBitPattern(representation, valuep), result); return result; } _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, uint32_t discriminator, _Unwind_VRS_DataRepresentation representation) { _LIBUNWIND_TRACE_API("_Unwind_VRS_Pop(context=%p, regclass=%d, " "discriminator=%d, representation=%d)", static_cast<void *>(context), regclass, discriminator, representation); switch (regclass) { case _UVRSC_WMMXC: #if !defined(__ARM_WMMX) break; #endif case _UVRSC_CORE: { if (representation != _UVRSD_UINT32) return _UVRSR_FAILED; // When popping SP from the stack, we don't want to override it from the // computed new stack location. See EHABI #7.5.4 table 3. bool poppedSP = false; uint32_t* sp; if (_Unwind_VRS_Get(context, _UVRSC_CORE, UNW_ARM_SP, _UVRSD_UINT32, &sp) != _UVRSR_OK) { return _UVRSR_FAILED; } for (uint32_t i = 0; i < 16; ++i) { if (!(discriminator & static_cast<uint32_t>(1 << i))) continue; uint32_t value = *sp++; if (regclass == _UVRSC_CORE && i == 13) poppedSP = true; if (_Unwind_VRS_Set(context, regclass, i, _UVRSD_UINT32, &value) != _UVRSR_OK) { return _UVRSR_FAILED; } } if (!poppedSP) { return _Unwind_VRS_Set(context, _UVRSC_CORE, UNW_ARM_SP, _UVRSD_UINT32, &sp); } return _UVRSR_OK; } case _UVRSC_WMMXD: #if !defined(__ARM_WMMX) break; #endif case _UVRSC_VFP: { if (representation != _UVRSD_VFPX && representation != _UVRSD_DOUBLE) return _UVRSR_FAILED; uint32_t first = discriminator >> 16; uint32_t count = discriminator & 0xffff; uint32_t end = first+count; uint32_t* sp; if (_Unwind_VRS_Get(context, _UVRSC_CORE, UNW_ARM_SP, _UVRSD_UINT32, &sp) != _UVRSR_OK) { return _UVRSR_FAILED; } // For _UVRSD_VFPX, we're assuming the data is stored in FSTMX "standard // format 1", which is equivalent to FSTMD + a padding word. for (uint32_t i = first; i < end; ++i) { // SP is only 32-bit aligned so don't copy 64-bit at a time. uint64_t w0 = *sp++; uint64_t w1 = *sp++; #ifdef __LITTLE_ENDIAN__ uint64_t value = (w1 << 32) | w0; #else uint64_t value = (w0 << 32) | w1; #endif if (_Unwind_VRS_Set(context, regclass, i, representation, &value) != _UVRSR_OK) return _UVRSR_FAILED; } if (representation == _UVRSD_VFPX) ++sp; return _Unwind_VRS_Set(context, _UVRSC_CORE, UNW_ARM_SP, _UVRSD_UINT32, &sp); } } _LIBUNWIND_ABORT("unsupported register class"); } /// Called by personality handler during phase 2 to find the start of the /// function. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context) { unw_cursor_t *cursor = (unw_cursor_t *)context; unw_proc_info_t frameInfo; uintptr_t result = 0; if (__unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS) result = (uintptr_t)frameInfo.start_ip; _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%llX", static_cast<void *>(context), (long long)result); return result; } /// Called by personality handler during phase 2 if a foreign exception // is caught. _LIBUNWIND_EXPORT void _Unwind_DeleteException(_Unwind_Exception *exception_object) { _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)", static_cast<void *>(exception_object)); if (exception_object->exception_cleanup != NULL) (*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT, exception_object); } extern "C" _LIBUNWIND_EXPORT _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception *exception_object, struct _Unwind_Context *context) { unw_cursor_t *cursor = (unw_cursor_t *)context; if (__unw_step(cursor) != UNW_STEP_SUCCESS) return _URC_FAILURE; return _URC_OK; } #endif // defined(_LIBUNWIND_ARM_EHABI)
{ "content_hash": "6640f19466457d5f841360e39e4df8e3", "timestamp": "", "source": "github", "line_count": 999, "max_line_length": 93, "avg_line_length": 36.747747747747745, "alnum_prop": 0.5726893846531013, "repo_name": "endlessm/chromium-browser", "id": "a8a64cbfd7e5e3c7f91dcee91adeffe73eb0ec76", "size": "36711", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "third_party/llvm/libunwind/src/Unwind-EHABI.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
namespace Tiny3D { namespace Math { void Plane::Define(const Vector3& v0, const Vector3& v1, const Vector3& v2) { Vector3 dist1 = v1 - v0; Vector3 dist2 = v2 - v0; Define(dist1.CrossProduct(dist2), v0); } /// Define from a normal vector and a point on the plane. void Plane::Define(const Vector3& normal, const Vector3& point) { normal_ = normal.Normal(); d_ = -normal_.DotProduct(point); } } }
{ "content_hash": "a8892cb0ada936d49af4baf2385578e5", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 75, "avg_line_length": 20.95, "alnum_prop": 0.665871121718377, "repo_name": "stievie/Tiny3D", "id": "1d6be590043d352ef9a4d5551694274e8872409d", "size": "459", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Tiny3D/Plane.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "535" }, { "name": "C", "bytes": "261149" }, { "name": "C++", "bytes": "1515132" }, { "name": "CMake", "bytes": "4450" }, { "name": "HLSL", "bytes": "14827" }, { "name": "Objective-C", "bytes": "404909" }, { "name": "Python", "bytes": "72976" } ], "symlink_target": "" }
use std::io::{Read, Write, BufRead, BufStream, self}; use std::mem; use std::collections::BTreeMap; use std::u16; use std::num::{Int, FromPrimitive, ToPrimitive}; use std::slice::SliceConcatExt; use url::Url; use rand::{thread_rng, Rng}; use nonce::Nonce; use message::{WSMessage, WSHeader, WS_MASK, WS_LEN, WS_LEN16, WS_LEN64, WS_OPTERM}; use stream::NetworkStream; pub struct WebSocket<S = NetworkStream> { stream: Option<BufStream<S>>, pub url: Url, hostname: String, use_ssl: bool, version: u32, extensions: Option<Vec<String>>, protocols: Option<Vec<String>> } impl WebSocket { pub fn with_options(url: Url, version: u32, protocols: Option<&[&str]>, extensions: Option<&[&str]>) -> WebSocket { let use_ssl = &*url.scheme == "wss"; let port = match url.port() { Some(p) => p, None if use_ssl => 443, _ => 80 }; WebSocket { stream: None, hostname: format!("{}:{}", url.serialize_host().unwrap(), port), url: url, use_ssl: use_ssl, version: version, extensions: extensions.map(|v| v.iter().map(|v| v.to_string()).collect()), protocols: protocols.map(|v| v.iter().map(|v| v.to_string()).collect()) } } #[inline] pub fn new(url: Url) -> WebSocket { WebSocket::with_options(url, 1, None, None) } fn try_connect(&mut self) -> io::Result<()> { self.stream = Some(BufStream::new(try!(NetworkStream::connect(&*self.hostname, self.use_ssl)))); Ok(()) } fn write_request(&mut self, nonce: &str) -> io::Result<()> { let s = match self.stream { Some(ref mut s) => s, None => return Err(io::Error::new(io::ErrorKind::NotConnected, "client not connected", None)) }; try!(write!(s, "GET {} HTTP/1.1\r\n", self.url.serialize_path().unwrap_or("/".to_string()))); try!(write!(s, "Host: {}\r\n", self.url.host().unwrap())); try!(write!(s, "Origin: {}\r\n", self.url.serialize_no_fragment())); try!(write!(s, "Sec-WebSocket-Key: {}\r\n", nonce)); try!(s.write_all(b"Upgrade: websocket\r\n")); try!(s.write_all(b"Connection: Upgrade\r\n")); try!(write!(s, "Sec-WebSocket-Version: {}\r\n", self.version)); if let Some(ref protos) = self.protocols { try!(write!(s, "Sec-WebSocket-Protocol: {}\r\n", protos.connect(", "))); } if let Some(ref exts) = self.extensions { try!(write!(s, "Sec-WebSocket-Extensions: {}\r\n", exts.connect(", "))); } try!(s.write_all(b"\r\n")); s.flush() } fn read_response(&mut self, nonce: &str) -> io::Result<()> { let spaces: &[_] = &[' ', '\t', '\r', '\n']; let s = match self.stream { Some(ref mut s) => s, None => return Err(io::Error::new(io::ErrorKind::NotConnected, "client not connected", None)) }; let mut lines = s.lines(); let status = match lines.next() { Some(Ok(line)) => line.splitn(2, ' ').nth(1).and_then(|s| s.parse::<u16>().ok()), Some(Err(e)) => return Err(e), None => return Err(io::Error::new(io::ErrorKind::InvalidInput, "missing response status", None)) }; match status { Some(101) => (), _ => return Err(io::Error::new(io::ErrorKind::InvalidInput, "invalid response status", None)) } let headers = lines.map(|r| r.unwrap_or("\r\n".to_string())) .take_while(|l| &**l != "\r\n") .map(|s| s.splitn(1, ':').map(|s| s.trim_matches(spaces).to_string()).collect::<Vec<String>>()) .map(|p| (p[0].to_string(), p[1].to_string())) .collect::<BTreeMap<String, String>>(); try!(s.flush()); let response = headers.get("Sec-WebSocket-Accept"); match response { Some(r) if nonce == *r => (), _ => return Err(io::Error::new(io::ErrorKind::InvalidInput, "missing Sec-WebSocket-Accept header in response", None)) } Ok(()) } pub fn connect(&mut self) -> io::Result<()> { let mut nonce = Nonce::new(); try!(self.try_connect()); try!(self.write_request(&*nonce)); nonce = nonce.encode(); try!(self.read_response(&*nonce)); Ok(()) } fn read_header(&mut self) -> io::Result<WSHeader> { let h: u16; try!(self.read(mem::transmute(h))); Ok(WSHeader::from_bits_truncate(h.to_le())) } fn read_length(&mut self, header: &WSHeader) -> io::Result<u64> { let wslen = *header & WS_LEN; if wslen == WS_LEN16 { self.read_be_u16().map(|v| v as u64) } else if wslen == WS_LEN64 { self.read_be_u64() } else { Ok(wslen.bits() as u64) } } pub fn read_message(&mut self) -> io::Result<WSMessage> { let header = try!(self.read_header()); let mut len = try!(self.read_length(&header)); let mask = if header.contains(WS_MASK) { Some(try!(self.read_be_u32())) } else { None }; // If this is the terminating frame (close command), // first two bytes of data MUST BE u16 status code let mut status = if header.contains(WS_OPTERM) { // compensate length of status code len = len - 2; Some(try!(self.read_be_u16())) } else { None }; let mut data = try!(self.read_exact(len as usize)); // If we have mask, decrypt data if let Some(mut m) = mask { // decrypt status if present if let Some(s) = status { status = Some(s ^ (m & 0xffff) as u16); // compensate the usage of two mask bytes m = m.rotate_right(16); } data = WebSocket::mask_data(&*data, m); } Ok(WSMessage { header: header, data: data, status: status.and_then(FromPrimitive::from_u16) }) } fn mask_data(data: &[u8], mask: u32) -> Vec<u8> { data.iter().enumerate().map(|(i, b)| *b ^ (mask >> ((i % 4) << 3) & 0xff) as u8).collect::<Vec<u8>>() } pub fn send_message(&mut self, msg: &WSMessage) -> io::Result<()> { let mut len = msg.data.len() as u64; let mut hdr = msg.header - WS_LEN; // If we have status set, the data length is increased by status size if msg.status.is_some() { len = len + 2; } // Encode and send length along with header if len < WS_LEN16.bits() as u64 { hdr = hdr | WSHeader::from_bits_truncate(len as u16 & WS_LEN.bits()); try!(self.write_all(mem::transmute(hdr.bits().to_be()))); } else if len < u16::MAX as u64 { hdr = hdr | WS_LEN16; try!(self.write_all(mem::transmute(hdr.bits().to_be()))); try!(self.write_all(mem::transmute(len as u16))); } else { hdr = hdr | WS_LEN64; try!(self.write_all(mem::transmute(hdr.bits().to_be()))); try!(self.write_all(mem::transmute((len as u64).to_be()))); } // If user required masking, encrypt all data if hdr.contains(WS_MASK) { // Generate and send random mask let mut mask = thread_rng().gen::<u32>(); try!(self.write_all(mem::transmute(mask.to_be()))); // Encrypt status code if present if let Some(status) = msg.status { try!(self.write_all(mem::transmute((status.to_u16().unwrap() ^ (mask & 0xffff) as u16).to_be()))); // compensate for mask already used for status encryption mask = mask.rotate_right(16); } try!(self.write_all(&*WebSocket::mask_data(&*msg.data, mask))); } else { // Send status code if present if let Some(status) = msg.status { try!(self.write_all(mem::transmute(status.to_u16().unwrap().to_be()))); } try!(self.write_all(&*msg.data)); } self.flush() } pub fn iter(&mut self) -> WSMessages { WSMessages { sock: self } } } impl Read for WebSocket { fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { match self.stream { Some(ref mut s) => s.read(buf), None => Err(io::Error::new(io::ErrorKind::NotConnected, "client not connected", None)) } } } impl Write for WebSocket { fn write(&mut self, buf: &[u8]) -> io::Result<usize> { match self.stream { Some(ref mut s) => s.write(buf), None => Err(io::Error::new(io::ErrorKind::NotConnected, "client not connected", None)) } } fn flush(&mut self) -> io::Result<()> { match self.stream { Some(ref mut s) => s.flush(), None => Err(io::Error::new(io::ErrorKind::NotConnected, "client not connected", None)) } } } impl BufRead for WebSocket { fn fill_buf<'a>(&'a mut self) -> io::Result<&'a [u8]> { match self.stream { Some(ref mut s) => s.fill_buf(), None => Err(io::Error::new(io::ErrorKind::NotConnected, "client not connected", None)) } } fn consume(&mut self, amt: usize) { match self.stream { Some(ref mut s) => s.consume(amt), None => () } } } pub struct WSMessages<'a> { sock: &'a mut WebSocket } pub struct WSDefragMessages<'a> { underlying: &'a mut WSMessages<'a>, buffer: WSMessage } impl<'a> WSMessages<'a> { pub fn defrag(&'a mut self) -> WSDefragMessages<'a> { WSDefragMessages{ underlying: self, buffer: WSMessage{ header: WSHeader::empty(), data: Vec::new(), status: None } } } } impl<'a> Iterator for WSMessages<'a> { type Item = WSMessage; fn next(&mut self) -> Option<WSMessage> { self.sock.read_message().ok() } } impl<'a> WSDefragMessages<'a> { fn popbuf(&mut self) -> Option<WSMessage> { if self.buffer.data.is_empty() { None } else { let mut buf = WSMessage{ header: WSHeader::empty(), data: Vec::new(), status: None }; mem::swap(&mut self.buffer, &mut buf); Some(buf) } } fn swapbuf(&mut self, msg: &mut WSMessage) { mem::swap(&mut self.buffer, msg); } } impl<'a> Iterator for WSDefragMessages<'a> { type Item = WSMessage; fn next(&mut self) -> Option<WSMessage> { loop { match self.underlying.next() { None => return self.popbuf(), Some(mut msg) => { if msg.is_whole() { return Some(msg); } else if msg.is_first() { self.swapbuf(&mut msg); } else if msg.is_more() { self.buffer.push(msg); } else if msg.is_last() { self.buffer.push(msg); return self.popbuf().map(|v| v.last()); } } } } } }
{ "content_hash": "d82ad7623868f55b3c99ecfdd2bbc264", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 154, "avg_line_length": 33.88145896656535, "alnum_prop": 0.5196913967883735, "repo_name": "kstep/rust-bare-websocket", "id": "6b36ce5d23545be0a48e3e194904b7efe96be2e2", "size": "11147", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/socket.rs", "mode": "33188", "license": "mit", "language": [ { "name": "Rust", "bytes": "25097" } ], "symlink_target": "" }
define({ "_widgetLabel": "Kiinteistöjen luonnostelu", "newTraverseButtonLabel": "Aloita uusi läpikäynti", "invalidConfigMsg": "Virheellinen määritys", "geometryServiceURLNotFoundMSG": "Geometriapalvelun URL-osoitetta ei voi noutaa", "editTraverseButtonLabel": "Muokkaa läpikäyntiä", "mapTooltipForStartNewTraverse": "Aloita valitsemalla kartalta piste tai kirjoittamalla alle", "mapTooltipForEditNewTraverse": "Valitse muokattava kiinteistö", "mapTooltipForUpdateStartPoint": "Päivitä aloituspiste napsauttamalla", "mapTooltipForScreenDigitization": "Lisää kiinteistön piste napsauttamalla", "mapTooltipForUpdatingRotaionPoint": "Päivitä kiertopiste napsauttamalla", "mapTooltipForRotate": "Käännä vetämällä", "mapTooltipForScale": "Muuta mittakaavaa vetämällä", "backButtonTooltip": "Takaisin", "newTraverseTitle": "Uusi läpikäynti", "editTraverseTitle": "Muokkaa läpikäyntiä", "clearingDataConfirmationMessage": "Muutokset hylätään. Haluatko jatkaa?", "unableToFetchParcelMessage": "Kiinteistön tietoja ei voi noutaa.", "unableToFetchParcelLinesMessage": "Kiinteistön viivoja ei voi noutaa.", "planSettings": { "planSettingsTitle": "Asetukset", "directionOrAngleTypeLabel": "Suunta- tai kulmatyyppi", "directionOrAngleUnitsLabel": "Suunta- tai kulmayksiköt", "distanceAndLengthUnitsLabel": "Etäisyys- ja pituusyksiköt", "areaUnitsLabel": "Pinta-alayksiköt", "circularCurveParameters": "Ympyränmuotoisen kaaren parametrit", "northAzimuth": "Pohjoinen-kompassisuunta", "southAzimuth": "Etelä-kompassisuunta", "quadrantBearing": "Kvadranttisuuntima", "radiusAndChordLength": "Säde ja puoliympyrän pituus", "radiusAndArcLength": "Säde ja kaaren pituus", "expandGridTooltipText": "Laajenna ruudukko", "collapseGridTooltipText": "Tiivistä ruudukko", "zoomToLocationTooltipText": "Tarkenna sijaintiin", "onScreenDigitizationTooltipText": "Digitoi", "updateRotationPointTooltipText": "Päivitä kiertopiste" }, "traverseSettings": { "bearingLabel": "Suuntima", "lengthLabel": "Pituus", "radiusLabel": "Säde", "noMiscloseCalculated": "Epäsulkua ei ole laskettu", "traverseMiscloseBearing": "Epäsulkusuuntima", "traverseAccuracy": "Tarkkuus", "accuracyHigh": "Suuri", "traverseDistance": "Epäsulkuetäisyys", "traverseMiscloseRatio": "Epäsulkusuhde", "traverseStatedArea": "Ilmoitettu alue", "traverseCalculatedArea": "Laskettu alue", "addButtonTitle": "Lisää", "deleteButtonTitle": "Poista" }, "parcelTools": { "rotationToolLabel": "Kulma", "scaleToolLabel": "Mittakaava" }, "newTraverse": { "invalidBearingMessage": "Virheellinen suuntima.", "invalidLengthMessage": "Virheellinen pituus.", "invalidRadiusMessage": "Virheellinen säde.", "negativeLengthMessage": "Kelpaa vain kaarteissa", "enterValidValuesMessage": "Anna kelvolliset arvot.", "enterValidParcelInfoMessage": "Anna tallennettavat kelvolliset kiinteistötiedot.", "unableToDrawLineMessage": "Viivaa ei voi piirtää.", "invalidEndPointMessage": "Virheellinen päätepiste. Viivaa ei voi piirtää.", "lineTypeLabel": "Viivatyyppi" }, "planInfo": { "requiredText": "(pakollinen)", "optionalText": "(valinnainen)", "parcelNamePlaceholderText": "Kiinteistön nimi", "parcelDocumentTypeText": "Dokumenttityyppi", "planNamePlaceholderText": "Suunnitelman nimi", "cancelButtonLabel": "Peruuta", "saveButtonLabel": "Tallenna", "saveNonClosedParcelConfirmationMessage": "Annettua kiinteistöä ei ole suljettu. Haluatko silti jatkaa ja tallentaa vain kiinteistön viivat?", "unableToCreatePolygonParcel": "Kiinteistön aluetta ei voi luoda.", "unableToSavePolygonParcel": "Kiinteistön aluetta ei voi tallentaa.", "unableToSaveParcelLines": "Kiinteistön viivoja ei voi tallentaa.", "unableToUpdateParcelLines": "Kiinteistön viivoja ei voi päivittää.", "parcelSavedSuccessMessage": "Kiinteistö on tallennettu.", "parcelDeletedSuccessMessage": "Kiinteistö on poistettu.", "parcelDeleteErrorMessage": "Virhe kiinteistön poistossa.", "enterValidParcelNameMessage": "Kirjoita kelvollinen kiinteistön nimi.", "enterValidPlanNameMessage": "Kirjoita kelvollinen suunnitelman nimi.", "enterValidDocumentTypeMessage": "Virheellinen dokumenttityyppi.", "enterValidStatedAreaNameMessage": "Anna kelvollinen sovittu alue." }, "xyInput": { "explanation": "Syötä koordinaatit, joiden koordinaatistotieto on sama kuin karttatasolla" } });
{ "content_hash": "13bbb7f3738c2b440b90092385220538", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 146, "avg_line_length": 49.5, "alnum_prop": 0.7476943346508564, "repo_name": "tmcgee/cmv-wab-widgets", "id": "a4e0f53d04378aafbbaeafdc09f583f39e464038", "size": "5385", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "wab/2.15/widgets/ParcelDrafter/nls/fi/strings.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1198579" }, { "name": "HTML", "bytes": "946685" }, { "name": "JavaScript", "bytes": "22190423" }, { "name": "Pascal", "bytes": "4207" }, { "name": "TypeScript", "bytes": "102918" } ], "symlink_target": "" }
package com.bpl.tucao.dto; /** * @author cuiyongdai * @desc * @date 2017/8/10 0010. */ public class HotCommentDto { private Integer hotId; private Integer userId; private String nickName; private String content; public Integer getHotId() { return hotId; } public void setHotId(Integer hotId) { this.hotId = hotId; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } public String getNickName() { return nickName; } public void setNickName(String nickName) { this.nickName = nickName; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } }
{ "content_hash": "9690fadb158fdbb0f9c04a0dbf808f32", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 46, "avg_line_length": 17.82608695652174, "alnum_prop": 0.6048780487804878, "repo_name": "vanroid/bpl-server", "id": "6b5bd43bc2aa1b265158d23a6e6e4d93f8a550e1", "size": "820", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/bpl/tucao/dto/HotCommentDto.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "3753" }, { "name": "ApacheConf", "bytes": "768" }, { "name": "Batchfile", "bytes": "6110" }, { "name": "CSS", "bytes": "943463" }, { "name": "HTML", "bytes": "2574074" }, { "name": "Java", "bytes": "1461629" }, { "name": "JavaScript", "bytes": "8809000" }, { "name": "PHP", "bytes": "8060" }, { "name": "PLSQL", "bytes": "73251" }, { "name": "PLpgSQL", "bytes": "4867" } ], "symlink_target": "" }
package org.bridje.orm.srcgen.model; import javax.xml.bind.Unmarshaller; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlTransient; /** * Information about a negated condition with an "and" operator. */ @XmlAccessorType(XmlAccessType.FIELD) public class AndNotStmt extends ConditionStmt { @XmlTransient private ConditionStmt parent; @Override public boolean isNot() { return true; } @Override public String getBooleanOperator() { return "and"; } /** * The previous condition of this condition. * * @return The previous condition of this condition. */ public ConditionStmt getParent() { return parent; } void afterUnmarshal(Unmarshaller u, Object parent) { this.parent = (ConditionStmt)parent; } @Override public QueryInf getQuery() { return getParent().getQuery(); } @Override public ConditionStmt clone(QueryInf query, ConditionStmt parent) { AndNotStmt result = new AndNotStmt(); super.clone(result, query); result.parent = parent; return result; } }
{ "content_hash": "7fc2089848737dbe5fa07cd95042864d", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 68, "avg_line_length": 20.8, "alnum_prop": 0.6522435897435898, "repo_name": "bridje/bridje-framework", "id": "d14223206f057f5f832a50d90fc7cb8613af1262", "size": "1849", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "bridje-orm-srcgen/src/main/java/org/bridje/orm/srcgen/model/AndNotStmt.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "70694" }, { "name": "HTML", "bytes": "433" }, { "name": "Java", "bytes": "1340500" }, { "name": "JavaScript", "bytes": "5450" } ], "symlink_target": "" }
package lumberjack import ( "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "testing" "time" "github.com/flynn/flynn/Godeps/_workspace/src/github.com/BurntSushi/toml" "gopkg.in/yaml.v1" ) // !!!NOTE!!! // // Running these tests in parallel will almost certainly cause sporadic (or even // regular) failures, because they're all messing with the same global variable // that controls the logic's mocked time.Now. So... don't do that. // Since all the tests uses the time to determine filenames etc, we need to // control the wall clock as much as possible, which means having a wall clock // that doesn't change unless we want it to. var fakeCurrentTime = time.Now() func fakeTime() time.Time { return fakeCurrentTime } func TestNewFile(t *testing.T) { currentTime = fakeTime dir := makeTempDir("TestNewFile", t) defer os.RemoveAll(dir) l := &Logger{ Filename: logFile(dir), } defer l.Close() b := []byte("boo!") n, err := l.Write(b) isNil(err, t) equals(len(b), n, t) existsWithLen(logFile(dir), n, t) fileCount(dir, 1, t) } func TestOpenExisting(t *testing.T) { currentTime = fakeTime dir := makeTempDir("TestOpenExisting", t) defer os.RemoveAll(dir) filename := logFile(dir) data := []byte("foo!") err := ioutil.WriteFile(filename, data, 0644) isNil(err, t) existsWithLen(filename, len(data), t) l := &Logger{ Filename: filename, } defer l.Close() b := []byte("boo!") n, err := l.Write(b) isNil(err, t) equals(len(b), n, t) // make sure the file got appended existsWithLen(filename, len(data)+n, t) // make sure no other files were created fileCount(dir, 1, t) } func TestWriteTooLong(t *testing.T) { currentTime = fakeTime megabyte = 1 dir := makeTempDir("TestWriteTooLong", t) defer os.RemoveAll(dir) l := &Logger{ Filename: logFile(dir), MaxSize: 5, } defer l.Close() b := []byte("booooooooooooooo!") n, err := l.Write(b) notNil(err, t) equals(0, n, t) equals(err.Error(), fmt.Sprintf("write length %d exceeds maximum file size %d", len(b), l.MaxSize), t) _, err = os.Stat(logFile(dir)) assert(os.IsNotExist(err), t, "File exists, but should not have been created") } func TestMakeLogDir(t *testing.T) { currentTime = fakeTime dir := time.Now().Format("TestMakeLogDir" + backupTimeFormat) dir = filepath.Join(os.TempDir(), dir) defer os.RemoveAll(dir) filename := logFile(dir) l := &Logger{ Filename: filename, } defer l.Close() b := []byte("boo!") n, err := l.Write(b) isNil(err, t) equals(len(b), n, t) existsWithLen(logFile(dir), n, t) fileCount(dir, 1, t) } func TestDefaultFilename(t *testing.T) { currentTime = fakeTime dir := os.TempDir() filename := filepath.Join(dir, filepath.Base(os.Args[0])+"-lumberjack.log") defer os.Remove(filename) l := &Logger{} defer l.Close() b := []byte("boo!") n, err := l.Write(b) isNil(err, t) equals(len(b), n, t) existsWithLen(filename, n, t) } func TestAutoRotate(t *testing.T) { currentTime = fakeTime megabyte = 1 dir := makeTempDir("TestAutoRotate", t) defer os.RemoveAll(dir) filename := logFile(dir) l := &Logger{ Filename: filename, MaxSize: 10, } defer l.Close() b := []byte("boo!") n, err := l.Write(b) isNil(err, t) equals(len(b), n, t) existsWithLen(filename, n, t) fileCount(dir, 1, t) newFakeTime() b2 := []byte("foooooo!") n, err = l.Write(b2) isNil(err, t) equals(len(b2), n, t) // the old logfile should be moved aside and the main logfile should have // only the last write in it. existsWithLen(filename, n, t) // the backup file will use the current fake time and have the old contents. existsWithLen(backupFile(dir), len(b), t) fileCount(dir, 2, t) } func TestFirstWriteRotate(t *testing.T) { currentTime = fakeTime megabyte = 1 dir := makeTempDir("TestFirstWriteRotate", t) defer os.RemoveAll(dir) filename := logFile(dir) l := &Logger{ Filename: filename, MaxSize: 10, } defer l.Close() start := []byte("boooooo!") err := ioutil.WriteFile(filename, start, 0600) isNil(err, t) newFakeTime() // this would make us rotate b := []byte("fooo!") n, err := l.Write(b) isNil(err, t) equals(len(b), n, t) existsWithLen(filename, n, t) existsWithLen(backupFile(dir), len(start), t) fileCount(dir, 2, t) } func TestMaxBackups(t *testing.T) { currentTime = fakeTime megabyte = 1 dir := makeTempDir("TestMaxBackups", t) defer os.RemoveAll(dir) filename := logFile(dir) l := &Logger{ Filename: filename, MaxSize: 10, MaxBackups: 1, } defer l.Close() b := []byte("boo!") n, err := l.Write(b) isNil(err, t) equals(len(b), n, t) existsWithLen(filename, n, t) fileCount(dir, 1, t) newFakeTime() // this will put us over the max b2 := []byte("foooooo!") n, err = l.Write(b2) isNil(err, t) equals(len(b2), n, t) // this will use the new fake time secondFilename := backupFile(dir) existsWithLen(secondFilename, len(b), t) // make sure the old file still exists with the same size. existsWithLen(filename, n, t) fileCount(dir, 2, t) newFakeTime() // this will make us rotate again n, err = l.Write(b2) isNil(err, t) equals(len(b2), n, t) // this will use the new fake time thirdFilename := backupFile(dir) existsWithLen(thirdFilename, len(b2), t) existsWithLen(filename, n, t) // we need to wait a little bit since the files get deleted on a different // goroutine. <-time.After(time.Millisecond * 10) // should only have two files in the dir still fileCount(dir, 2, t) // second file name should still exist existsWithLen(thirdFilename, len(b2), t) // should have deleted the first backup notExist(secondFilename, t) // now test that we don't delete directories or non-logfile files newFakeTime() // create a file that is close to but different from the logfile name. // It shouldn't get caught by our deletion filters. notlogfile := logFile(dir) + ".foo" err = ioutil.WriteFile(notlogfile, []byte("data"), 0644) isNil(err, t) // Make a directory that exactly matches our log file filters... it still // shouldn't get caught by the deletion filter since it's a directory. notlogfiledir := backupFile(dir) err = os.Mkdir(notlogfiledir, 0700) isNil(err, t) newFakeTime() // this will make us rotate again n, err = l.Write(b2) isNil(err, t) equals(len(b2), n, t) // this will use the new fake time fourthFilename := backupFile(dir) existsWithLen(fourthFilename, len(b2), t) // we need to wait a little bit since the files get deleted on a different // goroutine. <-time.After(time.Millisecond * 10) // We should have four things in the directory now - the 2 log files, the // not log file, and the directory fileCount(dir, 4, t) // third file name should still exist existsWithLen(filename, n, t) existsWithLen(fourthFilename, len(b2), t) // should have deleted the first filename notExist(thirdFilename, t) // the not-a-logfile should still exist exists(notlogfile, t) // the directory exists(notlogfiledir, t) } func TestMaxAge(t *testing.T) { currentTime = fakeTime megabyte = 1 dir := makeTempDir("TestMaxAge", t) defer os.RemoveAll(dir) filename := logFile(dir) l := &Logger{ Filename: filename, MaxSize: 10, MaxAge: 1, } defer l.Close() b := []byte("boo!") n, err := l.Write(b) isNil(err, t) equals(len(b), n, t) existsWithLen(filename, n, t) fileCount(dir, 1, t) // two days later newFakeTime() b2 := []byte("foooooo!") n, err = l.Write(b2) isNil(err, t) equals(len(b2), n, t) existsWithLen(backupFile(dir), len(b), t) // we need to wait a little bit since the files get deleted on a different // goroutine. <-time.After(10 * time.Millisecond) // We should still have 2 log files, since the most recent backup was just // created. fileCount(dir, 2, t) existsWithLen(filename, len(b2), t) // we should have deleted the old file due to being too old existsWithLen(backupFile(dir), len(b), t) // two days later newFakeTime() b3 := []byte("foooooo!") n, err = l.Write(b2) isNil(err, t) equals(len(b3), n, t) existsWithLen(backupFile(dir), len(b2), t) // we need to wait a little bit since the files get deleted on a different // goroutine. <-time.After(10 * time.Millisecond) // We should have 2 log files - the main log file, and the most recent // backup. The earlier backup is past the cutoff and should be gone. fileCount(dir, 2, t) existsWithLen(filename, len(b3), t) // we should have deleted the old file due to being too old existsWithLen(backupFile(dir), len(b2), t) } func TestOldLogFiles(t *testing.T) { currentTime = fakeTime megabyte = 1 dir := makeTempDir("TestOldLogFiles", t) defer os.RemoveAll(dir) filename := logFile(dir) data := []byte("data") err := ioutil.WriteFile(filename, data, 07) isNil(err, t) // This gives us a time with the same precision as the time we get from the // timestamp in the name. t1, err := time.Parse(backupTimeFormat, fakeTime().UTC().Format(backupTimeFormat)) isNil(err, t) backup := backupFile(dir) err = ioutil.WriteFile(backup, data, 07) isNil(err, t) newFakeTime() t2, err := time.Parse(backupTimeFormat, fakeTime().UTC().Format(backupTimeFormat)) isNil(err, t) backup2 := backupFile(dir) err = ioutil.WriteFile(backup2, data, 07) isNil(err, t) l := &Logger{Filename: filename} files, err := l.oldLogFiles() isNil(err, t) equals(2, len(files), t) // should be sorted by newest file first, which would be t2 equals(t2, files[0].timestamp, t) equals(t1, files[1].timestamp, t) } func TestTimeFromName(t *testing.T) { l := &Logger{Filename: "/var/log/myfoo/foo.log"} prefix, ext := l.prefixAndExt() val := l.timeFromName("foo-2014-05-04T14-44-33.555.log", prefix, ext) equals("2014-05-04T14-44-33.555", val, t) val = l.timeFromName("foo-2014-05-04T14-44-33.555", prefix, ext) equals("", val, t) val = l.timeFromName("2014-05-04T14-44-33.555.log", prefix, ext) equals("", val, t) val = l.timeFromName("foo.log", prefix, ext) equals("", val, t) } func TestLocalTime(t *testing.T) { currentTime = fakeTime megabyte = 1 dir := makeTempDir("TestLocalTime", t) defer os.RemoveAll(dir) l := &Logger{ Filename: logFile(dir), MaxSize: 10, LocalTime: true, } defer l.Close() b := []byte("boo!") n, err := l.Write(b) isNil(err, t) equals(len(b), n, t) b2 := []byte("fooooooo!") n2, err := l.Write(b2) isNil(err, t) equals(len(b2), n2, t) existsWithLen(logFile(dir), n2, t) existsWithLen(backupFileLocal(dir), n, t) } func TestRotate(t *testing.T) { currentTime = fakeTime dir := makeTempDir("TestRotate", t) defer os.RemoveAll(dir) filename := logFile(dir) l := &Logger{ Filename: filename, MaxBackups: 1, MaxSize: 100, // megabytes } defer l.Close() b := []byte("boo!") n, err := l.Write(b) isNil(err, t) equals(len(b), n, t) existsWithLen(filename, n, t) fileCount(dir, 1, t) newFakeTime() err = l.Rotate() isNil(err, t) // we need to wait a little bit since the files get deleted on a different // goroutine. <-time.After(10 * time.Millisecond) filename2 := backupFile(dir) existsWithLen(filename2, n, t) existsWithLen(filename, 0, t) fileCount(dir, 2, t) newFakeTime() err = l.Rotate() isNil(err, t) // we need to wait a little bit since the files get deleted on a different // goroutine. <-time.After(10 * time.Millisecond) filename3 := backupFile(dir) existsWithLen(filename3, 0, t) existsWithLen(filename, 0, t) fileCount(dir, 2, t) b2 := []byte("foooooo!") n, err = l.Write(b2) isNil(err, t) equals(len(b2), n, t) // this will use the new fake time existsWithLen(filename, n, t) } func TestJson(t *testing.T) { data := []byte(` { "filename": "foo", "maxsize": 5, "maxage": 10, "maxbackups": 3, "localtime": true }`[1:]) l := Logger{} err := json.Unmarshal(data, &l) isNil(err, t) equals("foo", l.Filename, t) equals(5, l.MaxSize, t) equals(10, l.MaxAge, t) equals(3, l.MaxBackups, t) equals(true, l.LocalTime, t) } func TestYaml(t *testing.T) { data := []byte(` filename: foo maxsize: 5 maxage: 10 maxbackups: 3 localtime: true`[1:]) l := Logger{} err := yaml.Unmarshal(data, &l) isNil(err, t) equals("foo", l.Filename, t) equals(5, l.MaxSize, t) equals(10, l.MaxAge, t) equals(3, l.MaxBackups, t) equals(true, l.LocalTime, t) } func TestToml(t *testing.T) { data := ` filename = "foo" maxsize = 5 maxage = 10 maxbackups = 3 localtime = true`[1:] l := Logger{} md, err := toml.Decode(data, &l) isNil(err, t) equals("foo", l.Filename, t) equals(5, l.MaxSize, t) equals(10, l.MaxAge, t) equals(3, l.MaxBackups, t) equals(true, l.LocalTime, t) equals(0, len(md.Undecoded()), t) } // makeTempDir creates a file with a semi-unique name in the OS temp directory. // It should be based on the name of the test, to keep parallel tests from // colliding, and must be cleaned up after the test is finished. func makeTempDir(name string, t testing.TB) string { dir := time.Now().Format(name + backupTimeFormat) dir = filepath.Join(os.TempDir(), dir) isNilUp(os.Mkdir(dir, 0777), t, 1) return dir } // existsWithLen checks that the given file exists and has the correct length. func existsWithLen(path string, length int, t testing.TB) { info, err := os.Stat(path) isNilUp(err, t, 1) equalsUp(int64(length), info.Size(), t, 1) } // logFile returns the log file name in the given directory for the current fake // time. func logFile(dir string) string { return filepath.Join(dir, "foobar.log") } func backupFile(dir string) string { return filepath.Join(dir, "foobar-"+fakeTime().UTC().Format(backupTimeFormat)+".log") } func backupFileLocal(dir string) string { return filepath.Join(dir, "foobar-"+fakeTime().Format(backupTimeFormat)+".log") } // logFileLocal returns the log file name in the given directory for the current // fake time using the local timezone. func logFileLocal(dir string) string { return filepath.Join(dir, fakeTime().Format(backupTimeFormat)) } // fileCount checks that the number of files in the directory is exp. func fileCount(dir string, exp int, t testing.TB) { files, err := ioutil.ReadDir(dir) isNilUp(err, t, 1) // Make sure no other files were created. equalsUp(exp, len(files), t, 1) } // newFakeTime sets the fake "current time" to two days later. func newFakeTime() { fakeCurrentTime = fakeCurrentTime.Add(time.Hour * 24 * 2) } func notExist(path string, t testing.TB) { _, err := os.Stat(path) assertUp(os.IsNotExist(err), t, 1, "expected to get os.IsNotExist, but instead got %v", err) } func exists(path string, t testing.TB) { _, err := os.Stat(path) assertUp(err == nil, t, 1, "expected file to exist, but got error from os.Stat: %v", err) }
{ "content_hash": "e149260fcc50233c9acc5542c7d7df43", "timestamp": "", "source": "github", "line_count": 634, "max_line_length": 93, "avg_line_length": 23.121451104100945, "alnum_prop": 0.6765127225595198, "repo_name": "mubassirhayat/flynn", "id": "c486e085ddac8b7fada09fdc48d2582206f31b26", "size": "14659", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Godeps/_workspace/src/github.com/natefinch/lumberjack/lumberjack_test.go", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "36594" }, { "name": "Go", "bytes": "859186" }, { "name": "JavaScript", "bytes": "226220" }, { "name": "Makefile", "bytes": "582" }, { "name": "Ruby", "bytes": "20502" }, { "name": "Shell", "bytes": "49436" } ], "symlink_target": "" }
"""Helper functions for supporting route domains""" import re from requests.utils import quote as urlquote from requests.utils import unquote as urlunquote # Pattern: <ipaddr>%<route_domain> ip_rd_re = re.compile(r'^([^%]*)%(\d+)$') # Pattern: <partition/folder_paths>/<ipaddr>%<route_domain>[:|.]<port> path_ip_rd_port_re = re.compile(r'^(.+)/(.+)%(\d+)[:|\.](.+)$') def combine_ip_and_route_domain(ip, route_domain): u"""Return address that includes IP and route domain Input ip format must be of the form: <ipv4_or_ipv6> """ address = "{}%{}".format(ip, route_domain) return address def split_ip_with_route_domain(address): u"""Return ip and route-domain parts of address Input ip format must be of the form: <ip_v4_or_v6_addr>[%<route_domain_id>] """ match = ip_rd_re.match(address) if match: ip = match.group(1) route_domain = int(match.group(2)) else: ip = address route_domain = None return ip, route_domain def normalize_address_with_route_domain(address, default_route_domain): u"""Return address with the route domain Return components of address, using the default route domain for the partition if one is not already specified. Input address is of the form: <ip_v4_or_v6_addr>[%<route_domain_id>] """ match = ip_rd_re.match(address) if match: ip = match.group(1) route_domain = int(match.group(2)) else: route_domain = default_route_domain ip = address address = combine_ip_and_route_domain(ip, route_domain) return address, ip, route_domain def encoded_normalize_address_with_route_domain(address, default_route_domain, inputUrlEncoded, outputUrlEncoded): """URL Encoded-aware version of normalize_address_with_route_domain""" if inputUrlEncoded: address = urlunquote(address) address = normalize_address_with_route_domain(address, default_route_domain)[0] if outputUrlEncoded: address = urlquote(address) return address def split_fullpath_with_route_domain(address): """Determine the individual components of an address path Input address format must be of the form: <partition_and_folders>/<ipv4_or_ipv6>%<route_domain>[:|.]<port> """ match = path_ip_rd_port_re.match(address) if match: path = match.group(1) ip = match.group(2) route_domain = int(match.group(3)) port = int(match.group(4)) return path, ip, route_domain, port # Future enhancment: we could pass in the default route domain # and then return path, ip, default_route_domain, port # (current implementation doesn't need this) return None, None, None, None
{ "content_hash": "4a85f77103ec8859f0d5b0acb80b859f", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 74, "avg_line_length": 30.760416666666668, "alnum_prop": 0.6105655265831358, "repo_name": "ryan-talley/f5-cccl", "id": "cd41aff1a0f8fefc3eedc0248eafa064eaaef450", "size": "3562", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "f5_cccl/utils/route_domain.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "476250" }, { "name": "Shell", "bytes": "5416" } ], "symlink_target": "" }
<Type Name="TableSection" FullName="Xamarin.Forms.TableSection"> <TypeSignature Language="C#" Value="public sealed class TableSection : Xamarin.Forms.TableSectionBase&lt;Xamarin.Forms.Cell&gt;" /> <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit TableSection extends Xamarin.Forms.TableSectionBase`1&lt;class Xamarin.Forms.Cell&gt;" /> <AssemblyInfo> <AssemblyName>Xamarin.Forms.Core</AssemblyName> <AssemblyVersion>1.0.0.0</AssemblyVersion> <AssemblyVersion>1.1.0.0</AssemblyVersion> <AssemblyVersion>1.2.0.0</AssemblyVersion> <AssemblyVersion>1.3.0.0</AssemblyVersion> <AssemblyVersion>1.4.0.0</AssemblyVersion> <AssemblyVersion>1.5.0.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <Base> <BaseTypeName>Xamarin.Forms.TableSectionBase&lt;Xamarin.Forms.Cell&gt;</BaseTypeName> <BaseTypeArguments> <BaseTypeArgument TypeParamName="T">Xamarin.Forms.Cell</BaseTypeArgument> </BaseTypeArguments> </Base> <Interfaces /> <Docs> <summary>A logical and visible section of a <see cref="T:Xamarin.Forms.TableView" />.</summary> <remarks>To be added.</remarks> </Docs> <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public TableSection ();" /> <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.0.0</AssemblyVersion> <AssemblyVersion>1.1.0.0</AssemblyVersion> <AssemblyVersion>1.2.0.0</AssemblyVersion> <AssemblyVersion>1.3.0.0</AssemblyVersion> <AssemblyVersion>1.4.0.0</AssemblyVersion> <AssemblyVersion>1.5.0.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <Parameters /> <Docs> <summary>Creates a new <see cref="T:Xamarin.Forms.TableSection" /> with default values.</summary> <remarks>To be added.</remarks> </Docs> </Member> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public TableSection (string title);" /> <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string title) cil managed" /> <MemberType>Constructor</MemberType> <AssemblyInfo> <AssemblyVersion>1.0.0.0</AssemblyVersion> <AssemblyVersion>1.1.0.0</AssemblyVersion> <AssemblyVersion>1.2.0.0</AssemblyVersion> <AssemblyVersion>1.3.0.0</AssemblyVersion> <AssemblyVersion>1.4.0.0</AssemblyVersion> <AssemblyVersion>1.5.0.0</AssemblyVersion> <AssemblyVersion>2.0.0.0</AssemblyVersion> </AssemblyInfo> <Parameters> <Parameter Name="title" Type="System.String" /> </Parameters> <Docs> <param name="title">To be added.</param> <summary>Creates a new <see cref="T:Xamarin.Forms.TableSection" /> with the title <paramref name="title" />.</summary> <remarks>To be added.</remarks> </Docs> </Member> </Members> </Type>
{ "content_hash": "89aaf139365b9f949970d7bd2bd050fa", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 177, "avg_line_length": 46.85294117647059, "alnum_prop": 0.6854990583804144, "repo_name": "Hitcents/Xamarin.Forms", "id": "7faeb599cdb061255b3522a3f75312eaa52c0916", "size": "3186", "binary": false, "copies": "2", "ref": "refs/heads/hitcents", "path": "docs/Xamarin.Forms.Core/Xamarin.Forms/TableSection.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1761" }, { "name": "C#", "bytes": "5547104" }, { "name": "CSS", "bytes": "523" }, { "name": "HTML", "bytes": "1028" }, { "name": "Java", "bytes": "2022" }, { "name": "Makefile", "bytes": "1775" }, { "name": "PowerShell", "bytes": "8514" } ], "symlink_target": "" }
package com.amazonaws.services.health.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.health.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * EventMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class EventMarshaller { private static final MarshallingInfo<String> ARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("arn").build(); private static final MarshallingInfo<String> SERVICE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("service").build(); private static final MarshallingInfo<String> EVENTTYPECODE_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("eventTypeCode").build(); private static final MarshallingInfo<String> EVENTTYPECATEGORY_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("eventTypeCategory").build(); private static final MarshallingInfo<String> REGION_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("region").build(); private static final MarshallingInfo<String> AVAILABILITYZONE_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("availabilityZone").build(); private static final MarshallingInfo<java.util.Date> STARTTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("startTime").build(); private static final MarshallingInfo<java.util.Date> ENDTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("endTime").build(); private static final MarshallingInfo<java.util.Date> LASTUPDATEDTIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("lastUpdatedTime").build(); private static final MarshallingInfo<String> STATUSCODE_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("statusCode").build(); private static final EventMarshaller instance = new EventMarshaller(); public static EventMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(Event event, ProtocolMarshaller protocolMarshaller) { if (event == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(event.getArn(), ARN_BINDING); protocolMarshaller.marshall(event.getService(), SERVICE_BINDING); protocolMarshaller.marshall(event.getEventTypeCode(), EVENTTYPECODE_BINDING); protocolMarshaller.marshall(event.getEventTypeCategory(), EVENTTYPECATEGORY_BINDING); protocolMarshaller.marshall(event.getRegion(), REGION_BINDING); protocolMarshaller.marshall(event.getAvailabilityZone(), AVAILABILITYZONE_BINDING); protocolMarshaller.marshall(event.getStartTime(), STARTTIME_BINDING); protocolMarshaller.marshall(event.getEndTime(), ENDTIME_BINDING); protocolMarshaller.marshall(event.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING); protocolMarshaller.marshall(event.getStatusCode(), STATUSCODE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
{ "content_hash": "3f0584d77de1bf8d1d6b21afe32bbbd2", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 157, "avg_line_length": 56.84507042253521, "alnum_prop": 0.7532210109018831, "repo_name": "dagnir/aws-sdk-java", "id": "681694cc6bbeea58eac693aa97dfc4fde058d53a", "size": "4616", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/transform/EventMarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "157317" }, { "name": "Gherkin", "bytes": "25556" }, { "name": "Java", "bytes": "165755153" }, { "name": "Scilab", "bytes": "3561" } ], "symlink_target": "" }
"use strict"; // THIS CODE WAS AUTOMATICALLY GENERATED // DO NOT EDIT THIS CODE BY HAND // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager Object.defineProperty(exports, "__esModule", { value: true }); exports.webworker_importscripts = void 0; exports.webworker_importscripts = {}; //# sourceMappingURL=webworker.importscripts.js.map
{ "content_hash": "753f246cd1989f9bac52e86fc8fbe34e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 67, "avg_line_length": 45.111111111111114, "alnum_prop": 0.770935960591133, "repo_name": "ChromeDevTools/devtools-frontend", "id": "e9413d6c6e3c7cace93d24b7a81d80be80e41dfc", "size": "406", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "615241" }, { "name": "Dart", "bytes": "205" }, { "name": "HTML", "bytes": "317251" }, { "name": "JavaScript", "bytes": "1401177" }, { "name": "LLVM", "bytes": "1918" }, { "name": "Makefile", "bytes": "687" }, { "name": "Python", "bytes": "133111" }, { "name": "Shell", "bytes": "1122" }, { "name": "TypeScript", "bytes": "15230731" }, { "name": "WebAssembly", "bytes": "921" } ], "symlink_target": "" }
ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
{ "content_hash": "dd6b2759673b6826772666f1049e7dc2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 23, "avg_line_length": 9.076923076923077, "alnum_prop": 0.6779661016949152, "repo_name": "mdoering/backbone", "id": "f472fa1a6d0ba64fea46c8b0e7430c1a430c4009", "size": "182", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Liliales/Liliaceae/Lilium/Lilium longiflorum/Lilium longiflorum longiflorum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
cd ios/ObjectiveC/Zone/1-QuickStart/Complete/ pod install cd ../../2-Notification/Starter/ pod install cd ../Complete/ pod install cd ../../3-InApp-Action/Starter/ pod install cd ../Complete/ pod install cd ../../../SWIFT/Zone/1-QuickStart/Complete/ pod install cd ../../2-Notification/Starter/ pod install cd ../Complete/ pod install cd ../../3-InApp-Action/Starter/ pod install cd ../Complete/ pod install
{ "content_hash": "e969da2e81568041dc22509cbc23f35f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 45, "avg_line_length": 19.476190476190474, "alnum_prop": 0.7188264058679706, "repo_name": "Connecthings/sdk-tutorial", "id": "5416005d59054c43e20b338f5ff9b5107f0c5009", "size": "422", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "PodInstallAll.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "312" }, { "name": "Java", "bytes": "45999" }, { "name": "Objective-C", "bytes": "51699" }, { "name": "Ruby", "bytes": "6308" }, { "name": "Shell", "bytes": "6135" }, { "name": "Swift", "bytes": "49146" } ], "symlink_target": "" }
package ProxyConn; use strict; use warnings; use Data::Dumper; use AnyEvent::Socket; use AnyEvent::Handle; use AnyEvent; use JSON::XS; use FileOutput; use Mappings; use Moose; use PacketHandler; use PredefinedAtoms; use v5.10; has 'fh' => (is => 'ro', isa => 'Ref', required => 1); has 'conn_id' => (is => 'ro', isa => 'Int', required => 1); has 'client_handle' => (is => 'rw', isa => 'Ref'); has 'x11_handle' => (is => 'rw', isa => 'Ref', predicate => 'has_x11_handle'); has 'packet_handler' => ( is => 'rw', isa => 'PacketHandler', ); sub BUILD { my ($self) = @_; say "new proxyconn built"; $self->packet_handler(PacketHandler->new(conn_id => $self->conn_id)); my $handle; $handle = AnyEvent::Handle->new( fh => $self->fh, on_error => sub { warn "Error on client socket: $_[2]\n"; # Kill x11_handle too (if exists) if ($self->has_x11_handle) { warn "Closing connection to X11 for this client\n"; $self->x11_handle->destroy; } $self->packet_handler->client_disconnected; $_[0]->destroy; }, on_eof => sub { $handle->destroy; # destroy handle warn "done.\n"; } ); $self->client_handle($handle); # Expect 12 bytes (byte order + 11 bytes of request) of protocol setup $handle->push_read(chunk => 12, sub { $self->_got_setup_request(@_) }); } # # Called when the first 12 bytes were read from the client. They contain a # setup request consisting of the byte order, expected major/minor version and # the authentication data. # # We establish a connection to X11 and forward everything we got from the # client. The next step is _got_setup_reply which will be called when X11 # replies to the setup request. # sub _got_setup_request { my ($self, $handle, $request) = @_; my ($byteorder, $pad0, $major, $minor, $auth_name_len, $auth_data_len) = unpack('ccSSSS', $request); say "byteorder = $byteorder, major = $major, minor = $minor, auth name len = $auth_name_len, auth data len = $auth_data_len"; # TODO: socket path tcp_connect "unix/", "/tmp/.X11-unix/X0", sub { # TODO: handle errors when connecting my ($fh) = @_; say "connected"; my $x11; $x11 = AnyEvent::Handle->new( fh => $fh, on_error => sub { warn "error (x11) $_[2]\n"; $_[0]->destroy; }, on_eof => sub { $x11->destroy; warn "done (x11)"; } ); $self->x11_handle($x11); # forward the request to the X11 server say "pushing req now"; $x11->push_write($request); $x11->push_read(chunk => 8, sub { $self->_got_setup_reply(@_) }); # TODO: why + 2? padding until it reaches 4, i guess my $comb = ($auth_name_len ) + 2 + ($auth_data_len ); if ($auth_data_len == 0 && $auth_name_len == 0) { say "auth null, not reading"; return; } $handle->push_read(chunk => $comb, sub { my ($handle, $auth) = @_; say "got auth, sending"; $x11->push_write($auth); }); }; } # # Called when X11 replied to the setup request. There are three cases: # 1) Everything went fine. In that case we forward the reply (plus all the # server info) to the client, then call _push_client_read and _push_x11_read # to handle data flowing in both directions. # # 2) Authentication failed for some reason. We display an error and exit. # # 3) Two-step authentication is required (Kerberos for example). We don’t # support that. # sub _got_setup_reply { my ($self, $x11, $reply) = @_; my ($status, $words) = unpack('cx[cSS]S', $reply); my $length = ($words * 4); # failed if ($status == 0) { say "setup failed answer:"; $x11->push_read(chunk => $length, sub { my ($x11, $errormsg) = @_; say "error authenticating at the X11 server: $errormsg"; exit 0; }); return; } if ($status == 1) { # see xcb_setup_t, should we ever want to display some parts of $reply say "[conn] successfully authenticated"; $self->client_handle->push_write($reply); $x11->push_read( chunk => $length, sub { my ($x11, $chunk) = @_; # we are interested in the root window IDs my ($vendor_len, $roots_len, $pmf_len) = unpack("x[LLLL]Sx[S]cc", $chunk); # the reply up to the lists consists of LLLLSSccccccCCcccc = 16 + 4 + 6 + 2 + 4 = 32 bytes # Extract and print the vendor as a safety check my $vendor = substr($chunk, 32, $vendor_len); say "[conn] Vendor = $vendor"; # after the vendor there is the list of pixmapformats. Every element is 8 bytes long my $pos = 32 + $vendor_len + ($pmf_len * 8); # now come the root entries my ($root) = unpack('L', substr($chunk, $pos)); say "[conn] root window id = " . sprintf("0x%08x", $root); PredefinedAtoms::add_predefined_atoms; my $id = Mappings->instance->id_for($root => 'window'); my $clever = encode_json({ type => 'cleverness', id => $id, idtype => 'window', title => 'root', }); FileOutput->instance->write($clever); say "[conn] vendor_len = $vendor_len, roots_len = $roots_len, pmf_len = $pmf_len"; $self->client_handle->push_write($chunk); $self->_push_client_read; $self->_push_x11_read; } ); return; } if ($status == 2) { print STDERR "Two-part authentication is not implemented\n"; exit 1; } } # # Read 4 bytes (and possibly more, depending on the request), then call # _pkt_to_server # sub _push_client_read { my ($self) = @_; $self->client_handle->push_read( chunk => 4, sub { my ($handle, $header) = @_; my ($words) = unpack('x[cc]S', $header); my $length = (($words * 4) - 4); if ($length == 0) { # request is only 4 bytes long, immediately call _pkt_to_server #say "complete, sending now"; $self->_pkt_to_server($handle, $header); $self->_push_client_read; return; } #say "waiting for length $length"; $handle->push_read(chunk => $length, sub { my ($handle, $request) = @_; #say "got complete req"; $self->_pkt_to_server($handle, $header . $request); $self->_push_client_read; }); } ); } # # Read 32 bytes (and possibly more in the handler), then call _pkt_from_server # sub _push_x11_read { my ($self) = @_; $self->x11_handle->push_read( chunk => 32, sub { my ($x11, $packet) = @_; my ($type, $words) = unpack('cx[ccc]L', $packet); my $length = ($words * 4); #say "additional length = " . $length; # Only replies (type 1) can have additional bytes if ($type != 1 || $length == 0) { #say "no additional bytes, sending now"; $self->_pkt_from_server($x11, $packet); $self->_push_x11_read; return; } $x11->push_read(chunk => $length, sub { my ($x11, $rest) = @_; #say "got additional bytes, sending to client"; $self->_pkt_from_server($x11, $packet . $rest); $self->_push_x11_read; }); } ); } # # Packet from client to X11 server # sub _pkt_to_server { my ($self, $handle, $packet) = @_; my $ph = $self->packet_handler; # make sure we are in a burst currently (starts a new one when first invoked) $ph->child_burst->ensure_in_burst; $self->x11_handle->push_write($packet); $ph->handle_request($packet); $ph->child_burst->finish if length($handle->{rbuf}) == 0; } sub _pkt_from_server { my ($self, $x11, $packet) = @_; $self->client_handle->push_write($packet); my $ph = $self->packet_handler; # make sure we are in a burst currently (starts a new one when first invoked) $ph->x11_burst->ensure_in_burst; my ($type) = unpack('c', $packet); if ($type == 0) { $ph->handle_error($packet); } elsif ($type == 1) { $ph->handle_reply($packet); } else { $ph->handle_event($packet); } $ph->x11_burst->finish if length($x11->{rbuf}) == 0; } __PACKAGE__->meta->make_immutable; 1
{ "content_hash": "66eceef8c480527f12c34f69316d5b69", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 129, "avg_line_length": 30.19463087248322, "alnum_prop": 0.5135585685707935, "repo_name": "x11vis/x11vis", "id": "bdece3470a3f175429e3a9dfbac4eff27b76b66f", "size": "9129", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "interceptor/lib/ProxyConn.pm", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "1950" }, { "name": "JavaScript", "bytes": "14925" }, { "name": "Makefile", "bytes": "2230" }, { "name": "Perl", "bytes": "66387" }, { "name": "Perl6", "bytes": "407" } ], "symlink_target": "" }
import preSVM as pre import nifti as nf import os as os ## Globals needed to create the SVMLIB data for a run ## ================================================= svmBaseName = 'rPRC_block_svmData.txt' roiVmr = 'rPRC_block.nii' trainLab1 = 'STI' trainLab2 = 'STU' testLab1 = 'TESTNSU' testLab2 = 'TESTSTU' os.chdir('/Users/type/Lab/RWCR/bv_AR/mvpa_data/') niiFiles, labFiles = pre.nii_LabelListMatch('.') trainLabsFiles = labFiles trainNiiFiles = niiFiles testLabsFiles = labFiles testNiiFiles = niiFiles ## ================================================= ## from time import localtime, strftime svmBaseName = strftime("%a%d%b%Y_%H-%M-%S", localtime()) + svmBaseName # Add a timestamp to the SVM file name, preventing accidental # overwriting or modification. #print('Creating training data:') #for labF, niiF in zip(trainLabsFiles, trainNiiFiles): #print(niiF,labF) ### Get the needed data #vtc = nf.NiftiImage(niiF) #roi = nf.NiftiImage(roiVmr) #vols, labels = pre.readLabList(labF) ### Preprocess the data #reducedRoi = pre.roiReduce(roi,vtc) #maskedVtc = pre.maskVtc(vtc,reducedRoi) #reference = pre.createRefVtc(maskedVtc) ### Filter labels and vols by trainLab1, trainLab2 ### then change recode the labels as 1 and 2 #l1mask = labels == trainLab1 #l2mask = labels == trainLab2 #l1l2mask = l1mask != l2mask #labels[l1mask] = 1 #labels[l2mask] = 2 #vols = vols[l1l2mask] #labels = labels[l1l2mask] #svmName = 'train_'+ trainLab1 + 'x' + trainLab2 + '_' + svmBaseName #pre.writeSVM(maskedVtc,reference,labels,vols,svmName) print('Creating testing data:') for labF, niiF in zip(testLabsFiles, testNiiFiles): print(niiF,labF) ## Get the needed data vtc = nf.NiftiImage(niiF) roi = nf.NiftiImage(roiVmr) vols, labels = pre.readLabList(labF) ## Preprocess the data reducedRoi = pre.roiReduce(roi,vtc) maskedVtc = pre.maskVtc(vtc,reducedRoi) reference = pre.createRefVtc(maskedVtc) ## Filter labels and vols by trainLab1, trainLab2 ## then change recode the labels as 1 and 2 l1mask = labels == testLab1 l2mask = labels == testLab2 l1l2mask = l1mask != l2mask labels[l1mask] = 1 labels[l2mask] = 2 vols = vols[l1l2mask] labels = labels[l1l2mask] svmName = 'test_'+ testLab1 + 'x' + testLab2 + '_' + svmBaseName pre.writeSVM(maskedVtc,reference,labels,vols,svmName) os.chdir('/Users/type/Code/mvpa')
{ "content_hash": "b0d01535bdeca4a391ae7d04c3aaece6", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 72, "avg_line_length": 26.633333333333333, "alnum_prop": 0.6779307467667918, "repo_name": "parenthetical-e/pyBV", "id": "6ec5029b2ffa6eb91a45d426b1d344d50bc5bf16", "size": "2398", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "archive/svmDataGen_TESTNSUxTESTSTU_testOnly.py", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Perl", "bytes": "226" }, { "name": "Python", "bytes": "66339" } ], "symlink_target": "" }
<?php namespace App; /** * Класс для хранения в сессии пользовательских данных * */ class Session { private $values = array(); public $filter = array(); public function __construct() { } public function __set($name, $value) { $this->values[$name] = $value; } public function __get($name) { return @$this->values[$name]; } /** * Возвращает инстанс сессии * @return Session */ public static function getSession() { if (!isset($_SESSION['App_session'])) { $_SESSION['App_session'] = new Session(); } return $_SESSION['App_session']; } }
{ "content_hash": "473bc4e92825fd05bcbcb9698c01d978", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 59, "avg_line_length": 17.68421052631579, "alnum_prop": 0.5297619047619048, "repo_name": "leon-mbs/zippyerp", "id": "94fc1eba0fdfddf199de4e4f9876770f1d023cc0", "size": "740", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "www/app/session.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "3168140" } ], "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_15.html">Class Test_AbaRouteValidator_15</a></li> </ol></div> <h1 class="aui-h2-clover"> Test testAbaNumberCheck_32975_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_15.html?line=11229#src-11229" >testAbaNumberCheck_32975_good</a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:44:32 </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_32975_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=30005#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": "b649f4c47a82ebd91d977e1f655aedb5", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 297, "avg_line_length": 43.92822966507177, "alnum_prop": 0.5097483934211959, "repo_name": "dcarda/aba.route.validator", "id": "833353ec2f4d9a43f8a71f903ef182496e51b6bc", "size": "9181", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_15_testAbaNumberCheck_32975_good_n5h.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "18715254" } ], "symlink_target": "" }
package saltchannel.v2; import java.util.concurrent.LinkedBlockingQueue; import saltchannel.BadPeer; import saltchannel.ByteChannel; import saltchannel.ComException; import saltchannel.util.TimeChecker; import saltchannel.util.TimeKeeper; import saltchannel.v2.packets.AppPacket; import saltchannel.v2.packets.M4Packet; import saltchannel.v2.packets.MultiAppPacket; import saltchannel.v2.packets.Packet; import saltchannel.v2.packets.PacketHeader; /** * A message channel for the application layer to use after a successful * handshake has been completed. * * The channel works on top of an underlying byte channel (an EncryptedChannelV2). * It adds a small header to the messages (2-bytes header + time). * Also, this class decides how to encode application messages * using either AppPacket or MultiAppPacket. * * @author Frans Lundberg */ public class ApplicationChannel implements ByteChannel { private ByteChannel channel; private TimeKeeper timeKeeper; private TimeChecker timeChecker; private M4Packet bufferedM4 = null; private LinkedBlockingQueue<byte[]> readQ; private boolean readLast = false; private EncryptedChannelV2 encryptedChannel; public ApplicationChannel(ByteChannel channel, TimeKeeper timeKeeper, TimeChecker timeChecker) { this.channel = channel; if (channel instanceof EncryptedChannelV2) { encryptedChannel = (EncryptedChannelV2) channel; } else { encryptedChannel = null; } this.timeKeeper = timeKeeper; this.timeChecker = timeChecker; this.readQ = new LinkedBlockingQueue<byte[]>(); } @Override public byte[] read() throws ComException { // // Note, APP_PACKET and TYPE_MULTI_APP_PACKET do not contain the // lastFlag; it is included in ENCRYPTED_MESSAGE. // if (readQ.size() > 0) { try { return readQ.take(); } catch (InterruptedException e) { throw new Error("should not happen, size is > 0"); } } byte[] bytes = channel.read(); if (encryptedChannel != null) { this.readLast = encryptedChannel.lastFlag(); } PacketHeader header = new PacketHeader(bytes, 0); int type = header.getType(); byte[] result; if (type == Packet.TYPE_APP_PACKET) { AppPacket p = AppPacket.fromBytes(bytes, 0, bytes.length); timeChecker.checkTime(p.time); result = p.appData; } else if (type == Packet.TYPE_MULTI_APP_PACKET) { MultiAppPacket multi = MultiAppPacket.fromBytes(bytes, 0, bytes.length); timeChecker.checkTime(multi.time); int count = multi.appMessages.length; result = multi.appMessages[0]; for (int i = 1; i < count; i++) { readQ.add(multi.appMessages[i]); } } else { throw new BadPeer("unexpected message type, " + type + ", expected AppPacket or MultiAppPacket"); } return result; } /** * Returns the number of remaining application buffered application * messages. This is the same as the number of further messages * of an MultiAppPacket that are buffered by this implementation. */ public int availableFromMultiAppPacket() { return readQ.size(); } /** * Returns true if the last packet read with read() is the last * batch of messages of the application session. * If available() returns 0, the last message of the session was read. */ public boolean lastFlag() { return this.readLast; } /** * @deprecated Deprecated from 2017-10-31, use write(isLast, messages) instead. */ @Override public void write(byte[]... messages) throws ComException { write(false, messages); } @Override public void write(boolean isLast, byte[]... messages) throws ComException { // // * Adds application header (AppPacket/MultiAppPacket). // * Adds (prepends) buffered M4 if needed. // * Writes to underlying layer (EncryptedChannelV2). // // messages: input application messages // messages2: application messages with AppPacket/MultiAppPacket headers. // messages3: output messages to EncryptedChannelV2 layer, possible with buffered M4. // byte[][] messages2; byte[][] messages3; int currentTime = timeKeeper.getTime(); boolean useMulti = MultiAppPacket.shouldUse(messages); if (useMulti) { messages2 = new byte[1][]; MultiAppPacket multi = new MultiAppPacket(); multi.appMessages = messages; multi.time = currentTime; messages2[0] = new byte[multi.getSize()]; multi.toBytes(messages2[0], 0); } else { messages2 = new byte[messages.length][]; for (int i = 0; i < messages.length; i++) { AppPacket p = new AppPacket(); p.appData = messages[i]; p.time = currentTime; messages2[i] = new byte[p.getSize()]; p.toBytes(messages2[i], 0); } } if (this.bufferedM4 == null) { messages3 = messages2; } else { messages3 = new byte[1 + messages2.length][]; this.bufferedM4.time = currentTime; messages3[0] = this.bufferedM4.toBytes(); System.arraycopy(messages2, 0, messages3, 1, messages2.length); this.bufferedM4 = null; } channel.write(isLast, messages3); } /** * Used by framework to set M4, so M4 can be sent together with * first application messages. */ void setBufferedM4(M4Packet m4) { this.bufferedM4 = m4; } }
{ "content_hash": "3a30ab1da6e7289b05fed7649e128ebf", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 100, "avg_line_length": 34.872832369942195, "alnum_prop": 0.6035140062986906, "repo_name": "assaabloy-ppi/salt-channel", "id": "1dc77891fe58bc62d9805542d3e7da5e959bcd53", "size": "6033", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/saltchannel/v2/ApplicationChannel.java", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2311" }, { "name": "Java", "bytes": "600439" } ], "symlink_target": "" }
Converter ========= Converter is a customizable unit converter application. It is licesned under the MIT license. Please see the [wiki](https://github.com/KerryL/Converter/wiki/Home) for more detailed information. Converter is built on wxWidgets. It compiles and runs under both MSW and GTK. Converter was inspired by Josh Madison's Convert application (http://joshmadison.com/convert-for-windows/). The major improvement is the ability to define custom categories and conversions. All conversions are stored in an XML file, and only require that the user define one conversion per unit. A graph structure is created and searched in order to map from one unit type to any other unit type in the same category, while requiring only a minimum number of conversion factors to be entered. Currently, the expression parser is very weak and only works on simple conversion definitions (good enough for all conversions I've come across so far, including temperature conversion), but there is definitely some room for improvement there. Feedback is welcome! Please log bugs and suggestions using GitHub's issue tracker. [![githalytics.com alpha](https://cruel-carlota.pagodabox.com/0fd4886340510dbe655700f724e6a41f "githalytics.com")](http://githalytics.com/KerryL/Converter)
{ "content_hash": "69af137e00c963acab34bd02f1e5262f", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 495, "avg_line_length": 91.5, "alnum_prop": 0.7993754879000781, "repo_name": "KerryL/Converter", "id": "c694e24013cf18dc20ae75794ee5f348ffa1075a", "size": "1281", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1020" }, { "name": "C++", "bytes": "158076" }, { "name": "Makefile", "bytes": "1674" }, { "name": "NASL", "bytes": "1554" }, { "name": "Shell", "bytes": "2316" } ], "symlink_target": "" }
// The MIT License (MIT) // Copyright 2015 Siney/Pangweiwei siney@yeah.net // // 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. namespace SLua { using System.Collections.Generic; using System; public class CustomExport { public static void OnGetAssemblyToGenerateExtensionMethod(out List<string> list) { list = new List<string> { "Assembly-CSharp", }; } public static void OnAddCustomClass(LuaCodeGen.ExportGenericDelegate add) { // below lines only used for demostrate how to add custom class to export, can be delete on your app add(typeof(System.Func<int>), null); add(typeof(System.Action<int, string>), null); add(typeof(System.Action<int, Dictionary<int, object>>), null); add(typeof(List<int>), "ListInt"); add(typeof(Dictionary<int, string>), "DictIntStr"); add(typeof(string), "String"); // add your custom class here // add( type, typename) // type is what you want to export // typename used for simplify generic type name or rename, like List<int> named to "ListInt", if not a generic type keep typename as null or rename as new type name } public static void OnAddCustomAssembly(ref List<string> list) { // add your custom assembly here // you can build a dll for 3rd library like ngui titled assembly name "NGUI", put it in Assets folder // add its name into list, slua will generate all exported interface automatically for you //list.Add("NGUI"); } public static HashSet<string> OnAddCustomNamespace() { return new HashSet<string> { //"NLuaTest.Mock" }; } // if uselist return a white list, don't check noUseList(black list) again public static void OnGetUseList(out List<string> list) { list = new List<string> { //"UnityEngine.GameObject", }; } public static List<string> FunctionFilterList = new List<string>() { "UIWidget.showHandles", "UIWidget.showHandlesWithMoveTool", }; // black list if white list not given public static void OnGetNoUseList(out List<string> list) { list = new List<string> { "HideInInspector", "ExecuteInEditMode", "AddComponentMenu", "ContextMenu", "RequireComponent", "DisallowMultipleComponent", "SerializeField", "AssemblyIsEditorAssembly", "Attribute", "Types", "UnitySurrogateSelector", "TrackedReference", "TypeInferenceRules", "FFTWindow", "RPC", "Network", "MasterServer", "BitStream", "HostData", "ConnectionTesterStatus", "GUI", "EventType", "EventModifiers", "FontStyle", "TextAlignment", "TextEditor", "TextEditorDblClickSnapping", "TextGenerator", "TextClipping", "Gizmos", "ADBannerView", "ADInterstitialAd", "Android", "Tizen", "jvalue", "iPhone", "iOS", "Windows", "CalendarIdentifier", "CalendarUnit", "CalendarUnit", "ClusterInput", "FullScreenMovieControlMode", "FullScreenMovieScalingMode", "Handheld", "LocalNotification", "NotificationServices", "RemoteNotificationType", "RemoteNotification", "SamsungTV", "TextureCompressionQuality", "TouchScreenKeyboardType", "TouchScreenKeyboard", "MovieTexture", "UnityEngineInternal", "Terrain", "Tree", "SplatPrototype", "DetailPrototype", "DetailRenderMode", "MeshSubsetCombineUtility", "AOT", "Social", "Enumerator", "SendMouseEvents", "Cursor", "Flash", "ActionScript", "OnRequestRebuild", "Ping", "ShaderVariantCollection", "SimpleJson.Reflection", "CoroutineTween", "GraphicRebuildTracker", "Advertisements", "UnityEditor", "WSA", "EventProvider", "Apple", "ClusterInput", "Motion", "UnityEngine.UI.ReflectionMethodsCache", }; } } }
{ "content_hash": "4145acf3d2e213cb59faf68c5bcd2e46", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 176, "avg_line_length": 36.224137931034484, "alnum_prop": 0.5268919562113279, "repo_name": "mr-kelly/slua", "id": "4b3d1eb8415345eec7019aedc41db129c9bda6b1", "size": "6305", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "Assets/Slua/Editor/CustomExport.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "34025" }, { "name": "C", "bytes": "4679701" }, { "name": "C#", "bytes": "417788" }, { "name": "C++", "bytes": "76310" }, { "name": "CSS", "bytes": "17825" }, { "name": "HTML", "bytes": "773456" }, { "name": "Lua", "bytes": "758016" }, { "name": "Makefile", "bytes": "75031" }, { "name": "Python", "bytes": "947" }, { "name": "Roff", "bytes": "11914" }, { "name": "Shell", "bytes": "4818" } ], "symlink_target": "" }
<?php declare(strict_types=1); /** * Base class to all analysers accessible through the AnalyserPlugin. * * @category PHP * @package PHP_Reflect * @author Laurent Laville <pear@laurent-laville.org> * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ namespace Bartlett\Reflect\Analyser; use Bartlett\Reflect; use Bartlett\Reflect\Event\BuildEvent; use PhpParser\Node; use PhpParser\NodeVisitor; /** * Provides common metrics for all analysers. * * @category PHP * @package PHP_Reflect * @author Laurent Laville <pear@laurent-laville.org> * @license http://www.opensource.org/licenses/bsd-license.php BSD License * @since Class available since Release 2.0.0RC2 */ abstract class AbstractAnalyser implements AnalyserInterface, NodeVisitor { protected $namespaces = array(); protected $testClass; protected $tokens; protected $file; protected $metrics = array(); protected $subject; public function getSubject(): Reflect { return $this->subject; } public function getCurrentFile(): string { return $this->file; } public function getTokens(): array { return $this->tokens; } /** * @param Reflect $reflect * @return void */ public function setSubject(Reflect $reflect): void { $this->subject = $reflect; } /** * @param array $tokens * @return void */ public function setTokens(array $tokens): void { $this->tokens = $tokens; } /** * @param string $path * @return void */ public function setCurrentFile(string $path): void { $this->file = $path; } /** * @return array * * @psalm-return array<string, mixed> */ public function getMetrics(): array { return array(get_class($this) => $this->metrics); } /** * @return string */ public function getName(): string { $parts = explode('\\', get_class($this)); return array_pop($parts); } /** * @return string */ public function getNamespace(): string { return implode('\\', array_slice(explode('\\', get_class($this)), 0, -1)); } /** * @return string */ public function getShortName(): string { return strtolower(str_replace('Analyser', '', $this->getName())); } /** * {@inheritDoc} */ public function beforeTraverse(array $nodes) { $this->subject->dispatch( new BuildEvent( $this, array( 'method' => get_class($this) . '::' . __FUNCTION__, 'node' => null, ) ) ); } /** * {@inheritDoc} */ public function enterNode(Node $node) { $this->subject->dispatch( new BuildEvent( $this, array( 'method' => get_class($this) . '::' . __FUNCTION__, 'node' => $node, ) ) ); } /** * {@inheritDoc} */ public function leaveNode(Node $node) { $this->subject->dispatch( new BuildEvent( $this, array( 'method' => get_class($this) . '::' . __FUNCTION__, 'node' => $node, ) ) ); } /** * {@inheritDoc} */ public function afterTraverse(array $nodes) { $this->subject->dispatch( new BuildEvent( $this, array( 'method' => get_class($this) . '::' . __FUNCTION__, 'node' => null, ) ) ); } /** * Visits a namespace node. * * @param Node\Stmt\Namespace_ $namespace Represents a namespace in the data source * * @return void */ protected function visitNamespace(Node\Stmt\Namespace_ $namespace): void { $this->namespaces[] = $namespace->name; } /** * Visits a class node. * * @param Node\Stmt\Class_ $class Represents a class in the namespace * * @return void */ protected function visitClass(Node\Stmt\Class_ $class): void { $this->testClass = false; $parent = $class->extends; if (empty($parent)) { // No ancestry // Treat the class as a test case class if the name // of the parent class ends with "TestCase". if (substr((string) $class->name, -8) == 'TestCase') { $this->testClass = true; } } else { // Ancestry // Treat the class as a test case class if the name // of the parent class equals to "PHPUnit_Framework_TestCase". if ((string) $parent === 'PHPUnit_Framework_TestCase') { $this->testClass = true; } } } /** * Checks if a property is implicitly public (PHP 4 syntax) * * @param array $tokens * @param Node\Stmt\Property $prop * * @return boolean */ protected function isImplicitlyPublicProperty(array $tokens, Node\Stmt\Property $prop): bool { $i = $prop->getAttribute('startTokenPos'); return (isset($tokens[$i]) && $tokens[$i][0] == T_VAR); } /** * Checks if a method is implicitly public (PHP 4 syntax) * * @param array $tokens * @param Node\Stmt\ClassMethod $method * * @return boolean */ protected function isImplicitlyPublicFunction(array $tokens, Node\Stmt\ClassMethod $method): bool { $i = $method->getAttribute('startTokenPos'); for ($c = count($tokens); $i < $c; ++$i) { $t = $tokens[$i]; if ($t[0] == T_PUBLIC || $t[0] == T_PROTECTED || $t[0] == T_PRIVATE) { return false; } if ($t[0] == T_FUNCTION) { break; } } return true; } /** * Checks if array syntax is normal or short (PHP 5.4+ feature) * * @param array $tokens * @param Node\Expr\Array_ $array * * @return boolean */ protected function isShortArraySyntax(array $tokens, Node\Expr\Array_ $array): bool { $i = $array->getAttribute('startTokenPos'); return is_string($tokens[$i]); } }
{ "content_hash": "367ad687e16384215a029a483a90c26c", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 101, "avg_line_length": 23.996350364963504, "alnum_prop": 0.5079847908745247, "repo_name": "llaville/php-reflect", "id": "685520c361f22b895ec51ce3f54b747b2497a688", "size": "6575", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Bartlett/Reflect/Analyser/AbstractAnalyser.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "363628" }, { "name": "Roff", "bytes": "7994" } ], "symlink_target": "" }
#ifndef itkChildTreeIterator_h #define itkChildTreeIterator_h #include "itkTreeIteratorBase.h" namespace itk { template <typename TTreeType> class ITK_TEMPLATE_EXPORT ChildTreeIterator : public TreeIteratorBase<TTreeType> { public: /** Typedefs */ using Self = ChildTreeIterator; using Superclass = TreeIteratorBase<TTreeType>; using TreeType = TTreeType; using ValueType = typename TTreeType::ValueType; using typename Superclass::TreeNodeType; using ChildIdentifier = typename TreeNodeType::ChildIdentifier; using typename Superclass::NodeType; /** Constructor */ ChildTreeIterator(TreeType * tree, const TreeNodeType * start = nullptr); /** Constructor */ ChildTreeIterator(const TreeIteratorBase<TTreeType> & iterator); /** Get the type of the iterator */ NodeType GetType() const override; /** Go to a specific child node */ bool GoToChild(ChildIdentifier number = 0) override; /** Go to a parent node */ bool GoToParent() override; /** Clone function */ TreeIteratorBase<TTreeType> * Clone() override; /** operator = */ Self & operator=(Superclass & iterator) { if (this != &iterator) { Superclass::operator=(iterator); auto & it = static_cast<ChildTreeIterator<TTreeType> &>(iterator); m_ListPosition = it.m_ListPosition; m_ParentNode = it.m_ParentNode; } return *this; } protected: /** Get the next value */ const ValueType & Next() override; /** Return true if the next value exists */ bool HasNext() const override; private: mutable ChildIdentifier m_ListPosition; TreeNodeType * m_ParentNode; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION # include "itkChildTreeIterator.hxx" #endif #endif
{ "content_hash": "116afab9382058550e4267f53b86d1ad", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 80, "avg_line_length": 22.55128205128205, "alnum_prop": 0.7003979533826038, "repo_name": "vfonov/ITK", "id": "089a8ee13cd7bbcb10ef006b9470bad0007924e2", "size": "2515", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Modules/Compatibility/Deprecated/include/itkChildTreeIterator.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "463579" }, { "name": "C++", "bytes": "35045408" }, { "name": "CMake", "bytes": "1623319" }, { "name": "CSS", "bytes": "17428" }, { "name": "HTML", "bytes": "8370" }, { "name": "Java", "bytes": "28281" }, { "name": "JavaScript", "bytes": "1522" }, { "name": "Objective-C++", "bytes": "5640" }, { "name": "Perl", "bytes": "6029" }, { "name": "Python", "bytes": "569543" }, { "name": "Ruby", "bytes": "296" }, { "name": "SWIG", "bytes": "66033" }, { "name": "Shell", "bytes": "165002" }, { "name": "Tcl", "bytes": "77628" }, { "name": "XSLT", "bytes": "8634" } ], "symlink_target": "" }
<?php namespace Gibilogic\CrudBundle\Model; /** * Simple OptionsResolver for the paginated entity repository options * (filtering and sorting). * * @author Matteo Guindani https://github.com/Ingannatore */ class PaginatedEntityRepositoryOptionsResolver extends SimpleOptionsResolver { /** * {@inheritdoc} */ protected function configure() { return $this ->setDefaults([ 'filters' => [], 'sorting' => [], 'page' => 1, ]) ->setRequired([ 'elementsPerPage', ]) ->setAllowedTypes('elementsPerPage', 'numeric') ->setAllowedTypes('filters', 'array') ->setAllowedTypes('sorting', 'array') ->setAllowedTypes('page', 'numeric'); } }
{ "content_hash": "283da51dd875dcad3cf908c2db9d5d3d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 76, "avg_line_length": 24.323529411764707, "alnum_prop": 0.5453446191051995, "repo_name": "Ingannatore/gibilogic-crud-bundle", "id": "0a21a1ffc66963cb781a9c9e24c09f36de394eee", "size": "1066", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Model/PaginatedEntityRepositoryOptionsResolver.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "14502" }, { "name": "JavaScript", "bytes": "708" }, { "name": "PHP", "bytes": "33456" } ], "symlink_target": "" }
import bsddb #classes class File(object): '''handle dataobject i/o''' def __init__(self, project, idfix): self.project = project self.idfix = idfix def dump(self): db = bsddb.btopen(self.project, 'c') list = db db.sync() return list def get(self, id): return float(self.dump()[str(id)]) def set(self, timestamp): db = bsddb.btopen(self.project, 'c') db[str(len(db) + self.idfix)] = str(timestamp) db.sync() def lastid(self): db = bsddb.btopen(self.project, 'c') try: id = db.keys()[len(db)-1] except IndexError: id = 1 #uneven db.sync() return int(id)
{ "content_hash": "368f4a982be6007ee38257bc90711b6c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 48, "avg_line_length": 18.21212121212121, "alnum_prop": 0.6289517470881864, "repo_name": "catinello/time-tracker", "id": "9de110e2317d0f6aaacd4af01b096ea64f03bd5e", "size": "633", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tt/data.py", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "503" }, { "name": "Python", "bytes": "4447" }, { "name": "Shell", "bytes": "298" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/motionLayout" app:layoutDescription="@xml/scene_02_autocomplete_false" android:layout_width="match_parent" android:layout_height="match_parent"> <View android:id="@+id/button" android:background="@color/colorAccent" android:layout_width="64dp" android:layout_height="64dp" android:text="Button" tools:layout_editor_absoluteX="147dp" tools:layout_editor_absoluteY="230dp" /> </androidx.constraintlayout.motion.widget.MotionLayout>
{ "content_hash": "05adb56411cdc4b296848cbb3a5eb354", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 74, "avg_line_length": 41, "alnum_prop": 0.7209469153515065, "repo_name": "android/views-widgets-samples", "id": "7382a9042076e92005846826d2fc2e62b9f3158f", "size": "1394", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "ConstraintLayoutExamples/motionlayout/src/main/res/layout/motion_02_basic_autocomplete_false.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1896" }, { "name": "HTML", "bytes": "1663" }, { "name": "Java", "bytes": "469931" }, { "name": "JavaScript", "bytes": "2890" }, { "name": "Kotlin", "bytes": "289433" } ], "symlink_target": "" }
require 'rails_helper' module UnsPerson RSpec.describe Reference, type: :model do pending "add some examples to (or delete) #{__FILE__}" end end
{ "content_hash": "852a3a232c5b791b9b951bd2972b4e01", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 58, "avg_line_length": 22, "alnum_prop": 0.7012987012987013, "repo_name": "unsilo/uns_person", "id": "ce04dfae7cc4643e89d573a1e451a99d049a07de", "size": "154", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/models/uns_person/reference_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1053" }, { "name": "HTML", "bytes": "64727" }, { "name": "JavaScript", "bytes": "3652" }, { "name": "Ruby", "bytes": "173959" } ], "symlink_target": "" }
package com.dian.service.sys; import java.util.List; import com.dian.model.sys.Attachment; import core.service.Service; public interface AttachmentService extends Service<Attachment> { List<Object[]> queryFlowerList(String epcId); void deleteAttachmentByForestryTypeId(Long forestryTypeId); }
{ "content_hash": "fbd267f6df8c1db96416bf4d44ca3d8f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 64, "avg_line_length": 21.133333333333333, "alnum_prop": 0.7665615141955836, "repo_name": "eyeshot/2dianmarket", "id": "eb9e5f92b15d9d32f048014ca2cbc84120d84e18", "size": "317", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/xcx/src/com/dian/service/sys/AttachmentService.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "12376" }, { "name": "Java", "bytes": "21395" }, { "name": "JavaScript", "bytes": "1446168" } ], "symlink_target": "" }
Extra Lazy Associations ======================= .. versionadded:: 2.1 In many cases associations between entities can get pretty large. Even in a simple scenario like a blog. where posts can be commented, you always have to assume that a post draws hundreds of comments. In Doctrine 2.0 if you accessed an association it would always get loaded completely into memory. This can lead to pretty serious performance problems, if your associations contain several hundreds or thousands of entities. With Doctrine 2.1 a feature called **Extra Lazy** is introduced for associations. Associations are marked as **Lazy** by default, which means the whole collection object for an association is populated the first time its accessed. If you mark an association as extra lazy the following methods on collections can be called without triggering a full load of the collection: - ``Collection#contains($entity)`` - ``Collection#containsKey($key)`` (available with Doctrine 2.5) - ``Collection#count()`` - ``Collection#get($key)`` (available with Doctrine 2.4) - ``Collection#slice($offset, $length = null)`` For each of the above methods the following semantics apply: - For each call, if the Collection is not yet loaded, issue a straight SELECT statement against the database. - For each call, if the collection is already loaded, fallback to the default functionality for lazy collections. No additional SELECT statements are executed. Additionally even with Doctrine 2.0 the following methods do not trigger the collection load: - ``Collection#add($entity)`` - ``Collection#offsetSet($key, $entity)`` - ArrayAccess with no specific key ``$coll[] = $entity``, it does not work when setting specific keys like ``$coll[0] = $entity``. With extra lazy collections you can now not only add entities to large collections but also paginate them easily using a combination of ``count`` and ``slice``. Enabling Extra-Lazy Associations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The mapping configuration is simple. Instead of using the default value of ``fetch="LAZY"`` you have to switch to extra lazy as shown in these examples: .. configuration-block:: .. code-block:: php <?php namespace Doctrine\Tests\Models\CMS; use Doctrine\ORM\Annotation as ORM; /** * @ORM\Entity */ class CmsGroup { /** * @ORM\ManyToMany(targetEntity="CmsUser", mappedBy="groups", fetch="EXTRA_LAZY") */ public $users; } .. code-block:: xml <?xml version="1.0" encoding="UTF-8"?> <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> <entity name="Doctrine\Tests\Models\CMS\CmsGroup"> <!-- ... --> <many-to-many field="users" target-entity="CmsUser" mapped-by="groups" fetch="EXTRA_LAZY" /> </entity> </doctrine-mapping>
{ "content_hash": "86bacd6af09a8ad713aa64db673e07db", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 160, "avg_line_length": 42.21052631578947, "alnum_prop": 0.6770573566084788, "repo_name": "lcobucci/doctrine2", "id": "407de5e05240aa0864a2ee59acbea50e0e44d5c1", "size": "3208", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/en/tutorials/extra-lazy-associations.rst", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "220" }, { "name": "PHP", "bytes": "4576495" }, { "name": "Shell", "bytes": "1544" } ], "symlink_target": "" }
rss: false layout: article title: "Inspect and Tweak Your Pages: the Basics" seotitle: "Inspect and Tweak Your Pages in the Chrome DevTools Elements Panel" description: "Inspect and live-edit the HTML & CSS of a web page using the Chrome DevTools Elements panel." introduction: "Inspect and live-edit the HTML & CSS of a web page using the Chrome DevTools Elements panel." article: written_on: 2015-04-14 updated_on: 2015-04-28 order: 1 authors: - megginkearney related-guides: edit-styles: - title: Edit Styles href: tools/iterate/inspect-styles/edit-styles section: title: "Edit Styles" href: tools/iterate/inspect-styles/edit-styles edit-dom: - title: Edit the DOM href: tools/iterate/inspect-styles/edit-dom section: title: "Edit the DOM" href: tools/iterate/inspect-styles/edit-styles priority: 0 collection: inspect-styles key-takeaways: dom-styles: - The Elements panel lets you see everything in one DOM tree, and allows inspection and on-the-fly editing of DOM elements. - The Styles pane shows the CSS rules that apply to the selected element, from highest priority to lowest. - The Metrics pane below the styles pane shows the current element's box model. - The Sources panel lets you see the changes you've made to your page locally. - This doc covers only the very basics of inspecting and tweaking your pages. See the related guides to learn all there is to know about editing your pages. remember: cascade-inheritance: - Understanding how cascading and inheritance works is essential to debugging your styles. The cascade relates to how CSS declarations are given weights to determine which rules should take precedence when they overlap with another rule. Inheritance relates to how HTML elements inherit CSS properties from their containing elements (ancestors). For more, see <a href="http://www.w3.org/TR/CSS2/cascade.html">W3C documentation on cascading</a>. current-tree: - The DOM tree view shows the current state of the tree; it may not match the HTML that was originally loaded for different reasons. For example, you can modify the DOM tree using JavaScript; the browser engine can try to correct invalid author markup and produce an unexpected DOM: --- {% wrap content %} Having a real-time representation of the page can be a powerful tool when debugging and authoring web pages. The Chrome DevTools Elements panel lets you view structured information about the current page and make live-edits. The Styles pane within the Elements panel shows the CSS rules applied to the individual elements in the page structure. For example, here’s a heading element selected in the Elements panel showing the styles applied to that element in the Styles pane: ![Viewing a heading element in the DOM](imgs/elements-panel.png) {% include modules/toc.liquid %} {% include modules/takeaway.liquid list=page.key-takeaways.dom-styles %} ## How to inspect a page Use the **Elements panel** to inspect all elements in your page in one DOM tree. Select any element and inspect the styles applied to it. ![Inspect element animation](animations/inspect-element.png) ### Inspect an element There are several ways to inspect an element: * Right-click any element on the page the page and select **Inspect Element**. * Press **Ctrl + Shift + C** (or **Cmd + Shift + C** on Mac) to open DevTools in Inspect Element mode, then click on an element. * Click the **Inspect Element button** ![Inspect icon](imgs/inspect-icon.png) at the top of the DevTools window to go into Inspect Element Mode, then click on an element. * Use the `inspect()` method in the console, such as `inspect(document.body)`. See the [Command Line API Reference](tools/javascript/command-line/command-line-reference) for information on using inspect. ### Inspect styles applied to an element The Styles pane shows the CSS rules that apply to the selected element, from highest priority to lowest: * Element styles applied directly to the element using the style property (or applied in DevTools). * Matched CSS rules include any rules matched by the element. For example, the CSS selector `span` matches an HTML `<span>` element. * Inherited styles include any inheritable style rules that match the selected element's ancestors. The labels on the image below correspond with the numbered items below. ![Annotated Styles pane](imgs/styles-annotated.png) 1. Styles associated with a selector that matches the element. 2. **Cascade** rules dictate that if two rules have the same origin, weight, and specificity, the last defined rule takes precedence. In this case, the second color property takes precedence. The first color property is shown in strikethrough text to show that it's been overridden. 3. [User agent stylesheets](http://meiert.com/en/blog/20070922/user-agent-style-sheets/) are clearly labelled, and are often overridden by the CSS on your web page. 4. The **cascade** dictates that author styles have more weight than user agent styles, so the user-defined style of `display: inline-block;` overrides the user-agent defined style of `display: block`. 5. **Inherited** styles are displayed as a group under the "Inherited from [node]" header. Click the DOM node in the header to navigate to its position in the DOM tree view. (The [CSS 2.1 properties table](http://www.w3.org/TR/CSS21/propidx.html) shows which properties are inheritable.) 6. The selector `:root body` has a higher **specificity** than just `body`, therefore its style declarations take precedence. 7. `font-family` on the body is **overridden**. It is also a similar case for the `font-size` property (overridden due to [selector specificity](http://www.w3.org/TR/css3-selectors/#specificity)). {% include modules/remember.liquid title="Note" list=page.remember.cascade-inheritance %} ## How to live-edit a DOM node To live-edit a DOM node, simply double-click on a [selected element](#inspect-an-element) and make changes: ![Editable DOM node](animations/edit-element-name.png) {% include modules/remember.liquid title="Note" list=page.remember.current-tree %} {% include modules/related_guides.liquid inline=true list=page.related-guides.edit-dom %} ## How to live-edit a style Live-edit styles within the **Styles pane** in the Elements panel. Unless the area containing the styling information is greyed out (as is the case with user agent stylesheets), all styles are editable. To edit a property name, click on it, edit, and press Tab or Enter: ![Edit property name](imgs/image_20.png) To edit the property's value, click on that value, edit, and press Tab or Enter: ![Edit property value](imgs/image_21.png) By default, your CSS modifications are not permanent, changes are lost when you reload the page. We recommend [setting up persistent authoring](tools/setup/workspace/setup-workflow) so your changes aren't lost. {% include modules/related_guides.liquid inline=true list=page.related-guides.edit-styles %} ## Visualize an element's box model parameters Examine and edit the current element's box model parameters using the Metrics pane. The Metrics pane resides just below the Styles pane. The concentric rectangles contain the values for the **padding**, **border**, and **margin** properties (top, right, bottom, and left values for each of them.) For non-statically positioned elements, a **position** rectangle will be additionally displayed in the pane, containing the values of the **top**, **right**, **bottom**, and **left** properties. ![Metrics pane](imgs/metrics.png) For `position: fixed` and `position: absolute` elements, the central field contains the actual **offsetWidth × offsetHeight** pixel dimensions of the selected element. All values can be modified by double-clicking them, like property values in the Styles pane (the changes are not, however, guaranteed to take effect, as this is subject to the concrete element positioning specifics.) ## View local changes To view a history of live-edits made to your page: * Open the **Sources** panel. * Right-click (or **Ctrl + Click** on Mac) on a source file in the sidebar. * Select **Local modifications**. ![How to get to local modifications](animations/revisions.png) To explore the changes made: * Expand top-level file names to view the time ![time modification occurred](imgs/image_25.png)a modification occurred. * Expand second-level items to view a [diff](http://en.wikipedia.org/wiki/Diff) (before and after) corresponding to the modification. A line with a pink background signifies a removal while a line with a green background signifies an addition. ![View diffs based on local edits](animations/revision-apply-original.png) ## Undo changes As mentioned earlier in this guide, if you haven't set up persistent authoring, any time you reload the page, all live-edits are lost. So [set up persistent authoring](tools/setup/workspace/setup-workflow). Assuming you've set up persistent authoring, to undo changes: * Use **Ctrl + Z** (or **Ctrl + Z** on Mac) to quickly undo minor changes to the DOM or styles via the Elements panel. * To undo all local modifications made to a file, open the **Sources** panel and select **revert** next to the filename. {% include modules/nextarticle.liquid %} {% endwrap %}
{ "content_hash": "5fbe70a4279a1258eedfd427ac1971c4", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 448, "avg_line_length": 57.592592592592595, "alnum_prop": 0.762593783494105, "repo_name": "paulirish/WebFundamentals", "id": "5b0fa3e0d316af8a7f2690128b742acf8673c5fb", "size": "9337", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/_langs/en/tools/iterate/inspect-styles/basics.markdown", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "208823" }, { "name": "HTML", "bytes": "451106" }, { "name": "JavaScript", "bytes": "19686" }, { "name": "Liquid", "bytes": "88220" }, { "name": "Makefile", "bytes": "572" }, { "name": "PHP", "bytes": "58019" }, { "name": "Python", "bytes": "2689" }, { "name": "Ruby", "bytes": "64013" }, { "name": "Shell", "bytes": "727" }, { "name": "Smarty", "bytes": "4892" } ], "symlink_target": "" }
use strict; use Getopt::Long; use File::Basename qw(basename dirname); my $usage= "\n$0 --etb \t<str>\tenrichment result table in the format column one sample, row one gene set --gmt \t<str>\tgene sets file in gmt format --outDir \t<str>\toutput directory --pv \t<str>\tpvalue cutoff to filter etb file. at least one sample greater than this value \t\t(default 0.05) --ovlpR \t<str>\toverlap ratio cutoff (default 0.1). \t\tthe overlap ratio is calculated by overlap_gene_num/gene_num_in_gsets. --minOvlp \t<str>\tminimal overlap numbers (default 3) --mcls \t<str>\tmethod class. currently SEA, GSEA and MEA (default GSEA) --rnklist \t<str>\tgene file list, in the format: \t\tID<tb>FilePath \t\tfor the file, every file in the format: \t\tGeneID<tb>Pvalue<tb>logFC #for SEA based enrichment --idlist \t<str>\tgene id file list, in the format: \t\tSampleID<tb>FilePath \t\tfor the file, every file contain gene ids with one id one line. --method \t<str>\tenrichment analysis method. \tfor GSEA currently support: \t\tfrom piano R package: fisher, stouffer, reporter, tailStrength, wilcoxon, mean, median, sum, maxmean, gsea or page. \t\tevery method can be concatenated by comma. (default is gsea) \tfor SEA currently support: \t\tFisherChiSquare, HyperGeometric --bakid \t<str>\tfor SEA. background id file, one id one line, if undefined the all \t\tids in the gmt will be used as background. NOTE: this program adopt the algorithm from GOFunction to filter \tthe enrichment results according two criteria: \tlocal redundancy and global redundancy \n"; my($etb,$pv,$gmt,$outDir,$method,$rnklist,$mcls,$idlist,$ovlpR,$minOvlp,$bakid); GetOptions( "etb:s"=>\$etb, "gmt:s"=>\$gmt, "outDir:s"=>\$outDir, "method:s"=>\$method, "mcls:s"=>\$mcls, "rnklist:s"=>\$rnklist, "pv:f"=>\$pv, "ovlpR:f"=>\$ovlpR, "minOvlp:i"=>\$minOvlp, "idlist:s"=>\$idlist, "bakid:s"=>\$bakid ); die $usage if !defined $gmt; $pv ||= 0.05; $ovlpR ||= 0.1; $minOvlp ||= 3; my $etb_base = basename $etb; my $gmt_base = basename $gmt; my $dir = dirname $0; `mkdir -p $outDir` if ! -e "$outDir"; #produce the local and global gene sets `mkdir -p $outDir/GO_local` if ! -e "$outDir/GO_local"; `mkdir -p $outDir/Global_local` if ! -e "$outDir/Global_local"; `mkdir -p $outDir/Global` if ! -e "$outDir/Global"; `mkdir -p $outDir/Combin` if ! -e "$outDir/Combin"; my $rscp = qq# options(stringsAsFactors=FALSE) library(GO.db) \#read in database \#gene sets tmp <- scan("$gmt",what="character",sep="\\n") gsets <- sapply(tmp,function(x) strsplit(x,"\\t")[[1]][-c(1,2)]) names(gsets) <- sapply(tmp,function(x) strsplit(x,"\\t")[[1]][1]) setDes <- sapply(tmp,function(x) strsplit(x,"\\t")[[1]][2]) names(setDes) <- toupper(names(gsets)) names(gsets) <- toupper(names(gsets)) etb <- read.table("$etb",sep="\\t",header=TRUE,row.names=1,check.names=FALSE) etb <- etb[which(apply(etb,1,function(x) any(x<$pv))),] rownames(etb) <- toupper(rownames(etb)) write.table(etb,file="$outDir/orig.$etb_base.filtpv",sep="\\t",quote=FALSE,col.names=NA) gsets <- gsets[rownames(etb)] setDes <- setDes[rownames(etb)] goids <- names(gsets)[grep("^GO:",names(gsets))] goids.onto <- select(GO.db,keys=goids,columns=c("GOID","ONTOLOGY"),keytype="GOID") goids.all <- tapply(goids.onto[,1],goids.onto[,2],as.character) goids.off <- list() goids.off <- c(goids.off,mget(goids.all[["BP"]],GOBPOFFSPRING)) goids.off <- c(goids.off,mget(goids.all[["MF"]],GOMFOFFSPRING)) goids.off <- c(goids.off,mget(goids.all[["CC"]],GOCCOFFSPRING)) goids.off <- sapply(goids.off,function(x) intersect(x,goids)) goids.off <- goids.off[sapply(goids.off,length)>0] \#local gene sets off.dif.gmt <- data.frame(setid="a",des="b",gids="c") off.dif.tb <- data.frame(ancesID="a",offID="b",ancesGnum=1,offGnum=1,spcNum=0) for(i in names(goids.off)){ i.in <- intersect(goids.off[[i]],goids) if(length(i.in)==0) next offgids <- unique(as.character(unlist(gsets[i.in]))) spcid <- setdiff(gsets[[i]],offgids) if(length(spcid)>2) off.dif.gmt <- rbind(off.dif.gmt,c( i,setDes[i], paste(spcid,collapse="\\t"))) off.dif.tb <- rbind(off.dif.tb,c( i,paste(i.in,collapse=","),length(gsets[[i]]),length(offgids), length(spcid))) } off.dif.gmt <- off.dif.gmt[-1,] off.dif.tb <- off.dif.tb[-1,] write.table(off.dif.gmt,file="$outDir/GO_local/local.gmt",sep="\\t",quote=FALSE,row.names=FALSE,col.names=FALSE) write.table(off.dif.tb,file="$outDir/GO_local/local.gmt.gNum",sep="\\t",quote=FALSE,row.names=FALSE) \#global gene sets setids <- names(gsets) glb.gmt.tb <- data.frame(set1="a",set2="b",OverlapN=1,set1_spcN=1,set2_spcN=2,set1_spcI="a",set2_spcI="b") glb.gmt <- data.frame(setid="a",des="b",gids="a") for(i in 1:(length(gsets)-1)){ for(j in (i+1):length(gsets)){ if(is.element(setids[j],goids.off[[setids[i]]]) || is.element(setids[i],goids.off[[setids[j]]])) next commid <- intersect(gsets[[setids[i]]],gsets[[setids[j]]]) if(length(commid) < $minOvlp) next if(length(commid)/length(gsets[[setids[j]]]) < $ovlpR && length(commid)/length(gsets[[setids[j]]]) < $ovlpR) next spcid.i <- setdiff(gsets[[setids[i]]],gsets[[setids[j]]]) spcid.j <- setdiff(gsets[[setids[j]]],gsets[[setids[i]]]) glb.gmt.tb <- rbind(glb.gmt.tb, c(setids[i],setids[j], length(commid), length(spcid.i), length(spcid.j), paste(spcid.i,collapse=","), paste(spcid.j,collapse=","))) if(length(spcid.i)>2){ glb.gmt <- rbind(glb.gmt, c(paste(setids[i],"_SPC_VS_",setids[j],sep=""), paste(setids[i],"_SPC_VS_",setids[j],sep=""), paste(spcid.i,collapse="\\t"))) } if(length(spcid.j)>2){ glb.gmt <- rbind(glb.gmt, c(paste(setids[i],"_VS_",setids[j],"_SPC",sep=""), paste(setids[i],"_VS_",setids[j],"_SPC",sep=""), paste(spcid.j,collapse="\\t"))) } } } glb.gmt <- glb.gmt[-1,] glb.gmt.tb <- glb.gmt.tb[-1,] write.table(glb.gmt,file="$outDir/Global/glb.gmt",sep="\\t",quote=FALSE,row.names=FALSE,col.names=FALSE) write.table(glb.gmt.tb,file="$outDir/Global/glb.gmt.tb",sep="\\t",quote=FALSE,row.names=FALSE) \#global local sets ids.off <- vector("list",length=length(gsets)) names(ids.off) <- names(gsets) ids.off[names(goids.off)] <- goids.off for(i in 1:dim(glb.gmt.tb)[1]){ if(glb.gmt.tb[i,4]>2 && glb.gmt.tb[i,5]<3){ ids.off[[glb.gmt.tb[i,1]]] <- append(ids.off[[glb.gmt.tb[i,1]]],glb.gmt.tb[i,2]) } if(glb.gmt.tb[i,5]>2 && glb.gmt.tb[i,4]<3){ ids.off[[glb.gmt.tb[i,2]]] <- append(ids.off[[glb.gmt.tb[i,2]]],glb.gmt.tb[i,1]) } } glocal.gmt <- data.frame(setid="a",des="a",gids="a") glocal.tb <- data.frame(ancesID="a",offID="a",acesGnum=1,offGnum=1,spcNum=1) ids.off <- ids.off[sapply(ids.off,length)>0] ids.off <- sapply(ids.off,function(x) unique(x)) for(i in names(ids.off)){ offgids <- unique(as.character(unlist(gsets[ids.off[[i]]]))) spcid <- setdiff(gsets[[i]],offgids) if(length(spcid)>2) glocal.gmt <- rbind(glocal.gmt,c( paste(i,"_glocal",sep=""),setDes[i], paste(spcid,collapse="\\t"))) glocal.tb <- rbind(glocal.tb,c( paste(i,"_glocal",sep=""),paste(ids.off[[i]],collapse=","),length(gsets[[i]]),length(offgids), length(spcid))) } glocal.gmt <- glocal.gmt[-1,] glocal.tb <- glocal.tb[-1,] write.table(glocal.gmt,file="$outDir/Global_local/glocal.gmt",sep="\\t",quote=FALSE,row.names=FALSE,col.names=FALSE) write.table(glocal.tb,file="$outDir/Global_local/glocal.tb",sep="\\t",quote=FALSE,row.names=FALSE) write.table(rbind(off.dif.gmt,glb.gmt,glocal.gmt),file="$outDir/Global/glb.local.gmt",sep="\\t",quote=FALSE,row.names=FALSE,col.names=FALSE) q('no') #; open O,">","$outDir/GOFunction.produceGMT.GSEA.R"; print O $rscp; close O; if(! -e "$outDir/Global/glb.local.gmt"){ `R CMD BATCH $outDir/GOFunction.produceGMT.GSEA.R $outDir/GOFunction.produceGMT.GSEA.Rout`; } if($mcls eq "GSEA"){ #run piano do enrichment open O,">","$outDir/01.run_piano.sh"; open O2,">","$outDir/Etb.cfg"; open I,$rnklist; my(@info,$id); while(<I>){ chomp; @info=split /\t/; my $rnk_base = basename $info[1]; print O "perl $dir/run_piano.pl --gmt $outDir/Global/glb.local.gmt --outDir $outDir/$rnk_base.enrich --glevel $info[1] --method $method --minG 3 --maxG 1950\n"; print O2 "$rnk_base.Up\tDown\n$rnk_base.Down\tUp\n"; #the second column Up/Down denote the direction in B for the format A-VS-B } close I; close O; close O2; #parse piano results open O2,">","$outDir/02.parse_piano.sh"; foreach $id (split /,/,$method){ open I1,$rnklist; open O,">","$outDir/enrich.$id"; while(<I1>){ chomp;@info=split /\t/; my $rnk_base = basename $info[1]; print O "$info[0]\t$outDir/$rnk_base.enrich/$info[0].piano.$id\n"; } close I1; close O; print O2 "\n#parse piano file\n"; print O2 "perl $dir/parse_piano.pl --outDir $outDir/ --pianof $outDir/enrich.$id\n\n"; } close O2; #local and global redunction $rscp = qq# \#read in data sets options(stringsAsFactors=FALSE) source("$dir/EACO_R_Fun.R") orig.enrich <- read.table("$outDir/orig.enrich.$method.padj.tb.filtpv",sep="\\t",header=TRUE,row.names=1,check.names=FALSE) sub.enrich <- read.table("$outDir/enrich.$method.pv.tb",sep="\\t",header=TRUE,row.names=1,check.names=FALSE) sub.enrich[is.na(sub.enrich)] <- 1 go.local.gmt <- read.gmt("$outDir/GO_local/local.gmt") glb.gmt <- read.gmt("$outDir/Global/glb.gmt") glocal.gmt <- read.gmt("$outDir/Global_local/glocal.gmt") orig.gmt <- read.gmt("$gmt") go.local.tb <- read.table("$outDir/GO_local/local.gmt.gNum",sep="\\t",header=TRUE,row.names=1,check.names=FALSE) glb.tb <- read.table("$outDir/Global/glb.gmt.tb",sep="\\t",header=TRUE,check.names=FALSE) glocal.tb <- read.table("$outDir/Global_local/glocal.tb",sep="\\t",header=TRUE,row.names=1,check.names=FALSE) rownames(glocal.tb) <- gsub("_glocal","",rownames(glocal.tb)) \#GO local redundancy local.res <- GOFunction.local(go.local.tb,orig.enrich,sub.enrich,orig.gmt,pv=$pv,out.dir="$outDir/GO_local") write.table(orig.enrich[names(local.res[["setDes"]]),],file="$outDir/GO_local/$etb_base.local.tb",sep="\\t",col.names=NA, quote=FALSE) \#global redundancy glb.res <- GOFunction.glb(glb.tb,orig.enrich,sub.enrich,orig.gmt,pv=$pv,out.dir="$outDir/Global") write.table(orig.enrich[names(glb.res[["setDes"]]),],file="$outDir/Global/$etb_base.global.tb",sep="\\t",col.names=NA, quote=FALSE) \#Global local redundancy sub.enrich.glocal <- sub.enrich[grep("glocal",rownames(sub.enrich)),] rownames(sub.enrich.glocal) <- gsub("_glocal","",rownames(sub.enrich.glocal)) glocal.res <- GOFunction.local(glocal.tb,orig.enrich,sub.enrich.glocal,orig.gmt,pv=$pv,out.dir="$outDir/Global_local") write.table(orig.enrich[names(glocal.res[["setDes"]]),],file="$outDir/Global_local/$etb_base.glocal.tb",sep="\\t",col.names=NA, quote=FALSE) \#combine the results together and output \#intersect of these three results commids <- intersect(intersect(names(glb.res[["setDes"]]),names(local.res[["setDes"]])),names(glocal.res[["setDes"]])) mergids <- unique(c(names(glb.res[["setDes"]]),names(local.res[["setDes"]]),names(glocal.res[["setDes"]]))) merg.des <- data.frame(gsetID=mergids, go.local=rep(NA,length(mergids)), global=rep(NA,length(mergids)), glocal=rep(NA,length(mergids))) rownames(merg.des) <- mergids merg.des[names(local.res[["setDes"]]),"go.local"] <- local.res[["setDes"]] merg.des[names(glb.res[["setDes"]]),"global"] <- glb.res[["setDes"]] merg.des[names(glocal.res[["setDes"]]),"glocal"] <- glocal.res[["setDes"]] write(commids,file="$outDir/Combin/gset.commids") write(mergids,file="$outDir/Combin/gset.mergids") write.table(merg.des,file="$outDir/Combin/combin.setDes.tb",row.names=FALSE,quote=FALSE,sep="\\t") write.table(orig.enrich[mergids,],file="$outDir/Combin/$etb_base.mergids.tb",sep="\\t",col.names=NA,quote=FALSE) write.table(orig.enrich[commids,],file="$outDir/Combin/$etb_base.commids.tb",sep="\\t",col.names=NA,quote=FALSE) save(local.res,glb.res,glocal.res,file="$outDir/GOFunction_reduction.RData") q('no') #; #check whether the piano was run if(-e "$outDir/enrich.$method.pv.tb"){ open O,">","$outDir/GOFunction.reduce.GSEA.R"; print O $rscp; close O; if(! -e "$outDir/GOFunction_reduction.RData"){ `R CMD BATCH $outDir/GOFunction.reduce.GSEA.R $outDir/GOFunction.reduce.GSEA.Rout`; } } } if($mcls eq "SEA"){ #run SEA enrichment for the preconstructed gene sets my(@info); open I,$idlist; open O,">","$outDir/01.run_SEA.sh"; open O2,">","$outDir/difsea.list"; while(<I>){ chomp; @info=split /\t/; my $file_base = basename $info[1]; print O "perl $dir/run_SEA.pl --gmt $outDir/Global/glb.local.gmt --outDir $outDir/01.Enrich --supplyID $info[1] --bakid $bakid\n"; print O2 "$outDir/01.Enrich/$file_base.difsea\n"; } close O;close O2; #cat the enrichment together open O,">","$outDir/02.pase_SEA.sh"; print O "#cat together the enrichment results\n"; print O "perl $dir/cat_enrich_result_to_pvtb.pl --difcfg $outDir/difsea.list --outDir $outDir/\n\n"; close O; #local and global redunction $rscp = qq# \#read in data sets options(stringsAsFactors=FALSE) source("$dir/EACO_R_Fun.R") orig.enrich <- read.table("$outDir/orig.difsea.list.qv.tb.filtpv",sep="\\t",header=TRUE,row.names=1,check.names=FALSE) sub.enrich <- read.table("$outDir/difsea.list.pv.tb",sep="\\t",header=TRUE,row.names=1,check.names=FALSE) go.local.gmt <- read.gmt("$outDir/GO_local/local.gmt") glb.gmt <- read.gmt("$outDir/Global/glb.gmt") glocal.gmt <- read.gmt("$outDir/Global_local/glocal.gmt") orig.gmt <- read.gmt("$gmt") go.local.tb <- read.table("$outDir/GO_local/local.gmt.gNum",sep="\\t",header=TRUE,row.names=1,check.names=FALSE) glb.tb <- read.table("$outDir/Global/glb.gmt.tb",sep="\\t",header=TRUE,check.names=FALSE) glocal.tb <- read.table("$outDir/Global_local/glocal.tb",sep="\\t",header=TRUE,row.names=1,check.names=FALSE) rownames(glocal.tb) <- gsub("_glocal","",rownames(glocal.tb)) \#GO local redundancy local.res <- GOFunction.local(go.local.tb,orig.enrich,sub.enrich,orig.gmt,pv=$pv,out.dir="$outDir/GO_local") write.table(orig.enrich[names(local.res[["setDes"]]),],file="$outDir/GO_local/$etb_base.local.tb",sep="\\t",col.names=NA, quote=FALSE) \#global redundancy glb.res <- GOFunction.glb(glb.tb,orig.enrich,sub.enrich,orig.gmt,pv=$pv,out.dir="$outDir/Global") write.table(orig.enrich[names(glb.res[["setDes"]]),],file="$outDir/Global/$etb_base.global.tb",sep="\\t",col.names=NA, quote=FALSE) \#Global local redundancy sub.enrich.glocal <- sub.enrich[grep("glocal",rownames(sub.enrich)),] rownames(sub.enrich.glocal) <- gsub("_glocal","",rownames(sub.enrich.glocal)) glocal.res <- GOFunction.local(glocal.tb,orig.enrich,sub.enrich.glocal,orig.gmt,pv=$pv,out.dir="$outDir/Global_local") write.table(orig.enrich[names(glocal.res[["setDes"]]),],file="$outDir/Global_local/$etb_base.glocal.tb",sep="\\t",col.names=NA, quote=FALSE) \#combine the results together and output \#intersect of these three results commids <- intersect(intersect(names(glb.res[["setDes"]]),names(local.res[["setDes"]])),names(glocal.res[["setDes"]])) mergids <- unique(c(names(glb.res[["setDes"]]),names(local.res[["setDes"]]),names(glocal.res[["setDes"]]))) merg.des <- data.frame(gsetID=mergids, go.local=rep(NA,length(mergids)), global=rep(NA,length(mergids)), glocal=rep(NA,length(mergids))) rownames(merg.des) <- mergids merg.des[names(local.res[["setDes"]]),"go.local"] <- local.res[["setDes"]] merg.des[names(glb.res[["setDes"]]),"global"] <- glb.res[["setDes"]] merg.des[names(glocal.res[["setDes"]]),"glocal"] <- glocal.res[["setDes"]] write(commids,file="$outDir/Combin/gset.commids") write(mergids,file="$outDir/Combin/gset.mergids") write.table(merg.des,file="$outDir/Combin/combin.setDes.tb",row.names=FALSE,quote=FALSE,sep="\\t") write.table(orig.enrich[mergids,],file="$outDir/Combin/$etb_base.mergids.tb",sep="\\t",col.names=NA,quote=FALSE) write.table(orig.enrich[commids,],file="$outDir/Combin/$etb_base.commids.tb",sep="\\t",col.names=NA,quote=FALSE) save(local.res,glb.res,glocal.res,file="$outDir/GOFunction_reduction.RData") q('no') #; #check whether the piano was run if(-e "$outDir/difsea.list.pv.tb"){ open O,">","$outDir/GOFunction.reduce.GSEA.R"; print O $rscp; close O; if(! -e "$outDir/GOFunction_reduction.RData"){ `R CMD BATCH $outDir/GOFunction.reduce.GSEA.R $outDir/GOFunction.reduce.GSEA.Rout`; } } }
{ "content_hash": "b1f53f8022a450bd9c3d74588b707a2b", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 164, "avg_line_length": 38.90714285714286, "alnum_prop": 0.676763967933419, "repo_name": "pengchy/EACO", "id": "546ba676ca1b13ebe5145cca44dd368df445de15", "size": "16418", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bin/run_GOFunction.pl", "mode": "33188", "license": "mit", "language": [ { "name": "Groff", "bytes": "10883" }, { "name": "Perl", "bytes": "112336" }, { "name": "R", "bytes": "118917" }, { "name": "Shell", "bytes": "15545" } ], "symlink_target": "" }
The algorithm screens and characterizes nodules as well as masses and scans for emphysema as well as aorta calcifications using pre-trained models. In the end, the results are aggregated and the cancer probability is calculated using XGBoost. ## Source **Author:** Pierre Fillard **Repository:** https://github.com/pfillard/tpx-kaggle-dsb2017 ## License GNU General Public License v3.0 ## Prerequisites This is the recommended / tested environment ```eval_rst +----------------+-----------+----------------------+ | Dependency | Name | Version | +================+===========+======================+ | Language | Python | 3.5 | +----------------+-----------+----------------------+ | ML engine | | | +----------------+-----------+----------------------+ | ML backend | | Tensorflow 1.1 | +----------------+-----------+----------------------+ | OS | Ubuntu | 16.04 x64 | +----------------+-----------+----------------------+ | Processor | CPU | 2x Intel i7 | +----------------+-----------+----------------------+ | | GPU | 4xNVIDIA Titan | +----------------+-----------+----------------------+ | Alternative GPU| GPU | NVIDIA NVIDIA P6000 | +----------------+-----------+----------------------+ | GPU driver | CUDA | 8 | +----------------+-----------+----------------------+ | | cuDNN | 5.1 | +----------------+-----------+----------------------+ ``` **Dependency packages:** All dependencies have been installed using `pip3`. ```python https://github.com/pfillard/tensorflow/tree/r1.0_relu1 xgboost numpy scipy skimage SimpleITK h5py optparse ``` ## Algorithm design Unfortunately, there is no technical report or blog post about the approach so far. Thus, the following notes have been derived from the source code only. ### Data format The input data is expected to have been converted in ITK MetaImage (.mhd, .raw) format. Some suggested ressources for that are [here](https://itk.org/ITKExamples/src/IO/GDCM/ReadDICOMSeriesAndWrite3DImage/Documentation.html) and [here](http://manpages.ubuntu.com/manpages/precise/man1/gdcm2vtk.1.html). ### Preprocessing The algorithm first segments the lung using a VGG-like 3DConvNet. ### Nodule detection Using 5 pre-trained models, the algorithm searches for nodules and saves their location together with the probability of the detection really being a nodule. Next, two models estimate the malignancy and the size of the nodules using regression techniques. ### Further features #### Mass detection Using the same models as for nodule detection, the algorithm tries to detect masses that might also exist beyond the lungs. The same models as for the nodule characterization are used to estimate size and malignancy of them. #### Emphysema scan For each image series, one model scans for emphysema (a lung disease that's responsible for short breath and is most often caused by smoking). The model outputs ten values labeled 'eh0' to 'eh9' whose meaning is still enigmatic to me. #### Aorta calcification Lastly, one model is applied to find calcifications of the aorta. The model outputs ten values labeled 'ah01' to 'ah10'. ### Prediction of cancer probability The features created in the previous steps, which have been saved to separate CSV files, are firstly aggregated into one CSV file. That file only uses the features: eh0, eh1, eh2, max_nod_size, max_nod_size, prob_max_nod, max_malignancy, prob_max_mal, ah0, ah1 and ah2. Lastly, XGBoost predicts the cancer probability based on these features. ## Trained model **Source:** https://github.com/pfillard/tpx-kaggle-dsb2017/tree/master/models **Usage instructions:** - Use `train.py` for feature extraction and model training - Use `predict.py` to make predictions ## Model Performance ### Training- / prediction time Unknown **Test system:** </br> ```eval_rst +-----------+-------+-------+ | Component | Spec | Count | +===========+=======+=======+ | CPU | | | +-----------+-------+-------+ | GPU | | | +-----------+-------+-------+ | RAM | | | +-----------+-------+-------+ ``` **Training time:** </br> **Prediction time:** </br> ### Model Evaluation **Dataset:** Data Science Bowl 2017 ```eval_rst +----------+--------+ | Metric | Score | +==========+========+ | Log Loss | 0.40409| +----------+--------+ ``` ## Use cases ### When to use this algorithm - if we also want to include information about masses beyond the lung, emphysema or aorta calcification - if we're fine with working with black-box algorithms ### When to avoid this algorithm - if converting images in ITK MetaImage is not feasible - if we want to understand what the design decisions of the author have been regarding network architecture etc. (no documentation given) ## Adaptation into Concept To Clinic ### Porting to Python 3.5+ The algorithm was written to run with Python 3.5. ### Porting to run on CPU and GPU When trying to run the code without a GPU, I'm getting errors when the models are restored. However, I think that it should be possible to port the models to run on CPUs. I'm just not that experienced with Tensorflow so far. ### Improvements on the code base The `kaggle_utils` and the `lidc` files need to be refactored as they already consist of over 600, respectively, 1100 lines of code. ### Adapting the model It's questionable how much impact the additional features have and how well the nodule detection works itself. Also, the models still are big black-boxes that first need to be interpreted in order to understand them and to make changes that can improve them. ## Comments I'm positively surprised by how well the author documented the technical requirements and how easy it is to overlook the codebase. Unfortunately, I haven't found a blog article or technical report about the approach. Thus, one is supposed to derive from the code what the author's solution concept is and what's the models architectures are. Furthermore, I'm not sure how one is supposed to install the Tensorflow 1.0 fork of the author which adds a patch for relu. It seems that one is required to compile it oneself using `./configure` and `bazel`. I contacted the author and asked for any advices on how to understand the pre-trained models and how to improve the approach to actually use it in an application. However, since the author seems to sell this approach or similar solutions to customers, I doubt that he will be able to help us a lot. ## References [Repository](https://github.com/pfillard/tpx-kaggle-dsb2017) [Sales Homepage](http://therapixel.com/)
{ "content_hash": "b0ecb103969d6fbbc95a4f300115ab8a", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 214, "avg_line_length": 40.535714285714285, "alnum_prop": 0.6323054331864905, "repo_name": "vessemer/concept-to-clinic", "id": "5e3378bbec85709b21cf7d92fd16f142fa907743", "size": "6836", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "docs/algorithms/algorithm_therapixel.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "777" }, { "name": "HTML", "bytes": "442" }, { "name": "JavaScript", "bytes": "31269" }, { "name": "Python", "bytes": "296297" }, { "name": "Shell", "bytes": "2951" }, { "name": "Vue", "bytes": "70043" } ], "symlink_target": "" }
Duolingo is a wrapper gem for the duolingo api. It allows you to query the api for a particular users details. ## Installation Add this line to your application's Gemfile: gem 'duolingo' And then execute: $ bundle Or install it yourself as: $ gem install duolingo ## Usage The information you can get with this gem are listed below: * **get_all_info** - This gives you back an array containing all the users basic information ```ruby username = "Novohispano" user = Duolingo::User.new(username) user.get_all_info ``` ## Contributing 1. Fork it ( http://github.com/<my-github-username>/duolingo/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
{ "content_hash": "287a2106f92cde0ca8f41da8be7bec0c", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 92, "avg_line_length": 23.857142857142858, "alnum_prop": 0.725748502994012, "repo_name": "mrageh/duolingo", "id": "ad1d11751afd7adbe16c3334ef2436cf62653b53", "size": "961", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "7588" } ], "symlink_target": "" }
package edu.utah.further.core.api.collections.page; import edu.utah.further.core.api.context.Api; import edu.utah.further.core.api.context.Labeled; /** * This type is a factory of pagers (paging iterators). Registered by a * {@link PagingProvider}. * -----------------------------------------------------------------------------------<br> * (c) 2008-2013 FURTHeR Project, Health Sciences IT, University of Utah<br> * Contact: {@code <further@utah.edu>}<br> * Biomedical Informatics, 26 South 2000 East<br> * Room 5775 HSEB, Salt Lake City, UT 84112<br> * Day Phone: 1-801-581-4080<br> * ----------------------------------------------------------------------------------- * * @author Oren E. Livne {@code <oren.livne@utah.edu>} * @version Sep 20, 2010 * @see https://jira.chpc.utah.edu/browse/FUR-1278 */ @Api public interface PagingProvider<T> { // ========================= VALUES ==================================== /** * Return the iterable type that this provider supports. * * @return the iterable type */ Labeled getIterableType(); /** * Return the iterable object type that this provider supports. * * @return the iterable object type */ Class<?> getObjectType(); /** * A factory method of iterators for supported iterable objects of type <code>T</code> * . * * @param iterable * object to iterate on * @param pagingStrategy * determines page size during iteration * @return pager instance */ Pager<?> newPager(T iterable, PagingStrategy pagingStrategy); }
{ "content_hash": "1ab1ae71cfed07cf3f0ba5ea8c224470", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 90, "avg_line_length": 29.75, "alnum_prop": 0.5817711700064642, "repo_name": "openfurther/further-open-core", "id": "044c5e85a4042151a19610c234c140c4a9164d7a", "size": "2162", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/core-api/src/main/java/edu/utah/further/core/api/collections/page/PagingProvider.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "1460" }, { "name": "Groovy", "bytes": "17766" }, { "name": "Java", "bytes": "6612950" }, { "name": "PLSQL", "bytes": "1743" }, { "name": "Shell", "bytes": "5384" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_27) on Sat Jul 13 14:32:25 CEST 2013 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class com.github.sarxos.webcam.WebcamDiscoveryEvent (Webcam Capture 0.3.10-RC4 API - 20130713-1432) </TITLE> <META NAME="date" CONTENT="2013-07-13"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.github.sarxos.webcam.WebcamDiscoveryEvent (Webcam Capture 0.3.10-RC4 API - 20130713-1432)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../com/github/sarxos/webcam/WebcamDiscoveryEvent.html" title="class in com.github.sarxos.webcam"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <a href="https://github.com/sarxos" target="_blank">Bartosz Firyn (SarXos)</a></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/github/sarxos/webcam//class-useWebcamDiscoveryEvent.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="WebcamDiscoveryEvent.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>com.github.sarxos.webcam.WebcamDiscoveryEvent</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../com/github/sarxos/webcam/WebcamDiscoveryEvent.html" title="class in com.github.sarxos.webcam">WebcamDiscoveryEvent</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.github.sarxos.webcam"><B>com.github.sarxos.webcam</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.github.sarxos.webcam"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../com/github/sarxos/webcam/WebcamDiscoveryEvent.html" title="class in com.github.sarxos.webcam">WebcamDiscoveryEvent</A> in <A HREF="../../../../../com/github/sarxos/webcam/package-summary.html">com.github.sarxos.webcam</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../com/github/sarxos/webcam/package-summary.html">com.github.sarxos.webcam</A> with parameters of type <A HREF="../../../../../com/github/sarxos/webcam/WebcamDiscoveryEvent.html" title="class in com.github.sarxos.webcam">WebcamDiscoveryEvent</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>WebcamDiscoveryListener.</B><B><A HREF="../../../../../com/github/sarxos/webcam/WebcamDiscoveryListener.html#webcamFound(com.github.sarxos.webcam.WebcamDiscoveryEvent)">webcamFound</A></B>(<A HREF="../../../../../com/github/sarxos/webcam/WebcamDiscoveryEvent.html" title="class in com.github.sarxos.webcam">WebcamDiscoveryEvent</A>&nbsp;event)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>WebcamDiscoveryListener.</B><B><A HREF="../../../../../com/github/sarxos/webcam/WebcamDiscoveryListener.html#webcamGone(com.github.sarxos.webcam.WebcamDiscoveryEvent)">webcamGone</A></B>(<A HREF="../../../../../com/github/sarxos/webcam/WebcamDiscoveryEvent.html" title="class in com.github.sarxos.webcam">WebcamDiscoveryEvent</A>&nbsp;event)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../com/github/sarxos/webcam/WebcamDiscoveryEvent.html" title="class in com.github.sarxos.webcam"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <a href="https://github.com/sarxos" target="_blank">Bartosz Firyn (SarXos)</a></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/github/sarxos/webcam//class-useWebcamDiscoveryEvent.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="WebcamDiscoveryEvent.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright © 2012-2013 <a href="https://github.com/sarxos" target="_blank">Bartosz Firyn (SarXos)</a>. All Rights Reserved. </BODY> </HTML>
{ "content_hash": "7a691c4043cf6a47f967eb0ca0f37a22", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 363, "avg_line_length": 47.77777777777778, "alnum_prop": 0.6419712070874861, "repo_name": "nekszer/WebCam-Java", "id": "eac8800a66f2c8282a31d9fe5efdb85ae086c81a", "size": "9031", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "docs/javadoc/com/github/sarxos/webcam/class-use/WebcamDiscoveryEvent.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "49322" }, { "name": "Java", "bytes": "173450" } ], "symlink_target": "" }
The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/frontdoor/armfrontdoor` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration). To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).
{ "content_hash": "65365fa34a954bf4c33c37692c18fa50", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 257, "avg_line_length": 97.6, "alnum_prop": 0.7950819672131147, "repo_name": "Azure/azure-sdk-for-go", "id": "e13b1c9f70d81f075185e6202e2452ab1ece2de6", "size": "530", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/resourcemanager/frontdoor/armfrontdoor/CHANGELOG.md", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1629" }, { "name": "Bicep", "bytes": "8394" }, { "name": "CSS", "bytes": "6089" }, { "name": "Dockerfile", "bytes": "1435" }, { "name": "Go", "bytes": "5463500" }, { "name": "HTML", "bytes": "8933" }, { "name": "JavaScript", "bytes": "8137" }, { "name": "PowerShell", "bytes": "504494" }, { "name": "Shell", "bytes": "3893" }, { "name": "Smarty", "bytes": "1723" } ], "symlink_target": "" }
<?php namespace Mautic\CoreBundle\Doctrine; use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; abstract class AbstractMauticMigration extends AbstractMigration implements ContainerAwareInterface { /** * @var ContainerInterface */ protected $container; /** * Supported platforms * * @var array */ protected $supported = array('mysql'); /** * Database prefix * * @var string */ protected $prefix; /** * Database platform * * @var string */ protected $platform; /** * @var \Mautic\CoreBundle\Factory\MauticFactory */ protected $factory; /** * @param Schema $schema * * @return void * @throws \Doctrine\DBAL\Migrations\AbortMigrationException */ public function up(Schema $schema) { $platform = $this->connection->getDatabasePlatform()->getName(); // Abort the migration if the platform is unsupported $this->abortIf(!in_array($platform, $this->supported), 'The database platform is unsupported for migrations'); $function = $this->platform . "Up"; if (method_exists($this, $function)) { $this->$function($schema); } } /** * @param Schema $schema * * @return void * @throws \Doctrine\DBAL\Migrations\AbortMigrationException */ public function down(Schema $schema) { // Not supported } /** * {@inheritdoc} */ public function setContainer(ContainerInterface $container = null) { $this->container = $container; $this->prefix = $container->getParameter('mautic.db_table_prefix'); $this->platform = $this->connection->getDatabasePlatform()->getName(); $this->factory = $container->get('mautic.factory'); } /** * Finds/creates the local name for constraints and indexes * * @param $table * @param $type * @param $suffix * * @return string */ protected function findPropertyName($table, $type, $suffix) { static $schemaManager; static $tables = array(); if (empty($schemaManager)) { $schemaManager = $this->factory->getDatabase()->getSchemaManager(); } // Prepend prefix $table = $this->prefix . $table; if (!array_key_exists($table, $tables)) { $tables[$table] = array(); } $type = strtolower($type); $suffix = strtolower(substr($suffix, -4)); switch ($type) { case 'fk': if (!array_key_exists('fk', $tables[$table])) { $keys = $schemaManager->listTableForeignKeys($table); /** @var \Doctrine\DBAL\Schema\ForeignKeyConstraint $k */ foreach ($keys as $k) { $name = strtolower($k->getName()); $key = substr($name, -4); $tables[$table]['fk'][$key] = $name; } } $localName = $tables[$table]['fk'][$suffix]; break; case 'idx': case 'uniq': if (!array_key_exists('idx', $tables[$table])) { $tables[$table]['idx'] = array( 'idx' => array(), 'uniq' => array() ); $indexes = $schemaManager->listTableIndexes($table); /** @var \Doctrine\DBAL\Schema\Index $i */ foreach ($indexes as $i) { $name = strtolower($i->getName()); $isIdx = stripos($name, 'idx'); $isUniq = stripos($name, 'uniq'); if ($isIdx !== false || $isUniq !== false) { $key = substr($name, -4); $keyType = ($isIdx !== false) ? 'idx' : 'uniq'; $tables[$table]['idx'][$keyType][$key] = $name; } } } $localName = $tables[$table]['idx'][$type][$suffix]; break; } $localName = strtoupper($localName); return $localName; } /** * Generate the name for the property * * @param $table * @param $type * @param array $columnNames * * @return string */ protected function generatePropertyName($table, $type, array $columnNames) { $columnNames = array_merge(array($this->prefix . $table), $columnNames); $hash = implode("", array_map(function($column) { return dechex(crc32($column)); }, $columnNames)); return substr(strtoupper($type . "_" . $hash), 0, 63); } }
{ "content_hash": "0d467d7307a51edf20d18c4d0a823161", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 118, "avg_line_length": 27.530054644808743, "alnum_prop": 0.5021834061135371, "repo_name": "rcdelfin/mautic", "id": "674992defccad0d32f4dc57e1be349bb677181e6", "size": "5255", "binary": false, "copies": "3", "ref": "refs/heads/staging", "path": "app/bundles/CoreBundle/Doctrine/AbstractMauticMigration.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3767" }, { "name": "CSS", "bytes": "1350177" }, { "name": "HTML", "bytes": "178411" }, { "name": "JavaScript", "bytes": "4614102" }, { "name": "PHP", "bytes": "8287715" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.4.2_05) on Thu Sep 30 22:16:07 GMT+01:00 2004 --> <TITLE> NoSuchMessageException (Spring Framework) </TITLE> <META NAME="keywords" CONTENT="org.springframework.context.NoSuchMessageException class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="NoSuchMessageException (Spring Framework)"; } </SCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NoSuchMessageException.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../org/springframework/context/ApplicationContextException.html" title="class in org.springframework.context"><B>PREV CLASS</B></A>&nbsp; &nbsp;NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="NoSuchMessageException.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_java.lang.RuntimeException">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.springframework.context</FONT> <BR> Class NoSuchMessageException</H2> <PRE> java.lang.Object <IMG SRC="../../../resources/inherit.gif" ALT="extended by">java.lang.Throwable <IMG SRC="../../../resources/inherit.gif" ALT="extended by">java.lang.Exception <IMG SRC="../../../resources/inherit.gif" ALT="extended by">java.lang.RuntimeException <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>org.springframework.context.NoSuchMessageException</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD> </DL> <HR> <DL> <DT>public class <B>NoSuchMessageException</B><DT>extends java.lang.RuntimeException</DL> <P> Exception thrown when a message can't be resolved. <P> <P> <DL> <DT><B>Author:</B></DT> <DD>Rod Johnson</DD> <DT><B>See Also:</B><DD><A HREF="../../../serialized-form.html#org.springframework.context.NoSuchMessageException">Serialized Form</A></DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Field Summary</B></FONT></TD> </TR> </TABLE> &nbsp;<A NAME="fields_inherited_from_class_java.lang.RuntimeException"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Fields inherited from class java.lang.RuntimeException</B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE></CODE></TD> </TR> </TABLE> &nbsp; <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../org/springframework/context/NoSuchMessageException.html#NoSuchMessageException(java.lang.String)">NoSuchMessageException</A></B>(java.lang.String&nbsp;code)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a new exception.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../org/springframework/context/NoSuchMessageException.html#NoSuchMessageException(java.lang.String, java.util.Locale)">NoSuchMessageException</A></B>(java.lang.String&nbsp;code, java.util.Locale&nbsp;locale)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a new exception.</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="methods_inherited_from_class_java.lang.Throwable"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.Throwable</B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.Object</B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TD> </TR> </TABLE> <A NAME="NoSuchMessageException(java.lang.String, java.util.Locale)"><!-- --></A><H3> NoSuchMessageException</H3> <PRE> public <B>NoSuchMessageException</B>(java.lang.String&nbsp;code, java.util.Locale&nbsp;locale)</PRE> <DL> <DD>Create a new exception. <P> <DT><B>Parameters:</B><DD><CODE>code</CODE> - code that could not be resolved for given locale<DD><CODE>locale</CODE> - locale that was used to search for the code within</DL> <HR> <A NAME="NoSuchMessageException(java.lang.String)"><!-- --></A><H3> NoSuchMessageException</H3> <PRE> public <B>NoSuchMessageException</B>(java.lang.String&nbsp;code)</PRE> <DL> <DD>Create a new exception. <P> <DT><B>Parameters:</B><DD><CODE>code</CODE> - code that could not be resolved for given locale</DL> <!-- ============ METHOD DETAIL ========== --> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NoSuchMessageException.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../org/springframework/context/ApplicationContextException.html" title="class in org.springframework.context"><B>PREV CLASS</B></A>&nbsp; &nbsp;NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="NoSuchMessageException.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_java.lang.RuntimeException">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright (C) 2003-2004 The Spring Framework Project.</i> </BODY> </HTML>
{ "content_hash": "41f53a6bc58eaa34dce652fe8735a74c", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 259, "avg_line_length": 41.96415770609319, "alnum_prop": 0.6470789203963102, "repo_name": "dachengxi/spring1.1.1_source", "id": "75e28fb3c9b9e2352330b3ddddaea5a9c75c28b4", "size": "11708", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/api/org/springframework/context/NoSuchMessageException.html", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "163" }, { "name": "FreeMarker", "bytes": "8024" }, { "name": "HTML", "bytes": "34675" }, { "name": "Java", "bytes": "5934573" } ], "symlink_target": "" }
package com.linecorp.armeria.client; import java.net.URI; import java.util.Optional; import java.util.Set; import java.util.function.Supplier; import org.slf4j.LoggerFactory; import com.linecorp.armeria.common.Scheme; import io.netty.channel.EventLoop; import io.netty.channel.EventLoopGroup; /** * Creates and manages clients. * * <h3>Life cycle of the default {@link ClientFactory}</h3> * <p> * {@link Clients} or {@link ClientBuilder} uses {@link #DEFAULT}, the default {@link ClientFactory}, * unless you specified a {@link ClientFactory} explicitly. Calling {@link #close()} on the default * {@link ClientFactory} will neither terminate its I/O threads nor release other related resources unlike * other {@link ClientFactory} to protect itself from accidental premature termination. * </p><p> * Instead, when the current {@link ClassLoader} is {@linkplain ClassLoader#getSystemClassLoader() the system * class loader}, a {@link Runtime#addShutdownHook(Thread) shutdown hook} is registered so that they are * released when the JVM exits. * </p><p> * If you are in an environment managed by a container or you desire the early termination of the default * {@link ClientFactory}, use {@link #closeDefault()}. * </p> */ public interface ClientFactory extends AutoCloseable { /** * The default {@link ClientFactory} implementation. */ ClientFactory DEFAULT = new AllInOneClientFactory(true); /** * Closes the default {@link ClientFactory}. */ static void closeDefault() { LoggerFactory.getLogger(ClientFactory.class).debug( "Closing the default {}", ClientFactory.class.getSimpleName()); ((AllInOneClientFactory) DEFAULT).doClose(); } /** * Returns the {@link Scheme}s supported by this {@link ClientFactory}. */ Set<Scheme> supportedSchemes(); /** * Returns the session-layer options of the connections created by this {@link ClientFactory}. */ SessionOptions options(); /** * Returns the {@link EventLoopGroup} being used by this {@link ClientFactory}. Can be used to, e.g., * schedule a periodic task without creating a separate event loop. Use {@link #eventLoopSupplier()} * instead if what you need is an {@link EventLoop} rather than an {@link EventLoopGroup}. */ EventLoopGroup eventLoopGroup(); /** * Returns a {@link Supplier} that provides one of the {@link EventLoop}s being used by this * {@link ClientFactory}. */ Supplier<EventLoop> eventLoopSupplier(); /** * Creates a new client that connects to the specified {@code uri}. * * @param uri the URI of the server endpoint * @param clientType the type of the new client * @param options the {@link ClientOptionValue}s */ <T> T newClient(String uri, Class<T> clientType, ClientOptionValue<?>... options); /** * Creates a new client that connects to the specified {@code uri}. * * @param uri the URI of the server endpoint * @param clientType the type of the new client * @param options the {@link ClientOptions} */ <T> T newClient(String uri, Class<T> clientType, ClientOptions options); /** * Creates a new client that connects to the specified {@link URI} using the default * {@link ClientFactory}. * * @param uri the URI of the server endpoint * @param clientType the type of the new client * @param options the {@link ClientOptionValue}s */ <T> T newClient(URI uri, Class<T> clientType, ClientOptionValue<?>... options); /** * Creates a new client that connects to the specified {@link URI} using the default * {@link ClientFactory}. * * @param uri the URI of the server endpoint * @param clientType the type of the new client * @param options the {@link ClientOptions} */ <T> T newClient(URI uri, Class<T> clientType, ClientOptions options); /** * Returns the {@link ClientBuilderParams} held in {@code client}. This is used when creating a new derived * {@link Client} which inherits {@link ClientBuilderParams} from {@code client}. If this * {@link ClientFactory} does not know how to handle the {@link ClientBuilderParams} for the provided * {@code client}, it should return {@link Optional#empty()}. */ <T> Optional<ClientBuilderParams> clientBuilderParams(T client); /** * Closes all clients managed by this factory and shuts down the {@link EventLoopGroup} * created implicitly by this factory. */ @Override void close(); }
{ "content_hash": "c077a5088c0d905aad6275d22f587bae", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 111, "avg_line_length": 36.611111111111114, "alnum_prop": 0.6785172339041838, "repo_name": "jonefeewang/armeria", "id": "98bacd76e2d4c4ad771c4250128702da12ced64e", "size": "5245", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/main/java/com/linecorp/armeria/client/ClientFactory.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "25018" }, { "name": "HTML", "bytes": "26000" }, { "name": "Java", "bytes": "3557888" }, { "name": "JavaScript", "bytes": "25771" }, { "name": "Protocol Buffer", "bytes": "19765" }, { "name": "Python", "bytes": "2844" }, { "name": "Shell", "bytes": "1043" }, { "name": "Thrift", "bytes": "130638" } ], "symlink_target": "" }
package translation // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/signalfxexporter/internal/translation" import ( "fmt" "strconv" "strings" "time" "unicode" sfxpb "github.com/signalfx/com_signalfx_metrics_protobuf/model" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" "go.uber.org/zap" "go.uber.org/zap/zapcore" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/signalfxexporter/internal/translation/dpfilters" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/signalfx" ) // Some fields on SignalFx protobuf are pointers, in order to reduce // allocations create the most used ones. var ( // SignalFx metric types used in the conversions. sfxMetricTypeGauge = sfxpb.MetricType_GAUGE sfxMetricTypeCumulativeCounter = sfxpb.MetricType_CUMULATIVE_COUNTER sfxMetricTypeCounter = sfxpb.MetricType_COUNTER ) // MetricsConverter converts MetricsData to sfxpb DataPoints. It holds an optional // MetricTranslator to translate SFx metrics using translation rules. type MetricsConverter struct { logger *zap.Logger metricTranslator *MetricTranslator filterSet *dpfilters.FilterSet datapointValidator *datapointValidator translator *signalfx.FromTranslator } // NewMetricsConverter creates a MetricsConverter from the passed in logger and // MetricTranslator. Pass in a nil MetricTranslator to not use translation // rules. func NewMetricsConverter( logger *zap.Logger, t *MetricTranslator, excludes []dpfilters.MetricFilter, includes []dpfilters.MetricFilter, nonAlphanumericDimChars string) (*MetricsConverter, error) { fs, err := dpfilters.NewFilterSet(excludes, includes) if err != nil { return nil, err } return &MetricsConverter{ logger: logger, metricTranslator: t, filterSet: fs, datapointValidator: newDatapointValidator(logger, nonAlphanumericDimChars), translator: &signalfx.FromTranslator{}, }, nil } // MetricsToSignalFxV2 converts the passed in MetricsData to SFx datapoints, // returning those datapoints and the number of time series that had to be // dropped because of errors or warnings. func (c *MetricsConverter) MetricsToSignalFxV2(md pmetric.Metrics) []*sfxpb.DataPoint { var sfxDataPoints []*sfxpb.DataPoint rms := md.ResourceMetrics() for i := 0; i < rms.Len(); i++ { rm := rms.At(i) extraDimensions := resourceToDimensions(rm.Resource()) for j := 0; j < rm.ScopeMetrics().Len(); j++ { ilm := rm.ScopeMetrics().At(j) var initialDps []*sfxpb.DataPoint for k := 0; k < ilm.Metrics().Len(); k++ { dps := c.translator.FromMetric(ilm.Metrics().At(k), extraDimensions) initialDps = append(initialDps, dps...) } // Translate and filter all metrics within the current ScopeMetric sfxDataPoints = append(sfxDataPoints, c.translateAndFilter(initialDps)...) } } return c.datapointValidator.sanitizeDataPoints(sfxDataPoints) } func (c *MetricsConverter) translateAndFilter(dps []*sfxpb.DataPoint) []*sfxpb.DataPoint { if c.metricTranslator != nil { dps = c.metricTranslator.TranslateDataPoints(c.logger, dps) } resultSliceLen := 0 for i, dp := range dps { if !c.filterSet.Matches(dp) { if resultSliceLen < i { dps[resultSliceLen] = dp } resultSliceLen++ } else { c.logger.Debug("Datapoint does not match filter, skipping", zap.String("dp", DatapointToString(dp))) } } dps = dps[:resultSliceLen] return dps } func filterKeyChars(str string, nonAlphanumericDimChars string) string { filterMap := func(r rune) rune { if unicode.IsLetter(r) || unicode.IsDigit(r) || strings.ContainsRune(nonAlphanumericDimChars, r) { return r } return '_' } return strings.Map(filterMap, str) } // resourceToDimensions will return a set of dimension from the // resource attributes, including a cloud host id (AWSUniqueId, gcp_id, etc.) // if it can be constructed from the provided metadata. func resourceToDimensions(res pcommon.Resource) []*sfxpb.Dimension { var dims []*sfxpb.Dimension if hostID, ok := splunk.ResourceToHostID(res); ok && hostID.Key != splunk.HostIDKeyHost { dims = append(dims, &sfxpb.Dimension{ Key: string(hostID.Key), Value: hostID.ID, }) } res.Attributes().Range(func(k string, val pcommon.Value) bool { // Never send the SignalFX token if k == splunk.SFxAccessTokenLabel { return true } dims = append(dims, &sfxpb.Dimension{ Key: k, Value: val.AsString(), }) return true }) return dims } func (c *MetricsConverter) ConvertDimension(dim string) string { res := dim if c.metricTranslator != nil { res = c.metricTranslator.translateDimension(dim) } return filterKeyChars(res, c.datapointValidator.nonAlphanumericDimChars) } // Values obtained from https://dev.splunk.com/observability/docs/datamodel/ingest#Criteria-for-metric-and-dimension-names-and-values const ( maxMetricNameLength = 256 maxDimensionNameLength = 128 maxDimensionValueLength = 256 maxNumberOfDimensions = 36 ) var ( invalidMetricNameReason = fmt.Sprintf( "metric name longer than %d characters", maxMetricNameLength) invalidDimensionNameReason = fmt.Sprintf( "dimension name longer than %d characters", maxDimensionNameLength) invalidDimensionValueReason = fmt.Sprintf( "dimension value longer than %d characters", maxDimensionValueLength) invalidNumberOfDimensions = fmt.Sprintf( "number of dimensions is larger than %d", maxNumberOfDimensions) ) type datapointValidator struct { logger *zap.Logger nonAlphanumericDimChars string } func newDatapointValidator(logger *zap.Logger, nonAlphanumericDimChars string) *datapointValidator { return &datapointValidator{logger: CreateSampledLogger(logger), nonAlphanumericDimChars: nonAlphanumericDimChars} } // sanitizeDataPoints sanitizes datapoints prior to dispatching them to the backend. // Datapoints that do not conform to the requirements are removed. This method drops // datapoints with metric name greater than 256 characters and number of dimensions greater than 36. func (dpv *datapointValidator) sanitizeDataPoints(dps []*sfxpb.DataPoint) []*sfxpb.DataPoint { resultDatapointsLen := 0 for dpIndex, dp := range dps { if dpv.isValidMetricName(dp.Metric) && dpv.isValidNumberOfDimension(dp) { dp.Dimensions = dpv.sanitizeDimensions(dp.Dimensions) if resultDatapointsLen < dpIndex { dps[resultDatapointsLen] = dp } resultDatapointsLen++ } } // Trim datapoints slice to account for any removed datapoints. return dps[:resultDatapointsLen] } // sanitizeDimensions replaces all characters unsupported by SignalFx backend // in metric label keys and with "_" and drops dimensions when the key is greater // than 128 characters or when value is greater than 256 characters in length. func (dpv *datapointValidator) sanitizeDimensions(dimensions []*sfxpb.Dimension) []*sfxpb.Dimension { resultDimensionsLen := 0 for dimensionIndex, d := range dimensions { if dpv.isValidDimension(d) { d.Key = filterKeyChars(d.Key, dpv.nonAlphanumericDimChars) if resultDimensionsLen < dimensionIndex { dimensions[resultDimensionsLen] = d } resultDimensionsLen++ } } // Trim dimensions slice to account for any removed dimensions. return dimensions[:resultDimensionsLen] } func (dpv *datapointValidator) isValidMetricName(name string) bool { if len(name) > maxMetricNameLength { dpv.logger.Debug("dropping datapoint", zap.String("reason", invalidMetricNameReason), zap.String("metric_name", name), zap.Int("metric_name_length", len(name)), ) return false } return true } func (dpv *datapointValidator) isValidNumberOfDimension(dp *sfxpb.DataPoint) bool { if len(dp.Dimensions) > maxNumberOfDimensions { dpv.logger.Debug("dropping datapoint", zap.String("reason", invalidNumberOfDimensions), zap.String("datapoint", DatapointToString(dp)), zap.Int("number_of_dimensions", len(dp.Dimensions)), ) return false } return true } func (dpv *datapointValidator) isValidDimension(dimension *sfxpb.Dimension) bool { return dpv.isValidDimensionName(dimension.Key) && dpv.isValidDimensionValue(dimension.Value, dimension.Key) } func (dpv *datapointValidator) isValidDimensionName(name string) bool { if len(name) > maxDimensionNameLength { dpv.logger.Debug("dropping dimension", zap.String("reason", invalidDimensionNameReason), zap.String("dimension_name", name), zap.Int("dimension_name_length", len(name)), ) return false } return true } func (dpv *datapointValidator) isValidDimensionValue(value, name string) bool { if len(value) > maxDimensionValueLength { dpv.logger.Debug("dropping dimension", zap.String("dimension_name", name), zap.String("reason", invalidDimensionValueReason), zap.String("dimension_value", value), zap.Int("dimension_value_length", len(value)), ) return false } return true } // CreateSampledLogger was copied from https://github.com/open-telemetry/opentelemetry-collector/blob/v0.26.0/exporter/exporterhelper/queued_retry.go#L108 func CreateSampledLogger(logger *zap.Logger) *zap.Logger { if logger.Core().Enabled(zapcore.DebugLevel) { // Debugging is enabled. Don't do any sampling. return logger } // Create a logger that samples all messages to 1 per 10 seconds initially, // and 1/10000 of messages after that. opts := zap.WrapCore(func(core zapcore.Core) zapcore.Core { return zapcore.NewSamplerWithOptions( core, 10*time.Second, 1, 10000, ) }) return logger.WithOptions(opts) } func DatapointToString(dp *sfxpb.DataPoint) string { var tsStr string if dp.Timestamp != 0 { tsStr = strconv.FormatInt(dp.Timestamp, 10) } var dimsStr string for _, dim := range dp.Dimensions { dimsStr += dim.String() } return fmt.Sprintf("%s: %s (%s) %s\n%s", dp.Metric, dp.Value.String(), dpTypeToString(*dp.MetricType), tsStr, dimsStr) } func dpTypeToString(t sfxpb.MetricType) string { switch t { case sfxpb.MetricType_GAUGE: return "Gauge" case sfxpb.MetricType_COUNTER: return "Counter" case sfxpb.MetricType_ENUM: return "Enum" case sfxpb.MetricType_CUMULATIVE_COUNTER: return "Cumulative Counter" default: return fmt.Sprintf("unsupported type %d", t) } }
{ "content_hash": "24d178071d165af26788944d7b9d891f", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 154, "avg_line_length": 32.05864197530864, "alnum_prop": 0.7441032059304901, "repo_name": "open-telemetry/opentelemetry-collector-contrib", "id": "cca241bb50f0ef1f0dfe0ddfe9bbe8104fdc75cc", "size": "10981", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "exporter/signalfxexporter/internal/translation/converter.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2677" }, { "name": "Go", "bytes": "14675167" }, { "name": "Makefile", "bytes": "22547" }, { "name": "PowerShell", "bytes": "2781" }, { "name": "Shell", "bytes": "11998" } ], "symlink_target": "" }
namespace wi { class TokenBucket { public: TokenBucket(int token_count, int seconds_count); bool IsEmpty(); private: float token_count_; int token_count_limit_; dword ms_per_token_; long64 ms_last_token_; }; } // namespace wi #endif // __TOKENBUCKET_H__
{ "content_hash": "c418fdfddceda51ac8beeed6dc865814", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 52, "avg_line_length": 15.722222222222221, "alnum_prop": 0.6466431095406361, "repo_name": "spiffcode/hostile-takeover", "id": "2bee54dfd174abab40c9446132128db0c9196661", "size": "365", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/tokenbucket.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "6688" }, { "name": "C", "bytes": "3816970" }, { "name": "C#", "bytes": "1415510" }, { "name": "C++", "bytes": "3135633" }, { "name": "CMake", "bytes": "32315" }, { "name": "CSS", "bytes": "177" }, { "name": "HTML", "bytes": "102628" }, { "name": "Java", "bytes": "81380" }, { "name": "JavaScript", "bytes": "272" }, { "name": "Makefile", "bytes": "124052" }, { "name": "Objective-C", "bytes": "72730" }, { "name": "Objective-C++", "bytes": "217278" }, { "name": "Pascal", "bytes": "64515" }, { "name": "Perl", "bytes": "5079" }, { "name": "Puppet", "bytes": "194" }, { "name": "Python", "bytes": "214573" }, { "name": "Shell", "bytes": "10804" } ], "symlink_target": "" }
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var RecipeSchema = new Schema({ name: { type: String}, recipe_country_id : {type: mongoose.Schema.Types.ObjectId, ref: 'Country'}, creation_date : {type: Date, default: Date.now}, update_date : {type:Date}, delete_date : {type: Date, default: null}, recipe_category_id : {type: mongoose.Schema.Types.ObjectId, ref: 'RecipeCategory'}, remarks : {type:[String]}, time : {preparation:{hour:{type:Number},minute:{type:Number}},cooking:{hour:{type:Number},minute:{type:Number}}}, people:{type:Number}, recipe_difficulty_id : {type: mongoose.Schema.Types.ObjectId, ref: 'RecipeDifficulty'}, }); module.exports = mongoose.model('Recipe', RecipeSchema);
{ "content_hash": "34ca88daa5371ab6823f4ca84ea0dc7e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 114, "avg_line_length": 38.421052631578945, "alnum_prop": 0.7054794520547946, "repo_name": "damdamgo/VilRecipe", "id": "33434ed73c1f0b1da37788bd82c6009e029ca794", "size": "730", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/recipe/recipe_schema.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1655" }, { "name": "JavaScript", "bytes": "107759" }, { "name": "Objective-C", "bytes": "4417" }, { "name": "Python", "bytes": "1730" } ], "symlink_target": "" }
package logs import ( "github.com/jagregory/cfval/constraints" . "github.com/jagregory/cfval/schema" ) // see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html var LogStream = Resource{ AwsType: "AWS::Logs::LogStream", // Name ReturnValue: Schema{ Type: ValueString, }, Properties: Properties{ "LogGroupName": Schema{ Type: ValueString, Required: constraints.Always, }, "LogStreamName": Schema{ Type: ValueString, }, }, }
{ "content_hash": "f9fbdc2386ffde1e5ab8151e512cd3d7", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 102, "avg_line_length": 18.666666666666668, "alnum_prop": 0.7023809523809523, "repo_name": "jagregory/cfval", "id": "7301299cebaba188316a8f368d111d870fed7f74", "size": "504", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "resources/logs/log_stream.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "393781" }, { "name": "Makefile", "bytes": "931" }, { "name": "Ruby", "bytes": "1746" } ], "symlink_target": "" }
package metric import ( "hume/record" ) type NumRecords struct { BaseMetric Counter } func (nr *NumRecords) Init() error { return nr.Counter.Initialize() } func (nr *NumRecords) Process(rec *record.Record) { nr.Count("true") }
{ "content_hash": "1fa130c20924eb7158562a4160f255cf", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 51, "avg_line_length": 13.11111111111111, "alnum_prop": 0.6991525423728814, "repo_name": "ARodri/hume", "id": "d5b8741e626038d5490f24cd78a9e89c24b4525c", "size": "236", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/hume/metric/numrecords.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "34522" } ], "symlink_target": "" }
package thebob.ja2maptool.util.map.controller.base; import java.util.Observable; import java.util.Observer; import thebob.ja2maptool.util.map.layers.map.IMapLayerManager; import thebob.ja2maptool.util.map.renderer.ITileRendererManager; /** * * @author the_bob */ public abstract class MapControllerBase extends Observable implements IMapController, Observer { private ITileRendererManager renderer; private IMapLayerManager map; public MapControllerBase(ITileRendererManager renderer, IMapLayerManager map) { this.renderer = renderer; this.map = map; renderer.addObserver(this); map.subscribe(this); System.out.println("thebob.ja2maptool.util.map.controller.base.MapControllerBase.<init>(): created " + this.getClass().getSimpleName()); } @Override public void disconnect() { getRenderer().deleteObserver(this); getMap().unsubscribe(this); System.out.println("thebob.ja2maptool.util.map.controller.base.MapControllerBase.disconnect(): " + this.getClass().getSimpleName()); } // no need to spam setChanged() all over the controller classes, it's a simple observer implementation here @Override public void notifyObservers(Object arg) { setChanged(); super.notifyObservers(arg); } // ---------- /** * @return the renderer */ public ITileRendererManager getRenderer() { return renderer; } /** * @return the map */ public IMapLayerManager getMap() { return map; } }
{ "content_hash": "c7749b1eee055eaaf5400d25e05f4a65", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 144, "avg_line_length": 26.35, "alnum_prop": 0.6729917773561037, "repo_name": "starcatter/ja2tools", "id": "13c43684e9afb7ad63ffca228c1537204b69f8ef", "size": "2715", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ja2MapTool/src/main/java/thebob/ja2maptool/util/map/controller/base/MapControllerBase.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "1171559" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "4d950104849a61df4cab5d3521193dc8", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "c5434b5d87f90095597cdec8177a293fab88b5fe", "size": "195", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Krigia/Krigia virginica/ Syn. Adopogon virginicum hispida/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.sf.cafebabe.task.serfile; import java.awt.event.ActionEvent; import javax.swing.*; import org.sf.cafebabe.Constants; import org.sf.cafebabe.util.Actions; import org.sf.cafebabe.util.IconProducer; public class PlainActions extends Actions implements Constants { private final static String COLLAPSE_TREE_STRING = "Collapse tree"; private final static String EXPAND_1ST_LEVEL_STRING = "Expand first level"; private final static String EXPAND_ALL_LEVELS_STRING = "Expand all levels"; private final static String SEARCH_STRING = "Search string"; private final static String TUTORIAL_MODE_STRING = "Tutorial mode"; private Action collapceAction, expandFirstLevelAction, expandAllLevelsAction, searchAction, tutorialAction; protected JToolBar toolBar = new JToolBar(); private SerFrame parent; public PlainActions(SerFrame parent) { this.parent = parent; init(); } public JToolBar getToolBar() { return toolBar; } protected void init() { collapceAction = createCollapceAction(COLLAPSE_TREE_STRING, IconProducer.getImageIcon(ICON_COLLAPSE)); expandFirstLevelAction = createExpandFirstLevelAction(EXPAND_1ST_LEVEL_STRING, IconProducer.getImageIcon(ICON_EXPAND)); expandAllLevelsAction = createExpandAllLevelsAction(EXPAND_ALL_LEVELS_STRING, IconProducer.getImageIcon(ICON_EXPAND_ALL)); searchAction = createSearchAction(SEARCH_STRING, IconProducer.getImageIcon(ICON_SEARCH)); AbstractButton tutoButton = new JToggleButton(); tutoButton.setSelectedIcon(IconProducer.getImageIcon(ICON_TUTORIAL_ON)); tutorialAction = createTutorialAction(TUTORIAL_MODE_STRING, IconProducer.getImageIcon(ICON_TUTORIAL_OFF), tutoButton); addActionToToolBar(collapceAction, toolBar, false, COLLAPSE_TREE_STRING, 0); addActionToToolBar(expandFirstLevelAction, toolBar, false, EXPAND_1ST_LEVEL_STRING, 0); addActionToToolBar(expandAllLevelsAction, toolBar, false, EXPAND_ALL_LEVELS_STRING, 0); addActionToToolBar(searchAction, toolBar, false, SEARCH_STRING, 0); JPanel emptyArea = new JPanel(); toolBar.add(emptyArea); addActionToToolBar(tutorialAction, toolBar, false, TUTORIAL_MODE_STRING, 0); } public Action createCollapceAction(String text, ImageIcon icon) { return new AbstractAction(text, icon) { public void actionPerformed(ActionEvent e) { parent.collapse(); } }; } public Action createExpandFirstLevelAction(String text, ImageIcon icon) { return new AbstractAction(text, icon) { public void actionPerformed(ActionEvent e) { parent.expandFirstLevel(); } }; } public Action createExpandAllLevelsAction(String text, ImageIcon icon) { return new AbstractAction(text, icon) { public void actionPerformed(ActionEvent e) { parent.expandAllLevels(); } }; } public Action createSearchAction(String text, ImageIcon icon) { return new AbstractAction(text, icon) { public void actionPerformed(ActionEvent e) { parent.search(); } }; } public Action createTutorialAction(String text, ImageIcon icon, AbstractButton button) { return new CustomAction(text, icon, button) { boolean isTutorialMode = false; public void actionPerformed(ActionEvent e) { parent.setTutorialMode(isTutorialMode = !isTutorialMode); } }; } }
{ "content_hash": "d210e690f0edfabf824a633dc8df7b94", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 82, "avg_line_length": 35.2952380952381, "alnum_prop": 0.6753912574203994, "repo_name": "shvets/cafebabe", "id": "03ee168395bf2c218ca1ad9729c9b3bf791e9eb6", "size": "3728", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cafebabe/src/main/java/org/sf/cafebabe/task/serfile/PlainActions.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "818854" }, { "name": "Shell", "bytes": "295" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <configuration> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> <appender name="FILE" class="ch.qos.logback.core.FileAppender"> <file>/Users/kishorereddy/git/slatekit/test/logback.log</file> <encoder> <pattern>%date %level [%thread] %logger{10} [%file : %line] %msg%n</pattern> </encoder> </appender> <appender name="LOGGLY" class="ch.qos.logback.ext.loggly.LogglyAppender"> <endpointUrl>https://logs-01.loggly.com/inputs/2ea79aee-83f3-4c71-bd30-5fa17411d6c6</endpointUrl> <pattern>%d{"ISO8601", UTC} %p %t %c %M - %m%n</pattern> <flushIntervalInSeconds>2</flushIntervalInSeconds> </appender> <appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender"> <appender-ref ref="LOGGLY" /> </appender> <logger name="api" level="warn" additivity="false"> <appender-ref ref="ASYNC" /> </logger> <logger name="db" level="error" additivity="false"> <!-- <appender-ref ref="STDOUT" /> <appender-ref ref="FILE" /> <appender-ref ref="ASYNC" /> --> <appender-ref ref="ASYNC" /> </logger> <root level="debug"> <appender-ref ref="STDOUT" /> </root> </configuration>
{ "content_hash": "19df84e64f8281a1799321d19455ab3e", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 105, "avg_line_length": 37.42857142857143, "alnum_prop": 0.6030534351145038, "repo_name": "code-helix/slatekit", "id": "053ddc12bb60a41c911f46aa36e14bd71b3ee1fe", "size": "1572", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/apps/kotlin/slatekit-examples/src/main/resources/logback.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "8156" }, { "name": "CSS", "bytes": "35" }, { "name": "HTML", "bytes": "303" }, { "name": "Java", "bytes": "14282" }, { "name": "JavaScript", "bytes": "28" }, { "name": "Kotlin", "bytes": "2252471" }, { "name": "Shell", "bytes": "13555" }, { "name": "Swift", "bytes": "1555" }, { "name": "TSQL", "bytes": "1990" } ], "symlink_target": "" }
package com.hp.autonomy.frontend.find.hod.beanconfiguration; import com.hp.autonomy.frontend.configuration.ConfigService; import com.hp.autonomy.frontend.configuration.HostAndPort; import com.hp.autonomy.frontend.configuration.RedisConfig; import com.hp.autonomy.frontend.find.core.beanconfiguration.RedisCondition; import com.hp.autonomy.frontend.find.hod.configuration.HodFindConfig; import com.hp.autonomy.hod.redis.RedisTokenRepository; import com.hp.autonomy.hod.redis.RedisTokenRepositoryConfig; import com.hp.autonomy.hod.redis.RedisTokenRepositorySentinelConfig; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import java.util.Collection; import java.util.HashSet; @Configuration @Conditional(RedisCondition.class) public class RedisHodConfiguration { @Autowired private ConfigService<HodFindConfig> configService; @Bean(destroyMethod = "destroy") public RedisTokenRepository tokenRepository() { final RedisConfig redisConfig = configService.getConfig().getRedis(); final Integer database = redisConfig.getDatabase(); final String password = redisConfig.getPassword(); if (redisConfig.getSentinels().isEmpty()) { final HostAndPort address = redisConfig.getAddress(); return new RedisTokenRepository(new RedisTokenRepositoryConfig.Builder() .setHost(address.getHost()) .setPort(address.getPort()) .setPassword(password) .setDatabase(database) .build()); } else { final Collection<RedisTokenRepositorySentinelConfig.HostAndPort> sentinels = new HashSet<>(); for (final HostAndPort hostAndPort : redisConfig.getSentinels()) { sentinels.add(new RedisTokenRepositorySentinelConfig.HostAndPort(hostAndPort.getHost(), hostAndPort.getPort())); } return new RedisTokenRepository(new RedisTokenRepositorySentinelConfig.Builder() .setHostsAndPorts(sentinels) .setMasterName(redisConfig.getMasterName()) .setDatabase(database) .setPassword(password) .build()); } } }
{ "content_hash": "c40ffe912b3bfdfc6c43e6cd30e475a5", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 128, "avg_line_length": 41, "alnum_prop": 0.7093840429929723, "repo_name": "ExperisIT-rav/FindExperisIT", "id": "cba2cd1de4462b7b6c29eb14756b6413634c0d1c", "size": "2601", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "hod/src/main/java/com/hp/autonomy/frontend/find/hod/beanconfiguration/RedisHodConfiguration.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "250209" }, { "name": "CoffeeScript", "bytes": "5997" }, { "name": "HTML", "bytes": "53144" }, { "name": "Java", "bytes": "565369" }, { "name": "JavaScript", "bytes": "815020" }, { "name": "Ruby", "bytes": "206" }, { "name": "Shell", "bytes": "4427" } ], "symlink_target": "" }