text
stringlengths
2
1.04M
meta
dict
package com.sksamuel.elastic4s.requests.delete import com.sksamuel.elastic4s.fields.TextField import com.sksamuel.elastic4s.requests.common.RefreshPolicy import com.sksamuel.elastic4s.testkit.DockerTests import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec import scala.util.Try class DeleteByQueryTest extends AnyWordSpec with Matchers with DockerTests { private val indexname = "charles_dickens" Try { client.execute { deleteIndex(indexname) }.await } client.execute { createIndex(indexname).mapping( properties( TextField("name") ) ).shards(1).waitForActiveShards(1) }.await "delete by query" should { "delete matched docs" in { client.execute { bulk( indexInto(indexname).fields("name" -> "mr bumbles").id("1"), indexInto(indexname).fields("name" -> "artful dodger").id("2"), indexInto(indexname).fields("name" -> "mrs bumbles").id("3"), indexInto(indexname).fields("name" -> "fagan").id("4") ).refresh(RefreshPolicy.Immediate) }.await client.execute { search(indexname).matchAllQuery() }.await.result.totalHits shouldBe 4 client.execute { deleteByQuery(indexname, matchQuery("name", "bumbles")).refresh(RefreshPolicy.Immediate) }.await.result.left.get.deleted shouldBe 2 client.execute { search(indexname).matchAllQuery() }.await.result.totalHits shouldBe 2 } "respect size parameter" in { client.execute { bulk( indexInto(indexname).fields("name" -> "mrs havisham").id("5"), indexInto(indexname).fields("name" -> "peggotty").id("6") ).refresh(RefreshPolicy.Immediate) }.await client.execute { search(indexname).matchAllQuery() }.await.result.totalHits shouldBe 4 client.execute { deleteByQuery(indexname, matchAllQuery()).refresh(RefreshPolicy.Immediate).maxDocs(3) }.await.result.left.get.deleted shouldBe 3 client.execute { search(indexname).matchAllQuery() }.await.result.totalHits shouldBe 1 } "return a Left[RequestFailure] when the delete fails" in { client.execute { deleteByQuery(",", matchQuery("name", "bumbles")) }.await.error.`type` shouldBe "action_request_validation_exception" } "return a task when setting wait_for_completion to false" in { val result = client.execute { deleteByQuery(indexname, matchQuery("name", "michael douglas")).waitForCompletion(false) }.await.result.right.get result.nodeId should not be null result.taskId should not be null } } }
{ "content_hash": "8146a1540f702f9b0c381d28a0a2a48f", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 97, "avg_line_length": 30.426966292134832, "alnum_prop": 0.6617429837518464, "repo_name": "sksamuel/elastic4s", "id": "29fe1c3c50c9fc7a97cb42b0ae5071b8eb9ead1a", "size": "2708", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/delete/DeleteByQueryTest.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "93" }, { "name": "Scala", "bytes": "1807156" }, { "name": "Shell", "bytes": "121" } ], "symlink_target": "" }
function [] = pde_visualizer(u, model, tlist, state_id, plot_title) % takes any pde u (soln), model, tlist and visualizes accordingly % colormap choices: 'jet', 'cool', 'gray', 'bone', 'copper' % can also specify contour levels % might be useful to have average value at a timepoint labelled % extract pde solution parameters np = size(model.Mesh.Nodes, 2); N = size(u,1)/np; assert(size(state_id,1) == N) % choose timepoints for plotting % DEFAULT - 4 timepoints, t0, ta, tb, t1 timesteps = size(u, 2); if timesteps > 4 m = mod(timesteps,3); T = (timesteps - m) / 3; ta = 1 + T; tb = 1 + 2*T; timepoints = [1, ta, tb, timesteps]; else timepoints = 1:timesteps; end % plot each state fig = figure('visible','off','PaperUnits','inches','PaperPosition',[0 0 15 9]); step = 0; for tt = timepoints for state = 1:N subplot(length(timepoints), N, step*N + state); pdeplot(model, 'xydata', u((state-1)*np+1:state*np, tt), 'colormap', 'gray'); title(['State ' state_id(state,:) ' Time ' num2str(tlist(tt)) 'h']); end step = step + 1; end % save figure print(fig,plot_title,'-djpeg','-r0'); end
{ "content_hash": "c39e8cc4b77dacc2eac954fa943a7b3a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 85, "avg_line_length": 28.9, "alnum_prop": 0.6288927335640139, "repo_name": "mattsmart/biomodels", "id": "05487ce4e70f36385487bf9dbf4a35a6bfa46928", "size": "1156", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "differential_equations/pde/pde_visualizer.m", "mode": "33188", "license": "mit", "language": [ { "name": "Jupyter Notebook", "bytes": "30519" }, { "name": "MATLAB", "bytes": "44848" }, { "name": "Mathematica", "bytes": "238830" }, { "name": "Python", "bytes": "644776" }, { "name": "Shell", "bytes": "179" } ], "symlink_target": "" }
// Disable autolinking for unit tests. #if !defined(BOOST_ALL_NO_LIB) #define BOOST_ALL_NO_LIB 1 #endif // !defined(BOOST_ALL_NO_LIB) // Test that header file is self-contained. #include <boost/asio/windows/stream_handle.hpp> #include <boost/asio/io_service.hpp> #include "../unit_test.hpp" //------------------------------------------------------------------------------ // windows_stream_handle_compile test // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // The following test checks that all public member functions on the class // windows::stream_handle compile and link correctly. Runtime failures are // ignored. namespace windows_stream_handle_compile { void write_some_handler(const boost::system::error_code&, std::size_t) { } void read_some_handler(const boost::system::error_code&, std::size_t) { } void test() { #if defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE) using namespace boost::asio; namespace win = boost::asio::windows; try { io_service ios; char mutable_char_buffer[128] = ""; const char const_char_buffer[128] = ""; boost::system::error_code ec; // basic_stream_handle constructors. win::stream_handle handle1(ios); HANDLE native_handle1 = INVALID_HANDLE_VALUE; win::stream_handle handle2(ios, native_handle1); #if defined(BOOST_ASIO_HAS_MOVE) win::stream_handle handle3(std::move(handle2)); #endif // defined(BOOST_ASIO_HAS_MOVE) // basic_stream_handle operators. #if defined(BOOST_ASIO_HAS_MOVE) handle1 = win::stream_handle(ios); handle1 = std::move(handle2); #endif // defined(BOOST_ASIO_HAS_MOVE) // basic_io_object functions. io_service& ios_ref = handle1.get_io_service(); (void)ios_ref; // basic_handle functions. win::stream_handle::lowest_layer_type& lowest_layer = handle1.lowest_layer(); (void)lowest_layer; const win::stream_handle& handle4 = handle1; const win::stream_handle::lowest_layer_type& lowest_layer2 = handle4.lowest_layer(); (void)lowest_layer2; HANDLE native_handle2 = INVALID_HANDLE_VALUE; handle1.assign(native_handle2); bool is_open = handle1.is_open(); (void)is_open; handle1.close(); handle1.close(ec); win::stream_handle::native_type native_handle3 = handle1.native(); (void)native_handle3; win::stream_handle::native_handle_type native_handle4 = handle1.native_handle(); (void)native_handle4; handle1.cancel(); handle1.cancel(ec); // basic_stream_handle functions. handle1.write_some(buffer(mutable_char_buffer)); handle1.write_some(buffer(const_char_buffer)); handle1.write_some(buffer(mutable_char_buffer), ec); handle1.write_some(buffer(const_char_buffer), ec); handle1.async_write_some(buffer(mutable_char_buffer), &write_some_handler); handle1.async_write_some(buffer(const_char_buffer), &write_some_handler); handle1.read_some(buffer(mutable_char_buffer)); handle1.read_some(buffer(mutable_char_buffer), ec); handle1.async_read_some(buffer(mutable_char_buffer), &read_some_handler); } catch (std::exception&) { } #endif // defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE) } } // namespace windows_stream_handle_compile //------------------------------------------------------------------------------ test_suite* init_unit_test_suite(int, char*[]) { test_suite* test = BOOST_TEST_SUITE("windows/stream_handle"); test->add(BOOST_TEST_CASE(&windows_stream_handle_compile::test)); return test; }
{ "content_hash": "8a8fd58daa3db6751045f2be53d02124", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 80, "avg_line_length": 28.896, "alnum_prop": 0.6323366555924695, "repo_name": "cpascal/af-cpp", "id": "45f0c805575de290e8b69476c0851f7f663de0a5", "size": "3907", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "apdos/exts/boost_1_53_0/libs/asio/test/windows/stream_handle.cpp", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "142321" }, { "name": "Batchfile", "bytes": "45292" }, { "name": "C", "bytes": "2380742" }, { "name": "C#", "bytes": "41850" }, { "name": "C++", "bytes": "141733840" }, { "name": "CMake", "bytes": "1784" }, { "name": "CSS", "bytes": "303526" }, { "name": "Cuda", "bytes": "27558" }, { "name": "FORTRAN", "bytes": "1440" }, { "name": "Groff", "bytes": "8174" }, { "name": "HTML", "bytes": "80494592" }, { "name": "IDL", "bytes": "15" }, { "name": "JavaScript", "bytes": "134468" }, { "name": "Lex", "bytes": "1318" }, { "name": "Makefile", "bytes": "1028949" }, { "name": "Max", "bytes": "36857" }, { "name": "Objective-C", "bytes": "4297" }, { "name": "PHP", "bytes": "60249" }, { "name": "Perl", "bytes": "30505" }, { "name": "Perl6", "bytes": "2130" }, { "name": "Python", "bytes": "1751993" }, { "name": "QML", "bytes": "613" }, { "name": "Rebol", "bytes": "372" }, { "name": "Shell", "bytes": "374946" }, { "name": "Tcl", "bytes": "1205" }, { "name": "TeX", "bytes": "13819" }, { "name": "XSLT", "bytes": "780775" }, { "name": "Yacc", "bytes": "19612" } ], "symlink_target": "" }
namespace Ui { class MainWindow; } namespace RobotTest { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); QDir directory; QString filename; RobotWorld world; SmartPointer<RobotTestBackend> backend; SmartPointer<QRobotTestGUI> gui; int mode; int argc; const char** argv; bool Initialize(int _argc, const char **_argv); void StatusConnect(); private: Ui::MainWindow *ui; public slots: void SetGeometry(bool status); void SetBboxes(bool status); void SetCOM(bool status); void SetFrame(bool status); void SetExpanded(bool status); void SetCollisions(bool status); void SetSensors(bool status); void SetIK(bool status); void SetROS(bool status); void SetDriver(int index); void UpdateDriverValue(); void UpdateDriverParameters(); void SetLink(int index); void UpdateLinkValue(); void UpdateLinkParameters(); void LinkMode(); void DriverMode(); void SliderLinkAngle(int ticks); void SliderDriverAngle(int ticks); void UpdateLinkSlider(double value); void UpdateDriverSlider(double value); void PrintCollisions(); void PrintConfig(); void LoadFile(); void ReloadFile(); }; #endif // MAINWINDOW_H
{ "content_hash": "d50c94e48cffa5278374e46feb3ea3b0", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 51, "avg_line_length": 22.0327868852459, "alnum_prop": 0.6837797619047619, "repo_name": "YilunZhou/Klampt", "id": "96e8434b337038aeb25467902daa6e4e043a5959", "size": "1549", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Main/RobotTestQt/mainwindow.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "3032" }, { "name": "C", "bytes": "9559" }, { "name": "C++", "bytes": "5281731" }, { "name": "CMake", "bytes": "57448" }, { "name": "GLSL", "bytes": "85" }, { "name": "Makefile", "bytes": "5886" }, { "name": "Objective-C", "bytes": "2101" }, { "name": "Python", "bytes": "1482381" }, { "name": "QMake", "bytes": "3587" }, { "name": "Shell", "bytes": "268" } ], "symlink_target": "" }
/* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. */ package javax.xml.crypto.test.dsig; import java.io.File; import java.io.FileInputStream; import java.security.KeyStore; import java.security.Security; import javax.xml.crypto.KeySelector; import javax.xml.crypto.URIDereferencer; import javax.xml.crypto.dsig.XMLSignatureException; import javax.xml.crypto.test.KeySelectors; /** * This is a testcase to validate all "merlin-xmldsig-twenty-three" * testcases from Baltimore * * @author Sean Mullan */ public class Baltimore23Test extends org.junit.Assert { private File dir; private final URIDereferencer ud; static { Security.insertProviderAt (new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI(), 1); } public Baltimore23Test() { String fs = System.getProperty("file.separator"); String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir"); dir = new File(base + fs + "src/test/resources" + fs + "ie" + fs + "baltimore" + fs + "merlin-examples", "merlin-xmldsig-twenty-three"); ud = new LocalHttpCacheURIDereferencer(); } @org.junit.Test public void test_signature_enveloped_dsa() throws Exception { String file = "signature-enveloped-dsa.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.KeyValueKeySelector()); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_enveloping_b64_dsa() throws Exception { String file = "signature-enveloping-b64-dsa.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.KeyValueKeySelector()); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_enveloping_dsa() throws Exception { String file = "signature-enveloping-dsa.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.KeyValueKeySelector()); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_external_b64_dsa() throws Exception { String file = "signature-external-b64-dsa.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.KeyValueKeySelector(), ud); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_external_dsa() throws Exception { String file = "signature-external-dsa.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.KeyValueKeySelector(), ud); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_enveloping_rsa() throws Exception { String file = "signature-enveloping-rsa.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.KeyValueKeySelector()); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_enveloping_hmac_sha1() throws Exception { String file = "signature-enveloping-hmac-sha1.xml"; KeySelector ks = new KeySelectors.SecretKeySelector ("secret".getBytes("ASCII") ); SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate(file, ks); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_enveloping_hmac_sha1_40() throws Exception { String file = "signature-enveloping-hmac-sha1-40.xml"; KeySelector ks = new KeySelectors.SecretKeySelector ("secret".getBytes("ASCII") ); try { SignatureValidator validator = new SignatureValidator(dir); validator.validate(file, ks); fail("Expected HMACOutputLength exception"); } catch (XMLSignatureException xse) { System.out.println(xse.getMessage()); // pass } } @org.junit.Test public void test_signature_keyname() throws Exception { String file = "signature-keyname.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.CollectionKeySelector(dir), ud); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_retrievalmethod_rawx509crt() throws Exception { String file = "signature-retrievalmethod-rawx509crt.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.CollectionKeySelector(dir), ud); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_x509_crt_crl() throws Exception { String file = "signature-x509-crt-crl.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.RawX509KeySelector(), ud); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_x509_crt() throws Exception { String file = "signature-x509-crt.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.RawX509KeySelector(), ud); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_x509_is() throws Exception { String file = "signature-x509-is.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.CollectionKeySelector(dir), ud); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_x509_ski() throws Exception { String file = "signature-x509-ski.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.CollectionKeySelector(dir), ud); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature_x509_sn() throws Exception { String file = "signature-x509-sn.xml"; SignatureValidator validator = new SignatureValidator(dir); boolean coreValidity = validator.validate (file, new KeySelectors.CollectionKeySelector(dir), ud); assertTrue("Signature failed core validation", coreValidity); } @org.junit.Test public void test_signature() throws Exception { // // This test fails with the IBM JDK // if ("IBM Corporation".equals(System.getProperty("java.vendor"))) { return; } String file = "signature.xml"; String fs = System.getProperty("file.separator"); String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir"); String keystore = base + fs + "src/test/resources" + fs + "ie" + fs + "baltimore" + fs + "merlin-examples" + fs + "merlin-xmldsig-twenty-three" + fs + "certs" + fs + "xmldsig.jks"; KeyStore ks = KeyStore.getInstance("JKS"); ks.load(new FileInputStream(keystore), "changeit".toCharArray()); SignatureValidator validator = new SignatureValidator(dir); boolean cv = validator.validate(file, new X509KeySelector(ks, false), ud); assertTrue("Signature failed core validation", cv); } }
{ "content_hash": "4b6358d108e22dc4f05963672f7be9fc", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 98, "avg_line_length": 37.38666666666666, "alnum_prop": 0.6702330004755112, "repo_name": "Legostaev/xmlsec-gost", "id": "830daa1f95da445ba60c7e862e7b3404f101c6cf", "size": "9214", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/javax/xml/crypto/test/dsig/Baltimore23Test.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "201" }, { "name": "HTML", "bytes": "4723643" }, { "name": "Java", "bytes": "4788223" }, { "name": "Makefile", "bytes": "154" }, { "name": "Shell", "bytes": "8665" }, { "name": "XSLT", "bytes": "1615" } ], "symlink_target": "" }
package crackingcoding.arraysandstrings; import java.util.Arrays; /** * Cracking the Coding Interview * @author liujian * * Arrays and Strings * * 1.3 Given two strings, write a method to decide if one is a permutation of the other * * 字母区分大小写, 空格也算字符里面 * */ public class OtherPermutation { /** * Solution 1 */ public static boolean permutation(String s1, String s2){ char[] array1 = s1.toCharArray(); char[] array2 = s2.toCharArray(); Arrays.sort(array1); Arrays.sort(array2); return Arrays.equals(array1, array2); } /** * Solution 2 */ public static boolean permutation2(String s1, String s2){ if(s1.length() != s2.length()){ return false; } int[] number = new int[128]; char[] array1 = s1.toCharArray(); for(char c : array1){ number[c]++; } for(char c : s2.toCharArray()){ if(--number[c] < 0) return false; } return true; } public static void main(String[] args) { System.out.println(permutation2("qwrt", "trwq")); } }
{ "content_hash": "a8a9e946beb961d77aec5bb5d91c64ab", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 87, "avg_line_length": 17.603448275862068, "alnum_prop": 0.6346718903036239, "repo_name": "TwentySevenC/Algorithms", "id": "e2758066e59490bdc4a8f643ef07f376d7c439d4", "size": "1051", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/crackingcoding/arraysandstrings/OtherPermutation.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "18501" } ], "symlink_target": "" }
> 原文链接:http://dailyjs.com/post/js101-this-binding Last week we looked at `this`, and how it can be assigned and manipulated. The example I gave showed that a function inside another function (or method) will resolve `this` to the global object, and I used `var self = this` to reference the intended object. Reader n1k0 pointed out another solution: `Function.prototype.call`: ```javascript Shape.prototype = { move: function(x, y) { this.x += x; this.y += y; function checkBounds() { if (this.x > 100) { console.error('Warning: Shape out of bounds'); } } checkBounds.call(this); } }; ``` ## The call and apply Methods In [JS101: Object.create](object.create.html), I mentioned how `Function.prototype.call` can be used to chain constructors. Let's take a deeper look at these methods of `Function`. The difference between the two is we generally use `call` when we know what a function's arguments are, because they're supplied as arguments. Conversely, `apply` expects an array of parameters: ```javascript Shape.prototype = { move: function(x, y) { this.x += x; this.y += y; function checkBounds(min, max) { if (this.x < min || this.x > max) { console.error('Warning: Shape out of bounds'); } } checkBounds.call(this, 0, 100); checkBounds.apply(this, [0, 100]); } }; ``` These methods have been around since ECMAScript 3rd Edition, and you'll see them used a lot. Take a look at the source for any popular JavaScript project and you'll find one of these methods being used: - [jQuery: core.js](https://github.com/jquery/jquery/blob/master/src/core.js) - [Express: application.js](https://github.com/visionmedia/express/blob/master/lib/application.js) - [Backbone.js](https://github.com/documentcloud/backbone/blob/master/backbone.js) Why are these methods so popular? Basically it comes down to functions being a first class citizen in JavaScript. I've been talking about the importance of objects for weeks, but learning how to manipulate functions is the key to mastering JavaScript. JavaScript allows us to pass functions around, then execute them in different contexts by taking advantage of `call` and `apply`. This is an example from the beginning of [jQuery's documentation](http://api.jquery.com/jQuery/): ```javascript $('div.foo').click(function() { $(this).slideUp(); }); ``` Here, `this` refers to the relevant DOM object. We've supplied our own callback, but `this` points to something that makes sense within the context of jQuery's API. ## Binding In the comments for the previous post, Andres Descalzo pointed out that [Function.prototype.bind](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind) can also be used to change `this`. The `bind` method of `Function` was introduced in ECMAScript 5th Edition, and it returns a new function that's *bound* to a different `this`: ```javascript Shape.prototype = { move: function(x, y) { this.x += x; this.y += y; function checkBounds(min, max) { if (this.x < min || this.x > max) { console.error('Warning: Shape out of bounds'); } } var checkBoundsThis = checkBounds.bind(this); checkBoundsThis(0, 100); } }; ``` Notice that a new variable has to be created for the newly bound function. The comment Andres posted uses an anonymous function to remove the extra variable: ```javascript Shape.prototype = { move: function(x, y) { this.x += x; this.y += y; var checkBounds = function(min, max) { if (this.x < min || this.x > max) { console.error('Warning: Shape out of bounds'); } }.bind(this); checkBounds(0, 100); } }; ``` I like [Mozilla's bind documentation](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind), because it shows how some built-in methods like `setTimeout` require less syntax when used with methods. The lesson here isn't really due to the design of `setTimeout` but more general: using `bind` is a convenient way to pass a *method* to another function. ## Summary When working with methods, the value of `this` is important. By using the `apply`, `call` and `bind` methods of `Function`, we can: - Change `this` inside a function, enabling flexible APIs to be created as demonstrated by popular projects like jQuery, Backbone.js, and Express - Reduce syntactical overhead when using functions inside methods, and passing methods to other functions -Chain calls to constructors (see [JS101: Object.create](object.create.html))
{ "content_hash": "c69410d980fcff45764f3d53d9b51266", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 381, "avg_line_length": 39.22222222222222, "alnum_prop": 0.7106123338417956, "repo_name": "7anshuai/js101", "id": "cc72b5890b07256db66a4f9611d837e0251645f5", "size": "4631", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "content/js101/this-binding.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('filmfestival', '0011_auto_20150610_1401'), ] operations = [ migrations.AddField( model_name='day', name='runtime', field=models.IntegerField(default=0), ), migrations.AddField( model_name='screening', name='time', field=models.TimeField(default=datetime.datetime(2015, 6, 10, 14, 54, 35, 375260)), preserve_default=False, ), ]
{ "content_hash": "33a19bab7b911e11f7347d3833e23e7a", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 95, "avg_line_length": 25.08, "alnum_prop": 0.580542264752791, "repo_name": "thanos/mykonosbiennale.org", "id": "fad72f8faa66e765ddac919ab55354f1b3bba08c", "size": "651", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "filmfestival/migrations/0012_auto_20150610_1454.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "8736050" }, { "name": "HTML", "bytes": "1440515" }, { "name": "JavaScript", "bytes": "6793247" }, { "name": "Python", "bytes": "318765" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <CrawlItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Text>Pljeskavica s kajmakom i ramstek su jedni od boljih koje sam jeo. Meso kvalitetno i dobro pečeno. Dostava na vrijeme. Izvrsno! Naručit ću opet sigurno.</Text> <Rating>6</Rating> <Source>http://pauza.hr/menu/jordanovecki-vuglec</Source> </CrawlItem>
{ "content_hash": "d37b0d179350f1af906a8b078cedf316", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 166, "avg_line_length": 69.16666666666667, "alnum_prop": 0.7325301204819277, "repo_name": "Tweety-FER/tar-polarity", "id": "ef055722fb4ca7d168270e7fc16c4ff2276db5a2", "size": "418", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CropinionDataset/reviews_original/Train/comment2625.xml", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "4796" }, { "name": "Python", "bytes": "9870" } ], "symlink_target": "" }
GEOPM IOGROUP TUTORIAL ====================== This directory contains a tutorial on how to extend the available signals and controls in GEOPM by creating an IOGroup. In general, signals are used to read platform (hardware and OS) information while controls are used to write to and change behavior of the platform. An example IOGroup can be seen in ExampleIOGroup.cpp. The steps for creating a new IOGroup and installing it as a plugin are listed below and are based on this example. 0. IOGroup Interface -------------------- IOGroups extend the IOGroup base class found in src/IOGroup.hpp. For more information on the interface, see the geopm::IOGroup(3) man page. The example plugin used in this tutorial provides both signals and controls. In addition to the interface methods, it can be helpful to implement static methods assist with registration; in this example plugin_name() and make_plugin() are implemented. These methods will be discussed further in the section on registration. 1. Implementing signals ----------------------- * signal_names(): ExampleIOGroup provides signals based on information in /proc/stat. "EXAMPLE::USER_TIME" represents the CPU time spent in user mode. "EXAMPLE::NICE_TIME" represents the CPU time spent in user mode with low priority. "EXAMPLE::SYSTEM_TIME" represents the CPU time spent in system mode. "EXAMPLE::IDLE_TIME" represents the CPU idle time. This IOGroup also provides aliases to these signals for convenience: "USER_TIME", "NICE_TIME", "SYSTEM_TIME", and "IDLE_TIME" respectively. All four names and their aliases are returned as signal names. * is_valid_signal(): Returns true if the name provided is one from the set returned by signal_names(). * signal_domain_type(): For this example, the domain of both signals is the entire board (M_DOMAIN_BOARD). If the signal name is not one of the supported signals, it returns M_DOMAIN_INVALID. * push_signal(): This method does some error checking of the inputs, then sets a flag to indicate that the corresponding signal will be read by read_batch(). It returns a unique index for each signal that will be used when calling sample() to determine which value to return. * read_batch(): For each signal read flag set to true, parses the value from the output of /proc/stat and saves it in a variable to be used by future calls to sample(). The advantage of using read_batch() and sample() in this way is that /proc/stat only needs to be read into memory once to provide values for all the signals. It also provides a way for the GEOPM Controller to ensure that signals from every IOGroup will be read at roughly the same time. The values saved here are the raw strings from the file, which will be converted to doubles when sample() is called. This follows the general pattern of IOGroups where read_batch() is responsible for reading the raw bytes, and sample() does the interpretation of the bytes to a meaningful value. For a more realistic example of this interaction, refer to the MSRIOGroup, in which read_batch() reads the raw bits from MSRs, and sample() converts them into SI units. * sample(): Converts the string value previously read by read_batch() to a number and returns it. * read_signal(): Provides a value for the signal immediately by parsing /proc/stat (as done in read_batch()) and returning the value. This method does not update the stored value for the signal because read_signal() should not affect future calls to sample(). * signal_description(): Returns a string description of the given signal name. This method can be used by helper applications (e.g. geopmread) to give users more detail about what a signal represents. 2. Implementing controls ------------------------ * control_names(): ExampleIOGroup provides two controls: "EXAMPLE::STDOUT" and its alias "STDOUT" print a number to standard output. "EXAMPLE::STDERR" and its alias "STDERR" print a number to standard error. While these controls are not very useful for real applications, they are provided as an example of the IOGroup interfaces dealing with output to the system. Under normal circumstances, printing values within GEOPM should be done through the reporting and tracing features, not through custom controls. * is_valid_control(): Returns true if the name provided is one from the set returned by control_names(). * control_domain_type(): For this example, the domain of the controls is the entire board (M_DOMAIN_BOARD). If the control name is not one of the supported controls, it returns M_DOMAIN_INVALID. * push_control(): This method does some error checking of the inputs, then sets a flag to indicate that the specified control will be written during write_batch(). * adjust(): The value passed into adjust is saved to be printed by a future call to write_batch(). Nothing will be printed at the time of the adjust() call. Similarly to read_batch() and sample(), adjust() is responsible for the conversion from meaningful value to raw bytes while write_batch() handles the raw I/O. In this example, the value passed into adjust() is saved as a string. When write_batch() is called, it does not need to do further double-to-string conversion to print the value. * write_batch(): If the STDOUT control has been pushed, it prints the latest value to standard output. If STDERR has been pushed, it prints the latest value to standard error. * control_description(): Returns a string description of the given control name. This method can be used by helper applications (e.g. geopmwrite) to give users more detail about how to use a control. 3. Set up registration on plugin load ------------------------------------- In order to be visible to PlatformIO and used by Agents, IOGroups must be registered with the IOGroup factory. The factory is a singleton and can be accessed with the iogroup_factory() method. The register_plugin() method of the factory takes two arguments: the name of the plugin ("example") and a pointer to a function that returns a unique_ptr to a new object of the plugin type. In this example, ExampleIOGroup::plugin_name() provides the first argument, and ExampleIOGroup::make_plugin is used as the second. ExampleIOGroup is registered at the time the plugin is loaded by GEOPM in the example_iogroup_load() method at the top of the file; the constructor attribute indicates that this method will run at plugin load time. GEOPM will automatically try to load any plugins it finds in the plugin path (discussed in the man page for geopm(7) under the description of GEOPM_PLUGIN_PATH). Do not link any of the GEOPM libraries into the plugin shared object; this will cause a circular link dependency. The Controller will make an effort to save and restore all of the values exposed by an IOGroup that has implemented the save_control() and restore_control() methods. The only built-in IOGroup with this functionality is the MSRIOGroup. The PlatformIO::save_control() method is implemented so that one must register all desired IOGroups prior to the invocation of PlatformIO::save_control(). Once PlatformIO::save_control() has been called, an error is raised if additional IOGroups are registered. If an IOGroup plugin is loaded by a mechanism other than using the GEOPM_PLUGIN_PATH, care must be taken to ensure that all IOGroup plugins are loaded prior to calling Agent::init() since PlatformIO::save_control() is called prior to the Agent::init() method. 4. Build and install -------------------- The ExampleIOGroup plugin is built by running tutorial_build_gnu.sh or tutorial_build_intel.sh. The plugin will be loaded with the geopmpolicy library if it is found in a directory in GEOPM_PLUGIN_PATH. Note that to be recognized as an iogroup plugin, the filename must begin with "libgeopmiogroup_" and end in ".so.0.0.0". Add the current directory (containing the .so file) to GEOPM_PLUGIN_PATH as follows: $ export GEOPM_PLUGIN_PATH=$PWD An alternative is to install the plugin by copying the .so file into the GEOPM install directory, <GEOPM_INSTALL_DIR>/lib/geopm. 5. Run with geopmread and geopmwrite ------------------------------------ Running `geopmread` with no arguments will print out a list of all signals on the platform. The new signals from ExampleIOGroup should now appear in this list. The values can be read using the signal name as shown: $ geopmread USER_TIME board 0 4932648 Running `geopmwrite` with no arguments will print out a list of all controls on the platform. The new controls from ExampleIOGroup should appear in this list as well. The controls can be tested using geopmwrite as shown: $ geopmwrite STDOUT board 0 12.34 12.34 For an example Agent that uses these signals and controls, refer to the Agent tutorial in $GEOPM_ROOT/tutorial/agent.
{ "content_hash": "09922e1d1ef3be8f309b991b50453bf9", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 83, "avg_line_length": 40.70454545454545, "alnum_prop": 0.7498604131769961, "repo_name": "cmcantalupo/geopm", "id": "f5933d54381d5f5c50f0c8566c230bfc7b571f8e", "size": "8955", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "tutorial/iogroup/README.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "342057" }, { "name": "C++", "bytes": "3025540" }, { "name": "Fortran", "bytes": "106333" }, { "name": "HTML", "bytes": "1251" }, { "name": "M4", "bytes": "48071" }, { "name": "Makefile", "bytes": "161772" }, { "name": "Nasal", "bytes": "2898" }, { "name": "Python", "bytes": "1119998" }, { "name": "Shell", "bytes": "138235" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.6.0_27) on Thu Jan 23 20:13:25 EST 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"> <title>org.apache.lucene.queryparser.surround.query (Lucene 4.6.1 API)</title> <meta name="date" content="2014-01-23"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <h1 class="bar"><a href="../../../../../../org/apache/lucene/queryparser/surround/query/package-summary.html" target="classFrame">org.apache.lucene.queryparser.surround.query</a></h1> <div class="indexContainer"> <h2 title="Interfaces">Interfaces</h2> <ul title="Interfaces"> <li><a href="DistanceSubQuery.html" title="interface in org.apache.lucene.queryparser.surround.query" target="classFrame"><i>DistanceSubQuery</i></a></li> <li><a href="SimpleTerm.MatchingTermVisitor.html" title="interface in org.apache.lucene.queryparser.surround.query" target="classFrame"><i>SimpleTerm.MatchingTermVisitor</i></a></li> </ul> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="AndQuery.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">AndQuery</a></li> <li><a href="BasicQueryFactory.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">BasicQueryFactory</a></li> <li><a href="ComposedQuery.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">ComposedQuery</a></li> <li><a href="DistanceQuery.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">DistanceQuery</a></li> <li><a href="FieldsQuery.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">FieldsQuery</a></li> <li><a href="NotQuery.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">NotQuery</a></li> <li><a href="OrQuery.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">OrQuery</a></li> <li><a href="SimpleTerm.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">SimpleTerm</a></li> <li><a href="SpanNearClauseFactory.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">SpanNearClauseFactory</a></li> <li><a href="SrndPrefixQuery.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">SrndPrefixQuery</a></li> <li><a href="SrndQuery.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">SrndQuery</a></li> <li><a href="SrndTermQuery.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">SrndTermQuery</a></li> <li><a href="SrndTruncQuery.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">SrndTruncQuery</a></li> </ul> <h2 title="Exceptions">Exceptions</h2> <ul title="Exceptions"> <li><a href="TooManyBasicQueries.html" title="class in org.apache.lucene.queryparser.surround.query" target="classFrame">TooManyBasicQueries</a></li> </ul> </div> </body> </html>
{ "content_hash": "1fb2b9486fe00d31e3005e0219420998", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 183, "avg_line_length": 78.48780487804878, "alnum_prop": 0.745183343691734, "repo_name": "OrlandoLee/ForYou", "id": "c85d501806767c28df257f20d6bab68d262f9a2e", "size": "3218", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lucene/lib/lucene-4.6.1/docs/queryparser/org/apache/lucene/queryparser/surround/query/package-frame.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "294179" }, { "name": "Java", "bytes": "4850924" }, { "name": "JavaScript", "bytes": "8728" }, { "name": "Ruby", "bytes": "15745" }, { "name": "Shell", "bytes": "368" } ], "symlink_target": "" }
package integration import ( "bytes" "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "log" "math/big" "net/http" "time" "github.com/fullsailor/pkcs7" ) const instanceDocument = `{ "devpayProductCodes" : null, "availabilityZone" : "xx-test-1b", "privateIp" : "10.1.2.3", "version" : "2010-08-31", "instanceId" : "i-00000000000000000", "billingProducts" : null, "instanceType" : "t2.micro", "accountId" : "1", "imageId" : "ami-00000000", "pendingTime" : "2000-00-01T0:00:00Z", "architecture" : "x86_64", "kernelId" : null, "ramdiskId" : null, "region" : "xx-test-1" }` func instanceDocumentHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") _, err := w.Write([]byte(instanceDocument)) if err != nil { w.WriteHeader(500) } } func certificateGenerate() (priv *rsa.PrivateKey, derBytes []byte, err error) { priv, err = rsa.GenerateKey(rand.Reader, 2048) if err != nil { log.Fatalf("failed to generate private key: %s", err) } serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128) serialNumber, err := rand.Int(rand.Reader, serialNumberLimit) if err != nil { log.Fatalf("failed to generate serial number: %s", err) } template := x509.Certificate{ SerialNumber: serialNumber, Subject: pkix.Name{ Organization: []string{"Test"}, }, NotBefore: time.Now().Add(-24 * time.Hour), NotAfter: time.Now().Add(365 * 24 * time.Hour), } derBytes, err = x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv) if err != nil { log.Fatalf("Failed to create certificate: %s", err) } return priv, derBytes, err } func pkcsHandler(priv *rsa.PrivateKey, derBytes []byte) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { cert, err := x509.ParseCertificate(derBytes) if err != nil { log.Fatalf("Cannot decode certificate: %s", err) } // Initialize a SignedData struct with content to be signed signedData, err := pkcs7.NewSignedData([]byte(instanceDocument)) if err != nil { log.Fatalf("Cannot initialize signed data: %s", err) } // Add the signing cert and private key if err = signedData.AddSigner(cert, priv, pkcs7.SignerInfoConfig{}); err != nil { log.Fatalf("Cannot add signer: %s", err) } // Finish() to obtain the signature bytes detachedSignature, err := signedData.Finish() if err != nil { log.Fatalf("Cannot finish signing data: %s", err) } encoded := pem.EncodeToMemory(&pem.Block{Type: "PKCS7", Bytes: detachedSignature}) encoded = bytes.TrimPrefix(encoded, []byte("-----BEGIN PKCS7-----\n")) encoded = bytes.TrimSuffix(encoded, []byte("\n-----END PKCS7-----\n")) w.Header().Set("Content-Type", "text/plain") _, err = w.Write(encoded) if err != nil { w.WriteHeader(500) } } } func stsHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/xml") _, err := w.Write([]byte(`<GetCallerIdentityResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/"> <GetCallerIdentityResult> <Arn>arn:aws:iam::1:user/Test</Arn> <UserId>AKIAI44QH8DHBEXAMPLE</UserId> <Account>1</Account> </GetCallerIdentityResult> <ResponseMetadata> <RequestId>01234567-89ab-cdef-0123-456789abcdef</RequestId> </ResponseMetadata> </GetCallerIdentityResponse>`)) if err != nil { w.WriteHeader(500) } } func ec2Handler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/xml") _, err := w.Write([]byte(`<DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>8f7724cf-496f-496e-8fe3-example</requestId> <reservationSet> <item> <reservationId>r-1234567890abcdef0</reservationId> <ownerId>123456789012</ownerId> <groupSet/> <instancesSet> <item> <instanceId>i-00000000000000000</instanceId> <imageId>ami-00000000</imageId> <instanceState> <code>16</code> <name>running</name> </instanceState> <privateDnsName>ip-192-168-1-88.eu-west-1.compute.internal</privateDnsName> <dnsName>ec2-54-194-252-215.eu-west-1.compute.amazonaws.com</dnsName> <reason/> <keyName>my_keypair</keyName> <amiLaunchIndex>0</amiLaunchIndex> <productCodes/> <instanceType>t2.micro</instanceType> <launchTime>2015-12-22T10:44:05.000Z</launchTime> <placement> <availabilityZone>eu-west-1c</availabilityZone> <groupName/> <tenancy>default</tenancy> </placement> <monitoring> <state>disabled</state> </monitoring> <subnetId>subnet-56f5f633</subnetId> <vpcId>vpc-11112222</vpcId> <privateIpAddress>192.168.1.88</privateIpAddress> <ipAddress>54.194.252.215</ipAddress> <sourceDestCheck>true</sourceDestCheck> <groupSet> <item> <groupId>sg-e4076980</groupId> <groupName>SecurityGroup1</groupName> </item> </groupSet> <architecture>x86_64</architecture> <rootDeviceType>ebs</rootDeviceType> <rootDeviceName>/dev/xvda</rootDeviceName> <blockDeviceMapping> <item> <deviceName>/dev/xvda</deviceName> <ebs> <volumeId>vol-1234567890abcdef0</volumeId> <status>attached</status> <attachTime>2015-12-22T10:44:09.000Z</attachTime> <deleteOnTermination>true</deleteOnTermination> </ebs> </item> </blockDeviceMapping> <virtualizationType>hvm</virtualizationType> <clientToken>xMcwG14507example</clientToken> <tagSet> <item> <key>Name</key> <value>Server_1</value> </item> </tagSet> <hypervisor>xen</hypervisor> <networkInterfaceSet> <item> <networkInterfaceId>eni-551ba033</networkInterfaceId> <subnetId>subnet-56f5f633</subnetId> <vpcId>vpc-11112222</vpcId> <description>Primary network interface</description> <ownerId>123456789012</ownerId> <status>in-use</status> <macAddress>02:dd:2c:5e:01:69</macAddress> <privateIpAddress>192.168.1.88</privateIpAddress> <privateDnsName>ip-192-168-1-88.eu-west-1.compute.internal</privateDnsName> <sourceDestCheck>true</sourceDestCheck> <groupSet> <item> <groupId>sg-e4076980</groupId> <groupName>SecurityGroup1</groupName> </item> </groupSet> <attachment> <attachmentId>eni-attach-39697adc</attachmentId> <deviceIndex>0</deviceIndex> <status>attached</status> <attachTime>2015-12-22T10:44:05.000Z</attachTime> <deleteOnTermination>true</deleteOnTermination> </attachment> <association> <publicIp>54.194.252.215</publicIp> <publicDnsName>ec2-54-194-252-215.eu-west-1.compute.amazonaws.com</publicDnsName> <ipOwnerId>amazon</ipOwnerId> </association> <privateIpAddressesSet> <item> <privateIpAddress>192.168.1.88</privateIpAddress> <privateDnsName>ip-192-168-1-88.eu-west-1.compute.internal</privateDnsName> <primary>true</primary> <association> <publicIp>54.194.252.215</publicIp> <publicDnsName>ec2-54-194-252-215.eu-west-1.compute.amazonaws.com</publicDnsName> <ipOwnerId>amazon</ipOwnerId> </association> </item> </privateIpAddressesSet> <ipv6AddressesSet> <item> <ipv6Address>2001:db8:1234:1a2b::123</ipv6Address> </item> </ipv6AddressesSet> </item> </networkInterfaceSet> <ebsOptimized>false</ebsOptimized> </item> </instancesSet> </item> </reservationSet> </DescribeInstancesResponse>`)) if err != nil { w.WriteHeader(500) } }
{ "content_hash": "e1ba40c44a81fdc18acd63ef5d2ff2d2", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 117, "avg_line_length": 39.581673306772906, "alnum_prop": 0.5124308002013085, "repo_name": "hairyhenderson/gomplate", "id": "0ea29ac169580b80944078d247378d477537e760", "size": "9935", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "internal/tests/integration/test_ec2_utils.go", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "2007" }, { "name": "Go", "bytes": "644531" }, { "name": "Makefile", "bytes": "6672" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace DiContainerBenchmarks\Fixture\C; class FixtureC341 { public function __construct(FixtureC340 $dependency) { } }
{ "content_hash": "ac28eb0c19fd334a255abc4923ad3218", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 56, "avg_line_length": 14, "alnum_prop": 0.7142857142857143, "repo_name": "kocsismate/php-di-container-benchmarks", "id": "f602b2302785ee2c16d452770cb92bf4a7c952c6", "size": "168", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Fixture/C/FixtureC341.php", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "172" }, { "name": "HCL", "bytes": "3637" }, { "name": "HTML", "bytes": "107490" }, { "name": "Makefile", "bytes": "1065" }, { "name": "PHP", "bytes": "919987" }, { "name": "Shell", "bytes": "2632" } ], "symlink_target": "" }
#pragma once #include <QtCore/qglobal.h> #include <QtCore/QString> #include <QtCore/QStringList> namespace trikGui { /// Class which contains program from programming widget. class ScriptHolder { public: /// Deleted ScriptHolder(ScriptHolder const&) = delete; /// Deleted ScriptHolder& operator=(ScriptHolder const&) = delete; /// Creates instance of ScriptHolder. static ScriptHolder* instance(); /// Returns list which contains titles of commands. const QStringList &titles() const; /// Returns list which contains scripts for commands. const QStringList &commands() const; /// Returns number of stored commands. int size() const; /// Adds given strings to appropriate list. /// @param title - new string for titles list. /// @param command - new string for commands list. void setData(const QString &title, const QString &command); /// Clears all stored data. void clear(); private: /// Constructor. ScriptHolder() = default; QStringList mTitles; QStringList mCommands; }; }
{ "content_hash": "ee8639c74632286b8e066bc03958d0e8", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 60, "avg_line_length": 20.714285714285715, "alnum_prop": 0.7261083743842365, "repo_name": "trikset/trikRuntime", "id": "f83f1b26af717c060268150fcfc8da3ed10b4b65", "size": "1606", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "trikGui/scriptHolder.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "112" }, { "name": "C", "bytes": "25126" }, { "name": "C++", "bytes": "1103726" }, { "name": "JavaScript", "bytes": "5258" }, { "name": "Prolog", "bytes": "272" }, { "name": "Python", "bytes": "1887" }, { "name": "QMake", "bytes": "57052" }, { "name": "Qt Script", "bytes": "4095" }, { "name": "Shell", "bytes": "11651" }, { "name": "Tcl", "bytes": "21535" } ], "symlink_target": "" }
const SET_PROJECT_CHANGED = 'scratch-gui/project-changed/SET_PROJECT_CHANGED'; const initialState = false; const reducer = function (state, action) { if (typeof state === 'undefined') state = initialState; switch (action.type) { case SET_PROJECT_CHANGED: return action.changed; default: return state; } }; const setProjectChanged = () => ({ type: SET_PROJECT_CHANGED, changed: true }); const setProjectUnchanged = () => ({ type: SET_PROJECT_CHANGED, changed: false }); export { reducer as default, initialState as projectChangedInitialState, setProjectChanged, setProjectUnchanged };
{ "content_hash": "8dc0b04569c8837ef07f9a0346365257", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 23.392857142857142, "alnum_prop": 0.6687022900763359, "repo_name": "LLK/scratch-gui", "id": "c59f6a107ea4cc9b7ec6cb0c4c403fb29a41fbf5", "size": "655", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/reducers/project-changed.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "120210" }, { "name": "EJS", "bytes": "704" }, { "name": "JavaScript", "bytes": "1616556" }, { "name": "Shell", "bytes": "1861" } ], "symlink_target": "" }
package v6fakes import ( sync "sync" cfnetworkingaction "code.cloudfoundry.org/cli/actor/cfnetworkingaction" v6 "code.cloudfoundry.org/cli/command/v6" ) type FakeNetworkPoliciesActor struct { NetworkPoliciesBySpaceStub func(string) ([]cfnetworkingaction.Policy, cfnetworkingaction.Warnings, error) networkPoliciesBySpaceMutex sync.RWMutex networkPoliciesBySpaceArgsForCall []struct { arg1 string } networkPoliciesBySpaceReturns struct { result1 []cfnetworkingaction.Policy result2 cfnetworkingaction.Warnings result3 error } networkPoliciesBySpaceReturnsOnCall map[int]struct { result1 []cfnetworkingaction.Policy result2 cfnetworkingaction.Warnings result3 error } NetworkPoliciesBySpaceAndAppNameStub func(string, string) ([]cfnetworkingaction.Policy, cfnetworkingaction.Warnings, error) networkPoliciesBySpaceAndAppNameMutex sync.RWMutex networkPoliciesBySpaceAndAppNameArgsForCall []struct { arg1 string arg2 string } networkPoliciesBySpaceAndAppNameReturns struct { result1 []cfnetworkingaction.Policy result2 cfnetworkingaction.Warnings result3 error } networkPoliciesBySpaceAndAppNameReturnsOnCall map[int]struct { result1 []cfnetworkingaction.Policy result2 cfnetworkingaction.Warnings result3 error } invocations map[string][][]interface{} invocationsMutex sync.RWMutex } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpace(arg1 string) ([]cfnetworkingaction.Policy, cfnetworkingaction.Warnings, error) { fake.networkPoliciesBySpaceMutex.Lock() ret, specificReturn := fake.networkPoliciesBySpaceReturnsOnCall[len(fake.networkPoliciesBySpaceArgsForCall)] fake.networkPoliciesBySpaceArgsForCall = append(fake.networkPoliciesBySpaceArgsForCall, struct { arg1 string }{arg1}) fake.recordInvocation("NetworkPoliciesBySpace", []interface{}{arg1}) fake.networkPoliciesBySpaceMutex.Unlock() if fake.NetworkPoliciesBySpaceStub != nil { return fake.NetworkPoliciesBySpaceStub(arg1) } if specificReturn { return ret.result1, ret.result2, ret.result3 } fakeReturns := fake.networkPoliciesBySpaceReturns return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceCallCount() int { fake.networkPoliciesBySpaceMutex.RLock() defer fake.networkPoliciesBySpaceMutex.RUnlock() return len(fake.networkPoliciesBySpaceArgsForCall) } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceCalls(stub func(string) ([]cfnetworkingaction.Policy, cfnetworkingaction.Warnings, error)) { fake.networkPoliciesBySpaceMutex.Lock() defer fake.networkPoliciesBySpaceMutex.Unlock() fake.NetworkPoliciesBySpaceStub = stub } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceArgsForCall(i int) string { fake.networkPoliciesBySpaceMutex.RLock() defer fake.networkPoliciesBySpaceMutex.RUnlock() argsForCall := fake.networkPoliciesBySpaceArgsForCall[i] return argsForCall.arg1 } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceReturns(result1 []cfnetworkingaction.Policy, result2 cfnetworkingaction.Warnings, result3 error) { fake.networkPoliciesBySpaceMutex.Lock() defer fake.networkPoliciesBySpaceMutex.Unlock() fake.NetworkPoliciesBySpaceStub = nil fake.networkPoliciesBySpaceReturns = struct { result1 []cfnetworkingaction.Policy result2 cfnetworkingaction.Warnings result3 error }{result1, result2, result3} } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceReturnsOnCall(i int, result1 []cfnetworkingaction.Policy, result2 cfnetworkingaction.Warnings, result3 error) { fake.networkPoliciesBySpaceMutex.Lock() defer fake.networkPoliciesBySpaceMutex.Unlock() fake.NetworkPoliciesBySpaceStub = nil if fake.networkPoliciesBySpaceReturnsOnCall == nil { fake.networkPoliciesBySpaceReturnsOnCall = make(map[int]struct { result1 []cfnetworkingaction.Policy result2 cfnetworkingaction.Warnings result3 error }) } fake.networkPoliciesBySpaceReturnsOnCall[i] = struct { result1 []cfnetworkingaction.Policy result2 cfnetworkingaction.Warnings result3 error }{result1, result2, result3} } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceAndAppName(arg1 string, arg2 string) ([]cfnetworkingaction.Policy, cfnetworkingaction.Warnings, error) { fake.networkPoliciesBySpaceAndAppNameMutex.Lock() ret, specificReturn := fake.networkPoliciesBySpaceAndAppNameReturnsOnCall[len(fake.networkPoliciesBySpaceAndAppNameArgsForCall)] fake.networkPoliciesBySpaceAndAppNameArgsForCall = append(fake.networkPoliciesBySpaceAndAppNameArgsForCall, struct { arg1 string arg2 string }{arg1, arg2}) fake.recordInvocation("NetworkPoliciesBySpaceAndAppName", []interface{}{arg1, arg2}) fake.networkPoliciesBySpaceAndAppNameMutex.Unlock() if fake.NetworkPoliciesBySpaceAndAppNameStub != nil { return fake.NetworkPoliciesBySpaceAndAppNameStub(arg1, arg2) } if specificReturn { return ret.result1, ret.result2, ret.result3 } fakeReturns := fake.networkPoliciesBySpaceAndAppNameReturns return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceAndAppNameCallCount() int { fake.networkPoliciesBySpaceAndAppNameMutex.RLock() defer fake.networkPoliciesBySpaceAndAppNameMutex.RUnlock() return len(fake.networkPoliciesBySpaceAndAppNameArgsForCall) } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceAndAppNameCalls(stub func(string, string) ([]cfnetworkingaction.Policy, cfnetworkingaction.Warnings, error)) { fake.networkPoliciesBySpaceAndAppNameMutex.Lock() defer fake.networkPoliciesBySpaceAndAppNameMutex.Unlock() fake.NetworkPoliciesBySpaceAndAppNameStub = stub } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceAndAppNameArgsForCall(i int) (string, string) { fake.networkPoliciesBySpaceAndAppNameMutex.RLock() defer fake.networkPoliciesBySpaceAndAppNameMutex.RUnlock() argsForCall := fake.networkPoliciesBySpaceAndAppNameArgsForCall[i] return argsForCall.arg1, argsForCall.arg2 } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceAndAppNameReturns(result1 []cfnetworkingaction.Policy, result2 cfnetworkingaction.Warnings, result3 error) { fake.networkPoliciesBySpaceAndAppNameMutex.Lock() defer fake.networkPoliciesBySpaceAndAppNameMutex.Unlock() fake.NetworkPoliciesBySpaceAndAppNameStub = nil fake.networkPoliciesBySpaceAndAppNameReturns = struct { result1 []cfnetworkingaction.Policy result2 cfnetworkingaction.Warnings result3 error }{result1, result2, result3} } func (fake *FakeNetworkPoliciesActor) NetworkPoliciesBySpaceAndAppNameReturnsOnCall(i int, result1 []cfnetworkingaction.Policy, result2 cfnetworkingaction.Warnings, result3 error) { fake.networkPoliciesBySpaceAndAppNameMutex.Lock() defer fake.networkPoliciesBySpaceAndAppNameMutex.Unlock() fake.NetworkPoliciesBySpaceAndAppNameStub = nil if fake.networkPoliciesBySpaceAndAppNameReturnsOnCall == nil { fake.networkPoliciesBySpaceAndAppNameReturnsOnCall = make(map[int]struct { result1 []cfnetworkingaction.Policy result2 cfnetworkingaction.Warnings result3 error }) } fake.networkPoliciesBySpaceAndAppNameReturnsOnCall[i] = struct { result1 []cfnetworkingaction.Policy result2 cfnetworkingaction.Warnings result3 error }{result1, result2, result3} } func (fake *FakeNetworkPoliciesActor) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.networkPoliciesBySpaceMutex.RLock() defer fake.networkPoliciesBySpaceMutex.RUnlock() fake.networkPoliciesBySpaceAndAppNameMutex.RLock() defer fake.networkPoliciesBySpaceAndAppNameMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } func (fake *FakeNetworkPoliciesActor) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } var _ v6.NetworkPoliciesActor = new(FakeNetworkPoliciesActor)
{ "content_hash": "b9dd7433fa182f2c9c00b3d7ea43bfb2", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 181, "avg_line_length": 40.40487804878049, "alnum_prop": 0.823252444766389, "repo_name": "odlp/antifreeze", "id": "4581d29f1e1042123bcc5c6f3c6f261bf57141cf", "size": "8332", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "vendor/github.com/cloudfoundry/cli/command/v6/v6fakes/fake_network_policies_actor.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "10174" }, { "name": "Shell", "bytes": "1077" } ], "symlink_target": "" }
.. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. .. include:: ../../../common.defs TSMgmt ****** Synopsis ======== Macros used for RPC communications. Management Signals ================== .. c:macro:: MGMT_SIGNAL_PID .. c:macro:: MGMT_SIGNAL_CONFIG_ERROR .. c:macro:: MGMT_SIGNAL_SYSTEM_ERROR .. c:macro:: MGMT_SIGNAL_CONFIG_FILE_READ .. c:macro:: MGMT_SIGNAL_CACHE_ERROR .. c:macro:: MGMT_SIGNAL_CACHE_WARNING .. c:macro:: MGMT_SIGNAL_LOGGING_ERROR .. c:macro:: MGMT_SIGNAL_LOGGING_WARNING .. c:macro:: MGMT_SIGNAL_PLUGIN_SET_CONFIG .. c:macro:: MGMT_SIGNAL_LIBRECORDS .. c:macro:: MGMT_SIGNAL_HTTP_CONGESTED_SERVER .. c:macro:: MGMT_SIGNAL_HTTP_ALLEVIATED_SERVER .. c:macro:: MGMT_SIGNAL_CONFIG_FILE_CHILD Management Events ================== .. c:macro:: MGMT_EVENT_SYNC_KEY .. c:macro:: MGMT_EVENT_SHUTDOWN .. c:macro:: MGMT_EVENT_RESTART .. c:macro:: MGMT_EVENT_BOUNCE .. c:macro:: MGMT_EVENT_CLEAR_STATS .. c:macro:: MGMT_EVENT_CONFIG_FILE_UPDATE .. c:macro:: MGMT_EVENT_PLUGIN_CONFIG_UPDATE .. c:macro:: MGMT_EVENT_ROLL_LOG_FILES .. c:macro:: MGMT_EVENT_LIBRECORDS .. c:macro:: MGMT_EVENT_STORAGE_DEVICE_CMD_OFFLINE .. c:macro:: MGMT_EVENT_LIFECYCLE_MESSAGE OpTypes ======= Possible operations or messages that can be sent between TM and remote clients. .. cpp:enum:: OpType .. cpp:enumerator:: RECORD_SET .. cpp:enumerator:: RECORD_GET .. cpp:enumerator:: PROXY_STATE_GET .. cpp:enumerator:: PROXY_STATE_SET .. cpp:enumerator:: RECONFIGURE .. cpp:enumerator:: RESTART .. cpp:enumerator:: BOUNCE .. cpp:enumerator:: EVENT_RESOLVE .. cpp:enumerator:: EVENT_GET_MLT .. cpp:enumerator:: EVENT_ACTIVE .. cpp:enumerator:: EVENT_REG_CALLBACK .. cpp:enumerator:: EVENT_UNREG_CALLBACK .. cpp:enumerator:: EVENT_NOTIFY .. cpp:enumerator:: STATS_RESET_NODE .. cpp:enumerator:: STORAGE_DEVICE_CMD_OFFLINE .. cpp:enumerator:: RECORD_MATCH_GET .. cpp:enumerator:: API_PING .. cpp:enumerator:: SERVER_BACKTRACE .. cpp:enumerator:: RECORD_DESCRIBE_CONFIG .. cpp:enumerator:: LIFECYCLE_MESSAGE .. cpp:enumerator:: UNDEFINED_OP TSMgmtError =========== .. cpp:enum:: TSMgmtError .. cpp:enumerator:: TS_ERR_OKAY .. cpp:enumerator:: TS_ERR_READ_FILE .. cpp:enumerator:: TS_ERR_WRITE_FILE .. cpp:enumerator:: TS_ERR_PARSE_CONFIG_RULE .. cpp:enumerator:: TS_ERR_INVALID_CONFIG_RULE .. cpp:enumerator:: TS_ERR_NET_ESTABLISH .. cpp:enumerator:: TS_ERR_NET_READ .. cpp:enumerator:: TS_ERR_NET_WRITE .. cpp:enumerator:: TS_ERR_NET_EOF .. cpp:enumerator:: TS_ERR_NET_TIMEOUT .. cpp:enumerator:: TS_ERR_SYS_CALL .. cpp:enumerator:: TS_ERR_PARAMS .. cpp:enumerator:: TS_ERR_NOT_SUPPORTED .. cpp:enumerator:: TS_ERR_PERMISSION_DENIED .. cpp:enumerator:: TS_ERR_FAIL MgmtMarshallType ================ .. cpp:enum:: MgmtMarshallType .. cpp:enumerator:: MGMT_MARSHALL_INT .. cpp:enumerator:: MGMT_MARSHALL_LONG .. cpp:enumerator:: MGMT_MARSHALL_STRING .. cpp:enumerator:: MGMT_MARSHALL_DATA
{ "content_hash": "420549392aa025ffa21f16fc0f34a46f", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 79, "avg_line_length": 21.508474576271187, "alnum_prop": 0.681639085894405, "repo_name": "vmamidi/trafficserver", "id": "40526f1a385b1a42df7814cf70f917d0233e599f", "size": "3808", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "doc/developer-guide/api/types/TSMgmtTypes.en.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1478484" }, { "name": "C++", "bytes": "16571327" }, { "name": "CMake", "bytes": "13151" }, { "name": "Dockerfile", "bytes": "6693" }, { "name": "Java", "bytes": "9881" }, { "name": "Lua", "bytes": "64412" }, { "name": "M4", "bytes": "216563" }, { "name": "Makefile", "bytes": "250981" }, { "name": "Objective-C", "bytes": "12976" }, { "name": "Perl", "bytes": "128436" }, { "name": "Python", "bytes": "1517480" }, { "name": "SWIG", "bytes": "25777" }, { "name": "Shell", "bytes": "177920" }, { "name": "Starlark", "bytes": "987" }, { "name": "Vim script", "bytes": "192" } ], "symlink_target": "" }
The key points of this chapter are: - You can annotate declarations just as you use modifiers such as public or static. - You can also annotate types that appear in declarations, casts, instanceof checks, or method references. - An annotation starts with a @ symbol and may contain key/value pairs called elements. - Annotation values must be compile-time constants: primitive types, enum constants, Class literals, other annotations, or arrays thereof. - An item can have repeating annotations or annotations of different types. - To define an annotation, specify an annotation interface whose methods correspond to the annotation elements. - The Java library defines over a dozen annotations, and annotations are extensively used in the Java Enterprise Edition. - To process annotations in a running Java program, you can use reflection and query the reflected items for annotations. - Annotation processors process source files during compilation, using the Java language model API to locate annotated items. - Annotations for local variables and packages are discarded when a class is compiled. Therefore, they can only be processed at the source level.
{ "content_hash": "550e837e6be73066c0f259e5b68d1ead", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 91, "avg_line_length": 32.891891891891895, "alnum_prop": 0.772391125718981, "repo_name": "sdcuike/book-reading", "id": "dd276ecb8148072226cd380dc4615af98cb59fbf", "size": "1217", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core-java-for-the-impatient/src/main/java/com/doctor/ch11/keyPoints.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "129839" }, { "name": "JavaScript", "bytes": "5205" }, { "name": "Lua", "bytes": "6726" }, { "name": "Shell", "bytes": "240" } ], "symlink_target": "" }
package org.apache.streams.kafka; import com.fasterxml.jackson.databind.ObjectMapper; import com.typesafe.config.Config; import kafka.consumer.Consumer; import kafka.consumer.ConsumerConfig; import kafka.consumer.KafkaStream; import kafka.consumer.Whitelist; import kafka.javaapi.consumer.ConsumerConnector; import kafka.serializer.StringDecoder; import kafka.utils.VerifiableProperties; import org.apache.streams.config.StreamsConfigurator; import org.apache.streams.core.StreamsDatum; import org.apache.streams.core.StreamsPersistReader; import org.apache.streams.core.StreamsResultSet; import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.streams.kafka.KafkaConfiguration; import java.io.Serializable; import java.math.BigInteger; import java.util.List; import java.util.Properties; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; public class KafkaPersistReader implements StreamsPersistReader, Serializable { public final static String STREAMS_ID = "KafkaPersistReader"; private static final Logger LOGGER = LoggerFactory.getLogger(KafkaPersistReader.class); protected volatile Queue<StreamsDatum> persistQueue; private ObjectMapper mapper = new ObjectMapper(); private KafkaConfiguration config; private ConsumerConfig consumerConfig; private ConsumerConnector consumerConnector; public List<KafkaStream<String, String>> inStreams; private ExecutorService executor = Executors.newSingleThreadExecutor(); public KafkaPersistReader() { Config config = StreamsConfigurator.config.getConfig("kafka"); this.config = KafkaConfigurator.detectConfiguration(config); this.persistQueue = new ConcurrentLinkedQueue<StreamsDatum>(); } public KafkaPersistReader(Queue<StreamsDatum> persistQueue) { Config config = StreamsConfigurator.config.getConfig("kafka"); this.config = KafkaConfigurator.detectConfiguration(config); this.persistQueue = persistQueue; } public void setConfig(KafkaConfiguration config) { this.config = config; } @Override public String getId() { return STREAMS_ID; } @Override public void startStream() { Properties props = new Properties(); props.setProperty("serializer.encoding", "UTF8"); consumerConfig = new ConsumerConfig(props); consumerConnector = Consumer.createJavaConsumerConnector(consumerConfig); Whitelist topics = new Whitelist(config.getTopic()); VerifiableProperties vprops = new VerifiableProperties(props); inStreams = consumerConnector.createMessageStreamsByFilter(topics, 1, new StringDecoder(vprops), new StringDecoder(vprops)); for (final KafkaStream stream : inStreams) { executor.submit(new KafkaPersistReaderTask(this, stream)); } } @Override public StreamsResultSet readAll() { return readCurrent(); } @Override public StreamsResultSet readCurrent() { return null; } @Override public StreamsResultSet readNew(BigInteger bigInteger) { return null; } @Override public StreamsResultSet readRange(DateTime dateTime, DateTime dateTime2) { return null; } @Override public boolean isRunning() { return !executor.isShutdown() && !executor.isTerminated(); } private static ConsumerConfig createConsumerConfig(String a_zookeeper, String a_groupId) { Properties props = new Properties(); props.put("zookeeper.connect", a_zookeeper); props.put("group.id", a_groupId); props.put("zookeeper.session.timeout.ms", "400"); props.put("zookeeper.sync.time.ms", "200"); props.put("auto.commit.interval.ms", "1000"); return new ConsumerConfig(props); } @Override public void prepare(Object configurationObject) { } @Override public void cleanUp() { consumerConnector.shutdown(); while( !executor.isTerminated()) { try { executor.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) {} } } }
{ "content_hash": "5523fbd4d65c3f15f71341386705de21", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 132, "avg_line_length": 30.22222222222222, "alnum_prop": 0.7182904411764706, "repo_name": "steveblackmon/incubator-streams", "id": "7d31d41571d686c7da4e2e5666b8b64614d9ae1b", "size": "5097", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "streams-contrib/streams-persist-kafka/src/main/java/org/apache/streams/kafka/KafkaPersistReader.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2214166" }, { "name": "PigLatin", "bytes": "5816" }, { "name": "Scala", "bytes": "9095" } ], "symlink_target": "" }
package com.amazonaws.services.robomaker.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/robomaker-2018-06-29/BatchDescribeSimulationJob" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class BatchDescribeSimulationJobRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * A list of Amazon Resource Names (ARNs) of simulation jobs to describe. * </p> */ private java.util.List<String> jobs; /** * <p> * A list of Amazon Resource Names (ARNs) of simulation jobs to describe. * </p> * * @return A list of Amazon Resource Names (ARNs) of simulation jobs to describe. */ public java.util.List<String> getJobs() { return jobs; } /** * <p> * A list of Amazon Resource Names (ARNs) of simulation jobs to describe. * </p> * * @param jobs * A list of Amazon Resource Names (ARNs) of simulation jobs to describe. */ public void setJobs(java.util.Collection<String> jobs) { if (jobs == null) { this.jobs = null; return; } this.jobs = new java.util.ArrayList<String>(jobs); } /** * <p> * A list of Amazon Resource Names (ARNs) of simulation jobs to describe. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setJobs(java.util.Collection)} or {@link #withJobs(java.util.Collection)} if you want to override the * existing values. * </p> * * @param jobs * A list of Amazon Resource Names (ARNs) of simulation jobs to describe. * @return Returns a reference to this object so that method calls can be chained together. */ public BatchDescribeSimulationJobRequest withJobs(String... jobs) { if (this.jobs == null) { setJobs(new java.util.ArrayList<String>(jobs.length)); } for (String ele : jobs) { this.jobs.add(ele); } return this; } /** * <p> * A list of Amazon Resource Names (ARNs) of simulation jobs to describe. * </p> * * @param jobs * A list of Amazon Resource Names (ARNs) of simulation jobs to describe. * @return Returns a reference to this object so that method calls can be chained together. */ public BatchDescribeSimulationJobRequest withJobs(java.util.Collection<String> jobs) { setJobs(jobs); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getJobs() != null) sb.append("Jobs: ").append(getJobs()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BatchDescribeSimulationJobRequest == false) return false; BatchDescribeSimulationJobRequest other = (BatchDescribeSimulationJobRequest) obj; if (other.getJobs() == null ^ this.getJobs() == null) return false; if (other.getJobs() != null && other.getJobs().equals(this.getJobs()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getJobs() == null) ? 0 : getJobs().hashCode()); return hashCode; } @Override public BatchDescribeSimulationJobRequest clone() { return (BatchDescribeSimulationJobRequest) super.clone(); } }
{ "content_hash": "3e38073f6102c8c027568419cbc1d1a7", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 129, "avg_line_length": 29.62937062937063, "alnum_prop": 0.6042010856738258, "repo_name": "aws/aws-sdk-java", "id": "ba3d9af70051c80feb18dab35e212df88231641a", "size": "4817", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/BatchDescribeSimulationJobRequest.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
from __future__ import unicode_literals from django import template from django.contrib.contenttypes.models import ContentType from classytags.core import Options from classytags.arguments import Argument from classytags.helpers import AsTag from taggit_templatetags2 import settings register = template.Library() @register.tag class GetTagForObject(AsTag): name = 'get_tags_for_object' options = Options( Argument('source_object', resolve=True, required=True), 'as', Argument('varname', resolve=False, required=False), ) def get_value(self, context, source_object, varname=''): """ Args: source_object - <django model object> Return: queryset tags """ tag_model = settings.TAG_MODEL app_label = source_object._meta.app_label model = source_object._meta.model_name content_type = ContentType.objects.get(app_label=app_label, model=model) try: tags = tag_model.objects.filter( taggit_taggeditem_items__object_id=source_object, taggit_taggeditem_items__content_type=content_type) except: tags = tag_model.objects.filter( taggit_taggeditem_items__object_id=source_object.id, taggit_taggeditem_items__content_type=content_type) if varname: context[varname] return '' else: return tags
{ "content_hash": "574baf189f0d37c6eb1b8dfc50199f5d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 68, "avg_line_length": 28.24074074074074, "alnum_prop": 0.6098360655737705, "repo_name": "danirus/blognajd", "id": "da022f6ac0ebb2214c0075bac427b9a4114c0c73", "size": "1525", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "blognajd/templatetags/blognajd_tags.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "17433" }, { "name": "HTML", "bytes": "28956" }, { "name": "Python", "bytes": "85405" }, { "name": "Shell", "bytes": "354" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> <parameters> <parameter key="kernel.root_dir">C:\wamp\www\Symfony\app</parameter> <parameter key="kernel.environment">dev</parameter> <parameter key="kernel.debug">true</parameter> <parameter key="kernel.name">app</parameter> <parameter key="kernel.cache_dir">C:\wamp\www\Symfony\app/cache/dev</parameter> <parameter key="kernel.logs_dir">C:\wamp\www\Symfony\app/logs</parameter> <parameter key="kernel.bundles" type="collection"> <parameter key="FrameworkBundle">Symfony\Bundle\FrameworkBundle\FrameworkBundle</parameter> <parameter key="SecurityBundle">Symfony\Bundle\SecurityBundle\SecurityBundle</parameter> <parameter key="TwigBundle">Symfony\Bundle\TwigBundle\TwigBundle</parameter> <parameter key="MonologBundle">Symfony\Bundle\MonologBundle\MonologBundle</parameter> <parameter key="SwiftmailerBundle">Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle</parameter> <parameter key="DoctrineBundle">Symfony\Bundle\DoctrineBundle\DoctrineBundle</parameter> <parameter key="AsseticBundle">Symfony\Bundle\AsseticBundle\AsseticBundle</parameter> <parameter key="SensioFrameworkExtraBundle">Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle</parameter> <parameter key="JMSSecurityExtraBundle">JMS\SecurityExtraBundle\JMSSecurityExtraBundle</parameter> <parameter key="IoshBlogBundle">Iosh\BlogBundle\IoshBlogBundle</parameter> <parameter key="AcmeDemoBundle">Acme\DemoBundle\AcmeDemoBundle</parameter> <parameter key="WebProfilerBundle">Symfony\Bundle\WebProfilerBundle\WebProfilerBundle</parameter> <parameter key="SensioDistributionBundle">Sensio\Bundle\DistributionBundle\SensioDistributionBundle</parameter> <parameter key="SensioGeneratorBundle">Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle</parameter> </parameter> <parameter key="kernel.charset">UTF-8</parameter> <parameter key="kernel.container_class">appDevDebugProjectContainer</parameter> <parameter key="database_driver">pdo_mysql</parameter> <parameter key="database_host">localhost</parameter> <parameter key="database_port"></parameter> <parameter key="database_name">symfony</parameter> <parameter key="database_user">root</parameter> <parameter key="database_password"></parameter> <parameter key="mailer_transport">smtp</parameter> <parameter key="mailer_host">localhost</parameter> <parameter key="mailer_user"></parameter> <parameter key="mailer_password"></parameter> <parameter key="locale">en</parameter> <parameter key="secret">ThisTokenIsNotSoSecretChangeIt</parameter> <parameter key="router_listener.class">Symfony\Bundle\FrameworkBundle\EventListener\RouterListener</parameter> <parameter key="controller_resolver.class">Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver</parameter> <parameter key="controller_name_converter.class">Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser</parameter> <parameter key="response_listener.class">Symfony\Component\HttpKernel\EventListener\ResponseListener</parameter> <parameter key="event_dispatcher.class">Symfony\Bundle\FrameworkBundle\ContainerAwareEventDispatcher</parameter> <parameter key="http_kernel.class">Symfony\Bundle\FrameworkBundle\HttpKernel</parameter> <parameter key="filesystem.class">Symfony\Component\Filesystem\Filesystem</parameter> <parameter key="cache_warmer.class">Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate</parameter> <parameter key="file_locator.class">Symfony\Component\HttpKernel\Config\FileLocator</parameter> <parameter key="translator.class">Symfony\Bundle\FrameworkBundle\Translation\Translator</parameter> <parameter key="translator.identity.class">Symfony\Component\Translation\IdentityTranslator</parameter> <parameter key="translator.selector.class">Symfony\Component\Translation\MessageSelector</parameter> <parameter key="translation.loader.php.class">Symfony\Component\Translation\Loader\PhpFileLoader</parameter> <parameter key="translation.loader.yml.class">Symfony\Component\Translation\Loader\YamlFileLoader</parameter> <parameter key="translation.loader.xliff.class">Symfony\Component\Translation\Loader\XliffFileLoader</parameter> <parameter key="debug.event_dispatcher.class">Symfony\Bundle\FrameworkBundle\Debug\TraceableEventDispatcher</parameter> <parameter key="debug.container.dump">C:\wamp\www\Symfony\app/cache/dev/appDevDebugProjectContainer.xml</parameter> <parameter key="kernel.secret">ThisTokenIsNotSoSecretChangeIt</parameter> <parameter key="kernel.trust_proxy_headers">false</parameter> <parameter key="session.class">Symfony\Component\HttpFoundation\Session</parameter> <parameter key="session.storage.native.class">Symfony\Component\HttpFoundation\SessionStorage\NativeSessionStorage</parameter> <parameter key="session.storage.filesystem.class">Symfony\Component\HttpFoundation\SessionStorage\FilesystemSessionStorage</parameter> <parameter key="session_listener.class">Symfony\Bundle\FrameworkBundle\EventListener\SessionListener</parameter> <parameter key="session.default_locale">en</parameter> <parameter key="session.storage.options" type="collection"/> <parameter key="form.extension.class">Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension</parameter> <parameter key="form.factory.class">Symfony\Component\Form\FormFactory</parameter> <parameter key="form.type_guesser.validator.class">Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser</parameter> <parameter key="form.csrf_provider.class">Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider</parameter> <parameter key="form.type_extension.csrf.enabled">true</parameter> <parameter key="form.type_extension.csrf.field_name">_token</parameter> <parameter key="validator.class">Symfony\Component\Validator\Validator</parameter> <parameter key="validator.mapping.class_metadata_factory.class">Symfony\Component\Validator\Mapping\ClassMetadataFactory</parameter> <parameter key="validator.mapping.cache.apc.class">Symfony\Component\Validator\Mapping\Cache\ApcCache</parameter> <parameter key="validator.mapping.cache.prefix"></parameter> <parameter key="validator.mapping.loader.loader_chain.class">Symfony\Component\Validator\Mapping\Loader\LoaderChain</parameter> <parameter key="validator.mapping.loader.static_method_loader.class">Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader</parameter> <parameter key="validator.mapping.loader.annotation_loader.class">Symfony\Component\Validator\Mapping\Loader\AnnotationLoader</parameter> <parameter key="validator.mapping.loader.xml_files_loader.class">Symfony\Component\Validator\Mapping\Loader\XmlFilesLoader</parameter> <parameter key="validator.mapping.loader.yaml_files_loader.class">Symfony\Component\Validator\Mapping\Loader\YamlFilesLoader</parameter> <parameter key="validator.validator_factory.class">Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory</parameter> <parameter key="validator.mapping.loader.xml_files_loader.mapping_files" type="collection"> <parameter>C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Component\Form/Resources/config/validation.xml</parameter> </parameter> <parameter key="validator.mapping.loader.yaml_files_loader.mapping_files" type="collection"/> <parameter key="profiler.class">Symfony\Component\HttpKernel\Profiler\Profiler</parameter> <parameter key="profiler_listener.class">Symfony\Component\HttpKernel\EventListener\ProfilerListener</parameter> <parameter key="data_collector.config.class">Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector</parameter> <parameter key="data_collector.request.class">Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector</parameter> <parameter key="data_collector.exception.class">Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector</parameter> <parameter key="data_collector.events.class">Symfony\Component\HttpKernel\DataCollector\EventDataCollector</parameter> <parameter key="data_collector.logger.class">Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector</parameter> <parameter key="data_collector.timer.class">Symfony\Bundle\FrameworkBundle\DataCollector\TimerDataCollector</parameter> <parameter key="data_collector.memory.class">Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector</parameter> <parameter key="profiler_listener.only_exceptions">false</parameter> <parameter key="profiler_listener.only_master_requests">false</parameter> <parameter key="profiler.storage.dsn">sqlite:C:\wamp\www\Symfony\app/cache/dev/profiler.db</parameter> <parameter key="profiler.storage.username"></parameter> <parameter key="profiler.storage.password"></parameter> <parameter key="profiler.storage.lifetime">86400</parameter> <parameter key="router.class">Symfony\Bundle\FrameworkBundle\Routing\Router</parameter> <parameter key="routing.loader.class">Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader</parameter> <parameter key="routing.resolver.class">Symfony\Component\Config\Loader\LoaderResolver</parameter> <parameter key="routing.loader.xml.class">Symfony\Component\Routing\Loader\XmlFileLoader</parameter> <parameter key="routing.loader.yml.class">Symfony\Component\Routing\Loader\YamlFileLoader</parameter> <parameter key="routing.loader.php.class">Symfony\Component\Routing\Loader\PhpFileLoader</parameter> <parameter key="router.options.generator_class">Symfony\Component\Routing\Generator\UrlGenerator</parameter> <parameter key="router.options.generator_base_class">Symfony\Component\Routing\Generator\UrlGenerator</parameter> <parameter key="router.options.generator_dumper_class">Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper</parameter> <parameter key="router.options.matcher_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</parameter> <parameter key="router.options.matcher_base_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</parameter> <parameter key="router.options.matcher_dumper_class">Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper</parameter> <parameter key="router.cache_warmer.class">Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer</parameter> <parameter key="router.options.matcher.cache_class">app%kernel.environment%UrlMatcher</parameter> <parameter key="router.options.generator.cache_class">app%kernel.environment%UrlGenerator</parameter> <parameter key="router.resource">C:\wamp\www\Symfony\app/config/routing_dev.yml</parameter> <parameter key="request_listener.http_port">80</parameter> <parameter key="request_listener.https_port">443</parameter> <parameter key="templating.engine.delegating.class">Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine</parameter> <parameter key="templating.name_parser.class">Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser</parameter> <parameter key="templating.cache_warmer.template_paths.class">Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer</parameter> <parameter key="templating.locator.class">Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator</parameter> <parameter key="templating.loader.filesystem.class">Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader</parameter> <parameter key="templating.loader.cache.class">Symfony\Component\Templating\Loader\CacheLoader</parameter> <parameter key="templating.loader.chain.class">Symfony\Component\Templating\Loader\ChainLoader</parameter> <parameter key="templating.finder.class">Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder</parameter> <parameter key="templating.engine.php.class">Symfony\Bundle\FrameworkBundle\Templating\PhpEngine</parameter> <parameter key="templating.helper.slots.class">Symfony\Component\Templating\Helper\SlotsHelper</parameter> <parameter key="templating.helper.assets.class">Symfony\Component\Templating\Helper\CoreAssetsHelper</parameter> <parameter key="templating.helper.actions.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\ActionsHelper</parameter> <parameter key="templating.helper.router.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper</parameter> <parameter key="templating.helper.request.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\RequestHelper</parameter> <parameter key="templating.helper.session.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper</parameter> <parameter key="templating.helper.code.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper</parameter> <parameter key="templating.helper.translator.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper</parameter> <parameter key="templating.helper.form.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper</parameter> <parameter key="templating.globals.class">Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables</parameter> <parameter key="templating.asset.path_package.class">Symfony\Bundle\FrameworkBundle\Templating\Asset\PathPackage</parameter> <parameter key="templating.asset.url_package.class">Symfony\Component\Templating\Asset\UrlPackage</parameter> <parameter key="templating.asset.package_factory.class">Symfony\Bundle\FrameworkBundle\Templating\Asset\PackageFactory</parameter> <parameter key="templating.helper.code.file_link_format">null</parameter> <parameter key="templating.helper.form.resources" type="collection"> <parameter>FrameworkBundle:Form</parameter> </parameter> <parameter key="templating.debugger.class">Symfony\Bundle\FrameworkBundle\Templating\Debugger</parameter> <parameter key="templating.loader.cache.path">null</parameter> <parameter key="templating.engines" type="collection"> <parameter>twig</parameter> </parameter> <parameter key="annotations.reader.class">Doctrine\Common\Annotations\AnnotationReader</parameter> <parameter key="annotations.cached_reader.class">Doctrine\Common\Annotations\CachedReader</parameter> <parameter key="annotations.file_cache_reader.class">Doctrine\Common\Annotations\FileCacheReader</parameter> <parameter key="security.context.class">Symfony\Component\Security\Core\SecurityContext</parameter> <parameter key="security.user_checker.class">Symfony\Component\Security\Core\User\UserChecker</parameter> <parameter key="security.encoder_factory.generic.class">Symfony\Component\Security\Core\Encoder\EncoderFactory</parameter> <parameter key="security.encoder.digest.class">Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder</parameter> <parameter key="security.encoder.plain.class">Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder</parameter> <parameter key="security.user.provider.entity.class">Symfony\Bridge\Doctrine\Security\User\EntityUserProvider</parameter> <parameter key="security.user.provider.in_memory.class">Symfony\Component\Security\Core\User\InMemoryUserProvider</parameter> <parameter key="security.user.provider.in_memory.user.class">Symfony\Component\Security\Core\User\User</parameter> <parameter key="security.user.provider.chain.class">Symfony\Component\Security\Core\User\ChainUserProvider</parameter> <parameter key="security.authentication.trust_resolver.class">Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver</parameter> <parameter key="security.authentication.trust_resolver.anonymous_class">Symfony\Component\Security\Core\Authentication\Token\AnonymousToken</parameter> <parameter key="security.authentication.trust_resolver.rememberme_class">Symfony\Component\Security\Core\Authentication\Token\RememberMeToken</parameter> <parameter key="security.authentication.manager.class">Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager</parameter> <parameter key="security.authentication.session_strategy.class">Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy</parameter> <parameter key="security.access.decision_manager.class">Symfony\Component\Security\Core\Authorization\AccessDecisionManager</parameter> <parameter key="security.access.simple_role_voter.class">Symfony\Component\Security\Core\Authorization\Voter\RoleVoter</parameter> <parameter key="security.access.authenticated_voter.class">Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter</parameter> <parameter key="security.access.role_hierarchy_voter.class">Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter</parameter> <parameter key="security.firewall.class">Symfony\Component\Security\Http\Firewall</parameter> <parameter key="security.firewall.map.class">Symfony\Bundle\SecurityBundle\Security\FirewallMap</parameter> <parameter key="security.firewall.context.class">Symfony\Bundle\SecurityBundle\Security\FirewallContext</parameter> <parameter key="security.matcher.class">Symfony\Component\HttpFoundation\RequestMatcher</parameter> <parameter key="security.role_hierarchy.class">Symfony\Component\Security\Core\Role\RoleHierarchy</parameter> <parameter key="security.http_utils.class">Symfony\Component\Security\Http\HttpUtils</parameter> <parameter key="security.authentication.retry_entry_point.class">Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint</parameter> <parameter key="security.channel_listener.class">Symfony\Component\Security\Http\Firewall\ChannelListener</parameter> <parameter key="security.authentication.form_entry_point.class">Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint</parameter> <parameter key="security.authentication.listener.form.class">Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener</parameter> <parameter key="security.authentication.listener.basic.class">Symfony\Component\Security\Http\Firewall\BasicAuthenticationListener</parameter> <parameter key="security.authentication.basic_entry_point.class">Symfony\Component\Security\Http\EntryPoint\BasicAuthenticationEntryPoint</parameter> <parameter key="security.authentication.listener.digest.class">Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener</parameter> <parameter key="security.authentication.digest_entry_point.class">Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint</parameter> <parameter key="security.authentication.listener.x509.class">Symfony\Component\Security\Http\Firewall\X509AuthenticationListener</parameter> <parameter key="security.authentication.listener.anonymous.class">Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener</parameter> <parameter key="security.authentication.switchuser_listener.class">Symfony\Component\Security\Http\Firewall\SwitchUserListener</parameter> <parameter key="security.logout_listener.class">Symfony\Component\Security\Http\Firewall\LogoutListener</parameter> <parameter key="security.logout.handler.session.class">Symfony\Component\Security\Http\Logout\SessionLogoutHandler</parameter> <parameter key="security.logout.handler.cookie_clearing.class">Symfony\Component\Security\Http\Logout\CookieClearingLogoutHandler</parameter> <parameter key="security.access_listener.class">Symfony\Component\Security\Http\Firewall\AccessListener</parameter> <parameter key="security.access_map.class">Symfony\Component\Security\Http\AccessMap</parameter> <parameter key="security.exception_listener.class">Symfony\Component\Security\Http\Firewall\ExceptionListener</parameter> <parameter key="security.context_listener.class">Symfony\Component\Security\Http\Firewall\ContextListener</parameter> <parameter key="security.authentication.provider.dao.class">Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider</parameter> <parameter key="security.authentication.provider.pre_authenticated.class">Symfony\Component\Security\Core\Authentication\Provider\PreAuthenticatedAuthenticationProvider</parameter> <parameter key="security.authentication.provider.anonymous.class">Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider</parameter> <parameter key="security.authentication.provider.rememberme.class">Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider</parameter> <parameter key="security.authentication.listener.rememberme.class">Symfony\Component\Security\Http\Firewall\RememberMeListener</parameter> <parameter key="security.rememberme.token.provider.in_memory.class">Symfony\Component\Security\Core\Authentication\RememberMe\InMemoryTokenProvider</parameter> <parameter key="security.authentication.rememberme.services.persistent.class">Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices</parameter> <parameter key="security.authentication.rememberme.services.simplehash.class">Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices</parameter> <parameter key="security.rememberme.response_listener.class">Symfony\Bundle\SecurityBundle\EventListener\ResponseListener</parameter> <parameter key="templating.helper.security.class">Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper</parameter> <parameter key="data_collector.security.class">Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector</parameter> <parameter key="security.access.denied_url">null</parameter> <parameter key="security.authentication.session_strategy.strategy">migrate</parameter> <parameter key="security.access.always_authenticate_before_granting">false</parameter> <parameter key="security.authentication.hide_user_not_found">true</parameter> <parameter key="security.role_hierarchy.roles" type="collection"> <parameter key="ROLE_ADMIN" type="collection"> <parameter>ROLE_USER</parameter> </parameter> <parameter key="ROLE_SUPER_ADMIN" type="collection"> <parameter>ROLE_USER</parameter> <parameter>ROLE_ADMIN</parameter> <parameter>ROLE_ALLOWED_TO_SWITCH</parameter> </parameter> </parameter> <parameter key="twig.class">Twig_Environment</parameter> <parameter key="twig.loader.class">Symfony\Bundle\TwigBundle\Loader\FilesystemLoader</parameter> <parameter key="templating.engine.twig.class">Symfony\Bundle\TwigBundle\TwigEngine</parameter> <parameter key="twig.cache_warmer.class">Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer</parameter> <parameter key="twig.extension.trans.class">Symfony\Bridge\Twig\Extension\TranslationExtension</parameter> <parameter key="twig.extension.assets.class">Symfony\Bundle\TwigBundle\Extension\AssetsExtension</parameter> <parameter key="twig.extension.actions.class">Symfony\Bundle\TwigBundle\Extension\ActionsExtension</parameter> <parameter key="twig.extension.code.class">Symfony\Bundle\TwigBundle\Extension\CodeExtension</parameter> <parameter key="twig.extension.routing.class">Symfony\Bridge\Twig\Extension\RoutingExtension</parameter> <parameter key="twig.extension.yaml.class">Symfony\Bridge\Twig\Extension\YamlExtension</parameter> <parameter key="twig.extension.form.class">Symfony\Bridge\Twig\Extension\FormExtension</parameter> <parameter key="twig.exception_listener.class">Symfony\Component\HttpKernel\EventListener\ExceptionListener</parameter> <parameter key="twig.exception_listener.controller">Symfony\Bundle\TwigBundle\Controller\ExceptionController::showAction</parameter> <parameter key="twig.form.resources" type="collection"> <parameter>form_div_layout.html.twig</parameter> </parameter> <parameter key="twig.options" type="collection"> <parameter key="debug">true</parameter> <parameter key="strict_variables">true</parameter> <parameter key="exception_controller">Symfony\Bundle\TwigBundle\Controller\ExceptionController::showAction</parameter> <parameter key="cache">C:\wamp\www\Symfony\app/cache/dev/twig</parameter> <parameter key="charset">UTF-8</parameter> </parameter> <parameter key="monolog.logger.class">Symfony\Bridge\Monolog\Logger</parameter> <parameter key="monolog.handler.stream.class">Monolog\Handler\StreamHandler</parameter> <parameter key="monolog.handler.fingers_crossed.class">Monolog\Handler\FingersCrossedHandler</parameter> <parameter key="monolog.handler.group.class">Monolog\Handler\GroupHandler</parameter> <parameter key="monolog.handler.buffer.class">Monolog\Handler\BufferHandler</parameter> <parameter key="monolog.handler.rotating_file.class">Monolog\Handler\RotatingFileHandler</parameter> <parameter key="monolog.handler.syslog.class">Monolog\Handler\SyslogHandler</parameter> <parameter key="monolog.handler.null.class">Monolog\Handler\NullHandler</parameter> <parameter key="monolog.handler.test.class">Monolog\Handler\TestHandler</parameter> <parameter key="monolog.handler.firephp.class">Symfony\Bridge\Monolog\Handler\FirePHPHandler</parameter> <parameter key="monolog.handler.debug.class">Symfony\Bridge\Monolog\Handler\DebugHandler</parameter> <parameter key="monolog.handler.swift_mailer.class">Monolog\Handler\SwiftMailerHandler</parameter> <parameter key="monolog.handler.native_mailer.class">Monolog\Handler\NativeMailerHandler</parameter> <parameter key="swiftmailer.class">Swift_Mailer</parameter> <parameter key="swiftmailer.transport.sendmail.class">Swift_Transport_SendmailTransport</parameter> <parameter key="swiftmailer.transport.mail.class">Swift_Transport_MailTransport</parameter> <parameter key="swiftmailer.transport.failover.class">Swift_Transport_FailoverTransport</parameter> <parameter key="swiftmailer.plugin.redirecting.class">Swift_Plugins_RedirectingPlugin</parameter> <parameter key="swiftmailer.plugin.impersonate.class">Swift_Plugins_ImpersonatePlugin</parameter> <parameter key="swiftmailer.plugin.messagelogger.class">Symfony\Bundle\SwiftmailerBundle\Logger\MessageLogger</parameter> <parameter key="swiftmailer.plugin.antiflood.class">Swift_Plugins_AntiFloodPlugin</parameter> <parameter key="swiftmailer.plugin.antiflood.threshold">99</parameter> <parameter key="swiftmailer.plugin.antiflood.sleep">0</parameter> <parameter key="swiftmailer.data_collector.class">Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector</parameter> <parameter key="swiftmailer.transport.smtp.class">Swift_Transport_EsmtpTransport</parameter> <parameter key="swiftmailer.transport.smtp.encryption">null</parameter> <parameter key="swiftmailer.transport.smtp.port">25</parameter> <parameter key="swiftmailer.transport.smtp.host">localhost</parameter> <parameter key="swiftmailer.transport.smtp.username"></parameter> <parameter key="swiftmailer.transport.smtp.password"></parameter> <parameter key="swiftmailer.transport.smtp.auth_mode">null</parameter> <parameter key="swiftmailer.spool.enabled">false</parameter> <parameter key="swiftmailer.sender_address">null</parameter> <parameter key="swiftmailer.single_address">null</parameter> <parameter key="doctrine.dbal.logger.debug.class">Doctrine\DBAL\Logging\DebugStack</parameter> <parameter key="doctrine.dbal.logger.class">Symfony\Bridge\Doctrine\Logger\DbalLogger</parameter> <parameter key="doctrine.dbal.configuration.class">Doctrine\DBAL\Configuration</parameter> <parameter key="doctrine.data_collector.class">Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector</parameter> <parameter key="doctrine.dbal.connection.event_manager.class">Doctrine\Common\EventManager</parameter> <parameter key="doctrine.dbal.connection_factory.class">Symfony\Bundle\DoctrineBundle\ConnectionFactory</parameter> <parameter key="doctrine.dbal.events.mysql_session_init.class">Doctrine\DBAL\Event\Listeners\MysqlSessionInit</parameter> <parameter key="doctrine.dbal.events.oracle_session_init.class">Doctrine\DBAL\Event\Listeners\OracleSessionInit</parameter> <parameter key="doctrine.class">Symfony\Bundle\DoctrineBundle\Registry</parameter> <parameter key="doctrine.entity_managers" type="collection"> <parameter key="default">doctrine.orm.default_entity_manager</parameter> </parameter> <parameter key="doctrine.default_entity_manager">default</parameter> <parameter key="doctrine.dbal.connection_factory.types" type="collection"/> <parameter key="doctrine.connections" type="collection"> <parameter key="default">doctrine.dbal.default_connection</parameter> </parameter> <parameter key="doctrine.default_connection">default</parameter> <parameter key="doctrine.orm.configuration.class">Doctrine\ORM\Configuration</parameter> <parameter key="doctrine.orm.entity_manager.class">Doctrine\ORM\EntityManager</parameter> <parameter key="doctrine.orm.cache.array.class">Doctrine\Common\Cache\ArrayCache</parameter> <parameter key="doctrine.orm.cache.apc.class">Doctrine\Common\Cache\ApcCache</parameter> <parameter key="doctrine.orm.cache.memcache.class">Doctrine\Common\Cache\MemcacheCache</parameter> <parameter key="doctrine.orm.cache.memcache_host">localhost</parameter> <parameter key="doctrine.orm.cache.memcache_port">11211</parameter> <parameter key="doctrine.orm.cache.memcache_instance.class">Memcache</parameter> <parameter key="doctrine.orm.cache.xcache.class">Doctrine\Common\Cache\XcacheCache</parameter> <parameter key="doctrine.orm.metadata.driver_chain.class">Doctrine\ORM\Mapping\Driver\DriverChain</parameter> <parameter key="doctrine.orm.metadata.annotation.class">Doctrine\ORM\Mapping\Driver\AnnotationDriver</parameter> <parameter key="doctrine.orm.metadata.annotation_reader.class">Symfony\Bridge\Doctrine\Annotations\IndexedReader</parameter> <parameter key="doctrine.orm.metadata.xml.class">Symfony\Bridge\Doctrine\Mapping\Driver\XmlDriver</parameter> <parameter key="doctrine.orm.metadata.yml.class">Symfony\Bridge\Doctrine\Mapping\Driver\YamlDriver</parameter> <parameter key="doctrine.orm.metadata.php.class">Doctrine\ORM\Mapping\Driver\PHPDriver</parameter> <parameter key="doctrine.orm.metadata.staticphp.class">Doctrine\ORM\Mapping\Driver\StaticPHPDriver</parameter> <parameter key="doctrine.orm.proxy_cache_warmer.class">Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer</parameter> <parameter key="form.type_guesser.doctrine.class">Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser</parameter> <parameter key="doctrine.orm.validator.unique.class">Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator</parameter> <parameter key="doctrine.orm.validator_initializer.class">Symfony\Bridge\Doctrine\Validator\EntityInitializer</parameter> <parameter key="doctrine.orm.auto_generate_proxy_classes">true</parameter> <parameter key="doctrine.orm.proxy_dir">C:\wamp\www\Symfony\app/cache/dev/doctrine/orm/Proxies</parameter> <parameter key="doctrine.orm.proxy_namespace">Proxies</parameter> <parameter key="assetic.asset_factory.class">Symfony\Bundle\AsseticBundle\Factory\AssetFactory</parameter> <parameter key="assetic.asset_manager.class">Assetic\Factory\LazyAssetManager</parameter> <parameter key="assetic.asset_manager_cache_warmer.class">Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer</parameter> <parameter key="assetic.cached_formula_loader.class">Assetic\Factory\Loader\CachedFormulaLoader</parameter> <parameter key="assetic.config_cache.class">Assetic\Cache\ConfigCache</parameter> <parameter key="assetic.config_loader.class">Symfony\Bundle\AsseticBundle\Factory\Loader\ConfigurationLoader</parameter> <parameter key="assetic.config_resource.class">Symfony\Bundle\AsseticBundle\Factory\Resource\ConfigurationResource</parameter> <parameter key="assetic.coalescing_directory_resource.class">Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource</parameter> <parameter key="assetic.directory_resource.class">Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource</parameter> <parameter key="assetic.filter_manager.class">Symfony\Bundle\AsseticBundle\FilterManager</parameter> <parameter key="assetic.worker.ensure_filter.class">Assetic\Factory\Worker\EnsureFilterWorker</parameter> <parameter key="assetic.node.paths" type="collection"/> <parameter key="assetic.cache_dir">C:\wamp\www\Symfony\app/cache/dev/assetic</parameter> <parameter key="assetic.twig_extension.class">Symfony\Bundle\AsseticBundle\Twig\AsseticExtension</parameter> <parameter key="assetic.twig_formula_loader.class">Assetic\Extension\Twig\TwigFormulaLoader</parameter> <parameter key="assetic.helper.dynamic.class">Symfony\Bundle\AsseticBundle\Templating\DynamicAsseticHelper</parameter> <parameter key="assetic.helper.static.class">Symfony\Bundle\AsseticBundle\Templating\StaticAsseticHelper</parameter> <parameter key="assetic.php_formula_loader.class">Symfony\Bundle\AsseticBundle\Factory\Loader\AsseticHelperFormulaLoader</parameter> <parameter key="assetic.debug">true</parameter> <parameter key="assetic.use_controller">true</parameter> <parameter key="assetic.enable_profiler">false</parameter> <parameter key="assetic.read_from">C:\wamp\www\Symfony\app/../web</parameter> <parameter key="assetic.write_to">C:\wamp\www\Symfony\app/../web</parameter> <parameter key="assetic.java.bin">C:\Windows\system32\java.EXE</parameter> <parameter key="assetic.node.bin">/usr/bin/node</parameter> <parameter key="assetic.sass.bin">/usr/bin/sass</parameter> <parameter key="assetic.filter.cssrewrite.class">Assetic\Filter\CssRewriteFilter</parameter> <parameter key="assetic.twig_extension.functions" type="collection"/> <parameter key="assetic.controller.class">Symfony\Bundle\AsseticBundle\Controller\AsseticController</parameter> <parameter key="assetic.routing_loader.class">Symfony\Bundle\AsseticBundle\Routing\AsseticLoader</parameter> <parameter key="assetic.cache.class">Assetic\Cache\FilesystemCache</parameter> <parameter key="assetic.use_controller_worker.class">Symfony\Bundle\AsseticBundle\Factory\Worker\UseControllerWorker</parameter> <parameter key="assetic.request_listener.class">Symfony\Bundle\AsseticBundle\EventListener\RequestListener</parameter> <parameter key="sensio_framework_extra.controller.listener.class">Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener</parameter> <parameter key="sensio_framework_extra.routing.loader.annot_dir.class">Symfony\Component\Routing\Loader\AnnotationDirectoryLoader</parameter> <parameter key="sensio_framework_extra.routing.loader.annot_file.class">Symfony\Component\Routing\Loader\AnnotationFileLoader</parameter> <parameter key="sensio_framework_extra.routing.loader.annot_class.class">Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader</parameter> <parameter key="sensio_framework_extra.converter.listener.class">Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener</parameter> <parameter key="sensio_framework_extra.converter.manager.class">Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager</parameter> <parameter key="sensio_framework_extra.converter.doctrine.class">Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter</parameter> <parameter key="sensio_framework_extra.view.listener.class">Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener</parameter> <parameter key="security.secured_services" type="collection"/> <parameter key="security.access.method_interceptor.class">JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor</parameter> <parameter key="security.access.run_as_manager.class">JMS\SecurityExtraBundle\Security\Authorization\RunAsManager</parameter> <parameter key="security.authentication.provider.run_as.class">JMS\SecurityExtraBundle\Security\Authentication\Provider\RunAsAuthenticationProvider</parameter> <parameter key="security.run_as.key">RunAsToken</parameter> <parameter key="security.run_as.role_prefix">ROLE_</parameter> <parameter key="security.access.after_invocation_manager.class">JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager</parameter> <parameter key="security.access.after_invocation.acl_provider.class">JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AclAfterInvocationProvider</parameter> <parameter key="security.extra.controller_listener.class">JMS\SecurityExtraBundle\Controller\ControllerListener</parameter> <parameter key="security.access.iddqd_voter.class">JMS\SecurityExtraBundle\Security\Authorization\Voter\IddqdVoter</parameter> <parameter key="security.extra.secure_all_services">false</parameter> <parameter key="web_profiler.debug_toolbar.class">Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener</parameter> <parameter key="web_profiler.debug_toolbar.intercept_redirects">false</parameter> <parameter key="web_profiler.debug_toolbar.mode">2</parameter> <parameter key="sensio.distribution.webconfigurator.class">Sensio\Bundle\DistributionBundle\Configurator\Configurator</parameter> <parameter key="data_collector.templates" type="collection"> <parameter key="data_collector.config" type="collection"> <parameter>config</parameter> <parameter>WebProfilerBundle:Collector:config</parameter> </parameter> <parameter key="data_collector.request" type="collection"> <parameter>request</parameter> <parameter>WebProfilerBundle:Collector:request</parameter> </parameter> <parameter key="data_collector.exception" type="collection"> <parameter>exception</parameter> <parameter>WebProfilerBundle:Collector:exception</parameter> </parameter> <parameter key="data_collector.events" type="collection"> <parameter>events</parameter> <parameter>WebProfilerBundle:Collector:events</parameter> </parameter> <parameter key="data_collector.logger" type="collection"> <parameter>logger</parameter> <parameter>WebProfilerBundle:Collector:logger</parameter> </parameter> <parameter key="data_collector.timer" type="collection"> <parameter>timer</parameter> <parameter>WebProfilerBundle:Collector:timer</parameter> </parameter> <parameter key="data_collector.memory" type="collection"> <parameter>memory</parameter> <parameter>WebProfilerBundle:Collector:memory</parameter> </parameter> <parameter key="data_collector.security" type="collection"> <parameter>security</parameter> <parameter>SecurityBundle:Collector:security</parameter> </parameter> <parameter key="swiftmailer.data_collector" type="collection"> <parameter>swiftmailer</parameter> <parameter>SwiftmailerBundle:Collector:swiftmailer</parameter> </parameter> <parameter key="data_collector.doctrine" type="collection"> <parameter>db</parameter> <parameter>DoctrineBundle:Collector:db</parameter> </parameter> </parameter> </parameters> <services> <service id="controller_name_converter" class="Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser" public="false"> <tag name="monolog.logger" channel="request"/> <argument type="service" id="kernel"/> </service> <service id="router_listener" class="Symfony\Bundle\FrameworkBundle\EventListener\RouterListener"> <tag name="kernel.event_listener" event="kernel.request" method="onEarlyKernelRequest" priority="255"/> <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest"/> <tag name="monolog.logger" channel="request"/> <argument type="service" id="router"/> <argument>80</argument> <argument>443</argument> <argument type="service" id="monolog.logger.request"/> </service> <service id="response_listener" class="Symfony\Component\HttpKernel\EventListener\ResponseListener"> <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/> <argument>UTF-8</argument> </service> <service id="event_dispatcher" class="Symfony\Bundle\FrameworkBundle\Debug\TraceableEventDispatcher"> <tag name="monolog.logger" channel="event"/> <argument type="service" id="service_container"/> <argument type="service" id="monolog.logger.event"/> <call method="addListenerService"> <argument>kernel.request</argument> <argument type="collection"> <argument>router_listener</argument> <argument>onEarlyKernelRequest</argument> </argument> <argument>255</argument> </call> <call method="addListenerService"> <argument>kernel.request</argument> <argument type="collection"> <argument>router_listener</argument> <argument>onKernelRequest</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.response</argument> <argument type="collection"> <argument>response_listener</argument> <argument>onKernelResponse</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.request</argument> <argument type="collection"> <argument>session_listener</argument> <argument>onKernelRequest</argument> </argument> <argument>128</argument> </call> <call method="addListenerService"> <argument>kernel.response</argument> <argument type="collection"> <argument>profiler_listener</argument> <argument>onKernelResponse</argument> </argument> <argument>-100</argument> </call> <call method="addListenerService"> <argument>kernel.exception</argument> <argument type="collection"> <argument>profiler_listener</argument> <argument>onKernelException</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.request</argument> <argument type="collection"> <argument>profiler_listener</argument> <argument>onKernelRequest</argument> </argument> <argument>1024</argument> </call> <call method="addListenerService"> <argument>kernel.controller</argument> <argument type="collection"> <argument>data_collector.request</argument> <argument>onKernelController</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.request</argument> <argument type="collection"> <argument>security.firewall</argument> <argument>onKernelRequest</argument> </argument> <argument>64</argument> </call> <call method="addListenerService"> <argument>kernel.response</argument> <argument type="collection"> <argument>security.rememberme.response_listener</argument> <argument>onKernelResponse</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.exception</argument> <argument type="collection"> <argument>twig.exception_listener</argument> <argument>onKernelException</argument> </argument> <argument>-128</argument> </call> <call method="addListenerService"> <argument>kernel.response</argument> <argument type="collection"> <argument>monolog.handler.firephp</argument> <argument>onKernelResponse</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.request</argument> <argument type="collection"> <argument>assetic.request_listener</argument> <argument>onKernelRequest</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.controller</argument> <argument type="collection"> <argument>sensio_framework_extra.controller.listener</argument> <argument>onKernelController</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.controller</argument> <argument type="collection"> <argument>sensio_framework_extra.converter.listener</argument> <argument>onKernelController</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.controller</argument> <argument type="collection"> <argument>sensio_framework_extra.view.listener</argument> <argument>onKernelController</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.view</argument> <argument type="collection"> <argument>sensio_framework_extra.view.listener</argument> <argument>onKernelView</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.response</argument> <argument type="collection"> <argument>sensio_framework_extra.cache.listener</argument> <argument>onKernelResponse</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.controller</argument> <argument type="collection"> <argument>security.extra.controller_listener</argument> <argument>onCoreController</argument> </argument> <argument>-255</argument> </call> <call method="addListenerService"> <argument>kernel.controller</argument> <argument type="collection"> <argument>acme.demo.listener</argument> <argument>onKernelController</argument> </argument> <argument>0</argument> </call> <call method="addListenerService"> <argument>kernel.response</argument> <argument type="collection"> <argument>web_profiler.debug_toolbar</argument> <argument>onKernelResponse</argument> </argument> <argument>-128</argument> </call> </service> <service id="http_kernel" class="Symfony\Bundle\FrameworkBundle\HttpKernel"> <argument type="service" id="event_dispatcher"/> <argument type="service" id="service_container"/> <argument type="service"> <service class="Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver" public="false"> <tag name="monolog.logger" channel="request"/> <argument type="service" id="service_container"/> <argument type="service" id="controller_name_converter"/> <argument type="service" id="monolog.logger.request"/> </service> </argument> </service> <service id="cache_warmer" class="Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate"> <argument type="collection"> <argument type="service"> <service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer" public="false"> <tag name="kernel.cache_warmer" priority="20"/> <argument type="service"> <service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder" public="false"> <argument type="service" id="kernel"/> <argument type="service" id="templating.name_parser"/> <argument>C:\wamp\www\Symfony\app/Resources</argument> </service> </argument> <argument type="service" id="templating.locator"/> </service> </argument> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer" public="false"> <tag name="kernel.cache_warmer" priority="10"/> <argument type="service" id="service_container"/> </service> </argument> <argument type="service"> <service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer" public="false"> <tag name="kernel.cache_warmer"/> <argument type="service" id="router"/> </service> </argument> <argument type="service"> <service class="Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer" public="false"> <tag name="kernel.cache_warmer"/> <argument type="service" id="service_container"/> <argument type="service"> <service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder" public="false"> <argument type="service" id="kernel"/> <argument type="service" id="templating.name_parser"/> <argument>C:\wamp\www\Symfony\app/Resources</argument> </service> </argument> </service> </argument> <argument type="service"> <service class="Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer" public="false"> <tag name="kernel.cache_warmer"/> <argument type="service" id="doctrine"/> </service> </argument> </argument> </service> <service id="request" scope="request"/> <service id="service_container"/> <service id="kernel"/> <service id="filesystem" class="Symfony\Component\Filesystem\Filesystem"/> <service id="file_locator" class="Symfony\Component\HttpKernel\Config\FileLocator"> <argument type="service" id="kernel"/> <argument>C:\wamp\www\Symfony\app/Resources</argument> </service> <service id="translator.default" class="Symfony\Bundle\FrameworkBundle\Translation\Translator"> <argument type="service" id="service_container"/> <argument type="service" id="translator.selector"/> <argument type="collection"> <argument key="translation.loader.php">php</argument> <argument key="translation.loader.yml">yml</argument> <argument key="translation.loader.xliff">xliff</argument> </argument> <argument type="collection"> <argument key="cache_dir">C:\wamp\www\Symfony\app/cache/dev/translations</argument> <argument key="debug">true</argument> </argument> <argument type="service" id="session"/> </service> <service id="translator" class="Symfony\Component\Translation\IdentityTranslator"> <argument type="service" id="translator.selector"/> </service> <service id="translator.selector" class="Symfony\Component\Translation\MessageSelector" public="false"/> <service id="translation.loader.php" class="Symfony\Component\Translation\Loader\PhpFileLoader"> <tag name="translation.loader" alias="php"/> </service> <service id="translation.loader.yml" class="Symfony\Component\Translation\Loader\YamlFileLoader"> <tag name="translation.loader" alias="yml"/> </service> <service id="translation.loader.xliff" class="Symfony\Component\Translation\Loader\XliffFileLoader"> <tag name="translation.loader" alias="xliff"/> </service> <service id="session" class="Symfony\Component\HttpFoundation\Session"> <argument type="service" id="session.storage"/> <argument>en</argument> </service> <service id="session_listener" class="Symfony\Bundle\FrameworkBundle\EventListener\SessionListener"> <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="128"/> <argument type="service" id="service_container"/> <argument>true</argument> </service> <service id="form.factory" class="Symfony\Component\Form\FormFactory"> <argument type="collection"> <argument type="service"> <service class="Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension" public="false"> <argument type="service" id="service_container"/> <argument type="collection"> <argument key="field">form.type.field</argument> <argument key="form">form.type.form</argument> <argument key="birthday">form.type.birthday</argument> <argument key="checkbox">form.type.checkbox</argument> <argument key="choice">form.type.choice</argument> <argument key="collection">form.type.collection</argument> <argument key="country">form.type.country</argument> <argument key="date">form.type.date</argument> <argument key="datetime">form.type.datetime</argument> <argument key="email">form.type.email</argument> <argument key="file">form.type.file</argument> <argument key="hidden">form.type.hidden</argument> <argument key="integer">form.type.integer</argument> <argument key="language">form.type.language</argument> <argument key="locale">form.type.locale</argument> <argument key="money">form.type.money</argument> <argument key="number">form.type.number</argument> <argument key="password">form.type.password</argument> <argument key="percent">form.type.percent</argument> <argument key="radio">form.type.radio</argument> <argument key="repeated">form.type.repeated</argument> <argument key="search">form.type.search</argument> <argument key="textarea">form.type.textarea</argument> <argument key="text">form.type.text</argument> <argument key="time">form.type.time</argument> <argument key="timezone">form.type.timezone</argument> <argument key="url">form.type.url</argument> <argument key="csrf">form.type.csrf</argument> <argument key="entity">form.type.entity</argument> </argument> <argument type="collection"> <argument key="field" type="collection"> <argument>form.type_extension.field</argument> </argument> <argument key="form" type="collection"> <argument>form.type_extension.csrf</argument> </argument> </argument> <argument type="collection"> <argument>form.type_guesser.validator</argument> <argument>form.type_guesser.doctrine</argument> </argument> </service> </argument> </argument> </service> <service id="form.type_guesser.validator" class="Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser"> <tag name="form.type_guesser"/> <argument type="service" id="validator.mapping.class_metadata_factory"/> </service> <service id="form.type.field" class="Symfony\Component\Form\Extension\Core\Type\FieldType"> <tag name="form.type" alias="field"/> <argument type="service" id="validator"/> </service> <service id="form.type.form" class="Symfony\Component\Form\Extension\Core\Type\FormType"> <tag name="form.type" alias="form"/> </service> <service id="form.type.birthday" class="Symfony\Component\Form\Extension\Core\Type\BirthdayType"> <tag name="form.type" alias="birthday"/> </service> <service id="form.type.checkbox" class="Symfony\Component\Form\Extension\Core\Type\CheckboxType"> <tag name="form.type" alias="checkbox"/> </service> <service id="form.type.choice" class="Symfony\Component\Form\Extension\Core\Type\ChoiceType"> <tag name="form.type" alias="choice"/> </service> <service id="form.type.collection" class="Symfony\Component\Form\Extension\Core\Type\CollectionType"> <tag name="form.type" alias="collection"/> </service> <service id="form.type.country" class="Symfony\Component\Form\Extension\Core\Type\CountryType"> <tag name="form.type" alias="country"/> </service> <service id="form.type.date" class="Symfony\Component\Form\Extension\Core\Type\DateType"> <tag name="form.type" alias="date"/> </service> <service id="form.type.datetime" class="Symfony\Component\Form\Extension\Core\Type\DateTimeType"> <tag name="form.type" alias="datetime"/> </service> <service id="form.type.email" class="Symfony\Component\Form\Extension\Core\Type\EmailType"> <tag name="form.type" alias="email"/> </service> <service id="form.type.file" class="Symfony\Component\Form\Extension\Core\Type\FileType"> <tag name="form.type" alias="file"/> </service> <service id="form.type.hidden" class="Symfony\Component\Form\Extension\Core\Type\HiddenType"> <tag name="form.type" alias="hidden"/> </service> <service id="form.type.integer" class="Symfony\Component\Form\Extension\Core\Type\IntegerType"> <tag name="form.type" alias="integer"/> </service> <service id="form.type.language" class="Symfony\Component\Form\Extension\Core\Type\LanguageType"> <tag name="form.type" alias="language"/> </service> <service id="form.type.locale" class="Symfony\Component\Form\Extension\Core\Type\LocaleType"> <tag name="form.type" alias="locale"/> </service> <service id="form.type.money" class="Symfony\Component\Form\Extension\Core\Type\MoneyType"> <tag name="form.type" alias="money"/> </service> <service id="form.type.number" class="Symfony\Component\Form\Extension\Core\Type\NumberType"> <tag name="form.type" alias="number"/> </service> <service id="form.type.password" class="Symfony\Component\Form\Extension\Core\Type\PasswordType"> <tag name="form.type" alias="password"/> </service> <service id="form.type.percent" class="Symfony\Component\Form\Extension\Core\Type\PercentType"> <tag name="form.type" alias="percent"/> </service> <service id="form.type.radio" class="Symfony\Component\Form\Extension\Core\Type\RadioType"> <tag name="form.type" alias="radio"/> </service> <service id="form.type.repeated" class="Symfony\Component\Form\Extension\Core\Type\RepeatedType"> <tag name="form.type" alias="repeated"/> </service> <service id="form.type.search" class="Symfony\Component\Form\Extension\Core\Type\SearchType"> <tag name="form.type" alias="search"/> </service> <service id="form.type.textarea" class="Symfony\Component\Form\Extension\Core\Type\TextareaType"> <tag name="form.type" alias="textarea"/> </service> <service id="form.type.text" class="Symfony\Component\Form\Extension\Core\Type\TextType"> <tag name="form.type" alias="text"/> </service> <service id="form.type.time" class="Symfony\Component\Form\Extension\Core\Type\TimeType"> <tag name="form.type" alias="time"/> </service> <service id="form.type.timezone" class="Symfony\Component\Form\Extension\Core\Type\TimezoneType"> <tag name="form.type" alias="timezone"/> </service> <service id="form.type.url" class="Symfony\Component\Form\Extension\Core\Type\UrlType"> <tag name="form.type" alias="url"/> </service> <service id="form.type_extension.field" class="Symfony\Component\Form\Extension\Validator\Type\FieldTypeValidatorExtension"> <tag name="form.type_extension" alias="field"/> <argument type="service" id="validator"/> </service> <service id="form.csrf_provider" class="Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider"> <argument type="service" id="session"/> <argument>ThisTokenIsNotSoSecretChangeIt</argument> </service> <service id="form.type.csrf" class="Symfony\Component\Form\Extension\Csrf\Type\CsrfType"> <tag name="form.type" alias="csrf"/> <argument type="service" id="form.csrf_provider"/> </service> <service id="form.type_extension.csrf" class="Symfony\Component\Form\Extension\Csrf\Type\FormTypeCsrfExtension"> <tag name="form.type_extension" alias="form"/> <argument>true</argument> <argument>_token</argument> </service> <service id="validator" class="Symfony\Component\Validator\Validator"> <argument type="service" id="validator.mapping.class_metadata_factory"/> <argument type="service"> <service class="Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory" public="false"> <argument type="service" id="service_container"/> <argument type="collection"> <argument key="doctrine.orm.validator.unique">doctrine.orm.validator.unique</argument> </argument> </service> </argument> <argument type="collection"> <argument type="service" id="doctrine.orm.validator_initializer"/> </argument> </service> <service id="validator.mapping.class_metadata_factory" class="Symfony\Component\Validator\Mapping\ClassMetadataFactory" public="false"> <argument type="service"> <service class="Symfony\Component\Validator\Mapping\Loader\LoaderChain" public="false"> <argument type="collection"> <argument type="service"> <service class="Symfony\Component\Validator\Mapping\Loader\AnnotationLoader" public="false"> <argument type="service" id="annotation_reader"/> </service> </argument> <argument type="service"> <service class="Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader" public="false"/> </argument> <argument type="service"> <service class="Symfony\Component\Validator\Mapping\Loader\XmlFilesLoader" public="false"> <argument type="collection"> <argument>C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Component\Form/Resources/config/validation.xml</argument> </argument> </service> </argument> <argument type="service"> <service class="Symfony\Component\Validator\Mapping\Loader\YamlFilesLoader" public="false"> <argument type="collection"/> </service> </argument> </argument> </service> </argument> <argument>null</argument> </service> <service id="profiler" class="Symfony\Component\HttpKernel\Profiler\Profiler"> <tag name="monolog.logger" channel="profiler"/> <argument type="service"> <service class="Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage" public="false"> <argument>sqlite:C:\wamp\www\Symfony\app/cache/dev/profiler.db</argument> <argument></argument> <argument></argument> <argument>86400</argument> </service> </argument> <argument type="service" id="monolog.logger.profiler"/> <call method="add"> <argument type="service"> <service class="Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector" public="false"> <tag name="data_collector" template="WebProfilerBundle:Collector:config" id="config" priority="255"/> <argument type="service" id="kernel"/> </service> </argument> </call> <call method="add"> <argument type="service" id="data_collector.request"/> </call> <call method="add"> <argument type="service"> <service class="Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector" public="false"> <tag name="data_collector" template="WebProfilerBundle:Collector:exception" id="exception" priority="255"/> </service> </argument> </call> <call method="add"> <argument type="service"> <service class="Symfony\Component\HttpKernel\DataCollector\EventDataCollector" public="false"> <tag name="data_collector" template="WebProfilerBundle:Collector:events" id="events" priority="255"/> <call method="setEventDispatcher"> <argument type="service" id="event_dispatcher"/> </call> </service> </argument> </call> <call method="add"> <argument type="service"> <service class="Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector" public="false"> <tag name="data_collector" template="WebProfilerBundle:Collector:logger" id="logger" priority="255"/> <tag name="monolog.logger" channel="profiler"/> <argument type="service" id="monolog.logger.profiler"/> </service> </argument> </call> <call method="add"> <argument type="service"> <service class="Symfony\Bundle\FrameworkBundle\DataCollector\TimerDataCollector" public="false"> <tag name="data_collector" template="WebProfilerBundle:Collector:timer" id="timer" priority="255"/> <argument type="service" id="kernel"/> </service> </argument> </call> <call method="add"> <argument type="service"> <service class="Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector" public="false"> <tag name="data_collector" template="WebProfilerBundle:Collector:memory" id="memory" priority="255"/> </service> </argument> </call> <call method="add"> <argument type="service"> <service class="Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector" public="false"> <tag name="data_collector" template="SecurityBundle:Collector:security" id="security"/> <argument type="service" id="security.context"/> </service> </argument> </call> <call method="add"> <argument type="service"> <service class="Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector" public="false"> <tag name="data_collector" template="SwiftmailerBundle:Collector:swiftmailer" id="swiftmailer"/> <argument type="service" id="service_container"/> <argument>false</argument> </service> </argument> </call> <call method="add"> <argument type="service"> <service class="Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector" public="false"> <tag name="data_collector" template="DoctrineBundle:Collector:db" id="db"/> <argument type="service" id="doctrine"/> <argument type="service" id="doctrine.dbal.logger"/> </service> </argument> </call> </service> <service id="profiler_listener" class="Symfony\Component\HttpKernel\EventListener\ProfilerListener"> <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" priority="-100"/> <tag name="kernel.event_listener" event="kernel.exception" method="onKernelException"/> <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="1024"/> <argument type="service" id="profiler"/> <argument>null</argument> <argument>false</argument> <argument>false</argument> </service> <service id="data_collector.request" class="Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector"> <tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/> <tag name="data_collector" template="WebProfilerBundle:Collector:request" id="request" priority="255"/> </service> <service id="routing.loader" class="Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader"> <tag name="monolog.logger" channel="router"/> <argument type="service" id="controller_name_converter"/> <argument type="service" id="monolog.logger.router"/> <argument type="service"> <service class="Symfony\Component\Config\Loader\LoaderResolver" public="false"> <call method="addLoader"> <argument type="service"> <service class="Symfony\Component\Routing\Loader\XmlFileLoader" public="false"> <tag name="routing.loader"/> <argument type="service" id="file_locator"/> </service> </argument> </call> <call method="addLoader"> <argument type="service"> <service class="Symfony\Component\Routing\Loader\YamlFileLoader" public="false"> <tag name="routing.loader"/> <argument type="service" id="file_locator"/> </service> </argument> </call> <call method="addLoader"> <argument type="service"> <service class="Symfony\Component\Routing\Loader\PhpFileLoader" public="false"> <tag name="routing.loader"/> <argument type="service" id="file_locator"/> </service> </argument> </call> <call method="addLoader"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Routing\AsseticLoader" public="false"> <tag name="routing.loader"/> <argument type="service" id="assetic.asset_manager"/> </service> </argument> </call> <call method="addLoader"> <argument type="service"> <service class="Symfony\Component\Routing\Loader\AnnotationDirectoryLoader" public="false"> <tag name="routing.loader"/> <argument type="service" id="file_locator"/> <argument type="service"> <service class="Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader" public="false"> <tag name="routing.loader"/> <argument type="service" id="annotation_reader"/> </service> </argument> </service> </argument> </call> <call method="addLoader"> <argument type="service"> <service class="Symfony\Component\Routing\Loader\AnnotationFileLoader" public="false"> <tag name="routing.loader"/> <argument type="service" id="file_locator"/> <argument type="service"> <service class="Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader" public="false"> <tag name="routing.loader"/> <argument type="service" id="annotation_reader"/> </service> </argument> </service> </argument> </call> <call method="addLoader"> <argument type="service"> <service class="Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader" public="false"> <tag name="routing.loader"/> <argument type="service" id="annotation_reader"/> </service> </argument> </call> </service> </argument> </service> <service id="templating.name_parser" class="Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser"> <argument type="service" id="kernel"/> </service> <service id="templating.locator" class="Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator" public="false"> <argument type="service" id="file_locator"/> <argument>C:\wamp\www\Symfony\app/cache/dev</argument> </service> <service id="templating.helper.slots" class="Symfony\Component\Templating\Helper\SlotsHelper"> <tag name="templating.helper" alias="slots"/> </service> <service id="templating.helper.assets" class="Symfony\Component\Templating\Helper\CoreAssetsHelper" scope="request"> <tag name="templating.helper" alias="assets"/> <argument type="service"> <service class="Symfony\Bundle\FrameworkBundle\Templating\Asset\PathPackage" scope="request" public="false"> <argument type="service" id="request"/> <argument>null</argument> <argument>null</argument> </service> </argument> <argument type="collection"/> </service> <service id="templating.asset.package_factory" class="Symfony\Bundle\FrameworkBundle\Templating\Asset\PackageFactory"> <argument type="service" id="service_container"/> </service> <service id="templating.helper.request" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\RequestHelper"> <tag name="templating.helper" alias="request"/> <argument type="service" id="request"/> </service> <service id="templating.helper.session" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper"> <tag name="templating.helper" alias="session"/> <argument type="service" id="request"/> </service> <service id="templating.helper.router" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper"> <tag name="templating.helper" alias="router"/> <argument type="service" id="router"/> </service> <service id="templating.helper.actions" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\ActionsHelper"> <tag name="templating.helper" alias="actions"/> <argument type="service" id="http_kernel"/> </service> <service id="templating.helper.code" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper"> <tag name="templating.helper" alias="code"/> <argument>null</argument> <argument>C:\wamp\www\Symfony\app</argument> <argument>UTF-8</argument> </service> <service id="templating.helper.translator" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper"> <tag name="templating.helper" alias="translator"/> <argument type="service" id="translator"/> </service> <service id="templating.helper.form" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper"> <tag name="templating.helper" alias="form"/> <argument type="service"> <service class="Symfony\Bundle\FrameworkBundle\Templating\PhpEngine" public="false"> <argument type="service" id="templating.name_parser"/> <argument type="service" id="service_container"/> <argument type="service" id="templating.loader"/> <argument type="service" id="templating.globals"/> <call method="setCharset"> <argument>UTF-8</argument> </call> <call method="setHelpers"> <argument type="collection"> <argument key="slots">templating.helper.slots</argument> <argument key="assets">templating.helper.assets</argument> <argument key="request">templating.helper.request</argument> <argument key="session">templating.helper.session</argument> <argument key="router">templating.helper.router</argument> <argument key="actions">templating.helper.actions</argument> <argument key="code">templating.helper.code</argument> <argument key="translator">templating.helper.translator</argument> <argument key="form">templating.helper.form</argument> <argument key="security">templating.helper.security</argument> <argument key="assetic">assetic.helper.dynamic</argument> </argument> </call> </service> </argument> <argument type="collection"> <argument>FrameworkBundle:Form</argument> </argument> </service> <service id="templating.globals" class="Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables"> <argument type="service" id="service_container"/> </service> <service id="security.context" class="Symfony\Component\Security\Core\SecurityContext"> <argument type="service" id="security.authentication.manager"/> <argument type="service" id="security.access.decision_manager"/> <argument>false</argument> </service> <service id="security.authentication.manager" class="Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager" public="false"> <argument type="collection"> <argument type="service"> <service class="Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider" public="false"> <argument type="service" id="security.user.provider.concrete.in_memory"/> <argument type="service"> <service class="Symfony\Component\Security\Core\User\UserChecker" public="false"/> </argument> <argument>secured_area</argument> <argument type="service" id="security.encoder_factory"/> <argument>true</argument> </service> </argument> </argument> </service> <service id="security.authentication.trust_resolver" class="Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver" public="false"> <argument>Symfony\Component\Security\Core\Authentication\Token\AnonymousToken</argument> <argument>Symfony\Component\Security\Core\Authentication\Token\RememberMeToken</argument> </service> <service id="security.access.decision_manager" class="Symfony\Component\Security\Core\Authorization\AccessDecisionManager" public="false"> <argument type="collection"> <argument type="service"> <service class="Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter" public="false"> <tag name="security.voter" priority="245"/> <argument type="service"> <service class="Symfony\Component\Security\Core\Role\RoleHierarchy" public="false"> <argument type="collection"> <argument key="ROLE_ADMIN" type="collection"> <argument>ROLE_USER</argument> </argument> <argument key="ROLE_SUPER_ADMIN" type="collection"> <argument>ROLE_USER</argument> <argument>ROLE_ADMIN</argument> <argument>ROLE_ALLOWED_TO_SWITCH</argument> </argument> </argument> </service> </argument> </service> </argument> <argument type="service"> <service class="Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter" public="false"> <tag name="security.voter" priority="250"/> <argument type="service" id="security.authentication.trust_resolver"/> </service> </argument> </argument> <argument>affirmative</argument> <argument>false</argument> <argument>true</argument> </service> <service id="security.firewall" class="Symfony\Component\Security\Http\Firewall"> <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="64"/> <argument type="service"> <service class="Symfony\Bundle\SecurityBundle\Security\FirewallMap" public="false"> <argument type="service" id="service_container"/> <argument type="collection"> <argument key="security.firewall.map.context.dev" type="service"> <service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false"> <argument>^/(_(profiler|wdt)|css|images|js)/</argument> </service> </argument> <argument key="security.firewall.map.context.login" type="service"> <service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false"> <argument>^/demo/secured/login$</argument> </service> </argument> <argument key="security.firewall.map.context.secured_area" type="service"> <service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false"> <argument>^/demo/secured/</argument> </service> </argument> </argument> </service> </argument> <argument type="service" id="event_dispatcher"/> </service> <service id="security.rememberme.response_listener" class="Symfony\Bundle\SecurityBundle\EventListener\ResponseListener"> <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/> </service> <service id="templating.helper.security" class="Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper"> <tag name="templating.helper" alias="security"/> <argument type="service" id="security.context"/> </service> <service id="security.user.provider.concrete.in_memory" class="Symfony\Component\Security\Core\User\InMemoryUserProvider" public="false"> <call method="createUser"> <argument type="service"> <service class="Symfony\Component\Security\Core\User\User" public="false"> <argument>user</argument> <argument>userpass</argument> <argument type="collection"> <argument>ROLE_USER</argument> </argument> </service> </argument> </call> <call method="createUser"> <argument type="service"> <service class="Symfony\Component\Security\Core\User\User" public="false"> <argument>admin</argument> <argument>adminpass</argument> <argument type="collection"> <argument>ROLE_ADMIN</argument> </argument> </service> </argument> </call> </service> <service id="security.firewall.map.context.dev" class="Symfony\Bundle\SecurityBundle\Security\FirewallContext"> <argument type="collection"/> <argument>null</argument> </service> <service id="security.firewall.map.context.login" class="Symfony\Bundle\SecurityBundle\Security\FirewallContext"> <argument type="collection"/> <argument>null</argument> </service> <service id="security.firewall.map.context.secured_area" class="Symfony\Bundle\SecurityBundle\Security\FirewallContext"> <argument type="collection"> <argument type="service"> <service class="Symfony\Component\Security\Http\Firewall\ChannelListener" public="false"> <tag name="monolog.logger" channel="security"/> <argument type="service"> <service class="Symfony\Component\Security\Http\AccessMap" public="false"/> </argument> <argument type="service"> <service class="Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint" public="false"/> </argument> <argument type="service" id="monolog.logger.security"/> </service> </argument> <argument type="service"> <service class="Symfony\Component\Security\Http\Firewall\ContextListener" public="false"> <argument type="service" id="security.context"/> <argument type="collection"> <argument type="service" id="security.user.provider.concrete.in_memory"/> </argument> <argument>secured_area</argument> <argument type="service" id="monolog.logger.security"/> <argument type="service" id="event_dispatcher"/> </service> </argument> <argument type="service"> <service class="Symfony\Component\Security\Http\Firewall\LogoutListener" public="false"> <argument type="service" id="security.context"/> <argument type="service"> <service class="Symfony\Component\Security\Http\HttpUtils" public="false"> <argument type="service" id="router"/> </service> </argument> <argument>/demo/secured/logout</argument> <argument>/demo/</argument> <argument>null</argument> <call method="addHandler"> <argument type="service"> <service class="Symfony\Component\Security\Http\Logout\SessionLogoutHandler" public="false"/> </argument> </call> </service> </argument> <argument type="service"> <service class="Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener" public="false"> <tag name="security.remember_me_aware" id="secured_area" provider="security.user.provider.concrete.in_memory"/> <argument type="service" id="security.context"/> <argument type="service" id="security.authentication.manager"/> <argument type="service"> <service class="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy" public="false"> <argument>migrate</argument> </service> </argument> <argument type="service"> <service class="Symfony\Component\Security\Http\HttpUtils" public="false"> <argument type="service" id="router"/> </service> </argument> <argument>secured_area</argument> <argument type="collection"> <argument key="check_path">/demo/secured/login_check</argument> <argument key="login_path">/demo/secured/login</argument> <argument key="use_forward">false</argument> <argument key="always_use_default_target_path">false</argument> <argument key="default_target_path">/</argument> <argument key="target_path_parameter">_target_path</argument> <argument key="use_referer">false</argument> <argument key="failure_path">null</argument> <argument key="failure_forward">false</argument> <argument key="username_parameter">_username</argument> <argument key="password_parameter">_password</argument> <argument key="csrf_parameter">_csrf_token</argument> <argument key="intention">authenticate</argument> <argument key="post_only">true</argument> </argument> <argument>null</argument> <argument>null</argument> <argument type="service" id="monolog.logger.security"/> <argument type="service" id="event_dispatcher"/> </service> </argument> <argument type="service"> <service class="Symfony\Component\Security\Http\Firewall\AccessListener" public="false"> <tag name="monolog.logger" channel="security"/> <argument type="service" id="security.context"/> <argument type="service" id="security.access.decision_manager"/> <argument type="service"> <service class="Symfony\Component\Security\Http\AccessMap" public="false"/> </argument> <argument type="service" id="security.authentication.manager"/> <argument type="service" id="monolog.logger.security"/> </service> </argument> </argument> <argument type="service"> <service class="Symfony\Component\Security\Http\Firewall\ExceptionListener" public="false"> <argument type="service" id="security.context"/> <argument type="service" id="security.authentication.trust_resolver"/> <argument type="service"> <service class="Symfony\Component\Security\Http\HttpUtils" public="false"> <argument type="service" id="router"/> </service> </argument> <argument type="service"> <service class="Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint" public="false"> <argument type="service" id="http_kernel"/> <argument type="service"> <service class="Symfony\Component\Security\Http\HttpUtils" public="false"> <argument type="service" id="router"/> </service> </argument> <argument>/demo/secured/login</argument> <argument>false</argument> </service> </argument> <argument>null</argument> <argument>null</argument> <argument type="service" id="monolog.logger.security"/> </service> </argument> </service> <service id="twig" class="Twig_Environment"> <argument type="service" id="twig.loader"/> <argument type="collection"> <argument key="debug">true</argument> <argument key="strict_variables">true</argument> <argument key="exception_controller">Symfony\Bundle\TwigBundle\Controller\ExceptionController::showAction</argument> <argument key="cache">C:\wamp\www\Symfony\app/cache/dev/twig</argument> <argument key="charset">UTF-8</argument> </argument> <call method="addExtension"> <argument type="service"> <service class="Symfony\Bundle\SecurityBundle\Twig\Extension\SecurityExtension" public="false"> <tag name="twig.extension"/> <argument type="service" id="security.context"/> </service> </argument> </call> <call method="addExtension"> <argument type="service"> <service class="Symfony\Bridge\Twig\Extension\TranslationExtension" public="false"> <tag name="twig.extension"/> <argument type="service" id="translator"/> </service> </argument> </call> <call method="addExtension"> <argument type="service"> <service class="Symfony\Bundle\TwigBundle\Extension\AssetsExtension" public="false"> <tag name="twig.extension"/> <argument type="service" id="service_container"/> </service> </argument> </call> <call method="addExtension"> <argument type="service"> <service class="Symfony\Bundle\TwigBundle\Extension\ActionsExtension" public="false"> <tag name="twig.extension"/> <argument type="service" id="service_container"/> </service> </argument> </call> <call method="addExtension"> <argument type="service"> <service class="Symfony\Bundle\TwigBundle\Extension\CodeExtension" public="false"> <tag name="twig.extension"/> <argument type="service" id="service_container"/> </service> </argument> </call> <call method="addExtension"> <argument type="service"> <service class="Symfony\Bridge\Twig\Extension\RoutingExtension" public="false"> <tag name="twig.extension"/> <argument type="service" id="router"/> </service> </argument> </call> <call method="addExtension"> <argument type="service"> <service class="Symfony\Bridge\Twig\Extension\YamlExtension" public="false"> <tag name="twig.extension"/> </service> </argument> </call> <call method="addExtension"> <argument type="service"> <service class="Symfony\Bridge\Twig\Extension\FormExtension" public="false"> <tag name="twig.extension"/> <argument type="collection"> <argument>form_div_layout.html.twig</argument> </argument> </service> </argument> </call> <call method="addExtension"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Twig\AsseticExtension" public="false"> <tag name="twig.extension"/> <tag name="assetic.templating.twig"/> <argument type="service" id="assetic.asset_factory"/> <argument>true</argument> <argument type="collection"/> </service> </argument> </call> <call method="addExtension"> <argument type="service" id="twig.extension.acme.demo"/> </call> </service> <service id="twig.loader" class="Symfony\Bundle\TwigBundle\Loader\FilesystemLoader"> <argument type="service" id="templating.locator"/> <argument type="service" id="templating.name_parser"/> <call method="addPath"> <argument>C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Bundle\TwigBundle\DependencyInjection/../../../Bridge/Twig/Resources/views/Form</argument> </call> </service> <service id="twig.exception_listener" class="Symfony\Component\HttpKernel\EventListener\ExceptionListener"> <tag name="kernel.event_listener" event="kernel.exception" method="onKernelException" priority="-128"/> <tag name="monolog.logger" channel="request"/> <argument>Symfony\Bundle\TwigBundle\Controller\ExceptionController::showAction</argument> <argument type="service" id="monolog.logger.request"/> </service> <service id="monolog.handler.main" class="Monolog\Handler\StreamHandler"> <argument>C:\wamp\www\Symfony\app/logs/dev.log</argument> <argument>100</argument> <argument>true</argument> </service> <service id="monolog.handler.firephp" class="Symfony\Bridge\Monolog\Handler\FirePHPHandler"> <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/> <argument>200</argument> <argument>true</argument> </service> <service id="swiftmailer.plugin.messagelogger" class="Symfony\Bundle\SwiftmailerBundle\Logger\MessageLogger"> <tag name="swiftmailer.plugin"/> </service> <service id="doctrine.dbal.logger" class="Symfony\Bridge\Doctrine\Logger\DbalLogger" public="false"> <tag name="monolog.logger" channel="doctrine"/> <argument type="service" id="monolog.logger.doctrine"/> </service> <service id="doctrine.dbal.connection_factory" class="Symfony\Bundle\DoctrineBundle\ConnectionFactory"> <argument type="collection"/> </service> <service id="doctrine" class="Symfony\Bundle\DoctrineBundle\Registry"> <argument type="service" id="service_container"/> <argument type="collection"> <argument key="default">doctrine.dbal.default_connection</argument> </argument> <argument type="collection"> <argument key="default">doctrine.orm.default_entity_manager</argument> </argument> <argument>default</argument> <argument>default</argument> </service> <service id="doctrine.dbal.default_connection" class="stdClass" factory-method="createConnection" factory-service="doctrine.dbal.connection_factory"> <argument type="collection"> <argument key="dbname">symfony</argument> <argument key="host">localhost</argument> <argument key="port"></argument> <argument key="user">root</argument> <argument key="password"></argument> <argument key="driver">pdo_mysql</argument> <argument key="driverOptions" type="collection"/> </argument> <argument type="service"> <service class="Doctrine\DBAL\Configuration" public="false"> <call method="setSQLLogger"> <argument type="service" id="doctrine.dbal.logger"/> </call> </service> </argument> <argument type="service"> <service class="Doctrine\Common\EventManager" public="false"> <call method="addEventSubscriber"> <argument type="service"> <service class="Doctrine\DBAL\Event\Listeners\MysqlSessionInit" public="false"> <tag name="doctrine.event_subscriber" connection="default"/> <argument>UTF8</argument> </service> </argument> </call> </service> </argument> <argument type="collection"/> </service> <service id="form.type_guesser.doctrine" class="Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser"> <tag name="form.type_guesser"/> <argument type="service" id="doctrine"/> </service> <service id="form.type.entity" class="Symfony\Bridge\Doctrine\Form\Type\EntityType"> <tag name="form.type" alias="entity"/> <argument type="service" id="doctrine"/> </service> <service id="doctrine.orm.validator.unique" class="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator"> <tag name="validator.constraint_validator" alias="doctrine.orm.validator.unique"/> <argument type="service" id="doctrine"/> </service> <service id="doctrine.orm.validator_initializer" class="Symfony\Bridge\Doctrine\Validator\EntityInitializer"> <tag name="validator.initializer"/> <argument type="service" id="doctrine"/> </service> <service id="doctrine.orm.default_entity_manager" class="Doctrine\ORM\EntityManager" factory-method="create"> <argument type="service" id="doctrine.dbal.default_connection"/> <argument type="service"> <service class="Doctrine\ORM\Configuration" public="false"> <call method="setEntityNamespaces"> <argument type="collection"/> </call> <call method="setMetadataCacheImpl"> <argument type="service"> <service class="Doctrine\Common\Cache\ArrayCache" public="false"> <call method="setNamespace"> <argument>sf2orm_default_0ce0b6cd24d9278792e8449ccd78d8db</argument> </call> </service> </argument> </call> <call method="setQueryCacheImpl"> <argument type="service"> <service class="Doctrine\Common\Cache\ArrayCache" public="false"> <call method="setNamespace"> <argument>sf2orm_default_0ce0b6cd24d9278792e8449ccd78d8db</argument> </call> </service> </argument> </call> <call method="setResultCacheImpl"> <argument type="service"> <service class="Doctrine\Common\Cache\ArrayCache" public="false"> <call method="setNamespace"> <argument>sf2orm_default_0ce0b6cd24d9278792e8449ccd78d8db</argument> </call> </service> </argument> </call> <call method="setMetadataDriverImpl"> <argument type="service"> <service class="Doctrine\ORM\Mapping\Driver\DriverChain" public="false"/> </argument> </call> <call method="setProxyDir"> <argument>C:\wamp\www\Symfony\app/cache/dev/doctrine/orm/Proxies</argument> </call> <call method="setProxyNamespace"> <argument>Proxies</argument> </call> <call method="setAutoGenerateProxyClasses"> <argument>true</argument> </call> <call method="setClassMetadataFactoryName"> <argument>Doctrine\ORM\Mapping\ClassMetadataFactory</argument> </call> </service> </argument> </service> <service id="assetic.filter_manager" class="Symfony\Bundle\AsseticBundle\FilterManager"> <argument type="service" id="service_container"/> <argument type="collection"> <argument key="cssrewrite">assetic.filter.cssrewrite</argument> </argument> </service> <service id="assetic.asset_manager" class="Assetic\Factory\LazyAssetManager"> <argument type="service" id="assetic.asset_factory"/> <argument type="collection"> <argument key="twig" type="service"> <service class="Assetic\Factory\Loader\CachedFormulaLoader" public="false"> <tag name="assetic.formula_loader" alias="twig"/> <tag name="assetic.templating.twig"/> <argument type="service"> <service class="Assetic\Extension\Twig\TwigFormulaLoader" public="false"> <tag name="assetic.templating.twig"/> <argument type="service" id="twig"/> </service> </argument> <argument type="service"> <service class="Assetic\Cache\ConfigCache" public="false"> <argument>C:\wamp\www\Symfony\app/cache/dev/assetic/config</argument> </service> </argument> <argument>true</argument> </service> </argument> </argument> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>FrameworkBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/FrameworkBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>FrameworkBundle</argument> <argument>C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>SecurityBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/SecurityBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>SecurityBundle</argument> <argument>C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Bundle\SecurityBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>TwigBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/TwigBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>TwigBundle</argument> <argument>C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Bundle\TwigBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>MonologBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/MonologBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>MonologBundle</argument> <argument>C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Bundle\MonologBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>SwiftmailerBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/SwiftmailerBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>SwiftmailerBundle</argument> <argument>C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Bundle\SwiftmailerBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>DoctrineBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/DoctrineBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>DoctrineBundle</argument> <argument>C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Bundle\DoctrineBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>AsseticBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/AsseticBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>AsseticBundle</argument> <argument>C:\wamp\www\Symfony\vendor\bundles\Symfony\Bundle\AsseticBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>SensioFrameworkExtraBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/SensioFrameworkExtraBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>SensioFrameworkExtraBundle</argument> <argument>C:\wamp\www\Symfony\vendor\bundles\Sensio\Bundle\FrameworkExtraBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>JMSSecurityExtraBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/JMSSecurityExtraBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>JMSSecurityExtraBundle</argument> <argument>C:\wamp\www\Symfony\vendor\bundles\JMS\SecurityExtraBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>IoshBlogBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/IoshBlogBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>IoshBlogBundle</argument> <argument>C:\wamp\www\Symfony\src\Iosh\BlogBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>AcmeDemoBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/AcmeDemoBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>AcmeDemoBundle</argument> <argument>C:\wamp\www\Symfony\src\Acme\DemoBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>WebProfilerBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/WebProfilerBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>WebProfilerBundle</argument> <argument>C:\wamp\www\Symfony\vendor\symfony\src\Symfony\Bundle\WebProfilerBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>SensioDistributionBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/SensioDistributionBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>SensioDistributionBundle</argument> <argument>C:\wamp\www\Symfony\vendor\bundles\Sensio\Bundle\DistributionBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="collection"> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>SensioGeneratorBundle</argument> <argument>C:\wamp\www\Symfony\app/Resources/SensioGeneratorBundle/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument type="service"> <service class="%assetic.directory_resource.class%" public="false"> <argument type="service" id="templating.loader"/> <argument>SensioGeneratorBundle</argument> <argument>C:\wamp\www\Symfony\vendor\bundles\Sensio\Bundle\GeneratorBundle/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> </argument> </service> </argument> <argument>twig</argument> </call> <call method="addResource"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource" public="false"> <tag name="assetic.templating.twig"/> <tag name="assetic.formula_resource" loader="twig"/> <argument type="service" id="templating.loader"/> <argument></argument> <argument>C:\wamp\www\Symfony\app/Resources/views</argument> <argument>/^[^.]+\.[^.]+\.twig$/</argument> </service> </argument> <argument>twig</argument> </call> </service> <service id="assetic.asset_factory" class="Symfony\Bundle\AsseticBundle\Factory\AssetFactory" public="false"> <argument type="service" id="kernel"/> <argument type="service" id="service_container"/> <argument type="service"> <service class="Symfony\Component\DependencyInjection\ParameterBag\ParameterBag" public="false"> <argument type="service"> <service class="stdClass" factory-method="getDefaultParameters" factory-service="service_container" public="false"/> </argument> </service> </argument> <argument>C:\wamp\www\Symfony\app/../web</argument> <argument>true</argument> <call method="addWorker"> <argument type="service"> <service class="Symfony\Bundle\AsseticBundle\Factory\Worker\UseControllerWorker" public="false"> <tag name="assetic.factory_worker"/> </service> </argument> </call> </service> <service id="assetic.filter.cssrewrite" class="Assetic\Filter\CssRewriteFilter"> <tag name="assetic.filter" alias="cssrewrite"/> </service> <service id="assetic.controller" class="Symfony\Bundle\AsseticBundle\Controller\AsseticController" scope="prototype"> <argument type="service" id="request"/> <argument type="service" id="assetic.asset_manager"/> <argument type="service" id="assetic.cache"/> <argument>false</argument> <argument type="service" id="profiler"/> </service> <service id="assetic.cache" class="Assetic\Cache\FilesystemCache" public="false"> <argument>C:\wamp\www\Symfony\app/cache/dev/assetic/assets</argument> </service> <service id="assetic.request_listener" class="Symfony\Bundle\AsseticBundle\EventListener\RequestListener"> <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest"/> </service> <service id="sensio_framework_extra.controller.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener"> <tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/> <argument type="service" id="annotation_reader"/> </service> <service id="sensio_framework_extra.converter.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener"> <tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/> <argument type="service" id="sensio_framework_extra.converter.manager"/> </service> <service id="sensio_framework_extra.converter.manager" class="Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager"> <call method="add"> <argument type="service" id="sensio_framework_extra.converter.doctrine.orm"/> <argument>0</argument> </call> </service> <service id="sensio_framework_extra.converter.doctrine.orm" class="Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter"> <tag name="request.param_converter"/> <argument type="service" id="doctrine"/> </service> <service id="sensio_framework_extra.view.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener"> <tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/> <tag name="kernel.event_listener" event="kernel.view" method="onKernelView"/> <argument type="service" id="service_container"/> </service> <service id="sensio_framework_extra.cache.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\CacheListener"> <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/> </service> <service id="security.access.method_interceptor" class="JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor"> <argument type="service" id="security.context"/> <argument type="service" id="security.authentication.manager"/> <argument type="service" id="security.access.decision_manager"/> <argument type="service"> <service class="JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager" public="false"> <argument type="collection"/> </service> </argument> <argument type="service"> <service class="JMS\SecurityExtraBundle\Security\Authorization\RunAsManager" public="false"> <argument>RunAsToken</argument> <argument>ROLE_</argument> </service> </argument> <argument type="service" id="logger"/> </service> <service id="security.extra.controller_listener" class="JMS\SecurityExtraBundle\Controller\ControllerListener"> <tag name="kernel.event_listener" event="kernel.controller" method="onCoreController" priority="-255"/> <argument type="service" id="service_container"/> <argument type="service" id="annotation_reader"/> </service> <service id="twig.extension.acme.demo" class="Acme\DemoBundle\Twig\Extension\DemoExtension" public="false"> <tag name="twig.extension"/> <argument type="service" id="twig.loader"/> </service> <service id="acme.demo.listener" class="Acme\DemoBundle\ControllerListener"> <tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/> <argument type="service" id="twig.extension.acme.demo"/> </service> <service id="web_profiler.debug_toolbar" class="Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener"> <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" priority="-128"/> <argument type="service" id="templating"/> <argument>false</argument> <argument>2</argument> </service> <service id="sensio.distribution.webconfigurator" class="Sensio\Bundle\DistributionBundle\Configurator\Configurator"> <argument>C:\wamp\www\Symfony\app</argument> </service> <service id="monolog.logger.request" class="Symfony\Bridge\Monolog\Logger"> <argument>request</argument> <call method="pushHandler"> <argument type="service" id="monolog.handler.main"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.firephp"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.debug"/> </call> </service> <service id="monolog.logger.event" class="Symfony\Bridge\Monolog\Logger"> <argument>event</argument> <call method="pushHandler"> <argument type="service" id="monolog.handler.main"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.firephp"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.debug"/> </call> </service> <service id="monolog.logger.profiler" class="Symfony\Bridge\Monolog\Logger"> <argument>profiler</argument> <call method="pushHandler"> <argument type="service" id="monolog.handler.main"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.firephp"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.debug"/> </call> </service> <service id="monolog.logger.router" class="Symfony\Bridge\Monolog\Logger"> <argument>router</argument> <call method="pushHandler"> <argument type="service" id="monolog.handler.main"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.firephp"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.debug"/> </call> </service> <service id="monolog.logger.templating" class="Symfony\Bridge\Monolog\Logger"> <argument>templating</argument> <call method="pushHandler"> <argument type="service" id="monolog.handler.main"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.firephp"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.debug"/> </call> </service> <service id="monolog.logger.security" class="Symfony\Bridge\Monolog\Logger"> <argument>security</argument> <call method="pushHandler"> <argument type="service" id="monolog.handler.main"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.firephp"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.debug"/> </call> </service> <service id="monolog.logger.doctrine" class="Symfony\Bridge\Monolog\Logger"> <argument>doctrine</argument> <call method="pushHandler"> <argument type="service" id="monolog.handler.main"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.firephp"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.debug"/> </call> </service> <service id="monolog.handler.debug" class="Symfony\Bridge\Monolog\Handler\DebugHandler"> <argument>100</argument> <argument>true</argument> </service> <service id="session.storage" class="Symfony\Component\HttpFoundation\SessionStorage\NativeSessionStorage"> <argument type="collection"/> </service> <service id="router" class="Symfony\Bundle\FrameworkBundle\Routing\Router"> <argument type="service" id="service_container"/> <argument>C:\wamp\www\Symfony\app/config/routing_dev.yml</argument> <argument type="collection"> <argument key="cache_dir">C:\wamp\www\Symfony\app/cache/dev</argument> <argument key="debug">true</argument> <argument key="generator_class">Symfony\Component\Routing\Generator\UrlGenerator</argument> <argument key="generator_base_class">Symfony\Component\Routing\Generator\UrlGenerator</argument> <argument key="generator_dumper_class">Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper</argument> <argument key="generator_cache_class">app%kernel.environment%UrlGenerator</argument> <argument key="matcher_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</argument> <argument key="matcher_base_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</argument> <argument key="matcher_dumper_class">Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper</argument> <argument key="matcher_cache_class">app%kernel.environment%UrlMatcher</argument> </argument> </service> <service id="templating.loader" class="Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader"> <argument type="service" id="templating.locator"/> </service> <service id="templating" class="Symfony\Bundle\TwigBundle\TwigEngine"> <argument type="service" id="twig"/> <argument type="service" id="templating.name_parser"/> <argument type="service" id="templating.globals"/> </service> <service id="annotation_reader" class="Doctrine\Common\Annotations\FileCacheReader"> <argument type="service"> <service class="Doctrine\Common\Annotations\AnnotationReader" public="false"/> </argument> <argument>C:\wamp\www\Symfony\app/cache/dev/annotations</argument> <argument>true</argument> </service> <service id="security.encoder_factory" class="Symfony\Component\Security\Core\Encoder\EncoderFactory"> <argument type="collection"> <argument key="Symfony\Component\Security\Core\User\User" type="collection"> <argument key="class">%security.encoder.plain.class%</argument> <argument key="arguments" type="collection"> <argument>false</argument> </argument> </argument> </argument> </service> <service id="logger" class="Symfony\Bridge\Monolog\Logger"> <argument>app</argument> <call method="pushHandler"> <argument type="service" id="monolog.handler.main"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.firephp"/> </call> <call method="pushHandler"> <argument type="service" id="monolog.handler.debug"/> </call> </service> <service id="swiftmailer.transport" class="Swift_Transport_EsmtpTransport"> <argument type="service"> <service class="Swift_Transport_StreamBuffer" public="false"> <argument type="service"> <service class="Swift_StreamFilters_StringReplacementFilterFactory" public="false"/> </argument> </service> </argument> <argument type="collection"> <argument type="service"> <service class="Swift_Transport_Esmtp_AuthHandler" public="false"> <argument type="collection"> <argument type="service"> <service class="Swift_Transport_Esmtp_Auth_CramMd5Authenticator" public="false"/> </argument> <argument type="service"> <service class="Swift_Transport_Esmtp_Auth_LoginAuthenticator" public="false"/> </argument> <argument type="service"> <service class="Swift_Transport_Esmtp_Auth_PlainAuthenticator" public="false"/> </argument> </argument> </service> </argument> </argument> <argument type="service"> <service class="Swift_Events_SimpleEventDispatcher" public="false"/> </argument> <call method="setHost"> <argument>localhost</argument> </call> <call method="setPort"> <argument>25</argument> </call> <call method="setEncryption"> <argument>null</argument> </call> <call method="setUsername"> <argument></argument> </call> <call method="setPassword"> <argument></argument> </call> <call method="setAuthMode"> <argument>null</argument> </call> <call method="registerPlugin"> <argument type="service" id="swiftmailer.plugin.messagelogger"/> </call> </service> <service id="mailer" class="Swift_Mailer"> <argument type="service" id="swiftmailer.transport"/> </service> <service id="debug.event_dispatcher" alias="event_dispatcher"/> <service id="database_connection" alias="doctrine.dbal.default_connection"/> <service id="doctrine.orm.entity_manager" alias="doctrine.orm.default_entity_manager"/> </services> </container>
{ "content_hash": "20d334ddab6819c970d5b11a27bd42be", "timestamp": "", "source": "github", "line_count": 2372, "max_line_length": 228, "avg_line_length": 57.53161888701518, "alnum_prop": 0.6716960392774705, "repo_name": "guillaumecedille/Symfony2", "id": "180eaa38b2663301e6c44e610559f6c8d2c2aa5d", "size": "136465", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/cache/dev_old/appDevDebugProjectContainer.xml", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "33457" } ], "symlink_target": "" }
<div class="wrapper"> <div class="tryinfo-box"> <div class="azure-logo-wrapper"> <img src="image/azure-logo.svg"> </div> <div>{{ 'tryNow_trialTimeRemaining' | translate }} <span id="timer-text">{{timerText}}</span></div> <div class="free-trial-wrapper"> <a [tooltip]="freeAccountTooltip" [attr.href]="freeTrialUri" (click)="trackLinkClick('freeTrialTopClick')" target="_blank" class="signup-button "> {{ 'tryNow_createFreeAzureAccount' | translate }} <tooltip-content #freeAccountTooltip> <p> {{ 'tryNow_FreeAccountToolTip' | translate }} </p> </tooltip-content> </a> </div> <span class="discover-more-wrapper"> <a [attr.href]="discoverMoreUri" (click)="trackLinkClick('discoverMoreClick')" target="_blank" class="discover-more-button"> {{ 'tryNow_discoverMore' | translate }} </a> </span> </div> </div>
{ "content_hash": "2bd3a673264a9ee58ba817b6d0ab0122", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 158, "avg_line_length": 45.869565217391305, "alnum_prop": 0.5364928909952607, "repo_name": "chunye/azure-functions-ux", "id": "7d240717bc7e2ba96cbefc710ffcf95f0949017b", "size": "1055", "binary": false, "copies": "2", "ref": "refs/heads/dev", "path": "AzureFunctions.AngularClient/src/app/try-now/try-now.component.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "96" }, { "name": "Batchfile", "bytes": "2209" }, { "name": "C#", "bytes": "196746" }, { "name": "CSS", "bytes": "127190" }, { "name": "HTML", "bytes": "257505" }, { "name": "JavaScript", "bytes": "16646" }, { "name": "PowerShell", "bytes": "6175" }, { "name": "Shell", "bytes": "146" }, { "name": "TypeScript", "bytes": "1577310" } ], "symlink_target": "" }
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! #include "config.h" #include "V8InspectorOverlayHost.h" #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/V8DOMConfiguration.h" #include "bindings/core/v8/V8ObjectConstructor.h" #include "core/dom/ContextFeatures.h" #include "core/dom/Document.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/TraceEvent.h" #include "wtf/GetPtr.h" #include "wtf/RefPtr.h" namespace blink { // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial // and does not depend on another global objects. #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif const WrapperTypeInfo V8InspectorOverlayHost::wrapperTypeInfo = { gin::kEmbedderBlink, V8InspectorOverlayHost::domTemplate, V8InspectorOverlayHost::refObject, V8InspectorOverlayHost::derefObject, V8InspectorOverlayHost::trace, 0, 0, V8InspectorOverlayHost::preparePrototypeObject, V8InspectorOverlayHost::installConditionallyEnabledProperties, "InspectorOverlayHost", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Independent, WrapperTypeInfo::WillBeGarbageCollectedObject }; #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) #pragma clang diagnostic pop #endif // This static member must be declared by DEFINE_WRAPPERTYPEINFO in InspectorOverlayHost.h. // For details, see the comment of DEFINE_WRAPPERTYPEINFO in // bindings/core/v8/ScriptWrappable.h. const WrapperTypeInfo& InspectorOverlayHost::s_wrapperTypeInfo = V8InspectorOverlayHost::wrapperTypeInfo; namespace InspectorOverlayHostV8Internal { static void resumeMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { InspectorOverlayHost* impl = V8InspectorOverlayHost::toImpl(info.Holder()); impl->resume(); } static void resumeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); InspectorOverlayHostV8Internal::resumeMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void stepOverMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { InspectorOverlayHost* impl = V8InspectorOverlayHost::toImpl(info.Holder()); impl->stepOver(); } static void stepOverMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); InspectorOverlayHostV8Internal::stepOverMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void startPropertyChangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { if (UNLIKELY(info.Length() < 1)) { V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(info.GetIsolate(), "startPropertyChange", "InspectorOverlayHost", 1, info.Length()), info.GetIsolate()); return; } InspectorOverlayHost* impl = V8InspectorOverlayHost::toImpl(info.Holder()); V8StringResource<> propertyName; { propertyName = info[0]; if (!propertyName.prepare()) return; } impl->startPropertyChange(propertyName); } static void startPropertyChangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); InspectorOverlayHostV8Internal::startPropertyChangeMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void changePropertyMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exceptionState(ExceptionState::ExecutionContext, "changeProperty", "InspectorOverlayHost", info.Holder(), info.GetIsolate()); if (UNLIKELY(info.Length() < 1)) { setMinimumArityTypeError(exceptionState, 1, info.Length()); exceptionState.throwIfNeeded(); return; } InspectorOverlayHost* impl = V8InspectorOverlayHost::toImpl(info.Holder()); float cssDelta; { cssDelta = toRestrictedFloat(info.GetIsolate(), info[0], exceptionState); if (exceptionState.throwIfNeeded()) return; } impl->changeProperty(cssDelta); } static void changePropertyMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); InspectorOverlayHostV8Internal::changePropertyMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void endPropertyChangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { InspectorOverlayHost* impl = V8InspectorOverlayHost::toImpl(info.Holder()); impl->endPropertyChange(); } static void endPropertyChangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); InspectorOverlayHostV8Internal::endPropertyChangeMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } } // namespace InspectorOverlayHostV8Internal static const V8DOMConfiguration::MethodConfiguration V8InspectorOverlayHostMethods[] = { {"resume", InspectorOverlayHostV8Internal::resumeMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, {"stepOver", InspectorOverlayHostV8Internal::stepOverMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, {"startPropertyChange", InspectorOverlayHostV8Internal::startPropertyChangeMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, {"changeProperty", InspectorOverlayHostV8Internal::changePropertyMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, {"endPropertyChange", InspectorOverlayHostV8Internal::endPropertyChangeMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, }; static void installV8InspectorOverlayHostTemplate(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) { functionTemplate->ReadOnlyPrototype(); v8::Local<v8::Signature> defaultSignature; defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "InspectorOverlayHost", v8::Local<v8::FunctionTemplate>(), V8InspectorOverlayHost::internalFieldCount, 0, 0, 0, 0, V8InspectorOverlayHostMethods, WTF_ARRAY_LENGTH(V8InspectorOverlayHostMethods)); v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate(); ALLOW_UNUSED_LOCAL(instanceTemplate); v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); // Custom toString template functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate()); } v8::Local<v8::FunctionTemplate> V8InspectorOverlayHost::domTemplate(v8::Isolate* isolate) { return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8InspectorOverlayHostTemplate); } bool V8InspectorOverlayHost::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) { return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); } v8::Local<v8::Object> V8InspectorOverlayHost::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) { return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); } InspectorOverlayHost* V8InspectorOverlayHost::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) { return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0; } void V8InspectorOverlayHost::refObject(ScriptWrappable* scriptWrappable) { #if !ENABLE(OILPAN) scriptWrappable->toImpl<InspectorOverlayHost>()->ref(); #endif } void V8InspectorOverlayHost::derefObject(ScriptWrappable* scriptWrappable) { #if !ENABLE(OILPAN) scriptWrappable->toImpl<InspectorOverlayHost>()->deref(); #endif } } // namespace blink
{ "content_hash": "1fed907f88c14699900849fbcc52a9d2", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 570, "avg_line_length": 43.93010752688172, "alnum_prop": 0.7558438379635296, "repo_name": "zero-rp/miniblink49", "id": "30e5372265dd5c8fba83f05f09d023ab93247aa8", "size": "8339", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "gen/blink/bindings/core/v8/V8InspectorOverlayHost.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "11324414" }, { "name": "Batchfile", "bytes": "52488" }, { "name": "C", "bytes": "31014938" }, { "name": "C++", "bytes": "281193388" }, { "name": "CMake", "bytes": "88548" }, { "name": "CSS", "bytes": "20839" }, { "name": "DIGITAL Command Language", "bytes": "226954" }, { "name": "HTML", "bytes": "202637" }, { "name": "JavaScript", "bytes": "32544926" }, { "name": "Lua", "bytes": "32432" }, { "name": "M4", "bytes": "125191" }, { "name": "Makefile", "bytes": "1517330" }, { "name": "Objective-C", "bytes": "87691" }, { "name": "Objective-C++", "bytes": "35037" }, { "name": "PHP", "bytes": "307541" }, { "name": "Perl", "bytes": "3283676" }, { "name": "Prolog", "bytes": "29177" }, { "name": "Python", "bytes": "4308928" }, { "name": "R", "bytes": "10248" }, { "name": "Scheme", "bytes": "25457" }, { "name": "Shell", "bytes": "264021" }, { "name": "TypeScript", "bytes": "162421" }, { "name": "Vim script", "bytes": "11362" }, { "name": "XS", "bytes": "4319" }, { "name": "eC", "bytes": "4383" } ], "symlink_target": "" }
require 'net_buildpack/runtime' module NETBuildpack::Util # A class representing the size of a category of memory. class MemorySize include Comparable # Creates a memory size based on a memory size string including a unit of 'K', 'M', or 'G'. # # @param [String] size a memory size including a unit def initialize(size) if size == '0' @bytes = 0 else fail "Invalid memory size '#{size}'" if !size || size.length < 2 unit = size[-1] v = size[0..-2] fail "Invalid memory size '#{size}'" unless MemorySize.is_integer v v = size.to_i # Store the number of bytes. case unit when 'b', 'B' @bytes = v when 'k', 'K' @bytes = v * KILO when 'm', 'M' @bytes = KILO * KILO * v when 'g', 'G' @bytes = KILO * KILO * KILO * v else fail "Invalid unit '#{unit}' in memory size '#{size}'" end end end # Returns a memory size as a string including a unit. If the memory size is not a whole number, it is rounded down. # The returned unit is always kilobytes, megabytes, or gigabytes which are commonly used units. # # @return [String] the memory size as a string, e.g. "10K" def to_s kilobytes = (@bytes / KILO).round if kilobytes == 0 '0' elsif kilobytes % KILO == 0 megabytes = kilobytes / KILO if megabytes % KILO == 0 gigabytes = megabytes / KILO gigabytes.to_s + 'G' else megabytes.to_s + 'M' end else kilobytes.to_s + 'K' end end # Compare this memory size with another memory size # # @param [MemorySize, 0] other # @return [Numeric] the result def <=>(other) if other == 0 @bytes <=> 0 else fail "Cannot compare a MemorySize to an instance of #{other.class}" unless other.is_a? MemorySize @bytes <=> other.bytes end end # Add a memory size to this memory size. # # @param [MemorySize] other the memory size to add # @return [MemorySize] the result def +(other) memory_size_operation(other) do |self_bytes, other_bytes| self_bytes + other_bytes end end # Multiply this memory size by a numeric factor. # # @param [Numeric] other the factor to multiply by # @return [MemorySize] the result def *(other) fail "Cannot multiply a Memory size by an instance of #{other.class}" unless other.is_a? Numeric MemorySize.from_numeric((@bytes * other).round) end # Subtract a memory size from this memory size. # # @param [MemorySize] other the memory size to subtract # @return [MemorySize] the result def -(other) memory_size_operation(other) do |self_bytes, other_bytes| self_bytes - other_bytes end end # Divide a memory size by a memory size or a numeric value. The units are respected, so the result of diving by a # memory size is a numeric whereas the result of dividing by a numeric value is a memory size. # # @param [MemorySize, Numeric] other the memory size or numeric value to divide by # @return [MemorySize, Numeric] the result def /(other) return @bytes / other.bytes.to_f if other.is_a? MemorySize return MemorySize.from_numeric((@bytes / other.to_f).round) if other.is_a? Numeric fail "Cannot divide a MemorySize by an instance of #{other.class}" end protected # @!attribute [r] bytes # @return [Numeric] the size in bytes of this memory size attr_reader :bytes private KILO = 1024 def memory_size_operation(other) fail "Invalid parameter: instance of #{other.class} is not a MemorySize" unless other.is_a? MemorySize MemorySize.from_numeric(yield @bytes, other.bytes) end def self.is_integer(v) f = Float(v) f && f.floor == f rescue false end def self.from_numeric(n) MemorySize.new("#{n.to_s}B") end public # Zero byte memory size ZERO = from_numeric 0 end end
{ "content_hash": "17ddd30acc1dbfc3d481ee732a088d7d", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 119, "avg_line_length": 28.675862068965518, "alnum_prop": 0.6005291005291006, "repo_name": "Hitakashi/.net-buildpack", "id": "6f5141c36a9eaafbf5da703fd9daa34b79054040", "size": "4803", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/net_buildpack/util/memory_size.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "24757" }, { "name": "Ruby", "bytes": "132131" }, { "name": "Shell", "bytes": "799" } ], "symlink_target": "" }
package uk.ac.ebi.pride.utilities.data.exporters; import org.junit.After; import org.junit.Before; import org.junit.Test; import uk.ac.ebi.pride.jmztab.model.MZTabFile; import uk.ac.ebi.pride.jmztab.utils.MZTabFileConverter; import uk.ac.ebi.pride.utilities.data.controller.impl.ControllerImpl.MzIdentMLControllerImpl; import java.io.*; import java.net.URL; import static org.junit.Assert.assertTrue; /** * The filtering when exporting a mzIdentML to mzTab is done follows the next set of rules: * * If there is not protein detection protocol in mzIdentML (e. g. no ambiguity groups provided) or there is not threshold define in the protein detection protocol: * -The filtering can not be done at protein level directly. In this case is needed to look into the spectrum identification protocol. * -If there is no threshold available at spectrum identification protocol * The spectra is filtered using rank information. Only spectrum with rank one pass the filter * -If there is a threshold available at spectrum identification protocol * The spectra is filtered using using the provided threshold * -Only the proteins whose spectra remain after the filtering will be kept. * If there is protein detection protocol in mzIdentML the proteins and protein groups will be filtered according to threshold first. * - After that the filtering by threshold at peptide level will be applied, because in the worst case scenario it will remove only proteins without spectra evidence that pass the filter. * Before NoPeptideFilter was used to avoid inconsistencies with the protein filter, however was observed that some spectra evidences that did not pass the threshold were * included because the threshold was provided but was incorrectly annotated in the file as NoThresholdAvailable. This option minimized the inclusion of spectra under the threshold. * If there is no threshold information at protein or peptide level available * -The spectra is filtered using rank information. Only spectrum with rank one pass the filter * -Only the proteins whose spectra remain after the filtering will be kept. * * @author Yasset Perez-Riverol * @author Rui Wang * @author Noemi del Toro */ public class HQMzIdentMLMzTabConverterTest { private MzIdentMLControllerImpl mzIdentMLController = null; @Before public void setUp() throws Exception { URL url = HQMzIdentMLMzTabConverterTest.class.getClassLoader().getResource("20110827_K1_A (K1A).mzid"); if (url == null) { throw new IllegalStateException("no file for input found!"); } File inputFile = new File(url.toURI()); // File inputFile = new File("/Users/ntoro/Desktop/mzTabs/OIS_3d_Protein_LABELSWAP.mzid-pride-filtered.xml"); mzIdentMLController = new MzIdentMLControllerImpl(inputFile); } @Test public void convertToMzTab() throws IOException { AbstractMzTabConverter mzTabconverter = new HQMzIdentMLMzTabConverter(mzIdentMLController); MZTabFile mzTabFile = mzTabconverter.getMZTabFile(); MZTabFileConverter checker = new MZTabFileConverter(); checker.check(mzTabFile); File tmpFile = File.createTempFile("tmeFile", "mztab"); mzTabFile.printMZTab(new BufferedOutputStream(new FileOutputStream(tmpFile))); assertTrue("No errors reported during the conversion from MzIdentML to MzTab", checker.getErrorList().size() == 0); tmpFile.deleteOnExit(); } @After public void tearDown() throws Exception { } }
{ "content_hash": "e8068958f85bde6dd5c883f4839ec249", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 201, "avg_line_length": 53.42028985507246, "alnum_prop": 0.7278893109061313, "repo_name": "PRIDE-Utilities/ms-data-core-api", "id": "c8ea768a32439751daf17f076fb7fe5116264508", "size": "3686", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/uk/ac/ebi/pride/utilities/data/exporters/HQMzIdentMLMzTabConverterTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AngelScript", "bytes": "1146" }, { "name": "Java", "bytes": "1531940" }, { "name": "Shell", "bytes": "264" } ], "symlink_target": "" }
source /etc/profile.d/globals.sh printf "Installing xrdp **********************************************************************" $screen_cmd "${apt} install -y xrdp ${assess_update_errors}" grok_error sudo sed -e 's/^new_cursors=true/new_cursors=false/g' \ -i /etc/xrdp/xrdp.ini sudo systemctl enable xrdp sudo systemctl restart xrdp # Disable authentication required dialog for color-manager. sudo tee -a '/etc/polkit-1/localauthority/50-local.d/xrdp-color-manager.pkla' << 'EOF' [Netowrkmanager] Identity=unix-user:* Action=org.freedesktop.color-manager.create-device ResultAny=no ResultInactive=no ResultActive=yes EOF sudo systemctl restart polkit
{ "content_hash": "950da53858a9fde61869967f10eb44ac", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 95, "avg_line_length": 31.428571428571427, "alnum_prop": 0.6909090909090909, "repo_name": "ninp0/csi", "id": "9c517bcb2403828a0e72257c635c2bdc34e2be48", "size": "680", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packer/provisioners/xrdp.sh", "mode": "33261", "license": "mit", "language": [ { "name": "Ruby", "bytes": "1351941" }, { "name": "Shell", "bytes": "72652" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>otway-rees: 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.0 / otway-rees - 8.9.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> otway-rees <small> 8.9.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-05-07 04:41:25 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-07 04:41:25 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.0 Formal proof management system dune 3.1.1 Fast, portable, and opinionated build system ocaml 4.12.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.12.1 Official release 4.12.1 ocaml-config 2 OCaml Switch Configuration ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled ocamlfind 1.9.3 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/otway-rees&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/OtwayRees&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.9&quot; &amp; &lt; &quot;8.10~&quot;} ] tags: [ &quot;keyword: Otway-Rees&quot; &quot;keyword: protocols&quot; &quot;keyword: cryptography&quot; &quot;category: Computer Science/Concurrent Systems and Protocols/Correctness of specific protocols&quot; ] authors: [ &quot;Dominique Bolignano and Valérie Ménissier-Morain&quot; ] bug-reports: &quot;https://github.com/coq-contribs/otway-rees/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/otway-rees.git&quot; synopsis: &quot;Otway-Rees cryptographic protocol&quot; description: &quot;&quot;&quot; A description and a proof of correctness for the Otway-Rees cryptographic protocol, usually used as an example for formalisation of such protocols.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/otway-rees/archive/v8.9.0.tar.gz&quot; checksum: &quot;md5=96ce31b2e5b188f3be00401df0b5d8b6&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-otway-rees.8.9.0 coq.8.15.0</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.0). The following dependencies couldn&#39;t be met: - coq-otway-rees -&gt; coq &lt; 8.10~ -&gt; ocaml &lt; 4.10 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-otway-rees.8.9.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": "7100ff677df7c83b36f1428a2e9637a4", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 159, "avg_line_length": 41.26589595375722, "alnum_prop": 0.54671522622216, "repo_name": "coq-bench/coq-bench.github.io", "id": "cf9d1a99a0f689c093008f0a2ad84aa90cc7e551", "size": "7166", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.12.1-2.0.8/released/8.15.0/otway-rees/8.9.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?php namespace PHPExiftool\Driver\Tag\FujiFilm; use JMS\Serializer\Annotation\ExclusionPolicy; use PHPExiftool\Driver\AbstractTag; /** * @ExclusionPolicy("all") */ class ExposureCompensation extends AbstractTag { protected $Id = 58; protected $Name = 'ExposureCompensation'; protected $FullName = 'FujiFilm::MOV'; protected $GroupName = 'FujiFilm'; protected $g0 = 'MakerNotes'; protected $g1 = 'FujiFilm'; protected $g2 = 'Camera'; protected $Type = 'rational64s'; protected $Writable = false; protected $Description = 'Exposure Compensation'; protected $flag_Permanent = true; }
{ "content_hash": "100cb9ad2034154f68c23329569a6d91", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 53, "avg_line_length": 16.973684210526315, "alnum_prop": 0.6852713178294574, "repo_name": "bburnichon/PHPExiftool", "id": "6de13ab02f5107fa1e3f797083f9302ab7138fca", "size": "869", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/PHPExiftool/Driver/Tag/FujiFilm/ExposureCompensation.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "22076400" } ], "symlink_target": "" }
from __future__ import annotations import pytest from airflow import settings from airflow.exceptions import AirflowException, PoolNotFound from airflow.models.pool import Pool from airflow.models.taskinstance import TaskInstance as TI from airflow.operators.empty import EmptyOperator from airflow.utils import timezone from airflow.utils.session import create_session from airflow.utils.state import State from tests.test_utils.db import clear_db_dags, clear_db_pools, clear_db_runs, set_default_pool_slots DEFAULT_DATE = timezone.datetime(2016, 1, 1) class TestPool: USER_POOL_COUNT = 2 TOTAL_POOL_COUNT = USER_POOL_COUNT + 1 # including default_pool @staticmethod def clean_db(): clear_db_dags() clear_db_runs() clear_db_pools() def setup_method(self): self.clean_db() self.pools = [] def add_pools(self): self.pools = [Pool.get_default_pool()] for i in range(self.USER_POOL_COUNT): name = f'experimental_{i + 1}' pool = Pool( pool=name, slots=i, description=name, ) self.pools.append(pool) with create_session() as session: session.add_all(self.pools) def teardown_method(self): self.clean_db() def test_open_slots(self, dag_maker): pool = Pool(pool='test_pool', slots=5) with dag_maker( dag_id='test_open_slots', start_date=DEFAULT_DATE, ): op1 = EmptyOperator(task_id='dummy1', pool='test_pool') op2 = EmptyOperator(task_id='dummy2', pool='test_pool') dag_maker.create_dagrun() ti1 = TI(task=op1, execution_date=DEFAULT_DATE) ti2 = TI(task=op2, execution_date=DEFAULT_DATE) ti1.state = State.RUNNING ti2.state = State.QUEUED session = settings.Session() session.add(pool) session.merge(ti1) session.merge(ti2) session.commit() session.close() assert 3 == pool.open_slots() assert 1 == pool.running_slots() assert 1 == pool.queued_slots() assert 2 == pool.occupied_slots() assert { "default_pool": { "open": 128, "queued": 0, "total": 128, "running": 0, }, "test_pool": { "open": 3, "queued": 1, "running": 1, "total": 5, }, } == pool.slots_stats() def test_infinite_slots(self, dag_maker): pool = Pool(pool='test_pool', slots=-1) with dag_maker( dag_id='test_infinite_slots', ): op1 = EmptyOperator(task_id='dummy1', pool='test_pool') op2 = EmptyOperator(task_id='dummy2', pool='test_pool') dag_maker.create_dagrun() ti1 = TI(task=op1, execution_date=DEFAULT_DATE) ti2 = TI(task=op2, execution_date=DEFAULT_DATE) ti1.state = State.RUNNING ti2.state = State.QUEUED session = settings.Session() session.add(pool) session.merge(ti1) session.merge(ti2) session.commit() session.close() assert float('inf') == pool.open_slots() assert 1 == pool.running_slots() assert 1 == pool.queued_slots() assert 2 == pool.occupied_slots() assert { "default_pool": { "open": 128, "queued": 0, "total": 128, "running": 0, }, "test_pool": { "open": float('inf'), "queued": 1, "running": 1, "total": float('inf'), }, } == pool.slots_stats() def test_default_pool_open_slots(self, dag_maker): set_default_pool_slots(5) assert 5 == Pool.get_default_pool().open_slots() with dag_maker( dag_id='test_default_pool_open_slots', ): op1 = EmptyOperator(task_id='dummy1') op2 = EmptyOperator(task_id='dummy2', pool_slots=2) dag_maker.create_dagrun() ti1 = TI(task=op1, execution_date=DEFAULT_DATE) ti2 = TI(task=op2, execution_date=DEFAULT_DATE) ti1.state = State.RUNNING ti2.state = State.QUEUED session = settings.Session() session.merge(ti1) session.merge(ti2) session.commit() session.close() assert 2 == Pool.get_default_pool().open_slots() assert { "default_pool": { "open": 2, "queued": 2, "total": 5, "running": 1, } } == Pool.slots_stats() def test_get_pool(self): self.add_pools() pool = Pool.get_pool(pool_name=self.pools[0].pool) assert pool.pool == self.pools[0].pool def test_get_pool_non_existing(self): self.add_pools() assert not Pool.get_pool(pool_name='test') def test_get_pool_bad_name(self): for name in ('', ' '): assert not Pool.get_pool(pool_name=name) def test_get_pools(self): self.add_pools() pools = sorted(Pool.get_pools(), key=lambda p: p.pool) assert pools[0].pool == self.pools[0].pool assert pools[1].pool == self.pools[1].pool def test_create_pool(self, session): self.add_pools() pool = Pool.create_or_update_pool(name='foo', slots=5, description='') assert pool.pool == 'foo' assert pool.slots == 5 assert pool.description == '' assert session.query(Pool).count() == self.TOTAL_POOL_COUNT + 1 def test_create_pool_existing(self, session): self.add_pools() pool = Pool.create_or_update_pool(name=self.pools[0].pool, slots=5, description='') assert pool.pool == self.pools[0].pool assert pool.slots == 5 assert pool.description == '' assert session.query(Pool).count() == self.TOTAL_POOL_COUNT def test_delete_pool(self, session): self.add_pools() pool = Pool.delete_pool(name=self.pools[-1].pool) assert pool.pool == self.pools[-1].pool assert session.query(Pool).count() == self.TOTAL_POOL_COUNT - 1 def test_delete_pool_non_existing(self): with pytest.raises(PoolNotFound, match="^Pool 'test' doesn't exist$"): Pool.delete_pool(name='test') def test_delete_default_pool_not_allowed(self): with pytest.raises(AirflowException, match="^default_pool cannot be deleted$"): Pool.delete_pool(Pool.DEFAULT_POOL_NAME) def test_is_default_pool(self): pool = Pool.create_or_update_pool(name="not_default_pool", slots=1, description="test") default_pool = Pool.get_default_pool() assert not Pool.is_default_pool(id=pool.id) assert Pool.is_default_pool(str(default_pool.id))
{ "content_hash": "a92af14cc0c723483051b638df9dbf1a", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 100, "avg_line_length": 32.91981132075472, "alnum_prop": 0.5582461670726465, "repo_name": "cfei18/incubator-airflow", "id": "fecd76b7145e6121e9c32334c5833c4105edd2b9", "size": "7766", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/models/test_pool.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "25980" }, { "name": "Dockerfile", "bytes": "72003" }, { "name": "HCL", "bytes": "3786" }, { "name": "HTML", "bytes": "173434" }, { "name": "JavaScript", "bytes": "143068" }, { "name": "Jinja", "bytes": "38808" }, { "name": "Jupyter Notebook", "bytes": "5482" }, { "name": "Mako", "bytes": "1339" }, { "name": "Python", "bytes": "22660683" }, { "name": "R", "bytes": "313" }, { "name": "Shell", "bytes": "312715" }, { "name": "TypeScript", "bytes": "472379" } ], "symlink_target": "" }
<?php include('classes/cache.class.php'); include('classes/base.class.php'); /*! * Define the caching engine to be used. * Supports: apc, memcached, xcache, disk */ define('CACHE_ENGINE', 'apc'); /*! * Define the account details. * You can add multiple accounts, or just one. */ $accounts = array( array( 'email' => 'YOUREMAIL', 'password' => 'YOURPASSWORD', 'gamertag' => 'YOURGAMERTAG' ) ); /*! * Pick a random email to login */ $account = $accounts[0]; if (count($accounts) > 1) { $id = rand(0, (count($accounts) - 1)); $account = $accounts[$id]; } /*! * Define the account credentials */ define('XBOX_EMAIL', $account['email']); define('XBOX_PASSWORD', $account['password']); define('XBOX_GAMERTAG', $account['gamertag']); /*! * Define some log file locations. */ date_default_timezone_set('America/New_York'); define('COOKIE_FILE', 'includes/cookies/' . XBOX_EMAIL . '.jar'); define('DEBUG_FILE', 'includes/logs/debug.log'); define('STACK_TRACE_FILE', 'includes/logs/stack_trace.log'); /*! * Initiate the caching engine. */ $cache = new Cache(CACHE_ENGINE);
{ "content_hash": "ed5568e9b7a9035a46eb221d58855e0c", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 65, "avg_line_length": 22.78846153846154, "alnum_prop": 0.6, "repo_name": "gavinblair/xbox-achievements", "id": "04e63516952e7144ae3545a08bdce4e6a69782a0", "size": "2086", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "includes/bootloader.template.php", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "16984" }, { "name": "JavaScript", "bytes": "2693" }, { "name": "PHP", "bytes": "64296" }, { "name": "Perl", "bytes": "975" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!--Autogenerated by Cloudera Manager--> <configuration> <property> <name>dfs.namenode.name.dir</name> <value>file:///mnt/sdb1/dfs/nn</value> </property> <property> <name>dfs.namenode.servicerpc-address</name> <value>name-node1:8022</value> </property> <property> <name>dfs.https.address</name> <value>name-node1:50470</value> </property> <property> <name>dfs.https.port</name> <value>50470</value> </property> <property> <name>dfs.namenode.http-address</name> <value>name-node1:50070</value> </property> <property> <name>dfs.replication</name> <value>3</value> </property> <property> <name>dfs.blocksize</name> <value>134217728</value> </property> <property> <name>dfs.client.use.datanode.hostname</name> <value>false</value> </property> <property> <name>fs.permissions.umask-mode</name> <value>022</value> </property> <property> <name>dfs.namenode.acls.enabled</name> <value>false</value> </property> <property> <name>dfs.client.use.legacy.blockreader</name> <value>false</value> </property> <property> <name>dfs.client.read.shortcircuit</name> <value>false</value> </property> <property> <name>dfs.domain.socket.path</name> <value>/var/run/hdfs-sockets/dn</value> </property> <property> <name>dfs.client.read.shortcircuit.skip.checksum</name> <value>false</value> </property> <property> <name>dfs.client.domain.socket.data.traffic</name> <value>false</value> </property> <property> <name>dfs.datanode.hdfs-blocks-metadata.enabled</name> <value>true</value> </property> </configuration>
{ "content_hash": "21e2c3615b8e30579c0e66593b535faf", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 59, "avg_line_length": 24.942028985507246, "alnum_prop": 0.652527600232423, "repo_name": "tophua/spark1.52", "id": "487f04fd1f904531ead41fb4e93f7cf959e2ec8d", "size": "1721", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/src/main/resources/hdfs-site.xml", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "26914" }, { "name": "C", "bytes": "1493" }, { "name": "CSS", "bytes": "15314" }, { "name": "Dockerfile", "bytes": "4597" }, { "name": "HiveQL", "bytes": "2018996" }, { "name": "Java", "bytes": "1763581" }, { "name": "JavaScript", "bytes": "68648" }, { "name": "Makefile", "bytes": "7771" }, { "name": "Python", "bytes": "1552537" }, { "name": "R", "bytes": "452786" }, { "name": "Roff", "bytes": "23131" }, { "name": "SQLPL", "bytes": "3603" }, { "name": "Scala", "bytes": "16031983" }, { "name": "Shell", "bytes": "147300" }, { "name": "Thrift", "bytes": "2016" }, { "name": "q", "bytes": "154646" } ], "symlink_target": "" }
/* * Brandon Russeau */ public class MaxVal extends Thread { static int max; public MaxVal(int[] num) { max = maxVal(num); } public void run() { System.out.println("The maximum value is " + max); } // calculate the maximum value of a series of numbers private int maxVal(int[] num) { max = num[0]; for (int i = 1; i < num.length; i++) { if (max < num[i]) max = num[i]; } return max; } }
{ "content_hash": "ae30abe20745cbe0be85d3020e12ba37", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 54, "avg_line_length": 16.192307692307693, "alnum_prop": 0.5938242280285035, "repo_name": "brusseau25/Winter_2016", "id": "c9ae447c9ce52e470e18ef4e07a1d7cdb99d3e8c", "size": "421", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "StatsThreads/src/MaxVal.java", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "13939" }, { "name": "C++", "bytes": "1" }, { "name": "Java", "bytes": "74193" } ], "symlink_target": "" }
# Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render invalid all existing # confirmation, reset password and unlock tokens in the database. # Devise will use the `secret_key_base` as its `secret_key` # by default. You can change it below and use your own secret key. config.secret_key = "#{ENV['SECRET_KEY_BASE']}" if Rails.env == 'production' config.secret_key = "#{ENV['SECRET_KEY_BASE']}" if Rails.env == 'staging' # config.secret_key = '8767600a2c96dfd7a1dc9bf6727f79d3a7e4dbcd44e5d0cda05f0265a46d602b723cb3577211ec79d1babb8bcc62f8ad16c5dd5ca3af2b4b234050f522189d4d' # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use your own mailer class # with default "from" parameter. config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' # Configure the class responsible to send e-mails. # config.mailer = 'Devise::Mailer' # Configure the parent class responsible to send e-mails. # config.parent_mailer = 'ActionMailer::Base' # ==> ORM configuration # Load and configure the ORM. Supports :active_record (default) and # :mongoid (bson_ext recommended) by default. Other ORMs may be # available as additional gems. require 'devise/orm/active_record' # ==> Configuration for any authentication mechanism # Configure which keys are used when authenticating a user. The default is # just :email. You can configure it to use [:username, :subdomain], so for # authenticating a user, both parameters are required. Remember that those # parameters are used only when authenticating and not when retrieving from # session. If you need permissions, you should implement that in a before filter. # You can also supply a hash where the value is a boolean determining whether # or not authentication should be aborted when the value is not present. # config.authentication_keys = [:email] # Configure parameters from the request object used for authentication. Each entry # given should be a request method and it will automatically be passed to the # find_for_authentication method and considered in your model lookup. For instance, # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. # The same considerations mentioned for authentication_keys also apply to request_keys. # config.request_keys = [] # Configure which authentication keys should be case-insensitive. # These keys will be downcased upon creating or modifying a user and when used # to authenticate or find a user. Default is :email. config.case_insensitive_keys = [:email] # Configure which authentication keys should have whitespace stripped. # These keys will have whitespace before and after removed upon creating or # modifying a user and when used to authenticate or find a user. Default is :email. config.strip_whitespace_keys = [:email] # Tell if authentication through request.params is enabled. True by default. # It can be set to an array that will enable params authentication only for the # given strategies, for example, `config.params_authenticatable = [:database]` will # enable it only for database (email + password) authentication. # config.params_authenticatable = true # Tell if authentication through HTTP Auth is enabled. False by default. # It can be set to an array that will enable http authentication only for the # given strategies, for example, `config.http_authenticatable = [:database]` will # enable it only for database authentication. The supported strategies are: # :database = Support basic authentication with authentication key + password # config.http_authenticatable = false # If 401 status code should be returned for AJAX requests. True by default. # config.http_authenticatable_on_xhr = true # The realm used in Http Basic Authentication. 'Application' by default. # config.http_authentication_realm = 'Application' # It will change confirmation, password recovery and other workflows # to behave the same regardless if the e-mail provided was right or wrong. # Does not affect registerable. # config.paranoid = true # By default Devise will store the user in session. You can skip storage for # particular strategies by setting this option. # Notice that if you are skipping storage for all authentication paths, you # may want to disable generating routes to Devise's sessions controller by # passing skip: :sessions to `devise_for` in your config/routes.rb config.skip_session_storage = [:http_auth] # By default, Devise cleans up the CSRF token on authentication to # avoid CSRF token fixation attacks. This means that, when using AJAX # requests for sign in and sign up, you need to get a new CSRF token # from the server. You can disable this option at your own risk. # config.clean_up_csrf_token_on_authentication = true # When false, Devise will not attempt to reload routes on eager load. # This can reduce the time taken to boot the app but if your application # requires the Devise mappings to be loaded during boot time the application # won't boot properly. # config.reload_routes = true # ==> Configuration for :database_authenticatable # For bcrypt, this is the cost for hashing the password and defaults to 11. If # using other algorithms, it sets how many times you want the password to be hashed. # # Limiting the stretches to just one in testing will increase the performance of # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use # a value less than 10 in other environments. Note that, for bcrypt (the default # algorithm), the cost increases exponentially with the number of stretches (e.g. # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). config.stretches = Rails.env.test? ? 1 : 11 # Set up a pepper to generate the hashed password. # config.pepper = 'fcb99505f02020688227c18e06b4e79e1f16a82f1ee7518c218177382e165626cfece223849a74058948c387db82abe057d5391aca1857c2f5e4192465ad6d77' # Send a notification to the original email when the user's email is changed. # config.send_email_changed_notification = false # Send a notification email when the user's password is changed. # config.send_password_change_notification = false # ==> Configuration for :confirmable # A period that the user is allowed to access the website even without # confirming their account. For instance, if set to 2.days, the user will be # able to access the website for two days without confirming their account, # access will be blocked just in the third day. Default is 0.days, meaning # the user cannot access the website without confirming their account. # config.allow_unconfirmed_access_for = 2.days # A period that the user is allowed to confirm their account before their # token becomes invalid. For example, if set to 3.days, the user can confirm # their account within 3 days after the mail was sent, but on the fourth day # their account can't be confirmed with the token any more. # Default is nil, meaning there is no restriction on how long a user can take # before confirming their account. # config.confirm_within = 3.days # If true, requires any email changes to be confirmed (exactly the same way as # initial account confirmation) to be applied. Requires additional unconfirmed_email # db field (see migrations). Until confirmed, new email is stored in # unconfirmed_email column, and copied to email column on successful confirmation. config.reconfirmable = true # Defines which key will be used when confirming an account # config.confirmation_keys = [:email] # ==> Configuration for :rememberable # The time the user will be remembered without asking for credentials again. # config.remember_for = 2.weeks # Invalidates all the remember me tokens when the user signs out. config.expire_all_remember_me_on_sign_out = true # If true, extends the user's remember period when remembered via cookie. # config.extend_remember_period = false # Options to be passed to the created cookie. For instance, you can set # secure: true in order to force SSL only cookies. # config.rememberable_options = {} # ==> Configuration for :validatable # Range for password length. config.password_length = 6..128 # Email regex used to validate email formats. It simply asserts that # one (and only one) @ exists in the given string. This is mainly # to give user feedback and not to assert the e-mail validity. config.email_regexp = /\A[^@\s]+@[^@\s]+\z/ # ==> Configuration for :timeoutable # The time you want to timeout the user session without activity. After this # time the user will be asked for credentials again. Default is 30 minutes. # config.timeout_in = 30.minutes # ==> Configuration for :lockable # Defines which strategy will be used to lock an account. # :failed_attempts = Locks an account after a number of failed attempts to sign in. # :none = No lock strategy. You should handle locking by yourself. # config.lock_strategy = :failed_attempts # Defines which key will be used when locking and unlocking an account # config.unlock_keys = [:email] # Defines which strategy will be used to unlock an account. # :email = Sends an unlock link to the user email # :time = Re-enables login after a certain amount of time (see :unlock_in below) # :both = Enables both strategies # :none = No unlock strategy. You should handle unlocking by yourself. # config.unlock_strategy = :both # Number of authentication tries before locking an account if lock_strategy # is failed attempts. # config.maximum_attempts = 20 # Time interval to unlock the account if :time is enabled as unlock_strategy. # config.unlock_in = 1.hour # Warn on the last attempt before the account is locked. # config.last_attempt_warning = true # ==> Configuration for :recoverable # # Defines which key will be used when recovering the password for an account # config.reset_password_keys = [:email] # Time interval you can reset your password with a reset password key. # Don't put a too small interval or your users won't have the time to # change their passwords. config.reset_password_within = 6.hours # When set to false, does not sign a user in automatically after their password is # reset. Defaults to true, so a user is signed in automatically after a reset. # config.sign_in_after_reset_password = true # ==> Configuration for :encryptable # Allow you to use another hashing or encryption algorithm besides bcrypt (default). # You can use :sha1, :sha512 or algorithms from others authentication tools as # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20 # for default behavior) and :restful_authentication_sha1 (then you should set # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper). # # Require the `devise-encryptable` gem when using anything other than bcrypt # config.encryptor = :sha512 # ==> Scopes configuration # Turn scoped views on. Before rendering "sessions/new", it will first check for # "users/sessions/new". It's turned off by default because it's slower if you # are using only default views. config.scoped_views = true # Configure the default scope given to Warden. By default it's the first # devise role declared in your routes (usually :user). # config.default_scope = :user # Set this configuration to false if you want /users/sign_out to sign out # only the current scope. By default, Devise signs out all scopes. # config.sign_out_all_scopes = true # ==> Navigation configuration # Lists the formats that should be treated as navigational. Formats like # :html, should redirect to the sign in page when the user does not have # access, but formats like :xml or :json, should return 401. # # If you have any extra navigational formats, like :iphone or :mobile, you # should add them to the navigational formats lists. # # The "*/*" below is required to match Internet Explorer requests. # config.navigational_formats = ['*/*', :html] # The default HTTP method used to sign out a resource. Default is :delete. config.sign_out_via = :delete # ==> OmniAuth # Add a new OmniAuth provider. Check the wiki for more information on setting # up on your models and hooks. # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' # ==> Warden configuration # If you want to use other strategies, that are not supported by Devise, or # change the failure app, you can configure them inside the config.warden block. # # config.warden do |manager| # manager.intercept_401 = false # manager.default_strategies(scope: :user).unshift :some_external_strategy # end # ==> Mountable engine configurations # When using Devise inside an engine, let's call it `MyEngine`, and this engine # is mountable, there are some extra configurations to be taken into account. # The following options are available, assuming the engine is mounted as: # # mount MyEngine, at: '/my_engine' # # The router that invoked `devise_for`, in the example above, would be: # config.router_name = :my_engine # # When using OmniAuth, Devise cannot automatically set OmniAuth path, # so you need to do it manually. For the users scope, it would be: # config.omniauth_path_prefix = '/my_engine/users/auth' end
{ "content_hash": "48550db46195576fd31376b71bcbb9d9", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 154, "avg_line_length": 49.44086021505376, "alnum_prop": 0.7417717848339858, "repo_name": "Nerdman4U/sude", "id": "461788d4e427467d0bad67e087ea27fead54fdae", "size": "13794", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/initializers/devise.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "56034" }, { "name": "CoffeeScript", "bytes": "1792" }, { "name": "HTML", "bytes": "53546" }, { "name": "JavaScript", "bytes": "29960" }, { "name": "Ruby", "bytes": "193807" } ], "symlink_target": "" }
! { dg-do compile } ! { dg-options "-fgnu-tm" } ! { dg-require-effective-target fgnu_tm } program foo real x end program foo
{ "content_hash": "feae5c6b3876f53ada61b3aa3da68e31", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 41, "avg_line_length": 21.833333333333332, "alnum_prop": 0.6412213740458015, "repo_name": "the-linix-project/linix-kernel-source", "id": "f02dfaf352394e43320dfeec4d35e9ee096cbe5f", "size": "131", "binary": false, "copies": "163", "ref": "refs/heads/master", "path": "gccsrc/gcc-4.7.2/gcc/testsuite/gfortran.dg/trans-mem-skel.f90", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ada", "bytes": "38139979" }, { "name": "Assembly", "bytes": "3723477" }, { "name": "Awk", "bytes": "83739" }, { "name": "C", "bytes": "103607293" }, { "name": "C#", "bytes": "55726" }, { "name": "C++", "bytes": "38577421" }, { "name": "CLIPS", "bytes": "6933" }, { "name": "CSS", "bytes": "32588" }, { "name": "Emacs Lisp", "bytes": "13451" }, { "name": "FORTRAN", "bytes": "4294984" }, { "name": "GAP", "bytes": "13089" }, { "name": "Go", "bytes": "11277335" }, { "name": "Haskell", "bytes": "2415" }, { "name": "Java", "bytes": "45298678" }, { "name": "JavaScript", "bytes": "6265" }, { "name": "Matlab", "bytes": "56" }, { "name": "OCaml", "bytes": "148372" }, { "name": "Objective-C", "bytes": "995127" }, { "name": "Objective-C++", "bytes": "436045" }, { "name": "PHP", "bytes": "12361" }, { "name": "Pascal", "bytes": "40318" }, { "name": "Perl", "bytes": "358808" }, { "name": "Python", "bytes": "60178" }, { "name": "SAS", "bytes": "1711" }, { "name": "Scilab", "bytes": "258457" }, { "name": "Shell", "bytes": "2610907" }, { "name": "Tcl", "bytes": "17983" }, { "name": "TeX", "bytes": "1455571" }, { "name": "XSLT", "bytes": "156419" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en" class="no-js"> <head> <meta charset="UTF-8"> <title>Section Object</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <!-- build:css css/ui.css --> <link rel="stylesheet" href="css/main.css"> <!-- endbuild --> <style> /* styles for this page only */ </style> <script src="https://code.jquery.com/jquery-2.2.3.min.js" integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=" crossorigin="anonymous"></script> </head> <body> <div class="ui-library-header"> <h1><a href="index.html">Dash UI Library</a></h1> <h2>Section Object</h2> </div> <!--#include file="includes/section.html" --> <!-- build:js js/ui.js --> <script src="js/modernizr-custombuild.js"></script> <script src="js/main.js"></script> <!-- endbuild --> </body> </html>
{ "content_hash": "a1dce452c2169beb5215c6eb58b54a02", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 90, "avg_line_length": 26.333333333333332, "alnum_prop": 0.6363636363636364, "repo_name": "cdlib/dash-ui", "id": "76bcf8aa1223eb553e6b9ae7257e6e1d18fb0d1d", "size": "869", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "app/object_section.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "56304" }, { "name": "HTML", "bytes": "131279" }, { "name": "JavaScript", "bytes": "30241" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Copyright (c) 2010-2013 Evolveum ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public"> <public publicId="http://prism.evolveum.com/xml/ns/public/annotation-3" uri="../../../target/midpoint-schema/xml/ns/public/annotation-3.xsd" /> <system systemId="http://prism.evolveum.com/xml/ns/public/annotation-3" uri="../../../target/midpoint-schema/xml/ns/public/annotation-3.xsd" /> <public publicId="http://prism.evolveum.com/xml/ns/public/types-3" uri="../../../target/midpoint-schema/xml/ns/public/types-3.xsd" /> <system systemId="http://prism.evolveum.com/xml/ns/public/types-3" uri="../../../target/midpoint-schema/xml/ns/public/types-3.xsd" /> <public publicId="http://prism.evolveum.com/xml/ns/public/query-3" uri="../../../target/midpoint-schema/xml/ns/public/query-3.xsd" /> <system systemId="http://prism.evolveum.com/xml/ns/public/query-3" uri="../../../target/midpoint-schema/xml/ns/public/query-3.xsd" /> <public publicId="http://midpoint.evolveum.com/xml/ns/public/common/common-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-3.xsd" /> <system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-3.xsd" /> <public publicId="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" uri="../../../target/midpoint-schema/xml/ns/public/connector/icf-1/resource-schema-3.xsd" /> <system systemId="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" uri="../../../target/midpoint-schema/xml/ns/public/connector/icf-1/resource-schema-3.xsd" /> <public publicId="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3" uri="../../../target/midpoint-schema/xml/ns/public/connector/icf-1/connector-schema-3.xsd" /> <system systemId="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3" uri="../../../target/midpoint-schema/xml/ns/public/connector/icf-1/connector-schema-3.xsd" /> <public publicId="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3" uri="../../../target/midpoint-schema/xml/ns/public/resource/capabilities-3.xsd" /> <system systemId="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3" uri="../../../target/midpoint-schema/xml/ns/public/resource/capabilities-3.xsd" /> <public publicId="http://midpoint.evolveum.com/xml/ns/public/model/import/extension-3" uri="../../../target/midpoint-schema/xml/ns/public/model/import/extension-3.xsd" /> <system systemId="http://midpoint.evolveum.com/xml/ns/public/model/import/extension-3" uri="../../../target/midpoint-schema/xml/ns/public/model/import/extension-3.xsd" /> <public publicId="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3" uri="../xml/ns/public/model/scripting/scripting-3.xsd" /> <system systemId="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3" uri="../xml/ns/public/model/scripting/scripting-3.xsd" /> <public publicId="http://midpoint.evolveum.com/xml/ns/public/model/scripting/extension-3" uri="../xml/ns/public/model/scripting/extension-3.xsd" /> <system systemId="http://midpoint.evolveum.com/xml/ns/public/model/scripting/extension-3" uri="../xml/ns/public/model/scripting/extension-3.xsd" /> <!-- <public publicId="http://midpoint.evolveum.com/xml/ns/public/model/workflow-1.xsd" uri="../../../target/midpoint-schema/xml/ns/public/model/workflow-1.xsd" /> <system systemId="http://midpoint.evolveum.com/xml/ns/public/model/workflow-1.xsd" uri="../../../target/midpoint-schema/xml/ns/public/model/workflow-1.xsd" /> --> <!-- Model WSDL location --> <public publicId="http://midpoint.evolveum.com/xml/ns/public/model/model-3" uri="../../../target/midpoint-schema/xml/ns/public/model/model-3.wsdl" /> <system systemId="http://midpoint.evolveum.com/xml/ns/public/model/model-3" uri="../../../target/midpoint-schema/xml/ns/public/model/model-3.wsdl" /> <public publicId="http://midpoint.evolveum.com/xml/ns/public/common/fault-3.xsd" uri="../../../target/midpoint-schema/xml/ns/public/common/fault-3.xsd" /> <system systemId="http://midpoint.evolveum.com/xml/ns/public/common/fault-3.xsd" uri="../../../target/midpoint-schema/xml/ns/public/common/fault-3.xsd" /> <!-- Bundled standard schemas --> <public publicId="datatypes" uri="../../../target/midpoint-schema/xml/ns/standard/datatypes.dtd" /> <system systemId="datatypes" uri="../../../target/midpoint-schema/xml/ns/standard/datatypes.dtd" /> <public publicId="-//W3C//DTD XMLSchema 200102//EN" uri="../../../target/midpoint-schema/xml/ns/standard/XMLSchema.dtd" /> <public publicId="-//W3C//DTD XMLSCHEMA 200102//EN" uri="../../../target/midpoint-schema/xml/ns/standard/XMLSchema.dtd" /> <system systemId="-//W3C//DTD XMLSCHEMA 200102//EN" uri="../../../target/midpoint-schema/xml/ns/standard/XMLSchema.dtd" /> <public publicId="XMLSchema.dtd" uri="../../../target/midpoint-schema/xml/ns/standard/XMLSchema.dtd" /> <system systemId="XMLSchema.dtd" uri="../../../target/midpoint-schema/xml/ns/standard/XMLSchema.dtd" /> <public publicId="http://www.w3.org/2001/04/xmlenc#" uri="../../../target/midpoint-schema/xml/ns/standard/xenc-schema.xsd" /> <system systemId="http://www.w3.org/2001/04/xmlenc#" uri="../../../target/midpoint-schema/xml/ns/standard/xenc-schema.xsd" /> <public publicId="http://www.w3.org/2001/XMLSchema" uri="../../../target/midpoint-schema/xml/ns/standard/XMLSchema.xsd" /> <system systemId="http://www.w3.org/2001/XMLSchema" uri="../../../target/midpoint-schema/xml/ns/standard/XMLSchema.xsd" /> <public publicId="http://www.w3.org/XML/1998/namespace" uri="../../../target/midpoint-schema/xml/ns/standard/xml.xsd" /> <system systemId="http://www.w3.org/XML/1998/namespace" uri="../../../target/midpoint-schema/xml/ns/standard/xml.xsd" /> <public publicId="http://www.w3.org/2000/09/xmldsig#" uri="../../../target/midpoint-schema/xml/ns/standard/xmldsig-core-schema.xsd" /> <system systemId="http://www.w3.org/2000/09/xmldsig#" uri="../../../target/midpoint-schema/xml/ns/standard/xmldsig-core-schema.xsd" /> </catalog>
{ "content_hash": "5fbcd21e5c412606df7fcd4d1982d65e", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 194, "avg_line_length": 80.87058823529412, "alnum_prop": 0.6998836194355542, "repo_name": "sabriarabacioglu/engerek", "id": "31a6f624dff0afdd5950262ec0432d4f2ca2ded2", "size": "6874", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "model/model-client/src/compile/resources/catalog.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "374009" }, { "name": "Groovy", "bytes": "10361" }, { "name": "Java", "bytes": "14663183" }, { "name": "JavaScript", "bytes": "71684" }, { "name": "Shell", "bytes": "3606" } ], "symlink_target": "" }
<?php require_once 'model/ArticleManager.php'; class Article { private $id; private $title; private $chapo; private $content; private $author; private $created; private $updated; public function __construct($datas = []) { if (!empty($datas)) { $this->hydrate($datas); } } public function hydrate($datas) { foreach ($datas as $key => $value) { $method = 'set'.ucfirst($key); if (is_callable([$this, $method])) { $this->$method($value); } } } // Getters and Setters public function getId() { return $this->id; } public function setId($id) { $this->id = $id; } public function getTitle() { return $this->title; } public function setTitle($title) { $this->title = $title; } public function getChapo() { return $this->chapo; } public function setChapo($chapo) { $this->chapo = $chapo; } public function getContent() { return $this->content; } public function setContent($content) { $this->content = $content; } public function getAuthor() { return $this->author; } public function setAuthor($author) { $this->author = $author; } public function getCreated() { return $this->created; } public function setCreated($created) { $this->created = $created; } public function getUpdated() { return $this->updated; } public function setUpdated($updated) { $this->updated = $updated; } }
{ "content_hash": "75abfefd1bad113d9edbc604bd063b05", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 46, "avg_line_length": 16.87962962962963, "alnum_prop": 0.4843664289632474, "repo_name": "Maxxxiimus92/p5_blog", "id": "f3ab904007dbf5c519656ab83ed4a9e72e908a60", "size": "1823", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "model/Article.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "20491" }, { "name": "JavaScript", "bytes": "44559" }, { "name": "PHP", "bytes": "28331" } ], "symlink_target": "" }
module Onboarding class ClusteringController < BaseController before_action only: [:new, :create] do redirect_if_event(:onboarding_user_created, new_onboarding_school_details_path(@school_onboarding)) end def new end def create @school_onboarding.update!(created_user: current_user) @school_onboarding.events.create!(event: :onboarding_user_created) redirect_to new_onboarding_school_details_path(@school_onboarding) end end end
{ "content_hash": "1d9ea63c509d22ba93059cc69ba02084", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 105, "avg_line_length": 30.1875, "alnum_prop": 0.7204968944099379, "repo_name": "BathHacked/energy-sparks", "id": "e90a3b9fecc9a548f7c37603baef2298b45450f0", "size": "483", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/onboarding/clustering_controller.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "34655" }, { "name": "HTML", "bytes": "498265" }, { "name": "JavaScript", "bytes": "44848" }, { "name": "Ruby", "bytes": "1317164" }, { "name": "Shell", "bytes": "2432" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Users Database</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <link rel="stylesheet" href="https:////netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <script> function addNewUser() { $.ajax('./create', { method: 'post', data: {name: $('#name').val(), login: $('#login').val(), email: $('#email').val(), password: $('#password').val(), role: $('#role').val(), country: $('#country').val(), town: $('#town').val()} }); location.href = "index.html"; return false; } </script> <body> <div class="container"> <h2 style="padding-bottom: 30px">Create new user</h2> <div class="row"> <div class="col-md-6"> Name: <input type="text" class="form-control" id="name" placeholder="Enter name"> Login: <input type="text" class="form-control" id="login" placeholder="Enter login"> Email: <input type="email" class="form-control" id="email" placeholder="Enter email"> Password: <input type="password" class="form-control" id="password" placeholder="Enter password"> Role: <input type="text" class="form-control" id="role" placeholder="Enter role admin or user"> Country: <input type="text" class="form-control" id="country" placeholder="Enter country"> Town; <input type="text" class="form-control" id="town" placeholder="Enter town"> </div> </div> <br/> <button type="submit" class="btn btn-success" onclick="return addNewUser();">Add new user</button> </div> </body> </html>
{ "content_hash": "0ac1be7839f9106fe80ce0591d645a5a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 126, "avg_line_length": 48.175, "alnum_prop": 0.610275038920602, "repo_name": "1Evgeny/java-a-to-z", "id": "abcac2f96d45452d8e0f5e5042bd00392db7ec4b", "size": "1927", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chapter_004/jscript/src/main/webapp/create.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "16294" }, { "name": "Java", "bytes": "697413" }, { "name": "JavaScript", "bytes": "9341" }, { "name": "TSQL", "bytes": "11619" }, { "name": "XSLT", "bytes": "595" } ], "symlink_target": "" }
0. [Unpacking your DC2](#0-unpacking-your-dc2) 1. [Power up your DC2](#1-power-up-your-dc2) 2. [Find the DC2 on your network](#2-find-the-dc2-on-your-network) 3. [Configure the DC2](#3-configure-the-dc2) 4. [Add the DC2 as a docker machine](#4-setup-dc2-as-a-docker-machine) 5. [Assemble the DC2](#5-dc2-assembly) 6. [FAQ](#6-faq) ## 0. Unpacking your DC2 - The first time you open the container doors, be really careful. The container is a model and was not designed to be an enclosure. If a hinge breaks, you can set it aside. If you have success gluing your hing back on, please share. - We booted all of the MinnowBoard Turbots to make sure they would cleanly boot. See the FAQ below if your MinnowBoard does not boot up. ## 1. Power up your DC2 1. Let's make sure your MinnowBoard boots up and get it all setup while we can easily see the lights etc. before putting it in the container. If you have more than one DC2, let's set them up separately. 2. Set your MinnowBoard on the pink foam to protect it from shorting out. 3. Connect your USB drive to the MinnowBoard. Plug it into the USB socket that is blue. 4. Connect your MinnowBoard with an ethernet cable to the same network your PC that you will use to setup the DC2 is connected to. 5. OPTIONALLY connect your MinnowBoard to a display with a micro HDMI connector. 6. The last connection will be connecting your MinnowBoard to power. 7. You should see the USB drive light flicker. If you have an display connected, you should see the the boot sequence scroll across. ![test setup](./images/test_setup.jpg) ## 2. Find the DC2 on your network 1. Make sure you have Bonjour / mDNS. When you connect your DC2 to your network, it will be using DHCP to get an IP address. To work with the DC2 from other machines, we will need to find out where it is. The DC2 will default to having the '''dc2.local''' hostname which will be broadcast with mDNS aka Bonjour. If you have a Mac or Windows 10 machine, you are good to go. If you have an earlier version of Windows, you will need to install [Bonjour Services](https://support.apple.com/kb/DL999?viewlocale=en_US&locale=en_US), If you are on a linux box, you can install [Avahi](https://wiki.archlinux.org/index.php/Avahi). 2. If you have more than one DC2, then set them up one at a time so you can change the host names to differentiate between them. 3. Check you can connect to your DC2. Open up [http://DC2.local:8765](http://DC2.local:8765) with your browser -- this should return the configuration information from your DC2. It can take 40 seconds for the DC2 to boot, and 30 seconds for the dc2-node script to run and Bonjour to have completed its broadcast so that loading the web page to work. You should see something like this: ```json { "latestVersion": "1.0.4", "version": "1.0.4", "hostname": "dc2", "ip": "a.b.c.d", "MAC": "ff:ff:ff:ff:ff:ff", "callHomeResponse": 200 } ``` Where `a.b.c.d` is the IP address of your DC2 and `ff:ff:ff:ff:ff:ff` is the MAC address of your DC2 ethernet port. ## 3. Configure the DC2 1. Check that you can SSH into your DC2. - `username`: `jack` is the preconfigured username - `password`: `hardtware` is the preconfigured password ```shell ssh jack@dc2.local ``` 2. Change your password ```shell passwd ``` Enter `hardtware` for the old password, and then enter your new password. 3. If you don't have an ssh key, on *another* machine run the following: ```shell ssh-keygen -b 4096 -f ~/.ssh/id_rsa.dc2 ``` You will be prompted to create a passphrase, create one and enter it in twice as prompted. 4. Copy your SSH public key to your DC2. First `exit` your SSH session with your DC2. If your SSH public key is at `~/.ssh/id_rsa.pub` (if created above, use `~/.ssh/id_rsa.dc2`) then from your machine: ```shell ssh jack@dc2.local "cat >> .ssh/authorized_keys" < ~/.ssh/id_rsa.pub ``` Enter your new password when prompted. You should now be able to `ssh jack@dc2.local` and not be prompted for a password. 5. If you are not in the `America/Los Angeles` timezone you can change it with: ```shell sudo dpkg-reconfigure tzdata ``` 6. If you want to change the locale, follow directions at [https://help.ubuntu.com/community/Locale](https://help.ubuntu.com/community/Locale). 7. If you have more than one DC2, change your hostname by replacing `dc2` to a new hostname unique on your network (eg. dc2a, dc2b, dc2c) in the `/etc/hostname` and `/etc/hosts` files. For example, if you wanted to change the hostname to `dc2a`, you would run: ```shell sudo echo dc2a /etc/hostname sudo sed -i 's/dc2/dc2a/1' /etc/hosts ``` Then restart `hostname` and `avahi` services with: ```shell sudo service hostname restart sudo /etc/init.d/avahi-daemon restart ``` > NOTE: Everwhere you see `dc2` below, change that to the new hostname you have given your DC2. 8. OPTIONALLY change the username from `jack` to something else. This requires a few more commands and should be considered a bit more advnaced of a topic. In our example we will change the username to `bob` and remove `jack` entirely. For this example, start my being logged in as `jack`. Create the new user: ```shell sudo useradd -m bob ``` Set a `sudo` password for the user: ```shell sudo passwd bob ``` Create the `ssh` directory for the user: ```shell sudo mkdir /home/bob/.ssh sudo chown bob:bob /home/bob/.ssh sudo chmod 700 /home/bob/.ssh ``` If you created and copied over a ssh key for jack, let's copy it over to bob. ```shell sudo cp /home/jack/.ssh/authorized_keys /home/bob/.ssh/authorized_keys sudo chown bob:bob /home/bob/.ssh/authorized_keys ``` The last item is to add `bob` to all of the appropriate groups that `jack` is a member of: ```shell sudo usermod -a -G adm bob sudo usermod -a -G cdrom bob sudo usermod -a -G sudo bob sudo usermod -a -G dip bob sudo usermod -a -G plugdev bob sudo usermod -a -G lpadmin bob sudo usermod -a -G dc2 bob sudo usermod -a -G sambashare bob ``` In a new terminal window, try to SSH now as bob using pubkey auth: ```shell ssh -o IdentityFile=~/.ssh/id_rsa bob@dc2.local ``` > NOTE: You will need to change `~/.ssh/id_rsa` to your respective key path from above and `dc2.local` to whatever you changed your hostname to above as well. If you are able to SSH in at this point you have correctly created another user and setup their SSH key correctly. As the final step, you may remove the `jack` user from the device. ```shell sudo userdel -r jack ``` 9. OPTIONALLY disable password authentication and only allow pubkey authentication. This is recommended for most users but is considered optional because it is more advanced. Bring up `/etc/ssh/sshd_config` in your favorite editor and uncomment the line that has `PasswordAuthentication`. Change the value to `no` if it is not set as such. Once completed, run: ```shell sudo service ssh restart ``` 10. OPTIONALLY update your packages. Run: ```shell sudo apt-get update sudo apt-get upgrade ``` You may need to enter `y` to approve the updates. ## 4. Setup DC2 as a Docker Machine 1. Make sure you have the [Docker Toolbox](https://www.docker.com/products/docker-toolbox) intalled on your computer. 2. Find the IP address of your DC2: ```shell ping dc2.local ``` Substitute `a.b.c.d` in the following commands with your DC2's IP address 3. Check that you can use SSH against your IP address: ```shell ssh dc2@a.b.c.d ``` If you had previously used SSH against that IP address, your will likely get an error and you will need to update your `known_hosts` file. 4. Add your SSH key to your agent. ```shell ssh-add ~/.ssh/id_rsa ``` You will be prompted for your SSH key passphrase. You may need to change `~/.ssh/id_rsa` to the path of your key that you created. 5. OPTIONALLY create a separate user to run `docker`. This is a security measure. On the DC2, create a user and password for the user: ```shell sudo useradd -m dockeradmin sudo passwd dockeradmin sudo mkdir /home/dockeradmin/.ssh sudo chown dockeradmin:dockeradmin /home/dockeradmin/.ssh sudo chmod 700 /home/dockeradmin/.ssh ``` Back on your machine, create a SSH key and copy it to the DC2. Make sure *not* to enter a passphrase for this user, unlike your SSH key pair which most certainly should have a passphrase. ```shell ssh-keygen -b 4096 -f ~/.ssh/id_rsa.dc2.docker ``` With your favorite editor, create `/home/dockeradmin/.ssh/authrorized_keys` to contain the public half of the keypair (`~/.ssh/id_rsa.dc2.docker.pub`). And make sure to set the proper permissions: ```shell sudo chown dockeradmin:dockeradmin /home/dockeradmin/.ssh/authorized_keys sudo chmod 600 /home/dockeradmin/.ssh/authorized_keys ``` Give the ability to this user full `sudo` access: ```shell sudo visudo ``` Copy/paste the following towards the bottom after the `%sudo` definition: ```shell # Docker dockeradmin ALL=(ALL) NOPASSWD: ALL ``` If everything was done perfectly, you should now be able to SSH as this user to the DC2. ```shell ssh -o IdentityFile=~/.ssh/id_rsa.dc2.docker dockeradmin@a.b.c.d ``` 6. Setup the DC2 as a generic machine: ```shell docker-machine create --driver generic --generic-ssh-user=jack --generic-ip-address=a.b.c.d dc2 ``` You may need to change the username if you created a separate one above. This command takes a while as it will be updating the DC2. It will create add your DC2 as a machine to run containers in. Sometimes `docker-machine` emits an error about certs. An example successful command and output might look like the following (with a couple more options): ```shell docker-machine create --driver generic --generic-ssh-user dockeradmin --generic-ssh-key ~/.ssh/id_rsa.dc2.docker --generic-ip-address 10.1.12.2 --generic-ssh-port 22 dc2 ``` ``` Running pre-create checks... Creating machine... (dc2) Importing SSH key... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with ubuntu(upstart)... Installing Docker... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Checking connection to Docker... Docker is up and running! To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env dc2 ``` 7. Check the status of your DC2 docker machine: ```shell docker-machine status dc2 ``` It should state `Running` at this point. 8. Setup the DC2 as your docker machine: To view the environment for your docker machine: ```shell docker-machine env dc2 ``` It should output several lines. For assistance with this or any `docker` command you can always run `docker-machine help <command>`. Where command can be `env` or any other `docker-machine` command. 9. Run the hello-world container: First, you need to setup your local environment by running the above `env` command. The output of that command at the end should have something like: ```shell # Run this command to configure your shell: # eval $(docker-machine env dc2) ``` Run the `eval ...` command. After that, run: ```shell docker run hello-world ``` You should see "Hello from Docker" along with various other output. You now have a functining Desktop Computer Container! 10. Shutting down your DC2. Make sure you properly shutdown your DC2 so that the file system does not get corrupted. If it does, you will need to connect a monitor and keyboard to fix the errors on boot. ```shell ssh jack@dc2.local sudo shutdown -h now ``` Success! Disconnect power, ethernet and HDMI (if connected) and finish assembly. ## 5. DC2 Assembly 1. Connect the MinnowBoard Turbot to the faceplate. 1. Get a #1 (or #2 if need be) philips head screwdriver and screw the 2 M3 philips screws each in a few turns. You want the screws to go in from the left side if you are looking at the front of the faceplate. We are doing this to loosen the threads as the faceplate threads are 3D printed. ![mounting screws](./images/mounting_screws.jpg) 2. Take out the screws, set the MinnowBoard Turbot on the faceplate, and screw the screws back in. Tighten enough that the MinnowBoard Turbot does not wobble around on the faceplate. If you have ordered a SilverJaw Lure, you can first mount it to the MinnowBoard Turbot placing the spacers between the two boards, then screw the screws into the faceplate, and then screw the screws into the standoff at the other end of the boards. ![mounting screws](./images/base_assembly.jpg) With SilverJaw ![mounting screws](./images/Silverjaw_Assembly.jpg) 2. Connnect the USB drive to the MinnowBoard if it is not connected. 3. If you have an OLED you need to connect it before installing the MinnowBoard Turbot into the container. 1. Just as we did with the screws for mounting the MinnowBoard, we need to clean out the threads for the OLED mount. Screw the M1.6 screws into the OLED mounting locations with the supplied allen wrench, and then take them back out. ![mounting screws](./images/OLED_screws.jpg) 2. Insert the memory card into the OLED. This image also shows how the cable will be connected. ![mounting screws](./images/OLED_assembly.jpg) 3. Mount the OLED with the 4 M1.6 hex head screws. ![mounting screws](./images/OLED_mounting.jpg) 4. Connect the cable from the USB 2.0 connector to the OLED. Make sure you connect per the image and then coil the cable as indicated. You can use the twist tie from the power supply to hold the OLED cable. ![mounting screws](./images/OLED_connection.jpg) Full Assembly ![mounting screws](./images/full_assembly.jpg) 5. NOTE: we are still working on software to drive the OLED. 4. Slide the assembled MinnoBoard and faceplate into the container. It should click a little when fully installed. 6. Reconnect ethernet and power and enjoy your DC2! ## 6. FAQ 1. **Question**: Something is not working? **Answer**: Check the FAQ below. If not answered, file an issue at https://github.com/hardtware/DC2/issues 2. **Question**: What is the CR1225 battery for? **Answer**: It is a spare battery. Your MinnowBoard Turbot should have a CR1225 battery in it already. 3. **Question**: I see `WRITE SAME failed. Manually zeroing.` on boot. What is happening? **Answer**: You don't need to worry about this and can ignore it. If you would like to make this message go away since it is unrelated to this hardware (it has to do with SCSI driver which is irrelevant for us), you can! Copy the following script to `/usr/local/sbin/disable-write-same`: ```shell #! /bin/sh # Disable SCSI WRITE_SAME, which is not supported by underlying disk # emulation. Run on boot from, eg, /etc/rc.local # # See http://www.it3.be/2013/10/16/write-same-failed/ # # Written by Ewen McNeill <ewen@naos.co.nz>, 2014-07-17 #--------------------------------------------------------------------------- find /sys/devices -name max_write_same_blocks | while read DISK; do echo 0 >"${DISK}" done ``` And then add a call on boot to this script before the `exit` in `/etc/rc.local`. On reboot you should no longer see this message. Source [link](http://ewen.mcneill.gen.nz/blog/entry/2014-07-17-mininet-on-ubuntu-14.04-in-kvm/). 4. **Question**: The machine did not boot. What happened? **Answer**: Sometimes something gets out of sync somewhere with the onboard memory and the drive and Ubuntu thinks something is corrupted and you have to tell it to continue. If you have a display attached you can see it. You can just hit `i` to ignore and everything will be fine. You might need to hit `i` a few times. If you don't have a monitor, try connecting a USB keyboard and hit `i` a few times. If you see the drive light flash, you should be booting. 5. **Question**: How do I remove the faceplate once I have assmebled it? **Answer**: To take out the faceplate and the board, put your fingers in the large hex holes, push the faceplate down towards the bottom of the container as the top of the faceplate hooks to the top inside of the container, then wiggle and pull to get it out. 6. **Question**: How can I stack up my containers? **Answer**: [remonlam](https://github.com/remonlam) has created an STL you can 3D print to stack up your containers [here](./stacker.md)
{ "content_hash": "c8b7dcddd7ad81ca1c9e3ed35227fd02", "timestamp": "", "source": "github", "line_count": 455, "max_line_length": 588, "avg_line_length": 38.032967032967036, "alnum_prop": 0.6963305403062698, "repo_name": "hardtware/DC2", "id": "0d1aef8aff83ab385c453d96ddaf6216751a6348", "size": "17318", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_91) on Tue Dec 29 12:44:11 AEDT 2015 --> <title>SigPolicyQualifiers (Bouncy Castle Library 1.54 API Specification)</title> <meta name="date" content="2015-12-29"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="SigPolicyQualifiers (Bouncy Castle Library 1.54 API Specification)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><b>Bouncy Castle Cryptography Library 1.54</b></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifierInfo.html" title="class in org.bouncycastle.asn1.esf"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/bouncycastle/asn1/esf/SPuri.html" title="class in org.bouncycastle.asn1.esf"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/bouncycastle/asn1/esf/SigPolicyQualifiers.html" target="_top">Frames</a></li> <li><a href="SigPolicyQualifiers.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.bouncycastle.asn1.esf</div> <h2 title="Class SigPolicyQualifiers" class="title">Class SigPolicyQualifiers</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li><a href="../../../../org/bouncycastle/asn1/ASN1Object.html" title="class in org.bouncycastle.asn1">org.bouncycastle.asn1.ASN1Object</a></li> <li> <ul class="inheritance"> <li>org.bouncycastle.asn1.esf.SigPolicyQualifiers</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../../org/bouncycastle/asn1/ASN1Encodable.html" title="interface in org.bouncycastle.asn1">ASN1Encodable</a>, <a href="../../../../org/bouncycastle/util/Encodable.html" title="interface in org.bouncycastle.util">Encodable</a></dd> </dl> <hr> <br> <pre>public class <span class="strong">SigPolicyQualifiers</span> extends <a href="../../../../org/bouncycastle/asn1/ASN1Object.html" title="class in org.bouncycastle.asn1">ASN1Object</a></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifiers.html#SigPolicyQualifiers(org.bouncycastle.asn1.esf.SigPolicyQualifierInfo[])">SigPolicyQualifiers</a></strong>(<a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifierInfo.html" title="class in org.bouncycastle.asn1.esf">SigPolicyQualifierInfo</a>[]&nbsp;qualifierInfos)</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifierInfo.html" title="class in org.bouncycastle.asn1.esf">SigPolicyQualifierInfo</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifiers.html#getInfoAt(int)">getInfoAt</a></strong>(int&nbsp;i)</code> <div class="block">Return the SigPolicyQualifierInfo at index i.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifiers.html" title="class in org.bouncycastle.asn1.esf">SigPolicyQualifiers</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifiers.html#getInstance(java.lang.Object)">getInstance</a></strong>(java.lang.Object&nbsp;obj)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifiers.html#size()">size</a></strong>()</code> <div class="block">Return the number of qualifier info elements present.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../org/bouncycastle/asn1/ASN1Primitive.html" title="class in org.bouncycastle.asn1">ASN1Primitive</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifiers.html#toASN1Primitive()">toASN1Primitive</a></strong>()</code> <div class="block"> SigPolicyQualifiers ::= SEQUENCE SIZE (1..MAX) OF SigPolicyQualifierInfo </div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_org.bouncycastle.asn1.ASN1Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.bouncycastle.asn1.<a href="../../../../org/bouncycastle/asn1/ASN1Object.html" title="class in org.bouncycastle.asn1">ASN1Object</a></h3> <code><a href="../../../../org/bouncycastle/asn1/ASN1Object.html#equals(java.lang.Object)">equals</a>, <a href="../../../../org/bouncycastle/asn1/ASN1Object.html#getEncoded()">getEncoded</a>, <a href="../../../../org/bouncycastle/asn1/ASN1Object.html#getEncoded(java.lang.String)">getEncoded</a>, <a href="../../../../org/bouncycastle/asn1/ASN1Object.html#hasEncodedTagValue(java.lang.Object,%20int)">hasEncodedTagValue</a>, <a href="../../../../org/bouncycastle/asn1/ASN1Object.html#hashCode()">hashCode</a>, <a href="../../../../org/bouncycastle/asn1/ASN1Object.html#toASN1Object()">toASN1Object</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="SigPolicyQualifiers(org.bouncycastle.asn1.esf.SigPolicyQualifierInfo[])"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>SigPolicyQualifiers</h4> <pre>public&nbsp;SigPolicyQualifiers(<a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifierInfo.html" title="class in org.bouncycastle.asn1.esf">SigPolicyQualifierInfo</a>[]&nbsp;qualifierInfos)</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getInstance(java.lang.Object)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getInstance</h4> <pre>public static&nbsp;<a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifiers.html" title="class in org.bouncycastle.asn1.esf">SigPolicyQualifiers</a>&nbsp;getInstance(java.lang.Object&nbsp;obj)</pre> </li> </ul> <a name="size()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>size</h4> <pre>public&nbsp;int&nbsp;size()</pre> <div class="block">Return the number of qualifier info elements present.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>number of elements present.</dd></dl> </li> </ul> <a name="getInfoAt(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getInfoAt</h4> <pre>public&nbsp;<a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifierInfo.html" title="class in org.bouncycastle.asn1.esf">SigPolicyQualifierInfo</a>&nbsp;getInfoAt(int&nbsp;i)</pre> <div class="block">Return the SigPolicyQualifierInfo at index i.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>i</code> - index of the info of interest</dd> <dt><span class="strong">Returns:</span></dt><dd>the info at index i.</dd></dl> </li> </ul> <a name="toASN1Primitive()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>toASN1Primitive</h4> <pre>public&nbsp;<a href="../../../../org/bouncycastle/asn1/ASN1Primitive.html" title="class in org.bouncycastle.asn1">ASN1Primitive</a>&nbsp;toASN1Primitive()</pre> <div class="block"><pre> SigPolicyQualifiers ::= SEQUENCE SIZE (1..MAX) OF SigPolicyQualifierInfo </pre></div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/bouncycastle/asn1/ASN1Encodable.html#toASN1Primitive()">toASN1Primitive</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/bouncycastle/asn1/ASN1Encodable.html" title="interface in org.bouncycastle.asn1">ASN1Encodable</a></code></dd> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../org/bouncycastle/asn1/ASN1Object.html#toASN1Primitive()">toASN1Primitive</a></code>&nbsp;in class&nbsp;<code><a href="../../../../org/bouncycastle/asn1/ASN1Object.html" title="class in org.bouncycastle.asn1">ASN1Object</a></code></dd> <dt><span class="strong">Returns:</span></dt><dd>a primitive representation of this object.</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><b>Bouncy Castle Cryptography Library 1.54</b></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/bouncycastle/asn1/esf/SigPolicyQualifierInfo.html" title="class in org.bouncycastle.asn1.esf"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/bouncycastle/asn1/esf/SPuri.html" title="class in org.bouncycastle.asn1.esf"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/bouncycastle/asn1/esf/SigPolicyQualifiers.html" target="_top">Frames</a></li> <li><a href="SigPolicyQualifiers.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "ee48d1c81d57f38e196970d6ef0b0dc6", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 613, "avg_line_length": 42.207207207207205, "alnum_prop": 0.6614727854855923, "repo_name": "GaloisInc/hacrypto", "id": "cc00e6452a43c3c8d10ef9f6393223fd11ce9520", "size": "14055", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Java/BouncyCastle/BouncyCastle-1.54/lcrypto-jdk15on-154/javadoc/org/bouncycastle/asn1/esf/SigPolicyQualifiers.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AGS Script", "bytes": "62991" }, { "name": "Ada", "bytes": "443" }, { "name": "AppleScript", "bytes": "4518" }, { "name": "Assembly", "bytes": "25398957" }, { "name": "Awk", "bytes": "36188" }, { "name": "Batchfile", "bytes": "530568" }, { "name": "C", "bytes": "344517599" }, { "name": "C#", "bytes": "7553169" }, { "name": "C++", "bytes": "36635617" }, { "name": "CMake", "bytes": "213895" }, { "name": "CSS", "bytes": "139462" }, { "name": "Coq", "bytes": "320964" }, { "name": "Cuda", "bytes": "103316" }, { "name": "DIGITAL Command Language", "bytes": "1545539" }, { "name": "DTrace", "bytes": "33228" }, { "name": "Emacs Lisp", "bytes": "22827" }, { "name": "GDB", "bytes": "93449" }, { "name": "Gnuplot", "bytes": "7195" }, { "name": "Go", "bytes": "393057" }, { "name": "HTML", "bytes": "41466430" }, { "name": "Hack", "bytes": "22842" }, { "name": "Haskell", "bytes": "64053" }, { "name": "IDL", "bytes": "3205" }, { "name": "Java", "bytes": "49060925" }, { "name": "JavaScript", "bytes": "3476841" }, { "name": "Jolie", "bytes": "412" }, { "name": "Lex", "bytes": "26290" }, { "name": "Logos", "bytes": "108920" }, { "name": "Lua", "bytes": "427" }, { "name": "M4", "bytes": "2508986" }, { "name": "Makefile", "bytes": "29393197" }, { "name": "Mathematica", "bytes": "48978" }, { "name": "Mercury", "bytes": "2053" }, { "name": "Module Management System", "bytes": "1313" }, { "name": "NSIS", "bytes": "19051" }, { "name": "OCaml", "bytes": "981255" }, { "name": "Objective-C", "bytes": "4099236" }, { "name": "Objective-C++", "bytes": "243505" }, { "name": "PHP", "bytes": "22677635" }, { "name": "Pascal", "bytes": "99565" }, { "name": "Perl", "bytes": "35079773" }, { "name": "Prolog", "bytes": "350124" }, { "name": "Python", "bytes": "1242241" }, { "name": "Rebol", "bytes": "106436" }, { "name": "Roff", "bytes": "16457446" }, { "name": "Ruby", "bytes": "49694" }, { "name": "Scheme", "bytes": "138999" }, { "name": "Shell", "bytes": "10192290" }, { "name": "Smalltalk", "bytes": "22630" }, { "name": "Smarty", "bytes": "51246" }, { "name": "SourcePawn", "bytes": "542790" }, { "name": "SystemVerilog", "bytes": "95379" }, { "name": "Tcl", "bytes": "35696" }, { "name": "TeX", "bytes": "2351627" }, { "name": "Verilog", "bytes": "91541" }, { "name": "Visual Basic", "bytes": "88541" }, { "name": "XS", "bytes": "38300" }, { "name": "Yacc", "bytes": "132970" }, { "name": "eC", "bytes": "33673" }, { "name": "q", "bytes": "145272" }, { "name": "sed", "bytes": "1196" } ], "symlink_target": "" }
<html> <head> <title>User agent detail - Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5235/12.6.092; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> </head> <body> <div class="container"> <div class="section"> <h1 class="header center orange-text">User agent detail</h1> <div class="row center"> <h5 class="header light"> Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5235/12.6.092; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 </h5> </div> </div> <div class="section"> <table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Source result (test suite)</th></tr><tr><td>whichbrowser/parser<br /><small>/tests/data/mobile/manufacturer-nokia-series60.yaml</small></td><td> </td><td>Series60 5.0</td><td>Webkit 413</td><td style="border-left: 1px solid #555">Nokia</td><td>5235 Ovi Music Unlimited</td><td>mobile:smart</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-test">Detail</a> <!-- Modal Structure --> <div id="modal-test" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Testsuite result detail</h4> <p><pre><code class="php">Array ( [headers] => User-Agent: Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5235/12.6.092; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 [result] => Array ( [engine] => Array ( [name] => Webkit [version] => 413 ) [os] => Array ( [name] => Series60 [family] => Array ( [name] => Symbian [version] => 5235 Ovi Music Unlimited ) [version] => 9.4 ) [device] => Array ( [type] => mobile [subtype] => smart [manufacturer] => Nokia [model] => 5.0 ) ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapPhp<br /><small>6012</small></td><td>Safari </td><td> </td><td>SymbianOS </td><td style="border-left: 1px solid #555"></td><td></td><td>Mobile Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.029</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-215ac98d-ccf8-4615-916e-5a819d6a59c9">Detail</a> <!-- Modal Structure --> <div id="modal-215ac98d-ccf8-4615-916e-5a819d6a59c9" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>BrowscapPhp result detail</h4> <p><pre><code class="php">stdClass Object ( [browser_name_regex] => /^mozilla\/5\.0 \(.*symbianos.*\) applewebkit\/.* \(khtml, like gecko\).*safari.*$/ [browser_name_pattern] => mozilla/5.0 (*symbianos*) applewebkit/* (khtml, like gecko)*safari* [parent] => Safari Generic for SymbianOS [comment] => Safari Generic [browser] => Safari [browser_type] => Browser [browser_bits] => 32 [browser_maker] => Apple Inc [browser_modus] => unknown [version] => 0.0 [majorver] => 0 [minorver] => 0 [platform] => SymbianOS [platform_version] => unknown [platform_description] => Symbian OS [platform_bits] => 32 [platform_maker] => Symbian Foundation [alpha] => [beta] => [win16] => [win32] => [win64] => [frames] => 1 [iframes] => 1 [tables] => 1 [cookies] => 1 [backgroundsounds] => [javascript] => 1 [vbscript] => [javaapplets] => [activexcontrols] => [ismobiledevice] => 1 [istablet] => [issyndicationreader] => [crawler] => [cssversion] => 1 [aolversion] => 0 [device_name] => general Mobile Phone [device_maker] => unknown [device_type] => Mobile Phone [device_pointing_method] => unknown [device_code_name] => general Mobile Phone [device_brand_name] => unknown [renderingengine_name] => unknown [renderingengine_version] => unknown [renderingengine_description] => unknown [renderingengine_maker] => unknown ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>DonatjUAParser<br /><small>v0.5.0</small></td><td>Safari 413</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661">Detail</a> <!-- Modal Structure --> <div id="modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>DonatjUAParser result detail</h4> <p><pre><code class="php">Array ( [platform] => [browser] => Safari [version] => 413 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>NeutrinoApiCom<br /><small></small></td><td>Nokia Web Browser </td><td><i class="material-icons">close</i></td><td>Symbian OS 9.4</td><td style="border-left: 1px solid #555">Nokia</td><td>5235</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.18902</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc">Detail</a> <!-- Modal Structure --> <div id="modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>NeutrinoApiCom result detail</h4> <p><pre><code class="php">stdClass Object ( [mobile_screen_height] => 640 [is_mobile] => 1 [type] => mobile-browser [mobile_brand] => Nokia [mobile_model] => 5235 [version] => [is_android] => [browser_name] => Nokia Web Browser [operating_system_family] => Symbian OS [operating_system_version] => 9.4 [is_ios] => [producer] => Nokia [operating_system] => Symbian OS [mobile_screen_width] => 360 [mobile_browser] => Safari ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>PiwikDeviceDetector<br /><small>3.5.2</small></td><td>Nokia Browser 7.0</td><td>WebKit </td><td>Symbian OS Series 60 5.0</td><td style="border-left: 1px solid #555">Nokia</td><td>5235</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.005</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-21638055-738d-46ba-a1b1-f5114bc26475">Detail</a> <!-- Modal Structure --> <div id="modal-21638055-738d-46ba-a1b1-f5114bc26475" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>PiwikDeviceDetector result detail</h4> <p><pre><code class="php">Array ( [client] => Array ( [type] => browser [name] => Nokia Browser [short_name] => NB [version] => 7.0 [engine] => WebKit ) [operatingSystem] => Array ( [name] => Symbian OS Series 60 [short_name] => S60 [version] => 5.0 [platform] => ) [device] => Array ( [brand] => NK [brandName] => Nokia [model] => 5235 [device] => 1 [deviceName] => smartphone ) [bot] => [extra] => Array ( [isBot] => [isBrowser] => 1 [isFeedReader] => [isMobileApp] => [isPIM] => [isLibrary] => [isMediaPlayer] => [isCamera] => [isCarBrowser] => [isConsole] => [isFeaturePhone] => [isPhablet] => [isPortableMediaPlayer] => [isSmartDisplay] => [isSmartphone] => 1 [isTablet] => [isTV] => [isDesktop] => [isMobile] => 1 [isTouchEnabled] => ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.0</small></td><td>Nokia S60 OSS Browser 12.6.092;</td><td><i class="material-icons">close</i></td><td>Nokia </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.002</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-5415e7f2-ef7b-434c-abe0-b71ba9f6707c">Detail</a> <!-- Modal Structure --> <div id="modal-5415e7f2-ef7b-434c-abe0-b71ba9f6707c" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>SinergiBrowserDetector result detail</h4> <p><pre><code class="php">Array ( [browser] => Sinergi\BrowserDetector\Browser Object ( [userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5235/12.6.092; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 ) [name:Sinergi\BrowserDetector\Browser:private] => Nokia S60 OSS Browser [version:Sinergi\BrowserDetector\Browser:private] => 12.6.092; [isRobot:Sinergi\BrowserDetector\Browser:private] => [isChromeFrame:Sinergi\BrowserDetector\Browser:private] => ) [operatingSystem] => Sinergi\BrowserDetector\Os Object ( [name:Sinergi\BrowserDetector\Os:private] => Nokia [version:Sinergi\BrowserDetector\Os:private] => unknown [isMobile:Sinergi\BrowserDetector\Os:private] => 1 [userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5235/12.6.092; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 ) ) [device] => Sinergi\BrowserDetector\Device Object ( [name:Sinergi\BrowserDetector\Device:private] => unknown [userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5235/12.6.092; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 ) ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UAParser<br /><small>v3.4.5</small></td><td>Nokia Browser 7.0</td><td><i class="material-icons">close</i></td><td>Symbian OS 9.4</td><td style="border-left: 1px solid #555">Nokia</td><td>5235</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.009</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b">Detail</a> <!-- Modal Structure --> <div id="modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">UAParser\Result\Client Object ( [ua] => UAParser\Result\UserAgent Object ( [major] => 7 [minor] => 0 [patch] => [family] => Nokia Browser ) [os] => UAParser\Result\OperatingSystem Object ( [major] => 9 [minor] => 4 [patch] => [patchMinor] => [family] => Symbian OS ) [device] => UAParser\Result\Device Object ( [brand] => Nokia [model] => 5235 [family] => Nokia 5235 ) [originalUserAgent] => Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5235/12.6.092; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UserAgentStringCom<br /><small></small></td><td>Browser for S60 OSS 5.0</td><td><i class="material-icons">close</i></td><td>SymbianOS 9.4</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.05301</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4">Detail</a> <!-- Modal Structure --> <div id="modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UserAgentStringCom result detail</h4> <p><pre><code class="php">stdClass Object ( [agent_type] => Browser [agent_name] => Browser for S60 [agent_version] => OSS 5.0 [os_type] => SymbianOS [os_name] => SymbianOS [os_versionName] => [os_versionNumber] => 9.4 [os_producer] => [os_producerURL] => [linux_distibution] => Null [agent_language] => [agent_languageTag] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhatIsMyBrowserCom<br /><small></small></td><td>Android Browser </td><td>WebKit 413</td><td>NokiaOS </td><td style="border-left: 1px solid #555">Nokia</td><td>Nokia 5235</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.41204</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-9795f66f-7271-430e-973a-a5c0e14dc35a">Detail</a> <!-- Modal Structure --> <div id="modal-9795f66f-7271-430e-973a-a5c0e14dc35a" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhatIsMyBrowserCom result detail</h4> <p><pre><code class="php">stdClass Object ( [operating_system_name] => NokiaOS [simple_sub_description_string] => [simple_browser_string] => Android Browser on NokiaOS 9.4 [browser_version] => [extra_info] => stdClass Object ( [20] => Array ( [0] => Series 60 ) ) [operating_platform] => Nokia 5235 [extra_info_table] => stdClass Object ( [Series 60] => 5.0 ) [layout_engine_name] => WebKit [detected_addons] => Array ( ) [operating_system_flavour_code] => [hardware_architecture] => [operating_system_flavour] => [operating_system_frameworks] => Array ( ) [browser_name_code] => android-browser [operating_system_version] => 9.4 [simple_operating_platform_string] => Nokia 5235 [is_abusive] => [layout_engine_version] => 413 [browser_capabilities] => Array ( [0] => MIDP v2.1 [1] => CLDC v1.1 ) [operating_platform_vendor_name] => Nokia [operating_system] => NokiaOS 9.4 [operating_system_version_full] => [operating_platform_code] => 5235 [browser_name] => Android Browser [operating_system_name_code] => nokiaos [user_agent] => Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5235/12.6.092; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 [browser_version_full] => [browser] => Android Browser ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhichBrowser<br /><small>2.0.10</small></td><td> </td><td>Webkit 413</td><td>Series60 5.0</td><td style="border-left: 1px solid #555">Nokia</td><td>5235 Ovi Music Unlimited</td><td>mobile:smart</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.004</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4">Detail</a> <!-- Modal Structure --> <div id="modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhichBrowser result detail</h4> <p><pre><code class="php">Array ( [engine] => Array ( [name] => Webkit [version] => 413 ) [os] => Array ( [name] => Series60 [family] => Array ( [name] => Symbian [version] => 9.4 ) [version] => 5.0 ) [device] => Array ( [type] => mobile [subtype] => smart [manufacturer] => Nokia [model] => 5235 Ovi Music Unlimited ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Woothee<br /><small>v1.2.0</small></td><td>Safari </td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>mobilephone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-3f285ff5-314b-4db4-9948-54572e92e7b6">Detail</a> <!-- Modal Structure --> <div id="modal-3f285ff5-314b-4db4-9948-54572e92e7b6" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Woothee result detail</h4> <p><pre><code class="php">Array ( [name] => Safari [vendor] => Apple [version] => UNKNOWN [category] => mobilephone [os] => SymbianOS [os_version] => UNKNOWN ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Wurfl<br /><small>1.6.4</small></td><td>Symbian S60 Browser </td><td><i class="material-icons">close</i></td><td>Symbian S60 9.4</td><td style="border-left: 1px solid #555">Nokia</td><td>5235</td><td>Feature Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.017</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-1a1aee36-7ce7-4111-a391-8e2c501f1532">Detail</a> <!-- Modal Structure --> <div id="modal-1a1aee36-7ce7-4111-a391-8e2c501f1532" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Wurfl result detail</h4> <p><pre><code class="php">Array ( [virtual] => Array ( [is_android] => false [is_ios] => false [is_windows_phone] => false [is_app] => false [is_full_desktop] => false [is_largescreen] => false [is_mobile] => true [is_robot] => false [is_smartphone] => false [is_touchscreen] => true [is_wml_preferred] => false [is_xhtmlmp_preferred] => false [is_html_preferred] => true [advertised_device_os] => Symbian S60 [advertised_device_os_version] => 9.4 [advertised_browser] => Symbian S60 Browser [advertised_browser_version] => [complete_device_name] => Nokia 5235 [form_factor] => Feature Phone [is_phone] => true [is_app_webview] => false ) [all] => Array ( [brand_name] => Nokia [model_name] => 5235 [unique] => true [ununiqueness_handler] => [is_wireless_device] => true [device_claims_web_support] => true [has_qwerty_keyboard] => false [can_skip_aligned_link_row] => true [uaprof] => http://nds1.nds.nokia.com/uaprof/Nokia5235r100-3G.xml [uaprof2] => http://nds1.nds.nokia.com/uaprof/Nokia5235r100-2G.xml [uaprof3] => [nokia_series] => 60 [nokia_edition] => 5 [device_os] => Symbian OS [mobile_browser] => Safari [mobile_browser_version] => [device_os_version] => [pointing_method] => touchscreen [release_date] => 2009_december [marketing_name] => [model_extra_info] => [nokia_feature_pack] => 0 [can_assign_phone_number] => true [is_tablet] => false [manufacturer_name] => [is_bot] => false [is_google_glass] => false [proportional_font] => true [built_in_back_button_support] => true [card_title_support] => true [softkey_support] => true [table_support] => true [numbered_menus] => false [menu_with_select_element_recommended] => false [menu_with_list_of_links_recommended] => true [icons_on_menu_items_support] => true [break_list_of_links_with_br_element_recommended] => false [access_key_support] => false [wrap_mode_support] => true [times_square_mode_support] => false [deck_prefetch_support] => false [elective_forms_recommended] => true [wizards_recommended] => false [image_as_link_support] => true [insert_br_element_after_widget_recommended] => false [wml_can_display_images_and_text_on_same_line] => false [wml_displays_image_in_center] => false [opwv_wml_extensions_support] => false [wml_make_phone_call_string] => wtai://wp/mc; [chtml_display_accesskey] => false [emoji] => false [chtml_can_display_images_and_text_on_same_line] => false [chtml_displays_image_in_center] => false [imode_region] => none [chtml_make_phone_call_string] => tel: [chtml_table_support] => false [xhtml_honors_bgcolor] => true [xhtml_supports_forms_in_table] => false [xhtml_support_wml2_namespace] => false [xhtml_autoexpand_select] => false [xhtml_select_as_dropdown] => false [xhtml_select_as_radiobutton] => false [xhtml_select_as_popup] => false [xhtml_display_accesskey] => false [xhtml_supports_invisible_text] => false [xhtml_supports_inline_input] => false [xhtml_supports_monospace_font] => false [xhtml_supports_table_for_layout] => true [xhtml_supports_css_cell_table_coloring] => true [xhtml_format_as_css_property] => true [xhtml_format_as_attribute] => false [xhtml_nowrap_mode] => false [xhtml_marquee_as_css_property] => false [xhtml_readable_background_color1] => #FFFFFF [xhtml_readable_background_color2] => #FFFFFF [xhtml_allows_disabled_form_elements] => false [xhtml_document_title_support] => true [xhtml_preferred_charset] => utf8 [opwv_xhtml_extensions_support] => false [xhtml_make_phone_call_string] => wtai://wp/mc; [xhtmlmp_preferred_mime_type] => application/xhtml+xml [xhtml_table_support] => true [xhtml_send_sms_string] => sms: [xhtml_send_mms_string] => mmsto: [xhtml_file_upload] => supported [cookie_support] => true [accept_third_party_cookie] => true [xhtml_supports_iframe] => full [xhtml_avoid_accesskeys] => true [xhtml_can_embed_video] => play_and_stop [ajax_support_javascript] => true [ajax_manipulate_css] => true [ajax_support_getelementbyid] => true [ajax_support_inner_html] => true [ajax_xhr_type] => standard [ajax_manipulate_dom] => true [ajax_support_events] => true [ajax_support_event_listener] => true [ajax_preferred_geoloc_api] => none [xhtml_support_level] => 4 [preferred_markup] => html_web_4_0 [wml_1_1] => true [wml_1_2] => true [wml_1_3] => true [html_wi_w3_xhtmlbasic] => true [html_wi_oma_xhtmlmp_1_0] => true [html_wi_imode_html_1] => false [html_wi_imode_html_2] => false [html_wi_imode_html_3] => false [html_wi_imode_html_4] => false [html_wi_imode_html_5] => false [html_wi_imode_htmlx_1] => false [html_wi_imode_htmlx_1_1] => false [html_wi_imode_compact_generic] => false [html_web_3_2] => true [html_web_4_0] => true [voicexml] => false [multipart_support] => true [total_cache_disable_support] => false [time_to_live_support] => false [resolution_width] => 360 [resolution_height] => 640 [columns] => 17 [max_image_width] => 330 [max_image_height] => 600 [rows] => 13 [physical_screen_width] => 40 [physical_screen_height] => 71 [dual_orientation] => false [density_class] => 1.0 [wbmp] => true [bmp] => true [epoc_bmp] => true [gif_animated] => true [jpg] => true [png] => true [tiff] => true [transparent_png_alpha] => true [transparent_png_index] => false [svgt_1_1] => false [svgt_1_1_plus] => false [greyscale] => false [gif] => true [colors] => 16777216 [webp_lossy_support] => false [webp_lossless_support] => false [post_method_support] => true [basic_authentication_support] => true [empty_option_value_support] => true [emptyok] => false [nokia_voice_call] => true [wta_voice_call] => true [wta_phonebook] => true [wta_misc] => false [wta_pdc] => false [https_support] => true [phone_id_provided] => false [max_data_rate] => 1200 [wifi] => true [sdio] => false [vpn] => false [has_cellular_radio] => true [max_deck_size] => 357000 [max_url_length_in_requests] => 255 [max_url_length_homepage] => 100 [max_url_length_bookmark] => 255 [max_url_length_cached_page] => 128 [max_no_of_connection_settings] => 5 [max_no_of_bookmarks] => 25 [max_length_of_username] => 32 [max_length_of_password] => 20 [max_object_size] => 0 [downloadfun_support] => false [directdownload_support] => true [inline_support] => true [oma_support] => true [ringtone] => true [ringtone_3gpp] => false [ringtone_midi_monophonic] => true [ringtone_midi_polyphonic] => true [ringtone_imelody] => false [ringtone_digiplug] => false [ringtone_compactmidi] => false [ringtone_mmf] => false [ringtone_rmf] => true [ringtone_xmf] => true [ringtone_amr] => true [ringtone_awb] => true [ringtone_aac] => false [ringtone_wav] => true [ringtone_mp3] => true [ringtone_spmidi] => true [ringtone_qcelp] => false [ringtone_voices] => 24 [ringtone_df_size_limit] => 0 [ringtone_directdownload_size_limit] => 61440 [ringtone_inline_size_limit] => 0 [ringtone_oma_size_limit] => 0 [wallpaper] => true [wallpaper_max_width] => 174 [wallpaper_max_height] => 143 [wallpaper_preferred_width] => 176 [wallpaper_preferred_height] => 144 [wallpaper_resize] => none [wallpaper_wbmp] => true [wallpaper_bmp] => true [wallpaper_gif] => true [wallpaper_jpg] => true [wallpaper_png] => true [wallpaper_tiff] => true [wallpaper_greyscale] => false [wallpaper_colors] => 12 [wallpaper_df_size_limit] => 0 [wallpaper_directdownload_size_limit] => 0 [wallpaper_inline_size_limit] => 0 [wallpaper_oma_size_limit] => 0 [screensaver] => true [screensaver_max_width] => 176 [screensaver_max_height] => 208 [screensaver_preferred_width] => 176 [screensaver_preferred_height] => 208 [screensaver_resize] => none [screensaver_wbmp] => true [screensaver_bmp] => true [screensaver_gif] => true [screensaver_jpg] => true [screensaver_png] => true [screensaver_greyscale] => false [screensaver_colors] => 12 [screensaver_df_size_limit] => 0 [screensaver_directdownload_size_limit] => 0 [screensaver_inline_size_limit] => 0 [screensaver_oma_size_limit] => 0 [picture] => true [picture_max_width] => 176 [picture_max_height] => 293 [picture_preferred_width] => 174 [picture_preferred_height] => 263 [picture_resize] => none [picture_wbmp] => true [picture_bmp] => true [picture_gif] => true [picture_jpg] => true [picture_png] => true [picture_greyscale] => false [picture_colors] => 24 [picture_df_size_limit] => 0 [picture_directdownload_size_limit] => 0 [picture_inline_size_limit] => 0 [picture_oma_size_limit] => 0 [video] => true [oma_v_1_0_forwardlock] => true [oma_v_1_0_combined_delivery] => false [oma_v_1_0_separate_delivery] => false [streaming_video] => true [streaming_3gpp] => true [streaming_mp4] => true [streaming_mov] => false [streaming_video_size_limit] => 0 [streaming_real_media] => 8 [streaming_flv] => false [streaming_3g2] => true [streaming_vcodec_h263_0] => 30 [streaming_vcodec_h263_3] => 30 [streaming_vcodec_mpeg4_sp] => 0 [streaming_vcodec_mpeg4_asp] => -1 [streaming_vcodec_h264_bp] => 1 [streaming_acodec_amr] => nb [streaming_acodec_aac] => none [streaming_wmv] => none [streaming_preferred_protocol] => rtsp [streaming_preferred_http_protocol] => microsoft_smooth_streaming [wap_push_support] => true [connectionless_service_indication] => true [connectionless_service_load] => false [connectionless_cache_operation] => true [connectionoriented_unconfirmed_service_indication] => true [connectionoriented_unconfirmed_service_load] => false [connectionoriented_unconfirmed_cache_operation] => true [connectionoriented_confirmed_service_indication] => true [connectionoriented_confirmed_service_load] => true [connectionoriented_confirmed_cache_operation] => true [utf8_support] => false [ascii_support] => true [iso8859_support] => false [expiration_date] => false [j2me_cldc_1_0] => true [j2me_cldc_1_1] => true [j2me_midp_1_0] => true [j2me_midp_2_0] => true [doja_1_0] => false [doja_1_5] => false [doja_2_0] => false [doja_2_1] => false [doja_2_2] => false [doja_3_0] => false [doja_3_5] => false [doja_4_0] => false [j2me_jtwi] => false [j2me_mmapi_1_0] => true [j2me_mmapi_1_1] => false [j2me_wmapi_1_0] => true [j2me_wmapi_1_1] => false [j2me_wmapi_2_0] => false [j2me_btapi] => true [j2me_3dapi] => false [j2me_locapi] => false [j2me_nokia_ui] => true [j2me_motorola_lwt] => false [j2me_siemens_color_game] => false [j2me_siemens_extension] => false [j2me_heap_size] => 12582912 [j2me_max_jar_size] => 12582912 [j2me_storage_size] => 0 [j2me_max_record_store_size] => 0 [j2me_screen_width] => 240 [j2me_screen_height] => 320 [j2me_canvas_width] => 0 [j2me_canvas_height] => 0 [j2me_bits_per_pixel] => 0 [j2me_audio_capture_enabled] => false [j2me_video_capture_enabled] => false [j2me_photo_capture_enabled] => false [j2me_capture_image_formats] => none [j2me_http] => false [j2me_https] => false [j2me_socket] => false [j2me_udp] => false [j2me_serial] => false [j2me_gif] => false [j2me_gif89a] => false [j2me_jpg] => false [j2me_png] => false [j2me_bmp] => false [j2me_bmp3] => false [j2me_wbmp] => false [j2me_midi] => true [j2me_wav] => false [j2me_amr] => true [j2me_mp3] => false [j2me_mp4] => false [j2me_imelody] => false [j2me_rmf] => false [j2me_au] => false [j2me_aac] => false [j2me_realaudio] => false [j2me_xmf] => false [j2me_wma] => false [j2me_3gpp] => true [j2me_h263] => false [j2me_svgt] => false [j2me_mpeg4] => false [j2me_realvideo] => false [j2me_real8] => false [j2me_realmedia] => false [j2me_left_softkey_code] => -6 [j2me_right_softkey_code] => -7 [j2me_middle_softkey_code] => -5 [j2me_select_key_code] => 0 [j2me_return_key_code] => 0 [j2me_clear_key_code] => -8 [j2me_datefield_no_accepts_null_date] => true [j2me_datefield_broken] => false [receiver] => true [sender] => true [mms_max_size] => 614400 [mms_max_height] => 1536 [mms_max_width] => 2048 [built_in_recorder] => false [built_in_camera] => true [mms_jpeg_baseline] => true [mms_jpeg_progressive] => false [mms_gif_static] => true [mms_gif_animated] => true [mms_png] => true [mms_bmp] => true [mms_wbmp] => true [mms_amr] => true [mms_wav] => true [mms_midi_monophonic] => true [mms_midi_polyphonic] => true [mms_midi_polyphonic_voices] => 24 [mms_spmidi] => true [mms_mmf] => false [mms_mp3] => true [mms_evrc] => false [mms_qcelp] => false [mms_ota_bitmap] => false [mms_nokia_wallpaper] => true [mms_nokia_operatorlogo] => true [mms_nokia_3dscreensaver] => false [mms_nokia_ringingtone] => true [mms_rmf] => true [mms_xmf] => true [mms_symbian_install] => true [mms_jar] => true [mms_jad] => true [mms_vcard] => true [mms_vcalendar] => false [mms_wml] => true [mms_wbxml] => true [mms_wmlc] => true [mms_video] => true [mms_mp4] => true [mms_3gpp] => true [mms_3gpp2] => false [mms_max_frame_rate] => 0 [nokiaring] => true [picturemessage] => true [operatorlogo] => true [largeoperatorlogo] => false [callericon] => false [nokiavcard] => false [nokiavcal] => false [sckl_ringtone] => false [sckl_operatorlogo] => false [sckl_groupgraphic] => false [sckl_vcard] => false [sckl_vcalendar] => false [text_imelody] => false [ems] => false [ems_variablesizedpictures] => false [ems_imelody] => false [ems_odi] => false [ems_upi] => false [ems_version] => 0 [siemens_ota] => false [siemens_logo_width] => 101 [siemens_logo_height] => 29 [siemens_screensaver_width] => 101 [siemens_screensaver_height] => 50 [gprtf] => false [sagem_v1] => false [sagem_v2] => false [panasonic] => false [sms_enabled] => true [wav] => true [mmf] => false [smf] => false [mld] => false [midi_monophonic] => true [midi_polyphonic] => true [sp_midi] => true [rmf] => true [xmf] => false [compactmidi] => false [digiplug] => false [nokia_ringtone] => true [imelody] => false [au] => true [amr] => true [awb] => true [aac] => true [mp3] => true [voices] => 24 [qcelp] => false [evrc] => false [flash_lite_version] => 3_0 [fl_wallpaper] => false [fl_screensaver] => false [fl_standalone] => true [fl_browser] => true [fl_sub_lcd] => false [full_flash_support] => false [css_supports_width_as_percentage] => true [css_border_image] => none [css_rounded_corners] => none [css_gradient] => none [css_spriting] => true [css_gradient_linear] => none [is_transcoder] => false [transcoder_ua_header] => user-agent [rss_support] => false [pdf_support] => true [progressive_download] => false [playback_vcodec_h263_0] => 10 [playback_vcodec_h263_3] => -1 [playback_vcodec_mpeg4_sp] => 0 [playback_vcodec_mpeg4_asp] => -1 [playback_vcodec_h264_bp] => 1 [playback_real_media] => 8 [playback_3gpp] => true [playback_3g2] => false [playback_mp4] => true [playback_mov] => false [playback_acodec_amr] => wb [playback_acodec_aac] => heaac2 [playback_df_size_limit] => 0 [playback_directdownload_size_limit] => 0 [playback_inline_size_limit] => 0 [playback_oma_size_limit] => 0 [playback_acodec_qcelp] => false [playback_wmv] => none [hinted_progressive_download] => false [html_preferred_dtd] => html4 [viewport_supported] => false [viewport_width] => [viewport_userscalable] => [viewport_initial_scale] => [viewport_maximum_scale] => [viewport_minimum_scale] => [mobileoptimized] => false [handheldfriendly] => false [canvas_support] => none [image_inlining] => true [is_smarttv] => false [is_console] => false [nfc_support] => false [ux_full_desktop] => false [jqm_grade] => none [is_sencha_touch_ok] => false [controlcap_is_smartphone] => default [controlcap_is_ios] => default [controlcap_is_android] => default [controlcap_is_robot] => default [controlcap_is_app] => default [controlcap_advertised_device_os] => default [controlcap_advertised_device_os_version] => default [controlcap_advertised_browser] => default [controlcap_advertised_browser_version] => default [controlcap_is_windows_phone] => default [controlcap_is_full_desktop] => default [controlcap_is_largescreen] => default [controlcap_is_mobile] => default [controlcap_is_touchscreen] => default [controlcap_is_wml_preferred] => default [controlcap_is_xhtmlmp_preferred] => default [controlcap_is_html_preferred] => default [controlcap_form_factor] => default [controlcap_complete_device_name] => default ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr></table> </div> <div class="section"> <h1 class="header center orange-text">About this comparison</h1> <div class="row center"> <h5 class="header light"> The primary goal of this project is simple<br /> I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br /> <br /> The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br /> <br /> You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br /> <br /> The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a> </h5> </div> </div> <div class="card"> <div class="card-content"> Comparison created <i>2016-02-13 13:29:00</i> | by <a href="https://github.com/ThaDafinser">ThaDafinser</a> </div> </div> </div> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script> <script> $(document).ready(function(){ // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered $('.modal-trigger').leanModal(); }); </script> </body> </html>
{ "content_hash": "019050689a183430643285673fc54d34", "timestamp": "", "source": "github", "line_count": 1157, "max_line_length": 801, "avg_line_length": 40.89109766637856, "alnum_prop": 0.5326879584029084, "repo_name": "ThaDafinser/UserAgentParserComparison", "id": "a5df2098caaaa6371c9cc2db37936a7b2340c430", "size": "47312", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "v4/user-agent-detail/34/f1/34f1e994-be73-49dd-823e-93710272a61a.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2060859160" } ], "symlink_target": "" }
/** * Automatically generated file. Please do not edit. * @author Highcharts Config Generator by Karasiq * @see [[http://api.highcharts.com/highmaps]] */ package com.highmaps.config import scalajs.js, js.`|` import com.highcharts.CleanJsObject import com.highcharts.HighchartsUtils._ /** * @note JavaScript name: <code>plotOptions-sma-events</code> */ @js.annotation.ScalaJSDefined class PlotOptionsSmaEvents extends com.highcharts.HighchartsGenericObject { /** * <p>Fires after the series has finished its initial animation, or in * case animation is disabled, immediately as the series is displayed.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-afteranimate/">Show label after animate</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-afteranimate/">Show label after animate</a> * @since 4.0 */ val afterAnimate: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the checkbox next to the series&#39; name in the legend is * clicked. One parameter, <code>event</code>, is passed to the function. The state * of the checkbox is found by <code>event.checked</code>. The checked item is * found by <code>event.item</code>. Return <code>false</code> to prevent the default action * which is to toggle the select state of the series.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-checkboxclick/">Alert checkbox status</a> * @since 1.2.0 */ val checkboxClick: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the series is clicked. One parameter, <code>event</code>, is passed to * the function, containing common event information. Additionally, * <code>event.point</code> holds a pointer to the nearest point on the graph.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-click/">Alert click info</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/stock/plotoptions/series-events-click/">Alert click info</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/maps/plotoptions/series-events-click/">Display click info in subtitle</a> * @since 6.0.0 */ val click: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the series is hidden after chart generation time, either * by clicking the legend item or by calling <code>.hide()</code>.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-hide/">Alert when the series is hidden by clicking the legend item</a> * @since 1.2.0 */ val hide: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the legend item belonging to the series is clicked. One * parameter, <code>event</code>, is passed to the function. The default action * is to toggle the visibility of the series. This can be prevented * by returning <code>false</code> or calling <code>event.preventDefault()</code>.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-legenditemclick/">Confirm hiding and showing</a> * @since 6.0.0 */ val legendItemClick: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the mouse leaves the graph. One parameter, <code>event</code>, is * passed to the function, containing common event information. If the * <a href="#plotOptions.series">stickyTracking</a> option is true, <code>mouseOut</code> * doesn&#39;t happen before the mouse enters another graph or leaves the * plot area.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-mouseover-sticky/">With sticky tracking by default</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-mouseover-no-sticky/">Without sticky tracking</a> * @since 6.0.0 */ val mouseOut: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the mouse enters the graph. One parameter, <code>event</code>, is * passed to the function, containing common event information.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-mouseover-sticky/">With sticky tracking by default</a> <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-mouseover-no-sticky/">Without sticky tracking</a> * @since 6.0.0 */ val mouseOver: js.UndefOr[js.Function] = js.undefined /** * <p>Fires when the series is shown after chart generation time, either * by clicking the legend item or by calling <code>.show()</code>.</p> * @example <a href="https://jsfiddle.net/gh/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-events-show/">Alert when the series is shown by clicking the legend item.</a> * @since 1.2.0 */ val show: js.UndefOr[js.Function] = js.undefined } object PlotOptionsSmaEvents { /** * @param afterAnimate <p>Fires after the series has finished its initial animation, or in. case animation is disabled, immediately as the series is displayed.</p> * @param checkboxClick <p>Fires when the checkbox next to the series&#39; name in the legend is. clicked. One parameter, <code>event</code>, is passed to the function. The state. of the checkbox is found by <code>event.checked</code>. The checked item is. found by <code>event.item</code>. Return <code>false</code> to prevent the default action. which is to toggle the select state of the series.</p> * @param click <p>Fires when the series is clicked. One parameter, <code>event</code>, is passed to. the function, containing common event information. Additionally,. <code>event.point</code> holds a pointer to the nearest point on the graph.</p> * @param hide <p>Fires when the series is hidden after chart generation time, either. by clicking the legend item or by calling <code>.hide()</code>.</p> * @param legendItemClick <p>Fires when the legend item belonging to the series is clicked. One. parameter, <code>event</code>, is passed to the function. The default action. is to toggle the visibility of the series. This can be prevented. by returning <code>false</code> or calling <code>event.preventDefault()</code>.</p> * @param mouseOut <p>Fires when the mouse leaves the graph. One parameter, <code>event</code>, is. passed to the function, containing common event information. If the. <a href="#plotOptions.series">stickyTracking</a> option is true, <code>mouseOut</code>. doesn&#39;t happen before the mouse enters another graph or leaves the. plot area.</p> * @param mouseOver <p>Fires when the mouse enters the graph. One parameter, <code>event</code>, is. passed to the function, containing common event information.</p> * @param show <p>Fires when the series is shown after chart generation time, either. by clicking the legend item or by calling <code>.show()</code>.</p> */ def apply(afterAnimate: js.UndefOr[js.Function] = js.undefined, checkboxClick: js.UndefOr[js.Function] = js.undefined, click: js.UndefOr[js.Function] = js.undefined, hide: js.UndefOr[js.Function] = js.undefined, legendItemClick: js.UndefOr[js.Function] = js.undefined, mouseOut: js.UndefOr[js.Function] = js.undefined, mouseOver: js.UndefOr[js.Function] = js.undefined, show: js.UndefOr[js.Function] = js.undefined): PlotOptionsSmaEvents = { val afterAnimateOuter: js.UndefOr[js.Function] = afterAnimate val checkboxClickOuter: js.UndefOr[js.Function] = checkboxClick val clickOuter: js.UndefOr[js.Function] = click val hideOuter: js.UndefOr[js.Function] = hide val legendItemClickOuter: js.UndefOr[js.Function] = legendItemClick val mouseOutOuter: js.UndefOr[js.Function] = mouseOut val mouseOverOuter: js.UndefOr[js.Function] = mouseOver val showOuter: js.UndefOr[js.Function] = show com.highcharts.HighchartsGenericObject.toCleanObject(new PlotOptionsSmaEvents { override val afterAnimate: js.UndefOr[js.Function] = afterAnimateOuter override val checkboxClick: js.UndefOr[js.Function] = checkboxClickOuter override val click: js.UndefOr[js.Function] = clickOuter override val hide: js.UndefOr[js.Function] = hideOuter override val legendItemClick: js.UndefOr[js.Function] = legendItemClickOuter override val mouseOut: js.UndefOr[js.Function] = mouseOutOuter override val mouseOver: js.UndefOr[js.Function] = mouseOverOuter override val show: js.UndefOr[js.Function] = showOuter }) } }
{ "content_hash": "8ed4f737dfc0cffe9652cf252e0d9f03", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 443, "avg_line_length": 71.015625, "alnum_prop": 0.7350935093509351, "repo_name": "Karasiq/scalajs-highcharts", "id": "9c48bb79fac965d97545e9bc1a8f0b6034451a38", "size": "9090", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/scala/com/highmaps/config/PlotOptionsSmaEvents.scala", "mode": "33188", "license": "mit", "language": [ { "name": "Scala", "bytes": "131509301" } ], "symlink_target": "" }
from settings.base import * import sys import urlparse DEBUG = False TEMPLATE_DEBUG = DEBUG SERVE_MEDIA = True INSTALLED_APPS += ['gunicorn'] CACHE_TIMEOUT = 60 * 60 * 24 urlparse.uses_netloc.append('postgres') urlparse.uses_netloc.append('mysql') try: if os.environ.has_key('DATABASE_URL'): url = urlparse.urlparse(os.environ['DATABASE_URL']) DATABASES = {} DATABASES['default'] = { 'NAME': url.path[1:], 'USER': url.username, 'PASSWORD': url.password, 'HOST': url.hostname, 'PORT': url.port, } if url.scheme == 'postgres': DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2' if url.scheme == 'mysql': DATABASES['default']['ENGINE'] = 'django.db.backends.mysql' except Exception as e: print "Unexpected error:", sys.exc_info() LOCAL_INSTALLED_APPS = [] LAUNCHPAD_ACTIVE = False # Analytics ID URCHIN_ID = "" # Email Settings DEFAULT_FROM_EMAIL = \ 'Django Packages <djangopackages-noreply@djangopackages.com>' EMAIL_SUBJECT_PREFIX = '[Django Packages] ' RESTRICT_PACKAGE_EDITORS = False RESTRICT_GRID_EDITORS = False ROOT_URLCONF = "app.urls" EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' SECRET_KEY = os.environ['SECRET_KEY'] GITHUB_API_SECRET = os.environ['GITHUB_API_SECRET'] GITHUB_APP_ID = os.environ['GITHUB_APP_ID'] SITE_TITLE = os.environ['SITE_TITLE'] FRAMEWORK_TITLE = os.environ['FRAMEWORK_TITLE'] PIWIK_CODE = """ <!-- Piwik --> <script type="text/javascript"> var pkBaseURL = (("https:" == document.location.protocol) ? "https://manage.cartwheelweb.com/piwik/" : "http://manage.cartwheelweb.com/piwik/"); document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); </script><script type="text/javascript"> try { var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 4); piwikTracker.trackPageView(); piwikTracker.enableLinkTracking(); } catch( err ) {} </script><noscript><p><img src="http://manage.cartwheelweb.com/piwik/piwik.php?idsite=4" style="border:0" alt="" /></p></noscript> <!-- End Piwik Tracking Code --> """ ########## STORAGE CONFIGURATION INSTALLED_APPS += ['storages', ] DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage' AWS_QUERYSTRING_AUTH = False AWS_HEADERS = { 'Expires': 'Thu, 15 Apr 2020 20:00:00 GMT', 'Cache-Control': 'max-age=86400', } # Boto requires subdomain formatting. from S3 import CallingFormat AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN # Amazon S3 configuration. if os.environ.has_key('S3_KEY'): AWS_ACCESS_KEY_ID = os.environ['S3_KEY'] AWS_SECRET_ACCESS_KEY = os.environ['S3_SECRET'] else: AWS_ACCESS_KEY_ID = AWS_KEY AWS_SECRET_ACCESS_KEY = AWS_SECRET_KEY AWS_STORAGE_BUCKET_NAME = 'opencomparison' STATIC_URL = 'https://s3.amazonaws.com/opencomparison/' MEDIA_URL = STATIC_URL ########## END STORAGE CONFIGURATION
{ "content_hash": "afae716cdd95613f6fadaec6fdb6042a", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 144, "avg_line_length": 28.57943925233645, "alnum_prop": 0.6742969260954872, "repo_name": "audreyr/opencomparison", "id": "5e21f1f4b4812e3a85b78b1fb48897012ff2b282", "size": "3058", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "settings/heroku.py", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "245807" }, { "name": "Python", "bytes": "572170" } ], "symlink_target": "" }
namespace More.Windows.Data { using More.ComponentModel; using System; using System.ComponentModel; using System.Diagnostics.Contracts; using static System.String; using static System.Text.RegularExpressions.Regex; using static System.Text.RegularExpressions.RegexOptions; /// <summary> /// Represents a numeric denomination inverse conversion rule. /// </summary> public class DenominationConvertBackRule : IRule<string, bool> { decimal denomination = 1m; /// <summary> /// Gets or sets the denomination associated with the rule. /// </summary> /// <value>The denomination associated with the rule. The default value is one.</value> public decimal Denomination { get { Contract.Ensures( Contract.Result<decimal>() > 0m ); return denomination; } set { Arg.GreaterThan( value, 0m, nameof( value ) ); denomination = value; } } /// <summary> /// Gets or sets the regular expression pattern associated with the rule. /// </summary> /// <value>The regular expression pattern associated with the rule.</value> public string RegexPattern { get; set; } /// <summary> /// Evaluates the rule. /// </summary> /// <param name="item">The <see cref="string">string</see> to evalute.</param> /// <returns>True if the rule is satisified; otherwise, false.</returns> public virtual bool Evaluate( string item ) => !IsNullOrEmpty( RegexPattern ) && IsMatch( item, RegexPattern, Singleline ); } }
{ "content_hash": "0e3c7588f91bb9e1b2710f55d43bec84", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 96, "avg_line_length": 34.7, "alnum_prop": 0.5884726224783862, "repo_name": "commonsensesoftware/More", "id": "d4b7dfc456d234dad56cc6cbcb4571c23e4d03f3", "size": "1737", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/More.UI.Presentation/Windows.Data/DenominationConvertBackRule.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "4062358" }, { "name": "Smalltalk", "bytes": "19010" } ], "symlink_target": "" }
AbsDecpackModule::AbsDecpackModule(const char* name, const char* title) : AppModule(name,title), _modeval(0), _mode("mode", this, 0) { commands( )->append( &_mode ); _mode.addDescription("mode: 0 - default, generator fills hepevt; 1 - QQ fills hepevt from hepg"); } //______________________________________________________________________________ AbsDecpackModule::~AbsDecpackModule() { } //______________________________________________________________________________ AppResult AbsDecpackModule::beginJob( AbsEvent* job ) { _modeval = _mode.value(); return genBeginJob(); } //______________________________________________________________________________ AppResult AbsDecpackModule::beginRun( AbsEvent* aRun ) { return genBeginRun(aRun); } AppResult AbsDecpackModule::endRun( AbsEvent* aRun ) { return genEndRun(aRun); } AppResult AbsDecpackModule::endJob( AbsEvent* aJob ) { return genEndJob(); } //______________________________________________________________________________ AppResult AbsDecpackModule::event(AbsEvent* event) { CdfHepevt* hepevt = CdfHepevt::Instance(); if ( _modeval ) { hepevt->initFromHepg(); } int rc = 0; hepevt->clearCommon(); // overkill... for( std::list<Hepevt*>::iterator i = hepevt->contentHepevt().begin(); i != hepevt->contentHepevt().end(); ++i ) { hepevt->list2common(i); rc = this->callGenerator(event); if ( !rc ) { std::cerr << "AbsDecpackModule: Error in decay package. "; std::cerr << std::endl; } hepevt->common2list(i); Tauevt* tau = new Tauevt( *(hepevt->TauevtPtr()) ); hepevt->contentTauevt().push_back(tau); hepevt->clearCommon(); } return AppResult::OK; }
{ "content_hash": "d4f5112bbd0420244fb2598283885fa4", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 100, "avg_line_length": 26.104477611940297, "alnum_prop": 0.5180102915951973, "repo_name": "iamaris/CDFCodes", "id": "c9f7dda9a1e16109e40ad2f3f5fb8d6fde45a5b5", "size": "2434", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pythia/generatorMods/src/AbsDecpackModule.cc", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1738" }, { "name": "C++", "bytes": "1531934" }, { "name": "D", "bytes": "1090254" }, { "name": "FORTRAN", "bytes": "2812614" }, { "name": "JavaScript", "bytes": "630" }, { "name": "Objective-C", "bytes": "128144" }, { "name": "Perl", "bytes": "12680" }, { "name": "Python", "bytes": "10910" }, { "name": "R", "bytes": "218" }, { "name": "Ruby", "bytes": "19273" }, { "name": "Scala", "bytes": "15398" }, { "name": "Shell", "bytes": "13283" }, { "name": "Tcl", "bytes": "153354" } ], "symlink_target": "" }
package com.hjhrq1991.tool.Util; import android.view.View; import android.view.inputmethod.InputMethodManager; import static android.content.Context.INPUT_METHOD_SERVICE; /** * Keyboard utilities */ public class Keyboard { /** * Hide soft input method manager * * @param view * @return view */ public static View hideSoftInput(final View view) { InputMethodManager manager = (InputMethodManager) view.getContext() .getSystemService(INPUT_METHOD_SERVICE); if (manager != null) manager.hideSoftInputFromWindow(view.getWindowToken(), 0); return view; } }
{ "content_hash": "febfc44ad0624aa5abcdaa63647a67c4", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 71, "avg_line_length": 22.214285714285715, "alnum_prop": 0.6929260450160771, "repo_name": "hjhrq1991/C-Car", "id": "5666dd7d040e2dd878ae18dac0623fe4511a5eab", "size": "622", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Common/src/main/java/com/hjhrq1991/tool/Util/Keyboard.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "992064" } ], "symlink_target": "" }
'use strict' const https = require('https') var userName = process.argv[2] var accessKey = process.argv[3] var tunnelName = process.argv[4] function removeTunnel () { const requestPath = `/rest/v1/${userName}/tunnels` console.log(requestPath) callSauce(requestPath, 'GET', function (error, result) { if (error) { console.log(error) } else { var data = JSON.parse(result) for (var k in data) { retrieveTunnel(data[k], function (error, result) { if (error) { console.log(error) } else if (result.identtifier === tunnelName) { deleteTunnel(result.id, function () { console.log('tunnel deleted ' + data[k] + ' ' + tunnelName) }) } }) } } }) } function retrieveTunnel (tunnelid, callback) { const requestPath = `/rest/v1/${userName}/tunnels/${tunnelid}` callSauce(requestPath, 'GET', function (error, result) { if (error) { callback(error) } else { callback(null, {'identtifier': JSON.parse(result).tunnel_identifier, 'id': tunnelid}) } }) } function deleteTunnel (tunnelid, callback) { const requestPath = `/rest/v1/${userName}/tunnels/${tunnelid}` callSauce(requestPath, 'DELETE', callback) } function callSauce (requestPath, type, callback) { function responseCallback (res) { res.setEncoding('utf8') console.log('Response: ', res.statusCode, JSON.stringify(res.headers)) res.on('data', function onData (chunk) { console.log('BODY: ' + chunk) callback(null, chunk) }) res.on('end', function onEnd () {}) } var req = https.request({ hostname: 'saucelabs.com', path: requestPath, method: type, auth: userName + ':' + accessKey }, responseCallback) req.on('error', function onError (e) { console.log('problem with request: ' + e.message) callback(e.message) }) req.write('') req.end() } removeTunnel()
{ "content_hash": "830aeb157f5a049711f14d31d15a69b2", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 91, "avg_line_length": 26.37837837837838, "alnum_prop": 0.6142418032786885, "repo_name": "serapath-contribution/browser-solidity", "id": "4490a586383b971f8ded44423406372875876120", "size": "1952", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "ci/sauceDisconnect.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4168" }, { "name": "HTML", "bytes": "1638" }, { "name": "JavaScript", "bytes": "436050" }, { "name": "Shell", "bytes": "4049" } ], "symlink_target": "" }
import { browser, element, by } from 'protractor'; export class EventforcePage { navigateTo() { return browser.get('/'); } getParagraphText() { return element(by.css('app-root h1')).getText(); } }
{ "content_hash": "8d1783d45657a0e623b381460ca5ae88", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 52, "avg_line_length": 19.545454545454547, "alnum_prop": 0.6372093023255814, "repo_name": "sean-perkins/eventforce", "id": "73bcf82307e5fca8bfde3bce72a8e1ee3b637c63", "size": "215", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/client/e2e/app.po.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "7593" }, { "name": "HTML", "bytes": "11237" }, { "name": "JavaScript", "bytes": "1996" }, { "name": "TypeScript", "bytes": "77952" } ], "symlink_target": "" }
package ru.job4j.loop; import org.junit.Test; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; /** *Test. * *@author akulabuhov (mailto:jkulabuha@yandex.ru) *@version $ld$ *@since 0.1 */ public class CounterTest { /** * Test counter. */ @Test public void whenSumEvenNumbersFromOneToTenThenThirty() { Counter test = new Counter(); int result = test.add(1, 10); assertThat(result, is(30)); } }
{ "content_hash": "871499a2acf347ea6026cdcdd623f6c9", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 60, "avg_line_length": 18.5, "alnum_prop": 0.6959459459459459, "repo_name": "jkulabuha/akulabuhov", "id": "6e97fb0d98e24e83ea4fb99e32d790faca2d1298", "size": "444", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chapter_001/src/test/java/ru/job4j/loop/CounterTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "40440" } ], "symlink_target": "" }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__delete_array_char_realloc_41.cpp Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete_array.label.xml Template File: sources-sinks-41.tmpl.cpp */ /* * @description * CWE: 762 Mismatched Memory Management Routines * BadSource: realloc Allocate data using realloc() * GoodSource: Allocate data using new [] * Sinks: * GoodSink: Deallocate data using free() * BadSink : Deallocate data using delete [] * Flow Variant: 41 Data flow: data passed as an argument from one function to another in the same source file * * */ #include "std_testcase.h" namespace CWE762_Mismatched_Memory_Management_Routines__delete_array_char_realloc_41 { #ifndef OMITBAD static void badSink(char * data) { /* POTENTIAL FLAW: Deallocate memory using delete [] - the source memory allocation function may * require a call to free() to deallocate the memory */ delete [] data; } void bad() { char * data; /* Initialize data*/ data = NULL; data = NULL; /* POTENTIAL FLAW: Allocate memory with a function that requires free() to free the memory */ data = (char *)realloc(data, 100*sizeof(char)); badSink(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B() uses the GoodSource with the BadSink */ static void goodG2BSink(char * data) { /* POTENTIAL FLAW: Deallocate memory using delete [] - the source memory allocation function may * require a call to free() to deallocate the memory */ delete [] data; } static void goodG2B() { char * data; /* Initialize data*/ data = NULL; /* FIX: Allocate memory using new [] */ data = new char[100]; goodG2BSink(data); } /* goodB2G() uses the BadSource with the GoodSink */ static void goodB2GSink(char * data) { /* FIX: Free memory using free() */ free(data); } static void goodB2G() { char * data; /* Initialize data*/ data = NULL; data = NULL; /* POTENTIAL FLAW: Allocate memory with a function that requires free() to free the memory */ data = (char *)realloc(data, 100*sizeof(char)); goodB2GSink(data); } void good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE762_Mismatched_Memory_Management_Routines__delete_array_char_realloc_41; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
{ "content_hash": "b69993bb5908474c0564042e839d8bb5", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 136, "avg_line_length": 26.907563025210084, "alnum_prop": 0.6533416614615865, "repo_name": "maurer/tiamat", "id": "59fc87e1e48075e312d5fda0c29d7cb1dce41f8a", "size": "3202", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "samples/Juliet/testcases/CWE762_Mismatched_Memory_Management_Routines/s01/CWE762_Mismatched_Memory_Management_Routines__delete_array_char_realloc_41.cpp", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
ALTER TABLE replication_policy ADD COLUMN IF NOT EXISTS copy_by_chunk boolean; CREATE TABLE IF NOT EXISTS job_queue_status ( id SERIAL NOT NULL PRIMARY KEY, job_type varchar(256) NOT NULL, paused boolean NOT NULL DEFAULT false, update_time timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE ("job_type") );
{ "content_hash": "ff128452cd4358907239a65d965ff68b", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 80, "avg_line_length": 40.55555555555556, "alnum_prop": 0.7013698630136986, "repo_name": "wy65701436/harbor", "id": "377ab11b1e82c4f69491f7481ce6516fce2f74bf", "size": "365", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "make/migrations/postgresql/0100_2.7.0_schema.up.sql", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2122" }, { "name": "Dockerfile", "bytes": "17013" }, { "name": "Go", "bytes": "5543957" }, { "name": "HTML", "bytes": "857388" }, { "name": "JavaScript", "bytes": "8987" }, { "name": "Jinja", "bytes": "199133" }, { "name": "Makefile", "bytes": "41515" }, { "name": "PLpgSQL", "bytes": "11799" }, { "name": "Python", "bytes": "532665" }, { "name": "RobotFramework", "bytes": "482646" }, { "name": "SCSS", "bytes": "113564" }, { "name": "Shell", "bytes": "81765" }, { "name": "Smarty", "bytes": "1931" }, { "name": "TypeScript", "bytes": "2048995" } ], "symlink_target": "" }
using System; using System.Runtime.InteropServices; namespace SharpVk { /// <summary> /// /// </summary> [StructLayout(LayoutKind.Sequential)] public partial struct PhysicalDeviceExternalImageFormatInfo { /// <summary> /// /// </summary> public SharpVk.ExternalMemoryHandleTypeFlags? HandleType { get; set; } /// <summary> /// /// </summary> /// <param name="pointer"> /// </param> internal unsafe void MarshalTo(SharpVk.Interop.PhysicalDeviceExternalImageFormatInfo* pointer) { pointer->SType = StructureType.PhysicalDeviceExternalImageFormatInfoVersion; pointer->Next = null; if (this.HandleType != null) { pointer->HandleType = this.HandleType.Value; } else { pointer->HandleType = default(SharpVk.ExternalMemoryHandleTypeFlags); } } } }
{ "content_hash": "06ac07aac009cceda0e54757853f25fe", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 102, "avg_line_length": 26.15, "alnum_prop": 0.5334608030592735, "repo_name": "FacticiusVir/SharpVk", "id": "3160fdab8bd39ee18539abedc10438bdfbd9526b", "size": "2283", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/SharpVk/PhysicalDeviceExternalImageFormatInfo.gen.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "5249731" } ], "symlink_target": "" }
Wallet Tools --------------------- ### [SpendFrom](/contrib/spendfrom) ### Use the raw transactions API to send coins received on a particular address (or addresses). Repository Tools --------------------- ### [Developer tools](/contrib/devtools) ### Specific tools for developers working on this repository. Contains the script `github-merge.sh` for merging github pull requests securely and signing them using GPG. ### [Verify-Commits](/contrib/verify-commits) ### Tool to verify that every merge commit was signed by a developer using the above `github-merge.sh` script. ### [Linearize](/contrib/linearize) ### Construct a linear, no-fork, best version of the blockchain. ### [Qos](/contrib/qos) ### A Linux bash script that will set up traffic control (tc) to limit the outgoing bandwidth for connections to the Sprint network. This means one can have an always-on sprintd instance running, and another local sprintd/sprint-qt instance which connects to this node and receives blocks from it. ### [Seeds](/contrib/seeds) ### Utility to generate the pnSeed[] array that is compiled into the client. Build Tools and Keys --------------------- ### [Debian](/contrib/debian) ### Contains files used to package sprintd/sprint-qt for Debian-based Linux systems. If you compile sprintd/sprint-qt yourself, there are some useful files here. ### [Gitian-descriptors](/contrib/gitian-descriptors) ### Gavin's notes on getting gitian builds up and running using KVM. ### [Gitian-downloader](/contrib/gitian-downloader) Various PGP files of core developers. ### [MacDeploy](/contrib/macdeploy) ### Scripts and notes for Mac builds. Test and Verify Tools --------------------- ### [TestGen](/contrib/testgen) ### Utilities to generate test vectors for the data-driven Sprint tests. ### [Test Patches](/contrib/test-patches) ### These patches are applied when the automated pull-tester tests each pull and when master is tested using jenkins. ### [Verify SF Binaries](/contrib/verifysfbinaries) ### This script attempts to download and verify the signature file SHA256SUMS.asc from SourceForge.
{ "content_hash": "87ffc929d5453c95bcbdffddd6d1f37c", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 293, "avg_line_length": 37.607142857142854, "alnum_prop": 0.7255460588793922, "repo_name": "BurningMan44/SprintCoin", "id": "22a534610d23713dd72d4fae717ee0a52cd9ad52", "size": "2106", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "contrib/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1315051" }, { "name": "C++", "bytes": "5290405" }, { "name": "CSS", "bytes": "124335" }, { "name": "HTML", "bytes": "50621" }, { "name": "Java", "bytes": "2100" }, { "name": "M4", "bytes": "147909" }, { "name": "Makefile", "bytes": "144545" }, { "name": "Objective-C", "bytes": "4951" }, { "name": "Objective-C++", "bytes": "7228" }, { "name": "Python", "bytes": "706509" }, { "name": "QMake", "bytes": "2057" }, { "name": "Roff", "bytes": "3766" }, { "name": "Shell", "bytes": "35722" } ], "symlink_target": "" }
namespace lslboost { namespace mpl { namespace aux { template< bool > struct resolve_arg_impl { template< typename T, typename U1, typename U2, typename U3 , typename U4, typename U5 > struct result_ { typedef T type; }; }; template<> struct resolve_arg_impl<true> { template< typename T, typename U1, typename U2, typename U3 , typename U4, typename U5 > struct result_ { typedef typename apply_wrap5< T , U1, U2, U3, U4, U5 >::type type; }; }; template< typename T > struct is_bind_template; template< typename T, typename U1, typename U2, typename U3, typename U4 , typename U5 > struct resolve_bind_arg : resolve_arg_impl< is_bind_template<T>::value > ::template result_< T,U1,U2,U3,U4,U5 > { }; template< typename T > struct replace_unnamed_arg_impl { template< typename Arg > struct result_ { typedef Arg next; typedef T type; }; }; template<> struct replace_unnamed_arg_impl< arg< -1 > > { template< typename Arg > struct result_ { typedef typename next<Arg>::type next; typedef Arg type; }; }; template< typename T, typename Arg > struct replace_unnamed_arg : replace_unnamed_arg_impl<T>::template result_<Arg> { }; template< int arity_ > struct bind_chooser; aux::no_tag is_bind_helper(...); template< typename T > aux::no_tag is_bind_helper(protect<T>*); template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > aux::yes_tag is_bind_helper(bind< F,T1,T2,T3,T4,T5 >*); template< int N > aux::yes_tag is_bind_helper(arg<N>*); template< bool is_ref_ = true > struct is_bind_template_impl { template< typename T > struct result_ { BOOST_STATIC_CONSTANT(bool, value = false); }; }; template<> struct is_bind_template_impl<false> { template< typename T > struct result_ { BOOST_STATIC_CONSTANT(bool, value = sizeof(aux::is_bind_helper(static_cast<T*>(0))) == sizeof(aux::yes_tag) ); }; }; template< typename T > struct is_bind_template : is_bind_template_impl< ::lslboost::detail::is_reference_impl<T>::value > ::template result_<T> { }; } // namespace aux template< typename F > struct bind0 { template< typename U1 = na, typename U2 = na, typename U3 = na , typename U4 = na, typename U5 = na > struct apply { private: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; typedef typename r0::type a0; typedef typename r0::next n1; typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; /// public: typedef typename apply_wrap0< f_ >::type type; }; }; namespace aux { template< typename F > aux::yes_tag is_bind_helper(bind0<F>*); } // namespace aux BOOST_MPL_AUX_ARITY_SPEC(1, bind0) BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0) namespace aux { template<> struct bind_chooser<0> { template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct result_ { typedef bind0<F> type; }; }; } // namespace aux template< typename F, typename T1 > struct bind1 { template< typename U1 = na, typename U2 = na, typename U3 = na , typename U4 = na, typename U5 = na > struct apply { private: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; typedef typename r0::type a0; typedef typename r0::next n1; typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; /// typedef aux::replace_unnamed_arg< T1,n1 > r1; typedef typename r1::type a1; typedef typename r1::next n2; typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1; /// public: typedef typename apply_wrap1< f_ , typename t1::type >::type type; }; }; namespace aux { template< typename F, typename T1 > aux::yes_tag is_bind_helper(bind1< F,T1 >*); } // namespace aux BOOST_MPL_AUX_ARITY_SPEC(2, bind1) BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1) namespace aux { template<> struct bind_chooser<1> { template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct result_ { typedef bind1< F,T1 > type; }; }; } // namespace aux template< typename F, typename T1, typename T2 > struct bind2 { template< typename U1 = na, typename U2 = na, typename U3 = na , typename U4 = na, typename U5 = na > struct apply { private: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; typedef typename r0::type a0; typedef typename r0::next n1; typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; /// typedef aux::replace_unnamed_arg< T1,n1 > r1; typedef typename r1::type a1; typedef typename r1::next n2; typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1; /// typedef aux::replace_unnamed_arg< T2,n2 > r2; typedef typename r2::type a2; typedef typename r2::next n3; typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2; /// public: typedef typename apply_wrap2< f_ , typename t1::type, typename t2::type >::type type; }; }; namespace aux { template< typename F, typename T1, typename T2 > aux::yes_tag is_bind_helper(bind2< F,T1,T2 >*); } // namespace aux BOOST_MPL_AUX_ARITY_SPEC(3, bind2) BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2) namespace aux { template<> struct bind_chooser<2> { template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct result_ { typedef bind2< F,T1,T2 > type; }; }; } // namespace aux template< typename F, typename T1, typename T2, typename T3 > struct bind3 { template< typename U1 = na, typename U2 = na, typename U3 = na , typename U4 = na, typename U5 = na > struct apply { private: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; typedef typename r0::type a0; typedef typename r0::next n1; typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; /// typedef aux::replace_unnamed_arg< T1,n1 > r1; typedef typename r1::type a1; typedef typename r1::next n2; typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1; /// typedef aux::replace_unnamed_arg< T2,n2 > r2; typedef typename r2::type a2; typedef typename r2::next n3; typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2; /// typedef aux::replace_unnamed_arg< T3,n3 > r3; typedef typename r3::type a3; typedef typename r3::next n4; typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3; /// public: typedef typename apply_wrap3< f_ , typename t1::type, typename t2::type, typename t3::type >::type type; }; }; namespace aux { template< typename F, typename T1, typename T2, typename T3 > aux::yes_tag is_bind_helper(bind3< F,T1,T2,T3 >*); } // namespace aux BOOST_MPL_AUX_ARITY_SPEC(4, bind3) BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3) namespace aux { template<> struct bind_chooser<3> { template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct result_ { typedef bind3< F,T1,T2,T3 > type; }; }; } // namespace aux template< typename F, typename T1, typename T2, typename T3, typename T4 > struct bind4 { template< typename U1 = na, typename U2 = na, typename U3 = na , typename U4 = na, typename U5 = na > struct apply { private: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; typedef typename r0::type a0; typedef typename r0::next n1; typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; /// typedef aux::replace_unnamed_arg< T1,n1 > r1; typedef typename r1::type a1; typedef typename r1::next n2; typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1; /// typedef aux::replace_unnamed_arg< T2,n2 > r2; typedef typename r2::type a2; typedef typename r2::next n3; typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2; /// typedef aux::replace_unnamed_arg< T3,n3 > r3; typedef typename r3::type a3; typedef typename r3::next n4; typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3; /// typedef aux::replace_unnamed_arg< T4,n4 > r4; typedef typename r4::type a4; typedef typename r4::next n5; typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4; /// public: typedef typename apply_wrap4< f_ , typename t1::type, typename t2::type, typename t3::type , typename t4::type >::type type; }; }; namespace aux { template< typename F, typename T1, typename T2, typename T3, typename T4 > aux::yes_tag is_bind_helper(bind4< F,T1,T2,T3,T4 >*); } // namespace aux BOOST_MPL_AUX_ARITY_SPEC(5, bind4) BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4) namespace aux { template<> struct bind_chooser<4> { template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct result_ { typedef bind4< F,T1,T2,T3,T4 > type; }; }; } // namespace aux template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct bind5 { template< typename U1 = na, typename U2 = na, typename U3 = na , typename U4 = na, typename U5 = na > struct apply { private: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; typedef typename r0::type a0; typedef typename r0::next n1; typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; /// typedef aux::replace_unnamed_arg< T1,n1 > r1; typedef typename r1::type a1; typedef typename r1::next n2; typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1; /// typedef aux::replace_unnamed_arg< T2,n2 > r2; typedef typename r2::type a2; typedef typename r2::next n3; typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2; /// typedef aux::replace_unnamed_arg< T3,n3 > r3; typedef typename r3::type a3; typedef typename r3::next n4; typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3; /// typedef aux::replace_unnamed_arg< T4,n4 > r4; typedef typename r4::type a4; typedef typename r4::next n5; typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4; /// typedef aux::replace_unnamed_arg< T5,n5 > r5; typedef typename r5::type a5; typedef typename r5::next n6; typedef aux::resolve_bind_arg< a5,U1,U2,U3,U4,U5 > t5; /// public: typedef typename apply_wrap5< f_ , typename t1::type, typename t2::type, typename t3::type , typename t4::type, typename t5::type >::type type; }; }; namespace aux { template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > aux::yes_tag is_bind_helper(bind5< F,T1,T2,T3,T4,T5 >*); } // namespace aux BOOST_MPL_AUX_ARITY_SPEC(6, bind5) BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5) namespace aux { template<> struct bind_chooser<5> { template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct result_ { typedef bind5< F,T1,T2,T3,T4,T5 > type; }; }; } // namespace aux namespace aux { template< typename T > struct is_bind_arg { BOOST_STATIC_CONSTANT(bool, value = true); }; template<> struct is_bind_arg<na> { BOOST_STATIC_CONSTANT(bool, value = false); }; template< typename T1, typename T2, typename T3, typename T4, typename T5 > struct bind_count_args { BOOST_STATIC_CONSTANT(int, value = is_bind_arg<T1>::value + is_bind_arg<T2>::value + is_bind_arg<T3>::value + is_bind_arg<T4>::value + is_bind_arg<T5>::value ); }; } template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct bind : aux::bind_chooser< aux::bind_count_args< T1,T2,T3,T4,T5 >::value >::template result_< F,T1,T2,T3,T4,T5 >::type { }; BOOST_MPL_AUX_ARITY_SPEC( 6 , bind ) BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC( 6 , bind ) }}
{ "content_hash": "08b5e845c63b18663379021fc800d30d", "timestamp": "", "source": "github", "line_count": 578, "max_line_length": 78, "avg_line_length": 22.86159169550173, "alnum_prop": 0.5768881489329499, "repo_name": "gazzlab/LSL-gazzlab-branch", "id": "171abbf0c0ae01b307e1a73b100b48a59151856b", "size": "13541", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "liblsl/external/lslboost/mpl/aux_/preprocessed/no_ctps/bind.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "63003" }, { "name": "C++", "bytes": "53791427" }, { "name": "Objective-C", "bytes": "39516" }, { "name": "Perl", "bytes": "2051" }, { "name": "Python", "bytes": "4119" }, { "name": "Shell", "bytes": "2310" } ], "symlink_target": "" }
require "google/cloud/iot/v1" ## # Example demonstrating basic usage of # Google::Cloud::Iot::V1::DeviceManager::Client#bind_device_to_gateway # def bind_device_to_gateway # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Iot::V1::DeviceManager::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Iot::V1::BindDeviceToGatewayRequest.new # Call the bind_device_to_gateway method. result = client.bind_device_to_gateway request # The returned object is of type Google::Cloud::Iot::V1::BindDeviceToGatewayResponse. p result end # [END cloudiot_v1_generated_DeviceManager_BindDeviceToGateway_sync]
{ "content_hash": "d1254baae13b41928d6acf9d476e7154", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 87, "avg_line_length": 35.7, "alnum_prop": 0.7591036414565826, "repo_name": "googleapis/google-cloud-ruby", "id": "a4f85789ab7c024ab9548f37eb1ff90b0ad2ec1c", "size": "1448", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "google-cloud-iot-v1/snippets/device_manager/bind_device_to_gateway.rb", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "23930" }, { "name": "CSS", "bytes": "1422" }, { "name": "DIGITAL Command Language", "bytes": "2216" }, { "name": "Go", "bytes": "1321" }, { "name": "HTML", "bytes": "66414" }, { "name": "JavaScript", "bytes": "1862" }, { "name": "Ruby", "bytes": "103945852" }, { "name": "Shell", "bytes": "19653" } ], "symlink_target": "" }
package com.google.javascript.jscomp; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback; import com.google.javascript.rhino.JSDocInfo; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.jstype.FunctionType; import com.google.javascript.rhino.jstype.JSType; import com.google.javascript.rhino.jstype.ObjectType; import javax.annotation.Nullable; /** * Sets the {@link JSDocInfo} on all {@code JSType}s, including their properties, using the JSDoc on * the node defining that type or property. * * <p>This pass propagates JSDocs across the type graph, but not across the symbol graph. For * example: * * <pre>{@code * /** * * I'm a user type! * * @constructor * *\/ * var Foo = function() { }; * * var Bar = Foo; * }</pre> * * will assign the "I'm a user type!" JSDoc from the `Foo` node to type "Foo" and type "ctor{Foo}". * However, this pass says nothing about JSDocs being propagated to the `Bar` node. * * <p>JSDoc is initially attached to AST Nodes at parse time. There are 3 cases where JSDocs get * attached to the type system, always from the associated declaration node: * * <ul> * <li>Nominal types (e.g. constructors, interfaces, enums). * <li>Object type properties (e.g. `Foo.prototype.bar`). * <li>Anonymous structural types, including functions. (Some function types with the same * signature are unique and therefore can have distinct JSDocs.) (b/111070482: it's unclear * why we support this.) * </ul> * * <p>#1 is fairly straight-forward with the additional detail that JSDocs are propagated to both * the instance type <em>and</em> the declaration type (i.e. the ctor or enum type). #2 should also * be mostly self-explanatory; it covers scenarios like the following: * * <pre>{@code * /** * * I'm a method! * * @param {number} x * * @return {number} * *\/ * Foo.prototype.bar = function(x) { ... }; * }</pre> * * in which JSDocInfo will appear on the "bar" slot of `Foo.prototype` and `Foo`. The function type * used as the RHS of the assignments (i.e. `function(this:Foo, number): number`) is not considered. * Note that this example would work equally well if `bar` were declared abstract. #3 is a bit * trickier; it covers types such as the following declarations: * * <pre>{@code * /** I'm an anonymous structural object type! *\/ * var myObject = {a: 5, b: 'Hello'}; * * /** * * I'm an anonymous structural function type! * * @param {number} x * * @return {string} * *\/ * var myFunction = function(x) { ... }; * * }</pre> * * which define unique types with their own JSDoc attributes. Object literal or function types with * the same structure will get different JSDocs despite possibly comparing equal. Additionally, when * assigning instances of these types as properties of nominal types (e.g. using `myFunction` as the * RHS of #2) the structural type JSDoc plays no part. */ class InferJSDocInfo extends AbstractPostOrderCallback implements HotSwapCompilerPass { private final AbstractCompiler compiler; InferJSDocInfo(AbstractCompiler compiler) { this.compiler = compiler; } @Override public void process(Node externs, Node root) { if (externs != null) { NodeTraversal.traverse(compiler, externs, this); } if (root != null) { NodeTraversal.traverse(compiler, root, this); } } @Override public void hotSwapScript(Node root, Node originalRoot) { checkNotNull(root); checkState(root.isScript()); NodeTraversal.traverse(compiler, root, this); } @Override public void visit(NodeTraversal t, Node n, Node parent) { switch (n.getToken()) { // Infer JSDocInfo on types of all type declarations on variables. case NAME: { if (parent == null) { return; } // Only allow JSDoc on variable declarations, named functions, named classes, and assigns. final JSDocInfo typeDoc; final JSType inferredType; if (NodeUtil.isNameDeclaration(parent)) { // Case: `/** ... */ (var|let|const) x = function() { ... }`. // Case: `(var|let|const) /** ... */ x = function() { ... }`. JSDocInfo nameInfo = n.getJSDocInfo(); typeDoc = (nameInfo != null) ? nameInfo : parent.getJSDocInfo(); inferredType = n.getJSType(); } else if (NodeUtil.isFunctionDeclaration(parent) || NodeUtil.isClassDeclaration(parent)) { // Case: `/** ... */ function f() { ... }`. // Case: `/** ... */ class Foo() { ... }`. typeDoc = parent.getJSDocInfo(); inferredType = parent.getJSType(); } else if (parent.isAssign() && n.isFirstChildOf(parent)) { // Case: `/** ... */ x = function () { ... }` typeDoc = parent.getJSDocInfo(); inferredType = n.getJSType(); } else { return; } if (typeDoc == null) { return; } // If we have no type, or the type already has a JSDocInfo, then we're done. ObjectType objType = dereferenced(inferredType); if (objType == null || objType.getJSDocInfo() != null) { return; } attachJSDocInfoToNominalTypeOrShape(objType, typeDoc, n.getString()); } return; case STRING_KEY: case GETTER_DEF: case SETTER_DEF: case MEMBER_FUNCTION_DEF: { JSDocInfo typeDoc = n.getJSDocInfo(); if (typeDoc == null) { return; } final ObjectType owningType; if (parent.isClassMembers()) { FunctionType ctorType = JSType.toMaybeFunctionType(parent.getParent().getJSType()); if (ctorType == null) { return; } owningType = n.isStaticMember() ? ctorType : ctorType.getPrototype(); } else { owningType = dereferenced(parent.getJSType()); } if (owningType == null) { return; } String propName = n.getString(); if (owningType.hasOwnProperty(propName)) { owningType.setPropertyJSDocInfo(propName, typeDoc); } } return; case GETPROP: { // Infer JSDocInfo on properties. // There are two ways to write doc comments on a property. final JSDocInfo typeDoc; if (parent.isAssign() && n.isFirstChildOf(parent)) { // Case: `/** @deprecated */ obj.prop = ...;` typeDoc = parent.getJSDocInfo(); } else if (parent.isExprResult()) { // Case: `/** @deprecated */ obj.prop;` typeDoc = n.getJSDocInfo(); } else { return; } if (typeDoc == null || !typeDoc.containsDeclaration()) { return; } ObjectType lhsType = dereferenced(n.getFirstChild().getJSType()); if (lhsType == null) { return; } // Put the JSDoc in the property slot, if there is one. String propName = n.getLastChild().getString(); if (lhsType.hasOwnProperty(propName)) { lhsType.setPropertyJSDocInfo(propName, typeDoc); } // Put the JSDoc in any constructors or function shapes as well. ObjectType propType = dereferenced(lhsType.getPropertyType(propName)); if (propType != null) { attachJSDocInfoToNominalTypeOrShape(propType, typeDoc, n.getQualifiedName()); } } return; default: return; } } /** Nullsafe wrapper for {@code JSType#dereference()}. */ private static ObjectType dereferenced(@Nullable JSType type) { return type == null ? null : type.dereference(); } /** Handle cases #1 and #3 in the class doc. */ private static void attachJSDocInfoToNominalTypeOrShape( ObjectType objType, JSDocInfo docInfo, @Nullable String qName) { if (objType.isConstructor() || objType.isInterface()) { if (!isReferenceNameOf(objType, qName)) { return; } objType.setJSDocInfo(docInfo); JSType.toMaybeFunctionType(objType).getInstanceType().setJSDocInfo(docInfo); } else if (objType.isEnumType()) { // Given: `/** @enum {number} */ MyEnum = { FOO: 0 };` // Then: typeOf(MyEnum).referenceName() == "enum{MyEnum}" // Then: typeOf(MyEnum.FOO).referenceName() == "MyEnum" ObjectType elementType = objType.toMaybeEnumType().getElementsType(); if (!isReferenceNameOf(elementType, qName)) { return; } objType.setJSDocInfo(docInfo); elementType.setJSDocInfo(docInfo); } else if (!objType.isNativeObjectType() && objType.isFunctionType()) { // Anonymous function types identified by their parameter and return types. Remember there can // be many unique but equal instances. objType.setJSDocInfo(docInfo); } } private static boolean isReferenceNameOf(ObjectType type, String name) { return type.hasReferenceName() && type.getReferenceName().equals(name); } }
{ "content_hash": "db7c84ff5d9d270268fd63a339cc8203", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 100, "avg_line_length": 34.832089552238806, "alnum_prop": 0.615532940546331, "repo_name": "vobruba-martin/closure-compiler", "id": "8cd3b9cb9ec7862ab4984b1ac0f3763062b36275", "size": "9947", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/com/google/javascript/jscomp/InferJSDocInfo.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "2098" }, { "name": "Java", "bytes": "16555335" }, { "name": "JavaScript", "bytes": "7281930" }, { "name": "Shell", "bytes": "724" } ], "symlink_target": "" }
using System.Windows.Media; using Cirrious.CrossCore.UI; namespace MvvmCross.Plugins.Color.WindowsPhone { public class MvxWindowsPhoneColor : IMvxNativeColor { public object ToNative(MvxColor mvxColor) { var color = ToNativeColor(mvxColor); return new SolidColorBrush(color); } public static System.Windows.Media.Color ToNativeColor(MvxColor mvxColor) { return System.Windows.Media.Color.FromArgb((byte) mvxColor.A, (byte) mvxColor.R, (byte) mvxColor.G, (byte) mvxColor.B); } } }
{ "content_hash": "65a137eb08ec565c2c57b14822677a65", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 111, "avg_line_length": 31.6, "alnum_prop": 0.6044303797468354, "repo_name": "MatthewSannes/MvvmCross-Plugins", "id": "6df3a7b4b9a932b18de2b799f5396267536e314a", "size": "907", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Color/MvvmCross.Plugins.Color.WindowsPhone/MvxWindowsPhoneColor.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "5211" }, { "name": "C#", "bytes": "885682" }, { "name": "PowerShell", "bytes": "5282" }, { "name": "Puppet", "bytes": "10798" } ], "symlink_target": "" }
/** * @constructor * @param {string} className * @param {!Element=} parentElement */ WebInspector.Toolbar = function(className, parentElement) { /** @type {!Array.<!WebInspector.ToolbarItem>} */ this._items = []; this._reverse = false; this.element = parentElement ? parentElement.createChild("div") : createElement("div"); this.element.className = className; this.element.classList.add("toolbar"); this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, "ui/toolbar.css"); this._contentElement = this._shadowRoot.createChild("div", "toolbar-shadow"); this._insertionPoint = this._contentElement.createChild("content"); } WebInspector.Toolbar.prototype = { /** * @param {boolean=} reverse */ makeWrappable: function(reverse) { this._contentElement.classList.add("wrappable"); this._reverse = !!reverse; if (reverse) this._contentElement.classList.add("wrappable-reverse"); }, makeVertical: function() { this._contentElement.classList.add("vertical"); }, makeBlueOnHover: function() { this._contentElement.classList.add("toolbar-blue-on-hover"); }, makeToggledGray: function() { this._contentElement.classList.add("toolbar-toggled-gray"); }, renderAsLinks: function() { this._contentElement.classList.add("toolbar-render-as-links"); }, /** * @param {boolean} enabled */ setEnabled: function(enabled) { for (var item of this._items) item.setEnabled(enabled); }, /** * @param {!WebInspector.ToolbarItem} item */ appendToolbarItem: function(item) { this._items.push(item); item._toolbar = this; if (this._reverse) this._contentElement.insertBefore(item.element, this._insertionPoint.nextSibling); else this._contentElement.insertBefore(item.element, this._insertionPoint); this._hideSeparatorDupes(); }, appendSeparator: function() { this.appendToolbarItem(new WebInspector.ToolbarSeparator()); }, appendSpacer: function() { this.appendToolbarItem(new WebInspector.ToolbarSeparator(true)); }, /** * @param {string} text */ appendText: function(text) { this.appendToolbarItem(new WebInspector.ToolbarText(text)); }, removeToolbarItems: function() { for (var item of this._items) delete item._toolbar; this._items = []; this._contentElement.removeChildren(); this._insertionPoint = this._contentElement.createChild("content"); }, /** * @param {string} color */ setColor: function(color) { var style = createElement("style"); style.textContent = ".toolbar-glyph { background-color: " + color + " !important }"; this._shadowRoot.appendChild(style); }, /** * @param {string} color */ setToggledColor: function(color) { var style = createElement("style"); style.textContent = ".toolbar-button.toolbar-state-on .toolbar-glyph { background-color: " + color + " !important }"; this._shadowRoot.appendChild(style); }, _hideSeparatorDupes: function() { if (!this._items.length) return; // Don't hide first and last separators if they were added explicitly. var previousIsSeparator = false; var lastSeparator; var nonSeparatorVisible = false; for (var i = 0; i < this._items.length; ++i) { if (this._items[i] instanceof WebInspector.ToolbarSeparator) { this._items[i].setVisible(!previousIsSeparator); previousIsSeparator = true; lastSeparator = this._items[i]; continue; } if (this._items[i].visible()) { previousIsSeparator = false; lastSeparator = null; nonSeparatorVisible = true; } } if (lastSeparator && lastSeparator !== this._items.peekLast()) lastSeparator.setVisible(false); this.element.classList.toggle("hidden", !!lastSeparator && lastSeparator.visible() && !nonSeparatorVisible); } } /** * @constructor * @extends {WebInspector.Object} * @param {!Element} element */ WebInspector.ToolbarItem = function(element) { this.element = element; this.element.classList.add("toolbar-item"); this._visible = true; this._enabled = true; this.element.addEventListener("mouseenter", this._mouseEnter.bind(this), false); this.element.addEventListener("mouseleave", this._mouseLeave.bind(this), false); } WebInspector.ToolbarItem.prototype = { /** * @param {string} title */ setTitle: function(title) { if (this._title === title) return; this._title = title; WebInspector.Tooltip.install(this.element, title); }, _mouseEnter: function() { this.element.classList.add("hover"); }, _mouseLeave: function() { this.element.classList.remove("hover"); }, /** * @param {boolean} value */ setEnabled: function(value) { if (this._enabled === value) return; this._enabled = value; this._applyEnabledState(); }, _applyEnabledState: function() { this.element.disabled = !this._enabled; }, /** * @return {boolean} x */ visible: function() { return this._visible; }, /** * @param {boolean} x */ setVisible: function(x) { if (this._visible === x) return; this.element.classList.toggle("hidden", !x); this._visible = x; if (this._toolbar && !(this instanceof WebInspector.ToolbarSeparator)) this._toolbar._hideSeparatorDupes(); }, __proto__: WebInspector.Object.prototype } /** * @constructor * @extends {WebInspector.ToolbarItem} * @param {string=} text */ WebInspector.ToolbarText = function(text) { WebInspector.ToolbarItem.call(this, createElementWithClass("div", "toolbar-text")); this.element.classList.add("toolbar-text"); this.setText(text || ""); } WebInspector.ToolbarText.prototype = { /** * @param {string} text */ setText: function(text) { this.element.textContent = text; }, __proto__: WebInspector.ToolbarItem.prototype } /** * @constructor * @extends {WebInspector.ToolbarItem} * @param {string} title * @param {string=} glyph * @param {string=} text */ WebInspector.ToolbarButton = function(title, glyph, text) { WebInspector.ToolbarItem.call(this, createElementWithClass("button", "toolbar-button")); this.element.addEventListener("click", this._clicked.bind(this), false); this.element.addEventListener("mousedown", this._mouseDown.bind(this), false); this.element.addEventListener("mouseup", this._mouseUp.bind(this), false); this._glyphElement = this.element.createChild("div", "toolbar-glyph hidden"); this._textElement = this.element.createChild("div", "toolbar-text hidden"); this.setTitle(title); if (glyph) this.setGlyph(glyph); this.setText(text || ""); this._state = ""; this._title = ""; } WebInspector.ToolbarButton.prototype = { /** * @param {string} text */ setText: function(text) { if (this._text === text) return; this._textElement.textContent = text; this._textElement.classList.toggle("hidden", !text); this._text = text; }, /** * @param {string} glyph */ setGlyph: function(glyph) { if (this._glyph === glyph) return; if (this._glyph) this._glyphElement.classList.remove(this._glyph); if (glyph) this._glyphElement.classList.add(glyph); this._glyphElement.classList.toggle("hidden", !glyph); this.element.classList.toggle("toolbar-has-glyph", !!glyph); this._glyph = glyph; }, /** * @param {string} iconURL */ setBackgroundImage: function(iconURL) { this.element.style.backgroundImage = "url(" + iconURL + ")"; }, /** * @return {string} */ state: function() { return this._state; }, /** * @param {string} state */ setState: function(state) { if (this._state === state) return; this.element.classList.remove("toolbar-state-" + this._state); this.element.classList.add("toolbar-state-" + state); this._state = state; }, /** * @param {number=} width */ turnIntoSelect: function(width) { this.element.classList.add("toolbar-has-dropdown"); this.element.createChild("div", "toolbar-dropdown-arrow"); if (width) this.element.style.width = width + "px"; }, /** * @param {!Event} event */ _clicked: function(event) { var defaultPrevented = this.dispatchEventToListeners("click", event); event.consume(defaultPrevented); }, /** * @param {!Event} event */ _mouseDown: function(event) { this.dispatchEventToListeners("mousedown", event); }, /** * @param {!Event} event */ _mouseUp: function(event) { this.dispatchEventToListeners("mouseup", event); }, __proto__: WebInspector.ToolbarItem.prototype } /** * @constructor * @extends {WebInspector.ToolbarItem} * @param {string=} placeholder * @param {number=} growFactor */ WebInspector.ToolbarInput = function(placeholder, growFactor) { WebInspector.ToolbarItem.call(this, createElementWithClass("input", "toolbar-item")); this.element.addEventListener("input", this._onChangeCallback.bind(this), false); if (growFactor) this.element.style.flexGrow = growFactor; if (placeholder) this.element.setAttribute("placeholder", placeholder); this._value = ""; } WebInspector.ToolbarInput.Event = { TextChanged: "TextChanged" }; WebInspector.ToolbarInput.prototype = { /** * @param {string} value */ setValue: function(value) { this._value = value; this.element.value = value; }, /** * @return {string} */ value: function() { return this.element.value; }, _onChangeCallback: function() { this.dispatchEventToListeners(WebInspector.ToolbarInput.Event.TextChanged, this.element.value); }, __proto__: WebInspector.ToolbarItem.prototype } /** * @constructor * @extends {WebInspector.ToolbarButton} * @param {string} title * @param {string=} glyph * @param {string=} text */ WebInspector.ToolbarToggle = function(title, glyph, text) { WebInspector.ToolbarButton.call(this, title, glyph, text); this._toggled = false; this.setState("off"); } WebInspector.ToolbarToggle.prototype = { /** * @return {boolean} */ toggled: function() { return this._toggled; }, /** * @param {boolean} toggled */ setToggled: function(toggled) { if (this._toggled === toggled) return; this._toggled = toggled; this.setState(toggled ? "on" : "off"); }, __proto__: WebInspector.ToolbarButton.prototype } /** * @param {!WebInspector.Action} action * @param {!Array<!WebInspector.ToolbarButton>=} toggledOptions * @param {!Array<!WebInspector.ToolbarButton>=} untoggledOptions * @return {!WebInspector.ToolbarItem} */ WebInspector.Toolbar.createActionButton = function(action, toggledOptions, untoggledOptions) { var button = new WebInspector.ToolbarToggle(action.title(), action.icon()); button.addEventListener("click", action.execute, action); action.addEventListener(WebInspector.Action.Events.Enabled, enabledChanged); action.addEventListener(WebInspector.Action.Events.Toggled, toggled); /** @type {?WebInspector.LongClickController} */ var longClickController = null; /** @type {?Array<!WebInspector.ToolbarButton>} */ var longClickButtons = null; /** @type {?Element} */ var longClickGlyph = null; toggled(); return button; /** * @param {!WebInspector.Event} event */ function enabledChanged(event) { button.setEnabled(/** @type {boolean} */ (event.data)); } function toggled() { button.setToggled(action.toggled()); if (action.title()) WebInspector.Tooltip.install(button.element, action.title(), action.id()); updateOptions(); } function updateOptions() { var buttons = action.toggled() ? (toggledOptions || null) : (untoggledOptions || null); if (buttons && buttons.length) { if (!longClickController) { longClickController = new WebInspector.LongClickController(button.element, showOptions); longClickGlyph = button.element.createChild("div", "long-click-glyph toolbar-button-theme"); longClickButtons = buttons; } } else { if (longClickController) { longClickController.dispose(); longClickController = null; longClickGlyph.remove(); longClickGlyph = null; longClickButtons = null; } } } function showOptions() { var buttons = longClickButtons.slice(); var mainButtonClone = new WebInspector.ToolbarToggle(action.title(), action.icon()); mainButtonClone.addEventListener("click", clicked); /** * @param {!WebInspector.Event} event */ function clicked(event) { button._clicked(/** @type {!Event} */ (event.data)); } mainButtonClone.setToggled(action.toggled()); buttons.push(mainButtonClone); var document = button.element.ownerDocument; document.documentElement.addEventListener("mouseup", mouseUp, false); var optionsGlassPane = new WebInspector.GlassPane(document); var optionsBar = new WebInspector.Toolbar("fill", optionsGlassPane.element); optionsBar._contentElement.classList.add("floating"); const buttonHeight = 26; var hostButtonPosition = button.element.totalOffset(); var topNotBottom = hostButtonPosition.top + buttonHeight * buttons.length < document.documentElement.offsetHeight; if (topNotBottom) buttons = buttons.reverse(); optionsBar.element.style.height = (buttonHeight * buttons.length) + "px"; if (topNotBottom) optionsBar.element.style.top = (hostButtonPosition.top + 1) + "px"; else optionsBar.element.style.top = (hostButtonPosition.top - (buttonHeight * (buttons.length - 1))) + "px"; optionsBar.element.style.left = (hostButtonPosition.left + 1) + "px"; for (var i = 0; i < buttons.length; ++i) { buttons[i].element.addEventListener("mousemove", mouseOver, false); buttons[i].element.addEventListener("mouseout", mouseOut, false); optionsBar.appendToolbarItem(buttons[i]); } var hostButtonIndex = topNotBottom ? 0 : buttons.length - 1; buttons[hostButtonIndex].element.classList.add("emulate-active"); function mouseOver(e) { if (e.which !== 1) return; var buttonElement = e.target.enclosingNodeOrSelfWithClass("toolbar-item"); buttonElement.classList.add("emulate-active"); } function mouseOut(e) { if (e.which !== 1) return; var buttonElement = e.target.enclosingNodeOrSelfWithClass("toolbar-item"); buttonElement.classList.remove("emulate-active"); } function mouseUp(e) { if (e.which !== 1) return; optionsGlassPane.dispose(); document.documentElement.removeEventListener("mouseup", mouseUp, false); for (var i = 0; i < buttons.length; ++i) { if (buttons[i].element.classList.contains("emulate-active")) { buttons[i].element.classList.remove("emulate-active"); buttons[i]._clicked(e); break; } } } } } /** * @constructor * @extends {WebInspector.ToolbarButton} * @param {function(!WebInspector.ContextMenu)} contextMenuHandler * @param {boolean=} useSoftMenu */ WebInspector.ToolbarMenuButton = function(contextMenuHandler, useSoftMenu) { WebInspector.ToolbarButton.call(this, "", "menu-toolbar-item"); this._contextMenuHandler = contextMenuHandler; this._useSoftMenu = !!useSoftMenu; } WebInspector.ToolbarMenuButton.prototype = { /** * @override * @param {!Event} event */ _mouseDown: function(event) { if (event.buttons !== 1) { WebInspector.ToolbarButton.prototype._mouseDown.call(this, event); return; } if (!this._triggerTimeout) this._triggerTimeout = setTimeout(this._trigger.bind(this, event), 200); }, /** * @param {!Event} event */ _trigger: function(event) { delete this._triggerTimeout; var contextMenu = new WebInspector.ContextMenu(event, this._useSoftMenu, this.element.totalOffsetLeft(), this.element.totalOffsetTop() + this.element.offsetHeight); this._contextMenuHandler(contextMenu); contextMenu.show(); }, /** * @override * @param {!Event} event */ _clicked: function(event) { if (!this._triggerTimeout) return; clearTimeout(this._triggerTimeout); this._trigger(event); }, __proto__: WebInspector.ToolbarButton.prototype } /** * @constructor * @extends {WebInspector.ToolbarToggle} * @param {!WebInspector.Setting} setting * @param {string} glyph * @param {string} title * @param {string=} toggledTitle */ WebInspector.ToolbarSettingToggle = function(setting, glyph, title, toggledTitle) { WebInspector.ToolbarToggle.call(this, title, glyph); this._defaultTitle = title; this._toggledTitle = toggledTitle || title; this._setting = setting; this._settingChanged(); this._setting.addChangeListener(this._settingChanged, this); } WebInspector.ToolbarSettingToggle.prototype = { _settingChanged: function() { var toggled = this._setting.get(); this.setToggled(toggled); this.setTitle(toggled ? this._toggledTitle : this._defaultTitle); }, /** * @override * @param {!Event} event */ _clicked: function(event) { this._setting.set(!this.toggled()); WebInspector.ToolbarToggle.prototype._clicked.call(this, event); }, __proto__: WebInspector.ToolbarToggle.prototype } /** * @constructor * @extends {WebInspector.ToolbarItem} * @param {boolean=} spacer */ WebInspector.ToolbarSeparator = function(spacer) { WebInspector.ToolbarItem.call(this, createElementWithClass("div", spacer ? "toolbar-spacer" : "toolbar-divider")); } WebInspector.ToolbarSeparator.prototype = { __proto__: WebInspector.ToolbarItem.prototype } /** * @interface */ WebInspector.ToolbarItem.Provider = function() { } WebInspector.ToolbarItem.Provider.prototype = { /** * @return {?WebInspector.ToolbarItem} */ item: function() {} } /** * @constructor * @extends {WebInspector.ToolbarItem} * @param {?function(!Event)} changeHandler * @param {string=} className */ WebInspector.ToolbarComboBox = function(changeHandler, className) { WebInspector.ToolbarItem.call(this, createElementWithClass("span", "toolbar-select-container")); this._selectElement = this.element.createChild("select", "toolbar-item"); this.element.createChild("div", "toolbar-dropdown-arrow"); if (changeHandler) this._selectElement.addEventListener("change", changeHandler, false); if (className) this._selectElement.classList.add(className); } WebInspector.ToolbarComboBox.prototype = { /** * @return {!HTMLSelectElement} */ selectElement: function() { return /** @type {!HTMLSelectElement} */ (this._selectElement); }, /** * @return {number} */ size: function() { return this._selectElement.childElementCount; }, /** * @return {!Array.<!Element>} */ options: function() { return Array.prototype.slice.call(this._selectElement.children, 0); }, /** * @param {!Element} option */ addOption: function(option) { this._selectElement.appendChild(option); }, /** * @param {string} label * @param {string=} title * @param {string=} value * @return {!Element} */ createOption: function(label, title, value) { var option = this._selectElement.createChild("option"); option.text = label; if (title) option.title = title; if (typeof value !== "undefined") option.value = value; return option; }, /** * @override */ _applyEnabledState: function() { this._selectElement.disabled = !this._enabled; }, /** * @param {!Element} option */ removeOption: function(option) { this._selectElement.removeChild(option); }, removeOptions: function() { this._selectElement.removeChildren(); }, /** * @return {?Element} */ selectedOption: function() { if (this._selectElement.selectedIndex >= 0) return this._selectElement[this._selectElement.selectedIndex]; return null; }, /** * @param {!Element} option */ select: function(option) { this._selectElement.selectedIndex = Array.prototype.indexOf.call(/** @type {?} */ (this._selectElement), option); }, /** * @param {number} index */ setSelectedIndex: function(index) { this._selectElement.selectedIndex = index; }, /** * @return {number} */ selectedIndex: function() { return this._selectElement.selectedIndex; }, /** * @param {number} width */ setMaxWidth: function(width) { this._selectElement.style.maxWidth = width + "px"; }, __proto__: WebInspector.ToolbarItem.prototype } /** * @constructor * @extends {WebInspector.ToolbarItem} * @param {string} text * @param {string=} title * @param {!WebInspector.Setting=} setting * @param {function()=} listener */ WebInspector.ToolbarCheckbox = function(text, title, setting, listener) { WebInspector.ToolbarItem.call(this, createCheckboxLabel(text)); this.element.classList.add("checkbox"); this.inputElement = this.element.checkboxElement; if (title) this.element.title = title; if (setting) WebInspector.SettingsUI.bindCheckbox(this.inputElement, setting); if (listener) this.inputElement.addEventListener("click", listener, false); } WebInspector.ToolbarCheckbox.prototype = { /** * @return {boolean} */ checked: function() { return this.inputElement.checked; }, /** * @param {boolean} value */ setChecked: function(value) { this.inputElement.checked = value; }, __proto__: WebInspector.ToolbarItem.prototype } /** * @constructor * @extends {WebInspector.Toolbar} * @param {string} location * @param {!Element=} parentElement */ WebInspector.ExtensibleToolbar = function(location, parentElement) { WebInspector.Toolbar.call(this, "", parentElement); this._loadItems(location); } WebInspector.ExtensibleToolbar.prototype = { /** * @param {string} location */ _loadItems: function(location) { var extensions = self.runtime.extensions(WebInspector.ToolbarItem.Provider); var promises = []; for (var i = 0; i < extensions.length; ++i) { if (extensions[i].descriptor()["location"] === location) promises.push(resolveItem(extensions[i])); } Promise.all(promises).then(appendItemsInOrder.bind(this)); /** * @param {!Runtime.Extension} extension * @return {!Promise.<?WebInspector.ToolbarItem>} */ function resolveItem(extension) { var descriptor = extension.descriptor(); if (descriptor["separator"]) return Promise.resolve(/** @type {?WebInspector.ToolbarItem} */(new WebInspector.ToolbarSeparator())); if (descriptor["actionId"]) { var action = WebInspector.actionRegistry.action(descriptor["actionId"]); return Promise.resolve(/** @type {?WebInspector.ToolbarItem} */(action ? WebInspector.Toolbar.createActionButton(action) : null)); } return extension.instance().then(fetchItemFromProvider); /** * @param {!Object} provider */ function fetchItemFromProvider(provider) { return /** @type {!WebInspector.ToolbarItem.Provider} */ (provider).item(); } } /** * @param {!Array.<?WebInspector.ToolbarItem>} items * @this {WebInspector.ExtensibleToolbar} */ function appendItemsInOrder(items) { for (var i = 0; i < items.length; ++i) { var item = items[i]; if (item) this.appendToolbarItem(item); } } }, __proto__: WebInspector.Toolbar.prototype }
{ "content_hash": "1de1264c83ce854e0235e5d916f64338", "timestamp": "", "source": "github", "line_count": 961, "max_line_length": 146, "avg_line_length": 27.04786680541103, "alnum_prop": 0.5997768630015774, "repo_name": "danakj/chromium", "id": "9bc2472583d0c977f23a787057085c696870f9fb", "size": "27555", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "0df953540c493624bfbfe796e47eb044", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "4b5dba8ad57edb269948ee1c65e44b563c8522a4", "size": "207", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Plantaginaceae/Penstemon/Penstemon dolius/ Syn. Penstemon dolius dolius/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
#include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/err.h> #include <linux/power_supply.h> #include <linux/platform_device.h> static enum power_supply_property fish_battery_properties[] = { POWER_SUPPLY_PROP_STATUS, POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_TECHNOLOGY, POWER_SUPPLY_PROP_CAPACITY, }; static enum power_supply_property fish_power_properties[] = { POWER_SUPPLY_PROP_ONLINE, }; static char *supply_list[] = { "battery", }; static int fish_power_get_property(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val); static int fish_battery_get_property(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val); static struct power_supply fish_power_supplies[] = { { .name = "battery", .type = POWER_SUPPLY_TYPE_BATTERY, .properties = fish_battery_properties, .num_properties = ARRAY_SIZE(fish_battery_properties), .get_property = fish_battery_get_property, }, { .name = "ac", .type = POWER_SUPPLY_TYPE_MAINS, .supplied_to = supply_list, .num_supplicants = ARRAY_SIZE(supply_list), .properties = fish_power_properties, .num_properties = ARRAY_SIZE(fish_power_properties), .get_property = fish_power_get_property, }, }; static int fish_power_get_property(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val) { switch (psp) { case POWER_SUPPLY_PROP_ONLINE: if (psy->type == POWER_SUPPLY_TYPE_MAINS) val->intval = 1; else val->intval = 0; break; default: return -EINVAL; } return 0; } static int fish_battery_get_property(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val) { switch (psp) { case POWER_SUPPLY_PROP_STATUS: val->intval = POWER_SUPPLY_STATUS_FULL; break; case POWER_SUPPLY_PROP_HEALTH: val->intval = POWER_SUPPLY_HEALTH_GOOD; break; case POWER_SUPPLY_PROP_PRESENT: val->intval = 1; break; case POWER_SUPPLY_PROP_TECHNOLOGY: val->intval = POWER_SUPPLY_TECHNOLOGY_UNKNOWN; break; case POWER_SUPPLY_PROP_CAPACITY: val->intval = 100; break; default: return -EINVAL; } return 0; } static int fish_battery_probe(struct platform_device *pdev) { int i; int rc; /* init power supplier framework */ for (i = 0; i < ARRAY_SIZE(fish_power_supplies); i++) { rc = power_supply_register(&pdev->dev, &fish_power_supplies[i]); if (rc) pr_err("%s: Failed to register power supply (%d)\n", __func__, rc); } return 0; } static struct platform_driver fish_battery_driver = { .probe = fish_battery_probe, .driver = { .name = "fish_battery", .owner = THIS_MODULE, }, }; static int __init fish_battery_init(void) { platform_driver_register(&fish_battery_driver); return 0; } module_init(fish_battery_init); MODULE_DESCRIPTION("Qualcomm fish battery driver"); MODULE_LICENSE("GPL");
{ "content_hash": "e3f4f99268b4204512b9736c91fbf60f", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 66, "avg_line_length": 22.870229007633586, "alnum_prop": 0.687917222963952, "repo_name": "michelborgess/RealOne-Victara-Kernel", "id": "19fbb91fe83ae6f43aa2927cd74389817c1e37f7", "size": "3579", "binary": false, "copies": "5318", "ref": "refs/heads/master", "path": "arch/arm/mach-msm/fish_battery.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "4528" }, { "name": "Assembly", "bytes": "8953302" }, { "name": "Awk", "bytes": "18610" }, { "name": "C", "bytes": "458831037" }, { "name": "C++", "bytes": "4466976" }, { "name": "Groff", "bytes": "22788" }, { "name": "Lex", "bytes": "40798" }, { "name": "Makefile", "bytes": "1273896" }, { "name": "Objective-C", "bytes": "751522" }, { "name": "Perl", "bytes": "357940" }, { "name": "Python", "bytes": "32666" }, { "name": "Scilab", "bytes": "21433" }, { "name": "Shell", "bytes": "123788" }, { "name": "SourcePawn", "bytes": "4856" }, { "name": "UnrealScript", "bytes": "20838" }, { "name": "Yacc", "bytes": "83091" } ], "symlink_target": "" }
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var authentication_service_1 = require("../../services/authentication.service"); var AuthenticationComponent = (function () { function AuthenticationComponent(authenticationService) { this.authenticationService = authenticationService; } AuthenticationComponent.prototype.ngOnInit = function () { var _this = this; this.authenticationService.execute(this.getConfigureUrl).subscribe(function (res) { if (res.isSuccess) { if (_this.onAuthenticationSuccess) { _this.onAuthenticationSuccess(); } console.debug('authentication success'); } else { if (_this.onAuthenticationError) { _this.onAuthenticationError(res); } console.debug('authentication failure'); console.debug(res); } }, function (error) { _this.onAuthenticationError(error); }); }; return AuthenticationComponent; }()); __decorate([ core_1.Input(), __metadata("design:type", String) ], AuthenticationComponent.prototype, "getConfigureUrl", void 0); __decorate([ core_1.Input(), __metadata("design:type", Function) ], AuthenticationComponent.prototype, "onAuthenticationSuccess", void 0); __decorate([ core_1.Input(), __metadata("design:type", Function) ], AuthenticationComponent.prototype, "onAuthenticationError", void 0); AuthenticationComponent = __decorate([ core_1.Component({ selector: 'lib-authentication', template: '<div></div>', }), __metadata("design:paramtypes", [authentication_service_1.AuthenticationService]) ], AuthenticationComponent); exports.AuthenticationComponent = AuthenticationComponent; //# sourceMappingURL=authentication.component.js.map
{ "content_hash": "553879d8074e7f4b8298b6abd0a15c4a", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 150, "avg_line_length": 45.233333333333334, "alnum_prop": 0.630066322770818, "repo_name": "wakuwaku3/cbn.sample", "id": "aedc288d1c42fbd5a27263bbf12c2f9e54430c84", "size": "2714", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Cbn.Sample.Web/src/lib/components/authentication/authentication.component.js", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "105" }, { "name": "C#", "bytes": "141703" }, { "name": "CSS", "bytes": "4762" }, { "name": "HTML", "bytes": "3344" }, { "name": "JavaScript", "bytes": "14495" }, { "name": "TypeScript", "bytes": "15711" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <link href="example.css" type="text/css" rel="stylesheet" /> <script src="../../dist/react-collectionview-standalone.js"></script> </head> <body> <div id="reactContainer"></div> <script src="cellFactory.js"></script> <script src="../example-base.js"></script> <script src="example.js" ></script> </body> </html>
{ "content_hash": "74dcdd10fa467bbd575c9cf504ab51e4", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 73, "avg_line_length": 24.941176470588236, "alnum_prop": 0.6132075471698113, "repo_name": "davidmfreese/React-CollectionView", "id": "86572e49da57c735f0bc2eef17cd57debc917483", "size": "424", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/flowlayout-vertical/Example.html", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "70531" } ], "symlink_target": "" }
module("About Regular Expressions (topics/about_regular_expressions.js)"); test("exec", function() { var numberFinder = /(\d).*(\d)/; var results = numberFinder.exec("what if 6 turned out to be 9?"); ok(results.equalTo(["6 turned out to be 9", "6", "9"]), 'what is the value of results?'); }); test("test", function() { var containsSelect = /select/.test(" select * from users "); equal(true, containsSelect, 'does the string provided contain "select"?'); }); test("match", function() { var matches = "what if 6 turned out to be 9?".match(/(\d)/g); ok(matches.equalTo(["6", "9"]), 'what is the value of matches?'); }); test("replace", function() { var pie = "apple pie".replace("apple", "strawberry"); equal("strawberry pie", pie, 'what is the value of pie?'); pie = "what if 6 turned out to be 9?".replace(/\d/g, function(number) { // the second parameter can be a string or a function var map = {'6': 'six','9': 'nine'}; return map[number]; }); equal("what if six turned out to be nine?", pie, 'what is the value of pie?'); }); // THE END
{ "content_hash": "881b05226ce457bae88cec3db8f240e2", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 129, "avg_line_length": 37.13333333333333, "alnum_prop": 0.6095152603231598, "repo_name": "yuliya5/JavaScript-Koans-Answers", "id": "feb4da6b7189cb6d2c6d2924c50c6896ebe50697", "size": "1132", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "topics/about_regular_expressions.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4668" }, { "name": "HTML", "bytes": "2250" }, { "name": "JavaScript", "bytes": "84440" } ], "symlink_target": "" }
google-site-verification: googlecbf335ea83016e9c.html
{ "content_hash": "717d4406559957be3d7856c131928bc9", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 53, "avg_line_length": 53, "alnum_prop": 0.9056603773584906, "repo_name": "justan0therdave/static", "id": "c272e488810b55bab01d4776d67b0fd27bfced8c", "size": "53", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/images/touch/googlecbf335ea83016e9c.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "237959" }, { "name": "HTML", "bytes": "1091307" }, { "name": "JavaScript", "bytes": "570473" } ], "symlink_target": "" }
import logging from swiftclient.exceptions import ClientException from swiftclient.service import SwiftService logging.basicConfig(level=logging.ERROR) logging.getLogger("requests").setLevel(logging.CRITICAL) logging.getLogger("swiftclient").setLevel(logging.CRITICAL) logger = logging.getLogger(__name__) with SwiftService() as swift: try: capabilities_result = swift.capabilities() capabilities = capabilities_result['capabilities'] if 'slo' in capabilities: print('SLO is supported') else: print('SLO is not supported') except ClientException as e: logger.error(e.value)
{ "content_hash": "c238582188ba280ed4dc3cac7cf5ed9e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 59, "avg_line_length": 32.45, "alnum_prop": 0.7164869029275809, "repo_name": "jeseem/python-swiftclient", "id": "024ad6f57ab32c6f0d02c8cdcc7c177c46a77523", "size": "649", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "examples/capabilities.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "667016" }, { "name": "Shell", "bytes": "1761" } ], "symlink_target": "" }
package mc.sel.exception; import mc.sel.token.Token; /** * Thrown when the input tokens are not grammatically correct. * * @author Milan Crnjak */ public class ParserException extends RuntimeException { private Token token; public ParserException(String message, Token token) { super(message); this.token = token; } public Token getToken() { return token; } }
{ "content_hash": "a53fa300306483e67a436d39dc81daf1", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 62, "avg_line_length": 18.772727272727273, "alnum_prop": 0.6658595641646489, "repo_name": "mcrnjak/sel", "id": "bd3d24187b83b65e5aec1d74e94ba1c06dbbafa4", "size": "413", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/mc/sel/exception/ParserException.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "78566" } ], "symlink_target": "" }
<?php /** * pp_authors actions. * * @package sf_sandbox * @subpackage pp_authors * @author Your name here * @version SVN: $Id: actions.class.php 5125 2007-09-16 00:53:55Z dwhittle $ */ class pp_authorsActions extends autopp_authorsActions { }
{ "content_hash": "ee17dfa06f2b8facc751a5b8de045a34", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 20.076923076923077, "alnum_prop": 0.6666666666666666, "repo_name": "serg-smirnoff/symfony-pposter", "id": "b2c18672efcd1d793815fdf003c3947e5cdcfee2", "size": "261", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "symfony/apps/admin/modules/pp_authors/actions/actions.class.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "2224" }, { "name": "Batchfile", "bytes": "1150" }, { "name": "CSS", "bytes": "58927" }, { "name": "HTML", "bytes": "113" }, { "name": "JavaScript", "bytes": "278252" }, { "name": "PHP", "bytes": "4512602" }, { "name": "Shell", "bytes": "1361" } ], "symlink_target": "" }
'use strict'; const TAG = 'FormatUtils:: '; /** * convert a key/value object into a query string * * @param keyValueObject a key/value object * * @returns {String} a query string */ export function objectToQueryString(keyValueObject) { var value = null; var res = ''; let keyValue; if(keyValueObject === null) return ''; for (let key in keyValueObject) { if(!keyValueObject.hasOwnProperty(key)) continue; value = keyValueObject[key].toString(); keyValue = key + '=' + value; res += res==='' ? '?' + keyValue : '&' + keyValue; } return res; } /** * convert a mime string array into key/value Object. * <pre> * mimeStringArrayToObject(['Content-Type:image/jpg', 'Content-ID: myid']) * ==> * { * 'Content-Type': 'image/jpg', * 'Content-ID': 'myid', * } * </pre> * * @param {Array} mimes array of strings that each represent a mime header. * * @return {Object} a key/value Object */ export function mimeStringArrayToObject(mimes) { if(!Array.isArray(mimes)) return mimes; let keyValue = {}; let msg = TAG + 'mimeStringArrayToObject(..) --> mimes array is not formatted correctly'; for(let item of mimes) { if(typeof item !== 'string') { console.warn(msg); continue; } let arr = item.split(':'); if(arr.length > 2) { console.warn(msg); continue; } keyValue[arr[0].trim()] = arr[1].trim(); } return keyValue; }
{ "content_hash": "30d4b02bb395f80d2063017e101ad670", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 93, "avg_line_length": 22.5, "alnum_prop": 0.5432098765432098, "repo_name": "HendrixString/node-okhttp", "id": "84697a95618a9de3ce8708ec24d0701dae7fd998", "size": "1620", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/utils/FormatUtils.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "82749" } ], "symlink_target": "" }
package com.carmanager.controllers; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.carmanager.constant.WebConstant; import com.carmanager.services.ClubActivityService; import com.carmanager.services.ClubService; @Controller @RequestMapping("/club") public class ClubController { @Autowired private ClubService clubService; @Autowired private ClubActivityService clubActivityService; private int maxResult = WebConstant.PAGE_SIZE; @RequestMapping(value = "/browse", method = RequestMethod.GET) private String getClubs(Map<String, Object> map) { map.put("clubs", clubService.findAllEntities()); return "club/club"; } @RequestMapping(value = "/{id}/detail", method = RequestMethod.GET) private String getClubDetails(@PathVariable("id") Integer id, Map<String, Object> map) { map.put("club", clubService.getEntity(id)); return "club/detail"; } @RequestMapping(value = "/activity", method = RequestMethod.GET) private String getClubActivities(Map<String, Object> map) { map.put("clubActivities", clubActivityService.getWeekClubActivities(maxResult)); return "club/activity"; } }
{ "content_hash": "6f755ea75460817574d89994d2f19333", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 89, "avg_line_length": 32.46511627906977, "alnum_prop": 0.7879656160458453, "repo_name": "yuqirong/CarManager", "id": "8165fc4109c1bb2d9ec810c8c8ab331b8d4eeea6", "size": "1396", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/carmanager/controllers/ClubController.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "222188" }, { "name": "HTML", "bytes": "158499" }, { "name": "Java", "bytes": "285386" }, { "name": "JavaScript", "bytes": "4543826" } ], "symlink_target": "" }
package org.apache.spark.sql.catalyst.analysis import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference, AttributeSet, CurrentDate, CurrentTimestamp, MonotonicallyIncreasingID} import org.apache.spark.sql.catalyst.expressions.aggregate.AggregateExpression import org.apache.spark.sql.catalyst.planning.ExtractEquiJoinKeys import org.apache.spark.sql.catalyst.plans._ import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.catalyst.streaming.InternalOutputModes import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.streaming.OutputMode /** * Analyzes the presence of unsupported operations in a logical plan. */ object UnsupportedOperationChecker { def checkForBatch(plan: LogicalPlan): Unit = { plan.foreachUp { case p if p.isStreaming => throwError("Queries with streaming sources must be executed with writeStream.start()")(p) case _ => } } def checkForStreaming(plan: LogicalPlan, outputMode: OutputMode): Unit = { if (!plan.isStreaming) { throwError( "Queries without streaming sources cannot be executed with writeStream.start()")(plan) } /** Collect all the streaming aggregates in a sub plan */ def collectStreamingAggregates(subplan: LogicalPlan): Seq[Aggregate] = { subplan.collect { case a: Aggregate if a.isStreaming => a } } val mapGroupsWithStates = plan.collect { case f: FlatMapGroupsWithState if f.isStreaming && f.isMapGroupsWithState => f } // Disallow multiple `mapGroupsWithState`s. if (mapGroupsWithStates.size >= 2) { throwError( "Multiple mapGroupsWithStates are not supported on a streaming DataFrames/Datasets")(plan) } val flatMapGroupsWithStates = plan.collect { case f: FlatMapGroupsWithState if f.isStreaming && !f.isMapGroupsWithState => f } // Disallow mixing `mapGroupsWithState`s and `flatMapGroupsWithState`s if (mapGroupsWithStates.nonEmpty && flatMapGroupsWithStates.nonEmpty) { throwError( "Mixing mapGroupsWithStates and flatMapGroupsWithStates are not supported on a " + "streaming DataFrames/Datasets")(plan) } // Only allow multiple `FlatMapGroupsWithState(Append)`s in append mode. if (flatMapGroupsWithStates.size >= 2 && ( outputMode != InternalOutputModes.Append || flatMapGroupsWithStates.exists(_.outputMode != InternalOutputModes.Append) )) { throwError( "Multiple flatMapGroupsWithStates are not supported when they are not all in append mode" + " or the output mode is not append on a streaming DataFrames/Datasets")(plan) } // Disallow multiple streaming aggregations val aggregates = collectStreamingAggregates(plan) if (aggregates.size > 1) { throwError( "Multiple streaming aggregations are not supported with " + "streaming DataFrames/Datasets")(plan) } // Disallow some output mode outputMode match { case InternalOutputModes.Append if aggregates.nonEmpty => val aggregate = aggregates.head // Find any attributes that are associated with an eventTime watermark. val watermarkAttributes = aggregate.groupingExpressions.collect { case a: Attribute if a.metadata.contains(EventTimeWatermark.delayKey) => a } // We can append rows to the sink once the group is under the watermark. Without this // watermark a group is never "finished" so we would never output anything. if (watermarkAttributes.isEmpty) { throwError( s"$outputMode output mode not supported when there are streaming aggregations on " + s"streaming DataFrames/DataSets without watermark")(plan) } case InternalOutputModes.Complete if aggregates.isEmpty => throwError( s"$outputMode output mode not supported when there are no streaming aggregations on " + s"streaming DataFrames/Datasets")(plan) case _ => } /** * Whether the subplan will contain complete data or incremental data in every incremental * execution. Some operations may be allowed only when the child logical plan gives complete * data. */ def containsCompleteData(subplan: LogicalPlan): Boolean = { val aggs = subplan.collect { case a@Aggregate(_, _, _) if a.isStreaming => a } // Either the subplan has no streaming source, or it has aggregation with Complete mode !subplan.isStreaming || (aggs.nonEmpty && outputMode == InternalOutputModes.Complete) } def checkUnsupportedExpressions(implicit operator: LogicalPlan): Unit = { val unsupportedExprs = operator.expressions.flatMap(_.collect { case m: MonotonicallyIncreasingID => m }).distinct if (unsupportedExprs.nonEmpty) { throwError("Expression(s): " + unsupportedExprs.map(_.sql).mkString(", ") + " is not supported with streaming DataFrames/Datasets") } } plan.foreachUp { implicit subPlan => // Operations that cannot exists anywhere in a streaming plan subPlan match { case Aggregate(_, aggregateExpressions, child) => val distinctAggExprs = aggregateExpressions.flatMap { expr => expr.collect { case ae: AggregateExpression if ae.isDistinct => ae } } throwErrorIf( child.isStreaming && distinctAggExprs.nonEmpty, "Distinct aggregations are not supported on streaming DataFrames/Datasets. Consider " + "using approx_count_distinct() instead.") case _: Command => throwError("Commands like CreateTable*, AlterTable*, Show* are not supported with " + "streaming DataFrames/Datasets") case _: InsertIntoDir => throwError("InsertIntoDir is not supported with streaming DataFrames/Datasets") // mapGroupsWithState and flatMapGroupsWithState case m: FlatMapGroupsWithState if m.isStreaming => // Check compatibility with output modes and aggregations in query val aggsAfterFlatMapGroups = collectStreamingAggregates(plan) if (m.isMapGroupsWithState) { // check mapGroupsWithState // allowed only in update query output mode and without aggregation if (aggsAfterFlatMapGroups.nonEmpty) { throwError( "mapGroupsWithState is not supported with aggregation " + "on a streaming DataFrame/Dataset") } else if (outputMode != InternalOutputModes.Update) { throwError( "mapGroupsWithState is not supported with " + s"$outputMode output mode on a streaming DataFrame/Dataset") } } else { // check latMapGroupsWithState if (aggsAfterFlatMapGroups.isEmpty) { // flatMapGroupsWithState without aggregation: operation's output mode must // match query output mode m.outputMode match { case InternalOutputModes.Update if outputMode != InternalOutputModes.Update => throwError( "flatMapGroupsWithState in update mode is not supported with " + s"$outputMode output mode on a streaming DataFrame/Dataset") case InternalOutputModes.Append if outputMode != InternalOutputModes.Append => throwError( "flatMapGroupsWithState in append mode is not supported with " + s"$outputMode output mode on a streaming DataFrame/Dataset") case _ => } } else { // flatMapGroupsWithState with aggregation: update operation mode not allowed, and // *groupsWithState after aggregation not allowed if (m.outputMode == InternalOutputModes.Update) { throwError( "flatMapGroupsWithState in update mode is not supported with " + "aggregation on a streaming DataFrame/Dataset") } else if (collectStreamingAggregates(m).nonEmpty) { throwError( "flatMapGroupsWithState in append mode is not supported after " + s"aggregation on a streaming DataFrame/Dataset") } } } // Check compatibility with timeout configs if (m.timeout == EventTimeTimeout) { // With event time timeout, watermark must be defined. val watermarkAttributes = m.child.output.collect { case a: Attribute if a.metadata.contains(EventTimeWatermark.delayKey) => a } if (watermarkAttributes.isEmpty) { throwError( "Watermark must be specified in the query using " + "'[Dataset/DataFrame].withWatermark()' for using event-time timeout in a " + "[map|flatMap]GroupsWithState. Event-time timeout not supported without " + "watermark.")(plan) } } case d: Deduplicate if collectStreamingAggregates(d).nonEmpty => throwError("dropDuplicates is not supported after aggregation on a " + "streaming DataFrame/Dataset") case Join(left, right, joinType, condition) => joinType match { case _: InnerLike => if (left.isStreaming && right.isStreaming && outputMode != InternalOutputModes.Append) { throwError("Inner join between two streaming DataFrames/Datasets is not supported" + s" in ${outputMode} output mode, only in Append output mode") } case FullOuter => if (left.isStreaming || right.isStreaming) { throwError("Full outer joins with streaming DataFrames/Datasets are not supported") } case LeftSemi | LeftAnti => if (right.isStreaming) { throwError("Left semi/anti joins with a streaming DataFrame/Dataset " + "on the right are not supported") } // We support streaming left outer joins with static on the right always, and with // stream on both sides under the appropriate conditions. case LeftOuter => if (!left.isStreaming && right.isStreaming) { throwError("Left outer join with a streaming DataFrame/Dataset " + "on the right and a static DataFrame/Dataset on the left is not supported") } else if (left.isStreaming && right.isStreaming) { val watermarkInJoinKeys = StreamingJoinHelper.isWatermarkInJoinKeys(subPlan) val hasValidWatermarkRange = StreamingJoinHelper.getStateValueWatermark( left.outputSet, right.outputSet, condition, Some(1000000)).isDefined if (!watermarkInJoinKeys && !hasValidWatermarkRange) { throwError("Stream-stream outer join between two streaming DataFrame/Datasets " + "is not supported without a watermark in the join keys, or a watermark on " + "the nullable side and an appropriate range condition") } } // We support streaming right outer joins with static on the left always, and with // stream on both sides under the appropriate conditions. case RightOuter => if (left.isStreaming && !right.isStreaming) { throwError("Right outer join with a streaming DataFrame/Dataset on the left and " + "a static DataFrame/DataSet on the right not supported") } else if (left.isStreaming && right.isStreaming) { val isWatermarkInJoinKeys = StreamingJoinHelper.isWatermarkInJoinKeys(subPlan) // Check if the nullable side has a watermark, and there's a range condition which // implies a state value watermark on the first side. val hasValidWatermarkRange = StreamingJoinHelper.getStateValueWatermark( right.outputSet, left.outputSet, condition, Some(1000000)).isDefined if (!isWatermarkInJoinKeys && !hasValidWatermarkRange) { throwError("Stream-stream outer join between two streaming DataFrame/Datasets " + "is not supported without a watermark in the join keys, or a watermark on " + "the nullable side and an appropriate range condition") } } case NaturalJoin(_) | UsingJoin(_, _) => // They should not appear in an analyzed plan. case _ => throwError(s"Join type $joinType is not supported with streaming DataFrame/Dataset") } case c: CoGroup if c.children.exists(_.isStreaming) => throwError("CoGrouping with a streaming DataFrame/Dataset is not supported") case u: Union if u.children.map(_.isStreaming).distinct.size == 2 => throwError("Union between streaming and batch DataFrames/Datasets is not supported") case Except(left, right) if right.isStreaming => throwError("Except on a streaming DataFrame/Dataset on the right is not supported") case Intersect(left, right) if left.isStreaming && right.isStreaming => throwError("Intersect between two streaming DataFrames/Datasets is not supported") case GroupingSets(_, _, child, _) if child.isStreaming => throwError("GroupingSets is not supported on streaming DataFrames/Datasets") case GlobalLimit(_, _) | LocalLimit(_, _) if subPlan.children.forall(_.isStreaming) => throwError("Limits are not supported on streaming DataFrames/Datasets") case Sort(_, _, _) if !containsCompleteData(subPlan) => throwError("Sorting is not supported on streaming DataFrames/Datasets, unless it is on " + "aggregated DataFrame/Dataset in Complete output mode") case Sample(_, _, _, _, child) if child.isStreaming => throwError("Sampling is not supported on streaming DataFrames/Datasets") case Window(_, _, _, child) if child.isStreaming => throwError("Non-time-based windows are not supported on streaming DataFrames/Datasets") case ReturnAnswer(child) if child.isStreaming => throwError("Cannot return immediate result on streaming DataFrames/Dataset. Queries " + "with streaming DataFrames/Datasets must be executed with writeStream.start().") case _ => } // Check if there are unsupported expressions in streaming query plan. checkUnsupportedExpressions(subPlan) } } def checkForContinuous(plan: LogicalPlan, outputMode: OutputMode): Unit = { checkForStreaming(plan, outputMode) plan.foreachUp { implicit subPlan => subPlan match { case (_: Project | _: Filter | _: MapElements | _: MapPartitions | _: DeserializeToObject | _: SerializeFromObject | _: SubqueryAlias | _: TypedFilter) => case node if node.nodeName == "StreamingRelationV2" => case Repartition(1, false, _) => case node: Aggregate => val aboveSinglePartitionCoalesce = node.find { case Repartition(1, false, _) => true case _ => false }.isDefined if (!aboveSinglePartitionCoalesce) { throwError(s"In continuous processing mode, coalesce(1) must be called before " + s"aggregate operation ${node.nodeName}.") } case node => throwError(s"Continuous processing does not support ${node.nodeName} operations.") } subPlan.expressions.foreach { e => if (e.collectLeaves().exists { case (_: CurrentTimestamp | _: CurrentDate) => true case _ => false }) { throwError(s"Continuous processing does not support current time operations.") } } } } private def throwErrorIf( condition: Boolean, msg: String)(implicit operator: LogicalPlan): Unit = { if (condition) { throwError(msg) } } private def throwError(msg: String)(implicit operator: LogicalPlan): Nothing = { throw new AnalysisException( msg, operator.origin.line, operator.origin.startPosition, Some(operator)) } }
{ "content_hash": "7f4f99bea87a0959555bc1e60ec5ac9e", "timestamp": "", "source": "github", "line_count": 375, "max_line_length": 152, "avg_line_length": 44.48, "alnum_prop": 0.6357913669064749, "repo_name": "debugger87/spark", "id": "5ced1ca200daa1e030c3e4b143480d55ee63f1d0", "size": "17480", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/UnsupportedOperationChecker.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "33141" }, { "name": "Batchfile", "bytes": "24315" }, { "name": "C", "bytes": "1493" }, { "name": "CSS", "bytes": "23957" }, { "name": "HTML", "bytes": "9846" }, { "name": "HiveQL", "bytes": "1823425" }, { "name": "Java", "bytes": "2965664" }, { "name": "JavaScript", "bytes": "141213" }, { "name": "Makefile", "bytes": "7774" }, { "name": "PLpgSQL", "bytes": "8788" }, { "name": "PowerShell", "bytes": "3751" }, { "name": "Python", "bytes": "2238785" }, { "name": "R", "bytes": "1064003" }, { "name": "Roff", "bytes": "14650" }, { "name": "SQLPL", "bytes": "6233" }, { "name": "Scala", "bytes": "22944773" }, { "name": "Shell", "bytes": "153382" }, { "name": "Thrift", "bytes": "33605" }, { "name": "q", "bytes": "146878" } ], "symlink_target": "" }
// @formatter:off package com.spike.giantdataanalysis.benchmark.tools.jmh.samples; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.Blackhole; import org.openjdk.jmh.runner.Runner; import org.openjdk.jmh.runner.RunnerException; import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import java.util.Random; import java.util.concurrent.TimeUnit; @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(5) @State(Scope.Benchmark) public class JMHSample_37_CacheAccess { /* * This sample serves as a warning against subtle differences in cache access patterns. * * Many performance differences may be explained by the way tests are accessing memory. * In the example below, we walk the matrix either row-first, or col-first: */ private final static int COUNT = 4096; private final static int MATRIX_SIZE = COUNT * COUNT; private int[][] matrix; @Setup public void setup() { matrix = new int[COUNT][COUNT]; Random random = new Random(1234); for (int i = 0; i < COUNT; i++) { for (int j = 0; j < COUNT; j++) { matrix[i][j] = random.nextInt(); } } } @Benchmark @OperationsPerInvocation(MATRIX_SIZE) public void colFirst(Blackhole bh) { for (int c = 0; c < COUNT; c++) { // MARK 列优先 for (int r = 0; r < COUNT; r++) { bh.consume(matrix[r][c]); } } } @Benchmark @OperationsPerInvocation(MATRIX_SIZE) public void rowFirst(Blackhole bh) { for (int r = 0; r < COUNT; r++) { // MARK 行优先 for (int c = 0; c < COUNT; c++) { bh.consume(matrix[r][c]); } } } /* Notably, colFirst accesses are much slower, and that's not a surprise: Java's multidimensional arrays are actually rigged, being one-dimensional arrays of one-dimensional arrays. Therefore, pulling n-th element from each of the inner array induces more cache misses, when matrix is large. -prof perfnorm conveniently highlights that, with >2 cache misses per one benchmark op: Benchmark Mode Cnt Score Error Units JMHSample_37_MatrixCopy.colFirst avgt 25 5.306 ± 0.020 ns/op JMHSample_37_MatrixCopy.colFirst:·CPI avgt 5 0.621 ± 0.011 #/op JMHSample_37_MatrixCopy.colFirst:·L1-dcache-load-misses avgt 5 2.177 ± 0.044 #/op <-- OOPS JMHSample_37_MatrixCopy.colFirst:·L1-dcache-loads avgt 5 14.804 ± 0.261 #/op JMHSample_37_MatrixCopy.colFirst:·LLC-loads avgt 5 2.165 ± 0.091 #/op JMHSample_37_MatrixCopy.colFirst:·cycles avgt 5 22.272 ± 0.372 #/op JMHSample_37_MatrixCopy.colFirst:·instructions avgt 5 35.888 ± 1.215 #/op JMHSample_37_MatrixCopy.rowFirst avgt 25 2.662 ± 0.003 ns/op JMHSample_37_MatrixCopy.rowFirst:·CPI avgt 5 0.312 ± 0.003 #/op JMHSample_37_MatrixCopy.rowFirst:·L1-dcache-load-misses avgt 5 0.066 ± 0.001 #/op JMHSample_37_MatrixCopy.rowFirst:·L1-dcache-loads avgt 5 14.570 ± 0.400 #/op JMHSample_37_MatrixCopy.rowFirst:·LLC-loads avgt 5 0.002 ± 0.001 #/op JMHSample_37_MatrixCopy.rowFirst:·cycles avgt 5 11.046 ± 0.343 #/op JMHSample_37_MatrixCopy.rowFirst:·instructions avgt 5 35.416 ± 1.248 #/op So, when comparing two different benchmarks, you have to follow up if the difference is caused by the memory locality issues. */ /* * ============================== HOW TO RUN THIS TEST: ==================================== * * You can run this test: * * a) Via the command line: * $ mvn clean install * $ java -jar target/benchmarks.jar JMHSample_37 * * b) Via the Java API: * (see the JMH homepage for possible caveats when running from IDE: * http://openjdk.java.net/projects/code-tools/jmh/) */ public static void main(String[] args) throws RunnerException { Options opt = new OptionsBuilder() .include(".*" + JMHSample_37_CacheAccess.class.getSimpleName() + ".*") .build(); new Runner(opt).run(); } }
{ "content_hash": "4e1334cfaac6a04b0d699054ffb49440", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 108, "avg_line_length": 41.48245614035088, "alnum_prop": 0.581306830196659, "repo_name": "zhoujiagen/giant-data-analysis", "id": "2de83e9d832f934cb9422eabc7a51d8c21b6db6f", "size": "6344", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "data-pipeline/infrastructure-benchmark/src/main/java/com/spike/giantdataanalysis/benchmark/tools/jmh/samples/JMHSample_37_CacheAccess.java", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "512" }, { "name": "FreeMarker", "bytes": "247" }, { "name": "Groovy", "bytes": "565" }, { "name": "HTML", "bytes": "509" }, { "name": "Java", "bytes": "3666096" }, { "name": "Python", "bytes": "126179" }, { "name": "Ruby", "bytes": "3140" }, { "name": "Scala", "bytes": "165639" }, { "name": "Shell", "bytes": "37085" }, { "name": "Thrift", "bytes": "7703" }, { "name": "XSLT", "bytes": "2430" } ], "symlink_target": "" }
require 'spec_helper' require 'stringio' require 'yaml' describe XXhash do hash32 = YAML.load(IO.read "spec/results32.yaml") hash64 = YAML.load(IO.read "spec/results64.yaml") hash32.each do |key, value| it 'returns correct hash' do expect(XXhash.xxh32(key[0], key[1])).to eq(value) end end hash64.each do |key, value| it 'returns correct hash' do expect(XXhash.xxh64(key[0], key[1])).to eq(value) end end describe 'StreamingHash' do hash32.each do |key, value| it 'returns correct hash' do expect(XXhash.xxh32_stream(StringIO.new(key[0]), key[1])).to eq(value) end end it 'returns same hash for streamed files' do h1 = XXhash.xxh32(File.read(__FILE__), 123) h2 = XXhash.xxh32_stream(File.open(__FILE__), 123) expect(h1).to eq(h2) end hash64.each do |key, value| it 'returns correct hash' do expect(XXhash.xxh64_stream(StringIO.new(key[0]), key[1])).to eq(value) end end it 'returns same hash for streamed files' do h1 = XXhash.xxh64(File.read(__FILE__), 123) h2 = XXhash.xxh64_stream(File.open(__FILE__), 123) expect(h1).to eq(h2) end end def use_external_hash hash, io, chunk_size=1024 while chunk=io.read(chunk_size) hash.update(chunk) end hash.digest end describe 'Digest::XXHash32' do it 'returns the hash for streamed strings' do StringIO.open('test') do |io| xxhash = Digest::XXHash32.new(123) result = use_external_hash xxhash, io expect(result).to eq(2758658570) end end it 'returns the hash for streamed files' do h1 = XXhash.xxh32(File.read(__FILE__), 123) xxhash = Digest::XXHash32.new(123) result = use_external_hash xxhash, File.open(__FILE__) expect(result).to eq(h1) end it 'returns correct hash after a reset' do h1 = XXhash.xxh32(File.read(__FILE__), 123) xxhash = Digest::XXHash32.new(123) expect(xxhash.digest('test')).to eq(2758658570) xxhash.reset result = use_external_hash xxhash, File.open(__FILE__) expect(result).to eq(h1) end end describe 'Digest::XXHash64' do it 'returns the hash for streamed strings' do StringIO.open('test') do |io| xxhash = Digest::XXHash64.new(123) result = use_external_hash xxhash, io expect(result).to eq(3134990500624303823) end end it 'returns the hash for streamed files' do h1 = XXhash.xxh64(File.read(__FILE__), 123) xxhash = Digest::XXHash64.new(123) result = use_external_hash xxhash, File.open(__FILE__) expect(result).to eq(h1) end it 'returns correct hash after a reset' do h1 = XXhash.xxh64(File.read(__FILE__), 123) xxhash = Digest::XXHash64.new(123) expect(xxhash.digest('test')).to eq(3134990500624303823) xxhash.reset result = use_external_hash xxhash, File.open(__FILE__) expect(result).to eq(h1) end end end
{ "content_hash": "792376a1ef4f6779e97ab0c3072917bd", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 78, "avg_line_length": 27.68807339449541, "alnum_prop": 0.6252485089463221, "repo_name": "justinwsmith/ruby-xxhash", "id": "4d0dd16059a8a9e546482d28e646f385e48894c2", "size": "3093", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/xxhash_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "12898" } ], "symlink_target": "" }
const path = require('path'); const assert = require('assert'); module.exports = { description: 'bundle.modules includes dependencies (#903)', bundle(bundle) { const modules = bundle.modules.map(module => { return { id: path.relative(__dirname, module.id), dependencies: module.dependencies.map(id => path.relative(__dirname, id)) }; }); assert.deepEqual(modules, [ { id: 'main.js', dependencies: ['foo.js', 'bar.js'] }, { id: 'foo.js', dependencies: ['bar.js'] }, { id: 'bar.js', dependencies: [path.normalize('nested/baz.js')] }, { id: path.normalize('nested/baz.js'), dependencies: [path.normalize('nested/qux.js')] }, { id: path.normalize('nested/qux.js'), dependencies: [] } ]); }, warnings: [ { code: 'EMPTY_BUNDLE', message: 'Generated an empty bundle' } ] };
{ "content_hash": "de35494060a7bc875e82a914a459feb9", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 77, "avg_line_length": 20.372093023255815, "alnum_prop": 0.5844748858447488, "repo_name": "corneliusweig/rollup", "id": "389ce982ba35d95c29ebb27f27f0286d8799ae8d", "size": "876", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/function/samples/module-tree/_config.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "636637" } ], "symlink_target": "" }
package asyncassertion_test import ( . "github.com/gopkg/database/leveldb/internal/ginkgo" . "github.com/gopkg/database/leveldb/internal/gomega" "testing" ) func TestAsyncAssertion(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "AsyncAssertion Suite") }
{ "content_hash": "d81f915f105294e638da4d3cf2762bef", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 54, "avg_line_length": 20.692307692307693, "alnum_prop": 0.7657992565055762, "repo_name": "gopkg/database", "id": "fd67f0d31ef36b9403a316eac407c0db90a58e9c", "size": "269", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "leveldb/internal/gomega/internal/asyncassertion/async_assertion_suite_test.go", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "8004139" }, { "name": "C++", "bytes": "366162" }, { "name": "Go", "bytes": "2570108" }, { "name": "JavaScript", "bytes": "7407" }, { "name": "Makefile", "bytes": "802" }, { "name": "Objective-C", "bytes": "3062" }, { "name": "Shell", "bytes": "1424" } ], "symlink_target": "" }
package org.cloudfoundry.uaa.authorizations; import org.immutables.value.Value; /** * The request payload for authorize by open id with an id token operation */ @Value.Immutable abstract class _AuthorizeByOpenIdWithIdTokenRequest extends AbstractAuthorizationRequest { }
{ "content_hash": "d17800d36b02e7eeb03300acf7b7644e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 90, "avg_line_length": 21.384615384615383, "alnum_prop": 0.8057553956834532, "repo_name": "cloudfoundry/cf-java-client", "id": "aa3d1e91e3aa685a7f5060441746615d03f5d236", "size": "898", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/authorizations/_AuthorizeByOpenIdWithIdTokenRequest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "460" }, { "name": "HTML", "bytes": "818" }, { "name": "Java", "bytes": "7530131" }, { "name": "Shell", "bytes": "6507" } ], "symlink_target": "" }
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/joey/Documents/Projects/rcTest") set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/joey/Documents/Projects/rcTest/build") # Force unix paths in dependencies. set(CMAKE_FORCE_UNIX_PATHS 1) # The C and CXX include file regular expressions for this directory. set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
{ "content_hash": "978fc1c715e22baf886f99a4e1294582", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 80, "avg_line_length": 42.5, "alnum_prop": 0.7666666666666667, "repo_name": "tongnalin/retinacheck", "id": "257f9b4788d933056021fe120518905082b2a99d", "size": "653", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Linux/build/CMakeFiles/CMakeDirectoryInformation.cmake", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "16040" }, { "name": "C++", "bytes": "29578" }, { "name": "CMake", "bytes": "10574" }, { "name": "Makefile", "bytes": "4791" } ], "symlink_target": "" }
package eu.the5zig.mod.server; /** * An abstract class that represents a server game mode. Override to store custom values for each specific game mode. */ public abstract class GameMode { /** * Stores a unix time stamp that is either used to display the remaining time or current time, depending * on the {@link #state}. */ protected long time; /** * The current game state. */ protected GameState state; // Preset fields. protected int kills; protected int killStreak; protected long killStreakTime; protected int killstreakDuration = 1000 * 20; protected int deaths; protected String winner; protected boolean respawnable; public GameMode() { this.time = -1; killStreakTime = -1; this.state = GameState.LOBBY; this.respawnable = false; } public long getTime() { return time; } public void setTime(long time) { this.time = time; } public GameState getState() { return state; } public void setState(GameState state) { this.state = state; if (state == GameState.FINISHED) { time = System.currentTimeMillis() - time; } else { this.time = -1; } } public int getKills() { return kills; } public void setKills(int kills) { this.kills = kills; } public int getKillStreak() { if (killStreakTime != -1 && System.currentTimeMillis() - killStreakTime > 0) { killStreakTime = -1; killStreak = 0; } return killStreak; } public void setKillStreak(int killStreak) { this.killStreak = killStreak; this.killStreakTime = System.currentTimeMillis() + killstreakDuration; } public int getDeaths() { return deaths; } public void setDeaths(int deaths) { this.deaths = deaths; } public String getWinner() { return winner; } public void setWinner(String winner) { this.winner = winner; } public boolean isRespawnable() { return respawnable; } public void setRespawnable(boolean canRespawn) { this.respawnable = canRespawn; } public abstract String getName(); }
{ "content_hash": "af866fc9535be6c90cc64ef93b8508a2", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 117, "avg_line_length": 18.990384615384617, "alnum_prop": 0.6941772151898734, "repo_name": "5zig/The-5zig-API", "id": "f93a683e3f357d7e0d4cb79cffbdf7388a82c479", "size": "2592", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/eu/the5zig/mod/server/GameMode.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "100674" } ], "symlink_target": "" }
use crate::QString; use cpp_core::CppBox; use std::os::raw::{c_char, c_int}; /// Allows to convert Qt strings to `std` strings impl<'a> From<&'a QString> for String { fn from(s: &'a QString) -> String { s.to_std_string() } } impl QString { /// Creates Qt string from an `std` string. /// /// `QString` makes a deep copy of the data. pub fn from_std_str<S: AsRef<str>>(s: S) -> CppBox<QString> { let slice = s.as_ref().as_bytes(); unsafe { QString::from_utf8_char_int(slice.as_ptr() as *mut c_char, slice.len() as c_int) } } /// Creates an `std` string from a Qt string. pub fn to_std_string(&self) -> String { unsafe { let buf = self.to_utf8(); let bytes = std::slice::from_raw_parts(buf.const_data() as *const u8, buf.size() as usize); std::str::from_utf8_unchecked(bytes).to_string() } } } /// Creates a `QString` from a Rust string. /// /// This is the same as `QString::from_std_str(str)`. pub fn qs<S: AsRef<str>>(str: S) -> CppBox<QString> { QString::from_std_str(str) }
{ "content_hash": "955eefe8a0db44c178d11c3060cfeee1", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 99, "avg_line_length": 30.18918918918919, "alnum_prop": 0.5684870188003581, "repo_name": "rust-qt/cpp_to_rust", "id": "c17b594ad3f509f4fa695a91793e64b8efe890df", "size": "1117", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "qt_ritual/crate_templates/qt_core/src/impl_q_string.rs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2260" }, { "name": "C", "bytes": "994" }, { "name": "C++", "bytes": "9321" }, { "name": "CMake", "bytes": "3196" }, { "name": "Python", "bytes": "460" }, { "name": "Rust", "bytes": "851132" }, { "name": "Shell", "bytes": "1638" } ], "symlink_target": "" }
package com.twitter.hpack; import java.io.IOException; import java.io.OutputStream; final class HuffmanEncoder { private final int[] codes; private final byte[] lengths; /** * Creates a new Huffman encoder with the specified Huffman coding. * @param codes the Huffman codes indexed by symbol * @param lengths the length of each Huffman code */ HuffmanEncoder(int[] codes, byte[] lengths) { this.codes = codes; this.lengths = lengths; } /** * Compresses the input string literal using the Huffman coding. * @param out the output stream for the compressed data * @param data the string literal to be Huffman encoded * @throws IOException if an I/O error occurs. * @see com.twitter.hpack.HuffmanEncoder#encode(OutputStream, byte[], int, int) */ public void encode(OutputStream out, byte[] data) throws IOException { encode(out, data, 0, data.length); } /** * Compresses the input string literal using the Huffman coding. * @param out the output stream for the compressed data * @param data the string literal to be Huffman encoded * @param off the start offset in the data * @param len the number of bytes to encode * @throws IOException if an I/O error occurs. In particular, * an <code>IOException</code> may be thrown if the * output stream has been closed. */ public void encode(OutputStream out, byte[] data, int off, int len) throws IOException { if (out == null) { throw new NullPointerException("out"); } else if (data == null) { throw new NullPointerException("data"); } else if (off < 0 || len < 0 || (off + len) < 0 || off > data.length || (off + len) > data.length) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return; } long current = 0; int n = 0; for (int i = 0; i < len; i++) { int b = data[off + i] & 0xFF; int code = codes[b]; int nbits = lengths[b]; current <<= nbits; current |= code; n += nbits; while (n >= 8) { n -= 8; out.write(((int)(current >> n))); } } if (n > 0) { current <<= (8 - n); current |= (0xFF >>> n); // this should be EOS symbol out.write((int)current); } } /** * Returns the number of bytes required to Huffman encode the input string literal. * @param data the string literal to be Huffman encoded * @return the number of bytes required to Huffman encode <code>data</code> */ public int getEncodedLength(byte[] data) { if (data == null) { throw new NullPointerException("data"); } long len = 0; for (byte b : data) { len += lengths[b & 0xFF]; } return (int)((len + 7) >> 3); } }
{ "content_hash": "9fc01a23275dc471193581c5896822b4", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 105, "avg_line_length": 29.53191489361702, "alnum_prop": 0.6102305475504323, "repo_name": "twitter/hpack", "id": "a2dcbb62b0cb23ee14f4e7ab2332d606bbecfd92", "size": "3372", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "hpack/src/main/java/com/twitter/hpack/HuffmanEncoder.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "104157" } ], "symlink_target": "" }
package facebox import ( "bytes" "encoding/json" "io" "net/http" "net/url" "github.com/pkg/errors" ) // CompareFaceprints returns the confidence of the comparsion between the target faceprint // and each of faceprint of the slice of candidates and returns an array of confidence in the same order // of the candidates func (c *Client) CompareFaceprints(target string, faceprintCandidates []string) ([]float64, error) { if target == "" { return nil, errors.New("target can not be empty") } u, err := url.Parse(c.addr + "/facebox/faceprint/compare") if err != nil { return nil, err } if !u.IsAbs() { return nil, errors.New("box address must be absolute") } request := compareFaceprintRequest{ Target: target, Faceprints: faceprintCandidates, } var buf bytes.Buffer if err := json.NewEncoder(&buf).Encode(request); err != nil { return nil, errors.Wrap(err, "encoding request body") } req, err := http.NewRequest(http.MethodPost, u.String(), &buf) if err != nil { return nil, err } req.Header.Set("Accept", "application/json; charset=utf-8") req.Header.Set("Content-Type", "application/json; charset=utf-8") resp, err := c.HTTPClient.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 300 { return nil, errors.New(resp.Status) } return c.parseCompareFacesResponse(resp.Body) } type compareFaceprintRequest struct { Faceprints []string `json:"faceprints"` Target string `json:"target"` } func (c *Client) parseCompareFacesResponse(r io.Reader) ([]float64, error) { var compareFaceprintsResponse struct { Success bool Error string Confidences []float64 } if err := json.NewDecoder(r).Decode(&compareFaceprintsResponse); err != nil { return nil, errors.Wrap(err, "decoding response") } if !compareFaceprintsResponse.Success { return nil, ErrFacebox(compareFaceprintsResponse.Error) } return compareFaceprintsResponse.Confidences, nil } type checkFaceprintRequest struct { Faceprints []string `json:"faceprints"` } // CheckFaceprints checks the list of faceprints to see if they // match any known faces. func (c *Client) CheckFaceprints(faceprints []string) ([]Face, error) { if len(faceprints) == 0 { return nil, errors.New("faceprints can not be empty") } u, err := url.Parse(c.addr + "/facebox/faceprint/check") if err != nil { return nil, err } if !u.IsAbs() { return nil, errors.New("box address must be absolute") } request := checkFaceprintRequest{ Faceprints: faceprints, } var buf bytes.Buffer if err := json.NewEncoder(&buf).Encode(request); err != nil { return nil, errors.Wrap(err, "encoding request body") } req, err := http.NewRequest(http.MethodPost, u.String(), &buf) if err != nil { return nil, err } req.Header.Set("Accept", "application/json; charset=utf-8") req.Header.Set("Content-Type", "application/json; charset=utf-8") resp, err := c.HTTPClient.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 300 { return nil, errors.New(resp.Status) } return c.parseCheckFaceprintResponse(resp.Body) } func (c *Client) parseCheckFaceprintResponse(r io.Reader) ([]Face, error) { var checkResponse struct { Success bool Error string Faceprints []Face } if err := json.NewDecoder(r).Decode(&checkResponse); err != nil { return nil, errors.Wrap(err, "decoding response") } if !checkResponse.Success { return nil, ErrFacebox(checkResponse.Error) } return checkResponse.Faceprints, nil }
{ "content_hash": "d2502b3302976da2e2cb467c3980340a", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 104, "avg_line_length": 27.72093023255814, "alnum_prop": 0.7027404921700223, "repo_name": "machinebox/sdk-go", "id": "de3afda5c0322d028b9933ab7c2353744e5ec240", "size": "3576", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "facebox/facebox_faceprint.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "217955" } ], "symlink_target": "" }
const { decode, parse } = require('./response') const { KafkaJSProtocolError } = require('../../../../errors') describe('Protocol > Requests > TxnOffsetCommit > v1', () => { test('response', async () => { const data = await decode(Buffer.from(require('../fixtures/v0_response.json'))) expect(data).toEqual({ clientSideThrottleTime: 0, throttleTime: 0, topics: [ { topic: 'test-topic-0ba33173f7664d75c6b2-63632-a0dab079-1c9a-44ba-be25-ca3d50df5003', partitions: [ { errorCode: 0, partition: 1 }, { errorCode: 0, partition: 2 }, ], }, ], }) await expect(parse(data)).resolves.toBeTruthy() }) test('throws KafkaJSProtocolError if there is an error on any of the partitions', async () => { const data = { throttleTime: 0, topics: [ { topic: 'test-topic', partitions: [ { errorCode: 0, partition: 1 }, { errorCode: 49, partition: 2 }, ], }, ], } await expect(parse(data)).rejects.toEqual( new KafkaJSProtocolError( 'The producer attempted to use a producer id which is not currently assigned to its transactional id' ) ) }) })
{ "content_hash": "fb88a6bc9a523c68ee8deff6eead4c5b", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 109, "avg_line_length": 28.818181818181817, "alnum_prop": 0.5583596214511041, "repo_name": "tulios/kafkajs", "id": "dc952a3ff6cbbcfb626273789fcaf219aea06453", "size": "1268", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/protocol/requests/txnOffsetCommit/v1/response.spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1737" }, { "name": "Java", "bytes": "2370" }, { "name": "JavaScript", "bytes": "1614176" }, { "name": "Shell", "bytes": "14273" }, { "name": "TypeScript", "bytes": "9014" } ], "symlink_target": "" }
<partial> <entry> <form>http://openrosa.org/formdesigner/5FBED77B-E327-495D-97E8-0733B97D8EA5</form> <command id="m1-f0"> <text> <locale id="forms.m1f0"/> </text> </command> <instance id="casedb" src="jr://instance/casedb"/> <instance id="commcaresession" src="jr://instance/session"/> <session> <datum function="instance('casedb')/casedb/case[@case_type='commcare-user'][hq_user_id=instance('commcaresession')/session/context/userid][1]/@case_id" id="case_id_case_clinic"/> </session> <assertions> <assert test="count(instance('casedb')/casedb/case[@case_type='commcare-user'][hq_user_id=instance('commcaresession')/session/context/userid][1]) = 1"> <text> <locale id="case_autoload.usercase.case_missing"/> </text> </assert> </assertions> </entry> </partial>
{ "content_hash": "7a72cda79d5f398a041c7795ac510a22", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 184, "avg_line_length": 39.36363636363637, "alnum_prop": 0.6327944572748267, "repo_name": "puttarajubr/commcare-hq", "id": "8f55ce857cd8478c1988cefdf29b5dd5b3dd626e", "size": "866", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "corehq/apps/app_manager/tests/data/suite/suite-advanced-autoselect-usercase.xml", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ActionScript", "bytes": "15950" }, { "name": "CSS", "bytes": "581878" }, { "name": "HTML", "bytes": "2790361" }, { "name": "JavaScript", "bytes": "2572023" }, { "name": "Makefile", "bytes": "3999" }, { "name": "Python", "bytes": "11275678" }, { "name": "Shell", "bytes": "23890" } ], "symlink_target": "" }
using MultiMiner.UX.ViewModels; using System.Linq; namespace MultiMiner.TUI.Commands { class SwitchAllCommand { private readonly ApplicationViewModel app; public SwitchAllCommand(ApplicationViewModel app) { this.app = app; } public bool HandleCommand(string[] input) { if (input.Count() == 2) { app.SetAllDevicesToCoin(input[1], true); return true; } return false; } } }
{ "content_hash": "9d3a9533f6b547cd4f36fe475f664f32", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 57, "avg_line_length": 20.615384615384617, "alnum_prop": 0.5335820895522388, "repo_name": "IWBWbiz/MultiMiner", "id": "5b58ea7fbb309422fbf149b4978d25c8360a33de", "size": "538", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "MultiMiner.TUI/Commands/SwitchAllCommand.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1117896" }, { "name": "Groff", "bytes": "5677330" }, { "name": "Inno Setup", "bytes": "7861" }, { "name": "Shell", "bytes": "2388" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace Scheb\TwoFactorBundle\Tests\Security\TwoFactor\Handler; use PHPUnit\Framework\MockObject\MockObject; use Scheb\TwoFactorBundle\Security\TwoFactor\Handler\AuthenticationHandlerInterface; use Scheb\TwoFactorBundle\Security\TwoFactor\Handler\TrustedDeviceHandler; use Scheb\TwoFactorBundle\Security\TwoFactor\Trusted\TrustedDeviceManager; class TrustedDeviceHandlerTest extends AbstractAuthenticationHandlerTestCase { /** * @var MockObject|AuthenticationHandlerInterface */ private $innerAuthenticationHandler; /** * @var MockObject|TrustedDeviceManager */ private $trustedDeviceManager; /** * @var TrustedDeviceHandler */ private $trustedHandler; protected function setUp(): void { $this->innerAuthenticationHandler = $this->createMock(AuthenticationHandlerInterface::class); $this->trustedDeviceManager = $this->createMock(TrustedDeviceManager::class); $this->trustedHandler = $this->createTrustedHandler(false); } private function createTrustedHandler(bool $extendTrustedToken): TrustedDeviceHandler { return new TrustedDeviceHandler($this->innerAuthenticationHandler, $this->trustedDeviceManager, $extendTrustedToken); } protected function stubIsTrustedDevice(bool $isTrustedDevice): void { $this->trustedDeviceManager ->expects($this->any()) ->method('isTrustedDevice') ->willReturn($isTrustedDevice); } /** * @test */ public function beginAuthentication_trustedOptionEnabled_checkTrustedToken(): void { $user = $this->createUser(); $context = $this->createAuthenticationContext(null, null, $user); $this->trustedDeviceManager ->expects($this->once()) ->method('isTrustedDevice') ->with($user, 'firewallName'); $this->trustedHandler->beginTwoFactorAuthentication($context); } /** * @test */ public function beginAuthentication_isTrustedDevice_returnOriginalToken(): void { $originalToken = $this->createToken(); $context = $this->createAuthenticationContext(null, $originalToken); $this->stubIsTrustedDevice(true); $this->innerAuthenticationHandler ->expects($this->never()) ->method($this->anything()); $returnValue = $this->trustedHandler->beginTwoFactorAuthentication($context); $this->assertSame($originalToken, $returnValue); } /** * @test */ public function beginAuthentication_isTrustedDeviceAndExtendTrustedToken_addNewTrustedToken(): void { $trustedHandler = $this->createTrustedHandler(true); $user = $this->createUser(); $context = $this->createAuthenticationContext(null, null, $user); $this->stubIsTrustedDevice(true); $this->trustedDeviceManager ->expects($this->once()) ->method('addTrustedDevice') ->with($user, 'firewallName'); $trustedHandler->beginTwoFactorAuthentication($context); } /** * @test */ public function beginAuthentication_isTrustedDeviceAndNotExtendTrustedToken_notAddNewTrustedToken(): void { $trustedHandler = $this->createTrustedHandler(false); $user = $this->createUser(); $context = $this->createAuthenticationContext(null, null, $user); $this->stubIsTrustedDevice(true); $this->trustedDeviceManager ->expects($this->never()) ->method('addTrustedDevice'); $trustedHandler->beginTwoFactorAuthentication($context); } /** * @test */ public function beginAuthentication_notTrustedDevice_returnTokenFromInnerAuthenticationHandler(): void { $context = $this->createAuthenticationContext(); $transformedToken = $this->createToken(); $this->stubIsTrustedDevice(false); $this->trustedDeviceManager ->expects($this->never()) ->method('addTrustedDevice'); $this->innerAuthenticationHandler ->expects($this->once()) ->method('beginTwoFactorAuthentication') ->with($context) ->willReturn($transformedToken); $returnValue = $this->trustedHandler->beginTwoFactorAuthentication($context); $this->assertSame($transformedToken, $returnValue); } }
{ "content_hash": "66ba058f81063168dda1e3ec4630bca0", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 125, "avg_line_length": 32.05035971223022, "alnum_prop": 0.6597081930415264, "repo_name": "scheb/two-factor-bundle", "id": "69dc296aa1e05b8561d5ab7c32638b896a067591", "size": "4455", "binary": false, "copies": "1", "ref": "refs/heads/4.x", "path": "Tests/Security/TwoFactor/Handler/TrustedDeviceHandlerTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2096" }, { "name": "PHP", "bytes": "404463" } ], "symlink_target": "" }
// $Id: Process_Manager.cpp 2622 2015-08-13 18:30:00Z mitza $ // Process_Manager.cpp #include "ace/Process_Manager.h" #if !defined (__ACE_INLINE__) #include "ace/Process_Manager.inl" #endif /* __ACE_INLINE__ */ #include "ace/ACE.h" #include "ace/Guard_T.h" #include "ace/Process.h" #include "ace/Signal.h" #include "ace/Object_Manager.h" #include "ace/Log_Category.h" #include "ace/Reactor.h" #include "ace/Countdown_Time.h" #include "ace/OS_NS_sys_wait.h" #include "ace/OS_NS_signal.h" #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_sys_time.h" #include "ace/os_include/os_typeinfo.h" #include "ace/Truncate.h" #if defined (ACE_HAS_SIG_C_FUNC) extern "C" void ACE_Process_Manager_cleanup (void *instance, void *arg) { ACE_Process_Manager::cleanup (instance, arg); } #endif ACE_BEGIN_VERSIONED_NAMESPACE_DECL void ACE_Process_Manager::cleanup (void *, void *) { ACE_Process_Manager::close_singleton (); } // This function acts as a signal handler for SIGCHLD. We don't really // want to do anything with the signal - it's just needed to interrupt // a sleep. See wait() for more info. #if !defined (ACE_WIN32) && !defined (ACE_LACKS_UNIX_SIGNALS) static void sigchld_nop (int, siginfo_t *, ucontext_t *) { return; } #endif /* ACE_WIN32 */ ACE_ALLOC_HOOK_DEFINE(ACE_Process_Manager) // Singleton instance. ACE_Process_Manager *ACE_Process_Manager::instance_ = 0; // Controls whether the <Process_Manager> is deleted when we shut down // (we can only delete it safely if we created it!) bool ACE_Process_Manager::delete_instance_ = false; ACE_Process_Manager::Process_Descriptor::~Process_Descriptor (void) { } ACE_ALLOC_HOOK_DEFINE(ACE_Process_Manager::Process_Descriptor) void ACE_Process_Manager::Process_Descriptor::dump (void) const { #if defined (ACE_HAS_DUMP) ACE_TRACE ("ACE_Process_Manager::Process_Descriptor::dump"); ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("\nproc_id_ = %d"), this->process_->getpid( ))); ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ } void ACE_Process_Manager::dump (void) const { #if defined (ACE_HAS_DUMP) ACE_TRACE ("ACE_Process_Manager::dump"); ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmax_process_table_size_ = %d"), this->max_process_table_size_)); ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncurrent_count_ = %d"), this->current_count_)); for (size_t i = 0; i < this->current_count_; i++) this->process_table_[i].dump (); ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ } ACE_Process_Manager::Process_Descriptor::Process_Descriptor (void) : process_ (0), exit_notify_ (0) { ACE_TRACE ("ACE_Process_Manager::Process_Descriptor::Process_Descriptor"); } ACE_Process_Manager * ACE_Process_Manager::instance (void) { ACE_TRACE ("ACE_Process_Manager::instance"); if (ACE_Process_Manager::instance_ == 0) { // Perform Double-Checked Locking Optimization. ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance (), 0)); if (ACE_Process_Manager::instance_ == 0) { ACE_NEW_RETURN (ACE_Process_Manager::instance_, ACE_Process_Manager, 0); ACE_Process_Manager::delete_instance_ = true; // Register with the Object_Manager so that the wrapper to // delete the proactor will be called when Object_Manager is // being terminated. #if defined ACE_HAS_SIG_C_FUNC ACE_Object_Manager::at_exit (ACE_Process_Manager::instance_, ACE_Process_Manager_cleanup, 0, typeid (*ACE_Process_Manager::instance_).name ()); #else ACE_Object_Manager::at_exit (ACE_Process_Manager::instance_, ACE_Process_Manager::cleanup, 0, typeid (*ACE_Process_Manager::instance_).name ()); #endif /* ACE_HAS_SIG_C_FUNC */ } } return ACE_Process_Manager::instance_; } ACE_Process_Manager * ACE_Process_Manager::instance (ACE_Process_Manager *tm) { ACE_TRACE ("ACE_Process_Manager::instance"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance (), 0)); ACE_Process_Manager *t = ACE_Process_Manager::instance_; // We can't safely delete it since we don't know who created it! ACE_Process_Manager::delete_instance_ = false; // Register with the Object_Manager so that the wrapper to // delete the proactor will be called when Object_Manager is // being terminated. #if defined ACE_HAS_SIG_C_FUNC ACE_Object_Manager::at_exit (ACE_Process_Manager::instance_, ACE_Process_Manager_cleanup, 0, typeid (*ACE_Process_Manager::instance_).name ()); #else ACE_Object_Manager::at_exit (ACE_Process_Manager::instance_, ACE_Process_Manager::cleanup, 0, typeid (*ACE_Process_Manager::instance_).name ()); #endif /* ACE_HAS_SIG_C_FUNC */ ACE_Process_Manager::instance_ = tm; return t; } void ACE_Process_Manager::close_singleton( void ) { ACE_TRACE ("ACE_Process_Manager::close_singleton"); ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance ())); if (ACE_Process_Manager::delete_instance_) { delete ACE_Process_Manager::instance_; ACE_Process_Manager::instance_ = 0; ACE_Process_Manager::delete_instance_ = false; } } int ACE_Process_Manager::resize (size_t size) { ACE_TRACE ("ACE_Process_Manager::resize"); if (size <= this->max_process_table_size_) return 0; Process_Descriptor *temp = 0; ACE_NEW_RETURN (temp, Process_Descriptor[size], -1); for (size_t i = 0; i < this->current_count_; i++) // Structure assignment. temp[i] = this->process_table_[i]; this->max_process_table_size_ = size; delete [] this->process_table_; this->process_table_ = temp; return 0; } // Create and initialize the table to keep track of the process pool. int ACE_Process_Manager::open (size_t size, ACE_Reactor *r) { ACE_TRACE ("ACE_Process_Manager::open"); if (r) { this->reactor (r); #if !defined (ACE_WIN32) && !defined (ACE_LACKS_UNIX_SIGNALS) // Register signal handler object. if (r->register_handler (SIGCHLD, this) == -1) return -1; #endif /* !defined(ACE_WIN32) */ } ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); if (this->max_process_table_size_ < size) this->resize (size); return 0; } // Initialize the synchronization variables. ACE_Process_Manager::ACE_Process_Manager (size_t size, ACE_Reactor *r) : ACE_Event_Handler (), process_table_ (0), max_process_table_size_ (0), current_count_ (0), default_exit_handler_ (0) #if defined (ACE_HAS_THREADS) , lock_ () #endif /* ACE_HAS_THREADS */ { ACE_TRACE ("ACE_Process_Manager::ACE_Process_Manager"); if (this->open (size, r) == -1) { ACELIB_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ACE_Process_Manager"))); } } // Close up and release all resources. int ACE_Process_Manager::close (void) { ACE_TRACE ("ACE_Process_Manager::close"); if (this->reactor () != 0) { #if !defined (ACE_WIN32) && !defined (ACE_LACKS_UNIX_SIGNALS) this->reactor ()->remove_handler (SIGCHLD, (ACE_Sig_Action *) 0); #endif /* !ACE_WIN32 */ this->reactor (0); } ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); if (this->process_table_ != 0) { while (this->current_count_ > 0) this->remove_proc (0); delete [] this->process_table_; this->process_table_ = 0; this->max_process_table_size_ = 0; this->current_count_ = 0; } if (this->default_exit_handler_ != 0) this->default_exit_handler_->handle_close (ACE_INVALID_HANDLE,0); this->default_exit_handler_ = 0; return 0; } ACE_Process_Manager::~ACE_Process_Manager (void) { ACE_TRACE ("ACE_Process_Manager::~ACE_Process_Manager"); this->close (); } #if !defined (ACE_WIN32) // This is called when the Reactor notices that a Process has exited. // What has actually happened is a SIGCHLD invoked the <handle_signal> // routine, which fooled the Reactor into thinking that this routine // needed to be called. Since we don't know which Process exited, we // must reap as many exit statuses as are immediately available. int ACE_Process_Manager::handle_input (ACE_HANDLE) { ACE_TRACE ("ACE_Process_Manager::handle_input"); pid_t pid; do pid = this->wait (0, ACE_Time_Value::zero); while (pid != 0 && pid != ACE_INVALID_PID); return 0; } int ACE_Process_Manager::handle_close (ACE_HANDLE /* handle */, ACE_Reactor_Mask close_mask) { ACE_TRACE ("ACE_Process_Manager::handle_close"); if (close_mask == ACE_Event_Handler::SIGNAL_MASK) { // Reactor is telling us we're gone; don't unregister again later. this->reactor (0); } return 0; } #endif /* !ACE_WIN32 */ // On Unix, this routine is called asynchronously when a SIGCHLD is // received. We just tweak the reactor so that it'll call back our // <handle_input> function, which allows us to handle Process exits // synchronously. // // On Win32, this routine is called synchronously, and is passed the // HANDLE of the Process that exited, so we can do all our work here. int ACE_Process_Manager::handle_signal (int, siginfo_t *si, ucontext_t *) { #if defined (ACE_WIN32) ACE_HANDLE proc = si->si_handle_; ACE_exitcode status = 0; BOOL result = ::GetExitCodeProcess (proc, &status); if (result) { if (status != STILL_ACTIVE) { { ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, lock_, -1)); ssize_t const i = this->find_proc (proc); if (i == -1) return -1; #if 0 pid_t pid = i != -1 ? process_table_[i].process_->getpid () : ACE_INVALID_PID; #endif this->notify_proc_handler (i, status); this->remove_proc (i); } return -1; // remove this HANDLE/Event_Handler combination } else ACELIB_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Process still active") ACE_TEXT (" -- shouldn't have been called yet!\n")), 0); // return 0 : stay registered } else { // <GetExitCodeProcess> failed. ACELIB_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("GetExitCodeProcess failed")), -1); // return -1: unregister } #else /* !ACE_WIN32 */ ACE_UNUSED_ARG (si); return reactor ()->notify (this, ACE_Event_Handler::READ_MASK); #endif /* !ACE_WIN32 */ } int ACE_Process_Manager::register_handler (ACE_Event_Handler *eh, pid_t pid) { ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); if (pid == ACE_INVALID_PID) { if (this->default_exit_handler_ != 0) this->default_exit_handler_->handle_close (ACE_INVALID_HANDLE, 0); this->default_exit_handler_ = eh; return 0; } ssize_t const i = this->find_proc (pid); if (i == -1) { errno = EINVAL; return -1; } Process_Descriptor &proc_desc = this->process_table_[i]; if (proc_desc.exit_notify_ != 0) proc_desc.exit_notify_->handle_close (ACE_INVALID_HANDLE, 0); proc_desc.exit_notify_ = eh; return 0; } // Create a new process. pid_t ACE_Process_Manager::spawn (ACE_Process_Options &options, ACE_Event_Handler *event_handler) { ACE_Process *process = 0; ACE_NEW_RETURN (process, ACE_Managed_Process, ACE_INVALID_PID); pid_t const pid = this->spawn (process, options, event_handler); if (pid == ACE_INVALID_PID || pid == 0) delete process; return pid; } // Create a new process. pid_t ACE_Process_Manager::spawn (ACE_Process *process, ACE_Process_Options &options, ACE_Event_Handler *event_handler) { ACE_TRACE ("ACE_Process_Manager::spawn"); pid_t const pid = process->spawn (options); // Only include the pid in the parent's table. if (pid == ACE_INVALID_PID || pid == 0) return pid; ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); if (this->append_proc (process, event_handler) == -1) // bad news: spawned, but not registered in table. return ACE_INVALID_PID; return pid; } // Create N new processs. int ACE_Process_Manager::spawn_n (size_t n, ACE_Process_Options &options, pid_t *child_pids, ACE_Event_Handler *event_handler) { ACE_TRACE ("ACE_Process_Manager::spawn_n"); if (child_pids != 0) for (size_t i = 0; i < n; ++i) child_pids[i] = ACE_INVALID_PID; for (size_t i = 0; i < n; i++) { pid_t const pid = this->spawn (options, event_handler); if (pid == ACE_INVALID_PID || pid == 0) // We're in the child or something's gone wrong. return pid; else if (child_pids != 0) child_pids[i] = pid; } return 0; } // Append a process into the pool (does not check for duplicates). // Must be called with locks held. int ACE_Process_Manager::append_proc (ACE_Process *proc, ACE_Event_Handler *event_handler) { ACE_TRACE ("ACE_Process_Manager::append_proc"); // Try to resize the array to twice its existing size (or the DEFAULT_SIZE, // if there are no array entries) if we run out of space... if (this->current_count_ >= this->max_process_table_size_) { size_t new_size = this->max_process_table_size_ * 2; if (new_size == 0) new_size = ACE_Process_Manager::DEFAULT_SIZE; if (this->resize (new_size) == -1) return -1; } Process_Descriptor &proc_desc = this->process_table_[this->current_count_]; proc_desc.process_ = proc; proc_desc.exit_notify_ = event_handler; #if defined (ACE_WIN32) // If we have a Reactor, then we're supposed to reap Processes // automagically. Get a handle to this new Process and tell the // Reactor we're interested in <handling_input> on it. ACE_Reactor * const r = this->reactor (); if (r != 0) r->register_handler (this, proc->gethandle ()); #endif /* ACE_WIN32 */ ++this->current_count_; return 0; } // Insert a process into the pool (checks for duplicates and doesn't // allow them to be inserted twice). int ACE_Process_Manager::insert_proc (ACE_Process *proc, ACE_Event_Handler *event_handler) { ACE_TRACE ("ACE_Process_Manager::insert_proc"); // Check for duplicates and bail out if they're already // registered... if (this->find_proc (proc->getpid ()) != -1) return -1; return this->append_proc (proc, event_handler); } // Remove a process from the pool. int ACE_Process_Manager::remove (pid_t pid) { ACE_TRACE ("ACE_Process_Manager::remove"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); ssize_t const i = this->find_proc (pid); if (i != -1) return this->remove_proc (i); // set "process not found" error return -1; } // Remove a process from the pool. Must be called with locks held. int ACE_Process_Manager::remove_proc (size_t i) { ACE_TRACE ("ACE_Process_Manager::remove_proc"); // If there's an exit_notify_ <Event_Handler> for this pid, call its // <handle_close> method. if (this->process_table_[i].exit_notify_ != 0) { this->process_table_[i].exit_notify_->handle_close (this->process_table_[i].process_->gethandle(), 0); this->process_table_[i].exit_notify_ = 0; } #if defined (ACE_WIN32) ACE_Reactor * const r = this->reactor (); if (r != 0) r->remove_handler (this->process_table_[i].process_->gethandle (), ACE_Event_Handler::DONT_CALL); #endif /* ACE_WIN32 */ this->process_table_[i].process_->unmanage (); this->process_table_[i].process_ = 0; this->current_count_--; if (this->current_count_ > 0) // Compact the table by moving the last item into the slot vacated // by the index being removed (this is a structure assignment). this->process_table_[i] = this->process_table_[this->current_count_]; return 0; } int ACE_Process_Manager::terminate (pid_t pid) { ACE_TRACE ("ACE_Process_Manager::terminate"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); // Check for duplicates and bail out if they're already // registered... ssize_t const i = this->find_proc (pid); if (i == -1) // set "no such process" error return -1; return ACE::terminate_process (pid); } int ACE_Process_Manager::terminate (pid_t pid, int sig) { ACE_TRACE ("ACE_Process_Manager::terminate"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); // Check for duplicates and bail out if they're already // registered... ssize_t const i = this->find_proc (pid); if (i == -1) // set "no such process" error return -1; return ACE_OS::kill (pid, sig); } int ACE_Process_Manager::set_scheduler (const ACE_Sched_Params & params, pid_t pid) { ACE_TRACE ("ACE_Process_Manager::set_scheduler"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); // Check to see if the process identified by the given pid is managed by // this instance of ACE_Process_Manager. ssize_t const i = this->find_proc (pid); if (i == -1) // set "no such process" error return ACE_INVALID_PID; return ACE_OS::sched_params (params, pid); } int ACE_Process_Manager::set_scheduler_all (const ACE_Sched_Params & params) { ACE_TRACE ("ACE_Process_Manager::set_scheduler_all"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); for (size_t i = 0; i < this->current_count_; ++i) { pid_t const pid = this->process_table_[i].process_->getpid (); if (ACE_OS::sched_params (params, pid) != 0) return -1; } return 0; } // Locate the index in the table associated with <pid>. Must be // called with the lock held. ssize_t ACE_Process_Manager::find_proc (pid_t pid) { ACE_TRACE ("ACE_Process_Manager::find_proc"); for (size_t i = 0; i < this->current_count_; ++i) { if (pid == this->process_table_[i].process_->getpid ()) { return ACE_Utils::truncate_cast<ssize_t> (i); } } return -1; } #if defined (ACE_WIN32) // Locate the index in the table associated with <h>. Must be // called with the lock held. ssize_t ACE_Process_Manager::find_proc (ACE_HANDLE h) { ACE_TRACE ("ACE_Process_Manager::find_proc"); for (size_t i = 0; i < this->current_count_; ++i) { if (h == this->process_table_[i].process_->gethandle ()) { return ACE_Utils::truncate_cast<ssize_t> (i); } } return -1; } #endif /* ACE_WIN32 */ // Wait for all the Processs to exit, or until <timeout> elapses. // Returns the number of Processes remaining, or -1 on an error. int ACE_Process_Manager::wait (const ACE_Time_Value &timeout) { ACE_TRACE ("ACE_Process_Manager::wait"); ACE_Time_Value until = timeout; ACE_Time_Value remaining = timeout; if (until < ACE_Time_Value::max_time) until += ACE_OS::gettimeofday (); while (this->current_count_ > 0) { pid_t const pid = this->wait (0, remaining); if (pid == ACE_INVALID_PID) // wait() failed return -1; else if (pid == 0) // timeout break; remaining = until < ACE_Time_Value::max_time ? until - ACE_OS::gettimeofday () : ACE_Time_Value::max_time; if (remaining <= ACE_Time_Value::zero) break; // else Process terminated...wait for more... } return static_cast<int> (this->current_count_); } // Collect a single child process' exit status. Store the exit code // in *<stat_loc> if non-zero. Call the appropriate exit_notify. If // <pid> == 0, wait for any of the Process_Manager's children (or as // near as possible -- on Unix, we might accidentally get some other // Process_Manager's Process, or an unmanaged Process, or a child // process started by some other means. pid_t ACE_Process_Manager::wait (pid_t pid, ACE_exitcode *status) { ACE_TRACE ("ACE_Process_Manager::wait"); return this->wait (pid, ACE_Time_Value::max_time, status); } // Collect a single child processes' exit status, unless <timeout> // elapses before the process exits. Same caveats about accidental // Process reaping on Unix as above. pid_t ACE_Process_Manager::wait (pid_t pid, const ACE_Time_Value &timeout, ACE_exitcode *status) { ACE_TRACE ("ACE_Process_Manager::wait"); ACE_exitcode local_stat = 0; if (status == 0) status = &local_stat; *status = 0; ssize_t idx = -1; ACE_Process *proc = 0; { // fake context after which the lock is released ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); if (pid != 0) { idx = this->find_proc (pid); if (idx == -1) return ACE_INVALID_PID; else proc = process_table_[idx].process_; } // release the lock. } if (proc != 0) pid = proc->wait (timeout, status); else { ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); // Wait for any Process spawned by this Process_Manager. #if defined (ACE_WIN32) HANDLE *handles = 0; ACE_NEW_RETURN (handles, HANDLE[this->current_count_], ACE_INVALID_PID); for (size_t i = 0; i < this->current_count_; ++i) handles[i] = process_table_[i].process_->gethandle (); DWORD handle_count = static_cast<DWORD> (this->current_count_); DWORD result = ::WaitForMultipleObjects (handle_count, handles, FALSE, timeout == ACE_Time_Value::max_time ? INFINITE : timeout.msec ()); if (result == WAIT_FAILED) pid = ACE_INVALID_PID; else if (result == WAIT_TIMEOUT) pid = 0; else { // Green Hills produces a warning that result >= // WAIT_OBJECT_0 is a pointless comparison because // WAIT_OBJECT_0 is zero and DWORD is unsigned long, so this // test is skipped for Green Hills. Same for mingw. # if defined (__MINGW32__) || defined (_MSC_VER) ACE_ASSERT (result < WAIT_OBJECT_0 + this->current_count_); # else ACE_ASSERT (result >= WAIT_OBJECT_0 && result < WAIT_OBJECT_0 + this->current_count_); # endif idx = this->find_proc (handles[result - WAIT_OBJECT_0]); if (idx != -1) { pid = process_table_[idx].process_->getpid (); result = ::GetExitCodeProcess (handles[result - WAIT_OBJECT_0], status); if (result == 0) { // <GetExitCodeProcess> failed! this->remove_proc (idx); pid = ACE_INVALID_PID; } } else { // uh oh...handle removed from process_table_, even though // we're holding a lock! delete [] handles; ACELIB_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Process removed") ACE_TEXT (" -- somebody's ignoring the lock!\n")), -1); } } delete [] handles; #else /* !defined(ACE_WIN32) */ if (timeout == ACE_Time_Value::max_time) pid = ACE_OS::waitpid (-1, status, 0); else if (timeout == ACE_Time_Value::zero) pid = ACE_OS::waitpid (-1, status, WNOHANG); else { # if defined (ACE_LACKS_UNIX_SIGNALS) pid = 0; ACE_Time_Value sleeptm (1); // 1 msec if (sleeptm > timeout) // if sleeptime > waittime sleeptm = timeout; ACE_Time_Value tmo (timeout); // Need one we can change for (ACE_Countdown_Time time_left (&tmo); tmo > ACE_Time_Value::zero ; time_left.update ()) { pid = ACE_OS::waitpid (-1, status, WNOHANG); if (pid > 0 || pid == ACE_INVALID_PID) break; // Got a child or an error - all done // pid 0, nothing is ready yet, so wait. // Do a (very) short sleep (only this thread sleeps). ACE_OS::sleep (sleeptm); } # else // Force generation of SIGCHLD, even though we don't want to // catch it - just need it to interrupt the sleep below. // If this object has a reactor set, assume it was given at // open(), and there's already a SIGCHLD action set, so no // action is needed here. ACE_Sig_Action old_action; if (this->reactor () == 0) { ACE_Sig_Action do_sigchld ((ACE_SignalHandler)sigchld_nop); do_sigchld.register_action (SIGCHLD, &old_action); } ACE_Time_Value tmo (timeout); // Need one we can change for (ACE_Countdown_Time time_left (&tmo); ; time_left.update ()) { pid = ACE_OS::waitpid (-1, status, WNOHANG); # if defined (ACE_VXWORKS) if (pid > 0 || (pid == ACE_INVALID_PID && errno != EINTR)) # else if (pid > 0 || pid == ACE_INVALID_PID) # endif break; // Got a child or an error - all done // pid 0, nothing is ready yet, so wait. // Do a sleep (only this thread sleeps) til something // happens. This relies on SIGCHLD interrupting the sleep. // If SIGCHLD isn't delivered, we'll need to do something // with sigaction to force it. if (-1 == ACE_OS::sleep (tmo) && errno == EINTR) continue; // Timed out pid = 0; break; } // Restore the previous SIGCHLD action if it was changed. if (this->reactor () == 0) old_action.register_action (SIGCHLD); # endif /* !ACE_LACKS_UNIX_SIGNALS */ } #endif /* !defined (ACE_WIN32) */ } ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); if (pid != ACE_INVALID_PID && pid != 0) { //we always need to get our id, because we could have been moved in the table meanwhile idx = this->find_proc (pid); if (idx == -1) { // oops, reaped an unmanaged process! ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) oops, reaped unmanaged %d\n"), pid)); return pid; } else proc = process_table_[idx].process_; if (proc != 0) ACE_ASSERT (pid == proc->getpid ()); this->notify_proc_handler (idx, *status); this->remove (pid); } return pid; } // Notify either the process-specific handler or the generic handler. // If process-specific, call handle_close on the handler. Returns 1 // if process found, 0 if not. Must be called with locks held. int ACE_Process_Manager::notify_proc_handler (size_t i, ACE_exitcode exit_code) { if (i < this->current_count_) { Process_Descriptor &proc_desc = this->process_table_[i]; proc_desc.process_->exit_code (exit_code); if (proc_desc.exit_notify_ != 0) proc_desc.exit_notify_->handle_exit (proc_desc.process_); else if (this->default_exit_handler_ != 0 && this->default_exit_handler_->handle_exit (proc_desc.process_) < 0) { this->default_exit_handler_->handle_close (ACE_INVALID_HANDLE, 0); this->default_exit_handler_ = 0; } return 1; } else { ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P:%t|%T) ACE_Process_Manager::notify_proc_handler:") ACE_TEXT (" unknown/unmanaged process reaped\n"))); return 0; } } ACE_END_VERSIONED_NAMESPACE_DECL
{ "content_hash": "b12816e5e2887c8c95185b7142729835", "timestamp": "", "source": "github", "line_count": 1023, "max_line_length": 105, "avg_line_length": 29.044965786901273, "alnum_prop": 0.5730151785413792, "repo_name": "binary42/OCI", "id": "786b917e96f5fb30bd0e21e65313cb66c2f5d778", "size": "29713", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ace/Process_Manager.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "176672" }, { "name": "C++", "bytes": "28193015" }, { "name": "HTML", "bytes": "19914" }, { "name": "IDL", "bytes": "89802" }, { "name": "LLVM", "bytes": "4067" }, { "name": "Lex", "bytes": "6305" }, { "name": "Makefile", "bytes": "509509" }, { "name": "Yacc", "bytes": "18367" } ], "symlink_target": "" }
layout: page title: Aeon Hero Group Executive Retreat date: 2016-05-24 author: Sarah Mclaughlin tags: weekly links, java status: published summary: Ut augue odio, pulvinar quis sapien eget, luctus vestibulum sapien. banner: images/banner/leisure-02.jpg booking: startDate: 11/25/2017 endDate: 11/30/2017 ctyhocn: SBNGSHX groupCode: AHGER published: true --- Fusce viverra diam eu cursus porta. Praesent sit amet finibus magna, vitae ullamcorper sapien. Morbi bibendum lobortis lectus et consectetur. Suspendisse quis commodo odio. In pharetra massa eu eros lacinia lobortis. Maecenas eleifend diam cursus, vehicula leo at, ultrices orci. Nunc tincidunt diam quis dignissim molestie. Vestibulum vel mauris sit amet nisl molestie vulputate. Sed suscipit arcu urna, eget ornare felis semper blandit. Sed efficitur ultricies mauris, sed pellentesque leo vehicula gravida. Integer a sapien vel arcu tempus dapibus. Curabitur ac diam pretium, dictum sem nec, hendrerit diam. Suspendisse in blandit tellus, feugiat ultricies ante. Donec lacus neque, tincidunt sed dui a, pretium pellentesque neque. Maecenas faucibus blandit nunc, vitae laoreet enim viverra eget. * Aliquam rutrum magna nec libero ornare auctor * In tincidunt eros sed ex porttitor, non interdum risus cursus * Nam tempus magna id tellus aliquam venenatis * Praesent ac ligula molestie, sollicitudin eros ac, sagittis lorem * Etiam vitae diam feugiat sem aliquet venenatis * Curabitur elementum risus imperdiet dui accumsan, a efficitur mi convallis. Nam et massa varius, finibus dolor sit amet, dignissim dui. Proin ac malesuada metus, mattis ornare urna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vulputate odio aliquam ipsum vehicula, ut efficitur nunc sollicitudin. Nullam scelerisque enim et sapien pellentesque semper sed nec risus. Curabitur ultrices dui ac nisl vehicula hendrerit. Mauris ut erat sed dui venenatis accumsan ut a nibh. Integer odio sem, semper vel vulputate et, facilisis eget lacus. Etiam laoreet a erat consectetur lobortis. Fusce euismod ac neque in ornare. Duis tincidunt feugiat metus, vel auctor ipsum tristique eu. Donec in nibh justo. Ut non turpis in mauris scelerisque rutrum et ac velit. In eu sodales nisl. Proin ligula nisi, feugiat a convallis faucibus, condimentum quis nibh. Ut ultricies ex risus, non luctus nulla sodales eu. Nullam efficitur lacus ex, quis dapibus velit accumsan nec. Aliquam elementum sodales arcu ac mattis. Nulla eu dolor at velit pharetra finibus rutrum vitae eros. Quisque hendrerit ligula mauris, sit amet fringilla dui pellentesque in.
{ "content_hash": "e8e8edab47592f8da3cdce547f2b4029", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 614, "avg_line_length": 96, "alnum_prop": 0.8109567901234568, "repo_name": "KlishGroup/prose-pogs", "id": "facde37b8b71d03c65806b959c02aa57e42bc2db", "size": "2596", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "pogs/S/SBNGSHX/AHGER/index.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="app_name">Quiz Sample Wearable App</string> <string name="question">Question %d</string> <string name="quiz_report">Quiz Report</string> <string name="correct">correct</string> <string name="incorrect">incorrect</string> <string name="skipped">skipped</string> <string name="reset_quiz">Reset Quiz</string> </resources>
{ "content_hash": "f4aca676d6373173a39e44fa839906d7", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 63, "avg_line_length": 33.5, "alnum_prop": 0.6886993603411514, "repo_name": "mauimauer/AndroidWearable-Samples", "id": "2136073ccab560890a7227d2fcad76fdcfd93e89", "size": "469", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Quiz/Wearable/src/main/res/values/strings.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "16954" }, { "name": "Java", "bytes": "368218" } ], "symlink_target": "" }
<?php namespace JJSoft\SigesCore\Http\Requests; use Joselfonseca\LaravelApiTools\Http\Requests\ApiRequest; class CreateFieldRequest extends ApiRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'name' => 'required', 'type' => 'required', 'description' => 'required' ]; } }
{ "content_hash": "cb6bf56ff1cda5c6f3263cee978cd12c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 64, "avg_line_length": 19.09375, "alnum_prop": 0.5597381342062193, "repo_name": "jjsoft-ar/siges-core", "id": "4f919e4c7cbf711f80db1bd99c9bc1a90523db89", "size": "611", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Http/Requests/CreateFieldRequest.php", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "5234" }, { "name": "PHP", "bytes": "132690" } ], "symlink_target": "" }
// Provides control sap.ui.commons.MenuItem. sap.ui.define(['jquery.sap.global', './MenuItemBase', './library', 'sap/ui/unified/MenuItem'], function(jQuery, MenuItemBase, library, MenuItem1) { "use strict"; /** * Constructor for a new MenuItem. * * @param {string} [sId] id for the new control, generated automatically if no id is given * @param {object} [mSettings] initial settings for the new control * * @class * Smallest unit in the menu hierarchy. An item can be a direct part of a menu bar, of a menu, or of a sub menu. * @extends sap.ui.unified.MenuItem * * @author SAP SE * @version 1.26.8 * * @constructor * @public * @deprecated Since version 1.21.0. * Please use the control sap.ui.unified.MenuItem of the library sap.ui.unified instead. * @alias sap.ui.commons.MenuItem * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel */ var MenuItem = MenuItem1.extend("sap.ui.commons.MenuItem", /** @lends sap.ui.commons.MenuItem.prototype */ { metadata : { deprecated : true, library : "sap.ui.commons" }}); /*Ensure MenuItemBase is loaded (incl. loading of unified library)*/ return MenuItem; }, /* bExport= */ true);
{ "content_hash": "1942522a73cab7208f4a130e2e565a46", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 122, "avg_line_length": 30.875, "alnum_prop": 0.6874493927125506, "repo_name": "brakmic/OpenUI5_Table_Demo", "id": "f38886f20c68e8adafee10ed5101f2f4fee19492", "size": "1431", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Scripts/vendor/sap/resources/sap/ui/commons/MenuItem-dbg.js", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1380" }, { "name": "CSS", "bytes": "1902" }, { "name": "HTML", "bytes": "10841" }, { "name": "JavaScript", "bytes": "205508" } ], "symlink_target": "" }
function [ variableNameList, status ] = variables( this ) %VARIABLES List all the variables on the MPBus workspace % Detailed explanation goes here [variableList, success] = this.workspace.getVariables(); if success variableNameList = fieldnames(variableList); else variableNameList = {}; end status = success;
{ "content_hash": "5550781d33dc03e97433169fc2489196", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 24.923076923076923, "alnum_prop": 0.7530864197530864, "repo_name": "DKLab/MPAnalyze", "id": "125248d8d713b3726baa3a5f08c7cd6cc925b46d", "size": "324", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "@MPBus/variables.m", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "M", "bytes": "10594" }, { "name": "Matlab", "bytes": "821544" }, { "name": "Mercury", "bytes": "7157" }, { "name": "Objective-C", "bytes": "1780" } ], "symlink_target": "" }
// Copyright (c) 2003-present, Jodd Team (http://jodd.org) // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. package jodd.mail; import jodd.util.ArraysUtil; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Common stuff for both {@link Email} and {@link jodd.mail.ReceivedEmail} */ public abstract class CommonEmail { public static final String X_PRIORITY = "X-Priority"; public static final int PRIORITY_HIGHEST = 1; public static final int PRIORITY_HIGH = 2; public static final int PRIORITY_NORMAL = 3; public static final int PRIORITY_LOW = 4; public static final int PRIORITY_LOWEST = 5; // ---------------------------------------------------------------- from protected EmailAddress from; /** * Sets the FROM address. */ public void setFrom(EmailAddress from) { this.from = from; } /** * Returns FROM {@link EmailAddress address}. */ public EmailAddress getFrom() { return from; } // ---------------------------------------------------------------- to protected EmailAddress[] to = EmailAddress.EMPTY_ARRAY; /** * Sets TO addresses. */ public void setTo(EmailAddress... tos) { if (tos == null) { tos = EmailAddress.EMPTY_ARRAY; } to = tos; } /** * Appends TO address. */ public void addTo(EmailAddress to) { this.to = ArraysUtil.append(this.to, to); } /** * Returns TO addresses. */ public EmailAddress[] getTo() { return to; } // ---------------------------------------------------------------- reply-to protected EmailAddress[] replyTo = EmailAddress.EMPTY_ARRAY; /** * Sets REPLY-TO addresses. */ public void setReplyTo(EmailAddress... replyTo) { if (replyTo == null) { replyTo = EmailAddress.EMPTY_ARRAY; } this.replyTo = replyTo; } /** * Appends REPLY-TO address. */ public void addReplyTo(EmailAddress to) { this.replyTo = ArraysUtil.append(this.replyTo, to); } /** * Returns REPLY-TO addresses. */ public EmailAddress[] getReplyTo() { return replyTo; } // ---------------------------------------------------------------- cc protected EmailAddress[] cc = EmailAddress.EMPTY_ARRAY; /** * Sets CC addresses. */ public void setCc(EmailAddress... ccs) { if (ccs == null) { ccs = EmailAddress.EMPTY_ARRAY; } cc = ccs; } /** * Appends CC address. */ public void addCc(EmailAddress to) { this.cc = ArraysUtil.append(this.cc, to); } /** * Returns CC addresses. */ public EmailAddress[] getCc() { return cc; } // ---------------------------------------------------------------- bcc protected EmailAddress[] bcc = EmailAddress.EMPTY_ARRAY; /** * Sets BCC addresses. */ public void setBcc(EmailAddress... bccs) { if (bccs == null) { bccs = EmailAddress.EMPTY_ARRAY; } bcc = bccs; } /** * Appends BCC address. */ public void addBcc(EmailAddress to) { this.bcc = ArraysUtil.append(this.bcc, to); } /** * Returns BCC addresses. */ public EmailAddress[] getBcc() { return bcc; } // ---------------------------------------------------------------- subject protected String subject; protected String subjectEncoding; /** * Sets message subject. */ public void setSubject(String subject) { this.subject = subject; } /** * Sets message subject with specified encoding to override default platform encoding. * If the subject contains non US-ASCII characters, it will be encoded using the specified charset. * If the subject contains only US-ASCII characters, no encoding is done and it is used as-is. * The application must ensure that the subject does not contain any line breaks. * See {@link javax.mail.internet.MimeMessage#setSubject(String, String)}. */ public void setSubject(String subject, String encoding) { this.subject = subject; this.subjectEncoding = encoding; } /** * Returns message subject. */ public String getSubject() { return this.subject; } /** * Returns the message subject encoding. */ public String getSubjectEncoding() { return this.subjectEncoding; } // ---------------------------------------------------------------- message protected List<EmailMessage> messages = new ArrayList<>(); /** * Returns all messages. */ public List<EmailMessage> getAllMessages() { return messages; } public void addMessage(EmailMessage emailMessage) { messages.add(emailMessage); } public void addMessage(String text, String mimeType, String encoding) { messages.add(new EmailMessage(text, mimeType, encoding)); } public void addMessage(String text, String mimeType) { messages.add(new EmailMessage(text, mimeType)); } // ---------------------------------------------------------------- headers protected Map<String, String> headers; /** * Returns all headers as a <code>HashMap</code>. */ protected Map<String, String> getAllHeaders() { return headers; } /** * Sets a new header value. */ public void setHeader(String name, String value) { if (headers == null) { headers = new HashMap<>(); } headers.put(name, value); } public String getHeader(String name) { if (headers == null) { return null; } return headers.get(name); } /** * Sets email priority. * Values of 1 through 5 are acceptable, with 1 being the highest priority, 3 = normal * and 5 = lowest priority. */ public void setPriority(int priority) { setHeader(X_PRIORITY, String.valueOf(priority)); } /** * Returns emails priority (1 - 5) or <code>-1</code> if priority not available. * @see #setPriority(int) */ public int getPriority() { if (headers == null) { return -1; } try { return Integer.parseInt(headers.get(X_PRIORITY)); } catch (NumberFormatException ignore) { return -1; } } // ---------------------------------------------------------------- date protected Date sentDate; /** * Sets e-mails sent date. If input parameter is <code>null</code> then date * will be when email is physically sent. */ public void setSentDate(Date date) { sentDate = date; } /** * Returns e-mails sent date. If return value is <code>null</code> then date * will be set during the process of sending. * * @return email's sent date or null if it will be set later. */ public Date getSentDate() { return sentDate; } }
{ "content_hash": "49f9b17777ba8abfe6191dfc27c1e548", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 100, "avg_line_length": 25.296178343949045, "alnum_prop": 0.6114818078811532, "repo_name": "vilmospapp/jodd", "id": "485ee768ba7b44852f9a37cce97cec5a8bd3731e", "size": "7943", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jodd-mail/src/main/java/jodd/mail/CommonEmail.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Groovy", "bytes": "7785" }, { "name": "HTML", "bytes": "4152625" }, { "name": "Java", "bytes": "8149688" }, { "name": "Kotlin", "bytes": "671" }, { "name": "Lex", "bytes": "3873" }, { "name": "Python", "bytes": "40766" }, { "name": "Shell", "bytes": "4004" } ], "symlink_target": "" }
import bcrypt from 'bcrypt'; import jwt from 'jsonwebtoken'; import nodemailer from 'nodemailer'; import decodeJwt from 'jwt-decode'; import smtpTransport from 'nodemailer-smtp-transport'; import util from 'util'; import user from '../models'; import passport from './local'; import validateSignupInput from '../helper/signupFormValidation'; import validateLoginInput from '../helper/loginFormValidation'; import validateResetPassword from '../helper/resetPasswordFormValidation'; import validateForgotPassword from '../helper/forgotPasswordFormValidation'; import formErrorResponse from '../helper/formErrorResponseString'; const User = user.User; /** * @export * @class UserHelpers */ export default class UserHelpers { /** * Get all registered members * @param {object} req for first parameter * @param {object} res for second parameter * @returns {object} a response object */ getAllRegisteredMembers(req, res) { User.findAll({}) .then((auser) => { const searchTerm = req.query.term; let appUsers; if (searchTerm.length === 2) { appUsers = auser; } else if (searchTerm.length > 2) { const value = searchTerm.substr(1, searchTerm.length - 2); appUsers = []; auser.forEach((Auser) => { if (value === Auser.username.slice(0, value.length)) { appUsers.push(Auser); } }); } const userArray = appUsers.map((mapUser) => { const userObj = {}; userObj.username = mapUser.username; userObj.email = mapUser.email; userObj.id = mapUser.id; return userObj; }); const PER_PAGE = 5; const offset = req.query.offset ? parseInt(req.query.offset, 10) : 0; const nextOffset = offset + PER_PAGE; const previousOffset = (offset - PER_PAGE < 1) ? 0 : offset - PER_PAGE; const meta = { limit: PER_PAGE, next: util.format('?limit=%s&offset=%s', PER_PAGE, nextOffset), offset: req.query.offset, previous: util.format('?limit=%s&offset=%s', PER_PAGE, previousOffset), total_count: userArray.length }; const getPaginatedItems = userArray.slice(offset, offset + PER_PAGE); res.status(200).json({ meta, userArray, comments: getPaginatedItems }); }) .catch(err => res.status(400).json('error')); } /** * Get one registered user * @param {object} req for first parameter * @param {object} res for second parameter * @returns {object} a response object */ getOneRegisteredUser(req, res) { const token = req.params.token; const decodeToken = decodeJwt(token); const id = decodeToken.id; User.findOne({ where: { id } }).then(users => res.status(200).json({ username: users.username, email: users.email, id: users.id })); } /** * Create new user * @param {object} req for first parameter * @param {object} res for second parameter * @returns {object} a response object */ createUser(req, res) { validateSignupInput(req.body); if (validateSignupInput(req.body).isValid) { const username = req.body.username; const email = req.body.email; const salt = bcrypt.genSaltSync(10); const password = bcrypt.hashSync(req.body.password, salt); User.sync({ force: false }).then(() => { return User .create({ username, email, password, salt }) .then((aUser) => { const token = jwt.sign({ exp: Math.floor(Date.now() / 1000) + (60 * 60), id: aUser.id }, process.env.SECRET_KEY); res.status(201).send({ token }); }) .catch((err) => { res.status(400).json('User already exists'); }); }); } else if (validateSignupInput(req.body).errors) { res.status(400).send(formErrorResponse(validateSignupInput(req.body).errors)); } } /** * Log in a registered user * @param {object} req for first parameter * @param {string} req.username a user's name * @param {string} req.password a user's password * @param {object} res for second parameter * @returns {object} a response object */ loginUser(req, res) { validateLoginInput(req.body); if (validateLoginInput(req.body).isValid) { passport.authenticate('local', (err, aUser) => { if (!aUser) { res.status(401).json('Unauthorized Access'); } if (aUser) { req.logIn(aUser, (err) => { const token = jwt.sign({ exp: Math.floor(Date.now() / 1000) + (60 * 60), id: aUser.id }, process.env.SECRET_KEY); res.status(200).send({ token }); }); } })(req, res); } else if (validateLoginInput(req.body).errors) { res.status(400).send(formErrorResponse(validateLoginInput(req.body).errors)); } } /** * Google auth * @param {object} req for first parameter * @param {object} res for second parameter * @returns {object} a response object */ googleAuth(req, res) { const username = req.body.username; const email = req.body.email; const salt = bcrypt.genSaltSync(10); const password = bcrypt.hashSync(req.body.password, salt); User.findOne({ where: { username } }).then((authUser) => { if (authUser) { const token = jwt.sign({ exp: Math.floor(Date.now() / 1000) + (60 * 60), username: authUser.username, email: authUser.email, id: authUser.id }, process.env.SECRET_KEY); res.status(200).send({ token }); } else { User.create({ username, email, password }).then((googleUser) => { const token = jwt.sign({ exp: Math.floor(Date.now() / 1000) + (60 * 60), username: googleUser.username, email: googleUser.email, id: googleUser.id }, process.env.SECRET_KEY); res.status(201).send({ token }); }); } }); } /** * Send mail to change password * @param {object} req for first parameter * @param {object} res for second parameter * @returns {*} null */ forgotPassword(req, res) { validateForgotPassword(req.body); if (validateForgotPassword(req.body).isValid) { User.findOne({ where: { email: req.body.email } }).then((auser) => { const token = jwt.sign({ exp: Math.floor(Date.now() / 1000) + (60 * 60), username: auser.username, email: auser.email, id: auser.id }, process.env.SECRET_KEY); const expires = Date.now() + 3600000; auser.updateAttributes({ resetPasswordToken: token, resetPasswordExpires: expires }); const transport = nodemailer.createTransport(smtpTransport({ service: 'Gmail', // sets automatically host, port and connection security settings auth: { user: 'kombolpostitapp@gmail.com', pass: 'kombolPostIt' } })); const mailOptions = { to: auser.email, from: 'kombol@PostIt.com', subject: 'PostIt Password Reset', html: `<h4>You are receiving this because you (or someone else) have requested the reset of the password for your account.\n\n Please click on the following link, or paste this into your browser to complete the process:</h4> <a href='http://${req.headers.host}/#/reset/${token}' className='btn waves-effect waves-light' id='notFoundGoback' > Change Password </a> <h4>If you did not request this, please ignore this email and your password will remain unchanged.</h4>` }; transport.sendMail(mailOptions); res.status(201).send({ status: 'An email has been sent to you', token }); }); } else if (validateForgotPassword(req.body).errors) { res.status(401).send(formErrorResponse(validateForgotPassword(req.body).errors)); } } /** * Change a registered users password * @param {object} req for first parameter * @param {object} res for second parameter * @returns {*} null */ changePassword(req, res) { User.findOne({ where: { resetPasswordToken: req.body.token, resetPasswordExpires: { $gt: Date.now() } } }).then((user) => { if (!user) res.status(404).json('User not found'); if (validateResetPassword(req.body).isValid) { const salt = bcrypt.genSaltSync(10); const password = bcrypt.hashSync(req.body.password, salt); user.updateAttributes({ salt, password, resetPasswordToken: undefined, resetPasswordExpires: undefined }); const transport = nodemailer.createTransport(smtpTransport({ service: 'Gmail', // sets automatically host, port and connection security settings auth: { user: 'kombolpostitapp@gmail.com', pass: 'kombolPostIt' } })); const mailOptions = { to: user.email, from: 'kombol@PostIt.com', subject: 'PostIt Password Reset', text: `This is a confirmation that the password for your account ${user.email} has just been changed.\n` }; transport.sendMail(mailOptions); const token = jwt.sign({ exp: Math.floor(Date.now() / 1000) + (60 * 60), username: user.username, email: user.email, id: user.id }, process.env.SECRET_KEY); res.status(200).send({ token, username: user.username }); } else if (validateResetPassword(req.body).errors) { res.status(400).send(formErrorResponse(validateResetPassword(req.body).errors)); } }); } }
{ "content_hash": "879a85b77c9bff64c4eff2aeff49950b", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 136, "avg_line_length": 33.79344262295082, "alnum_prop": 0.5674784127292132, "repo_name": "rkterungwa16/postIt-app", "id": "174e312692f26b4936792e8bb833f16261b1a834", "size": "10307", "binary": false, "copies": "1", "ref": "refs/heads/feature/server-api", "path": "server/controllers/users.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "175199" }, { "name": "HTML", "bytes": "32748" }, { "name": "JavaScript", "bytes": "887990" } ], "symlink_target": "" }
/* eslint-env jest */ /* global jasmine */ import { join } from 'path' import { readFileSync, readdirSync } from 'fs' import rimraf from 'rimraf' import { promisify } from 'util' import { nextServer, runNextCommand, startApp, stopApp } from 'next-test-utils' jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5 const rimrafPromise = promisify(rimraf) let appDir = join(__dirname, '..') let server // let appPort describe('Modern Mode', () => { beforeAll(async () => { await runNextCommand(['build'], { cwd: appDir, stdout: true, stderr: true }) const app = nextServer({ dir: appDir, dev: false, quiet: true, experimental: { modern: true } }) server = await startApp(app) // appPort = server.address().port }) afterAll(async () => { stopApp(server) rimrafPromise(join(appDir, '.next')) }) it('should generate client side modern and legacy build files', async () => { const buildId = readFileSync(join(appDir, '.next/BUILD_ID'), 'utf8') const expectedFiles = [ 'index', '_app', '_error', 'main', 'webpack', 'commons' ] const buildFiles = [ ...readdirSync(join(appDir, '.next/static', buildId, 'pages')), ...readdirSync(join(appDir, '.next/static/runtime')).map( file => file.replace(/-\w+\./, '.') // remove hash ), ...readdirSync(join(appDir, '.next/static/chunks')).map( file => file.replace(/\.\w+\./, '.') // remove hash ) ] console.log(`Client files: ${buildFiles.join(', ')}`) expectedFiles.forEach(file => { expect(buildFiles).toContain(`${file}.js`) expect(buildFiles).toContain(`${file}.module.js`) }) }) })
{ "content_hash": "9f1d48a022e3ccb4f1acd667af7b97b7", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 79, "avg_line_length": 25.676470588235293, "alnum_prop": 0.581901489117984, "repo_name": "BlancheXu/test", "id": "88185316f0d342f2ef1bedaefa2a2cb7a3ccd3de", "size": "1746", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/integration/modern-mode/test/index.test.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1007" }, { "name": "JavaScript", "bytes": "681828" }, { "name": "Shell", "bytes": "1294" }, { "name": "TypeScript", "bytes": "445811" } ], "symlink_target": "" }
#ifndef BOOST_OUTCOME_TRAIT_STD_ERROR_CODE_HPP #define BOOST_OUTCOME_TRAIT_STD_ERROR_CODE_HPP #include "../config.hpp" #include <system_error> BOOST_OUTCOME_V2_NAMESPACE_BEGIN namespace detail { // Customise _set_error_is_errno template <class State> constexpr inline void _set_error_is_errno(State &state, const std::error_code &error) { if(error.category() == std::generic_category() #ifndef _WIN32 || error.category() == std::system_category() #endif ) { state._status.set_have_error_is_errno(true); } } template <class State> constexpr inline void _set_error_is_errno(State &state, const std::error_condition &error) { if(error.category() == std::generic_category() #ifndef _WIN32 || error.category() == std::system_category() #endif ) { state._status.set_have_error_is_errno(true); } } template <class State> constexpr inline void _set_error_is_errno(State &state, const std::errc & /*unused*/) { state._status.set_have_error_is_errno(true); } } // namespace detail namespace policy { namespace detail { /* Pass through `make_error_code` function for `std::error_code`. */ inline std::error_code make_error_code(std::error_code v) { return v; } // Try ADL, if not use fall backs above template <class T> constexpr inline decltype(auto) error_code(T &&v) { return make_error_code(std::forward<T>(v)); } struct std_enum_overload_tag { }; } // namespace detail /*! AWAITING HUGO JSON CONVERSION TOOL SIGNATURE NOT RECOGNISED */ template <class T> constexpr inline decltype(auto) error_code(T &&v) { return detail::error_code(std::forward<T>(v)); } /*! AWAITING HUGO JSON CONVERSION TOOL SIGNATURE NOT RECOGNISED */ // inline void outcome_throw_as_system_error_with_payload(...) = delete; // To use the error_code_throw_as_system_error policy with a custom Error type, you must define a outcome_throw_as_system_error_with_payload() free function to say how to handle the payload inline void outcome_throw_as_system_error_with_payload(const std::error_code &error) { BOOST_OUTCOME_THROW_EXCEPTION(std::system_error(error)); } // NOLINT BOOST_OUTCOME_TEMPLATE(class Error) BOOST_OUTCOME_TREQUIRES(BOOST_OUTCOME_TPRED(std::is_error_code_enum<std::decay_t<Error>>::value || std::is_error_condition_enum<std::decay_t<Error>>::value)) inline void outcome_throw_as_system_error_with_payload(Error &&error, detail::std_enum_overload_tag /*unused*/ = detail::std_enum_overload_tag()) { BOOST_OUTCOME_THROW_EXCEPTION(std::system_error(make_error_code(error))); } // NOLINT } // namespace policy namespace trait { namespace detail { template <> struct _is_error_code_available<std::error_code> { // Shortcut this for lower build impact static constexpr bool value = true; using type = std::error_code; }; } // namespace detail // std::error_code is an error type template <> struct is_error_type<std::error_code> { static constexpr bool value = true; }; // For std::error_code, std::is_error_condition_enum<> is the trait we want. template <class Enum> struct is_error_type_enum<std::error_code, Enum> { static constexpr bool value = std::is_error_condition_enum<Enum>::value; }; } // namespace trait BOOST_OUTCOME_V2_NAMESPACE_END #endif
{ "content_hash": "43dd80110110fd916e9557857d652e79", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 265, "avg_line_length": 33.20792079207921, "alnum_prop": 0.6848539057841383, "repo_name": "kumakoko/KumaGL", "id": "18d430f99cfcadaca3ed389528da9f141df5daa4", "size": "4816", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "third_lib/boost/1.75.0/boost/outcome/detail/trait_std_error_code.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "763" }, { "name": "Batchfile", "bytes": "1610" }, { "name": "C", "bytes": "10066221" }, { "name": "C++", "bytes": "122279207" }, { "name": "CMake", "bytes": "32438" }, { "name": "CSS", "bytes": "97842" }, { "name": "GLSL", "bytes": "288465" }, { "name": "HTML", "bytes": "28003047" }, { "name": "JavaScript", "bytes": "512828" }, { "name": "M4", "bytes": "10000" }, { "name": "Makefile", "bytes": "12990" }, { "name": "Objective-C", "bytes": "100340" }, { "name": "Objective-C++", "bytes": "2520" }, { "name": "Perl", "bytes": "6275" }, { "name": "Roff", "bytes": "332021" }, { "name": "Ruby", "bytes": "9186" }, { "name": "Shell", "bytes": "37826" } ], "symlink_target": "" }
package net.runelite.client.plugins.puzzlesolver.solver.heuristics; import net.runelite.client.plugins.puzzlesolver.solver.PuzzleState; import static net.runelite.client.plugins.puzzlesolver.solver.PuzzleSolver.DIMENSION; /** * An implementation of the manhattan distance heuristic function. * * https://heuristicswiki.wikispaces.com/Manhattan+Distance */ public class ManhattanDistance implements Heuristic { @Override public int computeValue(PuzzleState state) { int value = 0; PuzzleState parent = state.getParent(); if (parent == null) { for (int x = 0; x < DIMENSION; x++) { for (int y = 0; y < DIMENSION; y++) { int piece = state.getPiece(x, y); if (piece == -1) { continue; } int goalX = piece % DIMENSION; int goalY = piece / DIMENSION; value += Math.abs(x - goalX) + Math.abs(y - goalY); } } } else { /* If the Manhattan distance for the parent has already been calculated, we can take advantage of that and just add/subtract from their heuristic value. Doing this decreases the execution time of the heuristic by about 25%. */ value = parent.getHeuristicValue(this); int x = parent.getEmptyPiece() % DIMENSION; int y = parent.getEmptyPiece() / DIMENSION; int x2 = state.getEmptyPiece() % DIMENSION; int y2 = state.getEmptyPiece() / DIMENSION; int piece = state.getPiece(x, y); if (x2 > x) { int targetX = piece % DIMENSION; // right if (targetX > x) value++; else value--; } else if (x2 < x) { int targetX = piece % DIMENSION; // left if (targetX < x) value++; else value--; } else if (y2 > y) { int targetY = piece / DIMENSION; // down if (targetY > y) value++; else value--; } else { int targetY = piece / DIMENSION; // up if (targetY < y) value++; else value--; } } return value; } }
{ "content_hash": "b8c359919932fb53ee90da150f856ec1", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 85, "avg_line_length": 20.25, "alnum_prop": 0.6198559670781894, "repo_name": "UniquePassive/runelite", "id": "7bcb3891b8e4026965435289729cb36f1bbd7c2a", "size": "3393", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "runelite-client/src/main/java/net/runelite/client/plugins/puzzlesolver/solver/heuristics/ManhattanDistance.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Java", "bytes": "8939248" }, { "name": "Shell", "bytes": "775" } ], "symlink_target": "" }
<?php class dmErrorWatcher extends dmConfigurable { protected $dispatcher, $context, $options; public function __construct(sfEventDispatcher $dispatcher, dmContext $context, array $options = array()) { $this->dispatcher = $dispatcher; $this->context = $context; $this->configure($options); } public function getDefaultOptions() { return array( 'error_description_class' => 'dmErrorDescription', 'mail_superadmin' => false, 'store_in_db' => false ); } public function connect() { $this->dispatcher->connect('application.throw_exception', array($this, 'listenToThrowException')); } public function listenToThrowException(sfEvent $event) { $this->handleException($event->getSubject()); } public function handleException(Exception $exception) { try { if ($this->getOption('mail_superadmin') || $this->getOption('store_in_db')) { $error = new $this->options['error_description_class']($exception, $this->context); if($this->getOption('mail_superadmin')) { $this->mailSuperadmin($error); } if($this->getOption('store_in_db')) { $this->storeInDb($error); } } } catch(Exception $e) { die(sprintf('Exception %s thrown while notifying exception %s', $e, $exception)); } } protected function mailSuperadmin(dmErrorDescription $error) { if (!$superAdmin = $this->getSuperadmin()) { return; } $subject = "Exception - {$error->env} - {$error->name}"; $body = "Exception notification for the environment {$error->env} - {$error->date}\n\n"; $body .= $error->exception . "\n\n\n\n\n"; $body .= "Additional data: \n\n"; foreach(array('class', 'name', 'module', 'action', 'uri') as $attribute) { $body .= $attribute . " => " . $error->$attribute . "\n\n"; } mail($superAdmin->email, $subject, $body); } protected function getSuperadmin() { return dmDb::query('DmUser u')->where('u.is_super_admin = ?', true)->fetchRecord(); } protected function storeInDb(dmErrorDescription $error) { dmDb::create('DmError', array( 'description' => $error->name."\n".$error->exception->getTraceAsString(), 'php_class' => $error->class, 'name' => dmString::truncate($error->name, 255, ''), 'module' => $error->module, 'action' => $error->action, 'uri' => $error->uri, 'env' => $error->env, ))->save(); } } class dmErrorDescription { public $exception, $class, $name, $module, $action, $uri, $env, $date; public function __construct(Exception $e, dmContext $context) { $this->exception = $e; $this->class = get_class($e); $this->name = $e->getMessage() ? $e->getMessage() : 'n/a'; $this->module = $context->getModuleName(); $this->action = $context->getActionName(); $this->uri = $context->getRequest()->getUri(); $env = 'n/a'; if ($conf = $context->getConfiguration()) { $env = $conf->getEnvironment(); } $this->env = $env; $this->date = date('H:i:s j F Y'); } }
{ "content_hash": "53efdf4c5a0eb5cb4fecf35cf5e9083f", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 106, "avg_line_length": 24.427480916030536, "alnum_prop": 0.5778125, "repo_name": "carechimba/diem", "id": "dfa18e93c4f98debc4c967f7b85be6446eac13c3", "size": "3200", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dmCorePlugin/lib/debug/dmErrorWatcher.php", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1447883" }, { "name": "PHP", "bytes": "6562230" }, { "name": "Shell", "bytes": "5570" } ], "symlink_target": "" }
package koncept.kwiki.core.resource; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.util.List; import koncept.kwiki.core.WikiResource; public class WikiResourceAssertions { public static void assertResourceDetails(List<WikiResource> resources) { for(WikiResource resource: resources) assertResourceDetails(resource); } public static void assertResourceDetails(WikiResource resource) { assertNotNull(resource); assertName(resource.getName()); } private static void assertName(String name) { assertNotNull(name); assertFalse("contains a backslash: " + name, name.contains("\\")); assertTrue("must start with a slash: " + name, name.startsWith("/")); assertFalse("must not have two slashes in a row: " + name, name.contains("//")); } }
{ "content_hash": "40dcf9981cd0ecd17ac48f17439c90a8", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 82, "avg_line_length": 27.424242424242426, "alnum_prop": 0.7226519337016575, "repo_name": "custom-koncept-ltd/kwiki", "id": "636557141a65b20dffd83cb1dc8c6854d87e11e0", "size": "905", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "kwiki-core/src/test/java/koncept/kwiki/core/resource/WikiResourceAssertions.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "88" }, { "name": "Java", "bytes": "69786" } ], "symlink_target": "" }
/** * TreeHelper.java * Hao Tong * Email: tonghaozju@gmail.com */ package com.cucs.waston.service; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import com.cucs.waston.data.Constants; import com.cucs.waston.data.Target; import com.cucs.waston.data.TargetPair; import edu.stanford.nlp.ling.HasWord; import edu.stanford.nlp.parser.lexparser.LexicalizedParser; import edu.stanford.nlp.process.Tokenizer; import edu.stanford.nlp.trees.GrammaticalStructure; import edu.stanford.nlp.trees.GrammaticalStructureFactory; import edu.stanford.nlp.trees.PennTreebankLanguagePack; import edu.stanford.nlp.trees.Tree; import edu.stanford.nlp.trees.TreebankLanguagePack; import edu.stanford.nlp.trees.TypedDependency; public class TreeHelper { private static LexicalizedParser lp = LexicalizedParser .loadModel(Constants.englishpcfg); private TreebankLanguagePack tlp; private GrammaticalStructureFactory gsf; private Tree parse; private PhraseStructureTree pst; private DependencyTree dt; private Collection<TypedDependency> tdl; public TreeHelper() { super(); this.tlp = new PennTreebankLanguagePack(); this.gsf = tlp.grammaticalStructureFactory(); this.pst = new PhraseStructureTree(); this.dt = new DependencyTree(); } public void initTreeHelper(String sentence) { Tokenizer<? extends HasWord> toke = tlp.getTokenizerFactory() .getTokenizer(new StringReader(sentence)); List<? extends HasWord> sentence_token = toke.tokenize(); this.parse = lp.apply(sentence_token); // stanford pst StringBuilder sb = new StringBuilder(); this.parse.toStringBuilder(sb); // System.out.println("PST:\n " + sb.toString()); // dependency tree GrammaticalStructure gs = gsf.newGrammaticalStructure(parse); this.tdl = gs.typedDependencies(); // System.out.println("DT:\n " + tdl); } public void initTreeHelper(TargetPair tPair) { // Tokenizer<? extends HasWord> toke = tlp.getTokenizerFactory() // .getTokenizer(new StringReader(sentence)); // List<? extends HasWord> sentence_token = toke.tokenize(); // this.parse = lp.apply(sentence_token); // stanford pst // StringBuilder sb = new StringBuilder(); // this.parse.toStringBuilder(sb); // System.out.println("PST:\n " + sb.toString()); // my pst this.pst.initTree(parse); // System.out.println("MY-PST:\n " + pst.toPennString()); // add target pst.addTargets(tPair.t1.ti, tPair.t1.tn, tPair.t2.ti, tPair.t2.tn); // System.out.println("MY-Target-PST:\n " + pst.toPennString()); // dependency tree // GrammaticalStructure gs = gsf.newGrammaticalStructure(parse); // Collection<TypedDependency> tdl = gs.typedDependencies(); // System.out.println("DT:\n " + tdl); // my dependency tree dt.initTree((List<TypedDependency>) tdl); // System.out.println("MY-DT/DW:\n " + dt.toPennString()); // add target to DT/DW dt.addTargets(tPair.t1.ti, tPair.t1.tn, tPair.t2.ti, tPair.t2.tn); // System.out.println("MY-Target-DT/DW:\n " + dt.toPennString()); } public PhraseStructureTree getPRUPST () { // get lowest common pst tree this.pst.convertToSmallestCommonSubTree(); System.out.println("MY-PRU-Target-PST:\n " + pst.toPennString()); return pst; } public DependencyTree getPRUGR () { // get pru_GR tree dt.convertToSmallestCommonSubTree(); DependencyTree pruGR = dt.convertToGrammaticalRelationTree(); System.out.println("MY-PRU-Target-GR:\n " + pruGR.toPennString()); return pruGR; } public DependencyTree getSQGRW () { // get sqgrw tree dt.convertToSmallestCommonSubTree(); DependencyTree sqgrw = dt.convertToGrammaticalRelationWordTree().convertToSQGRWTree(); // System.out.println("MY-PRU-Target-GRW:\n " + dt.convertToGrammaticalRelationWordTree().toPennString()); System.out.println("MY-PRU-Target-SQGRW:\n " + sqgrw.toPennString()); return sqgrw; } public Set<Integer> getPathWordIndexes(int type) { // get path index return dt.getPathWordIndexes(type); } public String formatTreeForSVM(String tree) { tree = this.removeLeaveParent(tree); if (!tree.trim().startsWith("(")) { return ""; } return tree; } public String removeLeaveParent(String input) { // String pattern = "\\([-a-zA-Z0-9.$,:_`'\\s]*\\)"; String pattern = "\\([^\\)^\\(]+\\)"; Pattern r = Pattern.compile(pattern); Matcher m = r.matcher(input); while (m.find()) { String s = m.group(0); String ns = s.substring(1, s.length()-1); ns = ns.trim(); if (ns.contains(" ")) { continue; } input = input.replace(s, ns); } input = input.replaceAll("\\)[\\s]*\\(", ")("); // pattern = "\\)\\s+[-a-zA-Z0-9.,:'\\s]+\\s+\\("; pattern = "\\)[^\\)^\\(]+\\("; r = Pattern.compile(pattern); m = r.matcher(input); while (m.find()) { String s = m.group(0); String ns = s.replaceAll("\\)", "( FUCK"); ns = ns.replaceAll("\\(", ") ("); input = input.replace(s, ns); } input = input.replaceAll("\\)\\s+\\)", "))"); // pattern = "\\)[-a-zA-Z0-9.,$:'\\s]+\\)"; pattern = "\\)[^\\)^\\(]+\\)"; r = Pattern.compile(pattern); m = r.matcher(input); while (m.find()) { String s = m.group(0); String ns = s.replaceAll("\\)", ""); ns = ns.trim(); if (!ns.isEmpty()) ns = ")( FUCK " + ns + "))"; else { ns = "))"; } input = input.replace(s, ns); m = r.matcher(input); } return input; } public static void myDemoDP(LexicalizedParser lp, String sentence) { // This option shows loading, sentence-segmenting and tokenizing a sentence TreebankLanguagePack tlp = new PennTreebankLanguagePack(); GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory(); Tokenizer<? extends HasWord> toke = tlp.getTokenizerFactory() .getTokenizer(new StringReader(sentence)); List<? extends HasWord> sentence_token = toke.tokenize(); Tree parse = lp.apply(sentence_token); // parse.pennPrint(); StringBuilder sb = new StringBuilder(); parse.toStringBuilder(sb); System.out.println("PST:\n " + sb.toString()); // my pst PhraseStructureTree pst = new PhraseStructureTree(); pst.initTree(parse); System.out.println("MYPST:\n " + pst.toPennString()); // add target pst.addTargets(new ArrayList<Integer>(){{add(3);add(4);}}, "T1-individual", new ArrayList<Integer>(){{add(6);add(7);add(8);}}, "T2-individual"); System.out.println("MY-Target-PST:\n " + pst.toPennString()); // get lowest common tree pst.convertToSmallestCommonSubTree(); System.out.println("MY-LCST-Target-PST:\n " + pst.toPennString()); // dependency tree GrammaticalStructure gs = gsf.newGrammaticalStructure(parse); // List<TypedDependency> tdl = gs.typedDependenciesCCprocessed(); Collection<TypedDependency> tdl = gs.typedDependencies(); System.out.println("DT:\n " + tdl); // my dependency tree DependencyTree dt = new DependencyTree(); dt.initTree((List<TypedDependency>) tdl); System.out.println("DT/DW:\n " + dt.toPennString()); System.out.println("GR:\n " + dt.convertToGrammaticalRelationTree().toPennString()); System.out.println("GRW:\n " + dt.convertToGrammaticalRelationWordTree().toPennString()); // add target to DT/DW dt.addTargets(new ArrayList<Integer>(){{add(3);add(4);}}, "T1-individual", new ArrayList<Integer>(){{add(6);add(7);add(8);}}, "T2-individual"); System.out.println("MY-Target-DT/DW:\n " + dt.toPennString()); // get path index System.out.println("Path index: \n"); System.out.println(dt.getPathWordIndexes(1)); System.out.println(dt.getPathWordIndexes(2)); System.out.println(dt.getPathWordIndexes(3)); // get lowest common tree of DT/DW dt.convertToSmallestCommonSubTree(); System.out.println("MY-LCST-Target-DT/DW:\n " + dt.toPennString()); System.out.println("MY-LCST-Target-GR:\n " + dt.convertToGrammaticalRelationTree().toPennString()); System.out.println("MY-LCST-Target-GRW:\n " + dt.convertToGrammaticalRelationWordTree().toPennString()); // get sqgrw tree System.out.println("MY-LCST-Target-SQGRW:\n " + dt.convertToGrammaticalRelationWordTree().convertToSQGRWTree().toPennString()); // Iterator<Tree> it = parse.iterator(); // while (it.hasNext()) { // System.out.println(it.next().value()); // } // File file = new File("./src/main/resources/test.txt"); // try { // FileReader fileReader = new FileReader(file); // PennTreeReader ptr = new PennTreeReader(fileReader); // Tree tr = ptr.readTree(); // tr.pennPrint(); // } catch (FileNotFoundException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } catch (IOException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } } public static void main(String[] args) { //String test = "Military officials say a missile hit his warthog and he was forced to eject"; // String test2 = "Bill Gates and Dick Parson, the ceos of these two companies, smoking a peace pipe right now"; // String test2 = "Military officials say a missile hit his warthog and he was forced to eject"; String test2 = "cnn's gary tuchman is live near the iraqi border with details on the mission and the pilot's rescue"; // String test2 = "When the Mouse heard this, it turned 'round and swam slowly back to her; its face was quite pale, and it said, in a low, trembling voice, Let us get to the shore and then I'll tell you my history and you'll understand why it is I hate cats and dogs."; TargetPair tp = new TargetPair(); // List<Integer> t1l = new ArrayList<Integer>(){{add(3);add(4);}}; // List<Integer> t2l = new ArrayList<Integer>(){{add(6);add(7);add(8);}}; // tp.setT1(new Target("T1-individual", t1l)); // tp.setT2(new Target("T2-individual", t2l)); // List<Integer> t1l = new ArrayList<Integer>(){{add(0);add(1);}}; // List<Integer> t2l = new ArrayList<Integer>(){{add(6);}}; // tp.setT1(new Target("T1-individual", t1l)); // tp.setT2(new Target("T2-individual", t2l)); List<Integer> t1l = new ArrayList<Integer>(){{add(0);add(1);add(2);}}; List<Integer> t2l = new ArrayList<Integer>(){{add(16);add(17);}}; tp.setT1(new Target("T1-individual", t1l)); tp.setT2(new Target("T2-individual", t2l)); TreeHelper th = new TreeHelper(); for (int i = 0; i < 1; i++) { th.initTreeHelper(test2); th.initTreeHelper(tp); System.out.println(th.formatTreeForSVM(th.getPRUPST().toPennString())); System.out.println(th.getPathWordIndexes(1)); System.out.println(th.getPathWordIndexes(2)); System.out.println(th.getPathWordIndexes(3)); System.out.println(th.formatTreeForSVM(th.getPRUGR().toPennString())); System.out.println(th.formatTreeForSVM(th.getSQGRW().toPennString())); } // myDemoDP(lp, test2); } }
{ "content_hash": "6fd5c421ab2dfba423e1d91e9ecec325", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 271, "avg_line_length": 33.52469135802469, "alnum_prop": 0.6786043085987847, "repo_name": "T-abide/SocialEventExtraction", "id": "f0d44980fee627c6d8374850c09721127538ff5d", "size": "10862", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/cucs/waston/service/TreeHelper.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "150" }, { "name": "HTML", "bytes": "11347" }, { "name": "Java", "bytes": "147041" }, { "name": "JavaScript", "bytes": "21098" } ], "symlink_target": "" }