text
stringlengths
2
1.04M
meta
dict
<font face="Verdana, Arial, Helvetica"> <center> <H1><font color=#ff0000> Using GrADS with Athena Widgets </font> </H1> </center> <p> <center> <b><font color=#ff0000>Previous section: </font></b> <a href=gagui_simple.html>Writing simple scripts</a> | <b><font color=#ff0000>Next section: </font></b> <a href=gagui_further.html>Going further... </a> </center> <p> <!-----------------------------------------------------------------> <hr> <h1>Writing the sample script</h1> <p> <center> <IMG SRC="gui_main.gif" ALT="GAGUI Window"> </center> <p> In the <a href=gagui_simple.html>previous section</a> you have been introduced to the basic aspects of GAGUI scripting. In this section we will walk you through the <a href=sample.gui>sample script</a> that you first learned how to run in an <a href=gagui_run.html>earlier section</a>. The <a href=gagui_further.html>following section</a> will wrap things up, while the glory details are given in the <a href=gagui_ref.html>Reference section</a>. <p> In addition of the GUI specific functions that you have seen so far, the GAGUI scripting processor can handle any GrADS command that you would enter at the command line interface, <i>e.g.</i>, <blockquote> <b> set gxout shaded </b> </blockquote> which selects the color shading style for contour plots. <p> When debugging a script it is sometimes helpful to have every GAGUI command being executed to be echoed to the screen. You turn this echo feature ON with this function. <blockquote> <b> Debug(on) </b> </blockquote> You have commented this function out in the sample script by placing the character '<b>#</b>' in front of it; you can also use '<b>*</b>' as a comment character. <p> A <i>label</i> is an inactive widget which displays some text, <i>e.g.</i>, an informative title. The first argument, <b>"root"</b> in this case, is the name you give to the widget so that you can refer to it later on: <p> <blockquote> <b> MakeLabel(root,"GrADS") </b> </blockquote> <p> Next we create a pushdown menu called <i><font color=#ff0000>File</font></i>. As usual, the first argument, <b>file</b> is the name of the widget <blockquote> <b> MakeMenu(file, " File ") </b> </blockquote> <p> Now that we have created a menu, we define its items. For the first item: <blockquote> <b> MakeMenuItem(open, file, "Open", Load, "open") </b> </blockquote> The parameters this particular item are: <ul> <li> <b>open</b> - the name of the item widget <li> <b> file</b> - the menu the item belongs to (see <b>MakeMenu()</b> above) <li> <b>"Open"</b> - This is the text it displays on the screen <li> <b> Load</b> - this is the callback name, i.e., the widget invokes this function when pressed. This particular callback pops up a <i>File Requestor</i> widget, and after the user clicks on a file name it executes the grads command <b>open</b> (see last argument) on this file. A list of the other available callbacks can be found in the <a href=gagui_ref.html>Reference section</a>. <li> <b>"open"</b> - argument to be passed to the callback. In this particular case, it is the GrADS command to be executed on the file. </ul> The definition of the other items in this menu follows. <blockquote> <b> MakeMenuItem(sdf, file, "SDF Open", Load, "sdfopen")<br> MakeMenuItem(xdf, file, "XDF Open", Load, "xdfopen")<br> MakeMenuItem(fsel, file, "File Selection ", FileSel, NULL )<br> MakeMenuItem(browse,file, "View Text File", Browse, NULL)<br> MakeMenuItem(junk, file, "_______________", NULL, NULL )<br> MakeMenuItem(exec, file, "Exec", Load, "exec")<br> MakeMenuItem(run, file, "Run", Load, "run")<br> MakeMenuItem(gui, file, "GUI", Load, "gui")<br> MakeMenuItem(junk, file, "_______________", NULL, NULL )<br> MakeMenuItem(fresh, file, "Refresh", Cmd, " ")<br> MakeMenuItem(init, file, "Reinit", Cmd, "reinit")<br> MakeMenuItem(exit, file, "Exit", Cmd, "quit") </b> </blockquote> Consult the <a href=gagui_ref.html>Reference section</a> for a description of the callbacks (fourth argument of <b>MakeMenuItem()</b>) used for these menu items. Notice that a NULL callback is used to introduce a horizontal line separating groups of items which are functionally related. <p> Had we turned debug ON before, we could turn it off here <blockquote> <b> Debug(off) </b> </blockquote> <p> Next we create a menu GrADS metafile printing related operations. Note that we use the <b>Load</b> callback for specifying the metafile name. <blockquote> <b> MakeMenu ( print, " Print " )<br> MakeMenuItem(printit, print, "Print", Cmd, "print")<br> MakeMenuItem(enable, print, "Enable Print", Load, "enable print")<br> MakeMenuItem(disable, print, "Disable Print", Cmd, "disable print") </b> </blockquote> <p> The following menu creates shortcuts for setting GrADS graphic options. Notice the use of callback <b>CmdStr</b> which pops up a dialog box asking the user to complement the command to be executed. <blockquote> <b> MakeMenu ( options, " Options " )<br> MakeMenuItem(shade, options, "Shaded", Cmd, "set gxout shaded" )<br> MakeMenuItem(cont, options, "Contour", Cmd, "set gxout contour" )<br> MakeMenuItem(grfill, options, "Grid Fill", Cmd, "set gxout grfill" )<br> MakeMenuItem(grvals, options, "Grid Values", Cmd, "set gxout grid" )<br> MakeMenuItem(vec, options, "Vector", Cmd, "set gxout vector" )<br> MakeMenuItem(strm, options, "Streamlines", Cmd, "set gxout stream" )<br> MakeMenuItem(bar, options, "Bar Chart", Cmd, "set gxout bar" )<br> MakeMenuItem(line, options, "Line Plot", Cmd, "set gxout line" )<br> MakeMenuItem(barb, options, "Wind Barbs", Cmd, "set gxout barb" )<br> MakeMenuItem(junk, options, "_______________", NULL, NULL )<br> MakeMenuItem(ci, options, "Contour Interval", CmdStr, "set cint" )<br> MakeMenuItem(tit, options, "Draw Title", CmdStr, "draw title " )<br) MakeMenuItem(cbar, options, "Color Bar", Cmd, "run cbarn" ) </b></b> </blockquote> <p> Here is a crude menu for defining GrADS dimensions. We plan to develop a specific callback with rubber bands, sliding bars, etc, for defining the GrADS dimension environment. For now, this menu will server as a place holder. <blockquote> <b> MakeMenu( dim, "Dim")<br> MakeMenuItem(lat, dim, "Latitude", CmdStr, "set lat " )<br> MakeMenuItem(lon, dim, "Longitude", CmdStr, "set lon " )<br> MakeMenuItem(lev, dim, "Level", CmdStr, "set lev " )<br> MakeMenuItem(time, dim, "Time", CmdStr, "set time " )<br> MakeMenuItem(junk, dim, "_________", NULL, NULL )<br> MakeMenuItem(x, dim, "x", CmdStr, "set x " )<br> MakeMenuItem(y, dim, "y", CmdStr, "set y " )<br> MakeMenuItem(z, dim, "z", CmdStr, "set z " )<br> MakeMenuItem(t, dim, "t", CmdStr, "set t " ) </b> </blockquote> <p> Now, let's create simple buttons. Buttons work pretty much like menu items but they do not belong to any menu and are directly clickable. <blockquote> <b> MakeButton( clear, "Clear", Cmd, "clear" )<br> MakeButton( quit, "Quit", Cmd, "quit" )<br> MakeButton( rein, "Reinit", Cmd, "reinit")<br> MakeButton( prompt, "ga>", CmdWin, NULL ) </b> </blockquote> Notice the <b>CmdWin</b> callback which spawns a separate window with a <i>GrADS Command Window</i> widget with a scrollable history list and what not. <p> Here are the buttons (and toggle) which handle the display of GrADS default expressions. Currently only the <b>hold</b> toggle variable is implemented. <blockquote> <b> MakeButton( var, "Var", VarSel, NULL )<br> MakeToggle( hold, "Hold", FALSE, NULL, Toggle, "hold" )<br> MakeButton( prev, " << ", Display, "<<" )<br> MakeButton( play, "Display", Display, "DISPLAY" )<br> MakeButton( next, " >> ", Display, ">>" ) </b> </blockquote> <p> Once you define buttons and menus you need to enforce their relative position. The very first button is always placed at the upper left corner. <p> First row: <blockquote> <b> SetWidgetPos(file, PLACE_UNDER, root, NO_CARE, NULL)<br> SetWidgetPos(print, PLACE_UNDER, root, PLACE_RIGHT, file )<br> SetWidgetPos(options, PLACE_UNDER, root, PLACE_RIGHT, print )<br> SetWidgetPos(dim, PLACE_UNDER, root, PLACE_RIGHT, options )<br> SetWidgetPos(rein, PLACE_UNDER, root, PLACE_RIGHT, dim )<br> SetWidgetPos(prompt, PLACE_UNDER, root, PLACE_RIGHT, rein ) </b> </blockquote> <p> Second row: <blockquote> <b> SetWidgetPos(hold, PLACE_UNDER, file, NO_CARE, NULL)<br> SetWidgetPos(var, PLACE_UNDER, file, PLACE_RIGHT, hold )<br> SetWidgetPos(prev, PLACE_UNDER, file, PLACE_RIGHT, var )<br> SetWidgetPos(play, PLACE_UNDER, file, PLACE_RIGHT, prev )<br> SetWidgetPos(next, PLACE_UNDER, file, PLACE_RIGHT, play )<br> SetWidgetPos(clear, PLACE_UNDER, file, PLACE_RIGHT, next )<br> SetWidgetPos(quit, PLACE_UNDER, file, PLACE_RIGHT, clear ) </b> </blockquote> <p> You can optionally select a font for ALL widgets: <blockquote> <b> GetFont(font,"-*-helvetica-bold-o-normal--*-*-*-*-*-*-*-*" )<br> AllWidgetFont(font) </b> </blockquote> <p> and select a font for and individual widget. Here is one example: <blockquote> <b> GetFont(myfont,"-*-helvetica-bold-o-normal--14-*-*-*-*-*-*-*" )<br> SetWidgetFont(root,myfont) </b> </blockquote> <p> In order to make your widgets appear on the screen you must issue this command. <blockquote> <b> ShowDisplay() </b> </blockquote> <p> After your widgets appear on the screen, you can set the color of your widgets. The following colors are pre-defined: white, back, red, green, blue, yellow. <blockquote> <b> GetNamedColor(gray,"grey")<br> GetNamedColor(Blue,"LightSkyBlue")<br> GetNamedColor(pink,"gold") <br> AllFgColor(black)<br> AllBgColor(Blue)<br> SetBgColor(root,white)<br> SetFgColor(root,red)<br> SetFgColor(prompt,yellow)<br> SetBgColor(prompt,red)<br> SetBgColor(prev,pink)<br> SetBgColor(play,pink)<br> SetBgColor(next,pink)<br> SetBgColor(hold,gray)<br> SetBgColor(var,gray)<br> SetBgColor(clear,gray)<br> SetBgColor(rein,gray)<br> SetBgColor(quit,gray) </b> </blockquote> Notice that the X window color <b>"gold"</b> has been assigned to the color variable <b>pink</b>. You usually you don't do silly things like this, but I wanted to make a point. <p> And you must call this function at the end of your first GUI script. This instructs the X Toolkit to enter an infinite loop, monitoring keyboard and mouse events. <blockquote> <b> MainLoop() </b> </blockquote> <i><font color=#ff0000>Repeating: you must call <b>MainLoop()</b>. </font></i> <p> When all is said and done, you can save the <a href=sample.gui>sample script</a> to somewhere in your local disk, say to a file named <b>sample.gui</b>. Then, at the GrADS prompt type <blockquote> <b> ga-> gui sample.gui </b> </blockquote> to execute the sample script. You should see something like this: <p> <center> <IMG SRC="gui_main.gif" ALT="GAGUI Window"> </center> <p> Please refer to the <a href=gagui_run.html>Running the sample script</a> for additional information. <!-----------------------------------------------------------------> <p> <center> <b><font color=#ff0000>Previous section: </font></b> <a href=gagui_simple.html>Writing simple scripts</a> | <b><font color=#ff0000>Next section: </font></b> <a href=gagui_further.html>Going further... </a> </center>
{ "content_hash": "3c46a08c6dd7af541669765c0fede96d", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 81, "avg_line_length": 33.61408450704225, "alnum_prop": 0.6494594821084387, "repo_name": "bucricket/projectMASviirs", "id": "54cb6ae7aaf4813aa9cc94111632ac40574994d0", "size": "11934", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "source/bin/Resources/Documentation/opengrads/doc/gagui/gagui_sample.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "266245" }, { "name": "Fortran", "bytes": "149664" }, { "name": "Gosu", "bytes": "262" }, { "name": "HTML", "bytes": "10077" }, { "name": "JavaScript", "bytes": "670498" }, { "name": "Makefile", "bytes": "1459" }, { "name": "Perl", "bytes": "314618" }, { "name": "Perl 6", "bytes": "1181" }, { "name": "Python", "bytes": "477004" }, { "name": "Shell", "bytes": "3239" } ], "symlink_target": "" }
package com.jdon.sample.test.event; import junit.framework.Assert; import com.jdon.annotation.Component; import com.jdon.annotation.model.OnEvent; import com.jdon.sample.test.event.TestEvent; @Component("consumer") public class B { @OnEvent("maTest") public void mb(TestEvent testEvent) throws Exception { testEvent.setResult(testEvent.getS() + 1); System.out.print("event.@OnEvent.mb.." + testEvent.getResult() + "\n"); Assert.assertEquals(testEvent.getResult(), 100); } }
{ "content_hash": "41b50f684740847587c68401b197437e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 73, "avg_line_length": 26.68421052631579, "alnum_prop": 0.717948717948718, "repo_name": "thushear/jdonframework", "id": "fd3e9726f43eb497a9f9cf8ca9489c648f7a3a57", "size": "1137", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/test/java/com/jdon/sample/test/event/B.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1480654" } ], "symlink_target": "" }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_memmove_83.h Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805.label.xml Template File: sources-sink-83.tmpl.h */ /* * @description * CWE: 122 Heap Based Buffer Overflow * BadSource: Allocate using new[] and set data pointer to a small buffer * GoodSource: Allocate using new[] and set data pointer to a large buffer * Sinks: memmove * BadSink : Copy int array to data using memmove * Flow Variant: 83 Data flow: data passed to class constructor and destructor by declaring the class object on the stack * * */ #include "std_testcase.h" namespace CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_memmove_83 { #ifndef OMITBAD class CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_memmove_83_bad { public: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_memmove_83_bad(int * dataCopy); ~CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_memmove_83_bad(); private: int * data; }; #endif /* OMITBAD */ #ifndef OMITGOOD class CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_memmove_83_goodG2B { public: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_memmove_83_goodG2B(int * dataCopy); ~CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_memmove_83_goodG2B(); private: int * data; }; #endif /* OMITGOOD */ }
{ "content_hash": "074c84089805ce61da25bda3bc5e4d5e", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 121, "avg_line_length": 28.5, "alnum_prop": 0.7115789473684211, "repo_name": "maurer/tiamat", "id": "e1f8f001141d9a27cb8b7455fa1bf550c09ba0ac", "size": "1425", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "samples/Juliet/testcases/CWE122_Heap_Based_Buffer_Overflow/s03/CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_memmove_83.h", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package org.pm4j.core.navi; import junit.framework.TestCase; import org.pm4j.navi.NaviHistory; import org.pm4j.navi.NaviHistoryCfg; import org.pm4j.navi.NaviHistoryCfg.SessionIdGenStrategy; import org.pm4j.navi.NaviLink; import org.pm4j.navi.NaviManager; import org.pm4j.navi.impl.NaviLinkImpl; import org.pm4j.navi.impl.NaviManagerImpl; public class NaviScopeTest extends TestCase { static final NaviLink L1 = new NaviLinkImpl("l1"); static final String V1 = "v1"; static final NaviLink L1_VAL = NaviLinkImpl.makeNaviScopeParamLink("l1", "k1", V1); static final NaviLink L2 = new NaviLinkImpl("l2"); static final Long V2 = new Long(1234); static final Long V2_CHANGED = new Long(12345); static final NaviLink L2_VAL = NaviLinkImpl.makeNaviScopeParamLink("l2", "k2", V2); static final NaviLink L3 = new NaviLinkImpl("l3"); static final String V3 = "v3"; static final NaviLink L3_VAL = NaviLinkImpl.makeNaviScopeParamLink("l3", "k3", V3); private NaviManager m; @Override protected void setUp() throws Exception { NaviHistoryCfg naviCfg = new NaviHistoryCfg(); naviCfg.setSessionIdGenStrategy(SessionIdGenStrategy.SEQUENTIAL); m = new NaviManagerImpl(naviCfg); } public void testPassValueToNextPage() { NaviHistory h; h = m.onNavigateTo(L1, null); // start new page and pass a value h = m.onNavigateTo(L2_VAL, "0.0"); assertEquals(V2, h.getNaviScopeProperty("k2")); // continue navigation to another page, the value should still be there h = m.onNavigateTo(L3, "0.1"); assertEquals(V2, h.getNaviScopeProperty("k2")); h = m.onNavigateTo(L1, "0.2"); assertEquals(null, h.getNaviScopeProperty("k2")); // get the the naviScope properties back on request on an old version: h = m.onNavigateTo(L3, "0.1"); assertEquals("1.0", h.getVersionString()); assertEquals(V2, h.getNaviScopeProperty("k2")); h = m.onNavigateTo(L2, "0.1"); assertEquals("2.0", h.getVersionString()); assertEquals(V2, h.getNaviScopeProperty("k2")); } public void testPassValueToCurrentPage() { NaviHistory h; h = m.onNavigateTo(L1, null); h = m.onNavigateTo(L1_VAL, "0.0"); assertEquals("v1", h.getNaviScopeProperty("k1")); h = m.onNavigateTo(L1, "0.1"); assertEquals("v1", h.getNaviScopeProperty("k1")); h = m.onNavigateTo(L2, "0.1"); assertEquals("v1", h.getNaviScopeProperty("k1")); h = m.onNavigateTo(L2_VAL, "0.2"); assertEquals("v1", h.getNaviScopeProperty("k1")); assertEquals(V2, h.getNaviScopeProperty("k2")); h = m.onNavigateTo(L1, "0.3"); assertEquals("v1", h.getNaviScopeProperty("k1")); assertEquals(null, h.getNaviScopeProperty("k2")); // get the the naviScope properties back on request to an old version: h = m.onNavigateTo(L1, "0.0"); assertEquals("1.0", h.getVersionString()); assertEquals(null, h.getNaviScopeProperty("k1")); assertEquals(null, h.getNaviScopeProperty("k2")); h = m.onNavigateTo(L1, "0.1"); assertEquals("2.0", h.getVersionString()); assertEquals("v1", h.getNaviScopeProperty("k1")); assertEquals(null, h.getNaviScopeProperty("k2")); h = m.onNavigateTo(L2, "0.3"); assertEquals("3.0", h.getVersionString()); assertEquals("v1", h.getNaviScopeProperty("k1")); assertEquals(V2, h.getNaviScopeProperty("k2")); } public void testNaviSessionIsolation() { NaviHistory h; h = m.onNavigateTo(L1, null); h = m.onNavigateTo(L1_VAL, "0.0"); assertEquals("v1", h.getNaviScopeProperty("k1")); h = m.onNavigateTo(L2_VAL, "0.0"); assertEquals("1.0", h.getVersionString()); assertEquals(null, h.getNaviScopeProperty("k1")); assertEquals(V2, h.getNaviScopeProperty("k2")); h = m.onNavigateTo(L1, "0.0"); assertEquals("2.0", h.getVersionString()); assertEquals(null, h.getNaviScopeProperty("k1")); assertEquals(null, h.getNaviScopeProperty("k2")); h = m.onNavigateTo(L1, "0.1"); assertEquals("0.1", h.getVersionString()); assertEquals("v1", h.getNaviScopeProperty("k1")); assertEquals(null, h.getNaviScopeProperty("k2")); } public void testHideValue() { NaviHistory h; h = m.onNavigateTo(L1, null); // pass the first value h = m.onNavigateTo(L1_VAL, "0.0"); assertEquals("v1", h.getNaviScopeProperty("k1")); // go to another page and pass another value for the same key h = m.onNavigateTo(NaviLinkImpl.makeNaviScopeParamLink("l2", "k1", "v1'"), "0.1"); assertEquals("v1'", h.getNaviScopeProperty("k1")); // use the first page and version -> the first value should be still there h = m.onNavigateTo(L1, "0.1"); assertEquals("1.0", h.getVersionString()); assertEquals("v1", h.getNaviScopeProperty("k1")); // ping the second page and version -> the second value should exist there h = m.onNavigateTo(L2, "0.2"); assertEquals("v1'", h.getNaviScopeProperty("k1")); } public void testPassNaviscopeValToPageChangeItAndPerformNavigationLoop() { NaviHistory h; h = m.onNavigateTo(L1, null); // start new page and pass a value h = m.onNavigateTo(L2_VAL, "0.0"); assertTrue("navigation link adds a property", V2 == h.getNaviScopeProperty("k2")); // change the value h.setNaviScopeProperty("k2", V2_CHANGED); assertTrue("property changed using the history interface", V2_CHANGED == h.getNaviScopeProperty("k2")); // do a navigation loop: h = m.onNavigateTo(L3, "0.1"); assertEquals("forward navigation should keep the propterty alive", V2_CHANGED, h.getNaviScopeProperty("k2")); h = m.onNavigateTo(L2, "0.2"); assertEquals("find the value on back navigation to the position where the parameter did already existed", V2_CHANGED, h.getNaviScopeProperty("k2")); h = m.onNavigateTo(L1, "0.3"); assertEquals("the value should not exist after back navigation to a position where it did not exist", null, h.getNaviScopeProperty("k2")); h = m.onNavigateTo(L2, "0.4"); assertEquals("a new navigation to the page L2 (not back-navigation!) without navi-parameter will " + "not find the value of the old navigation loop again", null, h.getNaviScopeProperty("k2")); } }
{ "content_hash": "8425b24c14d54b890514410757a975c9", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 109, "avg_line_length": 34.189189189189186, "alnum_prop": 0.6689328063241107, "repo_name": "pm4j/org.pm4j", "id": "ad86b394f9fe31661a2737f823818e9b10a2a060", "size": "6325", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pm4j-core/src/test/java/org/pm4j/core/navi/NaviScopeTest.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "93" }, { "name": "HTML", "bytes": "52514" }, { "name": "Java", "bytes": "3122649" } ], "symlink_target": "" }
package org.apache.camel.processor; import org.apache.camel.ContextTestSupport; import org.apache.camel.FailedToStartRouteException; import org.apache.camel.builder.RouteBuilder; /** * @version */ public class RouteStartupOrderClashTest extends ContextTestSupport { @Override public boolean isUseRouteBuilder() { return false; } public void testRouteStartupOrderClash() throws Exception { context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("seda:foo").startupOrder(2).to("mock:result"); from("direct:start").startupOrder(1).to("seda:foo"); // clash as we got two routes with order 2 from("seda:bar").startupOrder(2).to("mock:bar"); } }); try { context.start(); fail("Should have thrown an exception"); } catch (FailedToStartRouteException e) { // expected assertTrue(e.getMessage().contains("startupOrder 2")); } } }
{ "content_hash": "4d1e176bb6c12486a1f52b1a0ac5e05f", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 68, "avg_line_length": 28.225, "alnum_prop": 0.5863596102745793, "repo_name": "everttigchelaar/camel-svn", "id": "a72e253e878c068a60dac0264a7a78f5b5d256fa", "size": "1947", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderClashTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ActionScript", "bytes": "20202" }, { "name": "Groovy", "bytes": "4271" }, { "name": "Java", "bytes": "20966503" }, { "name": "JavaScript", "bytes": "4320924" }, { "name": "PHP", "bytes": "90746" }, { "name": "Ruby", "bytes": "4977" }, { "name": "Scala", "bytes": "189152" }, { "name": "Shell", "bytes": "1204" }, { "name": "XQuery", "bytes": "469" } ], "symlink_target": "" }
using std::ostream; using std::string; using std::vector; using std::unique_ptr; using ::mesos::typeutils::internal::createFrameworkInfoDifferencer; namespace mesos { // TODO(vinod): Ensure that these operators do not go out of sync // when new fields are added to the protobufs (MESOS-2487). bool operator==(const CommandInfo& left, const CommandInfo& right) { if (left.uris().size() != right.uris().size()) { return false; } // TODO(vinod): Factor out the comparison for repeated fields. for (int i = 0; i < left.uris().size(); i++) { bool found = false; for (int j = 0; j < right.uris().size(); j++) { if (left.uris().Get(i) == right.uris().Get(j)) { found = true; break; } } if (!found) { return false; } } if (left.arguments().size() != right.arguments().size()) { return false; } // The order of argv is important. for (int i = 0; i < left.arguments().size(); i++) { if (left.arguments().Get(i) != right.arguments().Get(i)) { return false; } } // NOTE: We are not validating CommandInfo::ContainerInfo here // because it is being deprecated in favor of ContainerInfo. // TODO(vinod): Kill the above comment when // CommandInfo::ContainerInfo is removed. return left.environment() == right.environment() && left.value() == right.value() && left.user() == right.user() && left.shell() == right.shell(); } bool operator==(const CommandInfo::URI& left, const CommandInfo::URI& right) { // NOTE: We purposefully do not compare the value of the `cache` field // because a URI downloaded from source or from the fetcher cache should // be considered identical. return left.value() == right.value() && left.executable() == right.executable() && left.extract() == right.extract() && left.output_file() == right.output_file(); } bool operator==(const ContainerID& left, const ContainerID& right) { return left.value() == right.value() && left.has_parent() == right.has_parent() && (!left.has_parent() || left.parent() == right.parent()); } bool operator==(const Credential& left, const Credential& right) { return left.principal() == right.principal() && left.secret() == right.secret(); } bool operator==(const CSIPluginInfo& left, const CSIPluginInfo& right) { // Order of containers is important. if (left.containers_size() != right.containers_size()) { return false; } for (int i = 0; i < left.containers_size(); i++) { if (left.containers(i) != right.containers(i)) { return false; } } return left.type() == right.type() && left.name() == right.name(); } bool operator==( const CSIPluginContainerInfo& left, const CSIPluginContainerInfo& right) { // Order of services is not important. if (left.services_size() != right.services_size()) { return false; } vector<bool> used(right.services_size(), false); for (int i = 0; i < left.services_size(); i++) { bool found = false; for (int j = 0; j < right.services_size(); j++) { if (left.services(i) == right.services(j) && !used[j]) { found = used[j] = true; break; } } if (!found) { return false; } } return left.has_command() == right.has_command() && (!left.has_command() || left.command() == right.command()) && Resources(left.resources()) == Resources(right.resources()) && left.has_container() == right.has_container() && (!left.has_container() || left.container() == right.container()); } bool operator==( const Environment::Variable& left, const Environment::Variable& right) { return left.name() == right.name() && left.value() == right.value(); } bool operator==(const Environment& left, const Environment& right) { // Order of variables is not important. if (left.variables().size() != right.variables().size()) { return false; } for (int i = 0; i < left.variables().size(); i++) { bool found = false; for (int j = 0; j < right.variables().size(); j++) { if (left.variables().Get(i) == right.variables().Get(j)) { found = true; break; } } if (!found) { return false; } } return true; } bool operator==(const Volume& left, const Volume& right) { return left.container_path() == right.container_path() && left.host_path() == right.host_path() && left.mode() == right.mode(); } bool operator==( const Volume::Source::CSIVolume::VolumeCapability& left, const Volume::Source::CSIVolume::VolumeCapability& right) { // NOTE: `MessageDifferencer::Equivalent` would ignore unknown fields and load // default values for unset fields (which are indistinguishable in proto3). return google::protobuf::util::MessageDifferencer::Equivalent(left, right); } // TODO(bmahler): Leverage process::http::URL for equality. bool operator==(const URL& left, const URL& right) { return left.SerializeAsString() == right.SerializeAsString(); } bool operator==(const UUID& left, const UUID& right) { return left.value() == right.value(); } bool operator==( const ContainerInfo::DockerInfo::PortMapping& left, const ContainerInfo::DockerInfo::PortMapping& right) { return left.host_port() == right.host_port() && left.container_port() == right.container_port() && left.protocol() == right.protocol(); } bool operator==(const Parameter& left, const Parameter& right) { return left.key() == right.key() && left.value() == right.value(); } bool operator==( const ContainerInfo::DockerInfo& left, const ContainerInfo::DockerInfo& right) { // Order of port mappings is not important. if (left.port_mappings().size() != right.port_mappings().size()) { return false; } for (int i = 0; i < left.port_mappings().size(); i++) { bool found = false; for (int j = 0; j < right.port_mappings().size(); j++) { if (left.port_mappings().Get(i) == right.port_mappings().Get(j)) { found = true; break; } } if (!found) { return false; } } // Order of parameters is not important. if (left.parameters().size() != right.parameters().size()) { return false; } for (int i = 0; i < left.parameters().size(); i++) { bool found = false; for (int j = 0; j < right.parameters().size(); j++) { if (left.parameters().Get(i) == right.parameters().Get(j)) { found = true; break; } } if (!found) { return false; } } return left.image() == right.image() && left.network() == right.network() && left.privileged() == right.privileged() && left.force_pull_image() == right.force_pull_image(); } bool operator==(const ContainerInfo& left, const ContainerInfo& right) { // Order of volumes is not important. if (left.volumes().size() != right.volumes().size()) { return false; } for (int i = 0; i < left.volumes().size(); i++) { bool found = false; for (int j = 0; j < right.volumes().size(); j++) { if (left.volumes().Get(i) == right.volumes().Get(j)) { found = true; break; } } if (!found) { return false; } } return left.type() == right.type() && left.hostname() == right.hostname() && left.docker() == right.docker(); } bool operator==(const Port& left, const Port& right) { return left.number() == right.number() && left.name() == right.name() && left.protocol() == right.protocol() && left.visibility() == right.visibility(); } bool operator==(const Ports& left, const Ports& right) { // Order of ports is not important. if (left.ports().size() != right.ports().size()) { return false; } for (int i = 0; i < left.ports().size(); i++) { bool found = false; for (int j = 0; j < right.ports().size(); j++) { if (left.ports().Get(i) == right.ports().Get(j)) { found = true; break; } } if (!found) { return false; } } return true; } bool operator==(const Label& left, const Label& right) { return left.key() == right.key() && left.value() == right.value(); } bool operator==(const Labels& left, const Labels& right) { // Order of labels is not important. if (left.labels().size() != right.labels().size()) { return false; } for (int i = 0; i < left.labels().size(); i++) { bool found = false; for (int j = 0; j < right.labels().size(); j++) { if (left.labels().Get(i) == right.labels().Get(j)) { found = true; break; } } if (!found) { return false; } } return true; } bool operator!=(const Labels& left, const Labels& right) { return !(left == right); } bool operator==(const DiscoveryInfo& left, const DiscoveryInfo& right) { return left.visibility() == right.visibility() && left.name() == right.name() && left.environment() == right.environment() && left.location() == right.location() && left.version() == right.version() && left.ports() == right.ports() && left.labels() == right.labels(); } bool operator==(const ExecutorInfo& left, const ExecutorInfo& right) { return left.has_type() == right.has_type() && (!left.has_type() || left.type() == right.type()) && left.executor_id() == right.executor_id() && left.data() == right.data() && Resources(left.resources()) == Resources(right.resources()) && left.command() == right.command() && left.framework_id() == right.framework_id() && left.name() == right.name() && left.source() == right.source() && left.container() == right.container() && left.discovery() == right.discovery(); } bool operator!=(const ExecutorInfo& left, const ExecutorInfo& right) { return !(left == right); } bool operator==(const HealthCheck& left, const HealthCheck& right) { return google::protobuf::util::MessageDifferencer::Equals(left, right); } bool operator==(const KillPolicy& left, const KillPolicy& right) { return google::protobuf::util::MessageDifferencer::Equals(left, right); } bool operator==(const MasterInfo& left, const MasterInfo& right) { return left.id() == right.id() && left.ip() == right.ip() && left.port() == right.port() && left.pid() == right.pid() && left.hostname() == right.hostname() && left.version() == right.version() && left.domain() == right.domain(); } bool operator==( const ResourceProviderInfo::Storage& left, const ResourceProviderInfo::Storage& right) { return left.plugin() == right.plugin(); } bool operator==( const ResourceProviderInfo& left, const ResourceProviderInfo& right) { // Order of reservations is important. if (left.default_reservations_size() != right.default_reservations_size()) { return false; } for (int i = 0; i < left.default_reservations_size(); i++) { if (left.default_reservations(i) != right.default_reservations(i)) { return false; } } return left.has_id() == right.has_id() && (!left.has_id() || left.id() == right.id()) && Attributes(left.attributes()) == Attributes(right.attributes()) && left.type() == right.type() && left.name() == right.name() && left.has_storage() == right.has_storage() && (!left.has_storage() || left.storage() == right.storage()); } bool operator==(const Offer::Operation& left, const Offer::Operation& right) { return google::protobuf::util::MessageDifferencer::Equals(left, right); } bool operator==(const Operation& left, const Operation& right) { return google::protobuf::util::MessageDifferencer::Equals(left, right); } bool operator==(const OperationStatus& left, const OperationStatus& right) { if (left.has_operation_id() != right.has_operation_id()) { return false; } if (left.has_operation_id() && left.operation_id() != right.operation_id()) { return false; } if (left.state() != right.state()) { return false; } if (left.has_message() != right.has_message()) { return false; } if (left.has_message() && left.message() != right.message()) { return false; } if (Resources(left.converted_resources()) != Resources(right.converted_resources())) { return false; } if (left.has_uuid() != right.has_uuid()) { return false; } if (left.has_uuid() && left.uuid() != right.uuid()) { return false; } if (left.has_slave_id() != right.has_slave_id()) { return false; } if (left.has_slave_id() && left.slave_id() != right.slave_id()) { return false; } if (left.has_resource_provider_id() != right.has_resource_provider_id()) { return false; } if (left.has_resource_provider_id() && left.resource_provider_id() != right.resource_provider_id()) { return false; } return true; } bool operator!=(const Offer::Operation& left, const Offer::Operation& right) { return !(left == right); } bool operator!=(const Operation& left, const Operation& right) { return !(left == right); } bool operator!=(const OperationStatus& left, const OperationStatus& right) { return !(left == right); } bool operator==( const ResourceStatistics& left, const ResourceStatistics& right) { return left.SerializeAsString() == right.SerializeAsString(); } bool operator==(const SlaveInfo& left, const SlaveInfo& right) { return left.hostname() == right.hostname() && Resources(left.resources()) == Resources(right.resources()) && Attributes(left.attributes()) == Attributes(right.attributes()) && left.id() == right.id() && left.checkpoint() == right.checkpoint() && left.port() == right.port() && left.domain() == right.domain(); } bool operator==(const Task& left, const Task& right) { // Order of task statuses is important. if (left.statuses().size() != right.statuses().size()) { return false; } for (int i = 0; i < left.statuses().size(); i++) { if (left.statuses().Get(i) != right.statuses().Get(i)) { return false; } } return left.name() == right.name() && left.task_id() == right.task_id() && left.framework_id() == right.framework_id() && left.executor_id() == right.executor_id() && left.slave_id() == right.slave_id() && left.state() == right.state() && Resources(left.resources()) == Resources(right.resources()) && left.status_update_state() == right.status_update_state() && left.status_update_uuid() == right.status_update_uuid() && left.labels() == right.labels() && left.discovery() == right.discovery() && left.user() == right.user() && left.container() == right.container() && left.health_check() == right.health_check() && left.kill_policy() == right.kill_policy(); } bool operator==(const TaskGroupInfo& left, const TaskGroupInfo& right) { // Order of tasks in a task group is not important. if (left.tasks().size() != right.tasks().size()) { return false; } for (int i = 0; i < left.tasks().size(); i++) { bool found = false; for (int j = 0; j < right.tasks().size(); j++) { if (left.tasks().Get(i) == right.tasks().Get(j)) { found = true; break; } } if (!found) { return false; } } return true; } // TODO(anand): Consider doing a field by field comparison instead. bool operator==(const TaskInfo& left, const TaskInfo& right) { return left.SerializeAsString() == right.SerializeAsString(); } // TODO(bmahler): Use SerializeToString here? bool operator==(const TaskStatus& left, const TaskStatus& right) { return left.task_id() == right.task_id() && left.state() == right.state() && left.data() == right.data() && left.message() == right.message() && left.slave_id() == right.slave_id() && left.timestamp() == right.timestamp() && left.executor_id() == right.executor_id() && left.healthy() == right.healthy() && left.source() == right.source() && left.reason() == right.reason() && left.uuid() == right.uuid(); } bool operator!=(const TaskStatus& left, const TaskStatus& right) { return !(left == right); } bool operator!=( const Volume::Source::CSIVolume::VolumeCapability& left, const Volume::Source::CSIVolume::VolumeCapability& right) { return !(left == right); } bool operator==(const CheckStatusInfo& left, const CheckStatusInfo& right) { return left.SerializeAsString() == right.SerializeAsString(); } bool operator!=(const CheckStatusInfo& left, const CheckStatusInfo& right) { return !(left == right); } namespace typeutils { bool equivalent(const FrameworkInfo& left, const FrameworkInfo& right) { return createFrameworkInfoDifferencer<FrameworkInfo>()->Compare(left, right); } Option<string> diff(const FrameworkInfo& left, const FrameworkInfo& right) { unique_ptr<::google::protobuf::util::MessageDifferencer> differencer{ createFrameworkInfoDifferencer<FrameworkInfo>()}; string result; differencer->ReportDifferencesToString(&result); if (differencer->Compare(left, right)) { return None(); } return result; } } // namespace typeutils { ostream& operator<<(ostream& stream, const CapabilityInfo& capabilityInfo) { return stream << JSON::protobuf(capabilityInfo); } ostream& operator<<(ostream& stream, const DeviceWhitelist& deviceWhitelist) { return stream << JSON::protobuf(deviceWhitelist); } ostream& operator<<(ostream& stream, const DrainConfig& drainConfig) { return stream << JSON::protobuf(drainConfig); } ostream& operator<<(ostream& stream, const DrainState& state) { return stream << DrainState_Name(state); } ostream& operator<<(ostream& stream, const CheckStatusInfo& checkStatusInfo) { switch (checkStatusInfo.type()) { case CheckInfo::COMMAND: if (checkStatusInfo.has_command()) { stream << "COMMAND"; if (checkStatusInfo.command().has_exit_code()) { stream << " exit code " << checkStatusInfo.command().exit_code(); } } break; case CheckInfo::HTTP: if (checkStatusInfo.has_http()) { stream << "HTTP"; if (checkStatusInfo.http().has_status_code()) { stream << " status code " << checkStatusInfo.http().status_code(); } } break; case CheckInfo::TCP: if (checkStatusInfo.has_tcp()) { stream << "TCP"; if (checkStatusInfo.tcp().has_succeeded()) { stream << (checkStatusInfo.tcp().succeeded() ? " connection success" : " connection failure"); } } break; case CheckInfo::UNKNOWN: stream << "UNKNOWN"; break; } return stream; } ostream& operator<<(ostream& stream, const CommandInfo& commandInfo) { return stream << JSON::protobuf(commandInfo); } ostream& operator<<(ostream& stream, const ContainerID& containerId) { return containerId.has_parent() ? stream << containerId.parent() << "." << containerId.value() : stream << containerId.value(); } ostream& operator<<(ostream& stream, const ContainerInfo& containerInfo) { return stream << containerInfo.DebugString(); } ostream& operator<<(ostream& stream, const DomainInfo& domainInfo) { return stream << JSON::protobuf(domainInfo); } ostream& operator<<(ostream& stream, const Environment& environment) { return stream << JSON::protobuf(environment); } ostream& operator<<(ostream& stream, const ExecutorID& executorId) { return stream << executorId.value(); } ostream& operator<<(ostream& stream, const ExecutorInfo& executor) { return stream << executor.DebugString(); } ostream& operator<<(ostream& stream, const FrameworkID& frameworkId) { return stream << frameworkId.value(); } ostream& operator<<(ostream& stream, const MasterInfo& master) { return stream << master.DebugString(); } ostream& operator<<(ostream& stream, const OfferID& offerId) { return stream << offerId.value(); } ostream& operator<<(ostream& stream, const OperationID& operationId) { return stream << operationId.value(); } ostream& operator<<(ostream& stream, const OperationState& state) { return stream << OperationState_Name(state); } ostream& operator<<(ostream& stream, const Operation& operation) { stream << operation.uuid() << " ("; stream << operation.info().type(); if (operation.has_framework_id()) { stream << " for framework " << operation.framework_id(); } if (operation.info().has_id()) { stream << ", ID: " << operation.info().id(); } const OperationStatus& latestStatus(operation.latest_status()); if (latestStatus.has_resource_provider_id()) { stream << ", affecting resource provider " << latestStatus.resource_provider_id(); } stream << ", latest state: " << latestStatus.state(); stream << ")"; return stream; } ostream& operator<<(ostream& stream, const RateLimits& limits) { return stream << limits.DebugString(); } ostream& operator<<( ostream& stream, const ResourceProviderID& resourceProviderId) { return stream << resourceProviderId.value(); } ostream& operator<<( ostream& stream, const ResourceProviderInfo& resourceProviderInfo) { return stream << JSON::protobuf(resourceProviderInfo); } ostream& operator<<(ostream& stream, const RLimitInfo& rlimitInfo) { return stream << JSON::protobuf(rlimitInfo); } ostream& operator<<(ostream& stream, const SlaveID& slaveId) { return stream << slaveId.value(); } ostream& operator<<(ostream& stream, const SlaveInfo& slave) { return stream << slave.DebugString(); } ostream& operator<<(ostream& stream, const TaskID& taskId) { return stream << taskId.value(); } ostream& operator<<(ostream& stream, const MachineID& machineId) { if (machineId.has_hostname() && machineId.has_ip()) { return stream << machineId.hostname() << " (" << machineId.ip() << ")"; } // If only a hostname is present. if (machineId.has_hostname()) { return stream << machineId.hostname(); } else { // If there is no hostname, then there is an IP. return stream << "(" << machineId.ip() << ")"; } } ostream& operator<<(ostream& stream, const TaskInfo& task) { return stream << task.DebugString(); } ostream& operator<<(ostream& stream, const TaskState& state) { return stream << TaskState_Name(state); } ostream& operator<<(ostream& stream, const UUID& uuid) { Try<id::UUID> _uuid = id::UUID::fromBytes(uuid.value()); if (_uuid.isError()) { return stream << "INVALID UUID"; } return stream << _uuid->toString(); } ostream& operator<<(ostream& stream, const CheckInfo::Type& type) { return stream << CheckInfo::Type_Name(type); } ostream& operator<<( ostream& stream, const CSIPluginContainerInfo::Service& service) { return stream << CSIPluginContainerInfo::Service_Name(service); } ostream& operator<<( ostream& stream, const FrameworkInfo::Capability& capability) { return stream << FrameworkInfo::Capability::Type_Name(capability.type()); } ostream& operator<<(ostream& stream, const Image::Type& imageType) { return stream << Image::Type_Name(imageType); } ostream& operator<<(ostream& stream, const Secret::Type& secretType) { return stream << Secret::Type_Name(secretType); } ostream& operator<<( ostream& stream, const Offer::Operation::Type& operationType) { return stream << Offer::Operation::Type_Name(operationType); } ostream& operator<<( ostream& stream, const Resource::DiskInfo::Source::Type& sourceType) { return stream << Resource::DiskInfo::Source::Type_Name(sourceType); } } // namespace mesos {
{ "content_hash": "2180874c9922c943871f5a06df421320", "timestamp": "", "source": "github", "line_count": 977, "max_line_length": 80, "avg_line_length": 24.11873080859775, "alnum_prop": 0.6282464776778136, "repo_name": "abudnik/mesos", "id": "899fd6dea3ab961b8f245059759cfd829219451f", "size": "24673", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "src/common/type_utils.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "8107" }, { "name": "C++", "bytes": "15036241" }, { "name": "CMake", "bytes": "102798" }, { "name": "CSS", "bytes": "8663" }, { "name": "Dockerfile", "bytes": "17368" }, { "name": "Groovy", "bytes": "3938" }, { "name": "HTML", "bytes": "99365" }, { "name": "Java", "bytes": "150499" }, { "name": "JavaScript", "bytes": "96892" }, { "name": "M4", "bytes": "201307" }, { "name": "Makefile", "bytes": "119712" }, { "name": "PowerShell", "bytes": "2547" }, { "name": "Python", "bytes": "356048" }, { "name": "Ruby", "bytes": "10022" }, { "name": "Shell", "bytes": "147120" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AssignmentProblem { class Preferences { public const string c_defaultTask = "role"; public const string c_defaultAgent = "player"; public const int c_defaultMaxPreferences = 8; public const int c_defaultMaxDislikes = 0; public const int c_defaultMaxImpossible = 4; public const bool c_preferencesOrdered = true; public const bool c_dislikesOrdered = true; public const int c_costImpossible = 1000; public const int c_costStep = 1; public const int c_costStepAverage = 5; /// <summary> /// Display name of tasks /// </summary> public string Task { get; set; } /// <summary> /// Display names of agents /// </summary> public string Agent { get; set; } /// <summary> /// Maximum number of preferences (can be 0) /// </summary> public int MaxPreferences { get; set; } /// <summary> /// Maximum number of dislikes (can be 0) /// </summary> public int MaxDislikes { get; set; } /// <summary> /// Maximum number of impossible choices (can be 0) /// </summary> public int MaxImpossible { get; set; } /// <summary> /// Are preferences ordered or equal? /// </summary> public bool PreferencesOrdered { get; set; } /// <summary> /// Are dislikes ordered or equal? /// </summary> public bool DislikesOrdered { get; set; } /// <summary> /// Cost for impossible tasks /// </summary> public int CostImpossible { get; set; } /// <summary> /// Cost steps for preferences / dislikes /// </summary> public int CostStep { get; set; } /// <summary> /// Step cist for average tasks /// Example: Step = 2, Average = 3, #Pref/Dislike = 3 /// | pref | average | dislike | /// Costs are 1, 3, 5, 8, 11, 13, 15 /// </summary> public int CostStepAverage; /// <summary> /// Load preferences from XML file if exists, otherwise use defaults /// </summary> public void Load() { SetDefaultValues(); } /// <summary> /// Save preferences to XML file /// </summary> public void Save() { } /// <summary> /// Set Default values /// </summary> private void SetDefaultValues() { Task = c_defaultTask; Agent = c_defaultAgent; MaxPreferences = c_defaultMaxPreferences; MaxDislikes = c_defaultMaxDislikes; MaxImpossible = c_defaultMaxImpossible; PreferencesOrdered = c_preferencesOrdered; DislikesOrdered = c_dislikesOrdered; CostImpossible = c_costImpossible; CostStep = c_costStep; CostStepAverage = c_costStepAverage; } } }
{ "content_hash": "7ddb9435117d181911e909972af8ae9d", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 70, "avg_line_length": 19.820689655172412, "alnum_prop": 0.592553931802366, "repo_name": "DonnieDarko85/CharAssignment", "id": "842426922c2558dab50017b5b199a444828c8913", "size": "2876", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AssignmentProblem/Preferences.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "128967" } ], "symlink_target": "" }
namespace Poco { class Logger; namespace Data { class Session; class Statement; } } namespace toggl { class AutotrackerRule; class Client; class Project; class Proxy; class Settings; class Tag; class Task; class TimeEntry; class User; class Workspace; class Database { public: explicit Database(const std::string db_path); ~Database(); error DeleteUser( User *model, const bool with_related_data); error LoadUserByID( const Poco::UInt64 &UID, User *user); error LoadUserByEmail( const std::string &email, User *model); error LoadCurrentUser(User *user); error LoadSettings(Settings *settings); error LoadWindowSettings( Poco::Int64 *window_x, Poco::Int64 *window_y, Poco::Int64 *window_height, Poco::Int64 *window_width); error SaveWindowSettings( const Poco::Int64 window_x, const Poco::Int64 window_y, const Poco::Int64 window_height, const Poco::Int64 window_width); error SetSettingsHasSeenBetaOffering(const bool &value); error SetSettingsUseIdleDetection(const bool &use_idle_detection); error SetSettingsAutotrack(const bool &value); error SetSettingsOpenEditorOnShortcut(const bool &value); error SetSettingsMenubarTimer(const bool &menubar_timer); error SetSettingsMenubarProject(const bool &menubar_project); error SetSettingsDockIcon(const bool &dock_icon); error SetSettingsOnTop(const bool &on_top); error SetSettingsReminder(const bool &reminder); error SetSettingsIdleMinutes(const Poco::UInt64 idle_minutes); error SetSettingsFocusOnShortcut(const bool &focus_on_shortcut); error SetSettingsReminderMinutes(const Poco::UInt64 reminder_minutes); error SetSettingsManualMode(const bool &manual_mode); error SetSettingsAutodetectProxy(const bool &autodetect_proxy); error SetSettingsRemindTimes( const std::string &remind_starts, const std::string &remind_ends); error SetSettingsRemindDays( const bool &remind_mon, const bool &remind_tue, const bool &remind_wed, const bool &remind_thu, const bool &remind_fri, const bool &remind_sat, const bool &remind_sun); error SetWindowMaximized( const bool value); error GetWindowMaximized(bool *result); error SetWindowMinimized( const bool value); error GetWindowMinimized(bool *result); error SetWindowEditSizeHeight( const Poco::Int64 value); error GetWindowEditSizeHeight(Poco::Int64 *result); error SetWindowEditSizeWidth( const Poco::Int64 value); error GetWindowEditSizeWidth(Poco::Int64 *result); error SetKeyStart( const std::string value); error GetKeyStart(std::string *result); error SetKeyShow( const std::string value); error GetKeyShow(std::string *result); error SetKeyModifierShow( const std::string value); error GetKeyModifierShow(std::string *result); error SetKeyModifierStart( const std::string value); error GetKeyModifierStart(std::string *result); error LoadProxySettings( bool *use_proxy, Proxy *proxy); error SaveProxySettings( const bool &use_proxy, const Proxy &proxy); error LoadUpdateChannel( std::string *update_channel); error SaveUpdateChannel( const std::string &update_channel); error UInt( const std::string sql, Poco::UInt64 *result); error String( const std::string sql, std::string *result); error SaveUser(User *user, bool with_related_data, std::vector<ModelChange> *changes); error LoadTimeEntriesForUpload(User *user); error CurrentAPIToken( std::string *token, Poco::UInt64 *uid); error SetCurrentAPIToken( const std::string &token, const Poco::UInt64 &uid); error ClearCurrentAPIToken(); static std::string GenerateGUID(); std::string DesktopID() const { return desktop_id_; } error EnsureDesktopID(); std::string AnalyticsClientID() const { return analytics_client_id_; } error EnsureAnalyticsClientID(); error Migrate( const std::string &name, const std::string sql); error EnsureTimelineGUIDS(); error Trim(const std::string text, std::string *result); private: error vacuum(); error initialize_tables(); error ensureMigrationTable(); template<typename T> error setSettingsValue( const std::string field_name, const T &value); template<typename T> error getSettingsValue( const std::string field_name, T *value); error execute( const std::string sql); error last_error( const std::string was_doing); error journalMode(std::string *); error setJournalMode(const std::string); error loadUsersRelatedData(User *user); error loadWorkspaces( const Poco::UInt64 &UID, std::vector<Workspace *> *list); error loadClients( const Poco::UInt64 &UID, std::vector<Client *> *list); error loadProjects( const Poco::UInt64 &UID, std::vector<Project *> *list); error loadTasks( const Poco::UInt64 &UID, std::vector<Task *> *list); error loadTags( const Poco::UInt64 &UID, std::vector<Tag *> *list); error loadAutotrackerRules( const Poco::UInt64 &UID, std::vector<AutotrackerRule *> *list); error loadTimeEntries( const Poco::UInt64 &UID, std::vector<TimeEntry *> *list); error loadTimelineEvents( const Poco::UInt64 &UID, std::vector<TimelineEvent *> *list); error loadTimeEntriesFromSQLStatement( Poco::Data::Statement *select, std::vector<TimeEntry *> *list); template <typename T> error saveRelatedModels( const Poco::UInt64 UID, const std::string table_name, std::vector<T *> *list, std::vector<ModelChange> *changes); error deleteFromTable( const std::string table_name, const Poco::Int64 &local_id); error deleteAllFromTableByUID( const std::string table_name, const Poco::Int64 &UID); error saveModel( AutotrackerRule *model, std::vector<ModelChange> *changes); error saveModel( Workspace *model, std::vector<ModelChange> *changes); error saveModel( Client *model, std::vector<ModelChange> *changes); error saveModel( Project *model, std::vector<ModelChange> *changes); error saveModel( Task *model, std::vector<ModelChange> *changes); error saveModel( Tag *model, std::vector<ModelChange> *changes); error saveModel( TimeEntry *model, std::vector<ModelChange> *changes); error saveModel( TimelineEvent *model, std::vector<ModelChange> *changes); error saveDesktopID(); error saveAnalyticsClientID(); error deleteTooOldTimeline( const Poco::UInt64 &UID); error deleteUserTimeline( const Poco::UInt64 &UID); error selectCompressedTimelineBatchForUpload( const Poco::UInt64 &user_id, std::vector<TimelineEvent> *timeline_events); Poco::Logger &logger() const; Poco::Mutex session_m_; Poco::Data::Session *session_; std::string desktop_id_; std::string analytics_client_id_; }; } // namespace toggl #endif // SRC_DATABASE_H_
{ "content_hash": "211266a6b85ef7c77e230c0285a4b552", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 74, "avg_line_length": 23.440366972477065, "alnum_prop": 0.6440965427266797, "repo_name": "codeman38/toggldesktop", "id": "ff04bed66026d250d84b05712224765654ee9b73", "size": "8011", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/database.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "54575" }, { "name": "C#", "bytes": "329056" }, { "name": "C++", "bytes": "790596" }, { "name": "Go", "bytes": "10456" }, { "name": "HTML", "bytes": "35682" }, { "name": "Lua", "bytes": "9263" }, { "name": "Makefile", "bytes": "20114" }, { "name": "Objective-C", "bytes": "207070" }, { "name": "QMake", "bytes": "10209" }, { "name": "Shell", "bytes": "2928" } ], "symlink_target": "" }
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! #ifndef V8OESTextureHalfFloat_h #define V8OESTextureHalfFloat_h #include "bindings/core/v8/ScriptWrappable.h" #include "bindings/core/v8/ToV8.h" #include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8DOMWrapper.h" #include "bindings/core/v8/WrapperTypeInfo.h" #include "modules/ModulesExport.h" #include "modules/webgl/OESTextureHalfFloat.h" #include "platform/heap/Handle.h" namespace blink { class V8OESTextureHalfFloat { public: MODULES_EXPORT static bool hasInstance(v8::Local<v8::Value>, v8::Isolate*); static v8::Local<v8::Object> findInstanceInPrototypeChain(v8::Local<v8::Value>, v8::Isolate*); MODULES_EXPORT static v8::Local<v8::FunctionTemplate> domTemplate(v8::Isolate*); static OESTextureHalfFloat* toImpl(v8::Local<v8::Object> object) { return toScriptWrappable(object)->toImpl<OESTextureHalfFloat>(); } MODULES_EXPORT static OESTextureHalfFloat* toImplWithTypeCheck(v8::Isolate*, v8::Local<v8::Value>); MODULES_EXPORT static const WrapperTypeInfo wrapperTypeInfo; static void refObject(ScriptWrappable*); static void derefObject(ScriptWrappable*); template<typename VisitorDispatcher> static void trace(VisitorDispatcher visitor, ScriptWrappable* scriptWrappable) { #if ENABLE(OILPAN) visitor->trace(scriptWrappable->toImpl<OESTextureHalfFloat>()); #endif } static void visitDOMWrapper(v8::Isolate*, ScriptWrappable*, const v8::Persistent<v8::Object>&); static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installConditionallyEnabledProperties(v8::Local<v8::Object>, v8::Isolate*) { } static void preparePrototypeObject(v8::Isolate*, v8::Local<v8::Object> prototypeObject, v8::Local<v8::FunctionTemplate> interfaceTemplate) { } }; template <> struct V8TypeOf<OESTextureHalfFloat> { typedef V8OESTextureHalfFloat Type; }; } // namespace blink #endif // V8OESTextureHalfFloat_h
{ "content_hash": "2a4fcaf5f28d3bc7ff5a603c178f17ef", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 146, "avg_line_length": 40.6078431372549, "alnum_prop": 0.7402221149203283, "repo_name": "weolar/miniblink49", "id": "7c8fde2dd6b2142e7fb4ca8e8fa454f087e401fb", "size": "2239", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "gen/blink/bindings/modules/v8/V8OESTextureHalfFloat.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "11324372" }, { "name": "Batchfile", "bytes": "52488" }, { "name": "C", "bytes": "32157305" }, { "name": "C++", "bytes": "280103993" }, { "name": "CMake", "bytes": "88548" }, { "name": "CSS", "bytes": "20839" }, { "name": "DIGITAL Command Language", "bytes": "226954" }, { "name": "HTML", "bytes": "202637" }, { "name": "JavaScript", "bytes": "32539485" }, { "name": "Lua", "bytes": "32432" }, { "name": "M4", "bytes": "125191" }, { "name": "Makefile", "bytes": "1517330" }, { "name": "NASL", "bytes": "42" }, { "name": "Objective-C", "bytes": "5320" }, { "name": "Objective-C++", "bytes": "35037" }, { "name": "POV-Ray SDL", "bytes": "307541" }, { "name": "Perl", "bytes": "3283676" }, { "name": "Prolog", "bytes": "29177" }, { "name": "Python", "bytes": "4331616" }, { "name": "R", "bytes": "10248" }, { "name": "Scheme", "bytes": "25457" }, { "name": "Shell", "bytes": "264021" }, { "name": "TypeScript", "bytes": "166033" }, { "name": "Vim Script", "bytes": "11362" }, { "name": "XS", "bytes": "4319" }, { "name": "eC", "bytes": "4383" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; namespace Aquapark { public class Aquapark { public static void Main(string[] args) { var slideQueue = new Queue<int>(); var n = int.Parse(Console.ReadLine()); for (int i = 0; i < n; i++) { var commandParams = Console.ReadLine() .Split(' '); switch (commandParams[0]) { case "add": var ID = int.Parse(commandParams[1]); slideQueue.Enqueue(ID); Console.WriteLine("Added {0}", ID); break; case "slide": var numberOfSlides = int.Parse(commandParams[1]); for (int k = 0; k < numberOfSlides % slideQueue.Count; k++) { slideQueue.Enqueue(slideQueue.Dequeue()); } Console.WriteLine("Slided {0}", numberOfSlides); break; case "print": Console.WriteLine(string.Join(" ", slideQueue.Reverse())); break; } } } } }
{ "content_hash": "a879278502e3d51b304d84315cc9f689", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 83, "avg_line_length": 30.272727272727273, "alnum_prop": 0.40615615615615613, "repo_name": "Xadera/Telerik-Academy-Alpha", "id": "9e833ceb74d8c3fd586917f08fb022ff68b482c4", "size": "1334", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Module 2/DSA Exam Practice/Aquapark/Aquapark.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "198" }, { "name": "C#", "bytes": "764282" }, { "name": "CSS", "bytes": "1146" }, { "name": "HTML", "bytes": "763" }, { "name": "JavaScript", "bytes": "22927" } ], "symlink_target": "" }
package com.zero_x_baadf00d.ebean.encryption; import io.ebean.config.EncryptKey; import io.ebean.config.EncryptKeyManager; import org.junit.Assert; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; /** * EbeanEncryptionTest. * * @author Thibault Meyer * @version 16.09.01 * @since 16.02.27 */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class EbeanEncryptionTest { /** * @since 16.02.27 */ @Test public void basicTest001() { final EncryptKeyManager encryptKeyManager = new BasicEncryptKeyManager(); encryptKeyManager.initialise(); final EncryptKey encryptKey = encryptKeyManager.getEncryptKey("tableName", "columnName"); Assert.assertNotNull(encryptKey); Assert.assertEquals("basic-key", encryptKey.getStringValue()); } /** * @since 16.02.27 */ @Test public void standardTest001() { final EncryptKeyManager encryptKeyManager = new StandardEncryptKeyManager(); encryptKeyManager.initialise(); Assert.assertEquals("basic-key-1", encryptKeyManager.getEncryptKey("tableName", "undefined").getStringValue()); Assert.assertEquals("basic-key-2", encryptKeyManager.getEncryptKey("tableName", "columnName").getStringValue()); Assert.assertEquals("basic-key", encryptKeyManager.getEncryptKey("tableName2", "columnName").getStringValue()); } }
{ "content_hash": "6b0fc76b8e9d190e63471c7f2b8d0188", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 120, "avg_line_length": 32.52272727272727, "alnum_prop": 0.7120894479385046, "repo_name": "0xbaadf00d/ebean-encryption", "id": "8e2b4b3becdff54181882ac81d1fb332fd7b3cb3", "size": "2584", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/com/zero_x_baadf00d/ebean/encryption/EbeanEncryptionTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "11768" } ], "symlink_target": "" }
<?php namespace TractorCow\Fluent\Extension; use InvalidArgumentException; use SilverStripe\ORM\DataQuery; use SilverStripe\ORM\DB; use SilverStripe\ORM\Queries\SQLSelect; use SilverStripe\Versioned\Versioned; use TractorCow\Fluent\Model\Locale; use TractorCow\Fluent\State\FluentState; /** * Extension for versioned localised objects * * Important: If adding this to a custom object, this extension must be added AFTER the versioned extension. * Use yaml `after` to enforce this */ class FluentVersionedExtension extends FluentExtension { /** * Live table suffix */ const SUFFIX_LIVE = '_Live'; /** * Versions table suffix */ const SUFFIX_VERSIONS = '_Versions'; /** * Default version table fields. _Versions has extra Version column. * * @var array */ protected $defaultVersionsFields = [ 'Version' => 'Int', ]; /** * Default version table indexes, including unique index to include Version column. * * @var array */ protected $defaultVersionsIndexes = [ 'Fluent_Record' => [ 'type' => 'unique', 'columns' => [ 'RecordID', 'Locale', 'Version', ], ], ]; /** * Cache of published status of this record * * @var array */ protected $localisedStageCache = []; protected function augmentDatabaseDontRequire($localisedTable) { DB::dont_require_table($localisedTable); DB::dont_require_table($localisedTable . self::SUFFIX_LIVE); DB::dont_require_table($localisedTable . self::SUFFIX_VERSIONS); } protected function augmentDatabaseRequireTable($localisedTable, $fields, $indexes) { DB::require_table($localisedTable, $fields, $indexes, false); // _Live record DB::require_table($localisedTable . self::SUFFIX_LIVE, $fields, $indexes, false); // Merge fields and indexes with Fluent defaults $versionsFields = array_merge($this->defaultVersionsFields, $fields); $versionsIndexes = array_merge($indexes, $this->defaultVersionsIndexes); DB::require_table($localisedTable . self::SUFFIX_VERSIONS, $versionsFields, $versionsIndexes, false); } /** * {@inheritDoc} * * @throws InvalidArgumentException if an invalid versioned mode is provided */ public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null) { /** @var Locale|null $locale */ $locale = $this->getDataQueryLocale($dataQuery); if (!$locale) { return; } // Rewrite query un-versioned parent::augmentSQL($query, $dataQuery); // Rewrite based on versioned rules if (!$dataQuery->getQueryParam('Versioned.mode')) { return; } $tables = $this->getLocalisedTables(); $versionedMode = $dataQuery->getQueryParam('Versioned.mode'); switch ($versionedMode) { // Reading a specific stage (Stage or Live) case 'stage': case 'stage_unique': // Rename all localised tables (note: alias remains unchanged). This is only done outside of draft. $stage = $dataQuery->getQueryParam('Versioned.stage'); if ($stage !== Versioned::DRAFT) { $this->renameLocalisedTables($query, $tables); } break; // Return all version instances case 'archive': case 'all_versions': case 'latest_versions': case 'version': $this->rewriteVersionedTables($query, $tables, $locale); break; default: throw new InvalidArgumentException("Bad value for query parameter Versioned.mode: {$versionedMode}"); } } /** * Rewrite all joined tables * * @param SQLSelect $query * @param array $tables * @param Locale $locale */ protected function rewriteVersionedTables(SQLSelect $query, array $tables, Locale $locale) { foreach ($tables as $tableName => $fields) { // Rename to _Versions suffixed versions $localisedTable = $this->getLocalisedTable($tableName); $query->renameTable($localisedTable, $localisedTable . self::SUFFIX_VERSIONS); // Add the chain of locale fallbacks $this->addLocaleFallbackChain($query, $tableName, $locale); } } /** * Update all joins to include Version as well as Locale / Record * * @param SQLSelect $query * @param string $tableName * @param Locale $locale */ protected function addLocaleFallbackChain(SQLSelect $query, $tableName, Locale $locale) { $baseTable = $this->owner->baseTable(); foreach ($locale->getChain() as $joinLocale) { /** @var Locale $joinLocale */ $joinAlias = $this->getLocalisedTable($tableName, $joinLocale->Locale); $versionTable = $baseTable . self::SUFFIX_VERSIONS; $query->setJoinFilter( $joinAlias, "\"{$versionTable}\".\"RecordID\" = \"{$joinAlias}\".\"RecordID\" " . "AND \"{$joinAlias}\".\"Locale\" = ? " . "AND \"{$joinAlias}\".\"Version\" = \"{$versionTable}\".\"Version\"" ); } } /** * Rename all localised tables to the "live" equivalent name (note: alias remains unchanged) * * @param SQLSelect $query * @param array $tables */ protected function renameLocalisedTables(SQLSelect $query, array $tables) { foreach ($tables as $table => $fields) { $localisedTable = $this->getLocalisedTable($table); $query->renameTable($localisedTable, $localisedTable . self::SUFFIX_LIVE); } } /** * Apply versioning to write * * @param array $manipulation */ public function augmentWrite(&$manipulation) { parent::augmentWrite($manipulation); // Only rewrite if the locale is valid $locale = Locale::getCurrentLocale(); if (!$locale) { return; } // Get all tables to translate fields for, and their respective field names $includedTables = $this->getLocalisedTables(); foreach ($includedTables as $table => $localisedFields) { // Localise both _Versions and _Live writes foreach ([self::SUFFIX_LIVE, self::SUFFIX_VERSIONS] as $suffix) { $versionedTable = $table . $suffix; $localisedTable = $this->getLocalisedTable($table) . $suffix; // Add extra case for "Version" column when localising Versions $localisedVersionFields = $localisedFields; if ($suffix === self::SUFFIX_VERSIONS) { $localisedVersionFields = array_merge( $localisedVersionFields, array_keys($this->defaultVersionsFields) ); } // Rewrite manipulation $this->localiseManipulationTable( $manipulation, $versionedTable, $localisedTable, $localisedVersionFields, $locale ); } } } /** * Decorate table to delete with _Live suffix as necessary * * @param string $tableName * @param string $locale * @return string */ protected function getDeleteTableTarget($tableName, $locale = '') { // Rewrite to _Live when deleting from live / unpublishing $table = parent::getDeleteTableTarget($tableName, $locale); if (Versioned::get_stage() === Versioned::LIVE) { $table .= self::SUFFIX_LIVE; } return $table; } /** * Check if this record is saved in this locale * * @param string $locale * @return bool */ public function isDraftedInLocale($locale = null) { return $this->isLocalisedInStage(Versioned::DRAFT, $locale); } /** * Check if this record is published in this locale * * @param string $locale * @return bool */ public function isPublishedInLocale($locale = null) { return $this->isLocalisedInStage(Versioned::LIVE, $locale); } /** * Check if this record exists (in either state) in this locale * * @param string $locale * @return bool */ public function existsInLocale($locale = null) { return $this->isDraftedInLocale($locale) || $this->isPublishedInLocale($locale); } /** * Check to see whether or not a record exists for a specific Locale in a specific stage. * * @param string $stage Version stage * @param string $locale Locale to check. Defaults to current locale. * @return bool */ protected function isLocalisedInStage($stage, $locale = null) { // Get locale if (!$locale) { $locale = FluentState::singleton()->getLocale(); // Potentially no Locales have been created in the system yet. if (!$locale) { return false; } } // Get table $baseTable = $this->owner->baseTable(); $table = $this->getLocalisedTable($baseTable); if ($stage === Versioned::LIVE) { $table .= self::SUFFIX_LIVE; } // Check cache $key = $table . '/' . $locale . '/' . $this->owner->ID; if (isset($this->localisedStageCache[$key])) { return $this->localisedStageCache[$key]; } $query = new SQLSelect(); $query->selectField('"ID"'); $query->addFrom('"'. $table . '"'); $query->addWhere([ '"RecordID"' => $this->owner->ID, '"Locale"' => $locale, ]); $query->firstRow(); $result = $query->execute()->value() !== null; // Set cache $this->localisedStageCache[$key] = $result; return $result; } public function flushCache() { $this->localisedStageCache = []; } }
{ "content_hash": "29a6861a29ad4a1199520eece8844eb9", "timestamp": "", "source": "github", "line_count": 332, "max_line_length": 117, "avg_line_length": 31.153614457831324, "alnum_prop": 0.5645364014309194, "repo_name": "tractorcow/silverstripe-fluent", "id": "6eced6f0094ef1680639f518af13d5af53f47375", "size": "10343", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Extension/FluentVersionedExtension.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "2147" }, { "name": "JavaScript", "bytes": "4810" }, { "name": "PHP", "bytes": "178475" }, { "name": "Scheme", "bytes": "1667" } ], "symlink_target": "" }
// $Id: Silly.java 9595 2006-03-10 18:14:21Z steve.ebersole@jboss.com $ package org.hibernate.test.connections; import java.io.Serializable; /** * Implementation of Silly. * * @author Steve Ebersole */ public class Silly implements Serializable { private Long id; private String name; private Other other; public Silly() { } public Silly(String name) { this.name = name; } public Silly(String name, Other other) { this.name = name; this.other = other; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Other getOther() { return other; } public void setOther(Other other) { this.other = other; } }
{ "content_hash": "f2334d5f4ceba6e33d4b6eb7f9646f71", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 71, "avg_line_length": 15.7, "alnum_prop": 0.6713375796178344, "repo_name": "HerrB92/obp", "id": "6a005f23a2d9df00a187e65d6ead70a54db9a42f", "size": "785", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "OpenBeaconPackage/libraries/hibernate-release-4.2.7.SP1/project/hibernate-core/src/test/java/org/hibernate/test/connections/Silly.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "181658" }, { "name": "Groovy", "bytes": "98685" }, { "name": "Java", "bytes": "34621856" }, { "name": "JavaScript", "bytes": "356255" }, { "name": "Shell", "bytes": "194" }, { "name": "XSLT", "bytes": "21372" } ], "symlink_target": "" }
using System; using System.Collections.Generic; namespace NetChan { /// <summary>Thread static pool of Waiters for type {T}</summary> /// <remarks> /// This massively reduces the garbage created when processing lots of messages, which in turn means higher throughput /// </remarks> internal class WaiterPool<T> { [ThreadStatic] private static Stack<Waiter<T>> pool; public static Waiter<T> Get(T v) { Waiter<T> s = Get(); s.Value = Maybe<T>.Some(v); return s; } public static Waiter<T> Get() { Waiter<T> s; if (pool == null || pool.Count == 0) { s = new Waiter<T>(); } else { s = pool.Pop(); } return s; } public static void Put(Waiter<T> w) { w.Clear(); if (pool == null) { pool = new Stack<Waiter<T>>(); } pool.Push(w); } } }
{ "content_hash": "1f84c4fc40a115899887eb2e2a95d40c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 122, "avg_line_length": 27.35135135135135, "alnum_prop": 0.48320158102766797, "repo_name": "busterwood/NetChan", "id": "dfedaa6d98127358de477f44aa8a0dffc29a4ce9", "size": "1080", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "NetChan/WaiterPool.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "75075" } ], "symlink_target": "" }
**Owner: SIG-Node** This document describes testing policy and process for runtimes implementing the [Container Runtime Interface (CRI)](/contributors/devel/sig-node/container-runtime-interface.md) to publish test results in a federated dashboard. The objective is to provide the Kubernetes community an easy way to track the conformance, stability, and supported features of a CRI runtime. This document focuses on Kubernetes node/cluster end-to-end (E2E) testing because many features require integration of runtime, OS, or even the cloud provider. A higher-level integration tests provider better signals on vertical stack compatibility to the Kubernetes community. On the other hand, runtime developers are strongly encouraged to run low-level [CRI validation test suite](https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/validation.md) for validation as part of their development process. ## Required and optional tests Runtime maintainers are **required** to submit the tests listed below. 1. Node conformance test suite 2. Node feature test suite Node E2E tests qualify an OS image with a pre-installed CRI runtime. The runtime maintainers are free to choose any OS distribution, packaging, and deployment mechanism. Please see the [tutorial](e2e-node-tests.md) to know more about the Node E2E test framework and tests for validating a compatible OS image. The conformance suite is a set of platform-agnostic (e.g., OS, runtime, and cloud provider) tests that validate the conformance of the OS image. The feature suite allows the runtime to demonstrate what features are supported with the OS distribution. In addition to the required tests, the runtime maintainers are *strongly recommended to run and submit results from the Kubernetes conformance test suite*. This cluster-level E2E test suite provides extra test signal for areas such as Networking, which cannot be covered by CRI, or Node-level tests. Because networking requires deep integration between the runtime, the cloud provider, and/or other cluster components, runtime maintainers are recommended to reach out to other relevant SIGs (e.g., SIG-GCP or SIG-AWS) for guidance and/or sponsorship. ## Process for publishing test results To publish tests results, please submit a proposal in the [Kubernetes community repository](https://github.com/kubernetes/community) briefly explaining your runtime, providing at least two maintainers, and assigning the proposal to the leads of SIG-Node. These test results should be published under the `sig-node` tab, organized as follows. ``` sig-node -> sig-node-cri-{Kubernetes-version} -> [page containing the required jobs] ``` Only the last three most recent Kubernetes versions and the master branch are kept at any time. This is consistent with the Kubernetes release schedule and policy. ## Test job maintenance Tests are required to run at least nightly. The runtime maintainers are responsible for keeping the tests healthy. If the tests are deemed not actively maintained, SIG-Node may remove the tests from the test grid at their discretion. ## Process for adding pre-submit testing If the tests are in good standing (i.e., consistently passing for more than 2 weeks), the runtime maintainers may request that the tests to be included in the pre-submit Pull Request (PR) tests. Please note that the pre-submit tests require significantly higher testing capacity, and are held at a higher standard since they directly affect the development velocity. If the tests are flaky or failing, and the maintainers are unable to respond and fix the issues in a timely manner, the SIG leads may remove the runtime from the presubmit tests until the issues are resolved. As of now, SIG-Node only accepts promotion of Node conformance tests to pre-submit because Kubernetes conformance tests involve a wider scope and may need co-sponsorships from other SIGs. ## FAQ *1. Can runtime maintainers publish results from other E2E tests?* Yes, runtime maintainers can publish additional Node E2E tests results. These test jobs will be displayed in the `sig-node-{runtime-name}` page. The same policy for test maintenance applies. As for additional Cluster E2E tests, SIG-Node may agree to host the results. However, runtime maintainers are strongly encouraged to seek for a more appropriate SIG to sponsor or host the results. *2. Can these runtime-specific test jobs be considered release blocking?* This is beyond the authority of SIG-Node, and requires agreement and consensus across multiple SIGs (e.g., Release, the relevant cloud provider SIG, etc). *3. How to run the aforementioned tests?* It is hard to keep instructions are even links to them up-to-date in one document. Please contact the relevant SIGs for assistance. *4. How can I change the test-grid to publish the test results?* Please contact SIG-Node for the detailed instructions. *5. How does this policy apply to Windows containers?* Windows containers are still in the early development phase and the features they support change rapidly. Therefore, it is suggested to treat it as a feature with select, whitelisted tests to run.
{ "content_hash": "6977f77d7ad63d77940451a1b93f0353", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 104, "avg_line_length": 44.43103448275862, "alnum_prop": 0.7995731470702367, "repo_name": "pwittrock/community", "id": "636f80a26587bc1cc8a0fd950468b8c3cacbbbe3", "size": "5201", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "contributors/devel/sig-node/cri-testing-policy.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "13484" }, { "name": "Makefile", "bytes": "1767" }, { "name": "Shell", "bytes": "6049" } ], "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.9.1"/> <title>V8 API Reference Guide for node.js v4.4.6: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for node.js v4.4.6 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1String.html">String</a></li><li class="navelem"><a class="el" href="classv8_1_1String_1_1ExternalStringResourceBase.html">ExternalStringResourceBase</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">v8::String::ExternalStringResourceBase Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="classv8_1_1String_1_1ExternalStringResourceBase.html">v8::String::ExternalStringResourceBase</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1String_1_1ExternalStringResourceBase.html#af4720342ae31e1ab4656df3f15d069c0">Dispose</a>()</td><td class="entry"><a class="el" href="classv8_1_1String_1_1ExternalStringResourceBase.html">v8::String::ExternalStringResourceBase</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>ExternalStringResourceBase</b>() (defined in <a class="el" href="classv8_1_1String_1_1ExternalStringResourceBase.html">v8::String::ExternalStringResourceBase</a>)</td><td class="entry"><a class="el" href="classv8_1_1String_1_1ExternalStringResourceBase.html">v8::String::ExternalStringResourceBase</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">protected</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>v8::internal::Heap</b> (defined in <a class="el" href="classv8_1_1String_1_1ExternalStringResourceBase.html">v8::String::ExternalStringResourceBase</a>)</td><td class="entry"><a class="el" href="classv8_1_1String_1_1ExternalStringResourceBase.html">v8::String::ExternalStringResourceBase</a></td><td class="entry"><span class="mlabel">friend</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>~ExternalStringResourceBase</b>() (defined in <a class="el" href="classv8_1_1String_1_1ExternalStringResourceBase.html">v8::String::ExternalStringResourceBase</a>)</td><td class="entry"><a class="el" href="classv8_1_1String_1_1ExternalStringResourceBase.html">v8::String::ExternalStringResourceBase</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
{ "content_hash": "726ac4fe8d17d4d62ad12e3e23a0bf41", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 450, "avg_line_length": 57.472727272727276, "alnum_prop": 0.676842771274913, "repo_name": "v8-dox/v8-dox.github.io", "id": "c6b7a8035f1cdab8ca47384bedf4f97c5f2747c4", "size": "6322", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "134c3b3/html/classv8_1_1String_1_1ExternalStringResourceBase-members.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <shiporder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Example.xsd"> <orderperson><TYPO descr="Typo: In word 'johnn'">johnn</TYPO> Smith</orderperson> <shipto> <name>First sentence. it <warning descr="EN_A_VS_AN">an</warning> friend. Last sentence.</name> <address>Some street 23</address> </shipto> </shiporder>
{ "content_hash": "9b679242990390ed251fa00efed64617", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 103, "avg_line_length": 48, "alnum_prop": 0.6666666666666666, "repo_name": "jwren/intellij-community", "id": "093b3d2ed335471e92aebf661a97ffcdd26a61a4", "size": "432", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "plugins/grazie/src/test/testData/ide/language/xml/Example.xml", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
from ex.common import * from ex.ioo.common import * from ex.pp.common import * # NOTE: one copy of mapper/reducer will be held in each process, so # the data replication is lower than using multiprocessing.Pool. But # here the data within the mapper/reducer should be readonly. _mapper = None _reducer = None def _init_mapper(args): global _mapper; _mapper = args def _init_reducer(args): global _reducer; _reducer = args def DoMapJob(job): '''process a single map job. each jobs_spec is a tuple (engine, (key, val)). (key, val) will be passed to the mapper directly.the mapper should return a list of result (key, val). ''' key, val=job results=_mapper.Map(key, val) log.debug('{0} mapped the job {1}. {2} results returned.'.format( _mapper.name, job, len(results))) return results # a list of (key, val) for the reducer def DoReduceJob(job): '''process a reduce single job. a job_spec is a tuple (engine, job). the job should be a tuple (key, vals), which will be passed to one Reduce() function. returns the (key, result) pair. ''' key, vals=job result=_reducer.Reduce(key, vals) log.debug('{0} reduced the key {1}'.format(_reducer.name, key)) return (key, result) class MapEngine: '''A class that handles Mapping jobs. ''' def __init__(self, mapper, pool_size): '''mapper: the mapper for the data. see the BaseMapper below. pool_size: number of processes to use. ''' self.mapper=mapper self.pool_size=int(pool_size) mapper.engine=self log.info('MapEngine initialized: Mapper={0}'.format(self.mapper.name)) def Start(self, jobs): '''start processing jobs. jobs should be a list of (key, val) pairs. each job will be dispatched to a map function. if each jobs is just a scalar, then the keys {0,1,...,n} will be assigned. returns the a of all the result (key, val) ''' log.info('Start mapping {0} jobs using {1} processes'.format( len(jobs), self.pool_size)) if not istuple(jobs[0]): jobs=enumerate(jobs) results=ProcJobs(DoMapJob, jobs, self.pool_size, _init_mapper, self.mapper) results=Flatten(results) log.debug('{0} results returned'.format(len(results))) return results class ReduceEngine: '''handles the reducing jobs. the memory assumption is that the results for keys can be held. ''' def __init__(self, reducer, pool_size): '''ReduceEngine pool_size: number of parallel processes ''' self.reducer=reducer self.pool_size=int(pool_size) reducer.engine=self log.info('ReduceEngine initialized: Reducer={0}'.format(self.reducer.name)) def Start(self, jobs): '''start processing jobs jobs should be a list of (key, val). these jobs will then be grouped according to key and send to the Reducer. all the vals of one key is handled by one reducer. if each jobs is just a scalar, then the keys {0,1,...,n} will be assigned. returns the list of results from each reducer. if the Reducer specifies do_aggregation, then returns the result of reducer's Aggregate(). ''' if not istuple(jobs[0]): keys=range(len(jobs)) jobs=[(i, [jobs[i]]) for i in range(len(jobs))] else: keys, vals=zip(*jobs) jobs=Group(keys, vals) log.info('Reducing {0} jobs / {1} keys with {2} processes'.format( len(keys), len(jobs), self.pool_size)) outputs=ProcJobs(DoReduceJob, jobs, self.pool_size, _init_reducer, self.reducer) if self.reducer.do_aggregation: outputs=self.reducer.Aggregate(outputs) return outputs class PartitionEngine: '''handles the partitioning job ''' def __init__(self, pool_size=1): '''pool_size: number of processes used for partitioning. currently only 1 process can be used. further the result will not be compressed. ''' if int(pool_size) > 1: log.warn('Parallel partitioning using not supported yet') self.pool_size=1; def Partition(self, input_files, output_dir, output_prefix='', batch_size=1): '''read input_files, output records with the same key into the same file in output_dir. the files are named as 'output_prefix_key.mrf'. prefix are used so that reducers can recognize them. the input_files should be pickle files that stores (key, val) pairs. batch_size: how many files to reading before each output. note that it should be small enough so that the files can be fit into memory. ''' n=len(input_files) log.info('Partition {0} files to {1}'.format(n, output_dir)) if len(output_prefix) > 0 and not output_prefix.endswith('_'): output_prefix += '_' start=0 while start <= len(input_files): # for each batch end=min(n, start + batch) files=input_files[start:end] output_buffer={} for f in files: # for each file ps=PickleStream(f) for p in ps: key=p[0] if output_buffer.has_key(key): output_buffer[key].append(p) else: output_buffer[key]=[p] for key, ps in output_buffer.items(): # output the buffer SavePickles("{0}/{1}{2}.mrf".format( output_dir, output_prefix, key), ps, append=True) start=end class BaseMapper: '''A class that handles Mapping jobs Need to specify the Map() function ''' def __init__(self, name, output_dest = None): '''initialize the mapper. the mapper should have a name. output_dir specifies the folder to output map results. this class can also hold global parameters that are used by the Map() function. usually the output_dest is specified so that the mapper knows where to store the results. ''' self.name=name self.output_dest=output_dest log.debug('Mapper {0} initialized. Output={1}'.format( name, output_dest)) def Map(self, key, val): '''an example Map() function. input: this function accept a key and the value to process. the val is a tuple that can contain anything. output: this function should return the resulting list of tuples (key, value). ''' input_file=key params=val # output to files output_file="{0}/{1}_mapped.pkl".format( self.output_dest, input_file) SavePickles(output_file, [(key, val)]) # output to server via socket SendPickle(self.output_dest, [(key, val)]) # direct return return (key, val) class BaseReducer: '''A class that handles Reducing jobs. the Reduce function handles all the data related to one key. ''' def __init__(self, name, do_aggregation=False): '''initialize the reducer. ''' self.name=name self.do_aggregation=do_aggregation def Reduce(self, key, vals): '''an example Reduce() function. input: this function accept a key and a list of record for this key. for example, the key can be the subtask name, and the vals can be the list of files for this subtask. output: this function should return a result object. ''' return ",".join(vals) def Aggregate(self, pairs): '''aggregate the results from different keys together ''' keys, results=unzip(pairs) return "\n".join(results)
{ "content_hash": "6203066a2d3391b07487f122bbadf3d6", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 97, "avg_line_length": 31.078125, "alnum_prop": 0.5977878330819507, "repo_name": "excelly/xpy-ml", "id": "4a789b62609bbe3d05f5cdf857dea6d64f6bfce0", "size": "7956", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ex/pp/mr.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "19317" }, { "name": "C++", "bytes": "210882" }, { "name": "CSS", "bytes": "995" }, { "name": "JavaScript", "bytes": "786" }, { "name": "Matlab", "bytes": "481" }, { "name": "Objective-C", "bytes": "71848" }, { "name": "PHP", "bytes": "49555" }, { "name": "Python", "bytes": "589740" }, { "name": "R", "bytes": "188344" }, { "name": "Shell", "bytes": "6014" } ], "symlink_target": "" }
<?php error_reporting(E_ALL); $data = array(); $datas = array('foo', 'bar', 'baz', 'qux'); for($i =0; $i< 500; $i++) { $data[] = array( 'id' => $i, 'status' => rand ( 0, 1), 'modified' => strtotime('2012-11-30') - rand ( 1, 10000), 'data' => $datas[rand(0, count($datas) - 1)], ); } if (isset($_GET['data'])) { header('Content-type: application/json'); exit(json_encode($data)); } ?> <!DOCTYPE html> <html> <head> <title>WebSql Sync Example</title> <META name="author" content="Matthew Hail"> <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.rc.1.js"></script> <script src="websql.js"></script> </head> <body> <h1>Example synchronizing a local websql database from a json rest service</h1> <p>The purpose if this example is to sync a remote database to a local websql database and perform all tasks asynchronously. The current data is displayed on page load. once thet data is synchronized, the list is refreshed with the new data.</p> <p>View the console to see the progress.</p> <script id="entry-template" type="text/x-handlebars-template"> <li> {{id}} - {{data}} - {{modified}} </li> </script> <ul id="items"> </ul> <script type="text/javascript" charset="utf-8"> (function($, window, undefined) { TestApp = (function(){ var TestApp = function(){ if (this === window) { return new TestApp(); } this.constructor = TestApp; this.init.apply(this, arguments); } var compileTemplates = function(templates) { var d = $.Deferred(); setTimeout(function() { for(var i in templates) if (templates.hasOwnProperty(i)) { try { var template = $(templates[i]).html(); templates[i] = Handlebars.compile(template); } catch(e) { d.reject(e); } } d.resolve(); }); return d.promise(); } $.extend(TestApp.prototype, { 'init' : function() { this.db = $.WebSql({'debug': true}); this.state.checkSchema = this.checkSchema(); this.state.syncDb = this.syncDb(); this.ready = $.when(compileTemplates(this.templates), this.state.checkSchema); }, 'templates' : { 'entry-template' : "#entry-template", }, 'state': {}, 'checkSchema' : function() { return this.db.query('CREATE TABLE IF NOT EXISTS data (id unique, data, modified, status)'); }, 'getData' : function(max) { return $.ajax({ url: window.location, data: { data: '1', modified: max}, dataType: 'json', }).promise(); }, 'syncDb' : function(db) { var d = $.Deferred(), self = this; self.db.query("SELECT MAX(modified) max_modified FROM data") .fail(d.reject) .then(function(tx, results) { var max = results.single() || 0; self.getData(max) .fail(d.reject) .then(function(data){ var updates = data.map(function(record){ var action = record.status === 1 ? self.db.insert('data', record, true) : self.db.delete('data', record, ['id']); action.done(function(){ d.notify(record); }); return action; }); $.when.apply(window, updates) .fail(d.reject) .then(d.resolve); }); }); return d.promise(); }, 'displayData' : function() { var d = $.Deferred(), self = this; self.db.query("SELECT * FROM data") .fail(d.reject) .then(function(tx, results) { try { $("#items").html($.map(results.toArray(), self.templates['entry-template']).join('')); } catch (e) { d.reject(e); } d.resolve(); }); return d.promise(); } }); return TestApp; })(); $(function(){ var app = TestApp(); app.ready.fail(function(e) { console.log(e)}); app.displayData().fail(function(e) { console.log(e)}); //app.state.syncDb.progress(function(e) { console.log(e)}); // display records app.state.syncDb.then(function(){ app.displayData(); }); }); })(jQuery, window); </script> </body> </html>
{ "content_hash": "0ce8548038b6b50d977c1690bb975665", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 128, "avg_line_length": 25.766871165644172, "alnum_prop": 0.5664285714285714, "repo_name": "mhail/jQuery.WebSql", "id": "572248b3ffe7e24339231b3052976853b94ecf83", "size": "4200", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.php", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="5dp" android:layout_y="100dp" android:text="Button" /> <!-- Deprecated attributes --> <TextView android:autoText="true" android:capitalize="true" android:editable="true" android:enabled="true" android:inputMethod="@+id/foo" android:numeric="true" android:password="true" android:phoneNumber="true" android:singleLine="true" /> <EditText android:editable="true" /> <EditText android:editable="false" /> </AbsoluteLayout>
{ "content_hash": "f089b5db17e0c4335b29dd227e486a16", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 74, "avg_line_length": 30.586206896551722, "alnum_prop": 0.6268320180383314, "repo_name": "consulo/consulo-android", "id": "70b7f23f1cfd99fe0ee7e3c5578661e1936eb01d", "size": "887", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tools-base/lint/cli/src/test/java/com/android/tools/lint/checks/data/res/layout/deprecation.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5115" }, { "name": "C", "bytes": "138494" }, { "name": "C++", "bytes": "3748" }, { "name": "CSS", "bytes": "41095" }, { "name": "Emacs Lisp", "bytes": "4737" }, { "name": "Groovy", "bytes": "833183" }, { "name": "HTML", "bytes": "1162651" }, { "name": "Java", "bytes": "38558853" }, { "name": "JavaScript", "bytes": "3488" }, { "name": "Lex", "bytes": "12419" }, { "name": "Makefile", "bytes": "844" }, { "name": "Prolog", "bytes": "1222" }, { "name": "RenderScript", "bytes": "73022" }, { "name": "Shell", "bytes": "15030" }, { "name": "XSLT", "bytes": "23593" } ], "symlink_target": "" }
initEditor = function(id) { // Init ace editor var editor = ace.edit(id); editor.setTheme("ace/theme/tomorrow"); editor.session.setMode("ace/mode/javascript"); editor.renderer.setScrollMargin(10, 10); editor.setOptions({ // "scrollPastEnd": 0.8, autoScrollEditorIntoView: true, vScrollBarAlwaysVisible: false, highlightSelectedWord: true }); // Control buttons $('#' + id).parent().append( '<div class="editor-control">' + '<div class="editor-run ' + id + '">' + '<span class="el el-caret-right"></span> Run' + '</div>' + '<div class="editor-expand ' + id + '">' + 'Resize <span class="el el-resize-full"></span>' + '</div>' + '</div>'); // Connect buttons $( "." + id + ".editor-expand" ).click(function() { $( "#" + id ).toggleClass( "editor-big", 500, "easeOutSine" ) .promise().done(function(){ var dom = ace.require("ace/lib/dom"); editor.resize(); }); }); $( "." + id + ".editor-run" ).click(function() { eval(editor.getValue()); }); // Hack around wierd firefox bug. if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { editor.on("focus", function() { window.scrollTo(0, $("#"+id).offset().top); }); } } loadContent = function(id, contentUrl, lineNumber, initFn) { var editor = ace.edit(id); // Load content $.ajax({ url: contentUrl, processData: false, cache: false }) .done(function( js ) { editor.setValue(js); editor.clearSelection(); editor.gotoLine(lineNumber); if (initFn) { initFn(); // This is a hack :( } }); } initThree = function(id){ var exp = {}; container = document.getElementById(id); // scene exp.scene = new THREE.Scene(); exp.scene.fog = new THREE.Fog( 0xcce0ff, 500, 10000 ); // camera exp.camera = new THREE.PerspectiveCamera( 30, $('#' + id).width() / $('#' + id).height(), 1, 10000 ); exp.camera.position.y = 50; exp.camera.position.z = 1500; exp.scene.add( exp.camera ); // controls exp.controls = new THREE.OrbitControls( exp.camera, container ); // lights var light, materials; exp.scene.add( new THREE.AmbientLight( 0x666666 ) ); light = new THREE.DirectionalLight( 0xdfebff, 1.75 ); light.position.set( 50, 200, 100 ); light.position.multiplyScalar( 1.3 ); light.castShadow = true; // light.shadowCameraVisible = true; light.shadowMapWidth = 1024; light.shadowMapHeight = 1024; var d = 300; light.shadowCameraLeft = -d; light.shadowCameraRight = d; light.shadowCameraTop = d; light.shadowCameraBottom = -d; light.shadowCameraFar = 1000; light.shadowDarkness = 0.5; exp.scene.add( light ); exp.renderer = new THREE.WebGLRenderer( { antialias: true } ); exp.renderer.setPixelRatio( window.devicePixelRatio ); exp.renderer.setSize( $('#' + id).width(), $('#' + id).height() ); exp.renderer.setClearColor( exp.scene.fog.color ); container.appendChild( exp.renderer.domElement ); exp.renderer.gammaInput = true; exp.renderer.gammaOutput = true; exp.renderer.shadowMapEnabled = true; // // stats = new Stats(); // container.appendChild( stats.domElement ); // var onWindowResize = function() { exp.camera.aspect = $('#' + id).width() / $('#' + id).height(); exp.camera.updateProjectionMatrix(); exp.renderer.setSize( $('#' + id).width(), $('#' + id).height() ); } window.addEventListener( 'resize', onWindowResize, false ); return exp; } // not awesome. assert = function (condition, message) { if (!condition) { message = message || "Assertion failed"; if (typeof Error !== "undefined") { throw new Error(message); } throw message; // Fallback } } // Color array that we will be using to help perception. // http://bl.ocks.org/mbostock/5577023 var colors = ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee090", "#ffffbf", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4", "#313695"];
{ "content_hash": "c609ec620d456196c85e205dda5e7092", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 102, "avg_line_length": 22.225988700564972, "alnum_prop": 0.6217590238942552, "repo_name": "the13fools/lets-get-lost", "id": "cb8f41d0320905d9040e0a6e435cbafc62cbce8f", "size": "3934", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "public/js/lib/fool-util.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "24108" }, { "name": "HTML", "bytes": "6742" }, { "name": "JavaScript", "bytes": "915123" } ], "symlink_target": "" }
package org.apache.cloudstack.quota; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import java.util.TimeZone; import javax.inject.Inject; import javax.naming.ConfigurationException; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.quota.constant.QuotaTypes; import org.apache.cloudstack.quota.dao.QuotaAccountDao; import org.apache.cloudstack.quota.dao.QuotaBalanceDao; import org.apache.cloudstack.quota.dao.QuotaTariffDao; import org.apache.cloudstack.quota.dao.QuotaUsageDao; import org.apache.cloudstack.quota.dao.ServiceOfferingDao; import org.apache.cloudstack.quota.vo.QuotaAccountVO; import org.apache.cloudstack.quota.vo.QuotaBalanceVO; import org.apache.cloudstack.quota.vo.QuotaTariffVO; import org.apache.cloudstack.quota.vo.QuotaUsageVO; import org.apache.cloudstack.quota.vo.ServiceOfferingVO; import org.apache.cloudstack.utils.usage.UsageUtils; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import com.cloud.usage.UsageVO; import com.cloud.usage.dao.UsageDao; import com.cloud.user.AccountVO; import com.cloud.user.dao.AccountDao; import com.cloud.utils.Pair; import com.cloud.utils.component.ManagerBase; @Component public class QuotaManagerImpl extends ManagerBase implements QuotaManager { private static final Logger s_logger = Logger.getLogger(QuotaManagerImpl.class.getName()); @Inject private AccountDao _accountDao; @Inject private QuotaAccountDao _quotaAcc; @Inject private UsageDao _usageDao; @Inject private QuotaTariffDao _quotaTariffDao; @Inject private QuotaUsageDao _quotaUsageDao; @Inject private ServiceOfferingDao _serviceOfferingDao; @Inject private QuotaBalanceDao _quotaBalanceDao; @Inject private ConfigurationDao _configDao; private TimeZone _usageTimezone; private int _aggregationDuration = 0; final static BigDecimal s_hoursInMonth = new BigDecimal(30 * 24); final static BigDecimal s_minutesInMonth = new BigDecimal(30 * 24 * 60); final static BigDecimal s_gb = new BigDecimal(1024 * 1024 * 1024); public QuotaManagerImpl() { super(); } private void mergeConfigs(Map<String, String> dbParams, Map<String, Object> xmlParams) { for (Map.Entry<String, Object> param : xmlParams.entrySet()) { dbParams.put(param.getKey(), (String)param.getValue()); } } @Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); Map<String, String> configs = _configDao.getConfiguration(params); if (params != null) { mergeConfigs(configs, params); } String aggregationRange = configs.get("usage.stats.job.aggregation.range"); String timeZoneStr = configs.get("usage.aggregation.timezone"); if (timeZoneStr == null) { timeZoneStr = "GMT"; } _usageTimezone = TimeZone.getTimeZone(timeZoneStr); _aggregationDuration = Integer.parseInt(aggregationRange); if (_aggregationDuration < UsageUtils.USAGE_AGGREGATION_RANGE_MIN) { s_logger.warn("Usage stats job aggregation range is to small, using the minimum value of " + UsageUtils.USAGE_AGGREGATION_RANGE_MIN); _aggregationDuration = UsageUtils.USAGE_AGGREGATION_RANGE_MIN; } s_logger.info("Usage timezone = " + _usageTimezone + " AggregationDuration=" + _aggregationDuration); return true; } @Override public boolean start() { if (s_logger.isInfoEnabled()) { s_logger.info("Starting Quota Manager"); } return true; } @Override public boolean stop() { if (s_logger.isInfoEnabled()) { s_logger.info("Stopping Quota Manager"); } return true; } public List<QuotaUsageVO> aggregatePendingQuotaRecordsForAccount(final AccountVO account, final Pair<List<? extends UsageVO>, Integer> usageRecords) { List<QuotaUsageVO> quotaListForAccount = new ArrayList<>(); if (usageRecords == null || usageRecords.first() == null || usageRecords.first().isEmpty()) { return quotaListForAccount; } s_logger.info("Getting pending quota records for account=" + account.getAccountName()); for (UsageVO usageRecord : usageRecords.first()) { BigDecimal aggregationRatio = new BigDecimal(_aggregationDuration).divide(s_minutesInMonth, 8, RoundingMode.HALF_EVEN); switch (usageRecord.getUsageType()) { case QuotaTypes.RUNNING_VM: List<QuotaUsageVO> lq = updateQuotaRunningVMUsage(usageRecord, aggregationRatio); if (!lq.isEmpty()) { quotaListForAccount.addAll(lq); } break; case QuotaTypes.ALLOCATED_VM: QuotaUsageVO qu = updateQuotaAllocatedVMUsage(usageRecord, aggregationRatio); if (qu != null) { quotaListForAccount.add(qu); } break; case QuotaTypes.SNAPSHOT: case QuotaTypes.TEMPLATE: case QuotaTypes.ISO: case QuotaTypes.VOLUME: case QuotaTypes.VM_SNAPSHOT: qu = updateQuotaDiskUsage(usageRecord, aggregationRatio, usageRecord.getUsageType()); if (qu != null) { quotaListForAccount.add(qu); } break; case QuotaTypes.LOAD_BALANCER_POLICY: case QuotaTypes.PORT_FORWARDING_RULE: case QuotaTypes.IP_ADDRESS: case QuotaTypes.NETWORK_OFFERING: case QuotaTypes.SECURITY_GROUP: case QuotaTypes.VPN_USERS: qu = updateQuotaRaw(usageRecord, aggregationRatio, usageRecord.getUsageType()); if (qu != null) { quotaListForAccount.add(qu); } break; case QuotaTypes.NETWORK_BYTES_RECEIVED: case QuotaTypes.NETWORK_BYTES_SENT: qu = updateQuotaNetwork(usageRecord, usageRecord.getUsageType()); if (qu != null) { quotaListForAccount.add(qu); } break; case QuotaTypes.VM_DISK_IO_READ: case QuotaTypes.VM_DISK_IO_WRITE: case QuotaTypes.VM_DISK_BYTES_READ: case QuotaTypes.VM_DISK_BYTES_WRITE: default: break; } } return quotaListForAccount; } public void processQuotaBalanceForAccount(final AccountVO account, final List<QuotaUsageVO> quotaListForAccount) { if (quotaListForAccount == null || quotaListForAccount.isEmpty()) { return; } if (s_logger.isDebugEnabled()) { s_logger.debug(quotaListForAccount.get(0)); } Date startDate = quotaListForAccount.get(0).getStartDate(); Date endDate = quotaListForAccount.get(0).getEndDate(); if (s_logger.isDebugEnabled()) { s_logger.debug("processQuotaBalanceForAccount startDate " + startDate + " endDate=" + endDate); s_logger.debug("processQuotaBalanceForAccount last items startDate " + quotaListForAccount.get(quotaListForAccount.size() - 1).getStartDate() + " items endDate=" + quotaListForAccount.get(quotaListForAccount.size() - 1).getEndDate()); } quotaListForAccount.add(new QuotaUsageVO()); BigDecimal aggrUsage = new BigDecimal(0); List<QuotaBalanceVO> creditsReceived = null; //bootstrapping QuotaUsageVO lastQuotaUsage = _quotaUsageDao.findLastQuotaUsageEntry(account.getAccountId(), account.getDomainId(), startDate); if (lastQuotaUsage == null) { aggrUsage = aggrUsage.add(aggregateCreditBetweenDates(account, new Date(0), startDate)); // create a balance entry for these accumulated credits QuotaBalanceVO firstBalance = new QuotaBalanceVO(account.getAccountId(), account.getDomainId(), aggrUsage, startDate); _quotaBalanceDao.saveQuotaBalance(firstBalance); } else { QuotaBalanceVO lastRealBalanceEntry = _quotaBalanceDao.findLastBalanceEntry(account.getAccountId(), account.getDomainId(), endDate); if (lastRealBalanceEntry != null){ aggrUsage = aggrUsage.add(lastRealBalanceEntry.getCreditBalance()); } if (s_logger.isDebugEnabled()) { s_logger.debug("Last balance entry " + lastRealBalanceEntry + " AggrUsage=" + aggrUsage); } // get all the credit entries after this balance and add aggrUsage = aggrUsage.add(aggregateCreditBetweenDates(account, lastRealBalanceEntry.getUpdatedOn(), endDate)); } for (QuotaUsageVO entry : quotaListForAccount) { if (s_logger.isDebugEnabled()) { s_logger.debug("Usage entry found " + entry); } if (entry.getQuotaUsed().compareTo(BigDecimal.ZERO) == 0) { // check if there were credits and aggregate aggrUsage = aggrUsage.add(aggregateCreditBetweenDates(account, entry.getStartDate(), entry.getEndDate())); continue; } if (startDate.compareTo(entry.getStartDate()) != 0) { saveQuotaBalance(account, aggrUsage, endDate); //New balance entry aggrUsage = new BigDecimal(0); startDate = entry.getStartDate(); endDate = entry.getEndDate(); QuotaBalanceVO lastRealBalanceEntry = _quotaBalanceDao.findLastBalanceEntry(account.getAccountId(), account.getDomainId(), endDate); Date lastBalanceDate = new Date(0); if (lastRealBalanceEntry != null) { lastBalanceDate = lastRealBalanceEntry.getUpdatedOn(); aggrUsage = aggrUsage.add(lastRealBalanceEntry.getCreditBalance()); } if (s_logger.isDebugEnabled()) { s_logger.debug("Getting Balance" + account.getAccountName() + ",Balance entry=" + aggrUsage + " on Date=" + endDate); } aggrUsage = aggrUsage.add(aggregateCreditBetweenDates(account, lastBalanceDate, endDate)); } aggrUsage = aggrUsage.subtract(entry.getQuotaUsed()); } saveQuotaBalance(account, aggrUsage, endDate); // update quota_balance saveQuotaAccount(account, aggrUsage, endDate); } private QuotaBalanceVO saveQuotaBalance(final AccountVO account, final BigDecimal aggrUsage, final Date endDate) { QuotaBalanceVO newBalance = new QuotaBalanceVO(account.getAccountId(), account.getDomainId(), aggrUsage, endDate); if (s_logger.isDebugEnabled()) { s_logger.debug("Saving Balance" + newBalance); } return _quotaBalanceDao.saveQuotaBalance(newBalance); } private boolean saveQuotaAccount(final AccountVO account, final BigDecimal aggrUsage, final Date endDate) { // update quota_accounts QuotaAccountVO quota_account = _quotaAcc.findByIdQuotaAccount(account.getAccountId()); if (quota_account == null) { quota_account = new QuotaAccountVO(account.getAccountId()); quota_account.setQuotaBalance(aggrUsage); quota_account.setQuotaBalanceDate(endDate); if (s_logger.isDebugEnabled()) { s_logger.debug(quota_account); } _quotaAcc.persistQuotaAccount(quota_account); return true; } else { quota_account.setQuotaBalance(aggrUsage); quota_account.setQuotaBalanceDate(endDate); if (s_logger.isDebugEnabled()) { s_logger.debug(quota_account); } return _quotaAcc.updateQuotaAccount(account.getAccountId(), quota_account); } } private BigDecimal aggregateCreditBetweenDates(final AccountVO account, final Date startDate, final Date endDate) { BigDecimal aggrUsage = new BigDecimal(0); List<QuotaBalanceVO> creditsReceived = null; creditsReceived = _quotaBalanceDao.findCreditBalance(account.getAccountId(), account.getDomainId(), startDate, endDate); if (s_logger.isDebugEnabled()) { s_logger.debug("Credit entries count " + creditsReceived.size() + " on Before Date=" + endDate); } if (creditsReceived != null) { for (QuotaBalanceVO credit : creditsReceived) { if (s_logger.isDebugEnabled()) { s_logger.debug("Credit entry found " + credit); s_logger.debug("Total = " + aggrUsage); } aggrUsage = aggrUsage.add(credit.getCreditBalance()); } } return aggrUsage; } @Override public boolean calculateQuotaUsage() { List<AccountVO> accounts = _accountDao.listAll(); for (AccountVO account : accounts) { Pair<List<? extends UsageVO>, Integer> usageRecords = _usageDao.getUsageRecordsPendingQuotaAggregation(account.getAccountId(), account.getDomainId()); if (s_logger.isDebugEnabled()) { s_logger.debug("Usage entries size = " + usageRecords.second().intValue() + ", accId" + account.getAccountId() + ", domId" + account.getDomainId()); } List<QuotaUsageVO> quotaListForAccount = aggregatePendingQuotaRecordsForAccount(account, usageRecords); if (s_logger.isDebugEnabled()) { s_logger.debug("Quota entries size = " + quotaListForAccount.size() + ", accId" + account.getAccountId() + ", domId" + account.getDomainId()); } processQuotaBalanceForAccount(account, quotaListForAccount); } return true; } public QuotaUsageVO updateQuotaDiskUsage(UsageVO usageRecord, final BigDecimal aggregationRatio, final int quotaType) { QuotaUsageVO quota_usage = null; QuotaTariffVO tariff = _quotaTariffDao.findTariffPlanByUsageType(quotaType, usageRecord.getEndDate()); if (tariff != null && tariff.getCurrencyValue().compareTo(BigDecimal.ZERO) != 0) { BigDecimal quotaUsgage; BigDecimal onehourcostpergb; BigDecimal noofgbinuse; onehourcostpergb = tariff.getCurrencyValue().multiply(aggregationRatio); noofgbinuse = new BigDecimal(usageRecord.getSize()).divide(s_gb, 8, RoundingMode.HALF_EVEN); quotaUsgage = new BigDecimal(usageRecord.getRawUsage()).multiply(onehourcostpergb).multiply(noofgbinuse); quota_usage = new QuotaUsageVO(usageRecord.getId(), usageRecord.getZoneId(), usageRecord.getAccountId(), usageRecord.getDomainId(), usageRecord.getUsageType(), quotaUsgage, usageRecord.getStartDate(), usageRecord.getEndDate()); _quotaUsageDao.persistQuotaUsage(quota_usage); } usageRecord.setQuotaCalculated(1); _usageDao.persistUsage(usageRecord); return quota_usage; } public List<QuotaUsageVO> updateQuotaRunningVMUsage(UsageVO usageRecord, final BigDecimal aggregationRatio) { List<QuotaUsageVO> quotalist = new ArrayList<QuotaUsageVO>(); QuotaUsageVO quota_usage; BigDecimal cpuquotausgage, speedquotausage, memoryquotausage, vmusage; BigDecimal onehourcostpercpu, onehourcostper100mhz, onehourcostper1mb, onehourcostforvmusage; BigDecimal rawusage; // get service offering details ServiceOfferingVO serviceoffering = _serviceOfferingDao.findServiceOffering(usageRecord.getVmInstanceId(), usageRecord.getOfferingId()); if (serviceoffering == null) { return quotalist; } rawusage = new BigDecimal(usageRecord.getRawUsage()); QuotaTariffVO tariff = _quotaTariffDao.findTariffPlanByUsageType(QuotaTypes.CPU_NUMBER, usageRecord.getEndDate()); if (tariff != null && tariff.getCurrencyValue().compareTo(BigDecimal.ZERO) != 0 && serviceoffering.getCpu() != null) { BigDecimal cpu = new BigDecimal(serviceoffering.getCpu()); onehourcostpercpu = tariff.getCurrencyValue().multiply(aggregationRatio); cpuquotausgage = rawusage.multiply(onehourcostpercpu).multiply(cpu); quota_usage = new QuotaUsageVO(usageRecord.getId(), usageRecord.getZoneId(), usageRecord.getAccountId(), usageRecord.getDomainId(), QuotaTypes.CPU_NUMBER, cpuquotausgage, usageRecord.getStartDate(), usageRecord.getEndDate()); _quotaUsageDao.persistQuotaUsage(quota_usage); quotalist.add(quota_usage); } tariff = _quotaTariffDao.findTariffPlanByUsageType(QuotaTypes.CPU_CLOCK_RATE, usageRecord.getEndDate()); if (tariff != null && tariff.getCurrencyValue().compareTo(BigDecimal.ZERO) != 0 && serviceoffering.getSpeed() != null) { BigDecimal speed = new BigDecimal(serviceoffering.getSpeed() / 100.00); onehourcostper100mhz = tariff.getCurrencyValue().multiply(aggregationRatio); speedquotausage = rawusage.multiply(onehourcostper100mhz).multiply(speed); quota_usage = new QuotaUsageVO(usageRecord.getId(), usageRecord.getZoneId(), usageRecord.getAccountId(), usageRecord.getDomainId(), QuotaTypes.CPU_CLOCK_RATE, speedquotausage, usageRecord.getStartDate(), usageRecord.getEndDate()); _quotaUsageDao.persistQuotaUsage(quota_usage); quotalist.add(quota_usage); } tariff = _quotaTariffDao.findTariffPlanByUsageType(QuotaTypes.MEMORY, usageRecord.getEndDate()); if (tariff != null && tariff.getCurrencyValue().compareTo(BigDecimal.ZERO) != 0 && serviceoffering.getRamSize() != null) { BigDecimal memory = new BigDecimal(serviceoffering.getRamSize()); onehourcostper1mb = tariff.getCurrencyValue().multiply(aggregationRatio); memoryquotausage = rawusage.multiply(onehourcostper1mb).multiply(memory); quota_usage = new QuotaUsageVO(usageRecord.getId(), usageRecord.getZoneId(), usageRecord.getAccountId(), usageRecord.getDomainId(), QuotaTypes.MEMORY, memoryquotausage, usageRecord.getStartDate(), usageRecord.getEndDate()); _quotaUsageDao.persistQuotaUsage(quota_usage); quotalist.add(quota_usage); } tariff = _quotaTariffDao.findTariffPlanByUsageType(QuotaTypes.RUNNING_VM, usageRecord.getEndDate()); if (tariff != null && tariff.getCurrencyValue().compareTo(BigDecimal.ZERO) != 0) { onehourcostforvmusage = tariff.getCurrencyValue().multiply(aggregationRatio); vmusage = rawusage.multiply(onehourcostforvmusage); quota_usage = new QuotaUsageVO(usageRecord.getId(), usageRecord.getZoneId(), usageRecord.getAccountId(), usageRecord.getDomainId(), QuotaTypes.RUNNING_VM, vmusage, usageRecord.getStartDate(), usageRecord.getEndDate()); _quotaUsageDao.persistQuotaUsage(quota_usage); quotalist.add(quota_usage); } usageRecord.setQuotaCalculated(1); _usageDao.persistUsage(usageRecord); return quotalist; } public QuotaUsageVO updateQuotaAllocatedVMUsage(UsageVO usageRecord, final BigDecimal aggregationRatio) { QuotaUsageVO quota_usage = null; QuotaTariffVO tariff = _quotaTariffDao.findTariffPlanByUsageType(QuotaTypes.ALLOCATED_VM, usageRecord.getEndDate()); if (tariff != null && tariff.getCurrencyValue().compareTo(BigDecimal.ZERO) != 0) { BigDecimal vmusage; BigDecimal onehourcostforvmusage; onehourcostforvmusage = tariff.getCurrencyValue().multiply(aggregationRatio); vmusage = new BigDecimal(usageRecord.getRawUsage()).multiply(onehourcostforvmusage); quota_usage = new QuotaUsageVO(usageRecord.getId(), usageRecord.getZoneId(), usageRecord.getAccountId(), usageRecord.getDomainId(), QuotaTypes.ALLOCATED_VM, vmusage, usageRecord.getStartDate(), usageRecord.getEndDate()); _quotaUsageDao.persistQuotaUsage(quota_usage); } usageRecord.setQuotaCalculated(1); _usageDao.persistUsage(usageRecord); return quota_usage; } public QuotaUsageVO updateQuotaRaw(UsageVO usageRecord, final BigDecimal aggregationRatio, final int ruleType) { QuotaUsageVO quota_usage = null; QuotaTariffVO tariff = _quotaTariffDao.findTariffPlanByUsageType(ruleType, usageRecord.getEndDate()); if (tariff != null && tariff.getCurrencyValue().compareTo(BigDecimal.ZERO) != 0) { BigDecimal ruleusage; BigDecimal onehourcost; onehourcost = tariff.getCurrencyValue().multiply(aggregationRatio); ruleusage = new BigDecimal(usageRecord.getRawUsage()).multiply(onehourcost); quota_usage = new QuotaUsageVO(usageRecord.getId(), usageRecord.getZoneId(), usageRecord.getAccountId(), usageRecord.getDomainId(), ruleType, ruleusage, usageRecord.getStartDate(), usageRecord.getEndDate()); _quotaUsageDao.persistQuotaUsage(quota_usage); } usageRecord.setQuotaCalculated(1); _usageDao.persistUsage(usageRecord); return quota_usage; } public QuotaUsageVO updateQuotaNetwork(UsageVO usageRecord, final int transferType) { QuotaUsageVO quota_usage = null; QuotaTariffVO tariff = _quotaTariffDao.findTariffPlanByUsageType(transferType, usageRecord.getEndDate()); if (tariff != null && tariff.getCurrencyValue().compareTo(BigDecimal.ZERO) != 0) { BigDecimal onegbcost; BigDecimal rawusageingb; BigDecimal networkusage; onegbcost = tariff.getCurrencyValue(); rawusageingb = new BigDecimal(usageRecord.getRawUsage()).divide(s_gb, 8, RoundingMode.HALF_EVEN); networkusage = rawusageingb.multiply(onegbcost); quota_usage = new QuotaUsageVO(usageRecord.getId(), usageRecord.getZoneId(), usageRecord.getAccountId(), usageRecord.getDomainId(), transferType, networkusage, usageRecord.getStartDate(), usageRecord.getEndDate()); _quotaUsageDao.persistQuotaUsage(quota_usage); } usageRecord.setQuotaCalculated(1); _usageDao.persistUsage(usageRecord); return quota_usage; } @Override public boolean isLockable(AccountVO account) { return (account.getType() == AccountVO.ACCOUNT_TYPE_NORMAL || account.getType() == AccountVO.ACCOUNT_TYPE_DOMAIN_ADMIN); } }
{ "content_hash": "b134fec2de82695a38230f0d0147c686", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 180, "avg_line_length": 50.26039387308534, "alnum_prop": 0.6621098001654404, "repo_name": "wido/cloudstack", "id": "769f9aec92f00f8269ed5003be3b98b8a94c742a", "size": "23754", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "framework/quota/src/main/java/org/apache/cloudstack/quota/QuotaManagerImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "10890" }, { "name": "C#", "bytes": "2356211" }, { "name": "CSS", "bytes": "358651" }, { "name": "Dockerfile", "bytes": "2374" }, { "name": "FreeMarker", "bytes": "4887" }, { "name": "Groovy", "bytes": "146420" }, { "name": "HTML", "bytes": "149088" }, { "name": "Java", "bytes": "36088724" }, { "name": "JavaScript", "bytes": "7976318" }, { "name": "Python", "bytes": "13363686" }, { "name": "Ruby", "bytes": "37714" }, { "name": "Shell", "bytes": "784058" }, { "name": "XSLT", "bytes": "58008" } ], "symlink_target": "" }
<def-group> <!-- THIS FILE IS GENERATED by create_package_removed.py. DO NOT EDIT. --> <definition class="compliance" id="package_ypbind_removed" version="1"> <metadata> <title>Package ypbind Removed</title> <affected family="unix"> <platform>Red Hat Enterprise Linux 6</platform> </affected> <description>The RPM package ypbind should be removed.</description> <reference source="swells" ref_id="20130829" ref_url="test_attestation"/> </metadata> <criteria> <criterion comment="package ypbind is removed" test_ref="test_package_ypbind_removed" /> </criteria> </definition> <linux:rpminfo_test check="all" check_existence="none_exist" id="test_package_ypbind_removed" version="1" comment="package ypbind is removed"> <linux:object object_ref="obj_package_ypbind_removed" /> </linux:rpminfo_test> <linux:rpminfo_object id="obj_package_ypbind_removed" version="1"> <linux:name>ypbind</linux:name> </linux:rpminfo_object> </def-group>
{ "content_hash": "1507067583fe4f156025aa1bcc65caf6", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 39.5, "alnum_prop": 0.682570593962999, "repo_name": "ykhodorkovskiy/clip", "id": "73700687852b6ce4a5eccda95bbf0d247995d13f", "size": "1027", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "packages/scap-security-guide/scap-security-guide-0.1.20/RHEL/6/input/checks/package_ypbind_removed.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "209" }, { "name": "C", "bytes": "13809" }, { "name": "Groff", "bytes": "246662" }, { "name": "HTML", "bytes": "1333" }, { "name": "Makefile", "bytes": "88495" }, { "name": "Python", "bytes": "95048" }, { "name": "Shell", "bytes": "17539" } ], "symlink_target": "" }
package com.fight.job.core.handler.annotation; import java.lang.annotation.*; /** * JobHandler Annotation. */ @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Inherited public @interface JobHandler { String value() default ""; }
{ "content_hash": "432a15770b8edfe96092f91e4108eeb1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 46, "avg_line_length": 17, "alnum_prop": 0.7333333333333333, "repo_name": "luoxn28/fight-job", "id": "39175e28dddefadd59668525d41c1e935186eb21", "size": "255", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fight-job-core/src/main/java/com/fight/job/core/handler/annotation/JobHandler.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "282" }, { "name": "Java", "bytes": "122882" }, { "name": "JavaScript", "bytes": "17788" }, { "name": "Vue", "bytes": "20934" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <title>STPAuthenticationContext Protocol Reference</title> <link rel="stylesheet" type="text/css" href="../css/jazzy.css" /> <link rel="stylesheet" type="text/css" href="../css/highlight.css" /> <meta charset="utf-8"> <script src="../js/jquery.min.js" defer></script> <script src="../js/jazzy.js" defer></script> <script src="../js/lunr.min.js" defer></script> <script src="../js/typeahead.jquery.js" defer></script> <script src="../js/jazzy.search.js" defer></script> </head> <body> <a name="//apple_ref/swift/Protocol/STPAuthenticationContext" class="dashAnchor"></a> <a title="STPAuthenticationContext Protocol Reference"></a> <header class="header"> <p class="header-col header-col--primary"> <a class="header-link" href="../../index.html"> Stripe iOS SDKs 23.2.0 </a> </p> <p class="header-col--secondary"> <form role="search" action="../search.json"> <input type="text" placeholder="Search documentation" data-typeahead> </form> </p> <p class="header-col header-col--secondary"> <a class="header-link" href="https://github.com/stripe/stripe-ios"> <img class="header-icon" src="../img/gh.png"/> View on GitHub </a> </p> </header> <p class="breadcrumbs"> <a class="breadcrumb" href="../../index.html">Stripe iOS SDKs</a> <img class="carat" src="../img/carat.png" /> <a class="breadcrumb" href="../index.html">Stripe</a> <img class="carat" src="../img/carat.png" /> STPAuthenticationContext Protocol Reference </p> <div class="content-wrapper"> <nav class="navigation"> <ul class="nav-groups"> <li class="nav-group-name"> <a class="nav-group-name-link" href="../Classes.html">Classes</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPAPIClient.html">STPAPIClient</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPAUBECSDebitFormView.html">STPAUBECSDebitFormView</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPAddCardViewController.html">STPAddCardViewController</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPAddress.html">STPAddress</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPAppInfo.html">STPAppInfo</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPApplePayContext.html">STPApplePayContext</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPApplePayContext/PaymentStatus.html">– PaymentStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPApplePayPaymentOption.html">STPApplePayPaymentOption</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPBankAccount.html">STPBankAccount</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPBankAccountCollector.html">STPBankAccountCollector</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPBankAccountParams.html">STPBankAccountParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPBankSelectionViewController.html">STPBankSelectionViewController</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCard.html">STPCard</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCardBrandUtilities.html">STPCardBrandUtilities</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCardFormView.html">STPCardFormView</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCardFormView/Representable.html">– Representable</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCardParams.html">STPCardParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCardValidator.html">STPCardValidator</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCollectBankAccountParams.html">STPCollectBankAccountParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConfirmAlipayOptions.html">STPConfirmAlipayOptions</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConfirmBLIKOptions.html">STPConfirmBLIKOptions</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConfirmCardOptions.html">STPConfirmCardOptions</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConfirmPaymentMethodOptions.html">STPConfirmPaymentMethodOptions</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConfirmUSBankAccountOptions.html">STPConfirmUSBankAccountOptions</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConfirmWeChatPayOptions.html">STPConfirmWeChatPayOptions</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConnectAccountAddress.html">STPConnectAccountAddress</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConnectAccountCompanyParams.html">STPConnectAccountCompanyParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConnectAccountIndividualParams.html">STPConnectAccountIndividualParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConnectAccountIndividualVerification.html">STPConnectAccountIndividualVerification</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConnectAccountParams.html">STPConnectAccountParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPConnectAccountVerificationDocument.html">STPConnectAccountVerificationDocument</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPContactField.html">STPContactField</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCoreScrollViewController.html">STPCoreScrollViewController</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCoreTableViewController.html">STPCoreTableViewController</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCoreViewController.html">STPCoreViewController</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCustomer.html">STPCustomer</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCustomerContext.html">STPCustomerContext</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPCustomerDeserializer.html">STPCustomerDeserializer</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPDateOfBirth.html">STPDateOfBirth</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPError.html">STPError</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPFPXBank.html">STPFPXBank</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPFakeAddPaymentPassViewController.html">STPFakeAddPaymentPassViewController</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPFile.html">STPFile</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes.html#/c:@M@StripePaymentsUI@objc(cs)STPFormView">STPFormView</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPImageLibrary.html">STPImageLibrary</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPIntentAction.html">STPIntentAction</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPIntentActionAlipayHandleRedirect.html">STPIntentActionAlipayHandleRedirect</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPIntentActionBoletoDisplayDetails.html">STPIntentActionBoletoDisplayDetails</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPIntentActionOXXODisplayDetails.html">STPIntentActionOXXODisplayDetails</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPIntentActionRedirectToURL.html">STPIntentActionRedirectToURL</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPIntentActionVerifyWithMicrodeposits.html">STPIntentActionVerifyWithMicrodeposits</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPIntentActionWechatPayRedirectToApp.html">STPIntentActionWechatPayRedirectToApp</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPIssuingCardPin.html">STPIssuingCardPin</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPKlarnaLineItem.html">STPKlarnaLineItem</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPMandateCustomerAcceptanceParams.html">STPMandateCustomerAcceptanceParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPMandateDataParams.html">STPMandateDataParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPMandateOnlineParams.html">STPMandateOnlineParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPMultiFormTextField.html">STPMultiFormTextField</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentActivityIndicatorView.html">STPPaymentActivityIndicatorView</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentCardTextField.html">STPPaymentCardTextField</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentCardTextField/Representable.html">– Representable</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentConfiguration.html">STPPaymentConfiguration</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentContext.html">STPPaymentContext</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentHandler.html">STPPaymentHandler</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentIntent.html">STPPaymentIntent</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes.html#/c:@M@StripePayments@objc(cs)STPPaymentIntentAction">STPPaymentIntentAction</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentIntentLastPaymentError.html">STPPaymentIntentLastPaymentError</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentIntentParams.html">STPPaymentIntentParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentIntentShippingDetails.html">STPPaymentIntentShippingDetails</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentIntentShippingDetailsAddress.html">STPPaymentIntentShippingDetailsAddress</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentIntentShippingDetailsAddressParams.html">STPPaymentIntentShippingDetailsAddressParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentIntentShippingDetailsParams.html">STPPaymentIntentShippingDetailsParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethod.html">STPPaymentMethod</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodAUBECSDebit.html">STPPaymentMethodAUBECSDebit</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodAUBECSDebitParams.html">STPPaymentMethodAUBECSDebitParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodAddress.html">STPPaymentMethodAddress</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes.html#/c:@M@StripePayments@objc(cs)STPPaymentMethodAffirm">STPPaymentMethodAffirm</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodAffirmParams.html">STPPaymentMethodAffirmParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodAfterpayClearpay.html">STPPaymentMethodAfterpayClearpay</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodAfterpayClearpayParams.html">STPPaymentMethodAfterpayClearpayParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes.html#/c:@M@StripePayments@objc(cs)STPPaymentMethodAlipay">STPPaymentMethodAlipay</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodAlipayParams.html">STPPaymentMethodAlipayParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes.html#/c:@M@StripePayments@objc(cs)STPPaymentMethodBLIK">STPPaymentMethodBLIK</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodBLIKParams.html">STPPaymentMethodBLIKParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodBacsDebit.html">STPPaymentMethodBacsDebit</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodBacsDebitParams.html">STPPaymentMethodBacsDebitParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodBancontact.html">STPPaymentMethodBancontact</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodBancontactParams.html">STPPaymentMethodBancontactParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodBillingDetails.html">STPPaymentMethodBillingDetails</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodBoleto.html">STPPaymentMethodBoleto</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodBoletoParams.html">STPPaymentMethodBoletoParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodCard.html">STPPaymentMethodCard</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodCardChecks.html">STPPaymentMethodCardChecks</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodCardNetworks.html">STPPaymentMethodCardNetworks</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodCardParams.html">STPPaymentMethodCardParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodCardPresent.html">STPPaymentMethodCardPresent</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodCardWallet.html">STPPaymentMethodCardWallet</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodCardWalletMasterpass.html">STPPaymentMethodCardWalletMasterpass</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodCardWalletVisaCheckout.html">STPPaymentMethodCardWalletVisaCheckout</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodEPS.html">STPPaymentMethodEPS</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodEPSParams.html">STPPaymentMethodEPSParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodFPX.html">STPPaymentMethodFPX</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodFPXParams.html">STPPaymentMethodFPXParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodGiropay.html">STPPaymentMethodGiropay</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodGiropayParams.html">STPPaymentMethodGiropayParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodGrabPay.html">STPPaymentMethodGrabPay</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodGrabPayParams.html">STPPaymentMethodGrabPayParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes.html#/c:@M@StripePayments@objc(cs)STPPaymentMethodKlarna">STPPaymentMethodKlarna</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodKlarnaParams.html">STPPaymentMethodKlarnaParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodLink.html">STPPaymentMethodLink</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodLinkParams.html">STPPaymentMethodLinkParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodNetBanking.html">STPPaymentMethodNetBanking</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodNetBankingParams.html">STPPaymentMethodNetBankingParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodOXXO.html">STPPaymentMethodOXXO</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodOXXOParams.html">STPPaymentMethodOXXOParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodParams.html">STPPaymentMethodParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodPrzelewy24.html">STPPaymentMethodPrzelewy24</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodPrzelewy24Params.html">STPPaymentMethodPrzelewy24Params</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodSEPADebit.html">STPPaymentMethodSEPADebit</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodSEPADebitParams.html">STPPaymentMethodSEPADebitParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodSofort.html">STPPaymentMethodSofort</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodSofortParams.html">STPPaymentMethodSofortParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodThreeDSecureUsage.html">STPPaymentMethodThreeDSecureUsage</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodUPI.html">STPPaymentMethodUPI</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodUPIParams.html">STPPaymentMethodUPIParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodUSBankAccount.html">STPPaymentMethodUSBankAccount</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodUSBankAccountNetworks.html">STPPaymentMethodUSBankAccountNetworks</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodUSBankAccountParams.html">STPPaymentMethodUSBankAccountParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodiDEAL.html">STPPaymentMethodiDEAL</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentMethodiDEALParams.html">STPPaymentMethodiDEALParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentOptionsViewController.html">STPPaymentOptionsViewController</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPaymentResult.html">STPPaymentResult</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPinManagementService.html">STPPinManagementService</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPushProvisioningContext.html">STPPushProvisioningContext</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPPushProvisioningDetailsParams.html">STPPushProvisioningDetailsParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPRadarSession.html">STPRadarSession</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPRedirectContext.html">STPRedirectContext</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSetupIntent.html">STPSetupIntent</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSetupIntentConfirmParams.html">STPSetupIntentConfirmParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSetupIntentLastSetupError.html">STPSetupIntentLastSetupError</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPShippingAddressViewController.html">STPShippingAddressViewController</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSource.html">STPSource</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSourceCardDetails.html">STPSourceCardDetails</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSourceKlarnaDetails.html">STPSourceKlarnaDetails</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSourceOwner.html">STPSourceOwner</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSourceParams.html">STPSourceParams</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSourceReceiver.html">STPSourceReceiver</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSourceRedirect.html">STPSourceRedirect</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSourceSEPADebitDetails.html">STPSourceSEPADebitDetails</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSourceVerification.html">STPSourceVerification</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPSourceWeChatPayDetails.html">STPSourceWeChatPayDetails</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPTheme.html">STPTheme</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPThreeDSButtonCustomization.html">STPThreeDSButtonCustomization</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPThreeDSCustomizationSettings.html">STPThreeDSCustomizationSettings</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPThreeDSFooterCustomization.html">STPThreeDSFooterCustomization</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPThreeDSLabelCustomization.html">STPThreeDSLabelCustomization</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPThreeDSNavigationBarCustomization.html">STPThreeDSNavigationBarCustomization</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPThreeDSSelectionCustomization.html">STPThreeDSSelectionCustomization</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPThreeDSTextFieldCustomization.html">STPThreeDSTextFieldCustomization</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPThreeDSUICustomization.html">STPThreeDSUICustomization</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPToken.html">STPToken</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/STPUserInformation.html">STPUserInformation</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/StripeAPI.html">StripeAPI</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/StripeAPI/BillingDetails.html">– BillingDetails</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/StripeAPI/PaymentMethod.html">– PaymentMethod</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Classes/StripeAPI.html#/PaymentMethodParams">– PaymentMethodParams</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="../Enums.html">Enumerations</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPBankAccountHolderType.html">STPBankAccountHolderType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPBankAccountStatus.html">STPBankAccountStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPBankSelectionMethod.html">STPBankSelectionMethod</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPBillingAddressFields.html">STPBillingAddressFields</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPCardBrand.html">STPCardBrand</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPCardErrorCode.html">STPCardErrorCode</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPCardFormViewStyle.html">STPCardFormViewStyle</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPCardFundingType.html">STPCardFundingType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPCardValidationState.html">STPCardValidationState</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPCollectBankAccountError.html">STPCollectBankAccountError</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPConnectAccountBusinessType.html">STPConnectAccountBusinessType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPErrorCode.html">STPErrorCode</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPFPXBankBrand.html">STPFPXBankBrand</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPFilePurpose.html">STPFilePurpose</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPIntentActionType.html">STPIntentActionType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPKlarnaLineItemType.html">STPKlarnaLineItemType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPKlarnaPaymentMethods.html">STPKlarnaPaymentMethods</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPMandateCustomerAcceptanceType.html">STPMandateCustomerAcceptanceType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentHandlerActionStatus.html">STPPaymentHandlerActionStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentHandlerErrorCode.html">STPPaymentHandlerErrorCode</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentIntentActionType.html">STPPaymentIntentActionType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentIntentCaptureMethod.html">STPPaymentIntentCaptureMethod</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentIntentConfirmationMethod.html">STPPaymentIntentConfirmationMethod</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentIntentLastPaymentErrorType.html">STPPaymentIntentLastPaymentErrorType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentIntentSetupFutureUsage.html">STPPaymentIntentSetupFutureUsage</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentIntentSourceActionType.html">STPPaymentIntentSourceActionType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentIntentStatus.html">STPPaymentIntentStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentMethodCardCheckResult.html">STPPaymentMethodCardCheckResult</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentMethodCardWalletType.html">STPPaymentMethodCardWalletType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentMethodType.html">STPPaymentMethodType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentMethodUSBankAccountHolderType.html">STPPaymentMethodUSBankAccountHolderType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentMethodUSBankAccountType.html">STPPaymentMethodUSBankAccountType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPaymentStatus.html">STPPaymentStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPPinStatus.html">STPPinStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPRedirectContextError.html">STPRedirectContextError</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPRedirectContextState.html">STPRedirectContextState</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPSetupIntentLastSetupErrorType.html">STPSetupIntentLastSetupErrorType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPSetupIntentStatus.html">STPSetupIntentStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPSetupIntentUsage.html">STPSetupIntentUsage</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPShippingStatus.html">STPShippingStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPShippingType.html">STPShippingType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPSourceCard3DSecureStatus.html">STPSourceCard3DSecureStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPSourceFlow.html">STPSourceFlow</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPSourceRedirectStatus.html">STPSourceRedirectStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPSourceStatus.html">STPSourceStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPSourceType.html">STPSourceType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPSourceUsage.html">STPSourceUsage</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPSourceVerificationStatus.html">STPSourceVerificationStatus</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPThreeDSButtonTitleStyle.html">STPThreeDSButtonTitleStyle</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPThreeDSCustomizationButtonType.html">STPThreeDSCustomizationButtonType</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Enums/STPTokenType.html">STPTokenType</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="../Extensions.html">Extensions</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Extensions/NSError.html">NSError</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Extensions/UINavigationBar.html">UINavigationBar</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Extensions/View.html">View</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="../Protocols.html">Protocols</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/ApplePayContextDelegate.html">ApplePayContextDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPAPIResponseDecodable.html">STPAPIResponseDecodable</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPAUBECSDebitFormViewDelegate.html">STPAUBECSDebitFormViewDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPAddCardViewControllerDelegate.html">STPAddCardViewControllerDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPApplePayContextDelegate.html">STPApplePayContextDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPAuthenticationContext.html">STPAuthenticationContext</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPBackendAPIAdapter.html">STPBackendAPIAdapter</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPBankSelectionViewControllerDelegate.html">STPBankSelectionViewControllerDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPCardFormViewDelegate.html">STPCardFormViewDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPCustomerEphemeralKeyProvider.html">STPCustomerEphemeralKeyProvider</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols.html#/c:@M@Stripe@objc(pl)STPEphemeralKeyProvider">STPEphemeralKeyProvider</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPFormEncodable.html">STPFormEncodable</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPFormTextFieldContainer.html">STPFormTextFieldContainer</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPIssuingCardEphemeralKeyProvider.html">STPIssuingCardEphemeralKeyProvider</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPPaymentCardTextFieldDelegate.html">STPPaymentCardTextFieldDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPPaymentContextDelegate.html">STPPaymentContextDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPPaymentOption.html">STPPaymentOption</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPPaymentOptionsViewControllerDelegate.html">STPPaymentOptionsViewControllerDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPShippingAddressViewControllerDelegate.html">STPShippingAddressViewControllerDelegate</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Protocols/STPSourceProtocol.html">STPSourceProtocol</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="../Typealiases.html">Type Aliases</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments22STPBooleanSuccessBlocka">STPBooleanSuccessBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments26STPCustomerCompletionBlocka">STPCustomerCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments13STPErrorBlocka">STPErrorBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments22STPFileCompletionBlocka">STPFileCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripeApplePay36STPIntentClientSecretCompletionBlocka">STPIntentClientSecretCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments30STPJSONResponseCompletionBlocka">STPJSONResponseCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments51STPPaymentHandlerActionPaymentIntentCompletionBlocka">STPPaymentHandlerActionPaymentIntentCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments49STPPaymentHandlerActionSetupIntentCompletionBlocka">STPPaymentHandlerActionSetupIntentCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments31STPPaymentIntentCompletionBlocka">STPPaymentIntentCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments31STPPaymentMethodCompletionBlocka">STPPaymentMethodCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments32STPPaymentMethodsCompletionBlocka">STPPaymentMethodsCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments21STPPaymentStatusBlocka">STPPaymentStatusBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments21STPPinCompletionBlocka">STPPinCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments30STPRadarSessionCompletionBlocka">STPRadarSessionCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments33STPRedirectContextCompletionBlocka">STPRedirectContextCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments46STPRedirectContextPaymentIntentCompletionBlocka">STPRedirectContextPaymentIntentCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments39STPRedirectContextSourceCompletionBlocka">STPRedirectContextSourceCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments29STPSetupIntentCompletionBlocka">STPSetupIntentCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:6Stripe33STPShippingMethodsCompletionBlocka">STPShippingMethodsCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments24STPSourceCompletionBlocka">STPSourceCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments32STPSourceProtocolCompletionBlocka">STPSourceProtocolCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments23STPTokenCompletionBlocka">STPTokenCompletionBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripeApplePay12STPVoidBlocka">STPVoidBlock</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="../Typealiases.html#/s:14StripePayments12STPVoidBlocka">STPVoidBlock</a> </li> </ul> </li> </ul> </nav> <article class="main-content"> <section class="section"> <div class="section-content top-matter"> <h1>STPAuthenticationContext</h1> <div class="declaration"> <div class="language"> <pre class="highlight swift"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">STPAuthenticationContext</span> <span class="p">:</span> <span class="kt">NSObjectProtocol</span></code></pre> </div> </div> <p><code>STPAuthenticationContext</code> provides information required to present authentication challenges to a user.</p> <div class="slightly-smaller"> <a href="https://github.com/stripe/stripe-ios/tree/23.2.0/StripePayments/StripePayments/PaymentHandler/STPAuthenticationContext.swift#L15-L36">Show on GitHub</a> </div> </div> </section> <section class="section"> <div class="section-content"> <div class="task-group"> <ul class="item-container"> <li class="item"> <div> <code> <a name="/c:@M@StripePayments@objc(pl)STPAuthenticationContext(im)authenticationPresentingViewController"></a> <a name="//apple_ref/swift/Method/authenticationPresentingViewController()" class="dashAnchor"></a> <a class="token" href="#/c:@M@StripePayments@objc(pl)STPAuthenticationContext(im)authenticationPresentingViewController">authenticationPresentingViewController()</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>The Stripe SDK will modally present additional view controllers on top of the <code>authenticationPresentingViewController</code> when required for user authentication, like in the Challenge Flow for 3DS2 transactions.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">authenticationPresentingViewController</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">UIViewController</span></code></pre> </div> </div> <div class="slightly-smaller"> <a href="https://github.com/stripe/stripe-ios/tree/23.2.0/StripePayments/StripePayments/PaymentHandler/STPAuthenticationContext.swift#L19">Show on GitHub</a> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@StripePayments@objc(pl)STPAuthenticationContext(im)prepareAuthenticationContextForPresentation:"></a> <a name="//apple_ref/swift/Method/prepare(forPresentation:)" class="dashAnchor"></a> <a class="token" href="#/c:@M@StripePayments@objc(pl)STPAuthenticationContext(im)prepareAuthenticationContextForPresentation:">prepare(forPresentation:<wbr>)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>This method is called before presenting a UIViewController for authentication. @note <code><a href="../Classes/STPPaymentHandler.html">STPPaymentHandler</a></code> will not proceed until <code>completion</code> is called.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">@objc(prepareAuthenticationContextForPresentation:)</span> <span class="kd">optional</span> <span class="kd">func</span> <span class="nf">prepare</span><span class="p">(</span> <span class="n">forPresentation</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../Typealiases.html#/s:14StripeApplePay12STPVoidBlocka">STPVoidBlock</a></span> <span class="p">)</span></code></pre> </div> </div> <div class="slightly-smaller"> <a href="https://github.com/stripe/stripe-ios/tree/23.2.0/StripePayments/StripePayments/PaymentHandler/STPAuthenticationContext.swift#L23">Show on GitHub</a> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@StripePayments@objc(pl)STPAuthenticationContext(im)configureSafariViewController:"></a> <a name="//apple_ref/swift/Method/configureSafariViewController(_:)" class="dashAnchor"></a> <a class="token" href="#/c:@M@StripePayments@objc(pl)STPAuthenticationContext(im)configureSafariViewController:">configureSafariViewController(_:<wbr>)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>This method is called before presenting an SFSafariViewController for web-based authentication. Implement this method to configure the <code>SFSafariViewController</code> instance, e.g. <code>viewController.preferredBarTintColor = MyBarTintColor</code> @note Setting the <code>delegate</code> property has no effect.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">@objc</span> <span class="kd">optional</span> <span class="kd">func</span> <span class="nf">configureSafariViewController</span><span class="p">(</span><span class="n">_</span> <span class="nv">viewController</span><span class="p">:</span> <span class="kt">SFSafariViewController</span><span class="p">)</span></code></pre> </div> </div> <div class="slightly-smaller"> <a href="https://github.com/stripe/stripe-ios/tree/23.2.0/StripePayments/StripePayments/PaymentHandler/STPAuthenticationContext.swift#L29">Show on GitHub</a> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@StripePayments@objc(pl)STPAuthenticationContext(im)authenticationContextWillDismissViewController:"></a> <a name="//apple_ref/swift/Method/authenticationContextWillDismiss(_:)" class="dashAnchor"></a> <a class="token" href="#/c:@M@StripePayments@objc(pl)STPAuthenticationContext(im)authenticationContextWillDismissViewController:">authenticationContextWillDismiss(_:<wbr>)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>This method is called when an authentication UIViewController is about to be dismissed. Implement this method to prepare your UI for the authentication view controller to be dismissed. For example, if you requested authentication while displaying an STPBankSelectionViewController, you may want to hide it to return the user to your desired view controller.</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">@objc(authenticationContextWillDismissViewController:)</span> <span class="kd">optional</span> <span class="kd">func</span> <span class="nf">authenticationContextWillDismiss</span><span class="p">(</span><span class="n">_</span> <span class="nv">viewController</span><span class="p">:</span> <span class="kt">UIViewController</span><span class="p">)</span></code></pre> </div> </div> <div class="slightly-smaller"> <a href="https://github.com/stripe/stripe-ios/tree/23.2.0/StripePayments/StripePayments/PaymentHandler/STPAuthenticationContext.swift#L35">Show on GitHub</a> </div> </section> </div> </li> </ul> </div> </div> </section> </article> </div> <section class="footer"> <p>&copy; 2022 <a class="link" href="https://stripe.com" target="_blank" rel="external noopener">Stripe</a>. All rights reserved. (Last updated: 2022-11-14)</p> <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p> </section> </body> </div> </html>
{ "content_hash": "90737d5f4c5fcf1780bc0a4d0dded6cf", "timestamp": "", "source": "github", "line_count": 1046, "max_line_length": 310, "avg_line_length": 60.48661567877629, "alnum_prop": 0.5736932779086125, "repo_name": "stripe/stripe-ios", "id": "3546f5e553fd42b484398d72321d73babfed5ff9", "size": "63285", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/docs/Protocols/STPAuthenticationContext.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "663" }, { "name": "HTML", "bytes": "259541" }, { "name": "JavaScript", "bytes": "76560" }, { "name": "Mustache", "bytes": "9421" }, { "name": "Objective-C", "bytes": "1387115" }, { "name": "Ruby", "bytes": "106095" }, { "name": "SCSS", "bytes": "31808" }, { "name": "Shell", "bytes": "36821" }, { "name": "Swift", "bytes": "6061875" } ], "symlink_target": "" }
package org.objectweb.asm; import junit.framework.TestSuite; /** * ClassReader tests. * * @author Eric Bruneton */ public class ClassReaderTest extends AbstractTest { public static TestSuite suite() throws Exception { return new ClassReaderTest().getSuite(); } @Override public void test() throws Exception { new ClassReader(is).accept(new ClassVisitor(Opcodes.ASM5) { AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM5) { @Override public AnnotationVisitor visitAnnotation(String name, String desc) { return this; } @Override public AnnotationVisitor visitArray(String name) { return this; } }; @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { return av; } @Override public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { return av; } @Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { return new FieldVisitor(Opcodes.ASM5) { @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { return av; } @Override public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { return av; } }; } @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { return new MethodVisitor(Opcodes.ASM5) { @Override public AnnotationVisitor visitAnnotationDefault() { return av; } @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { return av; } @Override public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { return av; } @Override public AnnotationVisitor visitParameterAnnotation( int parameter, String desc, boolean visible) { return av; } @Override public AnnotationVisitor visitInsnAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { return av; } @Override public AnnotationVisitor visitTryCatchAnnotation( int typeRef, TypePath typePath, String desc, boolean visible) { return av; } @Override public AnnotationVisitor visitLocalVariableAnnotation( int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String desc, boolean visible) { return av; } }; } }, 0); } }
{ "content_hash": "09d6a299b12e294224f12c048eae789d", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 78, "avg_line_length": 33.13559322033898, "alnum_prop": 0.46317135549872124, "repo_name": "patrikbeno/org.objectweb.asm", "id": "92e3a284c5ea312cdbed7dc0ca3c5c1989a041a7", "size": "5515", "binary": false, "copies": "7", "ref": "refs/heads/jrevolt", "path": "test/conform/org/objectweb/asm/ClassReaderTest.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "2375069" }, { "name": "Standard ML", "bytes": "119878" }, { "name": "XSLT", "bytes": "16226" } ], "symlink_target": "" }
using System; namespace MessagePack.LZ4 { public static partial class LZ4Codec { #if NETSTANDARD public static int Encode(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength) { if (IntPtr.Size == 4) { return LZ4Codec.Encode32Unsafe(input, inputOffset, inputLength, output, outputOffset, outputLength); } else { return LZ4Codec.Encode64Unsafe(input, inputOffset, inputLength, output, outputOffset, outputLength); } } public static int Decode(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength) { if (IntPtr.Size == 4) { return LZ4Codec.Decode32Unsafe(input, inputOffset, inputLength, output, outputOffset, outputLength); } else { return LZ4Codec.Decode64Unsafe(input, inputOffset, inputLength, output, outputOffset, outputLength); } } #else // use 'Safe' code for Unity because in IL2CPP gots strange behaviour. public static int Encode(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength) { if (IntPtr.Size == 4) { return LZ4Codec.Encode32Safe(input, inputOffset, inputLength, output, outputOffset, outputLength); } else { return LZ4Codec.Encode64Safe(input, inputOffset, inputLength, output, outputOffset, outputLength); } } public static int Decode(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength) { if (IntPtr.Size == 4) { return LZ4Codec.Decode32Safe(input, inputOffset, inputLength, output, outputOffset, outputLength); } else { return LZ4Codec.Decode64Safe(input, inputOffset, inputLength, output, outputOffset, outputLength); } } #endif internal static class HashTablePool { [ThreadStatic] static ushort[] ushortPool; [ThreadStatic] static uint[] uintPool; [ThreadStatic] static int[] intPool; public static ushort[] GetUShortHashTablePool() { if (ushortPool == null) { ushortPool = new ushort[HASH64K_TABLESIZE]; } else { Array.Clear(ushortPool, 0, ushortPool.Length); } return ushortPool; } public static uint[] GetUIntHashTablePool() { if (uintPool == null) { uintPool = new uint[HASH_TABLESIZE]; } else { Array.Clear(uintPool, 0, uintPool.Length); } return uintPool; } public static int[] GetIntHashTablePool() { if (intPool == null) { intPool = new int[HASH_TABLESIZE]; } else { Array.Clear(intPool, 0, intPool.Length); } return intPool; } } } }
{ "content_hash": "e1196957cd31baa87fd96cc1bd379421", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 131, "avg_line_length": 30.91304347826087, "alnum_prop": 0.5052039381153305, "repo_name": "neuecc/MasterMemory", "id": "25b8a378d69c9ecc7c42b497c5c3b026d689f153", "size": "3557", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/MasterMemory.Unity/Assets/Scripts/MessagePack/LZ4/Codec/LZ4Codec.Helper.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1571917" } ], "symlink_target": "" }
ig.module( 'game.entities.fx.basic-fx' ).requires( 'impact.entity', 'impact.sound' ).defines(function () { BasicFX = ig.Entity.extend({ collides: ig.Entity.COLLIDES.NEVER, handleMovementTrace: function (res) { this.pos.x += this.vel.x * ig.system.tick; this.pos.y += this.vel.y * ig.system.tick; } }); });
{ "content_hash": "8647d90c200848baaae996fa85a1f948", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 50, "avg_line_length": 20.9375, "alnum_prop": 0.6298507462686567, "repo_name": "khellste/defense", "id": "cc20dbeb3a777d2ab67551cb0a0f794e71472b77", "size": "335", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/game/entities/fx/basic-fx.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "74551" } ], "symlink_target": "" }
package com.ztiany.mall.utils; import java.util.Properties; import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMessage.RecipientType; /** * 邮件发送工具类 */ public class MailUtils { public static void sendMail(String email, String emailMsg) throws MessagingException { // 1.创建一个程序与邮件服务器会话对象 Session Properties props = new Properties(); props.setProperty("mail.transport.protocol", "SMTP"); props.setProperty("mail.host", "smtp.163.com"); props.setProperty("mail.smtp.auth", "true");// 指定验证为true // 创建验证器 Authenticator auth = new Authenticator() { public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("haha@163.com", "123456"); } }; Session session = Session.getInstance(props, auth); // 2.创建一个Message,它相当于是邮件内容 Message message = new MimeMessage(session); message.setFrom(new InternetAddress("haha@126.com")); // 设置发送者 message.setRecipient(RecipientType.TO, new InternetAddress(email)); // 设置发送方式与接收者 message.setSubject("用户激活"); message.setContent(emailMsg, "text/html;charset=utf-8"); // 3.创建 Transport用于将邮件发送 Transport.send(message); } }
{ "content_hash": "3ead5568b471ff0dc9a50e7a2f9f7ac1", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 90, "avg_line_length": 30.64, "alnum_prop": 0.6886422976501305, "repo_name": "Ztiany/CodeRepository", "id": "7a41c8d5376c227b1f2e31b8f18a43ca11ba34cd", "size": "1682", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "JavaEE/Project-Mall/src/main/java/com/ztiany/mall/utils/MailUtils.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "104421" }, { "name": "C++", "bytes": "43060" }, { "name": "CMake", "bytes": "7529" }, { "name": "CSS", "bytes": "9794" }, { "name": "Groovy", "bytes": "193822" }, { "name": "HTML", "bytes": "239910" }, { "name": "Java", "bytes": "3587367" }, { "name": "JavaScript", "bytes": "294734" }, { "name": "Kotlin", "bytes": "203000" }, { "name": "Makefile", "bytes": "15406" }, { "name": "Python", "bytes": "17218" }, { "name": "Shell", "bytes": "1356" } ], "symlink_target": "" }
import {Tag} from './Tag'; export class KMetric { public name: string; public groupName: string; public description: string; public tags: Array<Tag>; public value: number; }
{ "content_hash": "e0693a0951c7c1ea32150387c029f955", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 29, "avg_line_length": 20.555555555555557, "alnum_prop": 0.6972972972972973, "repo_name": "mmaia/kafka-simple-demo", "id": "e217396967fea600a2f7f62aa14ab618059b1536", "size": "185", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "knav-fe/src/app/model/KMetric.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "150591" }, { "name": "HTML", "bytes": "14608" }, { "name": "Java", "bytes": "78446" }, { "name": "JavaScript", "bytes": "17901" }, { "name": "TypeScript", "bytes": "25580" } ], "symlink_target": "" }
namespace llvm { class Argument; class CCState; class CCValAssign; class FastISel; class FunctionLoweringInfo; class MachineBasicBlock; class MachineFrameInfo; class MachineInstr; class MipsCCState; class MipsFunctionInfo; class MipsSubtarget; class MipsTargetMachine; class TargetLibraryInfo; class TargetRegisterClass; namespace MipsISD { enum NodeType : unsigned { // Start the numbering from where ISD NodeType finishes. FIRST_NUMBER = ISD::BUILTIN_OP_END, // Jump and link (call) JmpLink, // Tail call TailCall, // Get the Highest (63-48) 16 bits from a 64-bit immediate Highest, // Get the Higher (47-32) 16 bits from a 64-bit immediate Higher, // Get the High 16 bits from a 32/64-bit immediate // No relation with Mips Hi register Hi, // Get the Lower 16 bits from a 32/64-bit immediate // No relation with Mips Lo register Lo, // Get the High 16 bits from a 32 bit immediate for accessing the GOT. GotHi, // Get the High 16 bits from a 32-bit immediate for accessing TLS. TlsHi, // Handle gp_rel (small data/bss sections) relocation. GPRel, // Thread Pointer ThreadPointer, // Vector Floating Point Multiply and Subtract FMS, // Floating Point Branch Conditional FPBrcond, // Floating Point Compare FPCmp, // Floating point select FSELECT, // Node used to generate an MTC1 i32 to f64 instruction MTC1_D64, // Floating Point Conditional Moves CMovFP_T, CMovFP_F, // FP-to-int truncation node. TruncIntFP, // Return Ret, // Interrupt, exception, error trap Return ERet, // Software Exception Return. EH_RETURN, // Node used to extract integer from accumulator. MFHI, MFLO, // Node used to insert integers to accumulator. MTLOHI, // Mult nodes. Mult, Multu, // MAdd/Sub nodes MAdd, MAddu, MSub, MSubu, // DivRem(u) DivRem, DivRemU, DivRem16, DivRemU16, BuildPairF64, ExtractElementF64, Wrapper, DynAlloc, Sync, Ext, Ins, CIns, // EXTR.W instrinsic nodes. EXTP, EXTPDP, EXTR_S_H, EXTR_W, EXTR_R_W, EXTR_RS_W, SHILO, MTHLIP, // DPA.W intrinsic nodes. MULSAQ_S_W_PH, MAQ_S_W_PHL, MAQ_S_W_PHR, MAQ_SA_W_PHL, MAQ_SA_W_PHR, DPAU_H_QBL, DPAU_H_QBR, DPSU_H_QBL, DPSU_H_QBR, DPAQ_S_W_PH, DPSQ_S_W_PH, DPAQ_SA_L_W, DPSQ_SA_L_W, DPA_W_PH, DPS_W_PH, DPAQX_S_W_PH, DPAQX_SA_W_PH, DPAX_W_PH, DPSX_W_PH, DPSQX_S_W_PH, DPSQX_SA_W_PH, MULSA_W_PH, MULT, MULTU, MADD_DSP, MADDU_DSP, MSUB_DSP, MSUBU_DSP, // DSP shift nodes. SHLL_DSP, SHRA_DSP, SHRL_DSP, // DSP setcc and select_cc nodes. SETCC_DSP, SELECT_CC_DSP, // Vector comparisons. // These take a vector and return a boolean. VALL_ZERO, VANY_ZERO, VALL_NONZERO, VANY_NONZERO, // These take a vector and return a vector bitmask. VCEQ, VCLE_S, VCLE_U, VCLT_S, VCLT_U, // Vector Shuffle with mask as an operand VSHF, // Generic shuffle SHF, // 4-element set shuffle. ILVEV, // Interleave even elements ILVOD, // Interleave odd elements ILVL, // Interleave left elements ILVR, // Interleave right elements PCKEV, // Pack even elements PCKOD, // Pack odd elements // Vector Lane Copy INSVE, // Copy element from one vector to another // Combined (XOR (OR $a, $b), -1) VNOR, // Extended vector element extraction VEXTRACT_SEXT_ELT, VEXTRACT_ZEXT_ELT, // Load/Store Left/Right nodes. LWL = ISD::FIRST_TARGET_MEMORY_OPCODE, LWR, SWL, SWR, LDL, LDR, SDL, SDR }; } // ene namespace MipsISD //===--------------------------------------------------------------------===// // TargetLowering Implementation //===--------------------------------------------------------------------===// class MipsTargetLowering : public TargetLowering { bool isMicroMips; public: explicit MipsTargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI); static const MipsTargetLowering *create(const MipsTargetMachine &TM, const MipsSubtarget &STI); /// createFastISel - This method returns a target specific FastISel object, /// or null if the target does not support "fast" ISel. FastISel *createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo) const override; MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override { return MVT::i32; } EVT getTypeForExtReturn(LLVMContext &Context, EVT VT, ISD::NodeType) const override; bool isCheapToSpeculateCttz() const override; bool isCheapToSpeculateCtlz() const override; bool shouldFoldConstantShiftPairToMask(const SDNode *N, CombineLevel Level) const override; /// Return the register type for a given MVT, ensuring vectors are treated /// as a series of gpr sized integers. MVT getRegisterTypeForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const override; /// Return the number of registers for a given MVT, ensuring vectors are /// treated as a series of gpr sized integers. unsigned getNumRegistersForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const override; /// Break down vectors to the correct number of gpr sized integers. unsigned getVectorTypeBreakdownForCallingConv( LLVMContext &Context, CallingConv::ID CC, EVT VT, EVT &IntermediateVT, unsigned &NumIntermediates, MVT &RegisterVT) const override; /// Return the correct alignment for the current calling convention. Align getABIAlignmentForCallingConv(Type *ArgTy, DataLayout DL) const override { const Align ABIAlign(DL.getABITypeAlignment(ArgTy)); if (ArgTy->isVectorTy()) return std::min(ABIAlign, Align(8)); return ABIAlign; } ISD::NodeType getExtendForAtomicOps() const override { return ISD::SIGN_EXTEND; } void LowerOperationWrapper(SDNode *N, SmallVectorImpl<SDValue> &Results, SelectionDAG &DAG) const override; /// LowerOperation - Provide custom lowering hooks for some operations. SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override; /// ReplaceNodeResults - Replace the results of node with an illegal result /// type with new values built out of custom code. /// void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue>&Results, SelectionDAG &DAG) const override; /// getTargetNodeName - This method returns the name of a target specific // DAG node. const char *getTargetNodeName(unsigned Opcode) const override; /// getSetCCResultType - get the ISD::SETCC result ValueType EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override; SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override; MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override; void AdjustInstrPostInstrSelection(MachineInstr &MI, SDNode *Node) const override; void HandleByVal(CCState *, unsigned &, unsigned) const override; Register getRegisterByName(const char* RegName, EVT VT, const MachineFunction &MF) const override; /// If a physical register, this returns the register that receives the /// exception address on entry to an EH pad. unsigned getExceptionPointerRegister(const Constant *PersonalityFn) const override { return ABI.IsN64() ? Mips::A0_64 : Mips::A0; } /// If a physical register, this returns the register that receives the /// exception typeid on entry to a landing pad. unsigned getExceptionSelectorRegister(const Constant *PersonalityFn) const override { return ABI.IsN64() ? Mips::A1_64 : Mips::A1; } /// Returns true if a cast between SrcAS and DestAS is a noop. bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override { // Mips doesn't have any special address spaces so we just reserve // the first 256 for software use (e.g. OpenCL) and treat casts // between them as noops. return SrcAS < 256 && DestAS < 256; } bool isJumpTableRelative() const override { return getTargetMachine().isPositionIndependent(); } CCAssignFn *CCAssignFnForCall() const; CCAssignFn *CCAssignFnForReturn() const; protected: SDValue getGlobalReg(SelectionDAG &DAG, EVT Ty) const; // This method creates the following nodes, which are necessary for // computing a local symbol's address: // // (add (load (wrapper $gp, %got(sym)), %lo(sym)) template <class NodeTy> SDValue getAddrLocal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, bool IsN32OrN64) const { unsigned GOTFlag = IsN32OrN64 ? MipsII::MO_GOT_PAGE : MipsII::MO_GOT; SDValue GOT = DAG.getNode(MipsISD::Wrapper, DL, Ty, getGlobalReg(DAG, Ty), getTargetNode(N, Ty, DAG, GOTFlag)); SDValue Load = DAG.getLoad(Ty, DL, DAG.getEntryNode(), GOT, MachinePointerInfo::getGOT(DAG.getMachineFunction())); unsigned LoFlag = IsN32OrN64 ? MipsII::MO_GOT_OFST : MipsII::MO_ABS_LO; SDValue Lo = DAG.getNode(MipsISD::Lo, DL, Ty, getTargetNode(N, Ty, DAG, LoFlag)); return DAG.getNode(ISD::ADD, DL, Ty, Load, Lo); } // This method creates the following nodes, which are necessary for // computing a global symbol's address: // // (load (wrapper $gp, %got(sym))) template <class NodeTy> SDValue getAddrGlobal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned Flag, SDValue Chain, const MachinePointerInfo &PtrInfo) const { SDValue Tgt = DAG.getNode(MipsISD::Wrapper, DL, Ty, getGlobalReg(DAG, Ty), getTargetNode(N, Ty, DAG, Flag)); return DAG.getLoad(Ty, DL, Chain, Tgt, PtrInfo); } // This method creates the following nodes, which are necessary for // computing a global symbol's address in large-GOT mode: // // (load (wrapper (add %hi(sym), $gp), %lo(sym))) template <class NodeTy> SDValue getAddrGlobalLargeGOT(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned HiFlag, unsigned LoFlag, SDValue Chain, const MachinePointerInfo &PtrInfo) const { SDValue Hi = DAG.getNode(MipsISD::GotHi, DL, Ty, getTargetNode(N, Ty, DAG, HiFlag)); Hi = DAG.getNode(ISD::ADD, DL, Ty, Hi, getGlobalReg(DAG, Ty)); SDValue Wrapper = DAG.getNode(MipsISD::Wrapper, DL, Ty, Hi, getTargetNode(N, Ty, DAG, LoFlag)); return DAG.getLoad(Ty, DL, Chain, Wrapper, PtrInfo); } // This method creates the following nodes, which are necessary for // computing a symbol's address in non-PIC mode: // // (add %hi(sym), %lo(sym)) // // This method covers O32, N32 and N64 in sym32 mode. template <class NodeTy> SDValue getAddrNonPIC(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const { SDValue Hi = getTargetNode(N, Ty, DAG, MipsII::MO_ABS_HI); SDValue Lo = getTargetNode(N, Ty, DAG, MipsII::MO_ABS_LO); return DAG.getNode(ISD::ADD, DL, Ty, DAG.getNode(MipsISD::Hi, DL, Ty, Hi), DAG.getNode(MipsISD::Lo, DL, Ty, Lo)); } // This method creates the following nodes, which are necessary for // computing a symbol's address in non-PIC mode for N64. // // (add (shl (add (shl (add %highest(sym), %higher(sim)), 16), %high(sym)), // 16), %lo(%sym)) // // FIXME: This method is not efficent for (micro)MIPS64R6. template <class NodeTy> SDValue getAddrNonPICSym64(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const { SDValue Hi = getTargetNode(N, Ty, DAG, MipsII::MO_ABS_HI); SDValue Lo = getTargetNode(N, Ty, DAG, MipsII::MO_ABS_LO); SDValue Highest = DAG.getNode(MipsISD::Highest, DL, Ty, getTargetNode(N, Ty, DAG, MipsII::MO_HIGHEST)); SDValue Higher = getTargetNode(N, Ty, DAG, MipsII::MO_HIGHER); SDValue HigherPart = DAG.getNode(ISD::ADD, DL, Ty, Highest, DAG.getNode(MipsISD::Higher, DL, Ty, Higher)); SDValue Cst = DAG.getConstant(16, DL, MVT::i32); SDValue Shift = DAG.getNode(ISD::SHL, DL, Ty, HigherPart, Cst); SDValue Add = DAG.getNode(ISD::ADD, DL, Ty, Shift, DAG.getNode(MipsISD::Hi, DL, Ty, Hi)); SDValue Shift2 = DAG.getNode(ISD::SHL, DL, Ty, Add, Cst); return DAG.getNode(ISD::ADD, DL, Ty, Shift2, DAG.getNode(MipsISD::Lo, DL, Ty, Lo)); } // This method creates the following nodes, which are necessary for // computing a symbol's address using gp-relative addressing: // // (add $gp, %gp_rel(sym)) template <class NodeTy> SDValue getAddrGPRel(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, bool IsN64) const { SDValue GPRel = getTargetNode(N, Ty, DAG, MipsII::MO_GPREL); return DAG.getNode( ISD::ADD, DL, Ty, DAG.getRegister(IsN64 ? Mips::GP_64 : Mips::GP, Ty), DAG.getNode(MipsISD::GPRel, DL, DAG.getVTList(Ty), GPRel)); } /// This function fills Ops, which is the list of operands that will later /// be used when a function call node is created. It also generates /// copyToReg nodes to set up argument registers. virtual void getOpndList(SmallVectorImpl<SDValue> &Ops, std::deque<std::pair<unsigned, SDValue>> &RegsToPass, bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage, bool IsCallReloc, CallLoweringInfo &CLI, SDValue Callee, SDValue Chain) const; protected: SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const; SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const; // Subtarget Info const MipsSubtarget &Subtarget; // Cache the ABI from the TargetMachine, we use it everywhere. const MipsABIInfo &ABI; private: // Create a TargetGlobalAddress node. SDValue getTargetNode(GlobalAddressSDNode *N, EVT Ty, SelectionDAG &DAG, unsigned Flag) const; // Create a TargetExternalSymbol node. SDValue getTargetNode(ExternalSymbolSDNode *N, EVT Ty, SelectionDAG &DAG, unsigned Flag) const; // Create a TargetBlockAddress node. SDValue getTargetNode(BlockAddressSDNode *N, EVT Ty, SelectionDAG &DAG, unsigned Flag) const; // Create a TargetJumpTable node. SDValue getTargetNode(JumpTableSDNode *N, EVT Ty, SelectionDAG &DAG, unsigned Flag) const; // Create a TargetConstantPool node. SDValue getTargetNode(ConstantPoolSDNode *N, EVT Ty, SelectionDAG &DAG, unsigned Flag) const; // Lower Operand helpers SDValue LowerCallResult(SDValue Chain, SDValue InFlag, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::InputArg> &Ins, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals, TargetLowering::CallLoweringInfo &CLI) const; // Lower Operand specifics SDValue lowerBRCOND(SDValue Op, SelectionDAG &DAG) const; SDValue lowerConstantPool(SDValue Op, SelectionDAG &DAG) const; SDValue lowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const; SDValue lowerBlockAddress(SDValue Op, SelectionDAG &DAG) const; SDValue lowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const; SDValue lowerJumpTable(SDValue Op, SelectionDAG &DAG) const; SDValue lowerSELECT(SDValue Op, SelectionDAG &DAG) const; SDValue lowerSETCC(SDValue Op, SelectionDAG &DAG) const; SDValue lowerVASTART(SDValue Op, SelectionDAG &DAG) const; SDValue lowerVAARG(SDValue Op, SelectionDAG &DAG) const; SDValue lowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const; SDValue lowerFABS(SDValue Op, SelectionDAG &DAG) const; SDValue lowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const; SDValue lowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const; SDValue lowerEH_RETURN(SDValue Op, SelectionDAG &DAG) const; SDValue lowerATOMIC_FENCE(SDValue Op, SelectionDAG& DAG) const; SDValue lowerShiftLeftParts(SDValue Op, SelectionDAG& DAG) const; SDValue lowerShiftRightParts(SDValue Op, SelectionDAG& DAG, bool IsSRA) const; SDValue lowerEH_DWARF_CFA(SDValue Op, SelectionDAG &DAG) const; SDValue lowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG) const; /// isEligibleForTailCallOptimization - Check whether the call is eligible /// for tail call optimization. virtual bool isEligibleForTailCallOptimization(const CCState &CCInfo, unsigned NextStackOffset, const MipsFunctionInfo &FI) const = 0; /// copyByValArg - Copy argument registers which were used to pass a byval /// argument to the stack. Create a stack frame object for the byval /// argument. void copyByValRegs(SDValue Chain, const SDLoc &DL, std::vector<SDValue> &OutChains, SelectionDAG &DAG, const ISD::ArgFlagsTy &Flags, SmallVectorImpl<SDValue> &InVals, const Argument *FuncArg, unsigned FirstReg, unsigned LastReg, const CCValAssign &VA, MipsCCState &State) const; /// passByValArg - Pass a byval argument in registers or on stack. void passByValArg(SDValue Chain, const SDLoc &DL, std::deque<std::pair<unsigned, SDValue>> &RegsToPass, SmallVectorImpl<SDValue> &MemOpChains, SDValue StackPtr, MachineFrameInfo &MFI, SelectionDAG &DAG, SDValue Arg, unsigned FirstReg, unsigned LastReg, const ISD::ArgFlagsTy &Flags, bool isLittle, const CCValAssign &VA) const; /// writeVarArgRegs - Write variable function arguments passed in registers /// to the stack. Also create a stack frame object for the first variable /// argument. void writeVarArgRegs(std::vector<SDValue> &OutChains, SDValue Chain, const SDLoc &DL, SelectionDAG &DAG, CCState &State) const; SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::InputArg> &Ins, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const override; SDValue passArgOnStack(SDValue StackPtr, unsigned Offset, SDValue Chain, SDValue Arg, const SDLoc &DL, bool IsTailCall, SelectionDAG &DAG) const; SDValue LowerCall(TargetLowering::CallLoweringInfo &CLI, SmallVectorImpl<SDValue> &InVals) const override; bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF, bool isVarArg, const SmallVectorImpl<ISD::OutputArg> &Outs, LLVMContext &Context) const override; SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::OutputArg> &Outs, const SmallVectorImpl<SDValue> &OutVals, const SDLoc &dl, SelectionDAG &DAG) const override; SDValue LowerInterruptReturn(SmallVectorImpl<SDValue> &RetOps, const SDLoc &DL, SelectionDAG &DAG) const; bool shouldSignExtendTypeInLibCall(EVT Type, bool IsSigned) const override; // Inline asm support ConstraintType getConstraintType(StringRef Constraint) const override; /// Examine constraint string and operand type and determine a weight value. /// The operand object must already have been set up with the operand type. ConstraintWeight getSingleConstraintMatchWeight( AsmOperandInfo &info, const char *constraint) const override; /// This function parses registers that appear in inline-asm constraints. /// It returns pair (0, 0) on failure. std::pair<unsigned, const TargetRegisterClass *> parseRegForInlineAsmConstraint(StringRef C, MVT VT) const; std::pair<unsigned, const TargetRegisterClass *> getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override; /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops /// vector. If it is invalid, don't add anything to Ops. If hasMemory is /// true it means one of the asm constraint of the inline asm instruction /// being processed is 'm'. void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector<SDValue> &Ops, SelectionDAG &DAG) const override; unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const override { if (ConstraintCode == "o") return InlineAsm::Constraint_o; if (ConstraintCode == "R") return InlineAsm::Constraint_R; if (ConstraintCode == "ZC") return InlineAsm::Constraint_ZC; return TargetLowering::getInlineAsmMemConstraint(ConstraintCode); } bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS, Instruction *I = nullptr) const override; bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override; EVT getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign, bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc, const AttributeList &FuncAttributes) const override; /// isFPImmLegal - Returns true if the target can instruction select the /// specified FP immediate natively. If false, the legalizer will /// materialize the FP immediate as a load from a constant pool. bool isFPImmLegal(const APFloat &Imm, EVT VT, bool ForCodeSize) const override; unsigned getJumpTableEncoding() const override; bool useSoftFloat() const override; bool shouldInsertFencesForAtomic(const Instruction *I) const override { return true; } /// Emit a sign-extension using sll/sra, seb, or seh appropriately. MachineBasicBlock *emitSignExtendToI32InReg(MachineInstr &MI, MachineBasicBlock *BB, unsigned Size, unsigned DstReg, unsigned SrcRec) const; MachineBasicBlock *emitAtomicBinary(MachineInstr &MI, MachineBasicBlock *BB) const; MachineBasicBlock *emitAtomicBinaryPartword(MachineInstr &MI, MachineBasicBlock *BB, unsigned Size) const; MachineBasicBlock *emitAtomicCmpSwap(MachineInstr &MI, MachineBasicBlock *BB) const; MachineBasicBlock *emitAtomicCmpSwapPartword(MachineInstr &MI, MachineBasicBlock *BB, unsigned Size) const; MachineBasicBlock *emitSEL_D(MachineInstr &MI, MachineBasicBlock *BB) const; MachineBasicBlock *emitPseudoSELECT(MachineInstr &MI, MachineBasicBlock *BB, bool isFPCmp, unsigned Opc) const; MachineBasicBlock *emitPseudoD_SELECT(MachineInstr &MI, MachineBasicBlock *BB) const; }; /// Create MipsTargetLowering objects. const MipsTargetLowering * createMips16TargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI); const MipsTargetLowering * createMipsSETargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI); namespace Mips { FastISel *createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo); } // end namespace Mips } // end namespace llvm #endif // LLVM_LIB_TARGET_MIPS_MIPSISELLOWERING_H
{ "content_hash": "c6de46c2125a305b1db040ecc041586f", "timestamp": "", "source": "github", "line_count": 692, "max_line_length": 80, "avg_line_length": 37.80780346820809, "alnum_prop": 0.6077666934220082, "repo_name": "llvm-mirror/llvm", "id": "0a5cddd45afbf43fcdb67cd37a6aa4466ea51d05", "size": "27520", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "lib/Target/Mips/MipsISelLowering.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "53797008" }, { "name": "Batchfile", "bytes": "9834" }, { "name": "C", "bytes": "852170" }, { "name": "C++", "bytes": "86305007" }, { "name": "CMake", "bytes": "536242" }, { "name": "CSS", "bytes": "12605" }, { "name": "Dockerfile", "bytes": "5884" }, { "name": "Emacs Lisp", "bytes": "10556" }, { "name": "Go", "bytes": "149205" }, { "name": "HTML", "bytes": "37873" }, { "name": "LLVM", "bytes": "139035668" }, { "name": "Logos", "bytes": "28" }, { "name": "OCaml", "bytes": "306665" }, { "name": "Objective-C", "bytes": "10226" }, { "name": "PHP", "bytes": "2667" }, { "name": "Perl", "bytes": "25574" }, { "name": "Python", "bytes": "1014377" }, { "name": "Roff", "bytes": "39" }, { "name": "Shell", "bytes": "97425" }, { "name": "Swift", "bytes": "271" }, { "name": "Vim script", "bytes": "17497" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>fairisle: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.15.2 / fairisle - 8.6.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> fairisle <small> 8.6.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-03 10:13:39 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-03 10:13:39 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.15.2 Formal proof management system dune 3.4.1 Fast, portable, and opinionated build system ocaml 4.10.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.10.2 Official release 4.10.2 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/fairisle&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Fairisle&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.7~&quot;} ] tags: [ &quot;keyword: circuits&quot; &quot;keyword: automata&quot; &quot;keyword: co-induction&quot; &quot;keyword: dependent types&quot; &quot;category: Computer Science/Architecture&quot; &quot;date: 2005-12-15&quot; ] authors: [ &quot;Solange Coupet-Grimal &lt;Solange.Coupet@lif.univ-mrs.fr&gt; [http://www.cmi.univ-mrs.fr/~solange/]&quot; &quot;Line Jakubiec-Jamet &lt;Line.Jakubiec@lif.univ-mrs.fr&gt; [http://www.dil.univ-mrs.fr/~jakubiec/]&quot; ] bug-reports: &quot;https://github.com/coq-contribs/fairisle/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/fairisle.git&quot; synopsis: &quot;Proof of the Fairisle 4x4 Switch Element&quot; description: &quot;&quot;&quot; http://www.dil.univ-mrs.fr/~jakubiec/fairisle.tar.gz This library contains the development of general definitions dedicated to the verification of sequential synchronous devices (based on Moore and Mealy automata) and the formal verification of the Fairisle 4x4 Switch Element.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/fairisle/archive/v8.6.0.tar.gz&quot; checksum: &quot;md5=e899d5c1445154ba24d5e8d2ba7d64a0&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-fairisle.8.6.0 coq.8.15.2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.15.2). The following dependencies couldn&#39;t be met: - coq-fairisle -&gt; coq &lt; 8.7~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-fairisle.8.6.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "3abe75300c2fbb0a8ba819a7a3813936", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 234, "avg_line_length": 42.23121387283237, "alnum_prop": 0.5528332877087325, "repo_name": "coq-bench/coq-bench.github.io", "id": "764bc7a113e4b5d87b1d69a4a1d7e6899736c555", "size": "7331", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.10.2-2.0.6/released/8.15.2/fairisle/8.6.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die mit einer Assembly verknüpft sind. [assembly: AssemblyTitle("gView.MapServer.Lib.UI")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("gView GIS")] [assembly: AssemblyProduct("gView.MapServer.Lib.UI")] [assembly: AssemblyCopyright("Copyright © gView GIS 2007")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von // COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. [assembly: ComVisible(false)] // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird [assembly: Guid("b3866361-c91f-48a3-a3ce-5b729ac98a2c")] // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: // // Hauptversion // Nebenversion // Buildnummer // Revision // // Sie können alle Werte angeben oder die standardmäßigen Revisions- und Buildnummern // übernehmen, indem Sie "*" eingeben: [assembly: AssemblyVersion("4.0.0.0")] [assembly: AssemblyFileVersion("4.0.0.0")]
{ "content_hash": "81d0134a8f46dffb39f7040f8b62f382", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 106, "avg_line_length": 42.42857142857143, "alnum_prop": 0.7643097643097643, "repo_name": "jugstalt/gViewGisOS", "id": "9bc8fc04b9b576702c6c5c997967010cabd6ed4e", "size": "1503", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gView.MapServer.Lib.UI/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "14359299" }, { "name": "CSS", "bytes": "934" }, { "name": "HTML", "bytes": "4270" }, { "name": "NSIS", "bytes": "30399" }, { "name": "Visual Basic", "bytes": "17387" }, { "name": "XSLT", "bytes": "13865" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.github.stefanliebenberg</groupId> <artifactId>presentation-guice-injection</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>com.google.inject</groupId> <artifactId>guice</artifactId> <version>3.0</version> </dependency> <dependency> <groupId>com.google.inject.extensions</groupId> <artifactId>guice-assistedinject</artifactId> <version>3.0</version> </dependency> <dependency> <groupId>com.google.inject.extensions</groupId> <artifactId>guice-multibindings</artifactId> <version>3.0</version> </dependency> <dependency> <groupId>com.sparkjava</groupId> <artifactId>spark-core</artifactId> <version>2.1</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>18.0</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.3.1</version> </dependency> <dependency> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> <version>1.3.9</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> </dependencies> </project>
{ "content_hash": "8a81e0e897845ebadc613d142e8d86ae", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 108, "avg_line_length": 35.36363636363637, "alnum_prop": 0.5778920308483291, "repo_name": "StefanLiebenberg/presentation-guice-injection", "id": "16ccc7f159ddb60922eaa02c8ad384bfc2dbc184", "size": "1945", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pom.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "17144" } ], "symlink_target": "" }
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // 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("KinectTutorial")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("KinectTutorial")] [assembly: AssemblyCopyright("Copyright © 2016")] [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)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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": "f735d5be0e3ae96a442bb04af7c6abac", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 98, "avg_line_length": 43.345454545454544, "alnum_prop": 0.7076342281879194, "repo_name": "icoxfog417/KinectTutorial", "id": "158e254b9b905fb11edce25f93c81e7517ae4a02", "size": "2387", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "KinectTutorial/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "63487" } ], "symlink_target": "" }
// ----------------------------------------------------------------------- // <copyright file="ErrorHandler.cs" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> // ----------------------------------------------------------------------- namespace Microsoft.Store.PartnerCenter.Storefront.Filters.WebApi { using System; using System.Collections.Generic; using System.Diagnostics; using System.Dynamic; using System.Net; using System.Net.Http; using System.Web; using System.Web.Http.Filters; using BusinessLogic.Exceptions; using Newtonsoft.Json; using PartnerCenter.Exceptions; /// <summary> /// A filter that handles portal errors and returns a unified error response. /// </summary> [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] public sealed class ErrorHandlerAttribute : ExceptionFilterAttribute { /// <summary> /// Intercepts unhandled exceptions and crafts the error response appropriately. /// </summary> /// <param name="actionExecutedContext">The context for the action.</param> public override void OnException(HttpActionExecutedContext actionExecutedContext) { dynamic errorResponsePayload = new ExpandoObject(); HttpStatusCode errorResponseCode = HttpStatusCode.InternalServerError; if (actionExecutedContext.Exception is PartnerDomainException partnerDomainException) { Trace.TraceError("ErrorHandler: Intercepted PartnerDomainException: {0}.", actionExecutedContext.Exception.ToString()); switch (partnerDomainException.ErrorCode) { case ErrorCode.SubscriptionNotFound: case ErrorCode.PartnerOfferNotFound: case ErrorCode.InvalidFileType: case ErrorCode.InvalidInput: case ErrorCode.MicrosoftOfferImmutable: case ErrorCode.SubscriptionExpired: case ErrorCode.InvalidAddress: case ErrorCode.DomainNotAvailable: case ErrorCode.MaximumRequestSizeExceeded: case ErrorCode.AlreadyExists: case ErrorCode.PaymentGatewayPaymentError: case ErrorCode.PaymentGatewayIdentityFailureDuringConfiguration: // treat this as a retryable bad input. errorResponseCode = HttpStatusCode.BadRequest; break; case ErrorCode.PaymentGatewayFailure: case ErrorCode.DownstreamServiceError: errorResponseCode = HttpStatusCode.BadGateway; break; default: errorResponseCode = HttpStatusCode.InternalServerError; break; } errorResponsePayload.ErrorCode = partnerDomainException.ErrorCode; errorResponsePayload.Details = partnerDomainException.Details; } else { errorResponsePayload.Details = new Dictionary<string, string>(); if (actionExecutedContext.Exception is PartnerException partnerCenterException && (partnerCenterException.ErrorCategory == PartnerErrorCategory.BadInput || partnerCenterException.ErrorCategory == PartnerErrorCategory.AlreadyExists)) { Trace.TraceError("ErrorHandler: Intercepted PartnerException: {0}.", actionExecutedContext.Exception.ToString()); errorResponseCode = HttpStatusCode.BadRequest; // can be null. if (partnerCenterException.ServiceErrorPayload != null) { switch (partnerCenterException.ServiceErrorPayload.ErrorCode) { case "27002": errorResponsePayload.ErrorCode = ErrorCode.InvalidAddress; break; case "27100": errorResponsePayload.ErrorCode = ErrorCode.DomainNotAvailable; break; default: errorResponsePayload.ErrorCode = ErrorCode.InvalidInput; PartnerDomainException tempException = new PartnerDomainException(ErrorCode.DownstreamServiceError).AddDetail("ErrorMessage", partnerCenterException.Message); errorResponsePayload.Details = tempException.Details; break; } } else { // since ServiceErrorPayload is not available. Its better to mark it as downstream service error and send the exception message. errorResponsePayload.ErrorCode = ErrorCode.DownstreamServiceError; PartnerDomainException tempException = new PartnerDomainException(ErrorCode.DownstreamServiceError).AddDetail("ErrorMessage", partnerCenterException.Message); errorResponsePayload.Details = tempException.Details; } } else { if (actionExecutedContext.Exception is HttpException httpException && httpException.WebEventCode == 3004) { // the maximum request size has been exceeded Trace.TraceError("ErrorHandler: Maximum request size exceeded: {0}.", actionExecutedContext.Exception.ToString()); errorResponseCode = HttpStatusCode.BadRequest; errorResponsePayload.ErrorCode = ErrorCode.MaximumRequestSizeExceeded; } else { // any other exception will be treated as a server failure or bug Trace.TraceError("ErrorHandler: Intercepted Exception: {0}. Returning 500 as response.", actionExecutedContext.Exception.ToString()); errorResponsePayload.ErrorCode = ErrorCode.ServerError; } } } actionExecutedContext.Response = new HttpResponseMessage(errorResponseCode) { Content = new StringContent(JsonConvert.SerializeObject(errorResponsePayload)) }; } } }
{ "content_hash": "f429fc79f973344afdbf11c953b30d84", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 201, "avg_line_length": 52.3984375, "alnum_prop": 0.5729834501267332, "repo_name": "PartnerCenterSamples/Reseller-Web-Application", "id": "6ea5b0957b92de246b12f505ab35cd3c5f40685f", "size": "6709", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Storefront/Filters/WebApi/ErrorHandlerAttribute.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "131" }, { "name": "C#", "bytes": "529659" }, { "name": "CSS", "bytes": "39026" }, { "name": "HTML", "bytes": "130994" }, { "name": "JavaScript", "bytes": "353933" }, { "name": "PowerShell", "bytes": "6813" } ], "symlink_target": "" }
require 'gherkin_lint/linter' module GherkinLint # service class to lint for avoid scripting class AvoidScripting < Linter def lint filled_scenarios do |file, feature, scenario| steps = filter_when_steps scenario[:steps] next if steps.length <= 1 references = [reference(file, feature, scenario)] add_error(references, 'Multiple Actions') end end def filter_when_steps(steps) steps = steps.drop_while { |step| step[:keyword] != 'When ' } steps = steps.reverse.drop_while { |step| step[:keyword] != 'Then ' }.reverse steps.reject { |step| step[:keyword] == 'Then ' } end end end
{ "content_hash": "db120533f6270d29cd4df4c546230c23", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 83, "avg_line_length": 30.227272727272727, "alnum_prop": 0.637593984962406, "repo_name": "funkwerk/gherkin_lint", "id": "2a2d30dc593d4cb08211ee2266814c82e6e4068e", "size": "665", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/gherkin_lint/linter/avoid_scripting.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Gherkin", "bytes": "49208" }, { "name": "Ruby", "bytes": "45691" } ], "symlink_target": "" }
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ namespace Identity; use Zend\ModuleManager\Feature\ConfigProviderInterface; class Module implements ConfigProviderInterface { public function getConfig() { return include __DIR__ . '/../config/module.config.php'; } }
{ "content_hash": "cf099fd196a9fe79bef04b9ec3e95c22", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 79, "avg_line_length": 22.736842105263158, "alnum_prop": 0.7199074074074074, "repo_name": "rifats/user-identities", "id": "5797020bb423419dd2699c0c20ba138da7eae045", "size": "432", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "module/Identity/src/Module.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "748" }, { "name": "CSS", "bytes": "1016" }, { "name": "HTML", "bytes": "41124" }, { "name": "PHP", "bytes": "131816" } ], "symlink_target": "" }
import React, { PropTypes } from 'react' import { Router } from 'react-router' import { Provider } from 'react-redux'; import dropdownManager from 'components/Dropdown/DropdownManager'; import 'styles/app.css'; class AppContainer extends React.Component { static propTypes = { history: PropTypes.object.isRequired, routes: PropTypes.object.isRequired, routerKey: PropTypes.number, store: PropTypes.object.isRequired } render () { const { history, routes, routerKey, store } = this.props return ( <Provider store={store}> <div onClick={() => dropdownManager.close()}> <Router history={history} children={routes} key={routerKey} /> </div> </Provider> ) } } export default AppContainer
{ "content_hash": "ce178bb22dd2b9b633dbc826cbd10912", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 72, "avg_line_length": 27.178571428571427, "alnum_prop": 0.6741130091984231, "repo_name": "dingchaoyan1983/ReactRedux", "id": "dfcb64893ef21551d038d7b38e9993bf7f4216bc", "size": "761", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/containers/AppContainer.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "22947" }, { "name": "HTML", "bytes": "398" }, { "name": "JavaScript", "bytes": "109804" } ], "symlink_target": "" }
import React from 'react'; import classNames from 'classnames'; // import theme from './theme/static'; import ThemeContext from './theme/context'; import ThemeSwitcher from './theme/Switcher'; import styles from './Header.css'; export default function Header() { return ( <ThemeContext.Consumer> {({ theme }) => ( <header className={classNames(styles.appHeader, styles[theme])}> <h1 className={styles.appTitle}>Exercise 16</h1> <h2 className={styles.subTitle}>React Context</h2> <div className={styles.switcherWrapper}> <ThemeSwitcher /> </div> </header> )} </ThemeContext.Consumer> ); }
{ "content_hash": "28dffb2a5f7a1a49bc542e6649f3718b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 72, "avg_line_length": 28.458333333333332, "alnum_prop": 0.6310395314787701, "repo_name": "Brandon-J-Campbell/codemash", "id": "d0162670217ddd4ac3776b568e85a075618763cf", "size": "683", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cm19/ReactJS/your-first-react-app-exercises-master/exercise-16-hooks/Header.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "33677" }, { "name": "HTML", "bytes": "1674" }, { "name": "Java", "bytes": "1423" }, { "name": "JavaScript", "bytes": "174890" }, { "name": "Jupyter Notebook", "bytes": "6395" }, { "name": "Objective-C", "bytes": "4050" }, { "name": "Python", "bytes": "8860" }, { "name": "Swift", "bytes": "556620" } ], "symlink_target": "" }
<?php namespace Kunstmaan\AdminBundle\Command; use Doctrine\ORM\EntityManager; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Security\Acl\Domain\Acl; use Symfony\Component\Security\Acl\Domain\Entry; use Symfony\Component\Security\Acl\Domain\RoleSecurityIdentity; use Symfony\Component\Security\Acl\Model\MutableAclProviderInterface; use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface; /** * Permissions update of ACL entries for all nodes for given role. */ class UpdateAclCommand extends ContainerAwareCommand { /** * {@inheritdoc} */ protected function configure() { parent::configure(); $this->setName('kuma:acl:update') ->setDescription('Permissions update of ACL entries for all nodes for given role') ->setHelp('The <info>kuma:update:acl</info> will update ACL entries for the nodes of the current project'. 'with given role and permissions'); } /** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $helper = $this->getHelper('question'); // Select Role $roles = $this->getContainer()->getParameter('security.role_hierarchy.roles'); $question = new ChoiceQuestion('Select role', array_keys($roles)); $question->setErrorMessage('Role %s is invalid.'); $role = $helper->ask($input, $output, $question); // Select Permission(s) $permissionMap = $this->getContainer()->get('security.acl.permission.map'); $question = new ChoiceQuestion( 'Select permissions(s) (separate by ",")', $permissionMap->getPossiblePermissions() ); $question->setMultiselect(true); $mask = array_reduce($helper->ask($input, $output, $question), function ($a, $b) use ($permissionMap) { return $a | $permissionMap->getMasks($b, null)[0]; }, 0); // @var EntityManager $em $em = $this->getContainer()->get('doctrine.orm.entity_manager'); // @var MutableAclProviderInterface $aclProvider $aclProvider = $this->getContainer()->get('security.acl.provider'); // @var ObjectIdentityRetrievalStrategyInterface $oidStrategy $oidStrategy = $this->getContainer()->get('security.acl.object_identity_retrieval_strategy'); // Fetch all nodes & grant access $nodes = $em->getRepository('KunstmaanNodeBundle:Node')->findAll(); foreach ($nodes as $node) { $objectIdentity = $oidStrategy->getObjectIdentity($node); /** @var Acl $acl */ $acl = $aclProvider->findAcl($objectIdentity); $securityIdentity = new RoleSecurityIdentity($role); /** @var Entry $ace */ foreach ($acl->getObjectAces() as $index => $ace) { if (!$ace->getSecurityIdentity()->equals($securityIdentity)) { continue; } $acl->updateObjectAce($index, $mask); break; } $aclProvider->updateAcl($acl); } $output->writeln(count($nodes).' nodes processed.'); } }
{ "content_hash": "ad01133df03968c21d990590de7034f2", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 118, "avg_line_length": 38.55681818181818, "alnum_prop": 0.6368994989684645, "repo_name": "hgabka/KunstmaanBundlesCMS", "id": "c51fe38d20830ff46777ecdd51894879a8cab615", "size": "3393", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Kunstmaan/AdminBundle/Command/UpdateAclCommand.php", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "46244" }, { "name": "CSS", "bytes": "468600" }, { "name": "Gherkin", "bytes": "22178" }, { "name": "HTML", "bytes": "934141" }, { "name": "Hack", "bytes": "20" }, { "name": "JavaScript", "bytes": "4087160" }, { "name": "PHP", "bytes": "2946789" }, { "name": "Ruby", "bytes": "2363" }, { "name": "Shell", "bytes": "235" } ], "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>carbon-analytics-common</artifactId> <version>5.0.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>analytics-data-agents</artifactId> <packaging>pom</packaging> <name>WSO2 Carbon - Analytics Data Agents Components Aggregator Module</name> <url>http://wso2.org</url> <modules> <module>org.wso2.carbon.analytics.common.jmx.agent</module> <module>org.wso2.carbon.analytics.common.jmx.agent.ui</module> </modules> </project>
{ "content_hash": "8ee7de229aa6a7b4d327d7d339773e68", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 206, "avg_line_length": 41.73684210526316, "alnum_prop": 0.691046658259773, "repo_name": "chanakaudaya/carbon-analytics-common", "id": "970fcdd95a3c2217fa269775fb6bc7319cd2c6cc", "size": "1586", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "components/analytics-data-agents/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "20552" }, { "name": "HTML", "bytes": "35860" }, { "name": "Java", "bytes": "3392772" }, { "name": "JavaScript", "bytes": "182430" }, { "name": "Thrift", "bytes": "6297" } ], "symlink_target": "" }
Read and write CSV in/from files and strings
{ "content_hash": "c7a52e33695579f79a28f1dd19be9509", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 44, "avg_line_length": 45, "alnum_prop": 0.8, "repo_name": "SiroDiaz/csv", "id": "7650448fd0eca93537ffaab7f4fd8c18ba6525ec", "size": "51", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "2468" } ], "symlink_target": "" }
<h1>Configuration</h1> <md-card fxLayout="column"> <app-projet appConfigProperty='projetActif' appConfigValue='{{codeProjet}}' [(codeProjet)]="codeProjet"></app-projet> <app-base-url-ice-scrum appConfigProperty='baseUrlIceScrum' appConfigValue='{{urlRest}}' [(urlRest)]="urlRest"></app-base-url-ice-scrum> <app-login-ice-scrum appConfigProperty='loginIceScrum' appConfigValue='{{loginIceScrum}}' [(loginIceScrum)]="loginIceScrum"></app-login-ice-scrum> <app-passwd-ice-scrum appConfigProperty='passwdIceScrum' appConfigValue='{{passwdIceScrum}}' [(passwdIceScrum)]="passwdIceScrum"></app-passwd-ice-scrum> </md-card> <span class="app-action"> <button md-fab (click)="sauvegarderConfig()"><md-icon>check circle</md-icon></button> </span>
{ "content_hash": "b977b72dd7447986b9d483e9fc7f578a", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 156, "avg_line_length": 75.5, "alnum_prop": 0.7364238410596027, "repo_name": "nicolasguilhem/icescrum-io", "id": "74dade29510fd2698af3df7be6e370777c93d1c2", "size": "755", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/page-config/page-config.component.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "481" }, { "name": "HTML", "bytes": "2568" }, { "name": "JavaScript", "bytes": "1646" }, { "name": "TypeScript", "bytes": "21956" } ], "symlink_target": "" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18033 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace Tutorial4.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
{ "content_hash": "9acfc5114ef0824e59f46d3657aa38cd", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 151, "avg_line_length": 36.46666666666667, "alnum_prop": 0.5648994515539305, "repo_name": "RealRui/SharpDX_Demo", "id": "b2bd2ca05a0ac7c9f8e650d532818147973b3ad1", "size": "1096", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "SharpDXTutorial/Tutorial4/Properties/Settings.Designer.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "349836" } ], "symlink_target": "" }
var Entry = require('./entry'); var Rule = require('./rule'); var defaultTTLInMilliSeconds = 60 * 1000; var LOG_PREFIX = '[middleware-cache] '; function getNormalizedTTLInMilliSeconds(options) { var ttlInSeconds = options.ttlInSeconds || 0; return options.ttl || options.ttlInMilliSeconds || (ttlInSeconds * 1000) || 0; } function validateRules(rules) { if (!Array.isArray(rules)) throw new Error('rules must be an array'); if (!rules.length) throw new Error('you must specify one or more rules'); } function createRules(options) { var ttlInMilliSeconds = getNormalizedTTLInMilliSeconds(options) || defaultTTLInMilliSeconds; validateRules(options.rules); return options.rules.map(function(rule) { rule.ttlInMilliSeconds = getNormalizedTTLInMilliSeconds(rule) || ttlInMilliSeconds; return new Rule(rule); }); } function findRule(rules, request) { if (request.method != 'GET') return null; var foundRule = null; rules.some(function(rule) { if (rule.match(request)) return foundRule = rule; }); return foundRule; } function generateKey(request) { return request.method + '\n' + request.url; } function sendCachedResponse(response, cached) { response.statusCode = cached.status; Object.keys(cached.headers).forEach(function(key) { response.setHeader(key, cached.headers[key]); }); response.setHeader('X-Droonga-Cached', 'yes'); cached.body.forEach(function(chunk) { var data = new Buffer(chunk.data); response.write(data, chunk.encoding); }); response.end(); } module.exports = function cacheMiddleware(cache, options) { var rules = createRules(options); var logger = options.logger || console; return function(request, response, next) { var rule = findRule(rules, request); if (!rule) { next(); return; } var cacheKey = generateKey(request); cache.get(cacheKey, function(error, cachedResponse) { if (error) { logger.error(LOG_PREFIX, error); return; } if (cachedResponse) { sendCachedResponse(response, cachedResponse); } else { var entry = new Entry(); entry.hook(response, function(cachedResponse) { cache.set(cacheKey, cachedResponse, rule.ttlInMilliSeconds); }); next(); } }); }; };
{ "content_hash": "24fe752b525a6961216c2711d0decd14", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 70, "avg_line_length": 24.958333333333332, "alnum_prop": 0.6494156928213689, "repo_name": "droonga/express-droonga", "id": "f53aadb502a013bcc0f903b18e22e7f2d5292b92", "size": "2396", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/middleware/cache/index.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "347" }, { "name": "Emacs Lisp", "bytes": "120" }, { "name": "HTML", "bytes": "583" }, { "name": "JavaScript", "bytes": "205577" } ], "symlink_target": "" }
package eu.aniketos.securebpmn.export.aslan.export; import java.util.ArrayList; import java.util.List; /** * This class contains utility methods that are being used in the ASLan export. * * */ public class ExportUtil { private static int permLevel = -1; /** * Generates integer partitions in anti-lexicographic order using the * algorithm ZS1 as described in Zoghbi, A. and Stojmenovic, I. * "Fast Algorithms for Generating Integer Partitions", published in 1998. * For each partition, the parts are provided in descending order. * * @param n * The integer for which the partitions should be generated. * @return A List containing the integer partitions, each represented as a * integer Array. */ public static List<int[]> generateIntegerPartitions(int n) { List<int[]> res = new ArrayList<int[]>(); int[] x = new int[n]; for (int i = 1; i <= n; i++) { x[i - 1] = 1; } x[0] = n; int m = 1; int h = 1; res.add(copySubarray(x, 0, 1)); while (x[0] != 1) { if (x[h - 1] == 2) { m = m + 1; x[h - 1] = 1; h = h - 1; } else { int r = x[h - 1] - 1; int t = m - h + 1; x[h - 1] = r; while (t >= r) { h = h + 1; x[h - 1] = r; t = t - r; } if (t == 0) { m = h; } else { m = h + 1; if (t > 1) { h = h + 1; x[h - 1] = t; } } } res.add(copySubarray(x, 0, m)); } return res; } /** * Copies a subarray of a given array and returns it. * * @param src * The source array that should be used. * @param start * The start index. * @param end * The end index. * @return A subarray of the source array, including the value at the start * index and excluding the value at the end index. */ private static int[] copySubarray(int[] src, int start, int end) { int[] res = new int[end - start]; int resPos = 0; for (int i = start; i < end; i++) { res[resPos] = src[i]; resPos++; } return res; } /** * Generates all permutations of a sequence containing the numbers from 1 to * n. * * @param n * The upper bound of the permutations. * @return A List with all permutations of the sequence. */ public static List<int[]> generateLocationPermutations(int n) { List<int[]> res = new ArrayList<int[]>(); permLevel = -1; int[] value = new int[n]; for (int i = 0; i < value.length; i++) { value[i] = 0; } permVisit(value, n, 0, res); return res; } /** * Helper method for generating the integer sequence permutations. Should * not be used on its own! * */ private static void permVisit(int[] value, int n, int k, List<int[]> res) { permLevel = permLevel + 1; value[k] = permLevel; if (permLevel == n) { res.add(copySubarray(value, 0, value.length)); } else { for (int i = 0; i < n; i++) { if (value[i] == 0) permVisit(value, n, i, res); } } permLevel = permLevel - 1; value[k] = 0; } }
{ "content_hash": "6555d42b87aac692466473a5aa160b23", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 80, "avg_line_length": 26.421768707482993, "alnum_prop": 0.4389804325437693, "repo_name": "adbrucker/SecureBPMN", "id": "2738dea1e378bbe06002c5e2733d67fb0ac9c851", "size": "4488", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "designer/src/eu.aniketos.securebpmn.export.aslan/src/main/java/eu/aniketos/securebpmn/export/aslan/export/ExportUtil.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "10739" }, { "name": "Batchfile", "bytes": "388" }, { "name": "CSS", "bytes": "25050" }, { "name": "GAP", "bytes": "7182" }, { "name": "HTML", "bytes": "106052" }, { "name": "Java", "bytes": "16045621" }, { "name": "JavaScript", "bytes": "84216" }, { "name": "PLpgSQL", "bytes": "1606" }, { "name": "SQLPL", "bytes": "4516" }, { "name": "Shell", "bytes": "515" }, { "name": "XSLT", "bytes": "10788" } ], "symlink_target": "" }
// // G8ViewController.m // Template Framework Project // // Created by Daniele on 14/10/13. // Copyright (c) 2013 Daniele Galiotto - www.g8production.com. // All rights reserved. // #import "G8ViewController.h" @interface G8ViewController () @property (nonatomic, strong) NSOperationQueue *operationQueue; @end /** * For more information about using `G8Tesseract`, visit the GitHub page at: * https://github.com/gali8/Tesseract-OCR-iOS */ @implementation G8ViewController - (void)viewDidLoad { [super viewDidLoad]; // Create a queue to perform recognition operations self.operationQueue = [[NSOperationQueue alloc] init]; } -(void)recognizeImageWithTesseract:(UIImage *)image { // Animate a progress activity indicator [self.activityIndicator startAnimating]; // Create a new `G8RecognitionOperation` to perform the OCR asynchronously // It is assumed that there is a .traineddata file for the language pack // you want Tesseract to use in the "tessdata" folder in the root of the // project AND that the "tessdata" folder is a referenced folder and NOT // a symbolic group in your project G8RecognitionOperation *operation = [[G8RecognitionOperation alloc] initWithLanguage:@"eng"]; // Use the original Tesseract engine mode in performing the recognition // (see G8Constants.h) for other engine mode options operation.tesseract.engineMode = G8OCREngineModeTesseractOnly; // Let Tesseract automatically segment the page into blocks of text // based on its analysis (see G8Constants.h) for other page segmentation // mode options operation.tesseract.pageSegmentationMode = G8PageSegmentationModeAutoOnly; // Optionally limit the time Tesseract should spend performing the // recognition //operation.tesseract.maximumRecognitionTime = 1.0; // Set the delegate for the recognition to be this class // (see `progressImageRecognitionForTesseract` and // `shouldCancelImageRecognitionForTesseract` methods below) operation.delegate = self; // Optionally limit Tesseract's recognition to the following whitelist // and blacklist of characters //operation.tesseract.charWhitelist = @"01234"; //operation.tesseract.charBlacklist = @"56789"; // Set the image on which Tesseract should perform recognition operation.tesseract.image = image; // Optionally limit the region in the image on which Tesseract should // perform recognition to a rectangle //operation.tesseract.rect = CGRectMake(20, 20, 100, 100); // Specify the function block that should be executed when Tesseract // finishes performing recognition on the image operation.recognitionCompleteBlock = ^(G8Tesseract *tesseract) { // Fetch the recognized text NSString *recognizedText = tesseract.recognizedText; NSLog(@"%@", recognizedText); // Remove the animated progress activity indicator [self.activityIndicator stopAnimating]; UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"OCR Result" message:recognizedText preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *alertAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { }]; [alertController addAction:alertAction]; [self presentViewController:alertController animated:true completion:nil]; }; // Display the image to be recognized in the view self.imageToRecognize.image = operation.tesseract.thresholdedImage; // Finally, add the recognition operation to the queue [self.operationQueue addOperation:operation]; } /** * This function is part of Tesseract's delegate. It will be called * periodically as the recognition happens so you can observe the progress. * * @param tesseract The `G8Tesseract` object performing the recognition. */ - (void)progressImageRecognitionForTesseract:(G8Tesseract *)tesseract { NSLog(@"progress: %lu", (unsigned long)tesseract.progress); } /** * This function is part of Tesseract's delegate. It will be called * periodically as the recognition happens so you can cancel the recogntion * prematurely if necessary. * * @param tesseract The `G8Tesseract` object performing the recognition. * * @return Whether or not to cancel the recognition. */ - (BOOL)shouldCancelImageRecognitionForTesseract:(G8Tesseract *)tesseract { return NO; // return YES, if you need to cancel recognition prematurely } - (IBAction)openCamera:(id)sender { UIImagePickerController *imgPicker = [UIImagePickerController new]; imgPicker.delegate = self; if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera; [self presentViewController:imgPicker animated:YES completion:nil]; } } - (IBAction)recognizeSampleImage:(id)sender { [self recognizeImageWithTesseract:[UIImage imageNamed:@"image_sample"]]; } - (IBAction)clearCache:(id)sender { [G8Tesseract clearCache]; } #pragma mark - UIImagePickerController Delegate - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *image = info[UIImagePickerControllerOriginalImage]; [picker dismissViewControllerAnimated:YES completion:nil]; [self recognizeImageWithTesseract:image]; } @end
{ "content_hash": "f5a11d4832e834b0e96b99a0c43bd12e", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 170, "avg_line_length": 35.46496815286624, "alnum_prop": 0.7359913793103449, "repo_name": "gali8/Tesseract-OCR-iOS", "id": "03af92c499249c324461ce762bdf11d263fecaee", "size": "5568", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Template Framework Project/Template Framework Project/G8ViewController.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "840336" }, { "name": "C++", "bytes": "591194" }, { "name": "Makefile", "bytes": "7266" }, { "name": "Objective-C", "bytes": "236921" }, { "name": "Objective-C++", "bytes": "40925" }, { "name": "Python", "bytes": "4106" }, { "name": "Ruby", "bytes": "5315" }, { "name": "Shell", "bytes": "136" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "2b5d88a54c0237fd9330a863e0e6ff4b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "86f34d5558ed5fc9ddcc4fbd8125092042701fd6", "size": "180", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Lamiaceae/Mentha/Mentha sarntheinii/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
'use strict'; var cores = require('./solrCores'); var axios = require('axios'); var _ = require('lodash'); var Q = require('q'); function geneSearch(query) { var coreName = 'genes'; var url = cores.getUrlForCore(coreName); var params = getSolrParameters(query); return axios.get(url, {params: params}) .then(reformatData(coreName)); } function suggest(queryString) { var coreRequests = cores.coreNames().map(function(coreName) { var url = cores.getSuggestUrl(coreName); var params = cores.getSuggestParams(coreName,queryString); return axios.get(url, {params: params}); }); return axios.all(coreRequests) .then(function(coreResponses) { var data = []; var coreNames = cores.coreNames(); for(var i=0; i<coreNames.length; i++) { data.push({ label: cores.getCoreDisplayName(coreNames[i]), suggestions: cores.handleSuggestResponse(coreNames[i], coreResponses[i], queryString) }); } return data; }); } function coreLookup(coreName,ids,userParams) { var url = 'http://data.gramene.org/' + coreName + '/select'; var idList; if (Array.isArray(ids)) { idList = _.uniq(ids); } else { idList = [ids]; } var queryField = '_id'; var p = _.cloneDeep(userParams); if (!p) p={}; if (p.field) { queryField = p.field; delete p.field; } if (p.fl && !_.includes(p.fl,queryField)) { p.fl.push(queryField); p.fl = p.fl.join(','); } // idList may be too long, so we split into batches var batchSize=100; var promises = []; var offset=0; var lut={}; while (offset < idList.length) { var params = { rows:-1 // because batchSize might be < number of matched docs }; params[queryField] = idList.slice(offset,offset+batchSize); for(var f in p) { params[f] = p[f]; } offset += batchSize; promises.push(axios.get(url, {params: params}) .then(function(response) { response.data.response.forEach(function(doc) { var k = doc[queryField]; delete doc[queryField]; if (lut[k]) { lut[k].push(doc); } else { lut[k] = [doc]; } }); })); } return axios.all(promises).then(function() { return lut; }); } function testSearch(example) { return Q(_.cloneDeep(require('../spec/support/searchResult')[example])) .then(reformatData('genes')); } function defaultSolrParameters() { return { q: '*', rows: 0, facet: true }; } function getSolrParameters(query) { var result = defaultSolrParameters(); if(!query) return result; result.q = (query.q || '') + '*'; for(var rtName in query.resultTypes) { _.assign(result, query.resultTypes[rtName], function(existing, another) { var result = existing; // handle the case where the same key may be defined in many result types, for example // facet.field. It's typical for solr to have multiple facet.field parameters in the URL, // e.g. http://data.gramene.org/search/genes?wt=json&indent=true&q=*&rows=2&start=0&facet=true&facet.field=bin_10Mb&facet.field=bin_5Mb&facet.limit=10&facet.mincount=1&f.bin_10Mb.facet.limit=10&fq=Interpro_xrefs:(IPR008978 IPR002068) if(existing) { if(_.isArray(existing)) { existing.push(another); result = existing; } else { result = [existing, another]; } } else { result = another; } return result; }); } if(query.filters && Object.keys(query.filters).length) { result.fq = Object.keys(query.filters); } return result; } function reformatData(core) { return function(response) { var data = response.data; var fixed = {}; if (data.facet_counts) { var originalFacets = data.facet_counts.facet_fields; if(originalFacets && !data.results) { fixed = data.results = {}; for(var f in originalFacets) { fixed[f] = reformatFacet(originalFacets[f], cores.valuesAreNumeric(core,f), cores.getXrefDisplayName(core,f)); } delete data.facet_counts; } } if(data.response.docs.length) { fixed.list = data.response.docs; } fixed.metadata = { count: data.response.numFound, qtime: data.responseHeader.QTime }; if (data.facets) { fixed.tally={}; for(var f in data.facets) { fixed.tally[f] = data.facets[f]; } } return fixed; } } function reformatFacet(facetData, numericIds, displayName) { // facet data is an array of alternating ids (string) and counts (int), // e.g. ["4565", 99155, "3847", 54159, "109376", 46500, ... ] // we will make an associative array with id key and an object // for count and other values that may be added later. // e.g. { data : { "4565" : { count : 99155 }, // order here not guaranteed :-( // "3847" : { count: 54159 }, // "109376" : { count: 46500 } // } // } var result = {data: {}, sorted: [], count: 0, displayName: displayName}; for (var i=0;i<facetData.length;i+=2) { var id = numericIds ? parseInt(facetData[i]) : facetData[i] , count = facetData[i+1] , datum = { id: id, count: count }; result.data[id] = datum; result.sorted.push(datum); if(count > 0) result.count++; } return result; } exports.geneSearch = geneSearch; exports._testSearch = testSearch; exports.suggest = suggest; exports.coreLookup = coreLookup;
{ "content_hash": "4b7ee3f9ca7b29532cc0497e70109734", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 239, "avg_line_length": 27.13235294117647, "alnum_prop": 0.601806684733514, "repo_name": "ajo2995/gramene-search-client", "id": "68a76c27e3f45ecfcee969e5c7bbd85571201e31", "size": "5535", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/searchInterface.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "102137" } ], "symlink_target": "" }
from uuid import uuid4 from diesel import wait, fire from collections import defaultdict from diesel.events import Waiter, StopWaitDispatch class Lock(Waiter): def __init__(self, count=1): self.count = count def acquire(self): if self.count == 0: wait(self) else: self.count -= 1 def release(self): self.count += 1 fire(self) def __enter__(self): self.acquire() def __exit__(self, *args, **kw): self.release() @property def is_locked(self): return self.count == 0 def ready_early(self): return not self.is_locked def process_fire(self, value): if self.count == 0: raise StopWaitDispatch() self.count -= 1 return value class SynchronizeDefault(object): pass _sync_locks = defaultdict(Lock) def synchronized(key=SynchronizeDefault): return _sync_locks[key]
{ "content_hash": "cfafa98173f92fab2dd25453742ca655", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 50, "avg_line_length": 20.866666666666667, "alnum_prop": 0.597444089456869, "repo_name": "dieseldev/diesel", "id": "71d0c8fbe9767985c552d46d7bdb7eaf921bb90d", "size": "939", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "diesel/util/lock.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Makefile", "bytes": "252" }, { "name": "Protocol Buffer", "bytes": "9279" }, { "name": "Python", "bytes": "345729" } ], "symlink_target": "" }
<?php if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 1800)) { // last request was more than 30 minutes ago session_unset(); // unset $_SESSION variable for the run-time session_destroy(); // destroy session data in storage } $_SESSION['LAST_ACTIVITY'] = time(); function logged_in() { return (isset($_SESSION['_iiita_cms_username_'])); } function confirm_logged_in() { if(!logged_in()) { //header("Location:/cms"); } } ?>
{ "content_hash": "963954b8d127e201edbbcf5dff5f8894", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 89, "avg_line_length": 25.894736842105264, "alnum_prop": 0.6077235772357723, "repo_name": "GDGAllahabad/Website-EffervescenceMMXIV", "id": "5750621b6d424d75160d119f266ab477a7363c75", "size": "492", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "slow/register/models/session.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1665580" }, { "name": "HTML", "bytes": "1921839" }, { "name": "JavaScript", "bytes": "1704965" }, { "name": "PHP", "bytes": "1118846" } ], "symlink_target": "" }
<?xml version="1.0" encoding="iso-8859-1"?> <!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" xml:lang="en" lang="en"> <head> <title>File: util.rb</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="fileHeader"> <h1>util.rb</h1> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Path:</strong></td> <td>kwalify/util.rb </td> </tr> <tr class="top-aligned-row"> <td><strong>Last Update:</strong></td> <td>Sat Jul 17 14:31:52 +0900 2010</td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> <div id="description"> <p> $Rev$ $Release: 0.7.2 $ copyright(c) 2005-2010 kuwata-lab all rights reserved. </p> </div> </div> </div> <!-- if includes --> <div id="section"> <!-- if method_list --> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>
{ "content_hash": "18f3655a605b854ca2b3fef8a61fcfd9", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 102, "avg_line_length": 19.822429906542055, "alnum_prop": 0.5855728429985856, "repo_name": "CenturyLinkLabs/kwalify", "id": "e8b591cb31a7967a6225996ce3ab496bf2fcd90b", "size": "2121", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "doc-api/files/kwalify/util_rb.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6863" }, { "name": "Java", "bytes": "1835" }, { "name": "Makefile", "bytes": "938" }, { "name": "Ruby", "bytes": "341448" } ], "symlink_target": "" }
package org.frameworkset.util.annotations; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * <p>Title: Attribute.java</p> * <p>Description: </p> * <p>bboss workgroup</p> * <p>Copyright (c) 2008</p> * @Date 2010-10-27 * @author biaoping.yin * @version 1.0 */ @Target({ElementType.PARAMETER,ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Attribute { String locale() default ""; String name() default ""; boolean required() default false; String editor() default ""; AttributeScope scope() default AttributeScope.REQUEST_ATTRIBUTE; String defaultvalue() default ValueConstants.DEFAULT_NONE; /** * 指定日期格式 * @return */ String dateformat() default ValueConstants.DEFAULT_NONE; }
{ "content_hash": "16ab4aaa86181d44a59d51f0992601aa", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 65, "avg_line_length": 26.352941176470587, "alnum_prop": 0.7433035714285714, "repo_name": "bbossgroups/bbossgroups-3.5", "id": "7f97f125b8951ed345c98ed8bb35daa62e45a45e", "size": "1513", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "bboss-core-entity/src/org/frameworkset/util/annotations/Attribute.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2144" }, { "name": "C", "bytes": "227968" }, { "name": "CSS", "bytes": "1961" }, { "name": "FreeMarker", "bytes": "13875" }, { "name": "HTML", "bytes": "151852" }, { "name": "Java", "bytes": "19737353" }, { "name": "JavaScript", "bytes": "73606" }, { "name": "PLSQL", "bytes": "2684" }, { "name": "Shell", "bytes": "2970" } ], "symlink_target": "" }
get '/users/new' do if params[:errors] @errors = params[:errors] binding.pry end erb :'users/new' end post '/users' do @user = User.new(first_name: params[:first_name], last_name: params[:last_name], email: params[:email], password_hash: nil) @user.password = params[:password] if @user.save && (params[:password] != "") session[:user_id] = @user.id redirect '/' else @errors = @user.errors.full_messages if params[:password] == "" @errors << "Password can't be blank" end erb :'users/new' end end get "/userprofile" do erb :'users/show' end
{ "content_hash": "06e2db213b1341786ff3b40c8b0d714e", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 125, "avg_line_length": 21.5, "alnum_prop": 0.6179401993355482, "repo_name": "nyc-chorus-frogs-2016/THE-REAL-CHORUS-FOXES", "id": "87d052f35bbd1c7275792e37222fd74cae453fcc", "size": "602", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/user.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "9213" }, { "name": "HTML", "bytes": "10873" }, { "name": "JavaScript", "bytes": "283" }, { "name": "Ruby", "bytes": "19080" } ], "symlink_target": "" }
function Do-Thing { param() throw 'I have been thrown' } describe 'Exception testing demo' { it 'throws an exception' { { Do-Thing } | should throw } it 'throws a specific exception message' { { Do-Thing } | should throw 'notright' } }
{ "content_hash": "570509cfcbd87529f123a85a0a331e3a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 43, "avg_line_length": 14.11111111111111, "alnum_prop": 0.6456692913385826, "repo_name": "kidchenko/playground", "id": "da43f5ca290ecf98286e94bd1c5a8226b25f9c89", "size": "254", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "powershell-testing-powerShell-with-pester/Demos/Callouts/TestingExceptions.ps1", "mode": "33188", "license": "mit", "language": [ { "name": "ABAP", "bytes": "8568" }, { "name": "ASP.NET", "bytes": "98" }, { "name": "Ada", "bytes": "7270" }, { "name": "Batchfile", "bytes": "12383" }, { "name": "C", "bytes": "9517" }, { "name": "C#", "bytes": "1171050" }, { "name": "C++", "bytes": "728997" }, { "name": "CMake", "bytes": "9116" }, { "name": "COBOL", "bytes": "4067" }, { "name": "CSS", "bytes": "66432" }, { "name": "Common Lisp", "bytes": "11582" }, { "name": "D", "bytes": "4258" }, { "name": "Dart", "bytes": "2148" }, { "name": "Dockerfile", "bytes": "13639" }, { "name": "Elixir", "bytes": "4570" }, { "name": "Elm", "bytes": "2363" }, { "name": "Erlang", "bytes": "6106" }, { "name": "F#", "bytes": "8361" }, { "name": "Fortran", "bytes": "5005" }, { "name": "Gherkin", "bytes": "203" }, { "name": "Go", "bytes": "5312" }, { "name": "Groovy", "bytes": "4478" }, { "name": "HTML", "bytes": "358425" }, { "name": "Haskell", "bytes": "3880" }, { "name": "Java", "bytes": "615231" }, { "name": "JavaScript", "bytes": "6232832" }, { "name": "Kotlin", "bytes": "86837" }, { "name": "LFE", "bytes": "7144" }, { "name": "Makefile", "bytes": "3689" }, { "name": "OCaml", "bytes": "343" }, { "name": "PHP", "bytes": "5219" }, { "name": "PLSQL", "bytes": "3927" }, { "name": "PLpgSQL", "bytes": "11008" }, { "name": "Pascal", "bytes": "16226" }, { "name": "Perl", "bytes": "4384" }, { "name": "PowerShell", "bytes": "133352" }, { "name": "Python", "bytes": "12507" }, { "name": "R", "bytes": "3160" }, { "name": "Raku", "bytes": "3281" }, { "name": "Ruby", "bytes": "3370" }, { "name": "Rust", "bytes": "3871" }, { "name": "SCSS", "bytes": "8375" }, { "name": "Scala", "bytes": "3454" }, { "name": "Scheme", "bytes": "5368" }, { "name": "Shell", "bytes": "13402" }, { "name": "Smalltalk", "bytes": "8897" }, { "name": "Smarty", "bytes": "3440" }, { "name": "Standard ML", "bytes": "191" }, { "name": "Swift", "bytes": "4487" }, { "name": "TypeScript", "bytes": "202420" }, { "name": "Visual Basic .NET", "bytes": "5245" }, { "name": "Vue", "bytes": "1985" }, { "name": "XSLT", "bytes": "19568" } ], "symlink_target": "" }
module Api.Auth ( logUserIn, authorize ) where import DB import Web.Scotty import Auth import qualified Data.Text.Lazy as TL import Database.PostgreSQL.Simple import Types import Control.Monad.Trans.Maybe import Control.Monad.IO.Class import Control.Monad.Trans.Class import Data.Either import Control.Monad import Network.HTTP.Types.Status import qualified Data.ByteString.Lazy.Char8 as L {-| Attempts to log in using given credentials -} logUserIn :: Connection -> Credentials -> MaybeT IO Token logUserIn conn (Credentials user passwd) = do ok <- lift $ fmap fromOnly $ checkValVal conn (TL.pack user) (TL.pack passwd) checkCredentialsQuery guard (ok == 1) jwk <- lift $ readJWK "key.json" signed <- lift $ signUser jwk user guard (isRight signed) let Right token = signed return $ Token $ L.unpack token authorizeUser :: Maybe TL.Text -> MaybeT IO String authorizeUser auth' = do auth <- MaybeT . return $ fmap TL.unpack auth' let token = L.pack . unwords . tail . words $ auth jwk <- lift $ readJWK "key.json" verified <- lift $ verifyUser jwk token "" guard (isRight verified) return "stub" {-| Attempts to authorize user and sets response status accordingly -} authorize :: ActionM () -> ActionM () authorize success = do auth <- header (TL.pack "Authorization") :: ActionM (Maybe TL.Text) r <- liftIO $ runMaybeT $ do authorizeUser auth case r of Nothing -> status status401 Just c -> success
{ "content_hash": "ef1482c7fe948bbd6393a9739d2c5ded", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 74, "avg_line_length": 27.11111111111111, "alnum_prop": 0.7185792349726776, "repo_name": "maciejspychala/haskell-server", "id": "6076b15baa9e34110ec084cfd25919598af95323", "size": "1464", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Api/Auth.hs", "mode": "33188", "license": "mit", "language": [ { "name": "Haskell", "bytes": "33019" }, { "name": "PLpgSQL", "bytes": "4435" }, { "name": "Shell", "bytes": "47" } ], "symlink_target": "" }
package sun.bob.mcalendar.utils; import android.text.format.Time; import com.android.calendarcommon2.DateException; import com.android.calendarcommon2.RecurrenceProcessor; import com.android.calendarcommon2.RecurrenceSet; import java.util.ArrayList; import java.util.Date; import java.util.TimeZone; import sun.bob.mcalendar.beans.TaskBean; import sun.bob.mcalendar.constants.Constants; import sun.bob.mcalendarview.vo.DateData; /** * Created by bob.sun on 15/10/23. */ public class RecurrenceUtil { public static ArrayList<TaskBean> getAllRecurrence(TaskBean taskBean, DateData start, DateData end){ ArrayList<TaskBean> ret = new ArrayList<>(); RecurrenceSet rule = new RecurrenceSet( taskBean.getrRule(), taskBean.getrDate(), taskBean.getExRule(), taskBean.getExDate() ); RecurrenceProcessor processor = new RecurrenceProcessor(); Time time = new Time(TimeZone.getDefault().getID()); time.set(taskBean.getStartDateLong()); long[] result = null; try { result = processor.expand( time, rule, TimeStampUtil.toUnixLong(start), TimeStampUtil.toUnixLong(end)); } catch (DateException e) { e.printStackTrace(); return ret; } TaskBean toAdd; DateData timeData; int hour, minute; hour = taskBean.getEndDate().getHour(); minute = taskBean.getEndDate().getMinute(); for (long l : result){ toAdd = new TaskBean().populate(taskBean); toAdd.setStartDate(new Long(l).toString()); timeData = TimeStampUtil.toDateData(l); timeData.setHour(hour); timeData.setMinute(minute); toAdd.setEndDate(TimeStampUtil.toUnixTimeStamp(timeData)); ret.add(toAdd); } return ret; } public static TaskBean populateRRule(TaskBean taskBean, int which){ switch (which){ case Constants.RRULE_DAILY: taskBean.setrRule("FREQ=DAILY"); break; case Constants.RRULE_WEEKLY: taskBean.setrRule("FREQ=WEEKLY"); break; case Constants.RRULE_MONTHLY: taskBean.setrRule("FREQ=MONTHLY"); break; case Constants.RRULE_YEARLY: taskBean.setrRule("FREQ=YEARLY"); break; default: taskBean.setrRule(""); } return taskBean; } }
{ "content_hash": "348a55b32024874263afcd182a78f63d", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 104, "avg_line_length": 33.139240506329116, "alnum_prop": 0.5893812070282658, "repo_name": "oong/OCR_ADDON", "id": "62d8d147023c63c50cca9f66a2b854d855150495", "size": "2618", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/src/main/java/sun/bob/mcalendar/utils/RecurrenceUtil.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "545475" } ], "symlink_target": "" }
package org.apache.activemq.artemis.tests.integration.addressing; import java.util.HashSet; import java.util.Set; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.RoutingType; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Before; import org.junit.Test; public class AddressConfigTest extends ActiveMQTestBase { protected ActiveMQServer server; @Override @Before public void setUp() throws Exception { super.setUp(); Configuration configuration = createDefaultInVMConfig(); server = createServer(true, configuration); server.start(); } @Test public void persistAddressConfigTest() throws Exception { server.createQueue(SimpleString.toSimpleString("myAddress"), RoutingType.MULTICAST, SimpleString.toSimpleString("myQueue"), null, true, false); server.stop(); server.start(); AddressInfo addressInfo = server.getAddressInfo(SimpleString.toSimpleString("myAddress")); assertNotNull(addressInfo); Set<RoutingType> routingTypeSet = new HashSet<>(); routingTypeSet.add(RoutingType.MULTICAST); assertEquals(routingTypeSet, addressInfo.getRoutingTypes()); } }
{ "content_hash": "1891a6b5116582f064f528078f0a62ea", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 149, "avg_line_length": 34.23809523809524, "alnum_prop": 0.7642559109874826, "repo_name": "willr3/activemq-artemis", "id": "3e285cfd21d603893dfd60b44e91c954418f8124", "size": "2243", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressConfigTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "11634" }, { "name": "C", "bytes": "26484" }, { "name": "C++", "bytes": "1197" }, { "name": "CMake", "bytes": "4260" }, { "name": "CSS", "bytes": "11732" }, { "name": "HTML", "bytes": "19329" }, { "name": "Java", "bytes": "23829073" }, { "name": "Shell", "bytes": "34875" } ], "symlink_target": "" }
var life : float; private var destroyTime : float; function Start(){ destroyTime = Time.time + life; } function Update () { if(Time.time > destroyTime){ Destroy(gameObject); } if(Time.time > destroyTime - particleEmitter.maxEnergy){ particleEmitter.emit = false; } }
{ "content_hash": "ad6999879f98ac8873b7f938f48047fd", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 57, "avg_line_length": 18.466666666666665, "alnum_prop": 0.703971119133574, "repo_name": "HELZ47/TestingCode", "id": "bdf2df1d744cd35b8851ceda0209daa382f85949", "size": "277", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Unity_Networking_Test/Assets/Assets Not In Use/Cartoon Soldier/Scripts/Misc/particleAutoDestroy.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "355947" }, { "name": "C", "bytes": "3246" }, { "name": "C#", "bytes": "129412" }, { "name": "HTML", "bytes": "3334" }, { "name": "JavaScript", "bytes": "136457" } ], "symlink_target": "" }
/* eslint-disable max-nested-callbacks */ const Config = require('../src/setup/Config'); const Original = { rc: require('./helpers/config_rc.json'), config: require('../config/default.js'), }; function testConfig(obj) { return Object.assign( { configFolder: './spec/helpers', rc: './spec/helpers/config_rc.json', }, obj ); } describe('config', () => { it('should export a function', () => { expect(typeof Config).toBe('function'); }); it('should return an object', () => { const result = new Config(testConfig()); expect(typeof result).toBe('object'); }); it('should take custom options', () => { const result = new Config( testConfig({ test: true, }) ); expect(result.test).toBe(true); }); it('should not throw an error if there is no valid rc file', () => { expect(() => { new Config({ rc: 'does-not-exist.json', }); }).not.toThrow(); }); it('should read from the default config', () => { const result = new Config(testConfig()); expect(result.port).toBe(Original.config.port); }); it('should read from the a custom rc file', () => { const result = new Config(testConfig()); expect(result.env).toBe(Original.rc.env); }); it('should not throw an error if the machine config does not exist', () => { expect(() => { const result = new Config({ rc: './spec/helpers/missing.json', }); expect(typeof result).toBe('object'); }).not.toThrow(); }); it('should not throw an error if the environment config does not exist', () => { expect(() => { const result = new Config( testConfig({ env: 'does-not-exist', }) ); expect(typeof result).toBe('object'); }).not.toThrow(); }); it('should throw an error if the environment config has an error', () => { expect(() => { const result = new Config( testConfig({ configFolder: './spec/helpers/errors', env: 'TestErrorConfig', }) ); expect(typeof result).toBe('object'); }).toThrow(); }); it('should throw an error if the environment config does not return an object', () => { expect(() => { const result = new Config( testConfig({ configFolder: './spec/helpers/errors', env: 'TestErrorReturnUndefined', }) ); expect(typeof result).toBe('object'); }).toThrow(); }); it('should import a webpack config if it can find it', () => { const result = new Config( testConfig({ env: 'client', }) ); const mockWebpackConfig = require('./helpers/webpack.client'); expect(typeof result.webpackConfig).toBe('object'); expect(result.webpackConfig.entry).toBe(mockWebpackConfig.entry); }); it('should let accept additional config in its second argument', () => { expect(() => { const expectedPort = 4000; const result = new Config(undefined, { port: expectedPort, }); expect(new Config().port).not.toBe(expectedPort); expect(result.port).toBe(expectedPort); }).not.toThrow(); }); it('should deeply merge environment config over the default config', () => { expect(() => { const expectedValue = 'test-value'; const spy = jest.spyOn(Config.prototype, 'requireConfig').mockImplementation(env => { if (env === 'test') { return { env, nested: { value: expectedValue, }, }; } return { env, nested: { value: 'the-wrong-value', }, }; }); const result = new Config({ env: 'test', }); expect(spy).toHaveBeenCalled(); expect(result.nested.value).toBe(expectedValue); spy.mockClear(); }).not.toThrow(); }); });
{ "content_hash": "83127445e2f99b572766eabd4686ffac", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 91, "avg_line_length": 25.568627450980394, "alnum_prop": 0.5518916155419223, "repo_name": "isuttell/ceres-framework", "id": "3eaa66ab0a4ef6823254a68de59122d128102028", "size": "3912", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/config_spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1153" }, { "name": "JavaScript", "bytes": "130282" } ], "symlink_target": "" }
using System; using System.Reactive; namespace Qactive { public static class NotificationKindExtensions { internal static QbservableProtocolMessageKind AsMessageKind(this NotificationKind kind) { switch (kind) { case NotificationKind.OnNext: return QbservableProtocolMessageKind.OnNext; case NotificationKind.OnCompleted: return QbservableProtocolMessageKind.OnCompleted; case NotificationKind.OnError: return QbservableProtocolMessageKind.OnError; default: throw new ArgumentOutOfRangeException("kind"); } } } }
{ "content_hash": "92d20a657ecdcf1005796f27feae9d34", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 91, "avg_line_length": 27.08695652173913, "alnum_prop": 0.7030497592295345, "repo_name": "RxDave/Qactive", "id": "7a8a37a78723bcac483cb281fe1ced644ed270eb", "size": "625", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/Qactive/NotificationKindExtensions.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "720128" }, { "name": "Smalltalk", "bytes": "13108" } ], "symlink_target": "" }
declare module 'react-fast-compare' { const isEqual: (a: any, b: any) => boolean export default isEqual }
{ "content_hash": "844a367195c3cc8a0fa03a53881c6fc5", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 44, "avg_line_length": 27.5, "alnum_prop": 0.6909090909090909, "repo_name": "cdnjs/cdnjs", "id": "1f6bb46f03b9dec6363a36b879f47bcc593e7db7", "size": "110", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "ajax/libs/react-fast-compare/3.0.1/index.d.ts", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
require 'test_helper' class LanguagesHelperTest < ActionView::TestCase end
{ "content_hash": "51e53ce14a765a66b171c1d2bef81dd7", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 48, "avg_line_length": 19, "alnum_prop": 0.8157894736842105, "repo_name": "mcelliott/i18n_form_helper", "id": "3bc9dd9d0d6490beb033da4ea2c14d1e2233077f", "size": "76", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "test/dummy/test/unit/helpers/languages_helper_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "674" }, { "name": "JavaScript", "bytes": "746" }, { "name": "Ruby", "bytes": "54199" } ], "symlink_target": "" }
Please make sure you know common [Glossary](/documentation/about/GLOSSARY) and [SpEL](../scenarios_authoring/Spel.md) (especially the Data types section) before proceeding further. This part of the documentation describes various ways of customizing Nussknacker - from adding own Components to adding listeners for various Designer actions. The main way of adding customizations to Nussknacker is [ServiceLoader](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ServiceLoader.html) **Please make sure to put jars with custom code on right classpath** - Customizations of model (in particular `ComponentProviders`) can be loaded by adding libs/classes to dedicated `components/common/extra`, `components/lite/extra` or `components/flink/extra` directory. For advanced usages, you can configure `modelConfig.classPath` in [Model config](../installation_configuration_guide/Configuration). - Code of Designer customizations should go to the main designer classpath (e.g. put the jars in the `lib` folder) ## Types Types of expressions are based on Java types. Nussknacker provides own abstraction of type, which can contain more information about given type than pure Java class - e.g. object type (like in [Typescript](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#object-types)) is represented in runtime as Java `Map`, but during compilation we know the structure of this map. We also handle union types (again, similar to [Typescript](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)) and we have `Unknown` type which is represented as Java `Object` in runtime, but behaves a bit like [Typescript any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any) (please note that `Unknown` should be avoided as default [Security settings](./Security) settings prohibit omitting typechecking with `Unknown`. `TypingResult` is the main class (sealed trait) that represents type of expression in Nussknacker. `Typed` object has many methods for constructing `TypingResult` ## Components and ComponentProviders [Components](https://nussknacker.io/documentation/about/GLOSSARY#component) are main method of customizing Nussknacker. Components are created by configured `ComponentProvider` instances. There are following types of components: - `SourceFactory` - `SinkFactory` - `CustomStreamTransformer` - types of transformations depend on type of Engine - `Service` - mainly for defining stateless enrichments To read more see [ComponentProvider API](./Components) ## Deployment of scenarios The Designer uses [DeploymentManager](https://github.com/TouK/nussknacker/blob/staging/designer/deployment-manager-api/src/main/scala/pl/touk/nussknacker/engine/api/deployment/DeploymentManager.scala) interface to perform actions on scenarios (deploy / cancel / etc.). All providers that are available in distribution deployment are located in `managers` directory and are added to the designer classpath. If you want to implement own `DeploymentManager`, you should implement this interface, package it, add to classpath and configure scenario type to use it. More info you can find on [DeploymentManagerConfiguration page](../installation_configuration_guide/DeploymentManagerConfiguration) ## Other SPIs for Nussknacker customization (documentation will follow soon...) ### Model customization - Flink specific - [TypingResultAwareTypeInformationCustomisation](https://github.com/TouK/nussknacker/blob/staging/engine/flink/components-api/src/main/scala/pl/touk/nussknacker/engine/flink/api/typeinformation/TypingResultAwareTypeInformationCustomisation.scala) - [TypeInformationDetection](https://github.com/TouK/nussknacker/blob/staging/engine/flink/components-api/src/main/scala/pl/touk/nussknacker/engine/flink/api/typeinformation/TypeInformationDetection.scala) - [FlinkEspExceptionConsumerProvider](https://github.com/TouK/nussknacker/blob/staging/engine/flink/extensions-api/src/main/scala/pl/touk/nussknacker/engine/flink/api/exception/FlinkEspExceptionConsumer.scala) - [SerializersRegistrar](https://github.com/TouK/nussknacker/blob/staging/engine/flink/extensions-api/src/main/scala/pl/touk/nussknacker/engine/flink/api/serialization/SerializersRegistrar.scala) - [FlinkCompatibilityProvider](https://github.com/TouK/nussknacker/blob/staging/engine/flink/executor/src/main/scala/pl/touk/nussknacker/engine/process/FlinkCompatibilityProvider.scala) - [CustomParameterValidator](https://github.com/TouK/nussknacker/blob/staging/components-api/src/main/scala/pl/touk/nussknacker/engine/api/definition/ParameterValidator.scala) - [ObjectNaming](https://github.com/TouK/nussknacker/blob/staging/components-api/src/main/scala/pl/touk/nussknacker/engine/api/namespaces/ObjectNaming.scala) - [ToJsonEncoder](https://github.com/TouK/nussknacker/blob/staging/common-api/src/main/scala/pl/touk/nussknacker/engine/util/json/ToJsonEncoder.scala) - [WithExceptionExtractor](https://github.com/TouK/nussknacker/blob/staging/extensions-api/src/main/scala/pl/touk/nussknacker/engine/api/exception/WithExceptionExtractor.scala) - [ModelConfigLoader](https://github.com/TouK/nussknacker/blob/staging/extensions-api/src/main/scala/pl/touk/nussknacker/engine/modelconfig/ModelConfigLoader.scala) - [ProcessMigrations](https://github.com/TouK/nussknacker/blob/staging/extensions-api/src/main/scala/pl/touk/nussknacker/engine/migration/ProcessMigration.scala) - [DictServicesFactory](https://github.com/TouK/nussknacker/blob/staging/extensions-api/src/main/scala/pl/touk/nussknacker/engine/api/dict/DictServicesFactory.scala) ### Designer customization - [ProcessChangeListenerFactory](https://github.com/TouK/nussknacker/blob/staging/designer/listener-api/src/main/scala/pl/touk/nussknacker/ui/listener/ProcessChangeListenerFactory.scala) - Security - [AuthenticationProvider](https://github.com/TouK/nussknacker/blob/staging/security/src/main/scala/pl/touk/nussknacker/designer/security/api/AuthenticationProvider.scala) - [OAuth2ServiceFactory](https://github.com/TouK/nussknacker/blob/staging/security/src/main/scala/pl/touk/nussknacker/designer/security/oauth2/OAuth2ServiceFactory.scala) - [CountsReporterCreator](https://github.com/TouK/nussknacker/blob/staging/designer/processReports/src/main/scala/pl/touk/nussknacker/processCounts/CountsReporter.scala) - [NodeAdditionalInfoProvider](https://github.com/TouK/nussknacker/blob/staging/extensions-api/src/main/scala/pl/touk/nussknacker/engine/additionalInfo/NodeAdditionalInfoProvider.scala) - [CustomProcessValidatorFactory](https://github.com/TouK/nussknacker/blob/staging/designer/restmodel/src/main/scala/pl/touk/nussknacker/restmodel/validation/CustomProcessValidator.scala) ## Modules architecture and conventions The diagram below shows dependencies between modules. You can see two main groups on it : - API modules - Utils *API modules* contains interfaces that are needed by our core modules (on both designer and runtime side). On the other hand *Utils* modules contain classes built on top of API which can be used in extensions but are not mandatory. **API of *Utils* modules can be changed more often than API inside API modules** Both *API modules* and *Utils modules* have several modules with `-components` part in name. They should be used to build own [Components](./Components) `nussknacker-scenario-api` contains classes needed to operate on scenarios: creating it via DSL, marshalling to JSON, etc. `nussknacker-deployment-manager-api` contains interfaces needed to create own [DeploymentManager](https://github.com/TouK/nussknacker/blob/staging/designer/deployment-manager-api/src/main/scala/pl/touk/nussknacker/engine/api/deployment/DeploymentManager.scala) that can be used to scenario execution. `nussknacker-extensions-*` contains other extensions API. ![Modules architecture](./img/modeles-architecture.png) Your code should depend only on `nussknacker-xxx-api` or `nussknacker-xxx-components-utils`/`nussknacker-xxx-extensions-utils` packages and not on implementation modules, like `nussknacker-interpreter`, `nussknacker-flink-executor`, `nussknacker-lite-runtime` or other `internal` modules. They should only be needed in `test` scope. **If you find you need to depend on those modules, please bear in mind that they contain implementation details and their API should not be considered stable.** ## Plug-ins packaging The plug-in jar should be fatjar containing all libraries necessary for running your customization, except for dependencies provided by execution engine. In particular, for custom component implementation, following dependencies **should** be marked as `provided` and not be part of customization jar: - All Nussknacker modules with names ending in `-api`, e.g. `nussknacker-components-api`, `nussknacker-components-flink-api`, `nussknacker-lite-components-api` - `nussknacker-utils`, `nussknacker-components-utils`, `nussknacker-helpers-utils` (are provided in `defaultModel.jar`) - `nussknacker-flink-components-utils` (is provided in `flinkExecutor.jar`) - Basic Flink dependencies: `flink-streaming-scala`, `flink-runtime`, `flink-statebackend-rocksdb` etc. for Flink components (are provided in `flinkExecutor.jar`) - `nussknacker-kafka-utils` for Streaming components in Lite engine **Please remember that `provided` dependency are not transitive, i.e. if you depend on e.g. `nussknacker-flink-kafka-components-utils` you still have to declare dependency on `nussknacker-flink-components-utils` explicitly (see [Maven documentation](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope) for further info).**
{ "content_hash": "9dc6ca5debd87623c0ef36e4b85dfea3", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 473, "avg_line_length": 93.57692307692308, "alnum_prop": 0.8090834360871352, "repo_name": "TouK/nussknacker", "id": "6c8af78c5dda9535f062859da695e0df2ce9fed0", "size": "9744", "binary": false, "copies": "1", "ref": "refs/heads/staging", "path": "docs/developers_guide/Basics.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3757" }, { "name": "Dockerfile", "bytes": "597" }, { "name": "HTML", "bytes": "3573" }, { "name": "Java", "bytes": "240995" }, { "name": "JavaScript", "bytes": "189903" }, { "name": "PLSQL", "bytes": "269" }, { "name": "Scala", "bytes": "5323010" }, { "name": "Shell", "bytes": "42521" }, { "name": "Stylus", "bytes": "60452" }, { "name": "TypeScript", "bytes": "991644" } ], "symlink_target": "" }
package io.advantageous.qbit.service.health; import io.advantageous.boon.core.Lists; import io.advantageous.qbit.annotation.QueueCallback; import io.advantageous.qbit.annotation.QueueCallbackType; import io.advantageous.qbit.service.Stoppable; import io.advantageous.qbit.util.Timer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; /** * Manages health status of internal nodes/services. */ public class HealthServiceImpl implements HealthService, Stoppable { /** * Timer. */ private final Timer timer; /** * How often should we check TTLs. */ private final long recheckIntervalMS; /** * Internal map to check health. */ private final Map<String, NodeHealthStat> serviceHealthStatMap = new ConcurrentHashMap<>(); /** * Last Check in time. */ private long lastCheckIn; /** * Current time. */ private long now; /** * logger. */ private final Logger logger = LoggerFactory.getLogger(HealthServiceImpl.class); private final boolean debug = logger.isDebugEnabled(); private static int healthServiceCount; /** * Constructor. * * @param timer timer * @param recheckInterval recheck interval * @param timeUnit time unit for interval */ public HealthServiceImpl(final Timer timer, final long recheckInterval, final TimeUnit timeUnit) { this.timer = timer; recheckIntervalMS = timeUnit.toMillis(recheckInterval); now = timer.now(); lastCheckIn = now; healthServiceCount ++; if (logger.isDebugEnabled()) { Exception ex = new Exception(); ex.fillInStackTrace(); logger.debug("Health Service CREATED", ex); } if (healthServiceCount > 1) { logger.info("More than ONE Health Service created {}, if that is not intended turn on debugging", healthServiceCount); } logger.info("Health Service CREATED {}", this.hashCode()); } /** * Register method to register services / internal nodes. * * @param name name * @param ttl ttl * @param timeUnit timeUnit */ @Override public void register(final String name, final long ttl, final TimeUnit timeUnit) { logger.info("HealthService::register() {} {} {}", name, ttl, timeUnit); serviceHealthStatMap.put(name, new NodeHealthStat(name, timeUnit.toMillis(ttl))); } /** * Check in the service. * * @param name name */ @Override public void checkInOk(final String name) { if (debug) logger.debug("HealthService::checkInOk() {} ", name); final NodeHealthStat nodeHealthStat = getServiceHealthStat(name); nodeHealthStat.setLastCheckIn(now); nodeHealthStat.setReason(null); nodeHealthStat.setStatus(HealthStatus.PASS); } /** * Check in the service with a specific status. * * @param name name * @param status status */ @Override public void checkIn(final String name, final HealthStatus status) { if (status == HealthStatus.FAIL) { logger.error("HealthService::checkIn() {} {}", name, status); } else if (status == HealthStatus.WARN) { logger.warn("HealthService::checkIn() {} {}", name, status); } else { if (debug) logger.debug("HealthService::checkIn() {} {}", name, status); } final NodeHealthStat nodeHealthStat = getServiceHealthStat(name); nodeHealthStat.setStatus(status); nodeHealthStat.setReason(null); nodeHealthStat.setLastCheckIn(now); } @Override public boolean ok() { if (debug) logger.debug("HealthService::ok()"); boolean ok = serviceHealthStatMap.values() .stream() .allMatch(serviceHealthStat -> serviceHealthStat.getStatus() == HealthStatus.PASS); if (!ok) { logger.error("HealthService::ok() was ok? {}", ok); } else { if (debug) logger.debug("HealthService::ok() was ok? {}", ok); } return ok; } @Override public List<String> findHealthyNodes() { logger.info("HealthService::findHealthyNodes() called"); final List<String> names = new ArrayList<>(); serviceHealthStatMap.values() .stream() .filter(serviceHealthStat -> serviceHealthStat.getStatus() == HealthStatus.PASS) .forEach(serviceHealthStat -> names.add(serviceHealthStat.getName())); logger.info("HealthService::findHealthyNodes() called returns {}", names); return names; } @Override public List<String> findAllNodes() { logger.info("HealthService::findAllNodes() called"); final List<String> names = new ArrayList<>(); serviceHealthStatMap.values() .stream() .forEach(serviceHealthStat -> names.add(serviceHealthStat.getName())); logger.info("HealthService::findAllNodes() called returns {}", names); return names; } @Override public List<String> findAllNodesWithStatus(final HealthStatus queryStatus) { final List<String> names = new ArrayList<>(); serviceHealthStatMap.values() .stream() .filter(serviceHealthStat -> serviceHealthStat.getStatus() == queryStatus) .forEach(serviceHealthStat -> names.add(serviceHealthStat.getName())); return names; } @Override public List<String> findNotHealthyNodes() { final List<String> names = new ArrayList<>(); serviceHealthStatMap.values() .stream() .filter(serviceHealthStat -> serviceHealthStat.getStatus() != HealthStatus.PASS) .forEach(serviceHealthStat -> names.add(serviceHealthStat.getName())); return names; } @Override public List<NodeHealthStat> loadNodes() { logger.info("HealthService::loadNodes() called"); return Lists.deepCopy(this.serviceHealthStatMap.values()); } @Override public void unregister(String nodeName) { serviceHealthStatMap.remove(nodeName); } @QueueCallback({QueueCallbackType.IDLE, QueueCallbackType.LIMIT}) public void process() { now = timer.now(); final long duration = now - lastCheckIn; if (duration > recheckIntervalMS) { lastCheckIn = now; checkTTLs(); } } private void checkTTLs() { final Collection<NodeHealthStat> services = serviceHealthStatMap.values(); //noinspection Convert2MethodRef services.forEach(serviceHealthStat -> checkTTL(serviceHealthStat)); } private void checkTTL(final NodeHealthStat nodeHealthStat) { if (debug) logger.debug("HealthService::checkTTL() {}", nodeHealthStat.getName()); /* proceed to check the ttl if the status is pass. */ boolean proceed = nodeHealthStat.getStatus() == HealthStatus.PASS; if (!proceed) { return; } final long duration = now - nodeHealthStat.getLastCheckIn(); /* If the duration is greater than the ttl interval, then mark it as failed. */ if (duration > nodeHealthStat.getTtlInMS()) { logger.error("HealthService::checkTTL() {} FAILED TTL check, duration {}", nodeHealthStat.getName(), duration); nodeHealthStat.setReason(HealthFailReason.FAILED_TTL); nodeHealthStat.setStatus(HealthStatus.FAIL); } } private NodeHealthStat getServiceHealthStat(final String name) { final NodeHealthStat nodeHealthStat = serviceHealthStatMap.get(name); if (nodeHealthStat == null) { throw new IllegalStateException("Trying to manage a service that you have not registered"); } return nodeHealthStat; } public enum HealthFailReason { FAILED_TTL, NONE, OTHER } @Override public void stop() { logger.info("Health Service stopped"); } }
{ "content_hash": "825224776bec854df039a84ee89580b0", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 130, "avg_line_length": 27.65359477124183, "alnum_prop": 0.6180571968801701, "repo_name": "MammatusTech/qbit", "id": "320035e648bcfd3f19f5eaec00113d9ab837ab05", "size": "8462", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "qbit/core/src/main/java/io/advantageous/qbit/service/health/HealthServiceImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "1066" }, { "name": "Java", "bytes": "2074235" }, { "name": "Shell", "bytes": "371" } ], "symlink_target": "" }
require 'edgecase' class AboutClasses < EdgeCase::Koan class Dog end def test_instances_of_classes_can_be_created_with_new fido = Dog.new assert_equal __, fido.class end # ------------------------------------------------------------------ class Dog2 def set_name(a_name) @name = a_name end end def test_instance_variables_can_be_set_by_assigning_to_them fido = Dog2.new assert_equal __, fido.instance_variables fido.set_name("Fido") assert_equal __, fido.instance_variables end def test_instance_variables_cannot_be_accessed_outside_the_class fido = Dog2.new fido.set_name("Fido") assert_raise(___) do fido.name end assert_raise(___) do eval "fido.@name" # NOTE: Using eval because the above line is a syntax error. end end def test_you_can_politely_ask_for_instance_variable_values fido = Dog2.new fido.set_name("Fido") assert_equal __, fido.instance_variable_get("@name") end def test_you_can_rip_the_value_out_using_instance_eval fido = Dog2.new fido.set_name("Fido") assert_equal __, fido.instance_eval("@name") # string version assert_equal __, fido.instance_eval { @name } # block version end # ------------------------------------------------------------------ class Dog3 def set_name(a_name) @name = a_name end def name @name end end def test_you_can_create_accessor_methods_to_return_instance_variables fido = Dog3.new fido.set_name("Fido") assert_equal __, fido.name end # ------------------------------------------------------------------ class Dog4 attr_reader :name def set_name(a_name) @name = a_name end end def test_attr_reader_will_automatically_define_an_accessor fido = Dog4.new fido.set_name("Fido") assert_equal __, fido.name end # ------------------------------------------------------------------ class Dog5 attr_accessor :name end def test_attr_accessor_will_automatically_define_both_read_and_write_accessors fido = Dog5.new fido.name = "Fido" assert_equal __, fido.name end # ------------------------------------------------------------------ class Dog6 attr_reader :name def initialize(initial_name) @name = initial_name end end def test_initialize_provides_initial_values_for_instance_variables fido = Dog6.new("Fido") assert_equal __, fido.name end def test_args_to_new_must_match_initialize assert_raise(___) do Dog6.new end # THINK ABOUT IT: # Why is this so? end def test_different_objects_have_difference_instance_variables fido = Dog6.new("Fido") rover = Dog6.new("Rover") assert_not_equal rover.name, fido.name end # ------------------------------------------------------------------ class Dog7 attr_reader :name def initialize(initial_name) @name = initial_name end def get_self self end def to_s __ end def inspect "<Dog named '#{name}'>" end end def test_inside_a_method_self_refers_to_the_containing_object fido = Dog7.new("Fido") fidos_self = fido.get_self assert_equal __, fidos_self end def test_to_s_provides_a_string_version_of_the_object fido = Dog7.new("Fido") assert_equal "Fido", fido.to_s end def test_to_s_is_used_in_string_interpolation fido = Dog7.new("Fido") assert_equal "My dog is Fido", "My dog is #{fido}" end def test_inspect_provides_a_more_complete_string_version fido = Dog7.new("Fido") assert_equal __, fido.inspect end def test_all_objects_support_to_s_and_inspect array = [1,2,3] assert_equal __, array.to_s assert_equal __, array.inspect assert_equal __, "STRING".to_s assert_equal __, "STRING".inspect end end
{ "content_hash": "9947f6d42f52fd98d7b4852be59f2e74", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 80, "avg_line_length": 20.573684210526316, "alnum_prop": 0.566129444870811, "repo_name": "rizwanreza/ruby_koans", "id": "d576e4bbb87932fe0e21e770b50f9a783e8e8ff6", "size": "3909", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "koans/about_classes.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "126121" } ], "symlink_target": "" }
require 'diapason/version' require 'diapason/note' require 'diapason/tuning' require 'diapason/scale' require 'diapason/sound' module Diapason end
{ "content_hash": "defd48d1b6a775747811a519c57138a2", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 26, "avg_line_length": 18.5, "alnum_prop": 0.8040540540540541, "repo_name": "zavan/diapason", "id": "e19ce6220614fb66c5d3c0f188e3f41b8c79c74e", "size": "148", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/diapason.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "5434" }, { "name": "Shell", "bytes": "115" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "baa9788f99cb8615804abc8790598c5e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "07d4208be155bc555660fe6c046b1ac837e9cbf7", "size": "239", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Plantaginaceae/Chaenorhinum/Chaenorhinum origanifolium/Chaenorhinum origanifolium cotiellae/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
namespace autofill_assistant { namespace android_interactions { void SetValue(base::WeakPtr<BasicInteractions> basic_interactions, const SetModelValueProto& proto) { if (!basic_interactions) { return; } basic_interactions->SetValue(proto); } void ComputeValue(base::WeakPtr<BasicInteractions> basic_interactions, const ComputeValueProto& proto) { if (!basic_interactions) { return; } basic_interactions->ComputeValue(proto); } void SetUserActions(base::WeakPtr<BasicInteractions> basic_interactions, const SetUserActionsProto& proto) { if (!basic_interactions) { return; } basic_interactions->SetUserActions(proto); } void EndAction(base::WeakPtr<BasicInteractions> basic_interactions, const EndActionProto& proto) { if (!basic_interactions) { return; } basic_interactions->EndAction(ClientStatus(proto.status())); } void ToggleUserAction(base::WeakPtr<BasicInteractions> basic_interactions, const ToggleUserActionProto& proto) { if (!basic_interactions) { return; } basic_interactions->ToggleUserAction(proto); } void ShowInfoPopup(const InfoPopupProto& proto, base::android::ScopedJavaGlobalRef<jobject> jcontext, base::android::ScopedJavaGlobalRef<jobject> jinfo_page_util, const std::string& close_display_str) { JNIEnv* env = base::android::AttachCurrentThread(); auto jcontext_local = base::android::ScopedJavaLocalRef<jobject>(jcontext); ui_controller_android_utils::ShowJavaInfoPopup( env, ui_controller_android_utils::CreateJavaInfoPopup( env, proto, jinfo_page_util, close_display_str), jcontext_local); } void ShowListPopup(base::WeakPtr<UserModel> user_model, const ShowListPopupProto& proto, base::android::ScopedJavaGlobalRef<jobject> jcontext, base::android::ScopedJavaGlobalRef<jobject> jdelegate) { if (!user_model) { return; } auto item_names = user_model->GetValue(proto.item_names()); if (!item_names.has_value()) { DVLOG(2) << "Failed to show list popup: '" << proto.item_names() << "' not found in model."; return; } if (item_names->strings().values().size() == 0) { DVLOG(2) << "Failed to show list popup: the list of item names in '" << proto.item_names() << "' was empty."; return; } absl::optional<ValueProto> item_types; if (proto.has_item_types()) { item_types = user_model->GetValue(proto.item_types()); if (!item_types.has_value()) { DVLOG(2) << "Failed to show list popup: '" << proto.item_types() << "' not found in the model."; return; } if (item_types->ints().values().size() != item_names->strings().values().size()) { DVLOG(2) << "Failed to show list popup: Expected item_types to contain " << item_names->strings().values().size() << " integers, but got " << item_types->ints().values().size(); return; } } else { item_types = ValueProto(); for (int i = 0; i < item_names->strings().values().size(); ++i) { item_types->mutable_ints()->add_values( static_cast<int>(ShowListPopupProto::ENABLED)); } } auto selected_indices = user_model->GetValue(proto.selected_item_indices_model_identifier()); if (!selected_indices.has_value()) { DVLOG(2) << "Failed to show list popup: '" << proto.selected_item_indices_model_identifier() << "' not found in model."; return; } if (!(*selected_indices == ValueProto()) && selected_indices->kind_case() != ValueProto::kInts) { DVLOG(2) << "Failed to show list popup: expected '" << proto.selected_item_indices_model_identifier() << "' to be int[], but was of type " << selected_indices->kind_case(); return; } JNIEnv* env = base::android::AttachCurrentThread(); std::vector<std::string> item_names_vec; std::copy(item_names->strings().values().begin(), item_names->strings().values().end(), std::back_inserter(item_names_vec)); std::vector<int> item_types_vec; std::copy(item_types->ints().values().begin(), item_types->ints().values().end(), std::back_inserter(item_types_vec)); std::vector<int> selected_indices_vec; std::copy(selected_indices->ints().values().begin(), selected_indices->ints().values().end(), std::back_inserter(selected_indices_vec)); Java_AssistantViewInteractions_showListPopup( env, jcontext, base::android::ToJavaArrayOfStrings(env, item_names_vec), base::android::ToJavaIntArray(env, item_types_vec), base::android::ToJavaIntArray(env, selected_indices_vec), proto.allow_multiselect(), base::android::ConvertUTF8ToJavaString( env, proto.selected_item_indices_model_identifier()), proto.selected_item_names_model_identifier().empty() ? nullptr : base::android::ConvertUTF8ToJavaString( env, proto.selected_item_names_model_identifier()), jdelegate); } void ShowCalendarPopup(base::WeakPtr<UserModel> user_model, const ShowCalendarPopupProto& proto, base::android::ScopedJavaGlobalRef<jobject> jcontext, base::android::ScopedJavaGlobalRef<jobject> jdelegate) { if (!user_model) { return; } JNIEnv* env = base::android::AttachCurrentThread(); auto initial_date = user_model->GetValue(proto.date_model_identifier()); if (!initial_date.has_value()) { DVLOG(2) << "Failed to show calendar popup: " << proto.date_model_identifier() << " not found in model"; return; } if (*initial_date != ValueProto() && initial_date->dates().values().size() != 1) { DVLOG(2) << "Failed to show calendar popup: date_model_identifier must be " "empty or contain single date, but was " << *initial_date; return; } auto min_date = user_model->GetValue(proto.min_date()); if (!min_date.has_value() || min_date->dates().values().size() != 1) { DVLOG(2) << "Failed to show calendar popup: min_date not found or invalid " "in user model at " << proto.min_date(); return; } auto max_date = user_model->GetValue(proto.max_date()); if (!max_date.has_value() || max_date->dates().values().size() != 1) { DVLOG(2) << "Failed to show calendar popup: max_date not found or invalid " "in user model at " << proto.max_date(); return; } jboolean jsuccess = Java_AssistantViewInteractions_showCalendarPopup( env, jcontext, *initial_date != ValueProto() ? ui_controller_android_utils::ToJavaValue(env, *initial_date) : nullptr, ui_controller_android_utils::ToJavaValue(env, *min_date), ui_controller_android_utils::ToJavaValue(env, *max_date), base::android::ConvertUTF8ToJavaString(env, proto.date_model_identifier()), jdelegate); if (!jsuccess) { DVLOG(2) << "Failed to show calendar popup: JNI call failed"; } } void ShowGenericPopup(const ShowGenericUiPopupProto& proto, base::android::ScopedJavaGlobalRef<jobject> jcontent_view, base::android::ScopedJavaGlobalRef<jobject> jcontext, base::android::ScopedJavaGlobalRef<jobject> jdelegate) { JNIEnv* env = base::android::AttachCurrentThread(); Java_AssistantViewInteractions_showGenericPopup( env, jcontent_view, jcontext, jdelegate, base::android::ConvertUTF8ToJavaString(env, proto.popup_identifier())); } void SetViewText(base::WeakPtr<UserModel> user_model, const SetTextProto& proto, ViewHandlerAndroid* view_handler, base::android::ScopedJavaGlobalRef<jobject> jdelegate) { if (!user_model) { return; } auto text = user_model->GetValue(proto.text()); if (!text.has_value()) { DVLOG(2) << "Failed to set text for " << proto.view_identifier() << ": " << proto.text() << " not found in model"; return; } if (text->strings().values_size() != 1) { DVLOG(2) << "Failed to set text for " << proto.view_identifier() << ": expected " << proto.text() << " to contain single string, but was instead " << *text; return; } auto jview = view_handler->GetView(proto.view_identifier()); if (!jview.has_value()) { DVLOG(2) << "Failed to set text for " << proto.view_identifier() << ": " << " view not found"; return; } JNIEnv* env = base::android::AttachCurrentThread(); Java_AssistantViewInteractions_setViewText( env, *jview, base::android::ConvertUTF8ToJavaString(env, text->strings().values(0)), jdelegate); } void SetViewVisibility(base::WeakPtr<UserModel> user_model, const SetViewVisibilityProto& proto, ViewHandlerAndroid* view_handler) { if (!user_model) { return; } auto jview = view_handler->GetView(proto.view_identifier()); if (!jview.has_value()) { DVLOG(2) << "Failed to set view visibility for " << proto.view_identifier() << ": view not found"; return; } auto visible_value = user_model->GetValue(proto.visible()); if (!visible_value.has_value() || visible_value->booleans().values_size() != 1) { DVLOG(2) << "Failed to set view visibility for " << proto.view_identifier() << ": " << proto.visible() << " did not contain single boolean"; return; } JNIEnv* env = base::android::AttachCurrentThread(); Java_AssistantViewInteractions_setViewVisibility( env, *jview, ui_controller_android_utils::ToJavaValue(env, *visible_value)); } void SetViewEnabled(base::WeakPtr<UserModel> user_model, const SetViewEnabledProto& proto, ViewHandlerAndroid* view_handler) { if (!user_model) { return; } auto jview = view_handler->GetView(proto.view_identifier()); if (!jview.has_value()) { DVLOG(2) << "Failed to enable/disable view " << proto.view_identifier() << ": view not found"; return; } auto enabled_value = user_model->GetValue(proto.enabled()); if (!enabled_value.has_value() || enabled_value->booleans().values_size() != 1) { DVLOG(2) << "Failed to enable/disable view " << proto.view_identifier() << ": " << proto.enabled() << " did not contain single boolean"; return; } JNIEnv* env = base::android::AttachCurrentThread(); Java_AssistantViewInteractions_setViewEnabled( env, *jview, ui_controller_android_utils::ToJavaValue(env, *enabled_value)); } void RunConditionalCallback( base::WeakPtr<BasicInteractions> basic_interactions, const std::string& condition_identifier, InteractionHandlerAndroid::InteractionCallback callback) { if (!basic_interactions) { return; } basic_interactions->RunConditionalCallback(condition_identifier, callback); } void SetToggleButtonChecked(base::WeakPtr<UserModel> user_model, const std::string& view_identifier, const std::string& model_identifier, ViewHandlerAndroid* view_handler) { if (!user_model) { return; } auto jview = view_handler->GetView(view_identifier); if (!jview.has_value()) { DVLOG(2) << "Failed to set toggle state for " << view_identifier << ": view not found"; return; } auto checked_value = user_model->GetValue(model_identifier); if (!checked_value.has_value() || checked_value->booleans().values_size() != 1) { DVLOG(2) << "Failed to set toggle state for " << view_identifier << ": " << model_identifier << " did not contain single boolean"; return; } JNIEnv* env = base::android::AttachCurrentThread(); if (!Java_AssistantViewInteractions_setToggleButtonChecked( env, *jview, ui_controller_android_utils::ToJavaValue(env, *checked_value))) { DVLOG(2) << "Failed to set toggle state for " << view_identifier << ": JNI call failed"; } } void ClearViewContainer(const std::string& view_identifier, ViewHandlerAndroid* view_handler, base::android::ScopedJavaGlobalRef<jobject> jdelegate) { auto jview = view_handler->GetView(view_identifier); if (!jview.has_value()) { DVLOG(2) << "Failed to clear view container " << view_identifier << ": view not found"; return; } JNIEnv* env = base::android::AttachCurrentThread(); if (!Java_AssistantViewInteractions_clearViewContainer( env, *jview, base::android::ConvertUTF8ToJavaString(env, view_identifier), jdelegate)) { DVLOG(2) << "Failed to clear view container " << view_identifier << ": JNI call failed"; return; } } bool AttachViewToParent(base::android::ScopedJavaGlobalRef<jobject> jview, const std::string& parent_view_identifier, ViewHandlerAndroid* view_handler) { auto jparent_view = view_handler->GetView(parent_view_identifier); if (!jparent_view.has_value()) { DVLOG(2) << "Failed to attach view to " << parent_view_identifier << ": parent not found"; return false; } JNIEnv* env = base::android::AttachCurrentThread(); if (!Java_AssistantViewInteractions_attachViewToParent(env, *jparent_view, jview)) { DVLOG(2) << "Failed to attach view to " << parent_view_identifier << ": JNI call failed"; return false; } return true; } void UpdateRadioButtonGroup( base::WeakPtr<RadioButtonController> radio_button_controller, const std::string& radio_group, const std::string& model_identifier) { if (radio_button_controller == nullptr) { return; } radio_button_controller->UpdateRadioButtonGroup(radio_group, model_identifier); } } // namespace android_interactions } // namespace autofill_assistant
{ "content_hash": "a761f4faf392a021c25aa01ee24cc0fc", "timestamp": "", "source": "github", "line_count": 397, "max_line_length": 80, "avg_line_length": 36.16372795969773, "alnum_prop": 0.6176081354043323, "repo_name": "scheib/chromium", "id": "13c04615b6821ce0560db21e8adc96a0bbfd9ae1", "size": "15141", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "components/autofill_assistant/browser/android/generic_ui_interactions_android.cc", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
export default (typeof __RWR_ENV__ !== 'undefined') ? __RWR_ENV__ : {};
{ "content_hash": "6cc70f94cb90269ad5f5a624a0064b25", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 71, "avg_line_length": 72, "alnum_prop": 0.5555555555555556, "repo_name": "kamillamagna/NMF_Tool", "id": "fae20665834ccfa553ac59f1b1ffb7ab7b60ca7d", "size": "72", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "vendor/bundle/gems/react_webpack_rails-0.7.0/js/src/env.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "103" }, { "name": "CSS", "bytes": "289648" }, { "name": "HTML", "bytes": "1819532" }, { "name": "JavaScript", "bytes": "3425661" }, { "name": "Makefile", "bytes": "2846" }, { "name": "Ruby", "bytes": "273715" }, { "name": "Shell", "bytes": "2015" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Xml; using Cake.Core; namespace Cake.Common.Tools.NuGet.Pack { internal static class NuspecTransformer { private static readonly Dictionary<string, Func<NuGetPackSettings, string>> _mappings; private const string NuSpecXsd = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"; static NuspecTransformer() { _mappings = new Dictionary<string, Func<NuGetPackSettings, string>> { { "id", settings => ToString(settings.Id) }, { "version", settings => ToString(settings.Version) }, { "title", settings => ToString(settings.Title) }, { "authors", settings => ToCommaSeparatedString(settings.Authors) }, { "owners", settings => ToCommaSeparatedString(settings.Owners) }, { "description", settings => ToString(settings.Description) }, { "summary", settings => ToString(settings.Summary) }, { "licenseUrl", settings => ToString(settings.LicenseUrl) }, { "projectUrl", settings => ToString(settings.ProjectUrl) }, { "iconUrl", settings => ToString(settings.IconUrl) }, { "requireLicenseAcceptance", settings => ToString(settings.RequireLicenseAcceptance) }, { "copyright", settings => ToString(settings.Copyright) }, { "releaseNotes", settings => ToMultiLineString(settings.ReleaseNotes) }, { "tags", settings => ToSpaceSeparatedString(settings.Tags) } }; } public static void Transform(XmlDocument document, NuGetPackSettings settings) { // Create the namespace manager. var namespaceManager = new XmlNamespaceManager(document.NameTable); namespaceManager.AddNamespace("nu", NuSpecXsd); foreach (var elementName in _mappings.Keys) { var content = _mappings[elementName](settings); if (content != null) { // Replace the node content. var node = FindOrCreateElement(document, namespaceManager, elementName); node.InnerText = content; } } if (settings.Files != null && settings.Files.Count > 0) { var filesPath = string.Format(CultureInfo.InvariantCulture, "/package//*[local-name()='files']"); var filesElement = document.SelectSingleNode(filesPath, namespaceManager); if (filesElement == null) { // Get the package element. var package = GetPackageElement(document); filesElement = document.CreateAndAppendElement(package, "files"); } // Add the files filesElement.RemoveAll(); foreach (var file in settings.Files) { var fileElement = document.CreateAndAppendElement(filesElement, "file"); fileElement.AddAttributeIfSpecified(file.Source, "src"); fileElement.AddAttributeIfSpecified(file.Exclude, "exclude"); fileElement.AddAttributeIfSpecified(file.Target, "target"); } } } private static XmlNode GetPackageElement(XmlDocument document) { var package = document.SelectSingleNode("/package"); if (package == null) { throw new CakeException("Nuspec file is missing package root."); } return package; } private static XmlNode FindOrCreateElement(XmlDocument document, XmlNamespaceManager ns, string name) { var path = string.Format(CultureInfo.InvariantCulture, "/package//*[local-name()='metadata']//*[local-name()='{0}']", name); var node = document.SelectSingleNode(path, ns); if (node == null) { var parent = document.SelectSingleNode("/package//*[local-name()='metadata']", ns); if (parent == null) { // Get the package element. var package = GetPackageElement(document); // Create the metadata element. parent = document.CreateElement("metadata", NuSpecXsd); package.PrependChild(parent); } node = document.CreateAndAppendElement(parent, name); } return node; } private static XmlNode CreateAndAppendElement(this XmlDocument document, XmlNode parent, string name) { // If the parent didn't have a namespace specified, then skip adding one. // Otherwise add the parent's namespace. This is a little hackish, but it // will avoid empty namespaces. This should probably be done better... return parent.AppendChild( string.IsNullOrWhiteSpace(parent.NamespaceURI) ? document.CreateElement(name) : document.CreateElement(name, parent.NamespaceURI)); } private static void AddAttributeIfSpecified(this XmlNode element, string value, string name) { if (string.IsNullOrWhiteSpace(value) || element.OwnerDocument == null || element.Attributes == null) { return; } var attr = element.OwnerDocument.CreateAttribute(name); attr.Value = value; element.Attributes.Append(attr); } private static string ToString(string value) { return string.IsNullOrWhiteSpace(value) ? null : value; } private static string ToString(Uri value) { return value == null ? null : value.ToString().TrimEnd('/'); } private static string ToString(bool value) { return value.ToString(CultureInfo.InvariantCulture).ToLowerInvariant(); } private static string ToCommaSeparatedString(IEnumerable<string> values) { return values != null ? string.Join(",", values) : null; } private static string ToMultiLineString(IEnumerable<string> values) { return values != null ? string.Join("\r\n", values).NormalizeLineEndings() : null; } private static string ToSpaceSeparatedString(IEnumerable<string> values) { return values != null ? string.Join(" ", values.Select(x => x.Replace(" ", "-"))) : null; } } }
{ "content_hash": "912cc360855e9c81396aa4829e25fa72", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 136, "avg_line_length": 41.154761904761905, "alnum_prop": 0.5588660688458201, "repo_name": "manekovskiy/cake", "id": "ca09f4e885d0840efcb355a9dc76939e92ff60f2", "size": "6916", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/Cake.Common/Tools/NuGet/Pack/NuSpecTransformer.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1523787" }, { "name": "PowerShell", "bytes": "862" } ], "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("BaiduPan DDL Parser")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("BaiduPan DDL Parser")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("e416cbff-1016-46ca-a0c7-252fa897d04d")] // 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.2")] [assembly: AssemblyFileVersion("1.0.0.2")]
{ "content_hash": "a1149158f3cd9796ce35e9b13d10637e", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 39.19444444444444, "alnum_prop": 0.7448618001417434, "repo_name": "JixunMoe/BaiduPan-DDL-Parser", "id": "6f381b496a008e15538eb02e18c5db79a02ab2f9", "size": "1414", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "BaiduPan DDL Parser/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "7238" } ], "symlink_target": "" }
import { connect } from 'react-redux' import updateAction from '../../actions/updateAction' import { navigateThroughSubmodels } from '../../utils/stateNavigation' import Select from '../../components/inputs/Select' const mapStateToProps = function(state, ownProps) { const path = navigateThroughSubmodels( state.rform[ownProps.formId], ownProps.submodelPath || [] ) const value = path && path[ownProps.attribute] return { value } } const mapDispatchToProps = dispatch => ({ dispatch, }) const mergeProps = (stateProps, dispatchProps, ownProps) => ({ ...ownProps, ...stateProps, ...dispatchProps, // Since a select always has some value pre-selected, theat value should be // saved to the state saveInitialValue() { const { formId, attribute, submodelPath, value, options } = ownProps const initialValue = value || (options[0] && options[0].value) dispatchProps.dispatch( updateAction(formId, attribute, submodelPath, initialValue) ) } }) export default connect( mapStateToProps, mapDispatchToProps, mergeProps )(Select)
{ "content_hash": "23e09c26b89ffad2cec5c7aac9a431f2", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 77, "avg_line_length": 27.075, "alnum_prop": 0.7072945521698984, "repo_name": "KonstantinKo/rform", "id": "1c187707d29b8327e57219b42eccb9b34f3f38ba", "size": "1083", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/containers/inputs/Select.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "75649" } ], "symlink_target": "" }
package com.rhythm.louie; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * * @author cjohnson */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface Streaming { }
{ "content_hash": "ecb88d008e0f513d4a41e3fbb6a75e6b", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 44, "avg_line_length": 18.941176470588236, "alnum_prop": 0.7763975155279503, "repo_name": "rhlabs/louie", "id": "40e3ed60c233fc1cd17a4860959a3db28b0878c0", "size": "929", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "processor/src/main/java/com/rhythm/louie/Streaming.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2767" }, { "name": "HTML", "bytes": "1496" }, { "name": "Java", "bytes": "872201" }, { "name": "JavaScript", "bytes": "98889" }, { "name": "Protocol Buffer", "bytes": "19059" }, { "name": "Python", "bytes": "93974" }, { "name": "Shell", "bytes": "1146" } ], "symlink_target": "" }
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; CREATE TABLE IF NOT EXISTS `books` ( `bid` int(11) unsigned NOT NULL AUTO_INCREMENT, `isbn` varchar(13) DEFAULT NULL, `title` varchar(255) NOT NULL, `edition` varchar(63) DEFAULT NULL, `authors` varchar(127) DEFAULT NULL, `publisher` varchar(63) DEFAULT NULL, `publication_date` varchar(31) DEFAULT NULL, `binding` varchar(31) DEFAULT NULL, `product_type` tinyint(4) NOT NULL DEFAULT '0', `image_url` varchar(127) DEFAULT NULL, `bookstore_id` varchar(15) DEFAULT NULL, `bookstore_part_number` varchar(15) DEFAULT NULL, `bookstore_new_price` decimal(5,2) DEFAULT NULL, `bookstore_used_price` decimal(5,2) DEFAULT NULL, `amazon_url` varchar(255) DEFAULT NULL, `amazon_list_price` decimal(5,2) DEFAULT NULL, `amazon_new_price` decimal(5,2) DEFAULT NULL, `amazon_used_price` decimal(5,2) DEFAULT NULL, `amazon_updated` timestamp NULL DEFAULT NULL, `updated` timestamp NULL DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`bid`), UNIQUE KEY `bookstore_product_id` (`bookstore_id`), UNIQUE KEY `isbn` (`isbn`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; CREATE TABLE IF NOT EXISTS `courses` ( `cid` int(11) unsigned NOT NULL AUTO_INCREMENT, `did` int(11) unsigned NOT NULL, `code` varchar(15) NOT NULL, `name` varchar(31) NOT NULL, `bookstore_id` int(11) DEFAULT NULL, `scrape_status` tinyint(4) NOT NULL, `scraped` timestamp NULL DEFAULT NULL, `updated` timestamp NULL DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`cid`), UNIQUE KEY `Department_Course` (`did`,`bookstore_id`), KEY `Department_ID` (`did`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `departments` ( `did` int(11) unsigned NOT NULL AUTO_INCREMENT, `tid` int(11) unsigned NOT NULL, `code` varchar(15) NOT NULL, `bookstore_id` int(11) NOT NULL, `scrape_status` tinyint(4) NOT NULL, `scraped` timestamp NULL DEFAULT NULL, `updated` timestamp NULL DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`did`), UNIQUE KEY `Term_Department` (`tid`,`code`), KEY `Term_ID` (`tid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `posts` ( `pid` int(11) NOT NULL AUTO_INCREMENT, `price` int(11) NOT NULL, `uid` int(11) NOT NULL, `bid` int(11) NOT NULL, `notes` text CHARACTER SET utf8 NOT NULL, `edition` varchar(255) CHARACTER SET utf8 NOT NULL, `condition` tinyint(4) NOT NULL, `active` tinyint(4) NOT NULL DEFAULT '1', `updated` timestamp NULL DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`pid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `sections` ( `sid` int(11) unsigned NOT NULL AUTO_INCREMENT, `cid` int(11) unsigned NOT NULL, `code` varchar(15) NOT NULL, `bookstore_id` varchar(15) NOT NULL, `scrape_status` tinyint(4) NOT NULL, `scraped` timestamp NULL DEFAULT NULL, `updated` timestamp NULL DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`sid`), UNIQUE KEY `Course_Class` (`cid`,`bookstore_id`), KEY `Course_ID` (`cid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `sections_books` ( `weight` int(11) NOT NULL AUTO_INCREMENT, `sid` int(11) unsigned NOT NULL, `bid` int(11) unsigned DEFAULT NULL, `required_status` tinyint(4) DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`weight`), UNIQUE KEY `Class_Item` (`sid`,`bid`), KEY `Item_ID` (`bid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `sessions` ( `session_id` varchar(40) CHARACTER SET utf8 NOT NULL DEFAULT '0', `ip_address` varchar(45) CHARACTER SET utf8 NOT NULL DEFAULT '0', `user_agent` varchar(120) CHARACTER SET utf8 NOT NULL, `last_activity` int(10) unsigned NOT NULL DEFAULT '0', `user_data` text CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`session_id`), KEY `last_activity_idx` (`last_activity`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `terms` ( `tid` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(15) NOT NULL, `active` tinyint(4) NOT NULL DEFAULT '1', `bookstore_id` int(11) NOT NULL, `scrape_status` tinyint(4) NOT NULL, `scraped` timestamp NULL DEFAULT NULL, `updated` timestamp NULL DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`tid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `users` ( `uid` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(7) CHARACTER SET utf8 NOT NULL, `email` varchar(63) CHARACTER SET utf8 DEFAULT NULL, `first_name` varchar(31) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`uid`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ALTER TABLE `courses` ADD CONSTRAINT `courses_ibfk_1` FOREIGN KEY (`did`) REFERENCES `departments` (`did`) ON DELETE CASCADE; ALTER TABLE `departments` ADD CONSTRAINT `departments_ibfk_1` FOREIGN KEY (`tid`) REFERENCES `terms` (`tid`) ON DELETE CASCADE; ALTER TABLE `sections` ADD CONSTRAINT `sections_ibfk_1` FOREIGN KEY (`cid`) REFERENCES `courses` (`cid`) ON DELETE CASCADE; ALTER TABLE `sections_books` ADD CONSTRAINT `sections_books_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `sections` (`sid`) ON DELETE CASCADE; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
{ "content_hash": "dbcd92b14c946b7a23ca24711ee4ef22", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 109, "avg_line_length": 38.86754966887417, "alnum_prop": 0.7117055716476401, "repo_name": "eromba/bookswap", "id": "e729d1d08f28d9bcc7d239fdd09f738dbdbc994e", "size": "5869", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/bookswap.sql", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "32850" }, { "name": "JavaScript", "bytes": "3698" }, { "name": "PHP", "bytes": "1366782" } ], "symlink_target": "" }
import { LIST_UPDATED, UPDATE_LIST, CREATE_CUSTOMER, DELETE_CUSTOMER, ERROR, OK, SELECT_CUSTOMER, UNSELECT_CUSTOMER, UPDATE_CUSTOMER, } from '../constants' import * as Utils from './utils' const initialState = { customers: [], message: null, selectedCustomer: null } export default function customers(state = initialState, action) { switch (action.type) { case SELECT_CUSTOMER: return Object.assign({}, state, { selectedCustomer: action.id }) case UNSELECT_CUSTOMER: return Object.assign({}, state, { selectedCustomer: null }) case CREATE_CUSTOMER: return Object.assign({}, state, { message: Utils.makeWarning(`Creating new customer...`) }) case UPDATE_CUSTOMER: { const id = action.id return Object.assign({}, state, { message: Utils.makeWarning(`Updating customer ${id}...`) }) } case DELETE_CUSTOMER: { const id = action.id return Object.assign({}, state, { message: Utils.makeWarning(`Deleting customer ${id}...`) }) } case UPDATE_LIST: return Object.assign({}, state, { message: Utils.makeWarning('Fetching customers...') }) case LIST_UPDATED: const customers = action.data.map(item => ({ balance: item.account_balance/1000, description: item.description, email: item.email, firstName: item.metadata.firstName, id: item.id, lastName: item.metadata.lastName, })) return Object.assign({}, state, { message: Utils.makeInfo(`Read ${customers.length} customers.`), customers, }) case OK: return Object.assign({}, state, { message: Utils.makeInfo(action.message) }) case ERROR: return Object.assign({}, state, { message: Utils.makeError(action.message) }) default: return state } }
{ "content_hash": "1e5e10c8c5d556b76ae9f7bd2c44245a", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 71, "avg_line_length": 22.404761904761905, "alnum_prop": 0.614240170031881, "repo_name": "pietro909/stripe-react-demo", "id": "53ba221e4d593955f86236a73b57e578a24d22f6", "size": "1882", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/reducers/customers.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "446" }, { "name": "HTML", "bytes": "329" }, { "name": "JavaScript", "bytes": "14680" } ], "symlink_target": "" }
module Alchemy # This helpers are useful to render elements from pages. # # The most important helper for frontend developers is the {#render_elements} helper. # module ElementsHelper include Alchemy::UrlHelper include Alchemy::ElementsBlockHelper # Renders elements from given page # # == Examples: # # === Render only certain elements: # # <header> # <%= render_elements only: ['header', 'claim'] %> # </header> # <section id="content"> # <%= render_elements except: ['header', 'claim'] %> # </section> # # === Render elements from global page: # # <footer> # <%= render_elements from_page: 'footer' %> # </footer> # # === Fallback to elements from global page: # # You can use the fallback option as an override for elements that are stored on another page. # So you can take elements from a global page and only if the user adds an element on current page the # local one gets rendered. # # 1. You have to pass the the name of the element the fallback is for as <tt>for</tt> key. # 2. You have to pass a <tt>page_layout</tt> name or {Alchemy::Page} from where the fallback elements is taken from as <tt>from</tt> key. # 3. You can pass the name of element to fallback with as <tt>with</tt> key. This is optional (the element name from the <tt>for</tt> key is taken as default). # # <%= render_elements(fallback: { # for: 'contact_teaser', # from: 'sidebar', # with: 'contact_teaser' # }) %> # # === Custom elements finder: # # Having a custom element finder class: # # class MyCustomNewsArchive # def elements(page:) # news_page.elements.named('news').order(created_at: :desc) # end # # private # # def news_page # Alchemy::Page.where(page_layout: 'news-archive') # end # end # # In your view: # # <div class="news-archive"> # <%= render_elements finder: MyCustomNewsArchive.new %> # </div> # # @option options [Alchemy::Page|String] :from_page (@page) # The page the elements are rendered from. You can pass a page_layout String or a {Alchemy::Page} object. # @option options [Array<String>|String] :only # A list of element names only to be rendered. # @option options [Array<String>|String] :except # A list of element names not to be rendered. # @option options [Number] :count # The amount of elements to be rendered (begins with first element found) # @option options [Number] :offset # The offset to begin loading elements from # @option options [Hash] :fallback # Define elements that are rendered from another page. # @option options [Boolean] :random (false) # Randomize the output of elements # @option options [Boolean] :reverse (false) # Reverse the rendering order # @option options [String] :separator # A string that will be used to join the element partials. # @option options [Class] :finder (Alchemy::ElementsFinder) # A class instance that will return elements that get rendered. # Use this for your custom element loading logic in views. # def render_elements(options = {}) options = { from_page: @page, render_format: "html", }.update(options) finder = options[:finder] || Alchemy::ElementsFinder.new(options) elements = finder.elements(page: options[:from_page]) buff = [] elements.each_with_index do |element, i| buff << render_element(element, options, i + 1) end buff.join(options[:separator]).html_safe end # This helper renders a {Alchemy::Element} view partial. # # A element view partial is the html snippet presented to the website visitor. # # The partial is located in <tt>app/views/alchemy/elements</tt>. # # == View partial naming # # The partial has to be named after the name of the element as defined in the <tt>elements.yml</tt> file. # # === Example # # Given a headline element # # # elements.yml # - name: headline # contents: # - name: text # type: EssenceText # # Then your element view partial has to be named like: # # app/views/alchemy/elements/_headline.html.{erb|haml|slim} # # === Element partials generator # # You can use this handy generator to let Alchemy generate the partials for you: # # $ rails generate alchemy:elements --skip # # == Usage # # <%= render_element(Alchemy::Element.available.named(:headline).first) %> # # @param [Alchemy::Element] element # The element you want to render the view for # @param [Hash] options # Additional options # @param [Number] counter # a counter # # @note If the view partial is not found # <tt>alchemy/elements/_view_not_found.html.erb</tt> gets rendered. # def render_element(element, options = {}, counter = 1) if element.nil? warning("Element is nil") render "alchemy/elements/view_not_found", {name: "nil"} return end element.store_page(@page) render element, { element: element, counter: counter, options: options, }.merge(options.delete(:locals) || {}) rescue ActionView::MissingTemplate => e warning(%( Element view partial not found for #{element.name}.\n #{e} )) render "alchemy/elements/view_not_found", name: element.name end # Returns a string for the id attribute of a html element for the given element def element_dom_id(element) return "" if element.nil? "#{element.name}_#{element.id}".html_safe end # Renders the HTML tag attributes required for preview mode. def element_preview_code(element) tag_builder.tag_options(element_preview_code_attributes(element)) end # Returns a hash containing the HTML tag attributes required for preview mode. def element_preview_code_attributes(element) return {} unless element.present? && @preview_mode && element.page == @page { "data-alchemy-element" => element.id } end # Returns the element's tags information as a string. Parameters and options # are equivalent to {#element_tags_attributes}. # # @see #element_tags_attributes # # @return [String] # HTML tag attributes containing the element's tag information. # def element_tags(element, options = {}) tag_builder.tag_options(element_tags_attributes(element, options)) end # Returns the element's tags information as an attribute hash. # # @param [Alchemy::Element] element The {Alchemy::Element} you want to render the tags from. # # @option options [Proc] :formatter # ('lambda { |tags| tags.join(' ') }') # Lambda converting array of tags to a string. # # @return [Hash] # HTML tag attributes containing the element's tag information. # def element_tags_attributes(element, options = {}) options = { formatter: lambda { |tags| tags.join(" ") }, }.merge(options) return {} if !element.taggable? || element.tag_list.blank? { "data-element-tags" => options[:formatter].call(element.tag_list) } end end end
{ "content_hash": "b9d3ba89f8feed9a81da0a05f46a767c", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 163, "avg_line_length": 33.596412556053814, "alnum_prop": 0.6187933796049119, "repo_name": "mamhoff/alchemy_cms", "id": "0d3e31e247d96085a8a2b6ee5f5e68cf8c2c5820", "size": "7523", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/helpers/alchemy/elements_helper.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "350006" }, { "name": "CoffeeScript", "bytes": "77269" }, { "name": "HTML", "bytes": "175847" }, { "name": "JavaScript", "bytes": "39887" }, { "name": "Ruby", "bytes": "1101205" } ], "symlink_target": "" }
 using System; using System.Collections.Generic; using System.Reflection; namespace Foundations.Extensions { namespace SimpleCQRS.Framework { public class TypeMapper { public Dictionary<Type, Type> ParameterToArgumentTypeMapping { get; } = new Dictionary<Type, Type>(); public void MapTypes( Type argumentType, Type parameterType) { if (argumentType == null) { return; } if (parameterType.IsGenericParameter) { if (ParameterToArgumentTypeMapping.ContainsKey(parameterType)) { if (ParameterToArgumentTypeMapping[parameterType] != argumentType) throw new ArgumentException(); } else { ParameterToArgumentTypeMapping.Add( parameterType, argumentType); } } else if (parameterType.GetTypeInfo().IsGenericType) { if (!argumentType.GetTypeInfo().IsGenericType) { MapTypes(argumentType.GetTypeInfo().BaseType, parameterType); } else { var concreteTypeArgs = argumentType .GetTypeInfo() .GenericTypeArguments; var genericTypeArgs = parameterType .GetTypeInfo() .GenericTypeArguments; for (var i = 0; i < genericTypeArgs.Length; i++) { MapTypes(concreteTypeArgs[i], genericTypeArgs[i]); } } } } } } }
{ "content_hash": "1f485ff08ec26e8c2905f952b1efd259", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 85, "avg_line_length": 32.95238095238095, "alnum_prop": 0.41377649325626203, "repo_name": "lukedoolittle/foundations", "id": "0b1ae6923c85f79dc6332a6c6b8ded58da580950", "size": "2078", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Foundations/Extensions/TypeMapper.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "120325" }, { "name": "PowerShell", "bytes": "75042" } ], "symlink_target": "" }
package org.devgateway.toolkit.forms.wicket.page.edit.category; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.devgateway.toolkit.forms.wicket.components.form.TextFieldBootstrapFormComponent; import org.devgateway.toolkit.forms.wicket.page.edit.AbstractEditPage; import org.devgateway.toolkit.persistence.dao.categories.Category; /** * @author mpostelnicu */ public abstract class AbstractCategoryEditPage<T extends Category> extends AbstractEditPage<T> { private static final long serialVersionUID = 6571076983713857766L; private TextFieldBootstrapFormComponent<String> label; public AbstractCategoryEditPage(final PageParameters parameters) { super(parameters); } @Override protected void onInitialize() { super.onInitialize(); label = new TextFieldBootstrapFormComponent<>("label"); label.required(); editForm.add(label); } }
{ "content_hash": "631a45f1d713845e5742cf973bd9afdb", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 96, "avg_line_length": 30.258064516129032, "alnum_prop": 0.7633262260127932, "repo_name": "devgateway/oc-explorer", "id": "e60826998bacd520fe34f86cf8704fd46c22fdab", "size": "1468", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "forms/src/main/java/org/devgateway/toolkit/forms/wicket/page/edit/category/AbstractCategoryEditPage.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "34895" }, { "name": "Dockerfile", "bytes": "229" }, { "name": "HTML", "bytes": "29881" }, { "name": "Java", "bytes": "1781271" }, { "name": "JavaScript", "bytes": "368625" } ], "symlink_target": "" }
> <b>Note</b>: This translator is only for testing, and does not correspond to any real device. It just does > some console logging. ## Installing Dependencies To install dependencies for this translator, run: ```bash npm install ``` ## Running Test Automation This translator comes with some automated tests. Here's how you can run them: ### 1. Understand the Structure of the Translator Let's step through what's going on here. The manifest.xml for this translator documents the onboarding type for this translator is org.opent2t.onboarding.manual. This basically just describes what sort of setup, pairing or auth information is required to interact with the device. In the case of this onboarding type, success means you get a token parameter. This parameter is provided to the translator for it to work. ### 2. Create the `tests/testConfig.json` file This is where you can put credentials/config to drive this test (this file is added to .gitignore to prevent inadvertent check-in). Use the following contents to start this file: ```json { "Device": { "name": "Test Temperature Sensor.", "props": { "token": "some_test_token" } } } ``` > **Note:** This is a test translator and it does not actually use the token so you can specify whatever you wish for that. ### 3. Install Test Dependencies: ```bash npm install -g ava ``` ### 4. Run the tests To run all the tests, run: ```bash npm test ``` To run a specific test, run: ```bash ava <test file path> <options> ```
{ "content_hash": "67697c6b71d12825956cee38f60cd57b", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 116, "avg_line_length": 27.051724137931036, "alnum_prop": 0.6991714467813894, "repo_name": "ChuckFerring/translators", "id": "56a033e62294998cee6c48406918cc5c47f4c2fd", "size": "1607", "binary": false, "copies": "2", "ref": "refs/heads/dev", "path": "org.opent2t.sample.temperaturesensor.superpopular/org.opent2t.test.temperaturesensor/js/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Groovy", "bytes": "20701" }, { "name": "JavaScript", "bytes": "375896" }, { "name": "RAML", "bytes": "147445" } ], "symlink_target": "" }
<?php /** * Created by PhpStorm. * User: meathill * Date: 15/8/13 * Time: 下午4:54 */ namespace diy\service; use diy\model\ADModel; use PDO; use SQLHelper; class Baobei_Mailer extends Mailer { protected $DB_write; public function __construct($debug = false) { $this->username = 'baobei@dianjoy.com'; $this->password = BAOBEI_PASSWORD; $this->from = '点乐广告主邮件报备'; parent::__construct($debug); } public function send($to, $subject, $content) { // 留日志 $DB = $this->get_write_pdo(); SQLHelper::insert($DB, 't_ad_baobei', array( 'ad_id' => $content['id'], 'to_email' => $to, 'send_time' => date('Y-m-d H:i:s'), )); $content = $this->translate($content); $content['eid'] = SQLHelper::$lastInsertId; $template = $content['ad_app_type'] == 1 ? 'baobei' : 'baobei_ios'; $content = $this->create($template, $content); return parent::send($to, $subject, $content); } /** * @param $attr */ private function translate( $attr ) { $ad = new AD(); $types = $ad->get_all_labels(PDO::FETCH_KEY_PAIR); $attr['code'] = md5($attr['id'] . BAOBEI_SALT); $attr['quote_rmb'] = number_format($attr['quote_rmb'] / 100, 2); $attr['ad_type'] = $types[$attr['ad_type']]; $attr['cate'] = ADModel::$CATE[$attr['cate']]; $permissions = $ad->get_permissions(array('ad_id' => $attr['id'])); $permissions = array_values($permissions); $attr['permissions'] = implode("\n<br>", $permissions); $attr['feedback'] = ADModel::$FEEDBACK[$attr['feedback']]; $attr['ad_desc'] = preg_replace('/<span style="color: rgb\(255, 0, 0\);">(.*?)<\/span>/', '', $attr['ad_desc']); // 过滤掉标红文字 if (is_numeric($attr['channel'])) { $channel = new Channel(); $attr['channel'] = $channel->get_channel(array('id' => $attr['channel']))[$attr['channel']]; } if ($attr['agreement_id']) { $agreement = new Agreement(); $agreements = $agreement->get_agreements(['id' => $attr['agreement_id']]); $agreement = $agreements[$attr['agreement_id']]; $attr['agreement'] = $agreement['company_short'] ? $agreement['company_short'] : $agreement['company']; } return $attr; } /** * @return PDO */ protected function get_write_pdo() { $this->DB_write = $this->DB_write ? $this->DB_write : require dirname(__FILE__) . '/../connector/pdo.php'; return $this->DB_write; } }
{ "content_hash": "e42bcbdd9eae43346941870b338881aa", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 127, "avg_line_length": 30.974358974358974, "alnum_prop": 0.5757450331125827, "repo_name": "RyanTech/lemon-grass", "id": "3bc432b0199568f48f24ce636d4336e0424fd44f", "size": "2458", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/service/Baobei_Mailer.class.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "146" }, { "name": "PHP", "bytes": "272542" } ], "symlink_target": "" }
Dynamic editable energy consumption / green house gaz emition for french real estate listings rendered in css # Dependencies Needs jquery (selectors), jquery-ui (dragable), underscore (template) # Usage Include dpe-widget.js and dpe-widget.css in your web project. The wigdet is invoked as a jquery plugin on a DOM element with the following parameters : * __measureType__ : 'ce' for an energy consumption diagram, 'ges' for a greenhouse gaz emition diagram * __propertyType__ : free text, should be 'logement' or 'b&acirc;timent' * __initialValue__ : set the initial value for the energy consumption or the greenhouse gaz emition * __options__ may contain : * _boundInputId_ : give an input element id to bound the value of the widget to this element, it will be refreshed as the widget is modified * _inputName_ : if you want to use a custom name for the floating input of the widget * _readOnly_ : set to true to have a read-only widget See example.html for usage
{ "content_hash": "7dc5c61f25262105602c0e25e0493287", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 142, "avg_line_length": 54.22222222222222, "alnum_prop": 0.7561475409836066, "repo_name": "bcolombani/dpe-widget", "id": "77ef7d7aee6f5c02f51084dd53cef495793d4882", "size": "989", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4568" }, { "name": "HTML", "bytes": "1193" }, { "name": "JavaScript", "bytes": "9914" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <algorithms version="100401"> <algorithm name="SectLabel" version="100410"> <variant no="0" confidence="0.000003"> <title confidence="0.619752"> MBT: A Memory-Based Part of Speech Tagger-Generator </title> <author confidence="0.64892"> Walter Daelemans, Jakub Zavrel </author> <affiliation confidence="0.8247345"> Computational Linguistics and AT Tilburg University </affiliation> <address confidence="0.917402"> P.O. Box 90153, NL-5000 LE Tilburg </address> <email confidence="0.520467"> fwalter.daelemans,zavrelleaub.n1 </email> <author confidence="0.956332"> Peter Berck, Steven Gillis </author> <affiliation confidence="0.977094"> Center for Dutch Language and Speech University of Antwerp </affiliation> <address confidence="0.476213"> Universiteitsplein 1, B-2610 Wilrijk </address> <email confidence="0.17518"> Ipeter.berck,steven.gillislftia.ua.ac.be </email> <sectionHeader confidence="0.885503" genericHeader="abstract"> Abstract </sectionHeader> <bodyText confidence="0.999324722222222"> We introduce a memory-based approach to part of speech tagging. Memory-based learning is a form of supervised learning based on similarity-based reasoning. The part of speech tag of a word in a particular context is extrapolated from the most similar cases held in memory. Supervised learning approaches are useful when a tagged corpus is available as an example of the desired output of the tagger. Based on such a corpus, the tagger-generator automatically builds a tagger which is able to tag new text the same way, diminishing development time for the construction of a tagger considerably. Memory-based tagging shares this advantage with other statistical or machine learning approaches. Additional advantages specific to a memory-based approach include (i) the relatively small tagged corpus size sufficient for training, (ii) incremental learning, (iii) explanation capabilities, (iv) flexible integration of information in case representations, (v) its non-parametric nature, (vi) reasonably good results on unknown words without morphological analysis, and (vii) fast learning and tagging. In this paper we show that a large-scale application of the memory-based approach is feasible: we obtain a tagging accuracy that is on a par with that of known statistical approaches, and with attractive space and time complexity properties when using IGTree, a tree-based formalism for indexing and searching huge case bases. The use of IGTree has as additional advantage that optimal context size for disambiguation is dynamically computed. </bodyText> <sectionHeader confidence="0.999543" genericHeader="introduction"> 1 Introduction </sectionHeader> <bodyText confidence="0.9913537"> Part of Speech (POS) tagging is a process in which syntactic categories are assigned to words. It can be seen as a mapping from sentences to strings of tags. Automatic tagging is useful for a number of applications: as a preprocessing stage to parsing, in information retrieval, in text to speech systems, in corpus linguistics, etc. The two factors determining the syntactic category of a word are its lexical probability (e.g. without context, man is more probably a noun than a verb), and its contextual probability (e.g. after a pronoun, man is more probably a verb than a noun, as in they man the boats). Several approaches have been proposed to construct automatic taggers. Most work on statistical methods has used n-gram models or Hidden Markov Model-based taggers (e.g. Church, 1988; DeRose, 1988; Cutting et al. 1992; Merialdo, 1994, etc.). In </bodyText> <page confidence="0.999441"> 14 </page> <bodyText confidence="0.999574421052632"> these approaches, a tag sequence is chosen for a sentence that maximizes the product of lexical and contextual probabilities as estimated from a tagged corpus. In rule-based approaches, words are assigned a tag based on a set of rules and a lexicon. These rules can either be hand-crafted (Garside et al., 1987; Klein &amp;amp; Simmons, 1963; Green 8.6 Rubin, 1971), or learned, as in Hindle (1989) or the transformation-based error-driven approach of Brill (1992). In a memory-based approach, a set of cases is kept in memory. Each case consists of a word (or a lexical representation for the word) with preceding and following context, and the corresponding category for that word in that context. A new sentence is tagged by selecting for each word in the sentence and its context the most similar case(s) in memory, and extrapolating the category of the word from these &amp;apos;nearest neighbors&amp;apos;. A memory- based approach has features of both learning rule-based taggers (each case can be regarded as a very specific rule, the similarity based reasoning as a form of conflict resolution and rule selection mechanism) and of stochastic taggers: it is fundamentally a form of k-nearest neighbors (k-nn) modeling, a well-known non-parametric statistical pattern recognition technique. The approach in its basic form is computationally expensive, however; each new word in context that has to be tagged, has to be compared to each pattern kept in memory. In this paper we show that a heuristic case base compression formalism (Daelemans et al., 1996), makes the memory-based approach computationally attractive. </bodyText> <sectionHeader confidence="0.999829" genericHeader="method"> 2 Memory-Based Learning </sectionHeader> <bodyText confidence="0.998920714285714"> Memory-based Learning is a form of supervised, inductive learning from examples. Ex- amples are represented as a vector of feature values with an associated category label. During training, a set of examples (the training set) is presented in an incremental fash- ion to the classifier, and added to memory. During testing, a set of previously unseen feature-value patterns (the test set) is presented to the system. For each test pattern, its distance to all examples in memory is computed, and the category of the least distant instance(s) is used as the predicted category for the test pattern. The approach is based on the assumption that reasoning is based on direct reuse of stored experiences rather than on the application of knowledge (such as rules or decision trees) abstracted from experience. In AI, the concept has appeared in several disciplines (from computer vision to robotics), using terminology such as similarity-based, example-based, memory-based, exemplar- based, case-based, analogical, lazy, nearest-neighbour, and instance-based (Stanfill and Waltz, 1986; Kolodner, 1993; Aha et al. 1991; Salzberg, 1990). Ideas about this type of analogical reasoning can be found also in non-mainstream linguistics and pyscholinguistics (Skousen, 1989; Derwing Skousen, 1989; Chandler, 1992; Scha, 1992). In computational linguistics (apart from incidental computational work of the linguists referred to earlier), the general approach has only recently gained some popularity: e.g., Cardie (1994, syn- tactic and semantic disambiguation); Daelemans (1995, an overview of work in the early nineties on memory-based computational phonology and morphology); Jones (1996, an overview of example-based machine translation research); Federici and Pirrelli (1996). </bodyText> <subsectionHeader confidence="0.986426"> 2.1 Similarity Metric </subsectionHeader> <bodyText confidence="0.946409"> Performance of a memory-based system (accuracy on the test set) crucially depends on the distance metric (or similarity metric) used. The most straightforward distance metric would be the one in equation (1), where X and Y are the patterns to be compared, and 6(x, yi) is the distance between the values of the i-th feature in a pattern with n features. </bodyText> <page confidence="0.98805"> 15 </page> <equation confidence="0.944263"> A(X, Y) E .6(xi,y•) (1) </equation> <bodyText confidence="0.964350266666667"> Distance between two values is measured using equation (2), an overlap metric, for symbolic features (we will have no numeric features in the tagging application). S(xt, yz) = 0 if xi = yi, else 1 (2) We will refer to this approach as IB1 (Aha et al., 1991). We extended the algorithm described there in the following way: in case a pattern is associated with more than one category in the training set (i.e. the pattern is ambiguous), the distribution of patterns over the different categories is kept, and the most frequently occurring category is selected when the ambiguous pattern is used to extrapolate from. In this distance metric, all features describing an example are interpreted as being equally important in solving the classification problem, but this is not necessarily the case. In tagging, the focus word to be assigned a category is obviously more relevant than any of the words in its context. We therefore weigh each feature with its information gain; a number expressing the average amount of reduction of training set information entropy when knowing the value of the feature (Daelemans &amp;amp; van de Bosch, 1992, Quinlan, 1993; Hunt et al. 1966) (Equation 3). We will call this algorithm IB-IG. </bodyText> <equation confidence="0.999252"> ,A(X,Y) = E G(fi)5(xi,yi) (3) </equation> <sectionHeader confidence="0.993788" genericHeader="method"> 3 IGTrees </sectionHeader> <bodyText confidence="0.998424857142857"> Memory-based learning is an expensive algorithm: of each test item, all feature values must be compared to the corresponding feature values of all training items. Without optimisation, it has an asymptotic retrieval complexity of 0(NF) (where N is the number of items in memory, and F the number of features). The same asymptotic complexity is of course found for memory storage in this approach. We use IGTrees (Daelemans et al. 1996) to compress the memory. IGTree is a heuristic approximation of the IB-IG algorithm. </bodyText> <subsectionHeader confidence="0.992539"> 3.1 The IGTree Algorithms </subsectionHeader> <bodyText confidence="0.999506733333333"> IGTree combines two algorithms: one for compressing a case base into a trees, and one for retrieving classification information from these trees. During the construction of IGTree decision trees, cases are stored as paths of connected nodes. All nodes contain a test (based on one of the features) and a class label (representing the default class at that node). Nodes are connected via arcs denoting the outcomes for the test (feature values). A feature relevance ordering technique (in this case information gain, see Section 2.1) is used to determine the order in which features are used as tests in the tree. This order is fixed in advance, so the maximal depth of the tree is always equal to the number of features, and at the same level of the tree, all nodes have the same test (they are an instance of oblivious decision trees; cf. Langley &amp;amp; Sage, 1994). The reasoning behind this reorganisation (which is in fact a compression) is that when the computation of feature relevance points to one feature clearly being the most important in classification, search can be restricted to matching a test case to those stored cases that have the same feature value at that feature. Besides restricting search to those memory cases that match only on this feature, the case memory can be optimised by further restricting search to the </bodyText> <page confidence="0.995562"> 16 </page> <figure confidence="0.7683145"> Procedure BUILD-IG-TREE: Input: </figure> <listItem confidence="0.996271545454546"> • A training set T of cases with their classes (start value: a full case base), • an information-gain-ordered list of features (tests) Fz...Fn (start value: Fi...Fn). Output: A (sub)tree. 1. If T is unambiguous (all cases in T have the same class c), create a leaf node with class label c. 2. Else if i = (n + 1), create a leaf node with as label the class occurring most frequently in T. 3. Otherwise, until i = n (the number of features) • Select the first feature (test) Fi in F„..F7i, and construct a new node N for feature F.„ and as default class c (the class occurring most frequently in T). • Partition T into subsets T1...Tni according to the values 01...vrn which occur for F, in T (cases with the same value for this feature in the same subset). • For each je{l, m}: BUILD-IG-TREE (T3, Fi+1.-Fn), </listItem> <figureCaption confidence="0.7411695"> connect the root of this subtree to N and label the arc with v.,. Figure I: Algorithm for building IGTrees (`BUILD-IG-TREE&amp;apos;). </figureCaption> <bodyText confidence="0.999368678571429"> second most important feature, followed by the third most important feature, etc. A considerable compression is obtained as similar cases share partial paths. Instead of converting the case base to a tree in which all cases are fully represented as paths, storing all feature values, we compress the tree even more by restricting the paths to those input feature values that disambiguate the classification from all other cases in the training material. The idea is that it is not necessary to fully store a case as a path when only a few feature values of the case make its classification unique. This implies that feature values that do not contribute to the disambiguation of the case classification (i.e., the values of the features with lower feature relevance values than the the lowest value of the disambiguating features) are not stored in the tree. In our tagging application, this means that only context feature values that actually contribute to disambiguation are used in the construction of the tree. Leaf nodes contain the unique class label corresponding to a path in the tree. Non- terminal nodes contain information about the most probable or default classification given the path thus far, according to the bookkeeping information on class occurrences main- tained by the tree construction algorithm. This extra information is essential when using the tree for classification. Finding the classification of a new case involves traversing the tree (i.e., matching all feature values of the test case with arcs in the order of the overall feature information gain), and either retrieving a classification when a leaf is reached, or using the default classification on the last matching non-terminal node if a feature-value match fails. A final compression is obtained by pruning the derived tree. All leaf-node daughters of a mother node that have the same class as that node are removed from the tree, as their class information does not contradict the default class information already present at the mother node. Again, this compression does not affect IGTree&amp;apos;s generalisation performance. The recursive algorithms for tree construction (except the final pruning) and retrieval are given in Figures 1 and 2. For a detailed discussion, see Daelemans et al. (1996). </bodyText> <page confidence="0.998103"> 17 </page> <figure confidence="0.845161"> Procedure SEARCH-IC-TREE: Input: </figure> <listItem confidence="0.998151222222222"> • The root node N of a subtree (start value: top node of a complete IGTree), • an unlabeled case I with information-gain-ordered feature values ft... fn, (start value: fi.•./.). Output: A class label. 1. If N is a leaf node, output default class c associated with this node. 2. Otherwise, if test F, of the current node does not originate an arc labeled with ft, output default class c associated with N. 3. Otherwise, • new node M is the end node of the arc originating from N with as label L. • SEARCH-IG-TREE (M, fi+i </listItem> <figureCaption confidence="0.992806"> Figure 2: Algorithm for searching IGTrees (&amp;apos;SEARCH-IG-TREE&amp;apos;). </figureCaption> <subsectionHeader confidence="0.979727"> 3.2 IGTree Complexity </subsectionHeader> <bodyText confidence="0.991888"> The asymptotic complexity of IGTree (i.e, in the worst case) is extremely favorable. Complexity of searching a query pattern in the tree is proportional to F * log(V), where F is the number of features (equal to the maximal depth of the tree), and V is the average number of values per feature (i.e., the average branching factor in the tree). In IB1, search complexity is 0(N * F) (with N the number of stored cases). Retrieval by search in the tree is independent from the number of training cases, and therefore especially useful for large case bases. Storage requirements are proportional to N (compare 0(N * F) for IB1). Finally, the cost of building the tree on the basis of a set of cases is proportional to N * log(V) * F in the worst case (compare 0(N) for training in IB1). In practice, for our part-of-speech tagging experiments, IGTree retrieval is 100 to 200 times faster than normal memory-based retrieval, and uses over 95% less memory. </bodyText> <sectionHeader confidence="0.832957" genericHeader="method"> 4 Architecture of the Tagger </sectionHeader> <bodyText confidence="0.9996415"> The architecture takes the form of a tagger generator given a corpus tagged with the desired tag set, a POS tagger is generated which maps the words of new text to tags in this tag set according to the same systematicity. The construction of a POS tagger for a specific corpus is achieved in the following way. Given an annotated corpus, three datastructures are automatically extracted: a lexicon, a case base for known words (words occurring in the lexicon), and a case base for unknown words. Case Bases are indexed using IGTree. During tagging, each word in the text to be tagged is looked up in the lexicon. If it is found, its lexical representation is retrieved and its context is determined, and the resulting pattern is looked up in the known words case base. When a word is not found in the lexicon, its lexical representation is computed on the basis of its form, its context is determined, and the resulting pattern is looked up in the unknown words case base. In each case, output is a best guess of the category for the word in its current context. In the remainder of this section, we will describe each step in more detail. We start from a training set of tagged sentences T. </bodyText> <page confidence="0.996496"> 18 </page> <subsectionHeader confidence="0.968082"> 4.1 Lexicon Construction </subsectionHeader> <bodyText confidence="0.999110111111111"> A lexicon is extracted from T by computing for each word in T the number of times it occurs with each category. E.g. when using the first 2 million words of the Wall Street Journal corpus&amp;apos; as T, the word once would get the lexical definition RB: 330; IN: 77, i.e. once was tagged 330 times as an adverb, and 77 times as a preposition/subordinating conjunction.2 Using these lexical definitions, a new, possibly ambiguous, tag is produced for each word type. E.g. once would get a new tag, representing the category of words which can be both adverbs and prepositions/conjunctions (RB-IN). Frequency order is taken into account in this process: if there would be words which, like once, can be RB or IN, but more frequently IN than RB (e.g. the word below), then a different tag (IN-RB) is assigned to these words. The original tag set, consisting of 44 morphosyntactic tags, was expanded this way to 419 (possibly ambiguous) tags. In the WSJ example, the resulting lexicon contains 57962 word types, 7464 (13%) of which are ambiguous. On the same training set, 76% of word tokens are ambiguous. When tagging a new sentence, words are looked up in the lexicon. Depending on whether or not they can be found there, a case representation is constructed for them, and they are retrieved from either the known words case base or the unknown words case base. </bodyText> <subsectionHeader confidence="0.92725"> 4.2 Known Words </subsectionHeader> <bodyText confidence="0.99895652"> A windowing approach (Sejnowski &amp;amp; Rosenberg, 1987) was used to represent the tagging task as a classification problem. A case consists of information about a focus word to be tagged, its left and right context, and an associated category (tag) valid for the focus word in that context. There are several types of information which can be stored in the case base for each word, ranging from the words themselves to intricate lexical representations. In the pre- liminary experiments described in this paper, we limited this information to the possibly ambiguous tags of words (retrieved from the lexicon) for the focus word and its context to the right, and the disambiguated tags of words for the left context (as the result of earlier tagging decisions). Table 1 is a sample of the case base for the first sentence of the corpus (Pierre Vinken, 61 years old, will join the board as a nonexecutiye director nom 29) when using this case representation. The final column shows the target category; the disambiguated tag for the focus word. We will refer to this case representation as ddf at (d for disambiguated, f for focus, a for ambiguous, and t for target). The information gain values are given as well. A search among a selection of different context sizes suggested ddf at as a suitable case representation for tagging known words. An interesting property of memory-based learning is that case representations can be easily extended with different sources of in- formation if available (e.g. feedback from a parser in which the tagger operates, semantic types, the words themselves, lexical representations of words obtained from a different source than the corpus, etc.). The information gain feature relevance ordering technique achieves a delicate relevance weighting of different information sources when they are fused in a single case representation. The window size used by the algorithm will also dynamically change depending on the information present in the context for the disam- biguation of a particular focus symbol (see Schiitze et al., 1994, and Pereira et al., 1995 </bodyText> <footnote confidence="0.7217644"> 1ACL Data Collection Initiative CD-ROM 1, September 1991. 2We disregarded a category associated with a word when less than 10% of the word tokens were tagged with that category. This way, noise in the training material is filtered out. The value for this parameter will have to be adapted for other training sets, and was chosen here to maximise generalization accuracy (accuracy on tagging unseen text). </footnote> <page confidence="0.999375"> 19 </page> <tableCaption confidence="0.998483"> Table 1: Case representation and information gain pattern for known words. </tableCaption> <table confidence="0.987917571428572"> word d case representation d f a t IG .06 .22 .82 .23 Pierre Vinken , = = np = np np , np np np 61 nP , np np cd nns jj-np , cd nns jj years cd , cd nns old cd nns jj-np , </table> <bodyText confidence="0.579226"> for similar approaches). </bodyText> <subsectionHeader confidence="0.948027"> 4.3 Unknown Words </subsectionHeader> <bodyText confidence="0.998061275862069"> If a word is not present in the lexicon, its ambiguous category cannot be retrieved. In that case, a category can be guessed only on the basis of the form or the context of the word. Again, we take advantage of the data fusion capabilities of a memory-based approach by combining these two sources of information in the case representation, and having the information gain feature relevance weighting technique figure out their relative relevance (see Schmid, 1994; Samuelsson, 1994 for similar solutions). In most taggers, some form of morphological analysis is performed on unknown words, in an attempt to relate the unknown word to a known combination of known morphemes, thereby allowing its association with one or more possible categories. After determin- ing this ambiguous category, the word is disambiguated using context knowledge, the same way as known words. Morphological analysis presupposes the availability of highly language-specific resources such as a morpheme lexicon, spelling rules, morphological rules, and heuristics to prioritise possible analyses of a word according to their plausi- bility. This is a serious knowledge engineering bottleneck when the goal is to develop a language and annotation-independent tagger generator. In our memory-based approach, we provide morphological information (especially about suffixes) indirectly to the tagger by encoding the three last letters of the word as separate features in the case representation. The first letter is encoded as well because it contains information about prefix and capitalization of the word. Context information is added to the case representation in a similar way as with known words. It turned out that in combination with the &amp;apos;morphological&amp;apos; features, a context of one disambiguated tag of the word to the left of the unknown word and one ambiguous category of the word to the right, gives good results. We will call this case representation pdassst:3 three suffix letters (s), one prefix letter (p), one left disambiguated context words (d), and one am- biguous right context word (a). As the chance of an unknown word being a function word is small, and cases representing function words may interfere with correct classification of open-class words, only open-class words are used during construction of the unknown words case base. Table 2 shows part of the case base for unknown words. </bodyText> <footnote confidence="0.991826"> 3These parameters (optimal context size and number of suffix features) were again optimised for general- ization accuracy. </footnote> <page confidence="0.998081"> 20 </page> <tableCaption confidence="0.992742"> Table 2: Case representation and information gain pattern for unknown words. </tableCaption> <table confidence="0.995374833333333"> word p d case representation a s s s t IG .21 .21 .14 .15 .20 .32 Pierre Vinken 61 P V 6 y o = np r k = r e 6 r 1 e n 1 s d np np cd nns years np , a o jj old , nns jj-np cd nns , </table> <subsectionHeader confidence="0.980729"> 4.4 Control </subsectionHeader> <bodyText confidence="0.995862777777778"> Figure 3 shows the architecture of the tagger-generator: a tagger is produced by extracting a lexicon and two case-bases from the tagged example corpus. During tagging, the control is the following: words are looked up in the lexicon and separated into known and unknown words. They are retrieved from the known words case base and the unknown words case base, respectively. In both cases, context is used, in the case of unknown words, the first and three last letters of the word are used instead of the ambiguous tag for the focus word. As far as disambiguated tags for left context words are used, these are of course not obtained by retrieval from the lexicon (which provides ambiguous categories), but by using the previous decisions of the tagger. </bodyText> <figure confidence="0.811459"> TAGGER GENERATION TAGGING LEXICON word -&amp;gt; a KNOWN WORDS ■ CASE BASE ddfa -&amp;gt; t UNKNOWN WORDS i CASE BASE pdasss -&amp;gt; t TAGGER Tagged Corpus New Text - Tagged Text </figure> <figureCaption confidence="0.999591"> Figure 3: Architecture of the tagger-generator: flow of control. </figureCaption> <subsectionHeader confidence="0.744061"> 4.5 IGTrees for Tagging </subsectionHeader> <bodyText confidence="0.999457285714286"> As explained earlier, both case bases are implemented as IGTrees. For the known words case base, paths in the tree represent variable size context widths. The first feature (the expansion of the root node of the tree) is the focus word, then context features are added as further expansions of the tree until the context disambiguates the focus word completely. Further expansion is halted at that point. In some cases, short context sizes (corresponding to bigrams, e g) are sufficient to disambiguate a focus word, in other cases, more context is needed. IGTrees provide an elegant way of automatic determination of </bodyText> <page confidence="0.997705"> 21 </page> <bodyText confidence="0.9994072"> optimal context size. In the unknown words case base, the trie representation provides an automatic integration of information about the form and the context of a focus word not encountered before. In general, the top levels of the tree represent the morphological information (the three suffix letter features and the prefix letter), while the deeper levels contribute contextual disambiguation. </bodyText> <sectionHeader confidence="0.999677" genericHeader="method"> 5 Experiments </sectionHeader> <bodyText confidence="0.9989264"> In this section, we report first results on our memory-based tagging approach. In a first set of experiments, we compared our IGTree implementation of memory-based learning to more traditional implementations of the approach. In further experiments we studied the performance of our system on predicting the category of both known and unknown words. </bodyText> <subsectionHeader confidence="0.51818"> Experimental Set-up </subsectionHeader> <bodyText confidence="0.999436625"> The experimental methodology was taken from Machine Learning practice (e.g. Weiss &amp;amp; Kulikowski, 1991): independent training and test sets were selected from the origi- nal corpus, the system was trained on the training set, and the generalization accuracy (percentage of correct category assignments) was computed on the independent test set. Storage and time requirements were computed as well. Where possible, we used a 10-fold cross-validation approach. In this experimental method, a data set is partitioned ten times into 90% training material, and 10% testing material. Average accuracy provides a reliable estimate of the generalization accuracy. </bodyText> <subsectionHeader confidence="0.956168"> 5.1 Experiment 1: Comparison of Algorithms </subsectionHeader> <bodyText confidence="0.989911545454546"> Our goal is to adhere to the concept of memory-based learning with full memory while at the same time keeping memory and processing speed within attractive bounds. To this end, we applied the IGTree formalism to the task. In order to prove that IGTree is a suitable candidate for practical memory-based tagging, we compared three memory-based learning algorithms: (i) IB1, a slight extension (to cope with symbolic values and ambigu- ous training items) of the well-known k-nn algorithm in statistical pattern recognition (see Aha et al., 1991), (ii) IB1-IG, an extension of IB1 which uses feature relevance weighting (described in Section 2), and (iii) IGTree, a memoryand processing time saving heuris- tic implementation of IB1-IG (see Section 3). Table 3 lists the results in generalization accuracy, storage requirements and speed for the three algorithms using a ddf at pattern, a 100,000 word training set, and a 10,000 word test set. In this experiment, accuracy was </bodyText> <tableCaption confidence="0.844444"> tested on known words only. Table 3: Comparison of three memory-based learning techniques. </tableCaption> <table confidence="0.990556"> Algorithm Accuracy Time Memory (Kb) IB1 92.5 0:43:34 977 IB1-IG 96.0 0:49:45 977 IGTree 96.0 0:00:29 35 </table> <bodyText confidence="0.8912625"> The IGTree version turns out to be better or equally good in terms of generalization accuracy, but also is more than 100 times faster for tagging of new words4, and compresses </bodyText> <footnote confidence="0.9900105"> 4In training, i.e. building the case base, TM. and IB1-IG (4 seconds) are faster than IGTree (26 seconds) because the latter has to build a tree instead of just storing the patterns. </footnote> <page confidence="0.994349"> 22 </page> <bodyText confidence="0.9993465"> the original case base to 4% of the size of the original case base. This experiment shows that for this problem, we can use IGTree as a time and memory saving approximation of memory-based learning (IB-IG version), without loss in generalization accuracy. The time and speed advantage of IGTree grows with larger training sets. </bodyText> <subsectionHeader confidence="0.980428"> 5.2 Experiment 2: Learning Curve </subsectionHeader> <bodyText confidence="0.946692571428571"> A ten-fold cross-validation experiment on the first two million words of the WSJ corpus shows an average generalization performance of IGTree (on known words only) of 96.3%. We did 10-fold cross-validation experiments for several sizes of datasets (in steps of 100,000 memory items), revealing the learning curve in Figure 4. Training set size is on the X-axis, generalization performance as measured in a 10-fold cross-validation experiment is on the Y-axis. the &amp;apos;error&amp;apos; range indicate averages plus and minus one standard deviation on each 10-fold cross-validation experiment.&amp;apos; </bodyText> <table confidence="0.449037571428571"> Part of Speech Tagging Learning Curve 96.4 96.2 96 95.8 95.6 95.4 95.2 95 94.8 94.6 500 1000 1500 2000 Training size (x1000) </table> <figureCaption confidence="0.9998"> Figure 4: Learning curve for tagging. </figureCaption> <bodyText confidence="0.980677"> Already at small data set sizes, performance is relatively high. With increasingly larger data sets, the performance becomes more stable (witness the error ranges). It should be noted that in this experiment, we assumed correctly disambiguated tags in the left context. In practice, when using our tagger, this is of course not the case because the disambiguated tags in the left context of the current word to be tagged are the result of a previous decision of the tagger, which may be a mistake. To test the influence of this effect we performed a third experiment. </bodyText> <subsectionHeader confidence="0.840085"> 5.3 Experiment 3: Overall Accuracy </subsectionHeader> <bodyText confidence="0.954403714285714"> We performed the complete tagger generation process on a 2 million words training set (lexicon construction and known and unknown words case-base construction), and tested on 200,000 test words. Performance on known words, unknown words, and total are given in Table 4. In this experiment, numbers were not stored in the known words case base; they are looked up in the unknown words case base. &amp;apos;We are not convinced that variation in the results of the experiments in a 10-fold-cv set-up is statistically meaningful (the 10 experiments are not independent), but follow common practice here. </bodyText> <page confidence="0.997519"> 23 </page> <tableCaption confidence="0.997878"> Table 4: Accuracy of IGTree tagging on known and unknown words </tableCaption> <table confidence="0.999263"> Accuracy Percentage Known 96.7 94.5 Unknown 90.6 5.5 Total 96.4 100.0 </table> <sectionHeader confidence="0.991426" genericHeader="related_works"> 6 Related Research </sectionHeader> <bodyText confidence="0.999876285714286"> A case-based approach, similar to our memory-based approach, was also proposed by Cardie (1993a, 1994) for sentence analysis in limited domains (not only POS tagging but also semantic tagging and structural disambiguation). We will discuss only the reported POS tagging results here. Using a fairly complex case representation based on output from the CIRCUS conceptual sentence analyzer (22 local context features describing syntactic and semantic information about a five-word window centered on the word to be tagged, including the words themselves, and 11 global context features providing information about the major constituents parsed already), and with a tag set of 18 tags (7 open-class, 11 closed class), she reports a 95% tagging accuracy. A decision-tree learning approach to feature selection is used in this experiment (Cardie, 1993b, 1994) to discard irrelevant features. Results are based on experiments with 120 randomly chosen sentences from the TIPSTER JV corpus (representing 2056 cases). Cardie (p.c.) reports 89.1% correct tagging for unknown words. Percentage unknown words was 20.6% of the test words, and overall tagging accuracy (known and unknown) 95%. Notice that her algorithm gives no initial preference to training cases that match the test word during its initial case retrieval. On the other hand, after retrieving the top k cases, the algorithm does prefer those cases that match the test word when making its final predictions. So, it&amp;apos;s understandable that the algorithm is doing better on words that it&amp;apos;s seen during training as opposed to unknown words. In our memory-based approach, feature weighting (rather than feature selection) for determining the relevance of features is integrated more smoothly with the similarity metric, and our results are based on experiments with a larger corpus (3 million cases). Our case representation is (at this point) simpler: only the (ambiguous) tags, not the words themselves or any other information are used. The most important improvement is the use of IGTree to index and search the case base, solving the computational complexity problems a case-based approach would run into when using large case bases. An approach based on k-nn methods (such as memory-based and case-based methods) is a statistical approach, but it uses a different kind of statistics than Markov model-based approaches. K-nn is a non-parametric technique; it assumes no fixed type of distribution of the data. The most important advantages compared to current stochastic approaches are that (i) few training items (a small tagged corpus) are needed for relatively good performance, (ii) the approach is incremental: adding new cases does not require any recomputation of probabilities, and (iii) it provides explanation capabilities, and (iv) it requires no additional smoothing techniques to avoid zero-probabilities; the IGTree takes care of that. Compared to hand-crafted rule-based approaches, our approach provides a solution to the knowledge-acquisition and reusability bottlenecks, and to robustness and cover- age problems (similar advantages motivated Markov model-based statistical approaches). Compared to learning rule-based approaches such as the one by Brill (1992), a k-nn ap- proach provides a uniform approach for all disambiguation tasks, more flexibility in the engineering of case representations, and a more elegant approach to handling of unknown words (see e.g. Cardie 1994). </bodyText> <page confidence="0.998774"> 24 </page> <sectionHeader confidence="0.999324" genericHeader="conclusions"> 7 Conclusion </sectionHeader> <bodyText confidence="0.999489571428572"> We have shown that a memory-based approach to large-scale tagging is feasible both in terms of accuracy (comparable to other statistical approaches), and also in terms of computational efficiency (time and space requirements) when using IGTree to compress and index the case base. The approach combines some of the best features of learned rule-based and statistical systems (small training corpora needed, incremental learning, understandable and explainable behavior of the system). More specifically, memory-based tagging with IGTrees has the following advantages. </bodyText> <listItem confidence="0.996019791666667"> • Accurate generalization from small tagged corpora. Already at small corpus size (300-400 K tagged words), performance is good. These corpus sizes can be easily handled by our system. • Incremental learning. New &amp;apos;cases&amp;apos; (e.g. interactively corrected output of the tagger) can be incrementally added to the case bases, continually improving the performance of the overall system. • Explanation capabilities. To explain the classification behavior of the system, a path in the IGTree (with associated defaults) can be provided as an explanation, as well as nearest neighbors from which the decision was extrapolated. • Flexible integration of information sources. The feature weighting method takes care of the optimal fusing of different sources of information (e.g. word form and context), automatically. • Automatic selection of optimal context. The IGTree mechanism (when applied to the known words case base) automatically decides on the optimal context size for disambiguation of focus words. • Non-parametric estimation. The IGTree formalism provides automatic, nonparametric estimation of classifications for low-frequency contexts (it is similar in this respect to backed-off training), but avoids non-optimal estimation due to false intuitions or non-convergence of the gradient-descent procedure used in some versions of backed- off training. • Reasonably good results on unknown words without morphological analysis. On the WSJ corpus, unknown words can be predicted (using context and word form information) for more than 90%. • Fast learning and tagging. Due to the favorable complexity properties of IGTrees </listItem> <bodyText confidence="0.921842888888889"> (lookup time in IGTrees is independent on number of cases), both tagger generation and tagging are extremely fast. Tagging speed in our current implementation is about 1000 words per second. We have barely begun to optimise the approach: a more intelligent similarity metric would also take into account the differences in similarity between different values of the same feature. E.g. the similarity between the tags rb-in-nn and rb-in should be bigger than the similarity between rb-in and vb-nn. Apart from linguistic engineering refinements of the similarity metric, we are currently experimenting with statistical measures to compute such more fine-grained similarities (e.g. Stanfill &amp;amp; Waltz, 1986, Cost &amp;amp; Salzberg, 1994). </bodyText> <sectionHeader confidence="0.988747" genericHeader="acknowledgments"> Acknowledgements </sectionHeader> <bodyText confidence="0.99899025"> Research of the first author was done while he was a visiting scholar at NIAS (Netherlands Institute for Advanced Studies) in Wassenaar. Thanks to Antal van den Bosch, Ton Weijters, and Gert Durieux for discussions about tagging, IGTree, and machine learning of natural language. </bodyText> <page confidence="0.99841"> 25 </page> <sectionHeader confidence="0.996843" genericHeader="references"> References </sectionHeader> <reference confidence="0.999491266666667"> Aha, D. W., Kibler, D., &amp;amp; Albert, M. (1991). &amp;apos;Instance-based learning algorithms&amp;apos;. Machine Learning, 7, 37-66. Brill, E. (1992) &amp;apos;A simple rule-based part-of-speech tagger&amp;apos;. Proceedings Third ACL Applied, Trento, Italy, 152-155. Cardie, C. (1993a). &amp;apos;A case-based approach to knowledge acquisition for domain-specific sentence analysis&amp;apos;. In AAAI-93, 798-803. Cardie, C. (1993b). &amp;apos;Using Decision Trees to Improve Case-Based Learning&amp;apos;. In Pro- ceedings of the Tenth International Conference on Machine Learning, 25-32. Cardie, C. (1994). &amp;apos;Domain-Specific Knowledge Acquisition for Conceptual Sentence Analysis&amp;apos;. Ph.D. Thesis, University of Massachusetts, Amherst, MA. Chandler, S. (1992). &amp;apos;Are rules and modules really necessary for explaining language?&amp;apos; Journal of Psycholinguistic research, 22(6): 593-606. Church, K. (1988). &amp;apos;A stochastic parts program and noun phrase parser for unrestricted text&amp;apos;. Proceedings Second ACL Applied NLP, Austin, Texas, 136-143. Cost, S. and Salzberg, S. (1993). &amp;apos;A weighted nearest neighbour algorithm for learning with symbolic features.&amp;apos; Machine Learning, 10, 57-78. Cutting, D., Kupiec, J., Pederson, J., Sibun, P. (1992). A practical part of speech tagger. Proceedings Third ACL Applied NLP, Trento, Italy, 133-140. Daelemans, W. (1995). &amp;apos;Memory-based lexical acquisition and processing.&amp;apos; In Steffens, P., editor, Machine Translation and the Lexicon, Lecture Notes in Artificial Intelli- gence 898. Berlin: Springer, 85-98. Daelemans, W., Van den Bosch, A. (1992). &amp;apos;Generalisation performance of backprop- agation learning on a syllabification task.&amp;apos; In M. Drossaers &amp;amp; A. Nijholt (Eds.), TWLT3: Connectionism and Natural Language Processing. Enschede: Twente Uni- versity, 27-38. Daelemans, W., Van den Bosch, A., Weijters, T. (1996). &amp;apos;IGTree: Using Trees for Compression and Classification in Lazy Learning Algorithms.&amp;apos; In Aha, D. (ed.). Al Review Special Issue on Lazy Learning, forthcoming. DeRose, S. (1988). &amp;apos;Grammatical category disambiguation by statistical optimization. Computational Linguistics 14, 31-39. Derwing, B. L. and Skousen, R. (1989). &amp;apos;Real Time Morphology: Symbolic Rules or Analogical Networks&amp;apos;. Berkeley Linguistic Society 15: 48-62. Federici S. and V. Pirelli. (1996). &amp;apos;Analogy, Computation and Linguistic Theory.&amp;apos; In Jones, D. (ed.) New Methods in Language Processing. London: UCL Press, forth- coming. Garside, R., Leech, G. and Sampson, G. (1987). The computational analysis of English: A corpus-based approach, London: Longman, 1987. Greene, B.B. and Rubin, G.M. (1971). Automatic Grammatical Tagging of English. Providence RI: Department of Linguistics, Brown University. Hindle, Donald. (1989). &amp;apos;Acquiring disambiguation rules from text.&amp;apos; In Proceedings, 27th Annual Meeting of the Association for Computational Linguistics, Vancouver, BC. Hunt, E., J. Mann, P. Stone. (1966). Experiments in Induction. New York: Academic Press. Jones, D. Analogical Natural Language Processing. London: UCL Press, 1996. </reference> <page confidence="0.965065"> 26 </page> <reference confidence="0.998046166666667"> Klein S. and Simmons, R. (1963). &amp;apos;A grammatical approach to grammatical coding of English words.&amp;apos; JACM 10, 334-347. Kolodner, J. (1993). Case-Based Reasoning. San Mateo: Morgan Kaufmann. Langley, P. and Sage, S. (1994). &amp;apos;Oblivious decision trees and abstract cases.&amp;apos; In D. W. Aha (Ed.), Case-Based Reasoning: Papers from the 1994 Workshop (Techni- cal Report WS-94-01). Menlo Park, CA: AAAI Press. Merialdo, B. ( 1994). &amp;apos;Tagging English Text with a Probabilistic Model.&amp;apos; Computational Linguistics 20 (2), 155-172. Pereira, F., Y. Singer, N. Tishby. (1995). &amp;apos;Beyond Word N-grams.&amp;apos; Proceedings Third Workshop on Very Large Corpora, MIT, Cambridge Mass., 95-106. Quinlan, J. (1993). C4.5: Programs for Machine Learning. San Mateo, CA: Morgan Kaufmann. Salzberg, S. (1990) &amp;apos;A nearest hyperrectangle learning method&amp;apos;. Machine Learning 6, 251-276. Samuelsson, C. (1994) &amp;apos;Morphological Tagging Based Entirely on Bayesian Inference.&amp;apos; In Proceedings of the 9th Nordic Conference on Computational Linguistics, Stockholm University, Sweden, 1994. Scha, R. (1992) &amp;apos;Virtuele Grammatica&amp;apos;s en Creatieve Algoritmen.&amp;apos; Gramma/TTT 1 (1), 57-77. Schmid, H. (1994) &amp;apos;Part-of-speech tagging with neural networks.&amp;apos; In Proceedings of COLING, Kyoto, Japan. Schiitze, H., and Y. Singer. (1994) &amp;apos;Part-of-speech Tagging Using a Variable Context Markov Model&amp;apos; Proceedings of ACL 1994, Las Cruces, New Mexico. Skousen, R. (1989). Analogical Modeling of Language. Dordrecht: Kluwer. Sejnowski, T. J., Rosenberg, C. S. (1987). Parallel networks that learn to pronounce English text. Complex Systems, 1, 145-168. Stanfill, C. and Waltz, D. (1986). &amp;apos;Toward memory-based reasoning.&amp;apos; Communications of the ACM, 29, 1212-1228. Weiss, S. and Kulikowski, C. (1991). Computer systems that learn. San-Mateo: Morgan Kaufmann. </reference> <page confidence="0.99947"> 27 </page> </variant> </algorithm> </algorithms>
{ "content_hash": "829fe69d964daa9d143cba353d47e460", "timestamp": "", "source": "github", "line_count": 807, "max_line_length": 119, "avg_line_length": 58.759603469640645, "alnum_prop": 0.7915181678230245, "repo_name": "sfontanarrosa/metadata-extraction", "id": "f87af8d0e7ce17e1ab0311193b08d903369bbe50", "size": "47463", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "ParsCit/test/v090625b-output/W96-0102_xml_section.xml", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "47344" }, { "name": "C++", "bytes": "498183" }, { "name": "CSS", "bytes": "6248" }, { "name": "Java", "bytes": "12973" }, { "name": "Perl", "bytes": "82191" }, { "name": "Python", "bytes": "62281" }, { "name": "Ruby", "bytes": "4613" }, { "name": "Scala", "bytes": "534" }, { "name": "Shell", "bytes": "442673" }, { "name": "TeX", "bytes": "117394" }, { "name": "XSLT", "bytes": "3829" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="hr" version="2.1"> <context> <name>AboutDialog</name> <message> <source>About GlobalBoost Core</source> <translation>O Bitcoin Jezrgu</translation> </message> <message> <source>&lt;b&gt;GlobalBoost Core&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> <message> <source>Copyright</source> <translation>Autorsko pravo</translation> </message> <message> <source>The Bitcoin Core developers</source> <translation type="unfinished"/> </message> <message> <source>(%1-bit)</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <source>Double-click to edit address or label</source> <translation>Dvostruki klik za uređivanje adrese ili oznake</translation> </message> <message> <source>Create a new address</source> <translation>Dodajte novu adresu</translation> </message> <message> <source>&amp;New</source> <translation type="unfinished"/> </message> <message> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopiraj trenutno odabranu adresu u međuspremnik</translation> </message> <message> <source>&amp;Copy</source> <translation type="unfinished"/> </message> <message> <source>C&amp;lose</source> <translation type="unfinished"/> </message> <message> <source>&amp;Copy Address</source> <translation>&amp;Kopirati adresu</translation> </message> <message> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Izvoz podataka iz trenutnog taba u datoteku</translation> </message> <message> <source>&amp;Export</source> <translation>&amp;Izvoz</translation> </message> <message> <source>&amp;Delete</source> <translation>&amp;Brisanje</translation> </message> <message> <source>Choose the address to send coins to</source> <translation type="unfinished"/> </message> <message> <source>Choose the address to receive coins with</source> <translation type="unfinished"/> </message> <message> <source>C&amp;hoose</source> <translation type="unfinished"/> </message> <message> <source>Sending addresses</source> <translation type="unfinished"/> </message> <message> <source>Receiving addresses</source> <translation type="unfinished"/> </message> <message> <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation type="unfinished"/> </message> <message> <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> <translation type="unfinished"/> </message> <message> <source>Copy &amp;Label</source> <translation>Kopirati &amp;oznaku</translation> </message> <message> <source>&amp;Edit</source> <translation>&amp;Izmjeniti</translation> </message> <message> <source>Export Address List</source> <translation type="unfinished"/> </message> <message> <source>Comma separated file (*.csv)</source> <translation>Datoteka vrijednosti odvojenih zarezom (*. csv)</translation> </message> <message> <source>Exporting Failed</source> <translation type="unfinished"/> </message> <message> <source>There was an error trying to save the address list to %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <source>Label</source> <translation>Oznaka</translation> </message> <message> <source>Address</source> <translation>Adresa</translation> </message> <message> <source>(no label)</source> <translation>(bez oznake)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <source>Enter passphrase</source> <translation>Unesite lozinku</translation> </message> <message> <source>New passphrase</source> <translation>Nova lozinka</translation> </message> <message> <source>Repeat new passphrase</source> <translation>Ponovite novu lozinku</translation> </message> <message> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Unesite novi lozinku za novčanik. &lt;br/&gt; Molimo Vas da koristite zaporku od &lt;b&gt;10 ili više slučajnih znakova,&lt;/b&gt; ili &lt;b&gt;osam ili više riječi.&lt;/b&gt;</translation> </message> <message> <source>Encrypt wallet</source> <translation>Šifriranje novčanika</translation> </message> <message> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Ova operacija treba lozinku vašeg novčanika kako bi se novčanik otključao.</translation> </message> <message> <source>Unlock wallet</source> <translation>Otključaj novčanik</translation> </message> <message> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Ova operacija treba lozinku vašeg novčanika kako bi se novčanik dešifrirao.</translation> </message> <message> <source>Decrypt wallet</source> <translation>Dešifriranje novčanika.</translation> </message> <message> <source>Change passphrase</source> <translation>Promjena lozinke</translation> </message> <message> <source>Enter the old and new passphrase to the wallet.</source> <translation>Unesite staru i novu lozinku za novčanik.</translation> </message> <message> <source>Confirm wallet encryption</source> <translation>Potvrdi šifriranje novčanika</translation> </message> <message> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source> <translation>Upozorenje: Ako šifrirate vaš novčanik i izgubite lozinku, &lt;b&gt;IZGUBIT ĆETE SVE SVOJE BITCOINSE!&lt;/b&gt;</translation> </message> <message> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Jeste li sigurni da želite šifrirati svoj novčanik?</translation> </message> <message> <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 type="unfinished"/> </message> <message> <source>Warning: The Caps Lock key is on!</source> <translation>Upozorenje: Tipka Caps Lock je uključena!</translation> </message> <message> <source>Wallet encrypted</source> <translation>Novčanik šifriran</translation> </message> <message> <source>Bitcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source> <translation>Bitcoin će se sada zatvoriti kako bi dovršio postupak šifriranja. Zapamtite da šifriranje vašeg novčanika ne može u potpunosti zaštititi vaše bitcoine od krađe preko zloćudnog softvera koji bi bio na vašem računalu.</translation> </message> <message> <source>Wallet encryption failed</source> <translation>Šifriranje novčanika nije uspjelo</translation> </message> <message> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Šifriranje novčanika nije uspjelo zbog interne pogreške. Vaš novčanik nije šifriran.</translation> </message> <message> <source>The supplied passphrases do not match.</source> <translation>Priložene lozinke se ne podudaraju.</translation> </message> <message> <source>Wallet unlock failed</source> <translation>Otključavanje novčanika nije uspjelo</translation> </message> <message> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Lozinka za dešifriranje novčanika nije točna.</translation> </message> <message> <source>Wallet decryption failed</source> <translation>Dešifriranje novčanika nije uspjelo</translation> </message> <message> <source>Wallet passphrase was successfully changed.</source> <translation>Lozinka novčanika je uspješno promijenjena.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <source>Sign &amp;message...</source> <translation>&amp;Potpišite poruku...</translation> </message> <message> <source>Synchronizing with network...</source> <translation>Usklađivanje s mrežom ...</translation> </message> <message> <source>&amp;Overview</source> <translation>&amp;Pregled</translation> </message> <message> <source>Node</source> <translation type="unfinished"/> </message> <message> <source>Show general overview of wallet</source> <translation>Prikaži opći pregled novčanika</translation> </message> <message> <source>&amp;Transactions</source> <translation>&amp;Transakcije</translation> </message> <message> <source>Browse transaction history</source> <translation>Pretraži povijest transakcija</translation> </message> <message> <source>E&amp;xit</source> <translation>&amp;Izlaz</translation> </message> <message> <source>Quit application</source> <translation>Izlazak iz programa</translation> </message> <message> <source>Show information about Bitcoin</source> <translation>Prikaži informacije o Bitcoinu</translation> </message> <message> <source>About &amp;Qt</source> <translation>Više o &amp;Qt</translation> </message> <message> <source>Show information about Qt</source> <translation>Prikaži informacije o Qt</translation> </message> <message> <source>&amp;Options...</source> <translation>&amp;Postavke</translation> </message> <message> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Šifriraj novčanik...</translation> </message> <message> <source>&amp;Backup Wallet...</source> <translation>&amp;Backup novčanika...</translation> </message> <message> <source>&amp;Change Passphrase...</source> <translation>&amp;Promijena lozinke...</translation> </message> <message> <source>&amp;Sending addresses...</source> <translation type="unfinished"/> </message> <message> <source>&amp;Receiving addresses...</source> <translation type="unfinished"/> </message> <message> <source>Open &amp;URI...</source> <translation type="unfinished"/> </message> <message> <source>Importing blocks from disk...</source> <translation>Importiranje blokova sa diska...</translation> </message> <message> <source>Reindexing blocks on disk...</source> <translation>Re-indeksiranje blokova na disku...</translation> </message> <message> <source>Send coins to a Bitcoin address</source> <translation>Slanje novca na bitcoin adresu</translation> </message> <message> <source>Modify configuration options for Bitcoin</source> <translation>Promijeni postavke konfiguracije za bitcoin</translation> </message> <message> <source>Backup wallet to another location</source> <translation>Napravite sigurnosnu kopiju novčanika na drugoj lokaciji</translation> </message> <message> <source>Change the passphrase used for wallet encryption</source> <translation>Promijenite lozinku za šifriranje novčanika</translation> </message> <message> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <source>&amp;Verify message...</source> <translation>&amp;Potvrdite poruku...</translation> </message> <message> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> <source>Wallet</source> <translation>Novčanik</translation> </message> <message> <source>&amp;Send</source> <translation>&amp;Pošalji</translation> </message> <message> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <source>Sign messages with your Bitcoin addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source> <translation type="unfinished"/> </message> <message> <source>&amp;File</source> <translation>&amp;Datoteka</translation> </message> <message> <source>&amp;Settings</source> <translation>&amp;Konfiguracija</translation> </message> <message> <source>&amp;Help</source> <translation>&amp;Pomoć</translation> </message> <message> <source>Tabs toolbar</source> <translation>Traka kartica</translation> </message> <message> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <source>GlobalBoost Core</source> <translation>Bitcoin Jezgra</translation> </message> <message> <source>Request payments (generates QR codes and bitcoin: URIs)</source> <translation type="unfinished"/> </message> <message> <source>&amp;About GlobalBoost Core</source> <translation type="unfinished"/> </message> <message> <source>Show the list of used sending addresses and labels</source> <translation type="unfinished"/> </message> <message> <source>Show the list of used receiving addresses and labels</source> <translation type="unfinished"/> </message> <message> <source>Open a bitcoin: URI or payment request</source> <translation type="unfinished"/> </message> <message> <source>&amp;Command-line options</source> <translation type="unfinished"/> </message> <message> <source>Show the GlobalBoost Core help message to get a list with possible Bitcoin command-line options</source> <translation type="unfinished"/> </message> <message> <source>Bitcoin client</source> <translation>Bitcoin klijent</translation> </message> <message numerus="yes"> <source>%n active connection(s) to Bitcoin network</source> <translation><numerusform>%n aktivna veza na Bitcoin mrežu</numerusform><numerusform>%n aktivne veze na Bitcoin mrežu</numerusform><numerusform>%n aktivnih veza na Bitcoin mrežu</numerusform></translation> </message> <message> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <source>Processed %1 blocks of transaction history.</source> <translation>Obrađeno %1 blokova povijesti transakcije.</translation> </message> <message numerus="yes"> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <source>%1 and %2</source> <translation type="unfinished"/> </message> <message numerus="yes"> <source>%n year(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <source>Error</source> <translation>Greška</translation> </message> <message> <source>Warning</source> <translation>Upozorenje</translation> </message> <message> <source>Information</source> <translation>Informacija</translation> </message> <message> <source>Up to date</source> <translation>Ažurno</translation> </message> <message> <source>Catching up...</source> <translation>Ažuriranje...</translation> </message> <message> <source>Sent transaction</source> <translation>Poslana transakcija</translation> </message> <message> <source>Incoming transaction</source> <translation>Dolazna transakcija</translation> </message> <message> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Datum:%1 Iznos:%2 Tip:%3 Adresa:%4 </translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Novčanik je &lt;b&gt;šifriran&lt;/b&gt; i trenutno &lt;b&gt;otključan&lt;/b&gt;</translation> </message> <message> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Novčanik je &lt;b&gt;šifriran&lt;/b&gt; i trenutno &lt;b&gt;zaključan&lt;/b&gt;</translation> </message> <message> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>CoinControlDialog</name> <message> <source>Coin Control Address Selection</source> <translation type="unfinished"/> </message> <message> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <source>Amount:</source> <translation>Iznos:</translation> </message> <message> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <source>Change:</source> <translation type="unfinished"/> </message> <message> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <source>List mode</source> <translation type="unfinished"/> </message> <message> <source>Amount</source> <translation>Iznos</translation> </message> <message> <source>Address</source> <translation>Adresa</translation> </message> <message> <source>Date</source> <translation>Datum</translation> </message> <message> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <source>Confirmed</source> <translation>Potvrđeno</translation> </message> <message> <source>Priority</source> <translation type="unfinished"/> </message> <message> <source>Copy address</source> <translation>Kopirati adresu</translation> </message> <message> <source>Copy label</source> <translation>Kopirati oznaku</translation> </message> <message> <source>Copy amount</source> <translation>Kopiraj iznos</translation> </message> <message> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <source>Lock unspent</source> <translation type="unfinished"/> </message> <message> <source>Unlock unspent</source> <translation type="unfinished"/> </message> <message> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <source>highest</source> <translation type="unfinished"/> </message> <message> <source>higher</source> <translation type="unfinished"/> </message> <message> <source>high</source> <translation type="unfinished"/> </message> <message> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <source>medium</source> <translation type="unfinished"/> </message> <message> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <source>low</source> <translation type="unfinished"/> </message> <message> <source>lower</source> <translation type="unfinished"/> </message> <message> <source>lowest</source> <translation type="unfinished"/> </message> <message> <source>(%1 locked)</source> <translation type="unfinished"/> </message> <message> <source>none</source> <translation type="unfinished"/> </message> <message> <source>Dust</source> <translation type="unfinished"/> </message> <message> <source>yes</source> <translation type="unfinished"/> </message> <message> <source>no</source> <translation type="unfinished"/> </message> <message> <source>This label turns red, if the transaction size is greater than 1000 bytes.</source> <translation type="unfinished"/> </message> <message> <source>This means a fee of at least %1 per kB is required.</source> <translation type="unfinished"/> </message> <message> <source>Can vary +/- 1 byte per input.</source> <translation type="unfinished"/> </message> <message> <source>Transactions with higher priority are more likely to get included into a block.</source> <translation type="unfinished"/> </message> <message> <source>This label turns red, if the priority is smaller than &quot;medium&quot;.</source> <translation type="unfinished"/> </message> <message> <source>This label turns red, if any recipient receives an amount smaller than %1.</source> <translation type="unfinished"/> </message> <message> <source>This means a fee of at least %1 is required.</source> <translation type="unfinished"/> </message> <message> <source>Amounts below 0.546 times the minimum relay fee are shown as dust.</source> <translation type="unfinished"/> </message> <message> <source>This label turns red, if the change is smaller than %1.</source> <translation type="unfinished"/> </message> <message> <source>(no label)</source> <translation>(bez oznake)</translation> </message> <message> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <source>Edit Address</source> <translation>Izmjeni adresu</translation> </message> <message> <source>&amp;Label</source> <translation>&amp;Oznaka</translation> </message> <message> <source>The label associated with this address list entry</source> <translation type="unfinished"/> </message> <message> <source>The address associated with this address list entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <source>&amp;Address</source> <translation>&amp;Adresa</translation> </message> <message> <source>New receiving address</source> <translation>Nova adresa za primanje</translation> </message> <message> <source>New sending address</source> <translation>Nova adresa za slanje</translation> </message> <message> <source>Edit receiving address</source> <translation>Uredi adresu za primanje</translation> </message> <message> <source>Edit sending address</source> <translation>Uredi adresu za slanje</translation> </message> <message> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Upisana adresa &quot;%1&quot; je već u adresaru.</translation> </message> <message> <source>The entered address &quot;%1&quot; is not a valid Bitcoin address.</source> <translation>Upisana adresa &quot;%1&quot; nije valjana bitcoin adresa.</translation> </message> <message> <source>Could not unlock wallet.</source> <translation>Ne mogu otključati novčanik.</translation> </message> <message> <source>New key generation failed.</source> <translation>Stvaranje novog ključa nije uspjelo.</translation> </message> </context> <context> <name>FreespaceChecker</name> <message> <source>A new data directory will be created.</source> <translation type="unfinished"/> </message> <message> <source>name</source> <translation>ime</translation> </message> <message> <source>Directory already exists. Add %1 if you intend to create a new directory here.</source> <translation type="unfinished"/> </message> <message> <source>Path already exists, and is not a directory.</source> <translation type="unfinished"/> </message> <message> <source>Cannot create data directory here.</source> <translation type="unfinished"/> </message> </context> <context> <name>HelpMessageDialog</name> <message> <source>GlobalBoost Core - Command-line options</source> <translation type="unfinished"/> </message> <message> <source>GlobalBoost Core</source> <translation>Bitcoin Jezgra</translation> </message> <message> <source>version</source> <translation>verzija</translation> </message> <message> <source>Usage:</source> <translation>Upotreba:</translation> </message> <message> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <source>UI options</source> <translation>UI postavke</translation> </message> <message> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <source>Start minimized</source> <translation>Pokreni minimiziran</translation> </message> <message> <source>Set SSL root certificates for payment request (default: -system-)</source> <translation type="unfinished"/> </message> <message> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> <message> <source>Choose data directory on startup (default: 0)</source> <translation type="unfinished"/> </message> </context> <context> <name>Intro</name> <message> <source>Welcome</source> <translation>Dobrodošli</translation> </message> <message> <source>Welcome to GlobalBoost Core.</source> <translation type="unfinished"/> </message> <message> <source>As this is the first time the program is launched, you can choose where GlobalBoost Core will store its data.</source> <translation type="unfinished"/> </message> <message> <source>GlobalBoost Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source> <translation type="unfinished"/> </message> <message> <source>Use the default data directory</source> <translation type="unfinished"/> </message> <message> <source>Use a custom data directory:</source> <translation type="unfinished"/> </message> <message> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> <source>Error: Specified data directory &quot;%1&quot; can not be created.</source> <translation type="unfinished"/> </message> <message> <source>Error</source> <translation>Pogreška</translation> </message> <message> <source>GB of free space available</source> <translation type="unfinished"/> </message> <message> <source>(of %1GB needed)</source> <translation>(od potrebnog %1GB)</translation> </message> </context> <context> <name>OpenURIDialog</name> <message> <source>Open URI</source> <translation type="unfinished"/> </message> <message> <source>Open payment request from URI or file</source> <translation type="unfinished"/> </message> <message> <source>URI:</source> <translation type="unfinished"/> </message> <message> <source>Select payment request file</source> <translation type="unfinished"/> </message> <message> <source>Select payment request file to open</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <source>Options</source> <translation>Postavke</translation> </message> <message> <source>&amp;Main</source> <translation>&amp;Glavno</translation> </message> <message> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <source>Pay transaction &amp;fee</source> <translation>Plati &amp;naknadu za transakciju</translation> </message> <message> <source>Automatically start Bitcoin after logging in to the system.</source> <translation>Automatski pokreni Bitcoin kad se uključi računalo</translation> </message> <message> <source>&amp;Start Bitcoin on system login</source> <translation>&amp;Pokreni Bitcoin kod pokretanja sustava</translation> </message> <message> <source>Size of &amp;database cache</source> <translation type="unfinished"/> </message> <message> <source>MB</source> <translation type="unfinished"/> </message> <message> <source>Number of script &amp;verification threads</source> <translation type="unfinished"/> </message> <message> <source>Connect to the Bitcoin network through a SOCKS proxy.</source> <translation type="unfinished"/> </message> <message> <source>&amp;Connect through SOCKS proxy (default proxy):</source> <translation type="unfinished"/> </message> <message> <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source> <translation type="unfinished"/> </message> <message> <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source> <translation type="unfinished"/> </message> <message> <source>Third party transaction URLs</source> <translation type="unfinished"/> </message> <message> <source>Active command-line options that override above options:</source> <translation type="unfinished"/> </message> <message> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <source>&amp;Network</source> <translation>&amp;Mreža</translation> </message> <message> <source>(0 = auto, &lt;0 = leave that many cores free)</source> <translation type="unfinished"/> </message> <message> <source>W&amp;allet</source> <translation type="unfinished"/> </message> <message> <source>Expert</source> <translation type="unfinished"/> </message> <message> <source>Enable coin &amp;control features</source> <translation type="unfinished"/> </message> <message> <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source> <translation type="unfinished"/> </message> <message> <source>&amp;Spend unconfirmed change</source> <translation type="unfinished"/> </message> <message> <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Automatski otvori port Bitcoin klijenta na ruteru. To radi samo ako ruter podržava UPnP i ako je omogućen.</translation> </message> <message> <source>Map port using &amp;UPnP</source> <translation>Mapiraj port koristeći &amp;UPnP</translation> </message> <message> <source>Proxy &amp;IP:</source> <translation>Proxy &amp;IP:</translation> </message> <message> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <source>Port of the proxy (e.g. 9050)</source> <translation>Port od proxy-a (npr. 9050)</translation> </message> <message> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Verzija:</translation> </message> <message> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <source>&amp;Window</source> <translation>&amp;Prozor</translation> </message> <message> <source>Show only a tray icon after minimizing the window.</source> <translation>Prikaži samo ikonu u sistemskoj traci nakon minimiziranja prozora</translation> </message> <message> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimiziraj u sistemsku traku umjesto u traku programa</translation> </message> <message> <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>Minimizirati umjesto izaći iz aplikacije kada je prozor zatvoren. Kada je ova opcija omogućena, aplikacija će biti zatvorena tek nakon odabira Izlaz u izborniku.</translation> </message> <message> <source>M&amp;inimize on close</source> <translation>M&amp;inimiziraj kod zatvaranja</translation> </message> <message> <source>&amp;Display</source> <translation>&amp;Prikaz</translation> </message> <message> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <source>The user interface language can be set here. This setting will take effect after restarting Bitcoin.</source> <translation type="unfinished"/> </message> <message> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Jedinica za prikazivanje iznosa:</translation> </message> <message> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Izaberite željeni najmanji dio bitcoina koji će biti prikazan u sučelju i koji će se koristiti za plaćanje.</translation> </message> <message> <source>Whether to show Bitcoin addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Prikaži adrese u popisu transakcija</translation> </message> <message> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <source>&amp;OK</source> <translation>&amp;U redu</translation> </message> <message> <source>&amp;Cancel</source> <translation>&amp;Odustani</translation> </message> <message> <source>default</source> <translation>standardne vrijednosti</translation> </message> <message> <source>none</source> <translation type="unfinished"/> </message> <message> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <source>Client restart required to activate changes.</source> <translation type="unfinished"/> </message> <message> <source>Client will be shutdown, do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <source>This change would require a client restart.</source> <translation type="unfinished"/> </message> <message> <source>The supplied proxy address is invalid.</source> <translation>Priložena proxy adresa je nevažeća.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <source>Form</source> <translation>Oblik</translation> </message> <message> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source> <translation>Prikazani podatci mogu biti zastarjeli. Vaš novčanik se automatski sinkronizira s Bitcoin mrežom kada je veza uspostavljena, ali taj proces još nije završen.</translation> </message> <message> <source>Wallet</source> <translation>Novčanik</translation> </message> <message> <source>Available:</source> <translation type="unfinished"/> </message> <message> <source>Your current spendable balance</source> <translation type="unfinished"/> </message> <message> <source>Pending:</source> <translation type="unfinished"/> </message> <message> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source> <translation type="unfinished"/> </message> <message> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <source>Total:</source> <translation>Ukupno:</translation> </message> <message> <source>Your current total balance</source> <translation type="unfinished"/> </message> <message> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Nedavne transakcije&lt;/b&gt;</translation> </message> <message> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>PaymentServer</name> <message> <source>URI handling</source> <translation>URI upravljanje</translation> </message> <message> <source>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <source>Requested payment amount of %1 is too small (considered dust).</source> <translation type="unfinished"/> </message> <message> <source>Payment request error</source> <translation type="unfinished"/> </message> <message> <source>Cannot start bitcoin: click-to-pay handler</source> <translation type="unfinished"/> </message> <message> <source>Net manager warning</source> <translation type="unfinished"/> </message> <message> <source>Your active proxy doesn&apos;t support SOCKS5, which is required for payment requests via proxy.</source> <translation type="unfinished"/> </message> <message> <source>Payment request fetch URL is invalid: %1</source> <translation type="unfinished"/> </message> <message> <source>Payment request file handling</source> <translation type="unfinished"/> </message> <message> <source>Payment request file can not be read or processed! This can be caused by an invalid payment request file.</source> <translation type="unfinished"/> </message> <message> <source>Unverified payment requests to custom payment scripts are unsupported.</source> <translation type="unfinished"/> </message> <message> <source>Refund from %1</source> <translation type="unfinished"/> </message> <message> <source>Error communicating with %1: %2</source> <translation type="unfinished"/> </message> <message> <source>Payment request can not be parsed or processed!</source> <translation type="unfinished"/> </message> <message> <source>Bad response from server %1</source> <translation type="unfinished"/> </message> <message> <source>Payment acknowledged</source> <translation type="unfinished"/> </message> <message> <source>Network request error</source> <translation type="unfinished"/> </message> </context> <context> <name>QObject</name> <message> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> <source>Error: Specified data directory &quot;%1&quot; does not exist.</source> <translation type="unfinished"/> </message> <message> <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source> <translation type="unfinished"/> </message> <message> <source>Error: Invalid combination of -regtest and -testnet.</source> <translation type="unfinished"/> </message> <message> <source>GlobalBoost Core didn&apos;t yet exit safely...</source> <translation type="unfinished"/> </message> <message> <source>Enter a Bitcoin address (e.g. GZ5zr6tYVtXP782dn1fZ6xh57iWe48pJv3)</source> <translation>Unesite Bitcoin adresu (npr. GZ5zr6tYVtXP782dn1fZ6xh57iWe48pJv3)</translation> </message> </context> <context> <name>QRImageWidget</name> <message> <source>&amp;Save Image...</source> <translation type="unfinished"/> </message> <message> <source>&amp;Copy Image</source> <translation type="unfinished"/> </message> <message> <source>Save QR Code</source> <translation>Spremi QR kod</translation> </message> <message> <source>PNG Image (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <source>Client name</source> <translation>Ime klijenta</translation> </message> <message> <source>N/A</source> <translation>N/A</translation> </message> <message> <source>Client version</source> <translation>Verzija klijenta</translation> </message> <message> <source>&amp;Information</source> <translation>&amp;Informacija</translation> </message> <message> <source>Debug window</source> <translation type="unfinished"/> </message> <message> <source>General</source> <translation type="unfinished"/> </message> <message> <source>Using OpenSSL version</source> <translation>Koristim OpenSSL verziju</translation> </message> <message> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <source>Network</source> <translation>Mreža</translation> </message> <message> <source>Name</source> <translation>Ime</translation> </message> <message> <source>Number of connections</source> <translation>Broj konekcija</translation> </message> <message> <source>Block chain</source> <translation>Lanac blokova</translation> </message> <message> <source>Current number of blocks</source> <translation>Trenutni broj blokova</translation> </message> <message> <source>Estimated total blocks</source> <translation>Procjenjeni ukupni broj blokova</translation> </message> <message> <source>Last block time</source> <translation>Posljednje vrijeme bloka</translation> </message> <message> <source>&amp;Open</source> <translation>&amp;Otvori</translation> </message> <message> <source>&amp;Console</source> <translation>&amp;Konzola</translation> </message> <message> <source>&amp;Network Traffic</source> <translation type="unfinished"/> </message> <message> <source>&amp;Clear</source> <translation type="unfinished"/> </message> <message> <source>Totals</source> <translation type="unfinished"/> </message> <message> <source>In:</source> <translation type="unfinished"/> </message> <message> <source>Out:</source> <translation type="unfinished"/> </message> <message> <source>Build date</source> <translation type="unfinished"/> </message> <message> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <source>Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <source>Clear console</source> <translation>Očisti konzolu</translation> </message> <message> <source>Welcome to the Bitcoin RPC console.</source> <translation>Dobrodošli u Bitcoin RPC konzolu.</translation> </message> <message> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Kako bi navigirali kroz povijest koristite strelice gore i dolje. &lt;b&gt;Ctrl-L&lt;/b&gt; kako bi očistili ekran.</translation> </message> <message> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> <message> <source>%1 B</source> <translation type="unfinished"/> </message> <message> <source>%1 KB</source> <translation type="unfinished"/> </message> <message> <source>%1 MB</source> <translation type="unfinished"/> </message> <message> <source>%1 GB</source> <translation type="unfinished"/> </message> <message> <source>%1 m</source> <translation type="unfinished"/> </message> <message> <source>%1 h</source> <translation type="unfinished"/> </message> <message> <source>%1 h %2 m</source> <translation type="unfinished"/> </message> </context> <context> <name>ReceiveCoinsDialog</name> <message> <source>&amp;Amount:</source> <translation type="unfinished"/> </message> <message> <source>&amp;Label:</source> <translation>&amp;Oznaka:</translation> </message> <message> <source>&amp;Message:</source> <translation type="unfinished"/> </message> <message> <source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source> <translation type="unfinished"/> </message> <message> <source>R&amp;euse an existing receiving address (not recommended)</source> <translation type="unfinished"/> </message> <message> <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source> <translation type="unfinished"/> </message> <message> <source>An optional label to associate with the new receiving address.</source> <translation type="unfinished"/> </message> <message> <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source> <translation type="unfinished"/> </message> <message> <source>Clear all fields of the form.</source> <translation type="unfinished"/> </message> <message> <source>Clear</source> <translation type="unfinished"/> </message> <message> <source>Requested payments history</source> <translation type="unfinished"/> </message> <message> <source>&amp;Request payment</source> <translation type="unfinished"/> </message> <message> <source>Show the selected request (does the same as double clicking an entry)</source> <translation type="unfinished"/> </message> <message> <source>Show</source> <translation>Pokaži</translation> </message> <message> <source>Remove the selected entries from the list</source> <translation type="unfinished"/> </message> <message> <source>Remove</source> <translation type="unfinished"/> </message> <message> <source>Copy label</source> <translation>Kopirati oznaku</translation> </message> <message> <source>Copy message</source> <translation type="unfinished"/> </message> <message> <source>Copy amount</source> <translation>Kopiraj iznos</translation> </message> </context> <context> <name>ReceiveRequestDialog</name> <message> <source>QR Code</source> <translation>QR kôd</translation> </message> <message> <source>Copy &amp;URI</source> <translation type="unfinished"/> </message> <message> <source>Copy &amp;Address</source> <translation type="unfinished"/> </message> <message> <source>&amp;Save Image...</source> <translation type="unfinished"/> </message> <message> <source>Request payment to %1</source> <translation type="unfinished"/> </message> <message> <source>Payment information</source> <translation type="unfinished"/> </message> <message> <source>URI</source> <translation type="unfinished"/> </message> <message> <source>Address</source> <translation>Adresa</translation> </message> <message> <source>Amount</source> <translation>Iznos</translation> </message> <message> <source>Label</source> <translation>Oznaka</translation> </message> <message> <source>Message</source> <translation>Poruka</translation> </message> <message> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Rezultirajući URI je predug, probajte umanjiti tekst za naslov / poruku.</translation> </message> <message> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> </context> <context> <name>RecentRequestsTableModel</name> <message> <source>Date</source> <translation>Datum</translation> </message> <message> <source>Label</source> <translation>Oznaka</translation> </message> <message> <source>Message</source> <translation>Poruka</translation> </message> <message> <source>Amount</source> <translation>Iznos</translation> </message> <message> <source>(no label)</source> <translation>(bez oznake)</translation> </message> <message> <source>(no message)</source> <translation type="unfinished"/> </message> <message> <source>(no amount)</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <source>Send Coins</source> <translation>Slanje novca</translation> </message> <message> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <source>Amount:</source> <translation>Iznos:</translation> </message> <message> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <source>Change:</source> <translation type="unfinished"/> </message> <message> <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source> <translation type="unfinished"/> </message> <message> <source>Custom change address</source> <translation type="unfinished"/> </message> <message> <source>Send to multiple recipients at once</source> <translation>Pošalji k nekoliko primatelja odjednom</translation> </message> <message> <source>Add &amp;Recipient</source> <translation>&amp;Dodaj primatelja</translation> </message> <message> <source>Clear all fields of the form.</source> <translation type="unfinished"/> </message> <message> <source>Clear &amp;All</source> <translation>Obriši &amp;sve</translation> </message> <message> <source>Balance:</source> <translation>Stanje:</translation> </message> <message> <source>Confirm the send action</source> <translation>Potvrdi akciju slanja</translation> </message> <message> <source>S&amp;end</source> <translation>&amp;Pošalji</translation> </message> <message> <source>Confirm send coins</source> <translation>Potvrdi slanje novca</translation> </message> <message> <source>%1 to %2</source> <translation type="unfinished"/> </message> <message> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <source>Copy amount</source> <translation>Kopiraj iznos</translation> </message> <message> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <source>Total Amount %1 (= %2)</source> <translation type="unfinished"/> </message> <message> <source>or</source> <translation>ili</translation> </message> <message> <source>The recipient address is not valid, please recheck.</source> <translation>Adresa primatelja je nevaljala, molimo provjerite je ponovo.</translation> </message> <message> <source>The amount to pay must be larger than 0.</source> <translation>Iznos mora biti veći od 0.</translation> </message> <message> <source>The amount exceeds your balance.</source> <translation>Iznos je veći od stanja računa.</translation> </message> <message> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Iznos je veći od stanja računa kad se doda naknada za transakcije od %1.</translation> </message> <message> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Pronašli smo adresu koja se ponavlja. U svakom plaćanju program može svaku adresu koristiti samo jedanput.</translation> </message> <message> <source>Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <source>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> <source>Warning: Invalid Bitcoin address</source> <translation type="unfinished"/> </message> <message> <source>(no label)</source> <translation>(bez oznake)</translation> </message> <message> <source>Warning: Unknown change address</source> <translation type="unfinished"/> </message> <message> <source>Are you sure you want to send?</source> <translation type="unfinished"/> </message> <message> <source>added as transaction fee</source> <translation type="unfinished"/> </message> <message> <source>Payment request expired</source> <translation type="unfinished"/> </message> <message> <source>Invalid payment address %1</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <source>A&amp;mount:</source> <translation>&amp;Iznos:</translation> </message> <message> <source>Pay &amp;To:</source> <translation>&amp;Primatelj plaćanja:</translation> </message> <message> <source>The address to send the payment to (e.g. GZ5zr6tYVtXP782dn1fZ6xh57iWe48pJv3)</source> <translation type="unfinished"/> </message> <message> <source>Enter a label for this address to add it to your address book</source> <translation>Unesite oznaku za ovu adresu kako bi ju dodali u vaš adresar</translation> </message> <message> <source>&amp;Label:</source> <translation>&amp;Oznaka:</translation> </message> <message> <source>Choose previously used address</source> <translation type="unfinished"/> </message> <message> <source>This is a normal payment.</source> <translation type="unfinished"/> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Zalijepi adresu iz međuspremnika</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Remove this entry</source> <translation type="unfinished"/> </message> <message> <source>Message:</source> <translation>Poruka:</translation> </message> <message> <source>This is a verified payment request.</source> <translation type="unfinished"/> </message> <message> <source>Enter a label for this address to add it to the list of used addresses</source> <translation type="unfinished"/> </message> <message> <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source> <translation type="unfinished"/> </message> <message> <source>This is an unverified payment request.</source> <translation type="unfinished"/> </message> <message> <source>Pay To:</source> <translation>Primatelj plaćanja:</translation> </message> <message> <source>Memo:</source> <translation type="unfinished"/> </message> </context> <context> <name>ShutdownWindow</name> <message> <source>GlobalBoost Core is shutting down...</source> <translation type="unfinished"/> </message> <message> <source>Do not shut down the computer until this window disappears.</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <source>&amp;Sign Message</source> <translation>&amp;Potpišite poruku</translation> </message> <message> <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>Možete potpisati poruke sa svojom adresom kako bi dokazali da ih posjedujete. Budite oprezni da ne potpisujete ništa mutno, jer bi vas phishing napadi mogli na prevaru natjerati da prepišete svoj identitet njima. Potpisujte samo detaljno objašnjene izjave sa kojima se slažete.</translation> </message> <message> <source>The address to sign the message with (e.g. GZ5zr6tYVtXP782dn1fZ6xh57iWe48pJv3)</source> <translation>Unesite Bitcoin adresu (npr. GZ5zr6tYVtXP782dn1fZ6xh57iWe48pJv3)</translation> </message> <message> <source>Choose previously used address</source> <translation type="unfinished"/> </message> <message> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <source>Paste address from clipboard</source> <translation>Zalijepi adresu iz međuspremnika</translation> </message> <message> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <source>Enter the message you want to sign here</source> <translation>Upišite poruku koju želite potpisati ovdje</translation> </message> <message> <source>Signature</source> <translation>Potpis</translation> </message> <message> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <source>Sign the message to prove you own this Bitcoin address</source> <translation type="unfinished"/> </message> <message> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <source>Clear &amp;All</source> <translation>Obriši &amp;sve</translation> </message> <message> <source>&amp;Verify Message</source> <translation>&amp;Potvrdite poruku</translation> </message> <message> <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 type="unfinished"/> </message> <message> <source>The address the message was signed with (e.g. GZ5zr6tYVtXP782dn1fZ6xh57iWe48pJv3)</source> <translation>Unesite Bitcoin adresu (npr. GZ5zr6tYVtXP782dn1fZ6xh57iWe48pJv3)</translation> </message> <message> <source>Verify the message to ensure it was signed with the specified Bitcoin address</source> <translation type="unfinished"/> </message> <message> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <source>Enter a Bitcoin address (e.g. GZ5zr6tYVtXP782dn1fZ6xh57iWe48pJv3)</source> <translation>Unesite Bitcoin adresu (npr. GZ5zr6tYVtXP782dn1fZ6xh57iWe48pJv3)</translation> </message> <message> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <source>Wallet unlock was cancelled.</source> <translation>Otključavanje novčanika je otkazano.</translation> </message> <message> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <source>Message signed.</source> <translation>Poruka je potpisana.</translation> </message> <message> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>SplashScreen</name> <message> <source>GlobalBoost Core</source> <translation>Bitcoin Jezgra</translation> </message> <message> <source>The Bitcoin Core developers</source> <translation type="unfinished"/> </message> <message> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <source>KB/s</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <source>Open until %1</source> <translation>Otvoren do %1</translation> </message> <message> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <source>%1/offline</source> <translation>%1 nije dostupan</translation> </message> <message> <source>%1/unconfirmed</source> <translation>%1/nepotvrđeno</translation> </message> <message> <source>%1 confirmations</source> <translation>%1 potvrda</translation> </message> <message> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <source>Date</source> <translation>Datum</translation> </message> <message> <source>Source</source> <translation>Izvor</translation> </message> <message> <source>Generated</source> <translation>Generiran</translation> </message> <message> <source>From</source> <translation>Od</translation> </message> <message> <source>To</source> <translation>Za</translation> </message> <message> <source>own address</source> <translation>vlastita adresa</translation> </message> <message> <source>label</source> <translation>oznaka</translation> </message> <message> <source>Credit</source> <translation>Uplaćeno</translation> </message> <message numerus="yes"> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <source>not accepted</source> <translation>Nije prihvaćeno</translation> </message> <message> <source>Debit</source> <translation>Zaduženje</translation> </message> <message> <source>Transaction fee</source> <translation>Naknada za transakciju</translation> </message> <message> <source>Net amount</source> <translation>Neto iznos</translation> </message> <message> <source>Message</source> <translation>Poruka</translation> </message> <message> <source>Comment</source> <translation>Komentar</translation> </message> <message> <source>Transaction ID</source> <translation>ID transakcije</translation> </message> <message> <source>Merchant</source> <translation type="unfinished"/> </message> <message> <source>Generated coins must mature %1 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> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <source>Transaction</source> <translation>Transakcija</translation> </message> <message> <source>Inputs</source> <translation>Unosi</translation> </message> <message> <source>Amount</source> <translation>Iznos</translation> </message> <message> <source>true</source> <translation type="unfinished"/> </message> <message> <source>false</source> <translation type="unfinished"/> </message> <message> <source>, has not been successfully broadcast yet</source> <translation>, još nije bio uspješno emitiran</translation> </message> <message numerus="yes"> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <source>unknown</source> <translation>nepoznato</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <source>Transaction details</source> <translation>Detalji transakcije</translation> </message> <message> <source>This pane shows a detailed description of the transaction</source> <translation>Ova panela prikazuje detaljni opis transakcije</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <source>Date</source> <translation>Datum</translation> </message> <message> <source>Type</source> <translation>Tip</translation> </message> <message> <source>Address</source> <translation>Adresa</translation> </message> <message> <source>Amount</source> <translation>Iznos</translation> </message> <message> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <source>Open until %1</source> <translation>Otvoren do %1</translation> </message> <message> <source>Confirmed (%1 confirmations)</source> <translation>Potvrđen (%1 potvrda)</translation> </message> <message> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Generirano - Upozorenje: ovaj blok nije bio primljen od strane bilo kojeg drugog noda i vjerojatno neće biti prihvaćen!</translation> </message> <message> <source>Generated but not accepted</source> <translation>Generirano, ali nije prihvaćeno</translation> </message> <message> <source>Offline</source> <translation type="unfinished"/> </message> <message> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <source>Received with</source> <translation>Primljeno s</translation> </message> <message> <source>Received from</source> <translation>Primljeno od</translation> </message> <message> <source>Sent to</source> <translation>Poslano za</translation> </message> <message> <source>Payment to yourself</source> <translation>Plaćanje samom sebi</translation> </message> <message> <source>Mined</source> <translation>Rudareno</translation> </message> <message> <source>(n/a)</source> <translation>(n/d)</translation> </message> <message> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status transakcije</translation> </message> <message> <source>Date and time that the transaction was received.</source> <translation>Datum i vrijeme kad je transakcija primljena</translation> </message> <message> <source>Type of transaction.</source> <translation>Vrsta transakcije.</translation> </message> <message> <source>Destination address of transaction.</source> <translation>Odredište transakcije</translation> </message> <message> <source>Amount removed from or added to balance.</source> <translation>Iznos odbijen od ili dodan k saldu.</translation> </message> </context> <context> <name>TransactionView</name> <message> <source>All</source> <translation>Sve</translation> </message> <message> <source>Today</source> <translation>Danas</translation> </message> <message> <source>This week</source> <translation>Ovaj tjedan</translation> </message> <message> <source>This month</source> <translation>Ovaj mjesec</translation> </message> <message> <source>Last month</source> <translation>Prošli mjesec</translation> </message> <message> <source>This year</source> <translation>Ove godine</translation> </message> <message> <source>Range...</source> <translation>Raspon...</translation> </message> <message> <source>Received with</source> <translation>Primljeno s</translation> </message> <message> <source>Sent to</source> <translation>Poslano za</translation> </message> <message> <source>To yourself</source> <translation>Tebi</translation> </message> <message> <source>Mined</source> <translation>Rudareno</translation> </message> <message> <source>Other</source> <translation>Ostalo</translation> </message> <message> <source>Enter address or label to search</source> <translation>Unesite adresu ili oznaku za pretraživanje</translation> </message> <message> <source>Min amount</source> <translation>Min iznos</translation> </message> <message> <source>Copy address</source> <translation>Kopirati adresu</translation> </message> <message> <source>Copy label</source> <translation>Kopirati oznaku</translation> </message> <message> <source>Copy amount</source> <translation>Kopiraj iznos</translation> </message> <message> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <source>Edit label</source> <translation>Izmjeniti oznaku</translation> </message> <message> <source>Show transaction details</source> <translation>Prikaži detalje transakcije</translation> </message> <message> <source>Export Transaction History</source> <translation type="unfinished"/> </message> <message> <source>Exporting Failed</source> <translation type="unfinished"/> </message> <message> <source>There was an error trying to save the transaction history to %1.</source> <translation type="unfinished"/> </message> <message> <source>Exporting Successful</source> <translation type="unfinished"/> </message> <message> <source>The transaction history was successfully saved to %1.</source> <translation type="unfinished"/> </message> <message> <source>Comma separated file (*.csv)</source> <translation>Datoteka podataka odvojenih zarezima (*.csv)</translation> </message> <message> <source>Confirmed</source> <translation>Potvrđeno</translation> </message> <message> <source>Date</source> <translation>Datum</translation> </message> <message> <source>Type</source> <translation>Tip</translation> </message> <message> <source>Label</source> <translation>Oznaka</translation> </message> <message> <source>Address</source> <translation>Adresa</translation> </message> <message> <source>Amount</source> <translation>Iznos</translation> </message> <message> <source>ID</source> <translation>ID</translation> </message> <message> <source>Range:</source> <translation>Raspon:</translation> </message> <message> <source>to</source> <translation>za</translation> </message> </context> <context> <name>WalletFrame</name> <message> <source>No wallet has been loaded.</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <source>Send Coins</source> <translation>Slanje novca</translation> </message> </context> <context> <name>WalletView</name> <message> <source>&amp;Export</source> <translation>&amp;Izvoz</translation> </message> <message> <source>Export the data in the current tab to a file</source> <translation>Izvoz podataka iz trenutnog taba u datoteku</translation> </message> <message> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <source>Wallet Data (*.dat)</source> <translation>Podaci novčanika (*.dat)</translation> </message> <message> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <source>There was an error trying to save the wallet data to %1.</source> <translation type="unfinished"/> </message> <message> <source>The wallet data was successfully saved to %1.</source> <translation type="unfinished"/> </message> <message> <source>Backup Successful</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <source>Usage:</source> <translation>Upotreba:</translation> </message> <message> <source>List commands</source> <translation>Prikaži komande</translation> </message> <message> <source>Get help for a command</source> <translation>Potraži pomoć za komandu</translation> </message> <message> <source>Options:</source> <translation>Postavke:</translation> </message> <message> <source>Specify configuration file (default: globalboost.conf)</source> <translation>Odredi konfiguracijsku datoteku (ugrađeni izbor: globalboost.conf)</translation> </message> <message> <source>Specify pid file (default: globalboostd.pid)</source> <translation>Odredi proces ID datoteku (ugrađeni izbor: bitcoin.pid)</translation> </message> <message> <source>Specify data directory</source> <translation>Odredi direktorij za datoteke</translation> </message> <message> <source>Listen for connections on &lt;port&gt; (default: 8333 or testnet: 18333)</source> <translation>Slušaj na &lt;port&gt;u (default: 8333 ili testnet: 18333)</translation> </message> <message> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Održavaj najviše &lt;n&gt; veza sa članovima (default: 125)</translation> </message> <message> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <source>Specify your own public address</source> <translation>Odaberi vlastitu javnu adresu</translation> </message> <message> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Prag za odspajanje članova koji se čudno ponašaju (default: 100)</translation> </message> <message> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Broj sekundi koliko se članovima koji se čudno ponašaju neće dopustiti da se opet spoje (default: 86400)</translation> </message> <message> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 8332 or testnet: 18332)</source> <translation>Prihvaćaj JSON-RPC povezivanje na portu broj &lt;port&gt; (ugrađeni izbor: 8332 or testnet: 18332)</translation> </message> <message> <source>Accept command line and JSON-RPC commands</source> <translation>Prihvati komande iz tekst moda i JSON-RPC</translation> </message> <message> <source>GlobalBoost Core RPC client version</source> <translation type="unfinished"/> </message> <message> <source>Run in the background as a daemon and accept commands</source> <translation>Izvršavaj u pozadini kao uslužnik i prihvaćaj komande</translation> </message> <message> <source>Use the test network</source> <translation>Koristi test mrežu</translation> </message> <message> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=globalboostrpc 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;GlobalBoost Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <source>Continuously rate-limit free transactions to &lt;n&gt;*1000 bytes per minute (default:15)</source> <translation type="unfinished"/> </message> <message> <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> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly.</source> <translation type="unfinished"/> </message> <message> <source>Error: Listening for incoming connections failed (listen returned error %d)</source> <translation type="unfinished"/> </message> <message> <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> <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> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <source>Fees smaller than this are considered zero fee (for transaction creation) (default:</source> <translation type="unfinished"/> </message> <message> <source>Flush database activity from memory pool to disk log every &lt;n&gt; megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <source>How thorough the block verification of -checkblocks is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <source>In this mode -genproclimit controls how many blocks are generated immediately.</source> <translation type="unfinished"/> </message> <message> <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source> <translation type="unfinished"/> </message> <message> <source>Set the processor limit for when generation is on (-1 = unlimited, default: -1)</source> <translation type="unfinished"/> </message> <message> <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> <source>Unable to bind to %s on this computer. GlobalBoost Core is probably already running.</source> <translation type="unfinished"/> </message> <message> <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)</source> <translation type="unfinished"/> </message> <message> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Upozorenje: -paytxfee je podešen na preveliki iznos. To je iznos koji ćete platiti za obradu transakcije.</translation> </message> <message> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Bitcoin will not work properly.</source> <translation>Upozorenje: Molimo provjerite jesu li datum i vrijeme na vašem računalu točni. Ako vaš sat ide krivo, Bitcoin neće raditi ispravno.</translation> </message> <message> <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source> <translation type="unfinished"/> </message> <message> <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source> <translation type="unfinished"/> </message> <message> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <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 type="unfinished"/> </message> <message> <source>(default: 1)</source> <translation type="unfinished"/> </message> <message> <source>(default: wallet.dat)</source> <translation type="unfinished"/> </message> <message> <source>&lt;category&gt; can be:</source> <translation type="unfinished"/> </message> <message> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <source>GlobalBoost Core Daemon</source> <translation type="unfinished"/> </message> <message> <source>Block creation options:</source> <translation>Opcije za kreiranje bloka:</translation> </message> <message> <source>Clear list of wallet transactions (diagnostic tool; implies -rescan)</source> <translation type="unfinished"/> </message> <message> <source>Connect only to the specified node(s)</source> <translation>Poveži se samo sa određenim nodom</translation> </message> <message> <source>Connect through SOCKS proxy</source> <translation type="unfinished"/> </message> <message> <source>Connect to JSON-RPC on &lt;port&gt; (default: 8332 or testnet: 18332)</source> <translation type="unfinished"/> </message> <message> <source>Connection options:</source> <translation type="unfinished"/> </message> <message> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <source>Debugging/Testing options:</source> <translation type="unfinished"/> </message> <message> <source>Disable safemode, override a real safe mode event (default: 0)</source> <translation type="unfinished"/> </message> <message> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <source>Do not load the wallet and disable wallet RPC calls</source> <translation type="unfinished"/> </message> <message> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <source>Error: Disk space is low!</source> <translation>Pogreška: Nema prostora na disku!</translation> </message> <message> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <source>Error: system error: </source> <translation>Pogreška: sistemska pogreška:</translation> </message> <message> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <source>Fee per kB to add to transactions you send</source> <translation>Naknada po kB dodana transakciji koju šaljete</translation> </message> <message> <source>Fees smaller than this are considered zero fee (for relaying) (default:</source> <translation type="unfinished"/> </message> <message> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <source>Force safe mode (default: 0)</source> <translation type="unfinished"/> </message> <message> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <source>If &lt;category&gt; is not supplied, output all debugging information.</source> <translation type="unfinished"/> </message> <message> <source>Importing...</source> <translation type="unfinished"/> </message> <message> <source>Incorrect or no genesis block found. Wrong datadir for network?</source> <translation type="unfinished"/> </message> <message> <source>Invalid -onion address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <source>Prepend debug output with timestamp (default: 1)</source> <translation type="unfinished"/> </message> <message> <source>RPC client options:</source> <translation type="unfinished"/> </message> <message> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <source>Select SOCKS version for -proxy (4 or 5, default: 5)</source> <translation type="unfinished"/> </message> <message> <source>Set database cache size in megabytes (%d to %d, default: %d)</source> <translation type="unfinished"/> </message> <message> <source>Set maximum block size in bytes (default: %d)</source> <translation type="unfinished"/> </message> <message> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <source>Spend unconfirmed change when sending transactions (default: 1)</source> <translation type="unfinished"/> </message> <message> <source>This is intended for regression testing tools and app development.</source> <translation type="unfinished"/> </message> <message> <source>Usage (deprecated, use globalboost-cli):</source> <translation type="unfinished"/> </message> <message> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <source>Wait for RPC server to start</source> <translation type="unfinished"/> </message> <message> <source>Wallet %s resides outside data directory %s</source> <translation type="unfinished"/> </message> <message> <source>Wallet options:</source> <translation type="unfinished"/> </message> <message> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation type="unfinished"/> </message> <message> <source>You need to rebuild the database using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <source>Imports blocks from external blk000??.dat file</source> <translation>Importiraj blokove sa vanjskog blk000??.dat fajla</translation> </message> <message> <source>Cannot obtain a lock on data directory %s. GlobalBoost Core is probably already running.</source> <translation type="unfinished"/> </message> <message> <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <source>Output debugging information (default: 0, supplying &lt;category&gt; is optional)</source> <translation type="unfinished"/> </message> <message> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source> <translation type="unfinished"/> </message> <message> <source>Information</source> <translation>Informacija</translation> </message> <message> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <source>Limit size of signature cache to &lt;n&gt; entries (default: 50000)</source> <translation type="unfinished"/> </message> <message> <source>Log transaction priority and fee per kB when mining blocks (default: 0)</source> <translation type="unfinished"/> </message> <message> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Prihvati samo lance blokova koji se podudaraju sa ugrađenim checkpoint-ovima (default: 1)</translation> </message> <message> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <source>Print block on startup, if found in block index</source> <translation type="unfinished"/> </message> <message> <source>Print block tree on startup (default: 0)</source> <translation type="unfinished"/> </message> <message> <source>RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <source>RPC server options:</source> <translation type="unfinished"/> </message> <message> <source>Randomly drop 1 of every &lt;n&gt; network messages</source> <translation type="unfinished"/> </message> <message> <source>Randomly fuzz 1 of every &lt;n&gt; network messages</source> <translation type="unfinished"/> </message> <message> <source>Run a thread to flush wallet periodically (default: 1)</source> <translation type="unfinished"/> </message> <message> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>SSL postavke: (za detalje o podešavanju SSL opcija vidi Bitcoin Wiki)</translation> </message> <message> <source>Send command to GlobalBoost Core</source> <translation type="unfinished"/> </message> <message> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Šalji trace/debug informacije na konzolu umjesto u debug.log datoteku</translation> </message> <message> <source>Set minimum block size in bytes (default: 0)</source> <translation>Podesite minimalnu veličinu bloka u bajtovima (default: 0)</translation> </message> <message> <source>Sets the DB_PRIVATE flag in the wallet db environment (default: 1)</source> <translation type="unfinished"/> </message> <message> <source>Show all debugging options (usage: --help -help-debug)</source> <translation type="unfinished"/> </message> <message> <source>Show benchmark information (default: 0)</source> <translation type="unfinished"/> </message> <message> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Odredi vremenski prozor za spajanje na mrežu u milisekundama (ugrađeni izbor: 5000)</translation> </message> <message> <source>Start GlobalBoost Core Daemon</source> <translation type="unfinished"/> </message> <message> <source>System error: </source> <translation>Pogreška sistema:</translation> </message> <message> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 0)</translation> </message> <message> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Pokušaj koristiti UPnP da otvoriš port za uslugu (default: 1 when listening)</translation> </message> <message> <source>Username for JSON-RPC connections</source> <translation>Korisničko ime za JSON-RPC veze</translation> </message> <message> <source>Warning</source> <translation>Upozorenje</translation> </message> <message> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <source>Zapping all transactions from wallet...</source> <translation type="unfinished"/> </message> <message> <source>on startup</source> <translation type="unfinished"/> </message> <message> <source>version</source> <translation>verzija</translation> </message> <message> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <source>Password for JSON-RPC connections</source> <translation>Lozinka za JSON-RPC veze</translation> </message> <message> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Dozvoli JSON-RPC povezivanje s određene IP adrese</translation> </message> <message> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Pošalji komande nodu na adresi &lt;ip&gt; (ugrađeni izbor: 127.0.0.1)</translation> </message> <message> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Izvršite naredbu kada se najbolji blok promjeni (%s u cmd je zamjenjen sa block hash)</translation> </message> <message> <source>Upgrade wallet to latest format</source> <translation>Nadogradite novčanik u posljednji format.</translation> </message> <message> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Podesi memorijski prostor za ključeve na &lt;n&gt; (ugrađeni izbor: 100)</translation> </message> <message> <source>Rescan the block chain for missing wallet transactions</source> <translation>Ponovno pretraži lanac blokova za transakcije koje nedostaju</translation> </message> <message> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Koristi OpenSSL (https) za JSON-RPC povezivanje</translation> </message> <message> <source>Server certificate file (default: server.cert)</source> <translation>Uslužnikov SSL certifikat (ugrađeni izbor: server.cert)</translation> </message> <message> <source>Server private key (default: server.pem)</source> <translation>Uslužnikov privatni ključ (ugrađeni izbor: server.pem)</translation> </message> <message> <source>This help message</source> <translation>Ova poruka za pomoć</translation> </message> <message> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Program ne može koristiti %s na ovom računalu (bind returned error %d, %s)</translation> </message> <message> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Dozvoli DNS upite za dodavanje nodova i povezivanje</translation> </message> <message> <source>Loading addresses...</source> <translation>Učitavanje adresa...</translation> </message> <message> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Greška kod učitavanja wallet.dat: Novčanik pokvaren</translation> </message> <message> <source>Error loading wallet.dat: Wallet requires newer version of Bitcoin</source> <translation>Greška kod učitavanja wallet.dat: Novčanik zahtjeva noviju verziju Bitcoina</translation> </message> <message> <source>Wallet needed to be rewritten: restart Bitcoin to complete</source> <translation>Novčanik je trebao prepravak: ponovo pokrenite Bitcoin</translation> </message> <message> <source>Error loading wallet.dat</source> <translation>Greška kod učitavanja wallet.dat</translation> </message> <message> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Nevaljala -proxy adresa: &apos;%s&apos;</translation> </message> <message> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Nevaljali iznos za opciju -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <source>Invalid amount</source> <translation>Nevaljali iznos za opciju</translation> </message> <message> <source>Insufficient funds</source> <translation>Nedovoljna sredstva</translation> </message> <message> <source>Loading block index...</source> <translation>Učitavanje indeksa blokova...</translation> </message> <message> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Unesite nod s kojim se želite spojiti and attempt to keep the connection open</translation> </message> <message> <source>Loading wallet...</source> <translation>Učitavanje novčanika...</translation> </message> <message> <source>Cannot downgrade wallet</source> <translation>Nije moguće novčanik vratiti na prijašnju verziju.</translation> </message> <message> <source>Cannot write default address</source> <translation>Nije moguće upisati zadanu adresu.</translation> </message> <message> <source>Rescanning...</source> <translation>Rescaniranje</translation> </message> <message> <source>Done loading</source> <translation>Učitavanje gotovo</translation> </message> <message> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <source>Error</source> <translation>Greška</translation> </message> <message> <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 type="unfinished"/> </message> </context> </TS>
{ "content_hash": "de5fd625c6877b057a1410bbfee63b9e", "timestamp": "", "source": "github", "line_count": 3372, "max_line_length": 394, "avg_line_length": 35.2488137603796, "alnum_prop": 0.6338434615805282, "repo_name": "getcoin/globalboosty", "id": "5011920fc5eedccadcb9729b05f6b5ab1b654ba0", "size": "119122", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_hr.ts", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "167244" }, { "name": "C++", "bytes": "2950052" }, { "name": "CSS", "bytes": "1127" }, { "name": "Erlang", "bytes": "6761" }, { "name": "JavaScript", "bytes": "12" }, { "name": "Nu", "bytes": "293" }, { "name": "Objective-C++", "bytes": "6330" }, { "name": "PHP", "bytes": "2230" }, { "name": "Perl", "bytes": "27505" }, { "name": "Python", "bytes": "110559" }, { "name": "Shell", "bytes": "116646" }, { "name": "TypeScript", "bytes": "8991525" } ], "symlink_target": "" }
<!doctype html> <html lang="en"> <head> <title>Code coverage report for javascripts/profile/components/App.jsx</title> <meta charset="utf-8" /> <link rel="stylesheet" href="../../../prettify.css" /> <link rel="stylesheet" href="../../../base.css" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <style type='text/css'> .coverage-summary .sorter { background-image: url(../../../sort-arrow-sprite.png); } </style> </head> <body> <div class='wrapper'> <div class='pad1'> <h1> <a href="../../../index.html">all files</a> / <a href="index.html">javascripts/profile/components/</a> App.jsx </h1> <div class='clearfix'> <div class='fl pad1y space-right2'> <span class="strong">100% </span> <span class="quiet">Statements</span> <span class='fraction'>13/13</span> </div> <div class='fl pad1y space-right2'> <span class="strong">100% </span> <span class="quiet">Branches</span> <span class='fraction'>0/0</span> </div> <div class='fl pad1y space-right2'> <span class="strong">100% </span> <span class="quiet">Functions</span> <span class='fraction'>1/1</span> </div> <div class='fl pad1y space-right2'> <span class="strong">100% </span> <span class="quiet">Lines</span> <span class='fraction'>12/12</span> </div> </div> </div> <div class='status-line high'></div> <pre><table class="coverage"> <tr><td class="line-count quiet">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53</td><td class="line-coverage quiet"><span class="cline-any cline-yes">1×</span> <span class="cline-any cline-yes">1×</span> <span class="cline-any cline-yes">1×</span> <span class="cline-any cline-yes">1×</span> <span class="cline-any cline-yes">1×</span> <span class="cline-any cline-yes">1×</span> <span class="cline-any cline-yes">1×</span> <span class="cline-any cline-yes">1×</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1×</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1×</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">2×</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1×</span> <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import React from 'react'; import PropTypes from 'prop-types'; import { Col, Row, Tabs, Tab, Panel } from 'react-bootstrap'; import Favorites from './Favorites'; import UserInfo from './UserInfo'; import Security from './Security'; import RecentActivity from './RecentActivity'; import CreatedContent from './CreatedContent'; &nbsp; const propTypes = { user: PropTypes.object.isRequired, }; &nbsp; export default function App(props) { return ( &lt;div className="container app"&gt; &lt;Row&gt; &lt;Col md={3}&gt; &lt;UserInfo user={props.user} /&gt; &lt;/Col&gt; &lt;Col md={9}&gt; &lt;Tabs id="options"&gt; &lt;Tab eventKey={1} title={&lt;div&gt;&lt;i className="fa fa-star" /&gt; Favorites&lt;/div&gt;}&gt; &lt;Panel&gt;&lt;Favorites user={props.user} /&gt;&lt;/Panel&gt; &lt;/Tab&gt; &lt;Tab eventKey={2} title={ &lt;div&gt;&lt;i className="fa fa-paint-brush" /&gt; Created Content&lt;/div&gt; } &gt; &lt;Panel&gt; &lt;CreatedContent user={props.user} /&gt; &lt;/Panel&gt; &lt;/Tab&gt; &lt;Tab eventKey={3} title={&lt;div&gt;&lt;i className="fa fa-list" /&gt; Recent Activity&lt;/div&gt;}&gt; &lt;Panel&gt; &lt;RecentActivity user={props.user} /&gt; &lt;/Panel&gt; &lt;/Tab&gt; &lt;Tab eventKey={4} title={&lt;div&gt;&lt;i className="fa fa-lock" /&gt; Security &amp; Access&lt;/div&gt;}&gt; &lt;Panel&gt; &lt;Security user={props.user} /&gt; &lt;/Panel&gt; &lt;/Tab&gt; &lt;/Tabs&gt; &lt;/Col&gt; &lt;/Row&gt; &lt;/div&gt; ); } App.propTypes = propTypes; &nbsp;</pre></td></tr> </table></pre> <div class='push'></div><!-- for sticky footer --> </div><!-- /wrapper --> <div class='footer quiet pad2 space-top1 center small'> Code coverage generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 25 2017 16:16:59 GMT-0700 (PDT) </div> </div> <script src="../../../prettify.js"></script> <script> window.onload = function () { if (typeof prettyPrint === 'function') { prettyPrint(); } }; </script> <script src="../../../sorter.js"></script> </body> </html>
{ "content_hash": "944505b639f5aeda5441b716d5c56bbc", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 132, "avg_line_length": 31.18552036199095, "alnum_prop": 0.617382472431805, "repo_name": "lina9527/easybi", "id": "b96fdaf2206be38f616656b9f05c1f00b31715cb", "size": "6904", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "static/assets/coverage/lcov-report/javascripts/profile/components/App.jsx.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "76785" }, { "name": "HTML", "bytes": "3048686" }, { "name": "JavaScript", "bytes": "635778" }, { "name": "Mako", "bytes": "412" }, { "name": "Python", "bytes": "566451" }, { "name": "Shell", "bytes": "326" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8" ?> <ExampleDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <View>Examples/CreateStockCharts/MultiPane/CreateMultiPaneStockCharts.xaml</View> <ViewModel>Examples.CreateStockCharts.MultiPane.CreateMultiPaneStockChartsViewModel</ViewModel> <ViewModel /> <ImagePath>/SciChart.Examples;component/Resources/Images/ExampleImages/demoCreateMultiPaneStockCharts.png</ImagePath> <IconPath>IconCandlestick</IconPath> <ToolTipDescription>Using the SciChartGroup and SciStockChart control, create's a static multi-pane stock chart with Indicator and Volume panes</ToolTipDescription> <Description> An MVVM example which demonstrates creating a static multi-panel stock chart with Volume and Indicator panes using the [url='http://www.scichart.com/documentation/v4.x/webframe.html#SciChart.Charting~SciChart.Charting.Visuals.TradeChart.SciChartGroup.html']SciChartGroup[/url] control. All charts are synchronized by using the [url='http://www.scichart.com/documentation/v4.x/webframe.html#SciChart.Core~SciChart.Core.Utility.Mouse.MouseManager_members.html']MouseManager.MouseEventGroup[/url] attached property and by TwoWay binding all [url='http://www.scichart.com/documentation/v4.x/webframe.html#SciChart.Charting~SciChart.Charting.Visuals.Axes.AxisCore~VisibleRange.html']XAxis.VisibleRange[/url] properties to a common ViewModel property. Chart YAxis sizes are synchronized using the [url='http://www.scichart.com/documentation/v4.x/webframe.html#SciChart.Charting~SciChart.Charting.Visuals.TradeChart.SciChartGroup~VerticalChartGroupProperty.html']SciChartGroup.VerticalChartGroupId[/url] attached property. [url='http://support.scichart.com/index.php?/Knowledgebase/Article/View/17243/40/does-scichart-support-technical-indicators-like-macd-sma-ema-rsi']Technical Indicators[/url] are for demonstration purposes only. We recommend the open-source [url='http://ta-lib.org/']TA-Lib[/url] to integrate technical indicators to SciChart! [b][i]Example Usage[/i][/b] - Switch from OHLC to Candlestick chart. - Select Pan or Zoom mode. - Zoom to extents via button or double-clicking on the chart. - Drag XAxis and YAxis to scale. - Hover to see XY cursor values. - Change theme of the chart via the drop-down menu. [b]Documentation Links[/b] - [url='http://www.scichart.com/create-multipane-stock-charts-with-scichartgroup/']Create MultiPane Stock Charts with SciChartGroup[/url] - [url='http://www.scichart.com/how-to-add-a-scichartoverview-or-scrollbar-with-an-itemscontrol-of-charts-or-scichartgroup/']How to add a SciChartOverview or Scrollbar with an ItemsControl of charts, or SciChartGroup[/url] - [url='http://support.scichart.com/index.php?/Knowledgebase/Article/View/17243/40/does-scichart-support-technical-indicators-like-macd-sma-ema-rsi']Does SciChart Support Technical Indicators like MACD, SMA, EMA, RSI?[/url] - [url='http://www.scichart.com/documentation/v4.x/webframe.html#SciChart.Charting~SciChart.Charting.Visuals.TradeChart.SciChartGroup.html']SciChartGroup Type[/url] - [url='http://www.scichart.com/documentation/v4.x/webframe.html#SciChart.Core~SciChart.Core.Utility.Mouse.MouseManager_members.html']MouseManager.MouseEventGroup Property[/url] - [url='http://www.scichart.com/documentation/v4.x/webframe.html#SciChart.Charting~SciChart.Charting.Visuals.TradeChart.SciChartGroup~VerticalChartGroupProperty.html']SciChartGroup.VerticalChartGroupId Property[/url] </Description> <CodeFiles> <string>Resources/ExampleSourceFiles/CreateStockCharts/MultiPane/CreateMultiPaneStockCharts.xaml.txt</string> <string>Resources/ExampleSourceFiles/CreateStockCharts/MultiPane/CreateMultiPaneStockCharts.xaml.cs.txt</string> <string>Resources/ExampleSourceFiles/CreateStockCharts/MultiPane/CreateMultiPaneStockChartsViewModel.cs.txt</string> <string>Resources/ExampleSourceFiles/CreateStockCharts/MultiPane/PricePaneViewModel.cs.txt</string> <string>Resources/ExampleSourceFiles/CreateStockCharts/MultiPane/IndicatorPaneViewModel.cs.txt</string> <string>Resources/ExampleSourceFiles/CreateStockCharts/MultiPane/VolumePaneViewModel.cs.txt</string> <string>Resources/ExampleSourceFiles/CreateStockCharts/MultiPane/RsiPaneViewModel.cs.txt</string> <string>Resources/ExampleSourceFiles/CreateStockCharts/MultiPane/BaseChartPaneViewModel.cs.txt</string> <string>Resources/ExampleSourceFiles/CreateStockCharts/MultiPane/StockChartHelper.cs.txt</string> </CodeFiles> <Features> <Features>Stock</Features> <Features>Candlestick</Features> <Features>Band</Features> <Features>Line</Features> <Features>VerticalChartGroup</Features> <Features>SciChartGroup</Features> <Features>Trading</Features> </Features> </ExampleDefinition>
{ "content_hash": "173d1c2f9a02d8f39ef28422ade078ec", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 463, "avg_line_length": 84.51724137931035, "alnum_prop": 0.7962056303549572, "repo_name": "ABTSoftware/SciChart.WPF.Examples", "id": "cac9d69aa1eb054d95d14e6478485e508583e9e6", "size": "4904", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "v4.x/Examples/SciChart.Examples/Resources/ExampleDefinitions/b2D_Charts/Create_Stock_Charts/Multi-Pane_Stock_Charts.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "6" }, { "name": "C#", "bytes": "5454315" }, { "name": "HTML", "bytes": "10302" } ], "symlink_target": "" }
SHELL = /bin/sh srcdir = . top_srcdir = .. prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin sbindir = ${exec_prefix}/sbin libexecdir = ${exec_prefix}/libexec datadir = ${prefix}/share sysconfdir = ${prefix}/etc sharedstatedir = ${prefix}/com localstatedir = ${prefix}/var libdir = ${exec_prefix}/lib infodir = ${prefix}/info mandir = ${prefix}/man includedir = ${prefix}/include oldincludedir = /usr/include pkgdatadir = $(datadir)/libdnet pkglibdir = $(libdir)/libdnet pkgincludedir = $(includedir)/libdnet top_builddir = .. ACLOCAL = ${SHELL} /Users/norberto/src/nleite/sniffyourething/libdnet-1.12/config/missing --run aclocal-1.6 AUTOCONF = ${SHELL} /Users/norberto/src/nleite/sniffyourething/libdnet-1.12/config/missing --run autoconf AUTOMAKE = ${SHELL} /Users/norberto/src/nleite/sniffyourething/libdnet-1.12/config/missing --run automake-1.6 AUTOHEADER = ${SHELL} /Users/norberto/src/nleite/sniffyourething/libdnet-1.12/config/missing --run autoheader am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = /usr/local/bin/ginstall -c INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = ${INSTALL} INSTALL_HEADER = $(INSTALL_DATA) transform = s,x,x, NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = host_triplet = i386-apple-darwin13.4.0 EXEEXT = OBJEXT = o PATH_SEPARATOR = : AMTAR = ${SHELL} /Users/norberto/src/nleite/sniffyourething/libdnet-1.12/config/missing --run tar AR = ar AS = @AS@ AWK = awk CC = gcc CHECKINC = CHECKLIB = CXX = g++ CXXCPP = g++ -E DEPDIR = .deps DLLTOOL = @DLLTOOL@ ECHO = /bin/echo EGREP = grep -E F77 = gfortran GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s MAINT = # OBJDUMP = @OBJDUMP@ PACKAGE = libdnet PYTHON = RANLIB = ranlib RC = @RC@ STRIP = strip TCLINC = TCLLIB = VERSION = 1.12 ac_aux_dir = config am__include = include am__quote = install_sh = /Users/norberto/src/nleite/sniffyourething/libdnet-1.12/config/install-sh AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include SUBDIRS = check dnet subdir = test mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: # Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile Makefile: # $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
{ "content_hash": "77a6a0c38d93fa9e43f828ace18b86a2", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 110, "avg_line_length": 29.368115942028986, "alnum_prop": 0.6568298460323727, "repo_name": "nleite/sniffyourething", "id": "ecd3ccba3c40b9b661c48987404f19dd958bfe6f", "size": "10768", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libdnet-1.12/test/Makefile", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1276856" }, { "name": "Groff", "bytes": "52430" }, { "name": "Makefile", "bytes": "80235" }, { "name": "Python", "bytes": "125911" }, { "name": "Shell", "bytes": "677756" } ], "symlink_target": "" }
package org.apache.jena.atlas.io; import java.io.IOException; import java.io.Reader; /** Machinery to add Reader functionality to a CharStream. * No {@code synchronized} is used for {@link #read()}. */ public abstract class CharStreamReader extends Reader implements CharStream { private boolean isClosed = false; @Override public int read(char[] cbuf, int off, int len) throws IOException { if ( isClosed ) return -1; for ( int i = off ; i < off + len ; i++ ) { int x = advance(); if ( x == -1 ) { close(); if ( i == off ) return -1; return (i - off); } cbuf[i] = (char)x; } return len; } @Override public int read() throws IOException { if ( isClosed ) return -1; return advance(); } @Override public void close() throws IOException { if ( isClosed ) return; isClosed = true; closeStream(); } @Override public boolean ready() throws IOException { return !isClosed; } @Override public abstract int advance(); @Override public abstract void closeStream(); }
{ "content_hash": "5fe4064d8322ab901f26c6a3e98949be", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 77, "avg_line_length": 22.29824561403509, "alnum_prop": 0.5287175452399685, "repo_name": "apache/jena", "id": "4677cda99ec990cd87ec1e0c32fde9a6bcf6b9ef", "size": "2076", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "jena-base/src/main/java/org/apache/jena/atlas/io/CharStreamReader.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "22246" }, { "name": "C++", "bytes": "5877" }, { "name": "CSS", "bytes": "3241" }, { "name": "Dockerfile", "bytes": "3341" }, { "name": "Elixir", "bytes": "2548" }, { "name": "HTML", "bytes": "69029" }, { "name": "Haml", "bytes": "30030" }, { "name": "Java", "bytes": "35185092" }, { "name": "JavaScript", "bytes": "72788" }, { "name": "Lex", "bytes": "82672" }, { "name": "Makefile", "bytes": "198" }, { "name": "Perl", "bytes": "35662" }, { "name": "Python", "bytes": "416" }, { "name": "Ruby", "bytes": "216471" }, { "name": "SCSS", "bytes": "4242" }, { "name": "Shell", "bytes": "264124" }, { "name": "Thrift", "bytes": "3755" }, { "name": "Vue", "bytes": "104702" }, { "name": "XSLT", "bytes": "65126" } ], "symlink_target": "" }
ngram package ============= .. automodule:: ngram :members: :undoc-members: :show-inheritance: ngram.generate module --------------------- .. automodule:: ngram.generate :members: :undoc-members: :show-inheritance: ngram.ngram_helper module ------------------------- .. automodule:: ngram.ngram_helper :members: :undoc-members: :show-inheritance: ngram.train module ------------------ .. automodule:: ngram.train :members: :undoc-members: :show-inheritance:
{ "content_hash": "f8178e2e4f960ca65730184a63051cbe", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 34, "avg_line_length": 16.0625, "alnum_prop": 0.5622568093385214, "repo_name": "jasonsbrooks/ARTIST", "id": "030088efffe527cfebbcac60430bdfe46a56caeb", "size": "514", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/src/artist_generator/ngram.rst", "mode": "33188", "license": "mit", "language": [ { "name": "CMake", "bytes": "777" }, { "name": "Python", "bytes": "29649" } ], "symlink_target": "" }
title: Factoring Polynomials Common Factor localeTitle: Фактор факторинга Общий коэффициент --- ## Фактор факторинга Общий коэффициент Это заглушка. [Помогите нашему сообществу расширить его](https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/factoring-polynomials-common-factor/index.md) . [Это руководство по быстрому стилю поможет вам принять ваш запрос на тягу](https://github.com/freecodecamp/guides/blob/master/README.md) . #### Дополнительная информация:
{ "content_hash": "842539d9a52d11cc00b56bc0d8accdfc", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 177, "avg_line_length": 48.6, "alnum_prop": 0.8106995884773662, "repo_name": "otavioarc/freeCodeCamp", "id": "5382dbe8257fe58a0728c3f9e757b66385d1ed54", "size": "686", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "guide/russian/mathematics/factoring-polynomials-common-factor/index.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "35491" }, { "name": "HTML", "bytes": "17600" }, { "name": "JavaScript", "bytes": "777274" } ], "symlink_target": "" }
The OWASP Zed Attack Proxy (ZAP) is an easy to use integrated penetration testing tool for finding vulnerabilities in web applications. It is designed to be used by people with a wide range of security experience and as such is ideal for developers and functional testers who are new to penetration testing as well as being a useful addition to an experienced pen testers toolbox. [![](https://raw.githubusercontent.com/wiki/zaproxy/zaproxy/images/ZAP-Download.png)](https://github.com/zaproxy/zaproxy/wiki/Downloads) For more general information about ZAP go to the [ZAP home page](https://www.owasp.org/index.php/ZAP) We are in the process of migrating ZAP from Google Code. Current status: * zap-extensions migrated to https://github.com/zaproxy/zap-extensions * ZAP core help migrated to https://github.com/zaproxy/zap-core-help * Permissions removed from the Google Code repo * ZAP wiki moved to https://github.com/zaproxy/zaproxy/wiki * The source code and issues have also been migrated * Still to do - lots of tidying up of links ;) More details on this [ZAP Developer Group thread](https://groups.google.com/d/msg/zaproxy-develop/H3GzoTf9MEI/Jco2UljUTkoJ)
{ "content_hash": "4a2d9c69dd93776844334cd7e85d0683", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 244, "avg_line_length": 61.68421052631579, "alnum_prop": 0.78839590443686, "repo_name": "robocoder/zaproxy", "id": "cc689258e3d89f64df4d03356a447e99032d743c", "size": "1303", "binary": false, "copies": "1", "ref": "refs/heads/wip/socks-proxy", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4583" }, { "name": "CSS", "bytes": "592" }, { "name": "HTML", "bytes": "2951758" }, { "name": "Java", "bytes": "7309277" }, { "name": "JavaScript", "bytes": "118416" }, { "name": "Lex", "bytes": "7594" }, { "name": "Makefile", "bytes": "4630" }, { "name": "PHP", "bytes": "82544" }, { "name": "Perl", "bytes": "3826" }, { "name": "Python", "bytes": "117762" }, { "name": "Shell", "bytes": "2298" }, { "name": "XSLT", "bytes": "13763" } ], "symlink_target": "" }
require 'rest-client' # ECS API 的服务接入地址为:ecs.aliyuncs.com # 支持通过 HTTP 或 HTTPS 通道进行请求通信。为了获得更高的安全性,推荐您使用 HTTPS 通道发送请求。 # 每个请求都需要指定要执行的操作,即 Action 参数(例如 StartInstance),以及每个操作都需要包含的公共请求参数和指定操作所特有的请求参数。 # 支持 HTTP GET 方法发送请求,这种方式下请求参数需要包含在请求的 URL 中。 # 请求及返回结果都使用 UTF-8 字符集进行编码。 # 公共请求参数 # 名称 类型 是否必须 描述 # Format String 否 返回值的类型,支持 JSON 与 XML。默认为 XML。 # Version String 是 API 版本号,为日期形式:YYYY-MM-DD,本版本对应为 2014-05-26。 # AccessKeyId String 是 阿里云颁发给用户的访问服务所用的密钥 ID。 # Signature String 是 签名结果串,关于签名的计算方法,请参见<签名机制>。 # SignatureMethod String 是 签名方式,目前支持 HMAC-SHA1。 # Timestamp String 是 请求的时间戳。日期格式按照 ISO8601 标准表示,并需要使用 UTC 时间。格式为: # YYYY-MM-DDThh:mm:ssZ # 例如,2014-05-26T12:00:00Z(为北京时间 2014 年 5 月 26 日 12 点 0 分 0 秒)。 # SignatureVersion String 是 签名算法版本,目前版本是 1.0。 # SignatureNonce String 是 唯一随机数,用于防止网络重放攻击。用户在不同请求间要使用不同的随机数值 # ResourceOwnerAccount String 否 本次 API 请求访问到的资源拥有者账户,即登录用户名。 # 此参数的使用方法,详见< 借助 RAM 实现子账号对主账号的 ECS 资源访问 >,(只能在 RAM 中可对 ECS 资源进行授权的 Action 中才能使用此参数,否则访问会被拒绝) # 用户发送的每次接口调用请求,无论成功与否,系统都会返回一个唯一识别码 RequestId 给用户。 url = "https://ecs.aliyuncs.com" params = {:Format => 'JSON', :Version => '2014-05-26', :AccessKeyId => '', :Signature => '', :SignatureMethod => 'HMAC-SHA1', :Timestamp => '', :SignatureVersion => '1.0', :SignatureNonce => '' #, :ResourceOwnerAccount => '' } # (a) 按照参数名称的字典顺序对请求中所有的请求参数(包括文档中描述的“公共请求参数”和给定了的请求接口的自定义参数,但不能包括“公共请求参数”中提到 Signature 参数本身)进行排序。 # b) 对每个请求参数的名称和值进行编码。名称和值要使用 UTF-8 字符集进行 URL 编码,URL 编码的编码规则是 # (c) 对编码后的参数名称和值使用英文等号(\=)进行连接。 # (d) 再把英文等号连接得到的字符串按参数名称的字典顺序依次使用 &符号连接,即得到规范化请求字符串。 # 以 DescribeRegions 为例,签名前的请求 URL 为: # http://ecs.aliyuncs.com/?TimeStamp=2012-12-26T10:33:56Z&Format=XML&AccessKeyId=testid&Action=DescribeRegions&SignatureMethod=HMAC-SHA1&RegionId=region1&SignatureNonce=NwDAxvLU6tFE0DVb&Version=2014-05-26&SignatureVersion=1.0 # StringToSign= # HTTPMethod + “&” + # percentEncode(“/”) + ”&” + # percentEncode(CanonicalizedQueryString) # GET&%2F&AccessKeyId%3Dtestid%26Action%3DDescribeRegions%26Format%3DXML%26RegionId%3Dregion1%26SignatureMethod%3DHMAC-SHA1%26SignatureNonce%3DNwDAxvLU6tFE0DVb%26SignatureVersion%3D1.0%26TimeStamp%3D2012-12-26T10%253A33%253A56Z%26Version%3D2014-05-26 # 假如使用的 Access Key Id 是 “testid”,Access Key Secret 是 “testsecret”,用于计算 HMAC 的 Key 就是 “testsecret&”,则计算得到的签名值是: # SDFQNvyH5rtkc9T5Fwo8DOjw5hc= # 签名后的请求 URL 为(注意增加了 Signature 参数): # http://ecs.aliyuncs.com/?TimeStamp=2012-12-26T10%3A33%3A56Z&Format=XML&AccessKeyId=testid&Action=DescribeRegions&SignatureMethod=HMAC-SHA1&RegionId=region1&SignatureNonce=NwDAxvLU6tFE0DVb&Version=2012-09-13&SignatureVersion=1.0&Signature=SDFQNvyH5rtkc9T5Fwo8DOjw5hc%3d # { # "RequestId": "8906582E-6722-409A-A6C4-0E7863B733A5", # "HostId": "ecs.aliyuncs.com", # "Code": "UnsupportedOperation", # "Message": "The specified action is not supported." # } # 公共错误码 # 错误代码 描述 Http 状态码 语义 # MissingParameter The input parameter "Action" that is mandatory for processing this request is not supplied 400 缺少 Action 字段 # MissingParameter The input parameter "AccessKeyId" that is mandatory for processing this request is not supplied 400 缺少 AccessKeyId 字段 # MissingParameter An input parameter "Signature" that is mandatory for processing the request is not supplied. 400 缺少 Signature 字段 # MissingParameter The input parameter "TimeStamp" that is mandatory for processing this request is not supplied 400 缺少 Timestamp 字段 # MissingParameter The input parameter "Version" that is mandatory for processing this request is not supplied 400 缺少 Version 字段 # InvalidParameter The specified parameter "Action or Version" is not valid. 400 无效的 Action 值(该 API 不存在) # InvalidAccessKeyId.NotFound The Access Key ID provided does not exist in our records. 400 无效的 AccessKeyId 值(该 key 不存在) # Forbidden.AccessKeyDisabled The Access Key is disabled. 403 该 AccessKey 处于禁用状态 # IncompleteSignature The request signature does not conform to Aliyun standards. 400 无效的 Signature 取值(签名结果错误) # InvalidParamater The specified parameter "SignatureMethod" is not valid. 400 无效的 SignatureMethod 取值 # InvalidParamater The specified parameter "SignatureVersion" is not valid. 400 无效的 SignatureVersion 取值 # IllegalTimestamp The input parameter "Timestamp" that is mandatory for processing this request is not supplied. 400 无效的 Timestamp 取值(Timestamp 与服务器时间相差超过了 1 个小时) # SignatureNonceUsed The request signature nonce has been used. 400 无效的 SignatureNonce(该 SignatureNonce 值已被使用过) # InvalidParameter The specified parameter "Action or Version" is not valid. 400 无效的 Version 取值 # InvalidOwnerId The specified OwnerId is not valid. 400 无效的 OwnerId 取值 # InvalidOwnerAccount The specified OwnerAccount is not valid. 400 无效的 OwnerAccount 取值 # InvalidOwner OwnerId and OwnerAccount can't be used at one API access. 400 同时使用了 OwnerId 和 OwnerAccount # Throttling Request was denied due to request throttling. 400 因系统流控拒绝访问 # Throttling Request was denied due to request throttling. 400 该 key 的调用 quota 已用完 # InvalidAction Specified action is not valid. 403 该 key 无权调用该 API # UnsupportedHTTPMethod This http method is not supported. 403 用户使用了不支持的 Http Method(当前 TOP 只支持 post 和 get) # ServiceUnavailable The request has failed due to a temporary failure of the server. 500 服务不可用 # UnsupportedParameter The parameter ”<parameter name>” is not supported. 400 使用了无效的参数 # InternalError The request processing has failed due to some unknown error, exception or failure. 500 其他情况 # MissingParameter The input parameter OwnerId,OwnerAccount that is mandatory for processing this request is not supplied. 403 调用该接口没有指定 OwnerId # Forbidden.SubUser The specified action is not available for you。 403 无权调用订单类接口 # UnsupportedParameter The parameter ”<parameter name>” is not supported. 400 该参数无权使用 # Forbidden.InstanceNotFound The specified Instance is not found, so we cann't get enough information to check permission in RAM. 404 使用了 RAM 授权子账号进行资源访问,但是本次访问涉及到的 Instance 不存在 # Forbidden.DiskNotFound The specified Disk is not found, so we cann't get enough information to check permission in RAM. 404 使用了 RAM 授权子账号进行资源访问,但是本次访问涉及到的 Disk 不存在 # Forbidden.SecurityGroupNotFound The specified SecurityGroup is not found, so we cann't get enough information to check permission in RAM. 404 使用了 RAM 授权子账号进行资源访问,但是本次访问涉及到的 SecurityGroup 不存在 # Forbidden.SnapshotNotFound The specified Snapshot is not found, so we cann't get enough information to check permission in RAM. 404 使用了 RAM 授权子账号进行资源访问,但是本次访问涉及到的 Snapshot 不存在 # Forbidden.ImageNotFound The specified Image is not found, so we cann't get enough information to check permission in RAM. 404 使用了 RAM 授权子账号进行资源访问,但是本次访问涉及到的 Image 不存在 # Forbidden.RAM User not authorized to operate the specified resource, or this API doesn't support RAM. 403 使用了 RAM 授权子账号进行资源访问,但是本次操作没有被正确的授权 # Forbidden.NotSupportRAM This action does not support accessed by RAM mode. 403 该接口不允许使用 RAM 方式进行访问 # Forbidden.RiskControl This operation is forbidden by Aliyun Risk Control system. 403 阿里云风控系统拒绝了此次访问 # InsufficientBalance Your account does not have enough balance. 400 余额不足 # IdempotentParameterMismatch Request uses a client token in a previous request but is not identical to that request. 400 使用了一个已经使用过的 ClientToken,但此次请求内容却又与上一次使用该 Token 的 request 不一样. # RealNameAuthenticationError Your account has not passed the real-name authentication yet. 403 用户未进行实名认证 # InvalidIdempotenceParameter.Mismatch The specified parameters are different from before 403 幂等参数不匹配 # LastTokenProcessing The last token request is processing 403 上一次请求还在处理中 # InvalidParameter The specified parameter is not valid 400 参数校验失败
{ "content_hash": "e52b1f767f9af99f820ab257e9bcb8ff", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 270, "avg_line_length": 59.75590551181102, "alnum_prop": 0.7958887864013704, "repo_name": "prew/test", "id": "64d6717e4311952608470c29c1b5e33effbd14b7", "size": "10029", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "11651" } ], "symlink_target": "" }
var router = require('express').Router(), service = require('../services/band'); // ===== query all ================================================== router.get('/', function (req, res) { service.findAll(function (err, body) { if (err) { res.send(500, 'internal error while finding all bands (reason: ' + err + ')'); } else { res.json(body); } }); }); module.exports = router;
{ "content_hash": "e07dca9fe2e0f602d940c4980f46144a", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 84, "avg_line_length": 27.266666666666666, "alnum_prop": 0.5036674816625917, "repo_name": "efg-ludwigshafen/song-graph", "id": "da0a241b4d0b22ce846c5352cff269d51df643f1", "size": "409", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "routes/band.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "134" }, { "name": "JavaScript", "bytes": "26846" } ], "symlink_target": "" }
<project name="PacketStorm" default="jre" basedir="../.."> <!-- application-specific. Make sure basedir matches path. --> <description> Packet Storm </description> <property name="jarname" value="PacketStorm"/> <property name="apppath" value="examples/packetstorm"/> <property name="mainclass" value="examples.packetstorm.PacketStorm"/> <!-- the same for all applications --> <property name="jars" value="jars"/> <property name="destdir" value="classes-examples"/> <!-- j2me specific stuff --> <property environment="env"/> <property name="cldcapi" value="${env.WTK_HOME}/lib/cldcapi11.jar"/> <property name="midpapi" value="${env.WTK_HOME}/lib/midpapi20.jar"/> <property name="preverify" value="${env.WTK_HOME}/bin/preverify"/> <property name="proguard" value="${env.PROGUARD_HOME}/lib/proguard.jar"/> <property name="jartojad" value="jars/jar2jad.jar"/> <!-- android specific stuff --> <condition property="android" value="${env.ANDROID_HOME}/tools/android.bat" else ="${env.ANDROID_HOME}/tools/android"> <os family="windows"/> </condition> <!-- sign with secret key when -Dpublish is passed --> <condition property="androidbuildproperties" value="build.properties.secret" else="build.properties"> <isset property="publish"/> </condition> <target name="mkdirs" description="Create destination directories"> <delete dir="${destdir}"/> <mkdir dir="${destdir}"/> <mkdir dir="${jars}"/> <copy todir="${destdir}/${apppath}"> <fileset dir="${apppath}"> <include name="*.tbl"/> <include name="*.jpg"/> <include name="*.png"/> <include name="*.gif"/> <include name="*.wav"/> </fileset> </copy> </target> <!-- <target name="mkdirs-android" description="Create destination directories"> <delete dir="${destdir}"/> <mkdir dir="${destdir}"/> <mkdir dir="${jars}"/> <copy todir="${destdir}/assets"> <fileset dir="${apppath}"> <include name="*.tbl"/> <include name="*.jpg"/> <include name="*.png"/> <include name="*.gif"/> <include name="*.wav"/> </fileset> </copy> </target> --> <target name="jre" description="Compile for JRE" depends="mkdirs"> <copy todir="${destdir}"> <fileset dir="classes-jre"/> </copy> <javac srcdir="." destdir="${destdir}" source="1.3" target="1.3" debug="true"> <include name="${apppath}/*.java"/> </javac> <jar destfile="${jars}/${jarname}.jar"> <fileset dir="${destdir}"/> <manifest> <attribute name="Main-class" value="${mainclass}"/> </manifest> </jar> </target> <target name="jogl" description="Compile for JRE-JOGL" depends="mkdirs"> <copy todir="${destdir}"> <fileset dir="classes-jogl"/> </copy> <javac srcdir="." destdir="${destdir}" source="1.4" target="1.4" debug="true"> <include name="${apppath}/*.java"/> </javac> <jar destfile="${jars}/${jarname}Jogl.jar"> <fileset dir="${destdir}"/> <manifest> <attribute name="Main-class" value="${mainclass}"/> </manifest> </jar> </target> <!-- not yet ready <target name="android" description="Compile for Android" depends="mkdirs-android"> <copy todir="${destdir}/src"> <fileset dir="src-base"/> </copy> <copy todir="${destdir}"> <fileset dir="src-android"/> </copy> <copy todir="${destdir}"> <fileset dir="${apppath}"> <include name="AndroidManifest.xml"/> </fileset> </copy> <copy file="${apppath}/${androidbuildproperties}" tofile="${destdir}/build.properties" /> <copy todir="${destdir}/res"> <fileset dir="${apppath}/res"/> </copy> <copy todir="${destdir}/src/${apppath}"> <fileset dir="${apppath}"> <include name="*.java"/> </fileset> </copy> <exec executable="${android}" dir="${destdir}"> <arg value="update"/> <arg value="project"/> <arg value="- -name"/> please remove space <arg value="${jarname}"/> <arg value="- -target"/> please remove space <arg value="android-8"/> <arg value="- -path"/> please remove space <arg value="."/> </exec> <ant dir="${destdir}" target="release"/> </target> --> <target name="midp" description="Compile for J2ME" depends="mkdirs"> <delete dir="${destdir}-tmp"/> <mkdir dir="${destdir}-tmp"/> <javac srcdir="." destdir="${destdir}-tmp" source="1.3" target="1.3" debug="true" bootclasspath="${cldcapi};${midpapi}" classpath="classes-midp"> <include name="${apppath}/*.java"/> </javac> <exec executable="${preverify}"> <arg value="-classpath"/> <arg value="${cldcapi}${path.separator}${midpapi}${path.separator}classes-midp"/> <arg value="-d"/> <arg value="${destdir}"/> <arg value="${destdir}-tmp"/> </exec> <jar destfile="${jars}/${jarname}Midlet.jar"> <fileset dir="${destdir}"/> <fileset dir="classes-midp"/> <manifest> <attribute name="MIDlet-1" value="${jarname}, , ${mainclass}"/> <attribute name="MIDlet-Name" value="${jarname}"/> <attribute name="MIDlet-Jar-URL" value="${jarname}Midlet.jar"/> <attribute name="MIDlet-Vendor" value="JGame"/> <attribute name="MIDlet-Version" value="1.2"/> <attribute name="MicroEdition-Configuration" value="CLDC-1.1"/> <attribute name="MicroEdition-Profile" value="MIDP-2.0"/> </manifest> </jar> <!-- shrink using proguard (optional) --> <mkdir dir="${destdir}-shrunk-tmp"/> <mkdir dir="${destdir}-shrunk"/> <java jar="${proguard}" fork="true"> <arg value="-dontusemixedcaseclassnames"/> <arg value="-libraryjars ${cldcapi}"/> <arg value="-libraryjars ${midpapi}"/> <arg value="-allowaccessmodification"/> <arg value="-overloadaggressively"/> <arg value="-defaultpackage ''"/> <arg value="-verbose"/> <arg value="-keep"/> <arg value="public class * extends javax.microedition.midlet.MIDlet"/> <arg value="-injars ${jars}/${jarname}Midlet.jar"/> <arg value="-outjars ${destdir}-shrunk-tmp/${jarname}Midlet.jar"/> </java> <exec executable="${preverify}"> <arg value="-classpath"/> <arg value="${cldcapi}${path.separator}${midpapi}"/> <arg value="-d"/> <arg value="${destdir}-shrunk"/> <arg value="${destdir}-shrunk-tmp/${jarname}Midlet.jar"/> </exec> <copy file="${destdir}-shrunk/${jarname}Midlet.jar" todir="${jars}"/> <!-- finally, create jad --> <java jar="${jartojad}" fork="true"> <arg value="${jars}/${jarname}Midlet.jar"/> <arg value="${jars}/${jarname}Midlet.jad"/> </java> <!-- stat -c '%s' ${APPNAME}.jar | xargs echo 'MIDlet-Jar-Size:' | \ cat ${MANIFESTNAME} /dev/stdin >${APPNAME}.jad --> </target> </project>
{ "content_hash": "1fa48eae6ff433e2ac6b4bb7c6f70c85", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 84, "avg_line_length": 32.56716417910448, "alnum_prop": 0.6223648029330889, "repo_name": "UTFPR-Guarapuava-TSI/pong", "id": "3f4aa67385c671e4940bfab7871bb7b0d8a47714", "size": "6546", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/JGame-20120810/examples/packetstorm/build.xml", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1391" }, { "name": "Java", "bytes": "2021396" }, { "name": "PHP", "bytes": "27584" }, { "name": "Perl", "bytes": "1685" }, { "name": "Shell", "bytes": "2657" } ], "symlink_target": "" }
var util = require('util'), debug = require('debug')('kaching-paypal'), paypal_sdk = require('paypal-rest-sdk'), Strategy = require('kaching').Strategy; /** * `PaypalStrategy` constructor. * * @param {Object} options * @api public */ function PaypalStrategy (options) { this.name = 'paypal'; if (!options || !options.client_id || !options.client_secret) { throw new Error('PaypalStrategy: missing client_id or client_secret. '); } options.host = options.host || 'api.sandbox.paypal.com'; options.port = options.port || ''; paypal_sdk.configure(options); } util.inherits(PaypalStrategy, Strategy); /** * Create payment request. * * Example: * app.get('/kaching/paypal', function(req, res, next) { * // Setup payment detail in `req.payment` * req.payment = { * amount:{ * total:'7.47', * currency:'USD' * }, * description:'Kaching paypal test transaction' * }; * next(); * }, kaching.create('paypal', { * redirect_urls: { * return_url: 'http://localhost:3000/kaching/paypal/return', * cancel_url: 'http://localhost:3000/kaching/paypal/cancel' * } * }), function(req, res) { res.json(req.payment); }); * * @param {Object} payment * @param {Object} options * @param {Function} callback * @api protected */ PaypalStrategy.prototype.create = function(payment, options, callback) { var self = this; // Construct payment detail var payment_detail = {}; payment_detail.intent = payment.intent || options.intent || 'sale'; payment_detail.redirect_urls = payment.redirect_urls || options.redirect_urls; // Construct payer detail var payer = payment_detail.payer = {}; payer.payment_method = payment.payment_method || options.payment_method || 'paypal'; payer.funding_instruments = payment.funding_instruments; payer.payer_info = payment.payer_info; // Construct transaction detail var transactions = payment_detail.transactions = []; var transaction = transactions[0] = {}; transaction.amount = payment.amount; transaction.item_list = payment.item_list; transaction.description = payment.description; // Send create request to paypal debug('Creating paypal payment:' + JSON.stringify(payment_detail, null, ' ')); paypal_sdk.payment.create(payment_detail, function(err, payment){ // Invoke callback callback(err, payment); // Handle error if(err){ return self.error(err); } // Store payment in session object // self.session[payment.id] = payment; debug('Paypal payment created: ' + JSON.stringify(payment, null, ' ')); self.pass(); }); }; /** * Proceed to approval process. * * @param {Object} payment * @param {Object} options * @param {Function} callback * @api protected */ Strategy.prototype.approve = function(payment, options, callback) { // Fetch the approval_url, and redirect to let user complete the payment. var approvalUrl = payment.links.reduce(function(prev, cur) { return prev || (cur.rel === 'approval_url' ? cur.href : null); }, null); if (approvalUrl) { this.redirect(approvalUrl); } else { return this.error(new Error('Could not find approval_url in payment.links')); } }; /** * Execute an approved payment. * * @param {Object} payment * @param {Object} options * @param {Function} callback * @api protected */ Strategy.prototype.execute = function(payment, options, callback) { var self = this; var execute_payment_details = { payer_id: payment.payer_id }; paypal_sdk.payment.execute(payment.id, execute_payment_details, function(err, payment){ // Invoke callback callback(err, payment); // Handle error if(err){ return self.error(err); } // Store payment in session object // self.session[payment.id] = payment; debug('Paypal payment executed: ' + JSON.stringify(payment, null, ' ')); self.pass(); }); }; module.exports = exports = PaypalStrategy;
{ "content_hash": "14fd884938581e15f4fe961c336cdbda", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 89, "avg_line_length": 28.71014492753623, "alnum_prop": 0.6590106007067138, "repo_name": "gregwym/kaching-paypal", "id": "b22cdfa4448d61488502b7ac2fed67bbf75214cc", "size": "3962", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "3962" } ], "symlink_target": "" }
import express from 'express'; import sortBy from 'lodash/sortBy'; import { URL } from 'url'; import { Stream, User } from '../db'; import errors from '../http_errors'; const isValidAdvancedUrl = require('../util/is-valid-advanced-url')(URL); const api = express.Router(); api.get('/streamer/:name', async (req, res, next) => { try { const dbUser = await User.findById(req.params.name); if (!dbUser) { throw new errors.NotFound(); } res.json({ service: dbUser.service, channel: dbUser.channel, }); } catch (err) { return next(err); } }); // Returns private information. Requires the "jwt" cookie to contain a valid token. api.get('/profile', async (req, res, next) => { try { // Unauthorized. if (!req.session) { throw new errors.Unauthorized(); } const dbUser = await User.findById(req.session.id); if (!dbUser) { throw new errors.NotFound(); } res.json({ username: dbUser.id, service: dbUser.service, channel: dbUser.channel, left_chat: dbUser.left_chat, is_admin: dbUser.is_admin, }); } catch (err) { return next(err); } }); // Save changes to profile data. Returns updated profile data. api.post('/profile', async (req, res, next) => { try { if (!req.session) { throw new errors.Unauthorized(); } const dbUser = await User.findById(req.session.id); if (!dbUser) { throw new errors.NotFound(); } // Basic channel name sanitization let { channel, service } = req.body; if ((service !== 'advanced' && !/^[a-zA-Z0-9\-_]{1,64}$/.test(channel)) || (service === 'advanced' && !isValidAdvancedUrl(channel))) { throw new errors.BadRequest('Invalid channel for the selected service'); } // Encode any Unicode symbols in advanced channel URLs into a Punycode // string of ASCII symbols. This prevents users from cluttering up the // streams page with tons of emojis. if (service === 'advanced') { channel = new URL(channel).href; } await dbUser.update({ service: req.body.service || dbUser.service, channel: channel || dbUser.channel, left_chat: req.body.hasOwnProperty('left_chat') && typeof req.body.left_chat === 'boolean' ? req.body.left_chat : dbUser.left_chat, }); res.json({ username: dbUser.id, service: dbUser.service, channel: dbUser.channel, left_chat: dbUser.left_chat, }); } catch (error) { return next(error); } }); api.get('/users', async (req, res, next) => { if (!req.session) { return next(new errors.Unauthorized()); } const dbUser = await User.findById(req.session.id); if (!dbUser) { return next(new errors.NotFound()); } if (!dbUser.is_admin) { return next(new errors.Unauthorized()); } const dbUsers = await User.findAll(); const result = dbUsers.map((user) => ({ username: user.id, service: user.service, channel: user.channel, })); res.json(result); }); api.use(async (req, res) => { let streams = await Stream.findAllWithRustlers(); streams = sortBy(streams, s => -s.rustlers); res.json({ // Array of streams. Called "stream_list" to maintain backwards // compatibility with the old API (primarily for Bot). stream_list: streams.map(stream => { return { channel: stream.channel, live: stream.live, rustlers: stream.rustlers, service: stream.service, thumbnail: stream.thumbnail, // This begins with a forward slash because Bot expects it to. url: `/${stream.service}/${stream.channel}`, viewers: stream.viewers, }; }), // Map of URL to rustler count. Redundant since this information exists // above, but this is used by bbdgg in the old API so it's here for // backwards compatibility. streams: streams.reduce((acc, stream) => { acc[`/${stream.service}/${stream.channel}`] = stream.rustlers; return acc; }, {}), }); }); export default api;
{ "content_hash": "2da67351971622fa841269ee25b53a2b", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 137, "avg_line_length": 26.827814569536425, "alnum_prop": 0.6151567514194026, "repo_name": "slugalisk/Rustla2", "id": "1626b8c6997126a1818c73766056cc52fc40c826", "size": "4051", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/api/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "152643" }, { "name": "CMake", "bytes": "18158" }, { "name": "CSS", "bytes": "3171" }, { "name": "HTML", "bytes": "226" }, { "name": "JavaScript", "bytes": "112095" }, { "name": "Shell", "bytes": "1942" }, { "name": "VCL", "bytes": "1202" } ], "symlink_target": "" }
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__),"..","..")) require 'puppet/util/firewall' Puppet::Type.newtype(:firewallchain) do include Puppet::Util::Firewall @doc = <<-EOS This type provides the capability to manage rule chains for firewalls. Currently this supports only iptables, ip6tables and ebtables on Linux. And provides support for setting the default policy on chains and tables that allow it. **Autorequires:** If Puppet is managing the iptables, iptables-persistent, or iptables-services packages, and the provider is iptables_chain, the firewall resource will autorequire those packages to ensure that any required binaries are installed. EOS feature :iptables_chain, "The provider provides iptables chain features." feature :policy, "Default policy (inbuilt chains only)" ensurable do defaultvalues defaultto :present end newparam(:name) do desc <<-EOS The canonical name of the chain. For iptables the format must be {chain}:{table}:{protocol}. EOS isnamevar validate do |value| if value !~ Nameformat then raise ArgumentError, "Inbuilt chains must be in the form {chain}:{table}:{protocol} where {table} is one of FILTER, NAT, MANGLE, RAW, RAWPOST, BROUTE or empty (alias for filter), chain can be anything without colons or one of PREROUTING, POSTROUTING, BROUTING, INPUT, FORWARD, OUTPUT for the inbuilt chains, and {protocol} being IPv4, IPv6, ethernet (ethernet bridging) got '#{value}' table:'#{$1}' chain:'#{$2}' protocol:'#{$3}'" else chain = $1 table = $2 protocol = $3 case table when 'filter' if chain =~ /^(PREROUTING|POSTROUTING|BROUTING)$/ raise ArgumentError, "INPUT, OUTPUT and FORWARD are the only inbuilt chains that can be used in table 'filter'" end when 'mangle' if chain =~ InternalChains && chain == 'BROUTING' raise ArgumentError, "PREROUTING, POSTROUTING, INPUT, FORWARD and OUTPUT are the only inbuilt chains that can be used in table 'mangle'" end when 'nat' if chain =~ /^(BROUTING|FORWARD)$/ raise ArgumentError, "PREROUTING, POSTROUTING, INPUT, and OUTPUT are the only inbuilt chains that can be used in table 'nat'" end if protocol =~/^(IP(v6)?)?$/ raise ArgumentError, "table nat isn't valid in IPv6. You must specify ':IPv4' as the name suffix" end when 'raw' if chain =~ /^(POSTROUTING|BROUTING|INPUT|FORWARD)$/ raise ArgumentError,'PREROUTING and OUTPUT are the only inbuilt chains in the table \'raw\'' end when 'broute' if protocol != 'ethernet' raise ArgumentError,'BROUTE is only valid with protocol \'ethernet\'' end if chain =~ /^PREROUTING|POSTROUTING|INPUT|FORWARD|OUTPUT$/ raise ArgumentError,'BROUTING is the only inbuilt chain allowed on on table \'broute\'' end end if chain == 'BROUTING' && ( protocol != 'ethernet' || table!='broute') raise ArgumentError,'BROUTING is the only inbuilt chain allowed on on table \'BROUTE\' with protocol \'ethernet\' i.e. \'broute:BROUTING:enternet\'' end end end end newproperty(:policy) do desc <<-EOS This is the action to when the end of the chain is reached. It can only be set on inbuilt chains (INPUT, FORWARD, OUTPUT, PREROUTING, POSTROUTING) and can be one of: * accept - the packet is accepted * drop - the packet is dropped * queue - the packet is passed userspace * return - the packet is returned to calling (jump) queue or the default of inbuilt chains EOS newvalues(:accept, :drop, :queue, :return) defaultto do # ethernet chain have an ACCEPT default while other haven't got an # allowed value if @resource[:name] =~ /:ethernet$/ :accept else nil end end end newparam(:purge, :boolean => true) do desc <<-EOS Purge unmanaged firewall rules in this chain EOS newvalues(:false, :true) defaultto :false end newparam(:ignore) do desc <<-EOS Regex to perform on firewall rules to exempt unmanaged rules from purging (when enabled). This is matched against the output of `iptables-save`. This can be a single regex, or an array of them. To support flags, use the ruby inline flag mechanism. Meaning a regex such as /foo/i can be written as '(?i)foo' or '(?i:foo)' Full example: firewallchain { 'INPUT:filter:IPv4': purge => true, ignore => [ '-j fail2ban-ssh', # ignore the fail2ban jump rule '--comment "[^"]*(?i:ignore)[^"]*"', # ignore any rules with "ignore" (case insensitive) in the comment in the rule ], } EOS validate do |value| unless value.is_a?(Array) or value.is_a?(String) or value == false self.devfail "Ignore must be a string or an Array" end end munge do |patterns| # convert into an array of {Regex}es patterns = [patterns] if patterns.is_a?(String) patterns.map{|p| Regexp.new(p)} end end # Classes would be a better abstraction, pending: # http://projects.puppetlabs.com/issues/19001 autorequire(:package) do case value(:provider) when :iptables_chain %w{iptables iptables-persistent iptables-services} else [] end end autorequire(:service) do case value(:provider) when :iptables, :ip6tables %w{firewalld iptables ip6tables iptables-persistent netfilter-persistent} else [] end end validate do debug("[validate]") value(:name).match(Nameformat) chain = $1 table = $2 protocol = $3 # Check that we're not removing an internal chain if chain =~ InternalChains && value(:ensure) == :absent self.fail "Cannot remove in-built chains" end if value(:policy).nil? && protocol == 'ethernet' self.fail "you must set a non-empty policy on all ethernet table chains" end # Check that we're not setting a policy on a user chain if chain !~ InternalChains && !value(:policy).nil? && protocol != 'ethernet' self.fail "policy can only be set on in-built chains (with the exception of ethernet chains) (table:#{table} chain:#{chain} protocol:#{protocol})" end # no DROP policy on nat table if table == 'nat' && value(:policy) == :drop self.fail 'The "nat" table is not intended for filtering, the use of DROP is therefore inhibited' end end def generate return [] unless self.purge? value(:name).match(Nameformat) chain = $1 table = $2 protocol = $3 provider = case protocol when 'IPv4' :iptables when 'IPv6' :ip6tables end # gather a list of all rules present on the system rules_resources = Puppet::Type.type(:firewall).instances # Keep only rules in this chain rules_resources.delete_if { |res| (res[:provider] != provider or res.provider.properties[:table].to_s != table or res.provider.properties[:chain] != chain) } # Remove rules which match our ignore filter rules_resources.delete_if {|res| value(:ignore).find_index{|f| res.provider.properties[:line].match(f)}} if value(:ignore) # We mark all remaining rules for deletion, and then let the catalog override us on rules which should be present rules_resources.each {|res| res[:ensure] = :absent} rules_resources end end
{ "content_hash": "cb1ee8ca7718a69284b546f617bf291d", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 438, "avg_line_length": 34.346666666666664, "alnum_prop": 0.6370341614906833, "repo_name": "saqibarfeen/iota-influxdb-grafana", "id": "cb2c61412b3c8e31feff97ea6c0114005604db23", "size": "8105", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "iota-elasticsearch-kibana/deployment_scripts/puppet/modules/firewall/lib/puppet/type/firewallchain.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "124152" }, { "name": "Makefile", "bytes": "6795" }, { "name": "Pascal", "bytes": "1080" }, { "name": "Puppet", "bytes": "383227" }, { "name": "Python", "bytes": "3066" }, { "name": "Ruby", "bytes": "1418712" }, { "name": "Shell", "bytes": "43205" } ], "symlink_target": "" }
namespace CodeHub.Web.ViewModels.Paste { using System; using System.Collections.Generic; using System.Linq; using System.Web; public class EditPasteViewModel : AddPasteViewModel { public string Id { get; set; } } }
{ "content_hash": "4883e36f9ff50c7dc7ca238ad65ce89f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 55, "avg_line_length": 21, "alnum_prop": 0.6706349206349206, "repo_name": "dnmitev/CodeHub", "id": "4a65d541747cc06762bd188ddae6d76bbcb6318a", "size": "254", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CodeHub/Web/CodeHub.Web/ViewModels/Paste/EditPasteViewModel.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "102" }, { "name": "C#", "bytes": "219438" }, { "name": "CSS", "bytes": "235043" }, { "name": "JavaScript", "bytes": "1259919" } ], "symlink_target": "" }
package org.andengine.opengl.util; /** * (c) Zynga 2012 * * @author Nicolas Gramlich <ngramlich@zynga.com> * @since 11:18:30 - 10.02.2012 */ public class VertexUtils { // =========================================================== // Constants // =========================================================== // =========================================================== // Fields // =========================================================== // =========================================================== // Constructors // =========================================================== // =========================================================== // Getter & Setter // =========================================================== // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== // =========================================================== // Methods // =========================================================== /** * @param pVertices * @param pVertexOffset * @param pVertexStride * @param pVertexIndex * @return the value of the <code>pVertexOffset</code>-th attribute of the * <code>pVertexIndex</code>-th vertex. */ public static float getVertex(final float[] pVertices, final int pVertexOffset, final int pVertexStride, final int pVertexIndex) { return pVertices[(pVertexIndex * pVertexStride) + pVertexOffset]; } // =========================================================== // Inner and Anonymous Classes // =========================================================== }
{ "content_hash": "22b67c503d9801dc2558ae4f85b63e7b", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 131, "avg_line_length": 33.91836734693877, "alnum_prop": 0.3206979542719615, "repo_name": "iraupph/tictactoe-android", "id": "7568a985ece14159fb3f090b9ab245ad008f719d", "size": "1662", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AndEngineGLES2/src/org/andengine/opengl/util/VertexUtils.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "636" }, { "name": "C++", "bytes": "1712" }, { "name": "Groovy", "bytes": "704" }, { "name": "Java", "bytes": "2343706" }, { "name": "Shell", "bytes": "3493" } ], "symlink_target": "" }