text
stringlengths
2
1.04M
meta
dict
package team.cs6365.payfive.model; public class User { String name = ""; String paypalId = ""; Cart cart = new Cart(); public User() { this("", ""); } public User(String name) { this(name, ""); } public User(String name, String paypalId) { this.name = name; this.paypalId = paypalId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPaypalId() { return paypalId; } public void setPaypalId(String paypalId) { this.paypalId = paypalId; } }
{ "content_hash": "b4da5ceaefbda16b4e5d7b622c26323b", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 44, "avg_line_length": 15.756756756756756, "alnum_prop": 0.6020583190394511, "repo_name": "hoyin29/CS6365Project", "id": "ad8e8896dd71a4a1e35d30578aeb2a5599588d44", "size": "583", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "PayFive/src/team/cs6365/payfive/model/User.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "128969" } ], "symlink_target": "" }
<html> <head> <title>Toby Anstis's panel show appearances</title> <script type="text/javascript" src="../common.js"></script> <link rel="stylesheet" media="all" href="../style.css" type="text/css"/> <script type="text/javascript" src="../people.js"></script> <!--#include virtual="head.txt" --> </head> <body> <!--#include virtual="nav.txt" --> <div class="page"> <h1>Toby Anstis's panel show appearances</h1> <p>Toby Anstis (born 1970-12-14<sup><a href="https://en.wikipedia.org/wiki/Toby_Anstis">[ref]</a></sup>) has appeared in <span class="total">3</span> episodes between 2007-2011. <a href="https://en.wikipedia.org/wiki/Toby_Anstis">Toby Anstis on Wikipedia</a>.</p> <div class="performerholder"> <table class="performer"> <tr style="vertical-align:bottom;"> <td><div style="height:50px;" class="performances male" title="1"></div><span class="year">2007</span></td> <td><div style="height:0px;" class="performances male" title=""></div><span class="year">2008</span></td> <td><div style="height:0px;" class="performances male" title=""></div><span class="year">2009</span></td> <td><div style="height:0px;" class="performances male" title=""></div><span class="year">2010</span></td> <td><div style="height:100px;" class="performances male" title="2"></div><span class="year">2011</span></td> </tr> </table> </div> <ol class="episodes"> <li><strong>2011-12-22</strong> / <a href="../shows/loosewomen.html">Loose Women</a></li> <li><strong>2011-12-21</strong> / <a href="../shows/loosewomen.html">Loose Women</a></li> <li><strong>2007-05-23</strong> / <a href="../shows/loosewomen.html">Loose Women</a></li> </ol> </div> </body> </html>
{ "content_hash": "03c3b953e354039b8191c9d49fd1ecc3", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 265, "avg_line_length": 46.77777777777778, "alnum_prop": 0.6561757719714965, "repo_name": "slowe/panelshows", "id": "4fd6fe1ed9a7d5a5a6c0ffe56d6e72f58a284ebc", "size": "1684", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "people/84zoscwi.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8431" }, { "name": "HTML", "bytes": "25483901" }, { "name": "JavaScript", "bytes": "95028" }, { "name": "Perl", "bytes": "19899" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <Tokens version="1.0"> <File path="Classes/TDMultipartWriter.html"> <Token> <TokenIdentifier>//apple_ref/occ/cl/TDMultipartWriter</TokenIdentifier> <Abstract type="html">A streaming MIME multipart body generator, suitable for use with an NSURLRequest. Reads from a sequence of input streams (or data blobs) and inserts boundary strings between them. Can keep track of the total MIME body length so you can set it as the request&apos;s Content-Length, for servers that have trouble with chunked encodings. </Abstract> <DeclaredIn>TDMultipartWriter.h</DeclaredIn> <NodeRef refid="35"/> </Token> <Token> <TokenIdentifier>//apple_ref/occ/instm/TDMultipartWriter/initWithContentType:boundary:</TokenIdentifier> <Abstract type="html">Initializes an instance.</Abstract> <DeclaredIn>TDMultipartWriter.h</DeclaredIn> <Declaration>- (id)initWithContentType:(NSString *)type boundary:(NSString *)boundary</Declaration> <Parameters> <Parameter> <Name>type</Name> <Abstract type="html">The base content type, e.g. &quot;application/json&quot;.</Abstract> </Parameter><Parameter> <Name>boundary</Name> <Abstract type="html">The MIME part boundary to use, or nil to automatically generate one (a long random string). If you specify a boundary, you have to ensure that it appears nowhere in any of the input data! </Abstract> </Parameter> </Parameters> <Anchor>//api/name/initWithContentType:boundary:</Anchor> </Token> <Token> <TokenIdentifier>//apple_ref/occ/instm/TDMultipartWriter/setContentType:</TokenIdentifier> <Abstract type="html">The full MIME Content-Type header value, including the boundary parameter.</Abstract> <DeclaredIn>TDMultipartWriter.h</DeclaredIn> <Declaration>@property (readonly) NSString *contentType</Declaration> <Anchor>//api/name/contentType</Anchor> </Token> <Token> <TokenIdentifier>//apple_ref/occ/instp/TDMultipartWriter/contentType</TokenIdentifier> <Abstract type="html">The full MIME Content-Type header value, including the boundary parameter.</Abstract> <DeclaredIn>TDMultipartWriter.h</DeclaredIn> <Declaration>@property (readonly) NSString *contentType</Declaration> <Anchor>//api/name/contentType</Anchor> </Token> <Token> <TokenIdentifier>//apple_ref/occ/instm/TDMultipartWriter/setBoundary:</TokenIdentifier> <Abstract type="html">The boundary string.</Abstract> <DeclaredIn>TDMultipartWriter.h</DeclaredIn> <Declaration>@property (readonly) NSString *boundary</Declaration> <Anchor>//api/name/boundary</Anchor> </Token> <Token> <TokenIdentifier>//apple_ref/occ/instp/TDMultipartWriter/boundary</TokenIdentifier> <Abstract type="html">The boundary string.</Abstract> <DeclaredIn>TDMultipartWriter.h</DeclaredIn> <Declaration>@property (readonly) NSString *boundary</Declaration> <Anchor>//api/name/boundary</Anchor> </Token> <Token> <TokenIdentifier>//apple_ref/occ/instm/TDMultipartWriter/setNextPartsHeaders:</TokenIdentifier> <Abstract type="html">Call this before adding a new stream/data/file to specify the MIME headers that should go with it.</Abstract> <DeclaredIn>TDMultipartWriter.h</DeclaredIn> <Declaration>- (void)setNextPartsHeaders:(NSDictionary *)headers</Declaration> <Anchor>//api/name/setNextPartsHeaders:</Anchor> </Token> <Token> <TokenIdentifier>//apple_ref/occ/instm/TDMultipartWriter/openForURLRequest:</TokenIdentifier> <Abstract type="html">Attaches the writer to the URL request. This calls -openForInputStream and sets the resulting input stream as the HTTPBodyStream of the request. It also sets the Content-Type header of the request. </Abstract> <DeclaredIn>TDMultipartWriter.h</DeclaredIn> <Declaration>- (void)openForURLRequest:(NSMutableURLRequest *)request</Declaration> <Anchor>//api/name/openForURLRequest:</Anchor> </Token> </File> </Tokens>
{ "content_hash": "b6e1fa6c5c4cef3187c9017c89d68e9a", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 268, "avg_line_length": 40, "alnum_prop": 0.7264705882352941, "repo_name": "BellGeorge/BGLibrary", "id": "b18152802ebdce53be8c54f79fb73f84c6e7f811", "size": "4080", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Pods/Documentation/TouchDB/docset/Contents/Resources/Tokens35.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "162523" }, { "name": "C", "bytes": "627074" }, { "name": "C++", "bytes": "991" }, { "name": "Objective-C", "bytes": "2309317" }, { "name": "Ruby", "bytes": "15681" }, { "name": "Shell", "bytes": "1534" } ], "symlink_target": "" }
package org.apereo.cas.configuration.model.support.jdbc.authn; import org.apereo.cas.configuration.support.RequiredProperty; import org.apereo.cas.configuration.support.RequiresModule; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; /** * This is {@link QueryEncodeJdbcAuthenticationProperties}. * * @author Misagh Moayyed * @since 5.2.0 */ @RequiresModule(name = "cas-server-support-jdbc-authentication") @Getter @Setter @Accessors(chain = true) public class QueryEncodeJdbcAuthenticationProperties extends BaseJdbcAuthenticationProperties { private static final long serialVersionUID = -6647373426301411768L; /** * Algorithm used for hashing. */ private String algorithmName; /** * SQL query to execute and look up accounts. * Example: {@code SELECT * FROM table WHERE username=?}. */ @RequiredProperty private String sql; /** * Password column name. */ private String passwordFieldName = "password"; /** * Field/column name that indicates the salt used for password hashing. */ @RequiredProperty private String saltFieldName = "salt"; /** * Column name that indicates whether account is expired. */ private String expiredFieldName; /** * Column name that indicates whether account is disabled. */ private String disabledFieldName; /** * Field/column name that indicates the number of iterations used for password hashing. */ private String numberOfIterationsFieldName = "numIterations"; /** * Default number of iterations for hashing. */ private int numberOfIterations; /** * Static salt to be used for hashing. */ private String staticSalt; }
{ "content_hash": "f883ed999eeff446de37461081343347", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 95, "avg_line_length": 24.708333333333332, "alnum_prop": 0.6947723440134908, "repo_name": "leleuj/cas", "id": "3e9bc21984c6d645ba97e91a1d21f0d00947180e", "size": "1779", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/model/support/jdbc/authn/QueryEncodeJdbcAuthenticationProperties.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "13992" }, { "name": "Dockerfile", "bytes": "75" }, { "name": "Groovy", "bytes": "28247" }, { "name": "HTML", "bytes": "196019" }, { "name": "Java", "bytes": "12783758" }, { "name": "JavaScript", "bytes": "85879" }, { "name": "Python", "bytes": "26699" }, { "name": "Ruby", "bytes": "1323" }, { "name": "Shell", "bytes": "173622" } ], "symlink_target": "" }
module.exports = { createClient: require('./client').createClient, createServer: require('./server').createServer, createDb: require('./somedb').createDb };
{ "content_hash": "71bd3b5a1160e54e7f510112c3584487", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 49, "avg_line_length": 32.4, "alnum_prop": 0.7160493827160493, "repo_name": "vegapi/vegapi", "id": "9f311390c1d10caa5921421d0a6d95c46cffedd2", "size": "219", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/index.js", "mode": "33261", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "140259" } ], "symlink_target": "" }
package com.gruppe27.fellesprosjekt; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest(String testName) { super(testName); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite(AppTest.class); } /** * Rigourous Test :-) */ public void testApp() { assertTrue(true); } }
{ "content_hash": "22b960fc3114b945c8a48b2388df457c", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 46, "avg_line_length": 18.764705882352942, "alnum_prop": 0.5956112852664577, "repo_name": "Fellesprosjekt-27/fellesprosjekt", "id": "8d6a15bc1194e8b18d5069d5bd04d45c3a1c9ee8", "size": "638", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/com/gruppe27/fellesprosjekt/AppTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "865" }, { "name": "Java", "bytes": "131054" } ], "symlink_target": "" }
// Copyright 2022 Google LLC // // 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. package com.google.api.ads.admanager.jaxws.v202205; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * * Errors associated with line items with GRP settings. * * * <p>Java class for GrpSettingsError complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="GrpSettingsError"> * &lt;complexContent> * &lt;extension base="{https://www.google.com/apis/ads/publisher/v202205}ApiError"> * &lt;sequence> * &lt;element name="reason" type="{https://www.google.com/apis/ads/publisher/v202205}GrpSettingsError.Reason" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "GrpSettingsError", propOrder = { "reason" }) public class GrpSettingsError extends ApiError { @XmlSchemaType(name = "string") protected GrpSettingsErrorReason reason; /** * Gets the value of the reason property. * * @return * possible object is * {@link GrpSettingsErrorReason } * */ public GrpSettingsErrorReason getReason() { return reason; } /** * Sets the value of the reason property. * * @param value * allowed object is * {@link GrpSettingsErrorReason } * */ public void setReason(GrpSettingsErrorReason value) { this.reason = value; } }
{ "content_hash": "88eb67f0098613efa789ef0c17ef6c1b", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 134, "avg_line_length": 27.76829268292683, "alnum_prop": 0.6693017127799736, "repo_name": "googleads/googleads-java-lib", "id": "eacadc29aa103b876d1a7803267118fb1b208469", "size": "2277", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/dfp_appengine/src/main/java/com/google/api/ads/admanager/jaxws/v202205/GrpSettingsError.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "81068791" } ], "symlink_target": "" }
class SummitRestException(Exception): def __init__(self, status, uri, msg='', code=None, method='GET'): self.status = status self.uri = uri self.msg = msg self.code = code self.method = method def __str__(self): return 'HTTP {0} error: {1}'.format(self.status, self.msg)
{ "content_hash": "e7cbe45a7e1fc351c6146982fbf22303", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 69, "avg_line_length": 29.90909090909091, "alnum_prop": 0.5683890577507599, "repo_name": "josephl/summit-python", "id": "92c15cf29eb54910fd21395b740f579d8f893dfd", "size": "329", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "summit/exceptions.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "6590" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "38c44bc1b2551649d7d54579306fb6ff", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "8a5b5ae53742a99652c2a4dabd081236d47e93fc", "size": "186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Panicum/Panicum trichoides/ Syn. Isachne mayocoensis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2015 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. ~ --> <resources> <color name="colorPrimary">#3F51B5</color> <color name="colorPrimaryDark">#303F9F</color> <color name="colorAccent">#FF4081</color> </resources>
{ "content_hash": "77d066218d5f3afe9c5471fabcc80801", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 76, "avg_line_length": 36.95652173913044, "alnum_prop": 0.7035294117647058, "repo_name": "yigit/dev-summit-architecture-demo", "id": "fea5457a955769da977edba352b3b98ac1685e3a", "size": "850", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "client/app/src/main/res/values/colors.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1717" }, { "name": "HTML", "bytes": "17213" }, { "name": "Java", "bytes": "145869" }, { "name": "JavaScript", "bytes": "622" }, { "name": "Ruby", "bytes": "54261" } ], "symlink_target": "" }
<?php namespace Laravolt\Indonesia\Test\Models; use Illuminate\Database\Eloquent\Collection; use Laravolt\Indonesia\Models\City; use Laravolt\Indonesia\Models\District; use Laravolt\Indonesia\Models\Province; use Laravolt\Indonesia\Test\TestCase; class ProvinceTest extends TestCase { /** @test */ public function a_province_has_many_cities_relation() { $this->seed('Laravolt\Indonesia\Seeds\ProvincesSeeder'); $this->seed('Laravolt\Indonesia\Seeds\CitiesSeeder'); $province = Province::first(); $this->assertInstanceOf(Collection::class, $province->cities); $this->assertInstanceOf(City::class, $province->cities->first()); } /** @test */ public function a_province_has_many_districts_relation() { $this->seed('Laravolt\Indonesia\Seeds\ProvincesSeeder'); $this->seed('Laravolt\Indonesia\Seeds\CitiesSeeder'); $this->seed('Laravolt\Indonesia\Seeds\DistrictsSeeder'); $province = Province::first(); $this->assertInstanceOf(Collection::class, $province->districts); $this->assertInstanceOf(District::class, $province->districts->first()); } /** @test */ public function a_province_has_name_attribute() { $this->seed('Laravolt\Indonesia\Seeds\ProvincesSeeder'); $province = Province::first(); $this->assertEquals('ACEH', $province->name); } /** @test */ public function a_province_has_logo_path_attribute() { $this->seed('Laravolt\Indonesia\Seeds\ProvincesSeeder'); $province = Province::first(); $this->assertNull($province->logo_path); } /** @test */ public function a_province_can_store_meta_column() { $this->seed('Laravolt\Indonesia\Seeds\ProvincesSeeder'); $province = Province::first(); $province->meta = ['luas_wilayah' => 200.2]; $province->save(); $this->assertEquals(['luas_wilayah' => 200.2], $province->meta); } }
{ "content_hash": "eecba10ca3eb0db1d69313c16f4c63c2", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 80, "avg_line_length": 28.942028985507246, "alnum_prop": 0.6414621932899349, "repo_name": "laravolt/indonesia", "id": "dbaf9e947c97460d11b55d3b7b5e00ac39e2293a", "size": "1997", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/Models/ProvinceTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "Blade", "bytes": "10543" }, { "name": "PHP", "bytes": "61196" } ], "symlink_target": "" }
package org.pageseeder.berlioz.plus; import org.pageseeder.berlioz.plus.spi.RequestFactory; /** * Base class for all generators in this application. */ public abstract class ValidatingGenerator extends Generator<ValidatedRequest> { private static final RequestFactory<ValidatedRequest> REQUEST_FACTORY = new BuiltinFactory(); public ValidatingGenerator() { super(REQUEST_FACTORY); } }
{ "content_hash": "f6103acccc10f15c3c07d477c623c4b3", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 95, "avg_line_length": 25.125, "alnum_prop": 0.7786069651741293, "repo_name": "pageseeder/berlioz-plus", "id": "7fdfc3602ffa1b6c8f8c4f3d61be0ffc16e006a2", "size": "402", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/pageseeder/berlioz/plus/ValidatingGenerator.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "55030" } ], "symlink_target": "" }
require 'test_helper' describe 'Filesystem - positive senario' do let(:options) do object = mock() object.stubs(:model_name).returns('Entity') object.stubs(:table_name).returns('entities') object.stubs(:collection_name).returns('collection') object end let(:fs) do Filesystem.any_instance.stubs(:clear_dir!).returns(false) root_dir = File.expand_path(File.dirname(__FILE__) + '../../../../') fs = Filesystem.new(options) fs.instance_variable_set(:@root_dir, root_dir) fs end it 'should be' do refute_nil fs end it 'should respond on #filename' do refute_nil fs.filename end it 'should respond on #migration_origin' do refute_nil fs.migration_origin end it 'should respond on #migration_target' do refute_nil fs.migration_target end it 'should return timestamp of 14-digit format' do assert_match /\d{14}/, fs.send(:migration_timestamp) end it 'should define ORIGIN' do refute_nil Filesystem::ORIGIN end it 'should return filename with known data' do assert_equal fs.filename, "#{fs.send(:migration_timestamp)}_add_collection_rank_to_entities.rb" end it 'should store data' do File.stubs(:open).returns(true) assert_equal fs.store('***'), true end end describe 'Filesystem - negative senario' do let(:options) do object = mock() object.stubs(:model_name).returns('Entity') object.stubs(:table_name).returns('entities') object.stubs(:collection_name).returns('collection') object end let(:fs) do Filesystem.any_instance.stubs(:clear_dir!).returns(false) root_dir = File.expand_path(File.dirname(__FILE__) + '../../../../') fs = Filesystem.new(options) fs.instance_variable_set(:@root_dir, root_dir) fs end describe 'FS problem' do it 'should not store data' do File.stubs(:open).raises('Bad happens') assert_equal fs.store('***'), false end end end
{ "content_hash": "27af8a318e58bc0e4458ac510349a008", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 99, "avg_line_length": 24.987179487179485, "alnum_prop": 0.6618778860954335, "repo_name": "lochnessathome/ranked-model-hstore", "id": "3d61ada2795f35d72b6efcbd25268a0285705644", "size": "1949", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/ranked-model-hstore/generators/filesystem_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "34011" }, { "name": "Shell", "bytes": "115" } ], "symlink_target": "" }
package cameradar import ( "reflect" "testing" curl "github.com/Ullaakut/go-curl" ) func TestCurl(t *testing.T) { handle := Curl{ CURL: curl.EasyInit(), } handle2 := handle.Duphandle() if reflect.DeepEqual(handle, handle2) { t.Errorf("unexpected identical handle from duphandle: expected %+v got %+v", handle, handle2) } }
{ "content_hash": "e89432ba66692f99acd7df0061a89bbd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 95, "avg_line_length": 17, "alnum_prop": 0.6882352941176471, "repo_name": "EtixLabs/cameradar", "id": "37b0fc2692665d8e0c66eebcf26e0e3aa7bf88f5", "size": "340", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "curl_test.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "77768" } ], "symlink_target": "" }
namespace sample { using namespace rime; class TrivialTranslator : public Translator { public: TrivialTranslator(const Ticket& ticket); virtual an<Translation> Query(const string& input, const Segment& segment); private: string Translate(const string& input); using TrivialDictionary = map<string, string>; TrivialDictionary dictionary_; }; } // namespace sample #endif // TRIVIAL_TRANSLATOR_H_
{ "content_hash": "1b45476d2922c506bb34794e85eb62bd", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 56, "avg_line_length": 21.333333333333332, "alnum_prop": 0.6941964285714286, "repo_name": "Prcuvu/librime", "id": "cd4b77e81a1db16a2b29b158d0ea48af9ec21d94", "size": "792", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "sample/src/trivial_translator.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "9536" }, { "name": "C", "bytes": "25746" }, { "name": "C++", "bytes": "885463" }, { "name": "CMake", "bytes": "25101" }, { "name": "Dockerfile", "bytes": "752" }, { "name": "JavaScript", "bytes": "6401" }, { "name": "Makefile", "bytes": "4569" }, { "name": "Python", "bytes": "6074" }, { "name": "Shell", "bytes": "1689" } ], "symlink_target": "" }
--TEST-- Test shuffle() function : error conditions --FILE-- <?php /* Prototype : bool shuffle(array $array_arg) * Description: Randomly shuffle the contents of an array * Source code: ext/standard/array.c */ /* Test shuffle() to see that warning messages are emitted * when invalid number of arguments are passed to the function */ echo "*** Testing shuffle() : error conditions ***\n"; // zero arguments echo "\n-- Testing shuffle() function with Zero arguments --\n"; var_dump( shuffle() ); // more than the expected number of arguments echo "\n-- Testing shuffle() function with more than expected no. of arguments --\n"; $array_arg = array(1, "two" => 2); $extra_arg = 10; var_dump( shuffle($array_arg, $extra_arg) ); // printing the input array to check that it is not affected // by above shuffle() function calls echo "\n-- original input array --\n"; var_dump( $array_arg ); echo "Done"; ?> --EXPECTF-- *** Testing shuffle() : error conditions *** -- Testing shuffle() function with Zero arguments -- Warning: shuffle() expects exactly 1 parameter, 0 given in %s on line %d bool(false) -- Testing shuffle() function with more than expected no. of arguments -- Warning: shuffle() expects exactly 1 parameter, 2 given in %s on line %d bool(false) -- original input array -- array(2) { [0]=> int(1) ["two"]=> int(2) } Done
{ "content_hash": "d16415d2cdbd9abe520f762cc500cc7a", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 85, "avg_line_length": 25.12962962962963, "alnum_prop": 0.6809137803979366, "repo_name": "lunaczp/learning", "id": "833b390363740be0df984899964679e327a338f2", "size": "1357", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "language/c/testPhpSrc/php-5.6.17/ext/standard/tests/array/shuffle_error.phpt", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "4526" }, { "name": "Assembly", "bytes": "14500403" }, { "name": "Awk", "bytes": "21252" }, { "name": "Batchfile", "bytes": "2526" }, { "name": "C", "bytes": "381839655" }, { "name": "C++", "bytes": "10162228" }, { "name": "CMake", "bytes": "68196" }, { "name": "CSS", "bytes": "3943" }, { "name": "D", "bytes": "1022" }, { "name": "DTrace", "bytes": "4528" }, { "name": "Fortran", "bytes": "1834" }, { "name": "GAP", "bytes": "4344" }, { "name": "GDB", "bytes": "31864" }, { "name": "Gnuplot", "bytes": "148" }, { "name": "Go", "bytes": "732" }, { "name": "HTML", "bytes": "86756" }, { "name": "Java", "bytes": "8286" }, { "name": "JavaScript", "bytes": "238365" }, { "name": "Lex", "bytes": "121233" }, { "name": "Limbo", "bytes": "1609" }, { "name": "Lua", "bytes": "96" }, { "name": "M4", "bytes": "483288" }, { "name": "Makefile", "bytes": "1915601" }, { "name": "Nix", "bytes": "180099" }, { "name": "Objective-C", "bytes": "1742504" }, { "name": "OpenEdge ABL", "bytes": "4238" }, { "name": "PHP", "bytes": "27984629" }, { "name": "Pascal", "bytes": "74868" }, { "name": "Perl", "bytes": "317465" }, { "name": "Perl 6", "bytes": "6916" }, { "name": "Python", "bytes": "21547" }, { "name": "R", "bytes": "1112" }, { "name": "Roff", "bytes": "435717" }, { "name": "Scilab", "bytes": "22980" }, { "name": "Shell", "bytes": "468206" }, { "name": "UnrealScript", "bytes": "20840" }, { "name": "Vue", "bytes": "563" }, { "name": "XSLT", "bytes": "7946" }, { "name": "Yacc", "bytes": "172805" }, { "name": "sed", "bytes": "2073" } ], "symlink_target": "" }
// Example: Word Count Example with Metrics and ScioIO read/write // Usage: // `sbt "runMain com.spotify.scio.examples.extra.WordCountScioIO // --project=[PROJECT] --runner=DataflowRunner --region=[REGION NAME] // --input=gs://apache-beam-samples/shakespeare/kinglear.txt // --output=gs://[BUCKET]/[PATH]/wordcount"` package com.spotify.scio.examples.extra import com.spotify.scio._ import com.spotify.scio.examples.common.ExampleData import com.spotify.scio.io.TextIO import org.slf4j.LoggerFactory object WordCountScioIO { // Logger is an object instance, i.e. statically initialized and thus can be used safely in an // anonymous function without serialization issue private val logger = LoggerFactory.getLogger(this.getClass) def main(cmdlineArgs: Array[String]): Unit = { // Create `ScioContext` and `Args` val (sc, args) = ContextAndArgs(cmdlineArgs) // Parse input and output path from command line arguments val input = args.getOrElse("input", ExampleData.KING_LEAR) val output = args("output") // Create a distribution and two counter metrics. `Distribution` tracks min, max, sum, min, // etc. and `Counter` tracks count. val lineDist = ScioMetrics.distribution("lineLength") val sumNonEmpty = ScioMetrics.counter("nonEmptyLines") val sumEmpty = ScioMetrics.counter("emptyLines") // Create IO classes to read and write val inputTextIO = TextIO(input) val outputTextIO = TextIO(output) // Open text files as an `SCollection[String]` passing io read params sc.read(inputTextIO)(TextIO.ReadParam()) .map { w => // Trim input lines, update distribution metric val trimmed = w.trim lineDist.update(trimmed.length.toLong) trimmed } .filter { w => // Filter out empty lines, update counter metrics val r = w.nonEmpty if (r) sumNonEmpty.inc() else sumEmpty.inc() r } // Split input lines, filter out empty tokens and expand into a collection of tokens .flatMap(_.split("[^a-zA-Z']+").filter(_.nonEmpty)) // Count occurrences of each unique `String` to get `(String, Long)` .countByValue // Map `(String, Long)` tuples into final "word: count" strings .map { case (word, count) => word + ": " + count } // Save result as text files under the output path by passing write params .write(outputTextIO)(TextIO.DefaultWriteParam) // Execute the pipeline and block until it finishes val result = sc.run().waitUntilFinish() // Retrieve metric values logger.info("Max: " + result.distribution(lineDist).committed.map(_.getMax)) logger.info("Min: " + result.distribution(lineDist).committed.map(_.getMin)) logger.info("Sum non-empty: " + result.counter(sumNonEmpty).committed) logger.info("Sum empty: " + result.counter(sumEmpty).committed) } }
{ "content_hash": "cff796c048f512fe54e437520b58a6ce", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 96, "avg_line_length": 40.02777777777778, "alnum_prop": 0.6877168632893824, "repo_name": "spotify/scio", "id": "1c84135b72c40d44924e52c69a4b066da1b5ceb5", "size": "3480", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "scio-examples/src/main/scala/com/spotify/scio/examples/extra/WordCountScioIO.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "2556" }, { "name": "Java", "bytes": "1285728" }, { "name": "Python", "bytes": "20650" }, { "name": "Scala", "bytes": "3585133" }, { "name": "Shell", "bytes": "4181" }, { "name": "StringTemplate", "bytes": "518" } ], "symlink_target": "" }
<?xml version="1.0"?> <qualifications class="AGF07"> <qualification id="AGF10107" title="Certificate I in Agri-Food (Pathways)"> <units> <unit id="AGFCMN101A" title="Adapt to work requirements in agri-food industry"/> <unit id="AGFCMN102A" title="Apply effective work practices"/> <unit id="AGFCMN103A" title="Demonstrate care and apply safe practices at work"/> <unit id="AGFCMN201A" title="Contribute to animal care through work activities"/> <unit id="AGFCMN202A" title="Contribute to work activities to produce food"/> <unit id="RTE1001A" title="Support agricultural crop work"/> <unit id="RTE1601A" title="Support irrigation work"/> <unit id="RTE2029A" title="Assist agricultural crop maintenance"/> <unit id="RTE2030A" title="Assist agricultural crop harvesting"/> <unit id="RTE2114A" title="Monitor water supplies"/> <unit id="RTF1004A" title="Support gardening work"/> <unit id="RUV1101A" title="Prepare for animal care work"/> <unit id="RUV1102A" title="Support animal care work"/> <unit id="RUV1103A" title="Support animal care cleaning activities"/> <unit id="RUV1104A" title="Maintain the animal care workplace"/> </units> <units/> </qualification> </qualifications>
{ "content_hash": "4c95231eebadc7eeb260a33cea70c388", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 87, "avg_line_length": 55.869565217391305, "alnum_prop": 0.6894941634241245, "repo_name": "rheinardkorf/oktga", "id": "9905a7e4662dc0d5c7b26b7ca8610afc3945e890", "size": "1285", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "xml/AGF07_qualifications.xml", "mode": "33261", "license": "mit", "language": [ { "name": "Ruby", "bytes": "31416" } ], "symlink_target": "" }
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at w [dot] schoenborn [at] gmail [dot] com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org
{ "content_hash": "9c18969c7fa0e8acf672ee88e9bb0ac9", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 87, "avg_line_length": 45.614285714285714, "alnum_prop": 0.8202317569683683, "repo_name": "whiskeysierra/switchboard", "id": "f50b79112f94d6ea70086a1486297f348c3e1b78", "size": "3248", "binary": false, "copies": "5", "ref": "refs/heads/main", "path": ".github/CODE_OF_CONDUCT.md", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "73267" }, { "name": "Shell", "bytes": "660" } ], "symlink_target": "" }
require File.expand_path("../test_helper", File.dirname(__FILE__)) require 'methodical/modifier' require 'methodical/action_item' class ModifierTest < Test::Unit::TestCase context "#execute!" do specify "executes the modifier block" do step = stub_everything("ActionItem") sensor = :unset it = Methodical::Modifier.new("NAME", step) do sensor = :set end it.execute! assert_equal :set, sensor end specify "passes the action item to the block" do step = stub_everything("ActionItem") sensor = :unset it = Methodical::Modifier.new("NAME", step) do |action_item, baton| sensor = action_item end it.execute! assert_same step, sensor end specify "passes a baton to the block" do baton = stub("Baton") step = stub_everything("ActionItem") sensor = :unset it = Methodical::Modifier.new("NAME", step) do |action_item, baton| sensor = baton end it.execute!(baton) assert_not_nil sensor assert_same baton, sensor end end context "#<<" do specify "composes modifier and modified" do step = stub_everything("ActionItem") it = Methodical::Modifier.new("NAME") it << step assert_same step, it.action_item end specify "returns the modifier" do step = stub_everything("ActionItem") it = Methodical::Modifier.new("NAME") assert_same it, (it << step) end specify "delegates to action_item, if set" do mod2 = stub("Inner Modifier") step = stub_everything("ActionItem") it = Methodical::Modifier.new("NAME", mod2) mod2.expects(:<<).with(step) it << step end end context "#clone" do specify "deeply copies action item" do step = stub_everything("ActionItem") copy = stub_everything("Copy") it = Methodical::Modifier.new("NAME", step) step.expects(:clone).returns(copy).at_least_once assert_same copy, it.clone.action_item end end specify "delegates unknown methods to action item" do step = stub_everything("ActionItem") it = Methodical::Modifier.new("NAME", step) step.expects(:foo).with("bar") it.foo("bar") end end
{ "content_hash": "069f91790b0ee22b827dab09b8c4d3b7", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 73, "avg_line_length": 28.329113924050635, "alnum_prop": 0.6255585344057194, "repo_name": "avdi/methodical", "id": "da56479daef213c7ee2eb50ac12b6ca9a7f9b3a0", "size": "2238", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/methodical/modifier_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "65309" } ], "symlink_target": "" }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_52a.c Label Definition File: CWE195_Signed_to_Unsigned_Conversion_Error.label.xml Template File: sources-sink-52a.tmpl.c */ /* * @description * CWE: 195 Signed to Unsigned Conversion Error * BadSource: fscanf Read data from the console using fscanf() * GoodSource: Positive integer * Sink: strncpy * BadSink : Copy strings using strncpy() with the length of data * Flow Variant: 52 Data flow: data passed as an argument from one function to another to another in three different source files * * */ #include "std_testcase.h" #ifndef OMITBAD /* bad function declaration */ void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_52b_badSink(int data); void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_52_bad() { int data; /* Initialize data */ data = -1; /* POTENTIAL FLAW: Read data from the console using fscanf() */ fscanf(stdin, "%d", &data); CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_52b_badSink(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* good function declaration */ void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_52b_goodG2BSink(int data); /* goodG2B uses the GoodSource with the BadSink */ static void goodG2B() { int data; /* Initialize data */ data = -1; /* FIX: Use a positive integer less than &InitialDataSize&*/ data = 100-1; CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_52b_goodG2BSink(data); } void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_52_good() { goodG2B(); } #endif /* OMITGOOD */ /* 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 int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_52_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_52_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
{ "content_hash": "06f5ea1e9c036584b66dc75df7037cb8", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 129, "avg_line_length": 30.416666666666668, "alnum_prop": 0.6880626223091977, "repo_name": "JianpingZeng/xcc", "id": "d518210722619075d174b48cfbf1bfb8a159de9e", "size": "2555", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "xcc/test/juliet/testcases/CWE195_Signed_to_Unsigned_Conversion_Error/s01/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_52a.c", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments)).next()); }); }; const ava_1 = require("ava"); const fs = require("fs"); const path = require("path"); const webpack = require("webpack"); const SystemJS = require("systemjs"); const webpack_systemjs_export_plugin_1 = require("../src/webpack-systemjs-export-plugin"); var config = require('./example/webpack.config.js'); ava_1.default('SystemJS is bundled with the correct chunk', (t) => __awaiter(this, void 0, void 0, function* () { let c = Object.assign({}, config, { plugins: [ new webpack_systemjs_export_plugin_1.default({ bundleSystemJS: 'vendor' }) ] }); let wp = yield new Promise((res, rej) => { webpack(c, (err, stats) => { if (err) rej(err.message); }) .run((err, stats) => { if (err) t.fail(err.message); let vendorBuildPath = path.join(config.output.path, 'vendor.min.js'); let vendorHasSystem = fs.readFileSync(vendorBuildPath).toString().includes('SystemJS'); if (vendorHasSystem) res('Vendor has SystemJS bundled!'); }); }) .then((res) => t.pass(res)) .catch((err) => t.fail(err)); })); /* test('External modules not found in built chunks', async t => { var c = Object.assign({}, config, { plugins: [ new WebpackSystemJSExportPlugin({ externals: ['three'] })] }); t.fail(); }); */ ava_1.default('Public `node_modules` accessable to SystemJS', (t) => __awaiter(this, void 0, void 0, function* () { var c = Object.assign({}, config, { plugins: [ new webpack_systemjs_export_plugin_1.default({ public: ['lodash'] }) ] }); let wp = yield new Promise((res, rej) => { webpack(c, (err, stats) => { if (err) rej(err.message); }) .run((err, stats) => { if (err) t.fail(err.message); // Run built code and see if lodash is accessable. let vendorBuildPath = path.join(config.output.path, 'vendor.min.js'); require(vendorBuildPath); SystemJS.import('lodash') .then(_ => res('Bundled modules are accessable to SystemJS!')) .catch(err => rej(err.message)); }); }) .then((res) => t.pass(res)) .catch((err) => t.fail(err)); })); /* test('Custom chunk aliases loadable by SystemJS', async t => { var c = Object.assign({}, config, { plugins: [ new WebpackSystemJSExportPlugin({ register: [{ name: 'dynamic', alias: (chunk) => `myapp/${chunk}` }] }) ] }); let wp = await new Promise<string>((res, rej) => { webpack(c, (err, stats) => { if (err) rej(err.message); }) .run((err, stats) => { if (err) t.fail(err.message); // Run built code and see if lodash is accessable. let dynamicBuildPath = path.join(config.output.path, 'dynamic.min.js'); SystemJS.import(dynamicBuildPath) .then(m => (typeof m.default !== 'undefined') ? res('Bundled modules are accessable to SystemJS!') : rej('Failed to find default export!')) .catch(err => rej(err.message)) }); }) .then((res) => t.pass(res)) .catch((err) => t.fail(err)); t.fail(); }); */
{ "content_hash": "02ea5c0afb7f7367eb9d75c6601bdc59", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 151, "avg_line_length": 34.93103448275862, "alnum_prop": 0.5347976307996052, "repo_name": "alaingalvan/webpack-systemjs-export-plugin", "id": "7fb4b44f0eb7ed1a62c1260ed9fb7e14e6341ea5", "size": "4052", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/webpack-systemjs-export-plugin.spec.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "701" }, { "name": "JavaScript", "bytes": "23575" }, { "name": "TypeScript", "bytes": "20209" } ], "symlink_target": "" }
using UnityEngine; using System.Collections; using System.Collections.Generic; namespace PrimitivePlus { public class PrimitivePlusMeshes { public static Mesh GetMeshType(PrimitivePlusType type) { switch(type) { case PrimitivePlusType.Circle2D: return (m_Circle2D == null) ? Circle2D() : m_Circle2D; case PrimitivePlusType.CircleHalf2D: return (m_CircleHalf2D == null) ? CircleHalf2D() : m_CircleHalf2D; case PrimitivePlusType.Cone: return (m_Cone == null) ? Cone() : m_Cone; case PrimitivePlusType.ConeHalf: return (m_ConeHalf == null) ? ConeHalf() : m_ConeHalf; case PrimitivePlusType.ConeHexagon: return (m_ConeHexagon == null) ? ConeHexagon() : m_ConeHexagon; case PrimitivePlusType.ConePentagon: return (m_ConePentagon == null) ? ConePentagon() : m_ConePentagon; case PrimitivePlusType.Cross: return (m_Cross == null) ? Cross() : m_Cross; case PrimitivePlusType.Cross2D: return (m_Cross2D == null) ? Cross2D() : m_Cross2D; case PrimitivePlusType.Cube: return (m_Cube == null) ? Cube() : m_Cube; case PrimitivePlusType.CubeCorner: return (m_CubeCorner == null) ? CubeCorner() : m_CubeCorner; case PrimitivePlusType.CubeCornerThin: return (m_CubeCornerThin == null) ? CubeCornerThin() : m_CubeCornerThin; case PrimitivePlusType.CubeEdgeIn: return (m_CubeEdgeIn == null) ? CubeEdgeIn() : m_CubeEdgeIn; case PrimitivePlusType.CubeEdgeOut: return (m_CubeEdgeOut == null) ? CubeEdgeOut() : m_CubeEdgeOut; case PrimitivePlusType.CubeHollow: return (m_CubeHollow == null) ? CubeHollow() : m_CubeHollow; case PrimitivePlusType.CubeHollowThin: return (m_CubeHollowThin == null) ? CubeHollowThin() : m_CubeHollowThin; case PrimitivePlusType.CubeTube: return (m_CubeTube == null) ? CubeTube() : m_CubeTube; case PrimitivePlusType.Cylinder: return (m_Cylinder == null) ? Cylinder() : m_Cylinder; case PrimitivePlusType.CylinderHalf: return (m_CylinderHalf == null) ? CylinderHalf() : m_CylinderHalf; case PrimitivePlusType.CylinderTube: return (m_CylinderTube == null) ? CylinderTube() : m_CylinderTube; case PrimitivePlusType.CylinderTubeThin: return (m_CylinderTubeThin == null) ? CylinderTubeThin() : m_CylinderTubeThin; case PrimitivePlusType.Diamond: return (m_Diamond == null) ? Diamond() : m_Diamond; case PrimitivePlusType.DiamondThick: return (m_DiamondThick == null) ? DiamondThick() : m_DiamondThick; case PrimitivePlusType.Heart: return (m_Heart == null) ? Heart() : m_Heart; case PrimitivePlusType.Heart2D: return (m_Heart2D == null) ? Heart2D() : m_Heart2D; case PrimitivePlusType.Hexagon2D: return (m_Hexagon2D == null) ? Hexagon2D() : m_Hexagon2D; case PrimitivePlusType.Icosphere: return (m_Icosphere == null) ? Icosphere() : m_Icosphere; case PrimitivePlusType.IcosphereSmall: return (m_IcosphereSmall == null) ? IcosphereSmall() : m_IcosphereSmall; case PrimitivePlusType.Plane: return (m_Plane == null) ? Plane() : m_Plane; case PrimitivePlusType.PrismHexagon: return (m_PrismHexagon == null) ? PrismHexagon() : m_PrismHexagon; case PrimitivePlusType.PrismOctagon: return (m_PrismOctagon == null) ? PrismOctagon() : m_PrismOctagon; case PrimitivePlusType.PrismPentagon: return (m_PrismPentagon == null) ? PrismPentagon() : m_PrismPentagon; case PrimitivePlusType.PrismTriangle: return (m_PrismTriangle == null) ? PrismTriangle() : m_PrismTriangle; case PrimitivePlusType.Pyramid: return (m_Pyramid == null) ? Pyramid() : m_Pyramid; case PrimitivePlusType.PyramidCorner: return (m_PyramidCorner == null) ? PyramidCorner() : m_PyramidCorner; case PrimitivePlusType.PyramidTri: return (m_PyramidTri == null) ? PyramidTri() : m_PyramidTri; case PrimitivePlusType.Rhombus2D: return (m_Rhombus2D == null) ? Rhombus2D() : m_Rhombus2D; case PrimitivePlusType.Sphere: return (m_Sphere == null) ? Sphere() : m_Sphere; case PrimitivePlusType.SphereHalf: return (m_SphereHalf == null) ? SphereHalf() : m_SphereHalf; case PrimitivePlusType.Star: return (m_Star == null) ? Star() : m_Star; case PrimitivePlusType.Star2D: return (m_Star2D == null) ? Star2D() : m_Star2D; case PrimitivePlusType.Torus: return (m_Torus == null) ? Torus() : m_Torus; case PrimitivePlusType.TorusHalf: return (m_TorusHalf == null) ? TorusHalf() : m_TorusHalf; case PrimitivePlusType.Triangle2D: return (m_Triangle2D == null) ? Triangle2D() : m_Triangle2D; case PrimitivePlusType.Wedge: return (m_Wedge == null) ? Wedge() : m_Wedge; default: return null; } } private static Mesh m_Circle2D = null; private static Mesh Circle2D() { m_Circle2D = Resources.Load<Mesh>("Meshes/Circle2D"); return m_Circle2D; } private static Mesh m_CircleHalf2D = null; private static Mesh CircleHalf2D() { m_CircleHalf2D = Resources.Load<Mesh>("Meshes/CircleHalf2D"); return m_CircleHalf2D; } private static Mesh m_Cone = null; private static Mesh Cone() { m_Cone = Resources.Load<Mesh>("Meshes/Cone"); return m_Cone; } private static Mesh m_ConeHalf = null; private static Mesh ConeHalf() { m_ConeHalf = Resources.Load<Mesh>("Meshes/ConeHalf"); return m_ConeHalf; } private static Mesh m_ConeHexagon = null; private static Mesh ConeHexagon() { m_ConeHexagon = Resources.Load<Mesh>("Meshes/ConeHexagon"); return m_ConeHexagon; } private static Mesh m_ConePentagon = null; private static Mesh ConePentagon() { m_ConePentagon = Resources.Load<Mesh>("Meshes/ConePentagon"); return m_ConePentagon; } private static Mesh m_Cross = null; private static Mesh Cross() { m_Cross = Resources.Load<Mesh>("Meshes/Cross"); return m_Cross; } private static Mesh m_Cross2D = null; private static Mesh Cross2D() { m_Cross2D = Resources.Load<Mesh>("Meshes/Cross2D"); return m_Cross2D; } private static Mesh m_Cube = null; private static Mesh Cube() { m_Cube = Resources.Load<Mesh>("Meshes/Cube"); return m_Cube; } private static Mesh m_CubeCorner = null; private static Mesh CubeCorner() { m_CubeCorner = Resources.Load<Mesh>("Meshes/CubeCorner"); return m_CubeCorner; } private static Mesh m_CubeCornerThin = null; private static Mesh CubeCornerThin() { m_CubeCornerThin = Resources.Load<Mesh>("Meshes/CubeCornerThin"); return m_CubeCornerThin; } private static Mesh m_CubeEdgeIn = null; private static Mesh CubeEdgeIn() { m_CubeEdgeIn = Resources.Load<Mesh>("Meshes/CubeEdgeIn"); return m_CubeEdgeIn; } private static Mesh m_CubeEdgeOut = null; private static Mesh CubeEdgeOut() { m_CubeEdgeOut = Resources.Load<Mesh>("Meshes/CubeEdgeOut"); return m_CubeEdgeOut; } private static Mesh m_CubeHollow = null; private static Mesh CubeHollow() { m_CubeHollow = Resources.Load<Mesh>("Meshes/CubeHollow"); return m_CubeHollow; } private static Mesh m_CubeHollowThin = null; private static Mesh CubeHollowThin() { m_CubeHollowThin = Resources.Load<Mesh>("Meshes/CubeHollowThin"); return m_CubeHollowThin; } private static Mesh m_CubeTube = null; private static Mesh CubeTube() { m_CubeTube = Resources.Load<Mesh>("Meshes/CubeTube"); return m_CubeTube; } private static Mesh m_Cylinder = null; private static Mesh Cylinder() { m_Cylinder = Resources.Load<Mesh>("Meshes/Cylinder"); return m_Cylinder; } private static Mesh m_CylinderHalf = null; private static Mesh CylinderHalf() { m_CylinderHalf = Resources.Load<Mesh>("Meshes/CylinderHalf"); return m_CylinderHalf; } private static Mesh m_CylinderTube = null; private static Mesh CylinderTube() { m_CylinderTube = Resources.Load<Mesh>("Meshes/CylinderTube"); return m_CylinderTube; } private static Mesh m_CylinderTubeThin = null; private static Mesh CylinderTubeThin() { m_CylinderTubeThin = Resources.Load<Mesh>("Meshes/CylinderTubeThin"); return m_CylinderTubeThin; } private static Mesh m_Diamond = null; private static Mesh Diamond() { m_Diamond = Resources.Load<Mesh>("Meshes/Diamond"); return m_Diamond; } private static Mesh m_DiamondThick = null; private static Mesh DiamondThick() { m_DiamondThick = Resources.Load<Mesh>("Meshes/DiamondThick"); return m_DiamondThick; } private static Mesh m_Heart = null; private static Mesh Heart() { m_Heart = Resources.Load<Mesh>("Meshes/Heart"); return m_Heart; } private static Mesh m_Heart2D = null; private static Mesh Heart2D() { m_Heart2D = Resources.Load<Mesh>("Meshes/Heart2D"); return m_Heart2D; } private static Mesh m_Hexagon2D = null; private static Mesh Hexagon2D() { m_Hexagon2D = Resources.Load<Mesh>("Meshes/Hexagon2D"); return m_Hexagon2D; } private static Mesh m_Icosphere = null; private static Mesh Icosphere() { m_Icosphere = Resources.Load<Mesh>("Meshes/Icosphere"); return m_Icosphere; } private static Mesh m_IcosphereSmall = null; private static Mesh IcosphereSmall() { m_IcosphereSmall = Resources.Load<Mesh>("Meshes/IcosphereSmall"); return m_IcosphereSmall; } private static Mesh m_Plane = null; private static Mesh Plane() { m_Plane = Resources.Load<Mesh>("Meshes/Plane"); return m_Plane; } private static Mesh m_PrismHexagon = null; private static Mesh PrismHexagon() { m_PrismHexagon = Resources.Load<Mesh>("Meshes/PrismHexagon"); return m_PrismHexagon; } private static Mesh m_PrismOctagon = null; private static Mesh PrismOctagon() { m_PrismOctagon = Resources.Load<Mesh>("Meshes/PrismOctagon"); return m_PrismOctagon; } private static Mesh m_PrismPentagon = null; private static Mesh PrismPentagon() { m_PrismPentagon = Resources.Load<Mesh>("Meshes/PrismPentagon"); return m_PrismPentagon; } private static Mesh m_PrismTriangle = null; private static Mesh PrismTriangle() { m_PrismTriangle = Resources.Load<Mesh>("Meshes/PrismTriangle"); return m_PrismTriangle; } private static Mesh m_Pyramid = null; private static Mesh Pyramid() { m_Pyramid = Resources.Load<Mesh>("Meshes/Pyramid"); return m_Pyramid; } private static Mesh m_PyramidCorner = null; private static Mesh PyramidCorner() { m_PyramidCorner = Resources.Load<Mesh>("Meshes/PyramidCorner"); return m_PyramidCorner; } private static Mesh m_PyramidTri = null; private static Mesh PyramidTri() { m_PyramidTri = Resources.Load<Mesh>("Meshes/PyramidTri"); return m_PyramidTri; } private static Mesh m_Rhombus2D = null; private static Mesh Rhombus2D() { m_Rhombus2D = Resources.Load<Mesh>("Meshes/Rhombus2D"); return m_Rhombus2D; } private static Mesh m_Sphere = null; private static Mesh Sphere() { m_Sphere = Resources.Load<Mesh>("Meshes/Sphere"); return m_Sphere; } private static Mesh m_SphereHalf = null; private static Mesh SphereHalf() { m_SphereHalf = Resources.Load<Mesh>("Meshes/SphereHalf"); return m_SphereHalf; } private static Mesh m_Star = null; private static Mesh Star() { m_Star = Resources.Load<Mesh>("Meshes/Star"); return m_Star; } private static Mesh m_Star2D = null; private static Mesh Star2D() { m_Star2D = Resources.Load<Mesh>("Meshes/Star2D"); return m_Star2D; } private static Mesh m_Torus = null; private static Mesh Torus() { m_Torus = Resources.Load<Mesh>("Meshes/Torus"); return m_Torus; } private static Mesh m_TorusHalf = null; private static Mesh TorusHalf() { m_TorusHalf = Resources.Load<Mesh>("Meshes/TorusHalf"); return m_TorusHalf; } private static Mesh m_Triangle2D = null; private static Mesh Triangle2D() { m_Triangle2D = Resources.Load<Mesh>("Meshes/Triangle2D"); return m_Triangle2D; } private static Mesh m_Wedge = null; private static Mesh Wedge() { m_Wedge = Resources.Load<Mesh>("Meshes/Wedge"); return m_Wedge; } private static Mesh GetMesh(Vector3[] vertices, Vector3[] normals, Vector2[] uv, int[] triangles) { Mesh mesh = new Mesh(); mesh.vertices = vertices; mesh.normals = normals; mesh.uv = uv; mesh.triangles = triangles; mesh.RecalculateBounds(); ; return mesh; } } }
{ "content_hash": "3107a0a90715df18942878124c8ec604", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 99, "avg_line_length": 32.27225130890052, "alnum_prop": 0.6964633354964309, "repo_name": "DavidnCothron/4232-capstone-project", "id": "e846fb1ec34d5660db6028171cb6b074087ae845", "size": "12328", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "Assets/Resources/PrimitivePlus/Scripts/PrimitivePlusMeshes.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "1033388" }, { "name": "HLSL", "bytes": "217291" }, { "name": "ShaderLab", "bytes": "455490" } ], "symlink_target": "" }
"""Classes and functions implementing Layer SavedModel serialization.""" from tensorflow.python.keras.mixed_precision import policy from tensorflow.python.keras.saving.saved_model import base_serialization from tensorflow.python.keras.saving.saved_model import constants from tensorflow.python.keras.saving.saved_model import save_impl from tensorflow.python.keras.saving.saved_model import serialized_attributes from tensorflow.python.keras.utils import generic_utils from tensorflow.python.trackable import data_structures from tensorflow.python.util import nest class LayerSavedModelSaver(base_serialization.SavedModelSaver): """Implements Layer SavedModel serialization.""" @property def object_identifier(self): return constants.LAYER_IDENTIFIER @property def python_properties(self): # TODO(kathywu): Add python property validator return self._python_properties_internal() def _python_properties_internal(self): """Returns dictionary of all python properties.""" # TODO(kathywu): Add support for metrics serialization. # TODO(kathywu): Synchronize with the keras spec (go/keras-json-spec) once # the python config serialization has caught up. metadata = dict( name=self.obj.name, trainable=self.obj.trainable, expects_training_arg=self.obj._expects_training_arg, # pylint: disable=protected-access dtype=policy.serialize(self.obj._dtype_policy), # pylint: disable=protected-access batch_input_shape=getattr(self.obj, '_batch_input_shape', None), stateful=self.obj.stateful, must_restore_from_config=self.obj._must_restore_from_config, # pylint: disable=protected-access ) metadata.update(get_serialized(self.obj)) if self.obj.input_spec is not None: # Layer's input_spec has already been type-checked in the property setter. metadata['input_spec'] = nest.map_structure( lambda x: generic_utils.serialize_keras_object(x) if x else None, self.obj.input_spec) if (self.obj.activity_regularizer is not None and hasattr(self.obj.activity_regularizer, 'get_config')): metadata['activity_regularizer'] = generic_utils.serialize_keras_object( self.obj.activity_regularizer) if self.obj._build_input_shape is not None: # pylint: disable=protected-access metadata['build_input_shape'] = self.obj._build_input_shape # pylint: disable=protected-access return metadata def objects_to_serialize(self, serialization_cache): return (self._get_serialized_attributes( serialization_cache).objects_to_serialize) def functions_to_serialize(self, serialization_cache): return (self._get_serialized_attributes( serialization_cache).functions_to_serialize) def _get_serialized_attributes(self, serialization_cache): """Generates or retrieves serialized attributes from cache.""" keras_cache = serialization_cache.setdefault(constants.KERAS_CACHE_KEY, {}) if self.obj in keras_cache: return keras_cache[self.obj] serialized_attr = keras_cache[self.obj] = ( serialized_attributes.SerializedAttributes.new(self.obj)) if (save_impl.should_skip_serialization(self.obj) or self.obj._must_restore_from_config): # pylint: disable=protected-access return serialized_attr object_dict, function_dict = self._get_serialized_attributes_internal( serialization_cache) serialized_attr.set_and_validate_objects(object_dict) serialized_attr.set_and_validate_functions(function_dict) return serialized_attr def _get_serialized_attributes_internal(self, serialization_cache): """Returns dictionary of serialized attributes.""" objects = save_impl.wrap_layer_objects(self.obj, serialization_cache) functions = save_impl.wrap_layer_functions(self.obj, serialization_cache) # Attribute validator requires that the default save signature is added to # function dict, even if the value is None. functions['_default_save_signature'] = None return objects, functions # TODO(kathywu): Move serialization utils (and related utils from # generic_utils.py) to a separate file. def get_serialized(obj): with generic_utils.skip_failed_serialization(): # Store the config dictionary, which may be used when reviving the object. # When loading, the program will attempt to revive the object from config, # and if that fails, the object will be revived from the SavedModel. return generic_utils.serialize_keras_object(obj) class InputLayerSavedModelSaver(base_serialization.SavedModelSaver): """InputLayer serialization.""" @property def object_identifier(self): return constants.INPUT_LAYER_IDENTIFIER @property def python_properties(self): return dict( class_name=type(self.obj).__name__, name=self.obj.name, dtype=self.obj.dtype, sparse=self.obj.sparse, ragged=self.obj.ragged, batch_input_shape=self.obj._batch_input_shape, # pylint: disable=protected-access config=self.obj.get_config()) def objects_to_serialize(self, serialization_cache): return {} def functions_to_serialize(self, serialization_cache): return {} class RNNSavedModelSaver(LayerSavedModelSaver): """RNN layer serialization.""" @property def object_identifier(self): return constants.RNN_LAYER_IDENTIFIER def _get_serialized_attributes_internal(self, serialization_cache): objects, functions = ( super(RNNSavedModelSaver, self)._get_serialized_attributes_internal( serialization_cache)) states = data_structures.wrap_or_unwrap(self.obj.states) # SaveModel require all the objects to be Trackable when saving. # If the states is still a tuple after wrap_or_unwrap, it means it doesn't # contain any trackable item within it, eg empty tuple or (None, None) for # stateless ConvLSTM2D. We convert them to list so that wrap_or_unwrap can # make it a Trackable again for saving. When loaded, ConvLSTM2D is # able to handle the tuple/list conversion. if isinstance(states, tuple): states = data_structures.wrap_or_unwrap(list(states)) objects['states'] = states return objects, functions class IndexLookupLayerSavedModelSaver(LayerSavedModelSaver): """Index lookup layer serialization.""" @property def python_properties(self): # TODO(kathywu): Add python property validator metadata = self._python_properties_internal() if metadata['config'].get('has_static_table', False): metadata['config']['vocabulary'] = None return metadata
{ "content_hash": "6fc1d63aab83bb24a211c067184dada7", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 104, "avg_line_length": 41.08695652173913, "alnum_prop": 0.7298563869992442, "repo_name": "karllessard/tensorflow", "id": "9e6f2c55615d63ec59ecc06131eb9ad09facbf7e", "size": "7304", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "tensorflow/python/keras/saving/saved_model/layer_serialization.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "36962" }, { "name": "C", "bytes": "1366182" }, { "name": "C#", "bytes": "13584" }, { "name": "C++", "bytes": "124800442" }, { "name": "CMake", "bytes": "183072" }, { "name": "Cython", "bytes": "5003" }, { "name": "Dockerfile", "bytes": "416070" }, { "name": "Go", "bytes": "2104698" }, { "name": "HTML", "bytes": "4686483" }, { "name": "Java", "bytes": "1074438" }, { "name": "Jupyter Notebook", "bytes": "792868" }, { "name": "LLVM", "bytes": "6536" }, { "name": "MLIR", "bytes": "11176792" }, { "name": "Makefile", "bytes": "2760" }, { "name": "Objective-C", "bytes": "169288" }, { "name": "Objective-C++", "bytes": "294187" }, { "name": "Pawn", "bytes": "5552" }, { "name": "Perl", "bytes": "7536" }, { "name": "Python", "bytes": "42620525" }, { "name": "Roff", "bytes": "5034" }, { "name": "Ruby", "bytes": "9199" }, { "name": "Shell", "bytes": "620121" }, { "name": "Smarty", "bytes": "89545" }, { "name": "SourcePawn", "bytes": "14607" }, { "name": "Starlark", "bytes": "7545879" }, { "name": "Swift", "bytes": "78435" }, { "name": "Vim Snippet", "bytes": "58" } ], "symlink_target": "" }
#include "gm/gm.h" #include "include/core/SkCanvas.h" #include "include/core/SkPaint.h" #include "include/core/SkRect.h" #include "include/effects/SkGradientShader.h" #include "include/effects/SkImageFilters.h" static void draw_bg_blur(SkCanvas* canvas, SkIRect rect, float sigma) { // First create an intermediate layer that has an opaque area that we blur with transparency // all around it. We want to make sure the transparency doesn't affect the blur of the opaque // content. auto outsetRect = SkRect::Make(rect).makeOutset(10, 10); canvas->saveLayer(outsetRect, nullptr); SkColor colors[] = {SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN}; float cx = (rect.left() + rect.right() )/2.f; float cy = (rect.top() + rect.bottom())/2.f; auto g = SkGradientShader::MakeSweep(cx, cy, colors, nullptr, 3, SkTileMode::kMirror, 0, 45, 0, nullptr); SkPaint paint; paint.setShader(std::move(g)); canvas->drawRect(SkRect::Make(rect), paint); // Now do the bg-blur into another save-layer that should only read the opaque region. SkCanvas::SaveLayerRec rec; auto blur = SkImageFilters::Blur(sigma, sigma, SkTileMode::kClamp, nullptr, rect); rec.fBounds = &outsetRect; rec.fBackdrop = blur.get(); canvas->saveLayer(rec); canvas->restore(); canvas->restore(); } DEF_SIMPLE_GM(crbug_1174354, canvas, 70, 250) { // The initial fix for crbug.com/1156805 had an issue where the border added to the downsampled // texture that was used as input to the blur could actually bring in transparency when there // wasn't any within the original src bounds. It was populated the border using a filtering draw // from the full res source that could read from outside the pixels surrounding the original src // bounds. draw_bg_blur(canvas, SkIRect::MakeXYWH(10, 10, 50, 50), 5); draw_bg_blur(canvas, SkIRect::MakeXYWH(10, 70, 50, 50), 15); draw_bg_blur(canvas, SkIRect::MakeXYWH(10, 130, 50, 50), 30); draw_bg_blur(canvas, SkIRect::MakeXYWH(10, 190, 50, 50), 70); }
{ "content_hash": "45a4be1cad5e2ad6398004a06caff9da", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 100, "avg_line_length": 46.80769230769231, "alnum_prop": 0.5891536565324569, "repo_name": "aosp-mirror/platform_external_skia", "id": "75f6aaa693b17cf3c08086c8a914503b60b55a43", "size": "2576", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "gm/crbug_1174354.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "12716940" }, { "name": "Batchfile", "bytes": "904" }, { "name": "C", "bytes": "620774" }, { "name": "C#", "bytes": "4683" }, { "name": "C++", "bytes": "27394853" }, { "name": "GLSL", "bytes": "67013" }, { "name": "Go", "bytes": "80137" }, { "name": "HTML", "bytes": "1002516" }, { "name": "Java", "bytes": "32794" }, { "name": "JavaScript", "bytes": "51666" }, { "name": "Lex", "bytes": "4372" }, { "name": "Lua", "bytes": "70974" }, { "name": "Makefile", "bytes": "2295" }, { "name": "Objective-C", "bytes": "35223" }, { "name": "Objective-C++", "bytes": "34410" }, { "name": "PHP", "bytes": "120845" }, { "name": "Python", "bytes": "1002226" }, { "name": "Shell", "bytes": "49974" } ], "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_07) on Tue Sep 18 21:25:59 EST 2012 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Class com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck (checkstyle 5.6 API)</title> <meta name="date" content="2012-09-18"> <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="Uses of Class com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck (checkstyle 5.6 API)"; } //--> </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><a href="../../../../../../../com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheck.html" title="class in com.puppycrawl.tools.checkstyle.checks.naming">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?com/puppycrawl/tools/checkstyle/checks/naming/class-use/MethodNameCheck.html" target="_top">Frames</a></li> <li><a href="MethodNameCheck.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> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck" class="title">Uses of Class<br>com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck</h2> </div> <div class="classUseContainer">No usage of com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck</div> <!-- ======= 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><a href="../../../../../../../com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheck.html" title="class in com.puppycrawl.tools.checkstyle.checks.naming">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?com/puppycrawl/tools/checkstyle/checks/naming/class-use/MethodNameCheck.html" target="_top">Frames</a></li> <li><a href="MethodNameCheck.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> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2001-2012. All Rights Reserved.</small></p> </body> </html>
{ "content_hash": "1db90ebe7fd7c45c4a42a3470334bc34", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 185, "avg_line_length": 41.05128205128205, "alnum_prop": 0.6064959400374765, "repo_name": "kiwiwin/git-sniffer", "id": "036cb6015391f1049812b324b83a9077ff802580", "size": "4803", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "third_party_tools/checkstyle-5.6/site/apidocs/com/puppycrawl/tools/checkstyle/checks/naming/class-use/MethodNameCheck.html", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "529343" }, { "name": "Perl", "bytes": "1907" }, { "name": "Ruby", "bytes": "22553" } ], "symlink_target": "" }
using System.Collections.Generic; namespace CSharp2nem.ResponseObjects.Block { /* * Block related data */ /// <summary> /// Contains a number of classes that contain block related properties. /// </summary> public class BlockData { /// <summary> /// The previous block hash /// </summary> public class PrevBlockHash { /// <summary> /// The block hash /// </summary> public string Data { get; set; } } /// <summary> /// Contains a number of properties for a block /// </summary> public class Block { /// <summary> /// The block time stamp in seconds since the first block. /// </summary> public int TimeStamp { get; set; } /// <summary> /// The signature of the block. All blocks in the chain are signed by the harvesters. /// </summary> /// <remarks> /// This way any node can check if the block has been altered by some evil entity. /// </remarks> public string Signature { get; set; } /// <summary> /// The previous block hash /// </summary> public PrevBlockHash PrevBlockHash { get; set; } /// <summary> /// The block type. /// </summary> /// <remarks> /// There are currently two block types used: /// /// -1: Nemesis block type. This block type appears only once in the chain. /// 1: Regular block type.All blocks with height > 1 have this type. /// </remarks> public int Type { get; set; } /// <summary> /// The array of transactions. /// </summary> /// <remarks> /// See <see cref="TransactionDatum"/> for more details. A block can contain up to 120 transactions. /// </remarks> public List<TransactionDatum> Transactions { get; set; } /// <summary> /// The block version. The following versions are supported: /// </summary> /// <remarks> /// 0x68 &lt;&lt; 24 + 1 (1744830465 as 4 byte integer): the main network version /// 0x98 &lt;&lt; 24 + 1 (-1744830463 as 4 byte integer): the test network version /// </remarks> public int Version { get; set; } /// <summary> /// The public key of the harvester of the block as hexadecimal string. /// </summary> public string Signer { get; set; } /// <summary> /// The height of the block. Each block has a unique height. Subsequent blocks differ in height by 1. /// </summary> public int Height { get; set; } } /// <summary> /// The following structure is used by the NEM block chain explorer for convenience reason. The data is similar but not identical to that of a <see cref="Block"/>. /// </summary> public class ExplorerBlockViewModel { /// <summary> /// The block difficulty /// </summary> public long Difficulty { get; set; } /// <summary> /// List containing the transactions of the block. See <see cref="ExplorerTransferViewModel"/> for more details. /// </summary> public List<ExplorerTransferViewModel> Txes { get; set; } /// <summary> /// The <see cref="BlockData.Block"/> object. /// </summary> public Block Block { get; set; } /// <summary> /// The hash of the block as hexadecimal string. /// </summary> public string Hash { get; set; } } /// <summary> /// List of <see cref="ExplorerBlockViewModel"/> objects /// </summary> public class BlockList { /// <summary> /// List of <see cref="ExplorerBlockViewModel"/> objects /// </summary> public List<ExplorerBlockViewModel> Data { get; set; } } /// <summary> /// Block height object. /// </summary> /// <remarks> /// Typically used when sending the block height duing a request to get a block at a given height. /// </remarks> public class BlockHeight { /// <summary> /// The height of the block. /// </summary> public int height { get; set; } } /// <summary> /// The block hash /// </summary> public class Hash { /// <summary> /// The hash of the block as a hexidecimal string /// </summary> public string Data { get; set; } } /// <summary> /// Block meta data /// </summary> public class Meta { /// <summary> /// The database ID for the block /// </summary> public int Id { get; set; } /// <summary> /// The height of the block /// </summary> public int Height { get; set; } /// <summary> /// The hash of the block /// </summary> public Hash Hash { get; set; } } /* * Block transaction related data */ /// <summary> /// The block score /// </summary> public class BlockScore { /// <summary> /// The score for the block. /// </summary> /// <remarks> /// The score is an integer greater or equal to zero. It is submitted in hexadecimal format. /// </remarks> public string Score { get; set; } } /// <summary> /// The message attached to a transaction in a block /// </summary> public class Message { /// <summary> /// The payload of the message /// </summary> public string Payload { get; set; } /// <summary> /// The type of message /// </summary> /// <remarks> /// 1: plain test; 2: encrypted. /// </remarks> public int Type { get; set; } } /// <summary> /// The transaction data for a transaction in the block /// </summary> public class Transaction { /// <summary> /// The time stamp for the transaction /// </summary> public int TimeStamp { get; set; } /// <summary> /// The quantity of XEM transacted /// </summary> public long Amount { get; set; } /// <summary> /// The signature of the transaction in hexidecimal form /// </summary> public string Signature { get; set; } /// <summary> /// The total fee paid for this transaction /// </summary> public int Fee { get; set; } /// <summary> /// The transaction recipient address /// </summary> public string Recipient { get; set; } /// <summary> /// The type of transaction /// </summary> /// <remarks> /// See the transaction type section under the common transaction section of the documentation for further details. /// http://bob.nem.ninja/docs/#gathering-data-for-the-signature /// </remarks> public int Type { get; set; } /// <summary> /// The deadline by which the transaction should be included before it is refused by the network /// </summary> public int Deadline { get; set; } /// <summary> /// The message attachment. See <see cref="Message"/> /// </summary> public Message Message { get; set; } /// <summary> /// The transaction version. /// </summary> /// <remarks> /// Can be version 1 or 2. 1 is the old transaction version that does not support mosaic transfers. /// </remarks> public int Version { get; set; } /// <summary> /// The public key for the account that signed the transaction /// </summary> public string Signer { get; set; } } /// <summary> /// The transacton data /// </summary> public class TransactionDatum { /// <summary> /// The meta data for the transaction. See <see cref="Meta"/> /// </summary> public Meta Meta { get; set; } /// <summary> /// The transaction data. See <see cref="Transaction"/> /// </summary> public Transaction Transaction { get; set; } } /// <summary> /// Contains information about a transaction /// </summary> public class ExplorerTransferViewModel { /// <summary> /// The transaction data. See <see cref="TransactionDatum"/> /// </summary> public TransactionDatum Transaction { get; set; } /// <summary> /// The transaction hash /// </summary> public string Hash { get; set; } /// <summary> /// The inner hash if applicable. /// </summary> /// <remarks> /// Applicable when the transaction is a multisignature transaction /// </remarks> public string InnerHash { get; set; } } } }
{ "content_hash": "179ab3c576cfe2d73f2de2368a61f7f5", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 171, "avg_line_length": 34.79370629370629, "alnum_prop": 0.47774093055974276, "repo_name": "NemProject/csharp2nem", "id": "a522841b2d4e51ec0b2fde1c39bcad635f41db80", "size": "9953", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "NemApi/Wrapper/ResponseObjects/Block/BlockObjects.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "830590" }, { "name": "PowerShell", "bytes": "3737" } ], "symlink_target": "" }
namespace csapex { class MergeClouds : public csapex::Node, public VariadicInputs { public: MergeClouds(); void setupParameters(Parameterizable& parameters) override; void setup(csapex::NodeModifier& node_modifier) override; void process() override; template <class PointT> void inputCloud(typename pcl::PointCloud<PointT>::ConstPtr cloud); csapex::Input* createVariadicInput(csapex::TokenDataConstPtr type, const std::string& label, bool optional) override; private: void updateInputs(); private: Output* out_; connection_types::PointCloudMessage::Ptr result_; }; } // namespace csapex #endif // MERGE_CLOUDS_H
{ "content_hash": "83c79b09d16e87327264e0793386d40f", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 121, "avg_line_length": 23.642857142857142, "alnum_prop": 0.729607250755287, "repo_name": "cogsys-tuebingen/csapex_core_plugins", "id": "79c39086d5e0cde2418b8026713ec44435fcdff2", "size": "874", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "csapex_point_cloud/src/operations/merge_clouds.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "1269" }, { "name": "C++", "bytes": "2677667" }, { "name": "CMake", "bytes": "76400" }, { "name": "Objective-C", "bytes": "182" }, { "name": "Shell", "bytes": "815" } ], "symlink_target": "" }
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! #include "config.h" #include "V8UIEvent.h" #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/V8DOMConfiguration.h" #include "bindings/core/v8/V8HiddenValue.h" #include "bindings/core/v8/V8InputDevice.h" #include "bindings/core/v8/V8ObjectConstructor.h" #include "bindings/core/v8/V8UIEventInit.h" #include "bindings/core/v8/V8Window.h" #include "core/dom/ContextFeatures.h" #include "core/dom/Document.h" #include "core/frame/LocalDOMWindow.h" #include "core/frame/UseCounter.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 V8UIEvent::wrapperTypeInfo = { gin::kEmbedderBlink, V8UIEvent::domTemplate, V8UIEvent::refObject, V8UIEvent::derefObject, V8UIEvent::trace, 0, 0, V8UIEvent::preparePrototypeObject, V8UIEvent::installConditionallyEnabledProperties, "UIEvent", &V8Event::wrapperTypeInfo, 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 UIEvent.h. // For details, see the comment of DEFINE_WRAPPERTYPEINFO in // bindings/core/v8/ScriptWrappable.h. const WrapperTypeInfo& UIEvent::s_wrapperTypeInfo = V8UIEvent::wrapperTypeInfo; namespace UIEventV8Internal { static void viewAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); UIEvent* impl = V8UIEvent::toImpl(holder); v8SetReturnValueFast(info, WTF::getPtr(impl->view()), impl); } static void viewAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); UIEventV8Internal::viewAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void detailAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); UIEvent* impl = V8UIEvent::toImpl(holder); v8SetReturnValueInt(info, impl->detail()); } static void detailAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); UIEventV8Internal::detailAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void sourceDeviceAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); UIEvent* impl = V8UIEvent::toImpl(holder); RawPtr<InputDevice> cppValue(impl->sourceDevice()); if (cppValue && DOMDataStore::setReturnValue(info.GetReturnValue(), cppValue.get())) return; v8::Local<v8::Value> v8Value(toV8(cppValue.get(), holder, info.GetIsolate())); if (!v8Value.IsEmpty()) { V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "sourceDevice"), v8Value); v8SetReturnValue(info, v8Value); } } static void sourceDeviceAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); UIEventV8Internal::sourceDeviceAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void charCodeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); UIEvent* impl = V8UIEvent::toImpl(holder); v8SetReturnValueInt(info, impl->charCode()); } static void charCodeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::UIEventCharCode); UIEventV8Internal::charCodeAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void keyCodeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); UIEvent* impl = V8UIEvent::toImpl(holder); v8SetReturnValueInt(info, impl->keyCode()); } static void keyCodeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::UIEventKeyCode); UIEventV8Internal::keyCodeAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void whichAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); UIEvent* impl = V8UIEvent::toImpl(holder); v8SetReturnValueInt(info, impl->which()); } static void whichAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::UIEventWhich); UIEventV8Internal::whichAttributeGetter(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void initUIEventMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exceptionState(ExceptionState::ExecutionContext, "initUIEvent", "UIEvent", info.Holder(), info.GetIsolate()); UIEvent* impl = V8UIEvent::toImpl(info.Holder()); V8StringResource<> type; bool bubbles; bool cancelable; DOMWindow* view; int detail; { type = info[0]; if (!type.prepare()) return; bubbles = toBoolean(info.GetIsolate(), info[1], exceptionState); if (exceptionState.throwIfNeeded()) return; cancelable = toBoolean(info.GetIsolate(), info[2], exceptionState); if (exceptionState.throwIfNeeded()) return; view = toDOMWindow(info.GetIsolate(), info[3]); detail = toInt32(info.GetIsolate(), info[4], NormalConversion, exceptionState); if (exceptionState.throwIfNeeded()) return; } impl->initUIEvent(type, bubbles, cancelable, view, detail); } static void initUIEventMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::V8UIEvent_InitUIEvent_Method); UIEventV8Internal::initUIEventMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); } static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exceptionState(ExceptionState::ConstructionContext, "UIEvent", info.Holder(), info.GetIsolate()); if (UNLIKELY(info.Length() < 1)) { setMinimumArityTypeError(exceptionState, 1, info.Length()); exceptionState.throwIfNeeded(); return; } V8StringResource<> type; UIEventInit eventInitDict; { type = info[0]; if (!type.prepare()) return; if (!isUndefinedOrNull(info[1]) && !info[1]->IsObject()) { exceptionState.throwTypeError("parameter 2 ('eventInitDict') is not an object."); exceptionState.throwIfNeeded(); return; } V8UIEventInit::toImpl(info.GetIsolate(), info[1], eventInitDict, exceptionState); if (exceptionState.throwIfNeeded()) return; } RefPtrWillBeRawPtr<UIEvent> impl = UIEvent::create(type, eventInitDict); v8::Local<v8::Object> wrapper = info.Holder(); wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8UIEvent::wrapperTypeInfo, wrapper); v8SetReturnValue(info, wrapper); } } // namespace UIEventV8Internal static const V8DOMConfiguration::AccessorConfiguration V8UIEventAccessors[] = { {"view", UIEventV8Internal::viewAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, {"detail", UIEventV8Internal::detailAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, {"charCode", UIEventV8Internal::charCodeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, {"keyCode", UIEventV8Internal::keyCodeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, {"which", UIEventV8Internal::whichAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, }; static const V8DOMConfiguration::MethodConfiguration V8UIEventMethods[] = { {"initUIEvent", UIEventV8Internal::initUIEventMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, }; void V8UIEvent::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); if (!info.IsConstructCall()) { V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("UIEvent")); return; } if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) { v8SetReturnValue(info, info.Holder()); return; } UIEventV8Internal::constructor(info); } static void installV8UIEventTemplate(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) { functionTemplate->ReadOnlyPrototype(); v8::Local<v8::Signature> defaultSignature; defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "UIEvent", V8Event::domTemplate(isolate), V8UIEvent::internalFieldCount, 0, 0, V8UIEventAccessors, WTF_ARRAY_LENGTH(V8UIEventAccessors), V8UIEventMethods, WTF_ARRAY_LENGTH(V8UIEventMethods)); functionTemplate->SetCallHandler(V8UIEvent::constructorCallback); functionTemplate->SetLength(1); v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate(); ALLOW_UNUSED_LOCAL(instanceTemplate); v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); if (RuntimeEnabledFeatures::inputDeviceEnabled()) { static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration =\ {"sourceDevice", UIEventV8Internal::sourceDeviceAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, accessorConfiguration); } // Custom toString template functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate()); } v8::Local<v8::FunctionTemplate> V8UIEvent::domTemplate(v8::Isolate* isolate) { return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8UIEventTemplate); } bool V8UIEvent::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) { return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); } v8::Local<v8::Object> V8UIEvent::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) { return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); } UIEvent* V8UIEvent::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) { return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0; } void V8UIEvent::refObject(ScriptWrappable* scriptWrappable) { #if !ENABLE(OILPAN) scriptWrappable->toImpl<UIEvent>()->ref(); #endif } void V8UIEvent::derefObject(ScriptWrappable* scriptWrappable) { #if !ENABLE(OILPAN) scriptWrappable->toImpl<UIEvent>()->deref(); #endif } } // namespace blink
{ "content_hash": "99128db2ae20f139895cc2bcbb86034a", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 490, "avg_line_length": 46.644827586206894, "alnum_prop": 0.7295039550528573, "repo_name": "zero-rp/miniblink49", "id": "7616eb1d8958c6df79b5409525ce664d794ea40b", "size": "13695", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "gen/blink/bindings/core/v8/V8UIEvent.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": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SkypeLogReader2.Models { class ChatConversation { public Int32 ID { get; set; } public string DisplayName { get; set; } public ConversationType Type { get; set; } } enum ConversationType { SingleChat = 1, GroupChat = 2, } }
{ "content_hash": "54341da174dd18752919f631f59dba0d", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 50, "avg_line_length": 17.681818181818183, "alnum_prop": 0.622107969151671, "repo_name": "jellypotato-de/SkypeLogReader2", "id": "944eecc3a836923e074a913b0f90196eff72b7f0", "size": "391", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SkypeLogReader2/SkypeLogReader2/Models/ChatConversation.cs", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C#", "bytes": "5386" } ], "symlink_target": "" }
""" The MatchMaker classes should except a Topic or Fanout exchange key and return keys for direct exchanges, per (approximate) AMQP parlance. """ import itertools import json from oslo.config import cfg from logcollector.openstack.common.gettextutils import _ from logcollector.openstack.common import log as logging from logcollector.openstack.common.rpc import matchmaker as mm matchmaker_opts = [ # Matchmaker ring file cfg.StrOpt('ringfile', deprecated_name='matchmaker_ringfile', deprecated_group='DEFAULT', default='/etc/oslo/matchmaker_ring.json', help='Matchmaker ring file (JSON)'), ] CONF = cfg.CONF CONF.register_opts(matchmaker_opts, 'matchmaker_ring') LOG = logging.getLogger(__name__) class RingExchange(mm.Exchange): """Match Maker where hosts are loaded from a static JSON formatted file. __init__ takes optional ring dictionary argument, otherwise loads the ringfile from CONF.mathcmaker_ringfile. """ def __init__(self, ring=None): super(RingExchange, self).__init__() if ring: self.ring = ring else: with open(CONF.matchmaker_ring.ringfile, 'r') as fh: self.ring = json.load(fh) self.ring0 = {} for k in self.ring.keys(): self.ring0[k] = itertools.cycle(self.ring[k]) def _ring_has(self, key): return key in self.ring0 class RoundRobinRingExchange(RingExchange): """A Topic Exchange based on a hashmap.""" def __init__(self, ring=None): super(RoundRobinRingExchange, self).__init__(ring) def run(self, key): if not self._ring_has(key): LOG.warn( _("No key defining hosts for topic '%s', " "see ringfile") % (key, ) ) return [] host = next(self.ring0[key]) return [(key + '.' + host, host)] class FanoutRingExchange(RingExchange): """Fanout Exchange based on a hashmap.""" def __init__(self, ring=None): super(FanoutRingExchange, self).__init__(ring) def run(self, key): # Assume starts with "fanout~", strip it for lookup. nkey = key.split('fanout~')[1:][0] if not self._ring_has(nkey): LOG.warn( _("No key defining hosts for topic '%s', " "see ringfile") % (nkey, ) ) return [] return map(lambda x: (key + '.' + x, x), self.ring[nkey]) class MatchMakerRing(mm.MatchMakerBase): """Match Maker where hosts are loaded from a static hashmap.""" def __init__(self, ring=None): super(MatchMakerRing, self).__init__() self.add_binding(mm.FanoutBinding(), FanoutRingExchange(ring)) self.add_binding(mm.DirectBinding(), mm.DirectExchange()) self.add_binding(mm.TopicBinding(), RoundRobinRingExchange(ring))
{ "content_hash": "073df7721456cf7f3046ddb14424c604", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 76, "avg_line_length": 31.597826086956523, "alnum_prop": 0.60921912624699, "repo_name": "redhat-cip/openstack-logcollector", "id": "1f6e3331b1e1075b0972fcc7ca5203623b10bea2", "size": "3531", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "openstack-logcollector/openstack/common/rpc/matchmaker_ring.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "619436" } ], "symlink_target": "" }
rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 rpm -Uvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm yum -y update
{ "content_hash": "3901c2178f0ea7b272e0eda52bfea965", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 82, "avg_line_length": 41.75, "alnum_prop": 0.7425149700598802, "repo_name": "davehatton/packer", "id": "13f59400f568ce6b1f2e49a4efd824ffcb6fbfa9", "size": "185", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "centos-6.5/scripts/epel.sh", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Shell", "bytes": "12710" } ], "symlink_target": "" }
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="html/html; charset=utf-8" /> <title>CloudWatchPutMetricDataResponse Class Reference</title> <meta id="xcode-display" name="xcode-display" content="render"/> <link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" /> <link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" /> <meta name="generator" content="appledoc 2.2 (build 963)" /> </head> <body> <header id="top_header"> <div id="library" class="hideInXcode"> <h1><a id="libraryTitle" href="../index.html">AWS SDK for iOS v1.7.1 </a></h1> <a id="developerHome" href="../index.html">Amazon Web Services, Inc.</a> </div> <div id="title" role="banner"> <h1 class="hideInXcode">CloudWatchPutMetricDataResponse Class Reference</h1> </div> <ul id="headerButtons" role="toolbar"> <li id="toc_button"> <button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button> </li> <li id="jumpto_button" role="navigation"> <select id="jumpTo"> <option value="top">Jump To&#133;</option> <option value="overview">Overview</option> </select> </li> </ul> </header> <nav id="tocContainer" class="isShowingTOC"> <ul id="toc" role="tree"> <li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li> </ul> </nav> <article> <div id="contents" class="isShowingTOC" role="main"> <a title="CloudWatchPutMetricDataResponse Class Reference" name="top"></a> <div class="main-navigation navigation-top"> <ul> <li><a href="../index.html">Index</a></li> <li><a href="../hierarchy.html">Hierarchy</a></li> </ul> </div> <div id="header"> <div class="section-header"> <h1 class="title title-header">CloudWatchPutMetricDataResponse Class Reference</h1> </div> </div> <div id="container"> <div class="section section-specification"><table cellspacing="0"><tbody> <tr> <td class="specification-title">Inherits from</td> <td class="specification-value"><a href="../Classes/CloudWatchResponse.html">CloudWatchResponse</a> : <a href="../Classes/AmazonServiceResponse.html">AmazonServiceResponse</a> : NSObject</td> </tr><tr> <td class="specification-title">Declared in</td> <td class="specification-value">CloudWatchPutMetricDataResponse.h</td> </tr> </tbody></table></div> <div class="section section-overview"> <a title="Overview" name="overview"></a> <h2 class="subtitle subtitle-overview">Overview</h2> <p>Put Metric Data</p> </div> </div> <div class="main-navigation navigation-bottom"> <ul> <li><a href="../index.html">Index</a></li> <li><a href="../hierarchy.html">Hierarchy</a></li> </ul> </div> <div id="footer"><script src="/urchin.js" type="text/javascript"></script><script type="text/javascript">urchinTracker();</script> <hr /> <div class="footer-copyright"> <p><span class="copyright">&copy; 2013 Amazon Web Services, Inc.. All rights reserved. (Last updated: 2013-12-12)</span><br /> <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p> </div> </div> </div> </article> <script type="text/javascript"> function jumpToChange() { window.location.hash = this.options[this.selectedIndex].value; } function toggleTOC() { var contents = document.getElementById('contents'); var tocContainer = document.getElementById('tocContainer'); if (this.getAttribute('class') == 'open') { this.setAttribute('class', ''); contents.setAttribute('class', ''); tocContainer.setAttribute('class', ''); window.name = "hideTOC"; } else { this.setAttribute('class', 'open'); contents.setAttribute('class', 'isShowingTOC'); tocContainer.setAttribute('class', 'isShowingTOC'); window.name = ""; } return false; } function toggleTOCEntryChildren(e) { e.stopPropagation(); var currentClass = this.getAttribute('class'); if (currentClass == 'children') { this.setAttribute('class', 'children open'); } else if (currentClass == 'children open') { this.setAttribute('class', 'children'); } return false; } function tocEntryClick(e) { e.stopPropagation(); return true; } function init() { var selectElement = document.getElementById('jumpTo'); selectElement.addEventListener('change', jumpToChange, false); var tocButton = document.getElementById('table_of_contents'); tocButton.addEventListener('click', toggleTOC, false); var taskTreeItem = document.getElementById('task_treeitem'); if (taskTreeItem.getElementsByTagName('li').length > 0) { taskTreeItem.setAttribute('class', 'children'); taskTreeItem.firstChild.setAttribute('class', 'disclosure'); } var tocList = document.getElementById('toc'); var tocEntries = tocList.getElementsByTagName('li'); for (var i = 0; i < tocEntries.length; i++) { tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false); } var tocLinks = tocList.getElementsByTagName('a'); for (var i = 0; i < tocLinks.length; i++) { tocLinks[i].addEventListener('click', tocEntryClick, false); } if (window.name == "hideTOC") { toggleTOC.call(tocButton); } } window.onload = init; // If showing in Xcode, hide the TOC and Header if (navigator.userAgent.match(/xcode/i)) { document.getElementById("contents").className = "hideInXcode" document.getElementById("tocContainer").className = "hideInXcode" document.getElementById("top_header").className = "hideInXcode" } </script> </body> </html>
{ "content_hash": "76293c16f10b37dc8641033078043426", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 192, "avg_line_length": 27.561946902654867, "alnum_prop": 0.6182372772515653, "repo_name": "morizotter/AWSCloudWatchSample", "id": "d7f81176b740346ca27452df37bc0b2e4cba2389", "size": "6229", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "aws-ios-sdk-1.7.1/Documentation/com.amazon.aws.ios.docset/Contents/Resources/Documents/Classes/CloudWatchPutMetricDataResponse.html", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "708" }, { "name": "CSS", "bytes": "18960" }, { "name": "Objective-C", "bytes": "10544838" }, { "name": "Shell", "bytes": "3903" }, { "name": "TeX", "bytes": "276926" } ], "symlink_target": "" }
D3 Reusable Components Library ## Disclosure This repository is still in its early stage, so things may not work properly. ## Environment Setup Fork the repository. You will need node, npm, and grunt. Change into the project's root directory. ```bash npm install ``` Run Grunt with `grunt`. That's it!
{ "content_hash": "13b68cfe2d192ac4b8a4aab76e12eb38", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 98, "avg_line_length": 23.53846153846154, "alnum_prop": 0.7516339869281046, "repo_name": "bobegir/jubilee", "id": "3a64e50d7e9a007c65b366fee7b64d4803828bda", "size": "346", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1676" }, { "name": "JavaScript", "bytes": "700098" } ], "symlink_target": "" }
;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.reveal = { name : 'reveal', version : '{{VERSION}}', locked : false, settings : { animation : 'fadeAndPop', animation_speed : 250, close_on_background_click : true, close_on_esc : true, dismiss_modal_class : 'close-reveal-modal', multiple_opened : false, bg_class : 'reveal-modal-bg', root_element : 'body', open : function(){}, opened : function(){}, close : function(){}, closed : function(){}, on_ajax_error: $.noop, bg : $('.reveal-modal-bg'), css : { open : { 'opacity' : 0, 'visibility' : 'visible', 'display' : 'block' }, close : { 'opacity' : 1, 'visibility' : 'hidden', 'display' : 'none' } } }, init : function (scope, method, options) { $.extend(true, this.settings, method, options); this.bindings(method, options); }, events : function (scope) { var self = this, S = self.S; S(this.scope) .off('.reveal') .on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']:not([disabled])', function (e) { e.preventDefault(); if (!self.locked) { var element = S(this), ajax = element.data(self.data_attr('reveal-ajax')), replaceContentSel = element.data(self.data_attr('reveal-replace-content')); self.locked = true; if (typeof ajax === 'undefined') { self.open.call(self, element); } else { var url = ajax === true ? element.attr('href') : ajax; self.open.call(self, element, {url : url}, { replaceContentSel : replaceContentSel }); } } }); S(document) .on('click.fndtn.reveal', this.close_targets(), function (e) { e.preventDefault(); if (!self.locked) { var settings = S('[' + self.attr_name() + '].open').data(self.attr_name(true) + '-init') || self.settings, bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0]; if (bg_clicked) { if (settings.close_on_background_click) { e.stopPropagation(); } else { return; } } self.locked = true; self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open:not(.toback)') : S(this).closest('[' + self.attr_name() + ']')); } }); if (S('[' + self.attr_name() + ']', this.scope).length > 0) { S(this.scope) // .off('.reveal') .on('open.fndtn.reveal', this.settings.open) .on('opened.fndtn.reveal', this.settings.opened) .on('opened.fndtn.reveal', this.open_video) .on('close.fndtn.reveal', this.settings.close) .on('closed.fndtn.reveal', this.settings.closed) .on('closed.fndtn.reveal', this.close_video); } else { S(this.scope) // .off('.reveal') .on('open.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.open) .on('opened.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.opened) .on('opened.fndtn.reveal', '[' + self.attr_name() + ']', this.open_video) .on('close.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.close) .on('closed.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.closed) .on('closed.fndtn.reveal', '[' + self.attr_name() + ']', this.close_video); } return true; }, // PATCH #3: turning on key up capture only when a reveal window is open key_up_on : function (scope) { var self = this; // PATCH #1: fixing multiple keyup event trigger from single key press self.S('body').off('keyup.fndtn.reveal').on('keyup.fndtn.reveal', function ( event ) { var open_modal = self.S('[' + self.attr_name() + '].open'), settings = open_modal.data(self.attr_name(true) + '-init') || self.settings ; // PATCH #2: making sure that the close event can be called only while unlocked, // so that multiple keyup.fndtn.reveal events don't prevent clean closing of the reveal window. if ( settings && event.which === 27 && settings.close_on_esc && !self.locked) { // 27 is the keycode for the Escape key self.close.call(self, open_modal); } }); return true; }, // PATCH #3: turning on key up capture only when a reveal window is open key_up_off : function (scope) { this.S('body').off('keyup.fndtn.reveal'); return true; }, open : function (target, ajax_settings) { var self = this, modal; if (target) { if (typeof target.selector !== 'undefined') { // Find the named node; only use the first one found, since the rest of the code assumes there's only one node modal = self.S('#' + target.data(self.data_attr('reveal-id'))).first(); } else { modal = self.S(this.scope); ajax_settings = target; } } else { modal = self.S(this.scope); } var settings = modal.data(self.attr_name(true) + '-init'); settings = settings || this.settings; if (modal.hasClass('open') && target.attr('data-reveal-id') == modal.attr('id')) { return self.close(modal); } if (!modal.hasClass('open')) { var open_modal = self.S('[' + self.attr_name() + '].open'); if (typeof modal.data('css-top') === 'undefined') { modal.data('css-top', parseInt(modal.css('top'), 10)) .data('offset', this.cache_offset(modal)); } modal.attr('tabindex','0').attr('aria-hidden','false'); this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open // Prevent namespace event from triggering twice modal.on('open.fndtn.reveal', function(e) { if (e.namespace !== 'fndtn.reveal') return; }); modal.on('open.fndtn.reveal').trigger('open.fndtn.reveal'); if (open_modal.length < 1) { this.toggle_bg(modal, true); } if (typeof ajax_settings === 'string') { ajax_settings = { url : ajax_settings }; } if (typeof ajax_settings === 'undefined' || !ajax_settings.url) { if (open_modal.length > 0) { if (settings.multiple_opened) { self.to_back(open_modal); } else { self.hide(open_modal, settings.css.close); } } this.show(modal, settings.css.open); } else { var old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null; $.extend(ajax_settings, { success : function (data, textStatus, jqXHR) { if ( $.isFunction(old_success) ) { var result = old_success(data, textStatus, jqXHR); if (typeof result == 'string') { data = result; } } if (typeof options !== 'undefined' && typeof options.replaceContentSel !== 'undefined') { modal.find(options.replaceContentSel).html(data); } else { modal.html(data); } self.S(modal).foundation('section', 'reflow'); self.S(modal).children().foundation(); if (open_modal.length > 0) { if (settings.multiple_opened) { self.to_back(open_modal); } else { self.hide(open_modal, settings.css.close); } } self.show(modal, settings.css.open); } }); // check for if user initalized with error callback if (settings.on_ajax_error !== $.noop) { $.extend(ajax_settings, { error : settings.on_ajax_error }); } $.ajax(ajax_settings); } } self.S(window).trigger('resize'); }, close : function (modal) { var modal = modal && modal.length ? modal : this.S(this.scope), open_modals = this.S('[' + this.attr_name() + '].open'), settings = modal.data(this.attr_name(true) + '-init') || this.settings, self = this; if (open_modals.length > 0) { modal.removeAttr('tabindex','0').attr('aria-hidden','true'); this.locked = true; this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open modal.trigger('close.fndtn.reveal'); if ((settings.multiple_opened && open_modals.length === 1) || !settings.multiple_opened || modal.length > 1) { self.toggle_bg(modal, false); self.to_front(modal); } if (settings.multiple_opened) { self.hide(modal, settings.css.close, settings); self.to_front($($.makeArray(open_modals).reverse()[1])); } else { self.hide(open_modals, settings.css.close, settings); } } }, close_targets : function () { var base = '.' + this.settings.dismiss_modal_class; if (this.settings.close_on_background_click) { return base + ', .' + this.settings.bg_class; } return base; }, toggle_bg : function (modal, state) { if (this.S('.' + this.settings.bg_class).length === 0) { this.settings.bg = $('<div />', {'class': this.settings.bg_class}) .appendTo('body').hide(); } var visible = this.settings.bg.filter(':visible').length > 0; if ( state != visible ) { if ( state == undefined ? visible : !state ) { this.hide(this.settings.bg); } else { this.show(this.settings.bg); } } }, show : function (el, css) { // is modal if (css) { var settings = el.data(this.attr_name(true) + '-init') || this.settings, root_element = settings.root_element, context = this; if (el.parent(root_element).length === 0) { var placeholder = el.wrap('<div style="display: none;" />').parent(); el.on('closed.fndtn.reveal.wrapped', function () { el.detach().appendTo(placeholder); el.unwrap().unbind('closed.fndtn.reveal.wrapped'); }); el.detach().appendTo(root_element); } var animData = getAnimationData(settings.animation); if (!animData.animate) { this.locked = false; } if (animData.pop) { css.top = $(window).scrollTop() - el.data('offset') + 'px'; var end_css = { top: $(window).scrollTop() + el.data('css-top') + 'px', opacity: 1 }; return setTimeout(function () { return el .css(css) .animate(end_css, settings.animation_speed, 'linear', function () { context.locked = false; el.trigger('opened.fndtn.reveal'); }) .addClass('open'); }, settings.animation_speed / 2); } if (animData.fade) { css.top = $(window).scrollTop() + el.data('css-top') + 'px'; var end_css = {opacity: 1}; return setTimeout(function () { return el .css(css) .animate(end_css, settings.animation_speed, 'linear', function () { context.locked = false; el.trigger('opened.fndtn.reveal'); }) .addClass('open'); }, settings.animation_speed / 2); } return el.css(css).show().css({opacity : 1}).addClass('open').trigger('opened.fndtn.reveal'); } var settings = this.settings; // should we animate the background? if (getAnimationData(settings.animation).fade) { return el.fadeIn(settings.animation_speed / 2); } this.locked = false; return el.show(); }, to_back : function(el) { el.addClass('toback'); }, to_front : function(el) { el.removeClass('toback'); }, hide : function (el, css) { // is modal if (css) { var settings = el.data(this.attr_name(true) + '-init'), context = this; settings = settings || this.settings; var animData = getAnimationData(settings.animation); if (!animData.animate) { this.locked = false; } if (animData.pop) { var end_css = { top: - $(window).scrollTop() - el.data('offset') + 'px', opacity: 0 }; return setTimeout(function () { return el .animate(end_css, settings.animation_speed, 'linear', function () { context.locked = false; el.css(css).trigger('closed.fndtn.reveal'); }) .removeClass('open'); }, settings.animation_speed / 2); } if (animData.fade) { var end_css = {opacity : 0}; return setTimeout(function () { return el .animate(end_css, settings.animation_speed, 'linear', function () { context.locked = false; el.css(css).trigger('closed.fndtn.reveal'); }) .removeClass('open'); }, settings.animation_speed / 2); } return el.hide().css(css).removeClass('open').trigger('closed.fndtn.reveal'); } var settings = this.settings; // should we animate the background? if (getAnimationData(settings.animation).fade) { return el.fadeOut(settings.animation_speed / 2); } return el.hide(); }, close_video : function (e) { var video = $('.flex-video', e.target), iframe = $('iframe', video); if (iframe.length > 0) { iframe.attr('data-src', iframe[0].src); iframe.attr('src', iframe.attr('src')); video.hide(); } }, open_video : function (e) { var video = $('.flex-video', e.target), iframe = video.find('iframe'); if (iframe.length > 0) { var data_src = iframe.attr('data-src'); if (typeof data_src === 'string') { iframe[0].src = iframe.attr('data-src'); } else { var src = iframe[0].src; iframe[0].src = undefined; iframe[0].src = src; } video.show(); } }, data_attr : function (str) { if (this.namespace.length > 0) { return this.namespace + '-' + str; } return str; }, cache_offset : function (modal) { var offset = modal.show().height() + parseInt(modal.css('top'), 10) + modal.scrollY; modal.hide(); return offset; }, off : function () { $(this.scope).off('.fndtn.reveal'); }, reflow : function () {} }; /* * getAnimationData('popAndFade') // {animate: true, pop: true, fade: true} * getAnimationData('fade') // {animate: true, pop: false, fade: true} * getAnimationData('pop') // {animate: true, pop: true, fade: false} * getAnimationData('foo') // {animate: false, pop: false, fade: false} * getAnimationData(null) // {animate: false, pop: false, fade: false} */ function getAnimationData(str) { var fade = /fade/i.test(str); var pop = /pop/i.test(str); return { animate : fade || pop, pop : pop, fade : fade }; } }(jQuery, window, window.document));
{ "content_hash": "d58cf3af56bcac9921ef9fd04c95bc70", "timestamp": "", "source": "github", "line_count": 498, "max_line_length": 146, "avg_line_length": 31.8714859437751, "alnum_prop": 0.512663810483871, "repo_name": "lukeoly/transition-angels", "id": "82321464ec503cc23064629306b235f29499618e", "size": "15872", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "js/foundation/foundation.reveal.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "233594" }, { "name": "HTML", "bytes": "60951" }, { "name": "JavaScript", "bytes": "77767" }, { "name": "PHP", "bytes": "234" }, { "name": "Ruby", "bytes": "675" }, { "name": "Shell", "bytes": "2442" } ], "symlink_target": "" }
@implementation ItemHelper - (id)init { return self; } @end
{ "content_hash": "c2f705766fb15faac88ab67762cec28b", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 26, "avg_line_length": 5.833333333333333, "alnum_prop": 0.6142857142857143, "repo_name": "PixLandMedia/PXPodSandbox", "id": "8cafd88926e1e1c4d5f4f247708621874f083d7d", "size": "234", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Classes/ios/ItemHelper.m", "mode": "33261", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "496" }, { "name": "Ruby", "bytes": "5434" } ], "symlink_target": "" }
namespace oless { namespace excel { namespace records { class SXDtrRecord : public Record { public: SXDtrRecord(unsigned short type, std::vector<uint8_t> data) : Record(type, data) { } }; } } }
{ "content_hash": "074ea7ff7c8aeceb11b4752faee3706f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 86, "avg_line_length": 16.846153846153847, "alnum_prop": 0.634703196347032, "repo_name": "DBHeise/fileid", "id": "4171c4f4b931e19aa37f73ef32e49c0ed378a9dd", "size": "256", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fileid/document/excel/records/SXDtrRecord.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "1263238" }, { "name": "Makefile", "bytes": "1186" }, { "name": "PowerShell", "bytes": "17765" }, { "name": "Python", "bytes": "2380" }, { "name": "Shell", "bytes": "209" } ], "symlink_target": "" }
Simple JavaScript implementation of Croatian Business Registry Number (MB) validation. If the MB is valid function returns 1, otherwise 0 (false). Example: > var MB = '011302234'; > > validateMB(MB);
{ "content_hash": "455661bb981fbf738ce2d230593b4f36", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 86, "avg_line_length": 22.555555555555557, "alnum_prop": 0.7487684729064039, "repo_name": "otisid/mb-js-validator", "id": "0691d3e9423850aeb9e08767f909368601237467", "size": "221", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1020" } ], "symlink_target": "" }
/* Andrés puso la mesa con mucha antelación. Le gustaba el protocolo de las cenas de gala y las comidas de etiqueta, y en algún sitio leyó que los tenedores de carne solían tener tres puntas, mientras que los de pescado venían a tener cuatro. En ese momento su madre dijo: “A la mesa, que el pollo ya está listo”. ¿Cuántas puntas tenían los tenedores que usaron en la cena? Con la ayuda del IDE NetBeans crear un proyecto de tipo Aplicación Java llamado AlternativaTenedor, que contenga un paquete llamado org.japo.java.main, que tenga su punto de entrada en la clase Main y que muestre por pantalla todos los términos de la situación relatada. */ package org.pajo.java.main; import java.util.Locale; import java.util.Scanner; /** * * @author Adrián Martínez Gil 1dawm161715@gmail.com */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // Constantes int TENEDOR_CARNE = 3; int TENEDOR_PESCADO = 4; // Codificación Cultural y escaner Locale l = new Locale("ES", "es"); Scanner sc = new Scanner(System.in, "iso-8859-1"); sc.useLocale(l); // Variables String tipoComida; // Entradas System.out.println("¿Qué tipo de comida es?\n[carne\\pescado]"); tipoComida = sc.nextLine(); // Haz Cosas if (tipoComida.equals("carne")){ System.out.printf("El tenedor a utilizar es el de %d puntas.\n", TENEDOR_CARNE); } else if (tipoComida.equals("pescado")) { System.out.printf("El tenedor a utilizar es el de %d puntas.\n", TENEDOR_PESCADO); } else { System.out.println("El dato introducido no es válido."); } // Salida } }
{ "content_hash": "d56d162852ada84b56a813d7084f9294", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 94, "avg_line_length": 33.4, "alnum_prop": 0.6347305389221557, "repo_name": "1dawm161715/Ejercicios-1-DAW", "id": "9d848802c731857f143e5adee9957e3766be2660", "size": "1860", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Tema 3/2 - Decisión/AlternativaTenedor/src/org/pajo/java/main/Main.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "186955" } ], "symlink_target": "" }
package org.drools.modelcompiler; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import org.drools.modelcompiler.domain.Address; import org.drools.modelcompiler.domain.Person; import org.drools.modelcompiler.domain.Pet; import org.drools.modelcompiler.domain.Result; import org.junit.Test; import org.kie.api.runtime.KieSession; import org.kie.api.runtime.rule.FactHandle; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; public class PropertyReactivityTest extends BaseModelTest { public PropertyReactivityTest( RUN_TYPE testRunType ) { super( testRunType ); } @Test public void testPropertyReactivity() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " modify($p) { setAge( $p.getAge()+1 ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.fireAllRules(); assertEquals(41, p.getAge()); } @Test public void testPropertyReactivityWithUpdate() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " $p.setAge( $p.getAge()+1 );\n" + " update($p);\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.fireAllRules(); assertEquals(41, p.getAge()); } @Test public void testPropertyReactivityMvel() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R dialect\"mvel\" when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " modify($p) { age = $p.age+1 };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.fireAllRules(); assertEquals(41, p.getAge()); } @Test public void testPropertyReactivityMvelWithUpdate() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R dialect\"mvel\" when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " $p.age = $p.age+1;\n" + " update($p);\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.fireAllRules(); assertEquals(41, p.getAge()); } @Test public void testWatch() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R when\n" + " $p : Person( age < 50 ) @watch(!age)\n" + "then\n" + " modify($p) { setAge( $p.getAge()+1 ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.fireAllRules(); assertEquals(41, p.getAge()); } @Test public void testWatchAll() { // DROOLS-4509 final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R when\n" + " $p : Person( name == \"Mario\" ) @watch(*)\n" + "then\n" + " modify($p) { setAge( $p.getAge()+1 ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.fireAllRules(10); assertEquals(50, p.getAge()); } @Test public void testWatchAllBeforeBeta() { // DROOLS-4509 final String str = "import " + Person.class.getCanonicalName() + ";\n" + "import " + Address.class.getCanonicalName() + ";\n" + "\n" + "rule R when\n" + " $p : Person( name == \"Mario\" ) @watch(*)\n" + " Address() \n" + "then\n" + " modify($p) { setAge( $p.getAge()+1 ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.insert( new Address( "Milan" ) ); ksession.fireAllRules(10); assertEquals(50, p.getAge()); } @Test public void testWatchAllBeforeFrom() { // DROOLS-4509 final String str = "import " + Person.class.getCanonicalName() + ";\n" + "import " + Address.class.getCanonicalName() + ";\n" + "\n" + "rule R when\n" + " $p : Person( name == \"Mario\" ) @watch(*)\n" + " Address() from $p.addresses\n" + "then\n" + " modify($p) { setAge( $p.getAge()+1 ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); p.addAddress( new Address( "Milan" ) ); p.addAddress( new Address( "Rome" ) ); ksession.insert( p ); ksession.fireAllRules(10); assertEquals(50, p.getAge()); } @Test public void testImplicitWatch() { String str = "import " + Result.class.getCanonicalName() + ";" + "import " + Person.class.getCanonicalName() + ";" + "rule R when\n" + " $r : Result()\n" + " $p1 : Person()\n" + " $p2 : Person(name != \"Mark\", this != $p1, age > $p1.age)\n" + "then\n" + " $r.setValue($p2.getName() + \" is older than \" + $p1.getName());\n" + "end"; KieSession ksession = getKieSession(str); Result result = new Result(); ksession.insert(result); Person mark = new Person("Mark", 37); Person edson = new Person("Edson", 35); Person mario = new Person("Mario", 40); FactHandle markFH = ksession.insert(mark); FactHandle edsonFH = ksession.insert(edson); FactHandle marioFH = ksession.insert(mario); ksession.fireAllRules(); assertEquals("Mario is older than Mark", result.getValue()); result.setValue(null); ksession.delete(marioFH); ksession.fireAllRules(); assertNull(result.getValue()); mark.setAge(34); ksession.update(markFH, mark, "age"); ksession.fireAllRules(); assertEquals("Edson is older than Mark", result.getValue()); } @Test public void testImplicitWatchWithDeclaration() { String str = "import " + Result.class.getCanonicalName() + ";" + "import " + Person.class.getCanonicalName() + ";" + "rule R when\n" + " $r : Result()\n" + " $p1 : Person( $a : address )\n" + " $p2 : Person(name != \"Mark\", this != $p1, age > $p1.age)\n" + "then\n" + " $r.setValue($p2.getName() + \" is older than \" + $p1.getName());\n" + "end"; KieSession ksession = getKieSession(str); Result result = new Result(); ksession.insert(result); Person mark = new Person("Mark", 37); Person edson = new Person("Edson", 35); Person mario = new Person("Mario", 40); FactHandle markFH = ksession.insert(mark); FactHandle edsonFH = ksession.insert(edson); FactHandle marioFH = ksession.insert(mario); ksession.fireAllRules(); assertEquals("Mario is older than Mark", result.getValue()); result.setValue(null); ksession.delete(marioFH); ksession.fireAllRules(); assertNull(result.getValue()); mark.setAge(34); ksession.update(markFH, mark, "age"); ksession.fireAllRules(); assertEquals("Edson is older than Mark", result.getValue()); } @Test public void testImmutableField() { final String str = "declare Integer @propertyReactive end\n" + "declare Long @propertyReactive end\n" + "rule R when\n" + " $i : Integer( intValue > 0 )\n" + " Long( $l : intValue == $i )\n" + "then\n" + "end\n"; KieSession ksession = getKieSession( str ); ksession.insert( 42 ); ksession.insert( 42L ); assertEquals( 1, ksession.fireAllRules() ); } @Test(timeout = 5000L) public void testPRAfterAccumulate() { // DROOLS-2427 final String str = "import " + Order.class.getCanonicalName() + "\n" + "import " + OrderLine.class.getCanonicalName() + "\n" + "rule R when\n" + " $o: Order($lines: orderLines)\n" + " Number(intValue >= 15) from accumulate(\n" + " OrderLine($q: quantity) from $lines\n" + " , sum($q)\n" + " )\n" + " then\n" + " modify($o) { setPrice(10) }\n" + "end\n"; KieSession ksession = getKieSession( str ); Order order = new Order( Arrays.asList(new OrderLine( 9 ), new OrderLine( 8 )), 12 ); ksession.insert( order ); ksession.fireAllRules(); assertEquals( 10, order.getPrice() ); } public static class Order { private final List<OrderLine> orderLines; private int price; public Order( List<OrderLine> orderLines, int price ) { this.orderLines = orderLines; this.price = price; } public List<OrderLine> getOrderLines() { return orderLines; } public int getPrice() { return price; } public void setPrice( int price ) { this.price = price; } } public static class OrderLine { private final int quantity; public OrderLine( int quantity ) { this.quantity = quantity; } public int getQuantity() { return quantity; } } public static class Bean { private final List<String> firings = new ArrayList<>(); public List<String> getFirings() { return firings; } public String getValue() { return "Bean"; } public void setValue(String value) {} } @Test(timeout = 5000L) public void testPRWithAddOnList() { final String str = "import " + Bean.class.getCanonicalName() + "\n" + "rule R when\n" + " $b : Bean( firings not contains \"R\" )\n" + "then\n" + " $b.getFirings().add(\"R\");\n" + " update($b);\n" + "end\n"; KieSession ksession = getKieSession( str ); ksession.insert( new Bean() ); assertEquals( 1, ksession.fireAllRules() ); } @Test public void testPRWithUpdateOnList() { final String str = "import " + List.class.getCanonicalName() + "\n" + "rule R1 when\n" + " $l : List( empty == true )\n" + "then\n" + " $l.add(\"test\");\n" + " update($l);\n" + "end\n" + "rule R2 when\n" + " $l : List( !this.contains(\"test\") )\n" + "then\n" + "end\n"; KieSession ksession = getKieSession( str ); ksession.insert( new ArrayList() ); assertEquals( 1, ksession.fireAllRules() ); } @Test public void testPROnAtomic() { final String str = "import " + AtomicInteger.class.getCanonicalName() + "\n" + "rule R2 when\n" + " $i : AtomicInteger( get() < 3 )\n" + "then\n" + " $i.incrementAndGet();" + " insert(\"test\" + $i.get());" + " update($i);" + "end\n"; KieSession ksession = getKieSession( str ); ksession.insert(new AtomicInteger(0)); assertEquals( 3, ksession.fireAllRules() ); } @Test(timeout = 10000L) public void testPropertyReactivityWith2Rules() { checkPropertyReactivityWith2Rules( "age == 41\n" ); } @Test(timeout = 10000L) public void testPropertyReactivityWith2RulesUsingAccessor() { checkPropertyReactivityWith2Rules( "getAge() == 41\n" ); } @Test(timeout = 10000L) public void testPropertyReactivityWith2RulesLiteralFirst() { checkPropertyReactivityWith2Rules( "41 == age\n" ); } @Test(timeout = 10000L) public void testPropertyReactivityWith2RulesLiteralFirstUsingAccessor() { checkPropertyReactivityWith2Rules( "41 == getAge()\n" ); } private void checkPropertyReactivityWith2Rules( String constraint ) { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R1 when\n" + " $p : Person( age == 40 )\n" + "then\n" + " modify($p) { setAge( $p.getAge()+1 ) };\n" + "end\n" + "rule R2 when\n" + " $p : Person( " + constraint + " )\n" + "then\n" + " modify($p) { setEmployed( true ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person( "Mario", 40 ); ksession.insert( p ); ksession.fireAllRules(); assertEquals( 41, p.getAge() ); assertTrue( p.getEmployed() ); } @Test public void testReassignment() { // DROOLS-4884 final String str = "package com.example\n" + "\n" + "declare Counter\n" + " value1: int\n" + " value2: int\n" + "end\n" + "\n" + "rule \"Init\" when\n" + " not Counter()\n" + "then\n" + " drools.insert(new Counter(0, 0));\n" + "end\n" + "\n" + "rule \"Loop\"\n" + "when\n" + " $c: Counter( value1 == 0 )\n" + "then\n" + " $c = new Counter(0, 0);\n" + " $c.setValue2(1);\n" + " update($c);\n" + "end\n\n"; KieSession ksession = getKieSession( str ); assertEquals( 5, ksession.fireAllRules(5) ); } @Test public void testReassignment2() { // DROOLS-4884 final String str = "package com.example\n" + "\n" + "declare Counter\n" + " value1: int\n" + " value2: int\n" + "end\n" + "\n" + "rule \"Init\" when\n" + " not Counter()\n" + "then\n" + " drools.insert(new Counter(0, 0));\n" + "end\n" + "\n" + "rule \"Loop\"\n" + "when\n" + " $c: Counter( value1 == 0 )\n" + "then\n" + " $c = new Counter(0, 0);\n" + " $c.setValue1(1);\n" + " update($c);\n" + "end\n\n"; KieSession ksession = getKieSession( str ); assertEquals( 2, ksession.fireAllRules(5) ); } @Test public void testMultipleFieldUpdate() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R1 when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " modify($p) { setAge( $p.getAge()+1 ), setLikes(\"Cheese\") };\n" + "end\n" + "rule R2 when\n" + " $p : Person( name == \"Mario\", likes == \"Cheese\" )\n" + "then\n" + " modify($p) { setAge( $p.getAge()+1 ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); p.setLikes("Beer"); ksession.insert( p ); ksession.fireAllRules(); assertEquals(42, p.getAge()); } @Test public void testComplexSetterArgument() { String str = "import " + Person.class.getCanonicalName() + ";" + "rule R \n" + "when\n" + " $p: Person(address.street == \"street1\")\n" + "then\n" + " modify($p) { setLikes( String.valueOf(($p.getAddress().getStreet() + $p.getAddress().getCity()))) };\n" + "end"; KieSession ksession = getKieSession( str ); Person me = new Person( "Mario", 40 ); me.setAddress(new Address("street1", 2, "city1")); ksession.insert( me ); assertEquals(1, ksession.fireAllRules(10)); assertEquals( "street1city1", me.getLikes() ); } @Test public void testNestedPropInRHS() throws Exception { // Property Reactivity for "owner" final String str = "package org.drools.test;\n" + "import " + Pet.class.getCanonicalName() + ";\n" + "rule R1\n" + "when \n" + " $pet : Pet(age == 3)\n" + "then\n" + " modify ($pet) { getOwner().setLikes(\"Cookie\") };\n" + "end\n" + "rule R2\n" + "when \n" + " Pet(owner.likes == \"Cookie\")\n" + "then\n" + "end"; final KieSession ksession = getKieSession(str); Pet pet = new Pet(Pet.PetType.cat); Person person = new Person("John"); person.setLikes("Meat"); pet.setOwner(person); pet.setAge(3); ksession.insert(pet); assertEquals(2, ksession.fireAllRules()); } @Test public void testDeeplyNestedPropInRHS() throws Exception { // Property Reactivity for "owner" final String str = "package org.drools.test;\n" + "import " + Pet.class.getCanonicalName() + ";\n" + "rule R1\n" + "when \n" + " $pet : Pet(age == 3)\n" + "then\n" + " modify ($pet) { getOwner().getAddress().setStreet(\"XYZ street\") };\n" + "end\n" + "rule R2\n" + "when \n" + " Pet(owner.address.street == \"XYZ street\")\n" + "then\n" + "end"; final KieSession ksession = getKieSession(str); Pet pet = new Pet(Pet.PetType.cat); Person person = new Person("John"); person.setAddress(new Address("ABC street")); pet.setOwner(person); pet.setAge(3); ksession.insert(pet); assertEquals(2, ksession.fireAllRules()); } @Test public void testOutsideModifyBlockWithGetterAsArgument() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R1 when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " System.out.println(\"name = \" + $p.getName());\n" + " modify($p) { setAge(41) };\n" + "end\n"; final KieSession ksession = getKieSession(str); Person p = new Person("Mario", 40); ksession.insert(p); int fired = ksession.fireAllRules(10); assertEquals(1, fired); assertEquals(41, p.getAge()); } @Test public void testOutsideModifyBlockWithNonGetterAsArgument() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R1 when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " System.out.println(\"name.length = \" + $p.getName().length());\n" + " modify($p) { setAge(41) };\n" + "end\n"; final KieSession ksession = getKieSession(str); Person p = new Person("Mario", 40); ksession.insert(p); int fired = ksession.fireAllRules(10); assertEquals(1, fired); assertEquals(41, p.getAge()); } @Test public void testMultipleModifyBlocksWithNonGetterAsArgument() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "import " + Address.class.getCanonicalName() + ";\n" + "\n" + "rule R1 when\n" + " $p : Person( name == \"Mario\" )\n" + " $a : Address( street == \"Street\" )\n" + "then\n" + " System.out.println(\"name.length = \" + $p.getName().length());\n" + " modify($p) { setAge(41) };\n" + " System.out.println(\"street.length = \" + $a.getStreet().length());\n" + " modify($a) { setNumber(20) };\n" + "end\n"; final KieSession ksession = getKieSession(str); Person p = new Person("Mario", 40); ksession.insert(p); Address a = new Address("Street", 10, "City"); ksession.insert(a); int fired = ksession.fireAllRules(10); assertEquals(1, fired); assertEquals(41, p.getAge()); assertEquals(20, a.getNumber()); } @Test public void testUpdateWithGetterAsArgument() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R1 when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " System.out.println(\"name = \" + $p.getName());\n" + " $p.setAge(41);\n" + " update($p);\n" + "end\n"; final KieSession ksession = getKieSession(str); Person p = new Person("Mario", 40); ksession.insert(p); int fired = ksession.fireAllRules(10); assertEquals(1, fired); assertEquals(41, p.getAge()); } @Test public void testUpdateWithNonGetterAsArgument() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R1 when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " System.out.println(\"name.length = \" + $p.getName().length());\n" + " $p.setAge(41);\n" + " update($p);\n" + "end\n"; final KieSession ksession = getKieSession(str); Person p = new Person("Mario", 40); ksession.insert(p); int fired = ksession.fireAllRules(10); assertEquals(1, fired); assertEquals(41, p.getAge()); } @Test public void testUpdateWithNonGetterAsDeclaration() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R1 when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " int length = $p.getName().length();\n" + " System.out.println(\"length = \" + length);\n" + " $p.setAge(41);\n" + " update($p);\n" + "end\n"; final KieSession ksession = getKieSession(str); Person p = new Person("Mario", 40); ksession.insert(p); int fired = ksession.fireAllRules(10); assertEquals(1, fired); assertEquals(41, p.getAge()); } @Test public void testUpdateWithNonGetterIntentinalLoop() { final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R1 when\n" + " $p : Person( name == \"Mario\" )\n" + "then\n" + " $p.getName().length();\n" + " $p.setAge(41);\n" + " update($p);\n" + "end\n"; final KieSession ksession = getKieSession(str); Person p = new Person("Mario", 40); ksession.insert(p); int fired = ksession.fireAllRules(10); // this is not likely an expected loop but standard-drl considers getter+otherMethod modifies the prop "name". // anyway, such "read" method is not written like this (= without assigning to a variable or as an argument of other method) // This test is to ensure the same behavior on stadard-drl and executable-model. assertEquals(10, fired); assertEquals(41, p.getAge()); } @Test public void testPropertyReactivityOnBoundVariable() { // RHDM-1387 final String str = "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R when\n" + " $p : Person( $n : name, $n == \"Mario\" )\n" + "then\n" + " modify($p) { setAge( $p.getAge()+1 ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.fireAllRules(5); assertEquals(41, p.getAge()); } public static int dummy(int i) { return i; } @Test public void testWatchCallingExternalMethod() { // DROOLS-5514 final String str = "import static " + this.getClass().getCanonicalName() + ".dummy;\n" + "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R when\n" + " $p : Person( dummy(age) < 50 ) @watch(!*, age)\n" + "then\n" + " modify($p) { setAge( $p.getAge()+1 ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.fireAllRules(); assertEquals(50, p.getAge()); } @Test public void testWatchCallingExternalMethod2() { // DROOLS-5514 final String str = "import static " + this.getClass().getCanonicalName() + ".dummy;\n" + "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R when\n" + " $p : Person( dummy(age) < 50 )\n" + "then\n" + " modify($p) { setName( $p.getName()+\"1\" ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.fireAllRules(3); assertEquals("Mario111", p.getName()); } @Test public void testWatchCallingExternalMethod3() { // DROOLS-5514 final String str = "import static " + this.getClass().getCanonicalName() + ".dummy;\n" + "import " + Person.class.getCanonicalName() + ";\n" + "\n" + "rule R when\n" + " $p : Person( dummy(age) < 50 ) @watch(!*, age)\n" + "then\n" + " modify($p) { setName( $p.getName()+\"1\" ) };\n" + "end\n"; KieSession ksession = getKieSession( str ); Person p = new Person("Mario", 40); ksession.insert( p ); ksession.fireAllRules(3); assertEquals("Mario1", p.getName()); } }
{ "content_hash": "3f679cbb364cdb35ab6bd2b2c116b91a", "timestamp": "", "source": "github", "line_count": 911, "max_line_length": 132, "avg_line_length": 32.95170142700329, "alnum_prop": 0.45204703687664477, "repo_name": "lanceleverich/drools", "id": "d192508f4c5c4540ffb4a453e20ee374e4c1d642", "size": "30612", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "drools-model/drools-model-compiler/src/test/java/org/drools/modelcompiler/PropertyReactivityTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "15980" }, { "name": "Batchfile", "bytes": "2554" }, { "name": "CSS", "bytes": "1412" }, { "name": "GAP", "bytes": "197299" }, { "name": "HTML", "bytes": "6163" }, { "name": "Java", "bytes": "35717579" }, { "name": "Python", "bytes": "4555" }, { "name": "Ruby", "bytes": "491" }, { "name": "Shell", "bytes": "1120" }, { "name": "XSLT", "bytes": "24302" } ], "symlink_target": "" }
<?xml version="1.0" ?> <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"> <!-- <services> <service id="scheduled_tasks.example" class="ScheduledTasksBundle\Example"> <argument type="service" id="service_id" /> <argument>plain_value</argument> <argument>%parameter_name%</argument> </service> </services> --> </container>
{ "content_hash": "2a0f1610841d00b7571fac865c8c2e12", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 120, "avg_line_length": 36.0625, "alnum_prop": 0.6395147313691508, "repo_name": "isthub/scheduled-tasks-bundle", "id": "45edf8e3b76b651a291391faa173e2827b8a6bcc", "size": "577", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Resources/config/services.xml", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "373613" }, { "name": "HTML", "bytes": "4625" }, { "name": "PHP", "bytes": "43764" }, { "name": "Ruby", "bytes": "926" } ], "symlink_target": "" }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package gid.myunivaq2.service.service; import SPARTA.TassaMatricola; import gid.myunivaq2.jpa.Tassa; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; /** * * @author ASUS TRONY */ @Stateless @Path("tassa") public class TassaFacadeREST extends AbstractFacade<Tassa> { @PersistenceContext(unitName = "GID_MYUNIVAQ2_war_2.0esamePU") private EntityManager em; public TassaFacadeREST() { super(Tassa.class); } @POST @Override @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public void create(Tassa entity) { super.create(entity); } @PUT @Path("{id}") @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public void edit(@PathParam("id") String id, Tassa entity) { super.edit(entity); } @DELETE @Path("{id}") public void remove(@PathParam("id") String id) { super.remove(super.find(id)); } @GET @Path("{id}") @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Tassa find(@PathParam("id") String id) { return super.find(id); } @GET @Path("matricola/{matricola}") @Produces({ MediaType.APPLICATION_JSON}) public Response findmatricola(@PathParam("matricola") String a) throws SQLException { Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/MYUNIVAQ?zeroDateTimeBehavior=convertToNull","root","mysql"); TassaMatricola asd = new TassaMatricola(); List<TassaMatricola> list = asd.TassaMatricolaC(con, a); return Response.ok(list).build(); } @GET @Override @Produces({ MediaType.APPLICATION_JSON}) public List<Tassa> findAll() { return super.findAll(); } @GET @Path("{from}/{to}") @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public List<Tassa> findRange(@PathParam("from") Integer from, @PathParam("to") Integer to) { return super.findRange(new int[]{from, to}); } @GET @Path("count") @Produces(MediaType.TEXT_PLAIN) public String countREST() { return String.valueOf(super.count()); } @Override protected EntityManager getEntityManager() { return em; } }
{ "content_hash": "4ef390e7d0fd118bc342cb77b5a6f92f", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 142, "avg_line_length": 27.064814814814813, "alnum_prop": 0.6763599042080055, "repo_name": "simoleo95/progettoMobile", "id": "d6e789ea9e60c00bb0985a305fcd7f83d3a6aceb", "size": "2923", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MYUNIVAQ2/src/main/java/gid/myunivaq2/service/service/TassaFacadeREST.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "42090" }, { "name": "CSS", "bytes": "19034" }, { "name": "HTML", "bytes": "2363438" }, { "name": "Java", "bytes": "300967" }, { "name": "JavaScript", "bytes": "715" }, { "name": "Shell", "bytes": "73180" }, { "name": "TypeScript", "bytes": "55354" }, { "name": "XSLT", "bytes": "4615" } ], "symlink_target": "" }
.d-accordion { box-sizing: border-box; position: relative; overflow: auto; display: flex; align-items: stretch; flex-direction: column; } .d-accordion-header { display: flex; border: 2px solid; padding: 10px 15px; font-weight: bold; border-radius: 0; border-color: #dddddd; color: #333333; background-color: #f5f5f5; } .d-accordion-header .d-header-label-button { flex: 1; border: none; background: none; padding: 0; color: inherit; font: inherit; text-align: inherit; } .d-accordion-header:hover { background-color: #e1e1e1; border-color: #bebebe; } .d-accordion-header.d-open { background-color: #428bca; border-color: #428bca; border-bottom-width: 1px; color: #ffffff; } .d-accordion-header.d-open:hover { background-color: #72a8d7; border-color: #3071a9; } .d-accordion > [role=region] { border: solid 2px #dddddd; border-top: none; border-radius: 0; } [role=region].d-accordion-open-panel { border-color: #428bca; flex: 1; } @keyframes d-accordion-open-animation { from { flex: 0.0001; } to { flex: 1; } } @-webkit-keyframes d-accordion-open-animation { from { flex: 0.0001; } to { flex: 1; } } [role=region].d-accordion-open-animation { animation-name: d-accordion-open-animation; animation-duration: .3s; animation-fill-mode: forwards; animation-timing-function: linear; -webkit-animation-name: d-accordion-open-animation; -webkit-animation-duration: .3s; -webkit-animation-fill-mode: forwards; -webkit-animation-timing-function: linear; overflow: hidden; } @keyframes d-accordion-close-animation { from { flex: 1; } to { flex: 0.0001; } } @-webkit-keyframes d-accordion-close-animation { from { flex: 1; } to { flex: 0.0001; } } [role=region].d-accordion-close-animation { animation-name: d-accordion-close-animation; animation-duration: .3s; animation-fill-mode: forwards; animation-timing-function: linear; -webkit-animation-name: d-accordion-close-animation; -webkit-animation-duration: .3s; -webkit-animation-fill-mode: forwards; -webkit-animation-timing-function: linear; overflow: hidden; }
{ "content_hash": "c9d24d4abcc854212338a815750a6d09", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 54, "avg_line_length": 20.89423076923077, "alnum_prop": 0.6801656695812242, "repo_name": "xblox/control-freak", "id": "a199194177e1de4c7376bdc9de6f227910216737", "size": "2173", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "Code/client/src/lib/xibm/ibm/deliteful/Accordion/themes/ios/Accordion.css", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "767" }, { "name": "CSS", "bytes": "3187385" }, { "name": "HTML", "bytes": "544608" }, { "name": "JavaScript", "bytes": "17657439" }, { "name": "Python", "bytes": "9278" }, { "name": "Shell", "bytes": "2710" } ], "symlink_target": "" }
/* this file has been autogenerated by vtkNodeJsWrap */ /* editing this might proof futile */ #define VTK_WRAPPING_CXX #define VTK_STREAMS_FWD_ONLY #include <nan.h> #include "vtkImageAlgorithmWrap.h" #include "vtkPointLoadWrap.h" #include "vtkObjectBaseWrap.h" #include "../../plus/plus.h" using namespace v8; extern Nan::Persistent<v8::Object> vtkNodeJsNoWrap; Nan::Persistent<v8::FunctionTemplate> VtkPointLoadWrap::ptpl; VtkPointLoadWrap::VtkPointLoadWrap() { } VtkPointLoadWrap::VtkPointLoadWrap(vtkSmartPointer<vtkPointLoad> _native) { native = _native; } VtkPointLoadWrap::~VtkPointLoadWrap() { } void VtkPointLoadWrap::Init(v8::Local<v8::Object> exports) { Nan::SetAccessor(exports, Nan::New("vtkPointLoad").ToLocalChecked(), ConstructorGetter); Nan::SetAccessor(exports, Nan::New("PointLoad").ToLocalChecked(), ConstructorGetter); } void VtkPointLoadWrap::ConstructorGetter( v8::Local<v8::String> property, const Nan::PropertyCallbackInfo<v8::Value>& info) { InitPtpl(); info.GetReturnValue().Set(Nan::New(ptpl)->GetFunction()); } void VtkPointLoadWrap::InitPtpl() { if (!ptpl.IsEmpty()) return; v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New); VtkImageAlgorithmWrap::InitPtpl( ); tpl->Inherit(Nan::New<FunctionTemplate>(VtkImageAlgorithmWrap::ptpl)); tpl->SetClassName(Nan::New("VtkPointLoadWrap").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); Nan::SetPrototypeMethod(tpl, "ComputeEffectiveStressOff", ComputeEffectiveStressOff); Nan::SetPrototypeMethod(tpl, "computeEffectiveStressOff", ComputeEffectiveStressOff); Nan::SetPrototypeMethod(tpl, "ComputeEffectiveStressOn", ComputeEffectiveStressOn); Nan::SetPrototypeMethod(tpl, "computeEffectiveStressOn", ComputeEffectiveStressOn); Nan::SetPrototypeMethod(tpl, "GetComputeEffectiveStress", GetComputeEffectiveStress); Nan::SetPrototypeMethod(tpl, "getComputeEffectiveStress", GetComputeEffectiveStress); Nan::SetPrototypeMethod(tpl, "GetLoadValue", GetLoadValue); Nan::SetPrototypeMethod(tpl, "getLoadValue", GetLoadValue); Nan::SetPrototypeMethod(tpl, "GetModelBounds", GetModelBounds); Nan::SetPrototypeMethod(tpl, "getModelBounds", GetModelBounds); Nan::SetPrototypeMethod(tpl, "GetPoissonsRatio", GetPoissonsRatio); Nan::SetPrototypeMethod(tpl, "getPoissonsRatio", GetPoissonsRatio); Nan::SetPrototypeMethod(tpl, "GetSampleDimensions", GetSampleDimensions); Nan::SetPrototypeMethod(tpl, "getSampleDimensions", GetSampleDimensions); Nan::SetPrototypeMethod(tpl, "NewInstance", NewInstance); Nan::SetPrototypeMethod(tpl, "newInstance", NewInstance); Nan::SetPrototypeMethod(tpl, "SafeDownCast", SafeDownCast); Nan::SetPrototypeMethod(tpl, "safeDownCast", SafeDownCast); Nan::SetPrototypeMethod(tpl, "SetComputeEffectiveStress", SetComputeEffectiveStress); Nan::SetPrototypeMethod(tpl, "setComputeEffectiveStress", SetComputeEffectiveStress); Nan::SetPrototypeMethod(tpl, "SetLoadValue", SetLoadValue); Nan::SetPrototypeMethod(tpl, "setLoadValue", SetLoadValue); Nan::SetPrototypeMethod(tpl, "SetModelBounds", SetModelBounds); Nan::SetPrototypeMethod(tpl, "setModelBounds", SetModelBounds); Nan::SetPrototypeMethod(tpl, "SetPoissonsRatio", SetPoissonsRatio); Nan::SetPrototypeMethod(tpl, "setPoissonsRatio", SetPoissonsRatio); Nan::SetPrototypeMethod(tpl, "SetSampleDimensions", SetSampleDimensions); Nan::SetPrototypeMethod(tpl, "setSampleDimensions", SetSampleDimensions); #ifdef VTK_NODE_PLUS_VTKPOINTLOADWRAP_INITPTPL VTK_NODE_PLUS_VTKPOINTLOADWRAP_INITPTPL #endif ptpl.Reset( tpl ); } void VtkPointLoadWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info) { if(!info.IsConstructCall()) { Nan::ThrowError("Constructor not called in a construct call."); return; } if(info.Length() == 0) { vtkSmartPointer<vtkPointLoad> native = vtkSmartPointer<vtkPointLoad>::New(); VtkPointLoadWrap* obj = new VtkPointLoadWrap(native); obj->Wrap(info.This()); } else { if(info[0]->ToObject() != vtkNodeJsNoWrap ) { Nan::ThrowError("Parameter Error"); return; } } info.GetReturnValue().Set(info.This()); } void VtkPointLoadWrap::ComputeEffectiveStressOff(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } native->ComputeEffectiveStressOff(); } void VtkPointLoadWrap::ComputeEffectiveStressOn(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } native->ComputeEffectiveStressOn(); } void VtkPointLoadWrap::GetComputeEffectiveStress(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); int r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetComputeEffectiveStress(); info.GetReturnValue().Set(Nan::New(r)); } void VtkPointLoadWrap::GetLoadValue(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); double r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetLoadValue(); info.GetReturnValue().Set(Nan::New(r)); } void VtkPointLoadWrap::GetModelBounds(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); double const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetModelBounds(); Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 6 * sizeof(double)); Local<v8::Float64Array> at = v8::Float64Array::New(ab, 0, 6); memcpy(ab->GetContents().Data(), r, 6 * sizeof(double)); info.GetReturnValue().Set(at); } void VtkPointLoadWrap::GetPoissonsRatio(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); double r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetPoissonsRatio(); info.GetReturnValue().Set(Nan::New(r)); } void VtkPointLoadWrap::GetSampleDimensions(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); int const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetSampleDimensions(); Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 3 * sizeof(int)); Local<v8::Int32Array> at = v8::Int32Array::New(ab, 0, 3); memcpy(ab->GetContents().Data(), r, 3 * sizeof(int)); info.GetReturnValue().Set(at); } void VtkPointLoadWrap::NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); vtkPointLoad * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->NewInstance(); VtkPointLoadWrap::InitPtpl(); v8::Local<v8::Value> argv[1] = { Nan::New(vtkNodeJsNoWrap) }; v8::Local<v8::Function> cons = Nan::New<v8::FunctionTemplate>(VtkPointLoadWrap::ptpl)->GetFunction(); v8::Local<v8::Object> wo = cons->NewInstance(1, argv); VtkPointLoadWrap *w = new VtkPointLoadWrap(); w->native = r; w->Wrap(wo); info.GetReturnValue().Set(wo); } void VtkPointLoadWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectBaseWrap::ptpl))->HasInstance(info[0])) { VtkObjectBaseWrap *a0 = ObjectWrap::Unwrap<VtkObjectBaseWrap>(info[0]->ToObject()); vtkPointLoad * r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->SafeDownCast( (vtkObjectBase *) a0->native.GetPointer() ); VtkPointLoadWrap::InitPtpl(); v8::Local<v8::Value> argv[1] = { Nan::New(vtkNodeJsNoWrap) }; v8::Local<v8::Function> cons = Nan::New<v8::FunctionTemplate>(VtkPointLoadWrap::ptpl)->GetFunction(); v8::Local<v8::Object> wo = cons->NewInstance(1, argv); VtkPointLoadWrap *w = new VtkPointLoadWrap(); w->native = r; w->Wrap(wo); info.GetReturnValue().Set(wo); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointLoadWrap::SetComputeEffectiveStress(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsInt32()) { if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetComputeEffectiveStress( info[0]->Int32Value() ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointLoadWrap::SetLoadValue(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsNumber()) { if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetLoadValue( info[0]->NumberValue() ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointLoadWrap::SetModelBounds(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); size_t i; if(info.Length() > 0 && info[0]->IsFloat64Array()) { v8::Local<v8::Float64Array>a0(v8::Local<v8::Float64Array>::Cast(info[0]->ToObject())); if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetModelBounds( (double *)(a0->Buffer()->GetContents().Data()) ); return; } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); double b0[6]; if( a0->Length() < 6 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 6; i++ ) { if( !a0->Get(i)->IsNumber() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->NumberValue(); } if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetModelBounds( b0 ); return; } else if(info.Length() > 0 && info[0]->IsNumber()) { if(info.Length() > 1 && info[1]->IsNumber()) { if(info.Length() > 2 && info[2]->IsNumber()) { if(info.Length() > 3 && info[3]->IsNumber()) { if(info.Length() > 4 && info[4]->IsNumber()) { if(info.Length() > 5 && info[5]->IsNumber()) { if(info.Length() != 6) { Nan::ThrowError("Too many parameters."); return; } native->SetModelBounds( info[0]->NumberValue(), info[1]->NumberValue(), info[2]->NumberValue(), info[3]->NumberValue(), info[4]->NumberValue(), info[5]->NumberValue() ); return; } } } } } } Nan::ThrowError("Parameter mismatch"); } void VtkPointLoadWrap::SetPoissonsRatio(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsNumber()) { if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetPoissonsRatio( info[0]->NumberValue() ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPointLoadWrap::SetSampleDimensions(const Nan::FunctionCallbackInfo<v8::Value>& info) { VtkPointLoadWrap *wrapper = ObjectWrap::Unwrap<VtkPointLoadWrap>(info.Holder()); vtkPointLoad *native = (vtkPointLoad *)wrapper->native.GetPointer(); size_t i; if(info.Length() > 0 && info[0]->IsInt32Array()) { v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject())); if( a0->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetSampleDimensions( (int *)(a0->Buffer()->GetContents().Data()) ); return; } else if(info.Length() > 0 && info[0]->IsArray()) { v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject())); int b0[3]; if( a0->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a0->Get(i)->IsInt32() ) { Nan::ThrowError("Array contents invalid."); return; } b0[i] = a0->Get(i)->Int32Value(); } if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->SetSampleDimensions( b0 ); return; } else if(info.Length() > 0 && info[0]->IsInt32()) { if(info.Length() > 1 && info[1]->IsInt32()) { if(info.Length() > 2 && info[2]->IsInt32()) { if(info.Length() != 3) { Nan::ThrowError("Too many parameters."); return; } native->SetSampleDimensions( info[0]->Int32Value(), info[1]->Int32Value(), info[2]->Int32Value() ); return; } } } Nan::ThrowError("Parameter mismatch"); }
{ "content_hash": "eb84ed916d145365eadf6a1a6e27c71e", "timestamp": "", "source": "github", "line_count": 498, "max_line_length": 106, "avg_line_length": 28.734939759036145, "alnum_prop": 0.6891684136967156, "repo_name": "axkibe/node-vtk", "id": "2a0e8b3a7a4a7f881d4ade0a6e48c9e4410e5601", "size": "14310", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wrappers/8.1.1/vtkPointLoadWrap.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C++", "bytes": "75388342" }, { "name": "CMake", "bytes": "915" }, { "name": "JavaScript", "bytes": "70" }, { "name": "Roff", "bytes": "145455" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- #%L Bobcat %% Copyright (C) 2016 Cognifide Ltd. %% 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. #L% --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.cognifide.qa.bb</groupId> <artifactId>bobcat</artifactId> <version>2.3.1-SNAPSHOT</version> </parent> <artifactId>bb-email</artifactId> <name>Bobcat Email</name> <dependencies> <dependency> <groupId>com.google.inject</groupId> <artifactId>guice</artifactId> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-email</artifactId> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> </dependency> <!-- logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <!-- tests --> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-params</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-core</artifactId> </dependency> <dependency> <groupId>com.icegreen</groupId> <artifactId>greenmail</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.rat</groupId> <artifactId>apache-rat-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> </plugin> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> </plugin> </plugins> </build> </project>
{ "content_hash": "eff3f9e170ddceed7da8a0bb0b900e10", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 204, "avg_line_length": 32.735849056603776, "alnum_prop": 0.5829971181556196, "repo_name": "Cognifide/bobcat", "id": "af4628caddcf0b87bbb429f58a4d3e19c372f485", "size": "3470", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bb-email/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "908281" }, { "name": "Shell", "bytes": "1044" } ], "symlink_target": "" }
+++ title = "Query Key-Frame Info from Video Stream using FFprobe" description = "使用 ffprobe 获取视频中的关键帧信息命令如下:`ffprobe -loglevel error -hide_banner -select_streams v -skip_frame nokey -show_frames -show_entries frame=pict_type -of json=compact=1 input.avi`" date = 2019-09-09T09:52:45+08:00 draft = false template = "page.html" [taxonomies] categories = ["Streaming"] tags = ["ffprobe", "key-frame", "note"] +++ 使用 [ffprobe](https://ffmpeg.org/ffprobe.html) 获取视频中的关键帧信息命令如下: ```sh ffprobe -loglevel error -hide_banner -select_streams v -skip_frame nokey -show_frames -show_entries frame=pict_type -of json=compact=1 input.avi ffprobe -loglevel error -hide_banner -select_streams v -show_format -show_frames -show_entries frame=pict_t ype:format=filename,duration,size:format_tags= -show_streams -of json=compact=1 input.mp4 ``` [ffprobe](https://ffmpeg.org/ffprobe.html) 的更多用法请参考[其文档](https://ffmpeg.org/ffprobe-all.html) 。 <!-- more --> --- 以上。
{ "content_hash": "013a22d75c6462cc34394040cf922a55", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 197, "avg_line_length": 36.65384615384615, "alnum_prop": 0.7324239244491081, "repo_name": "wbprime/wbpages", "id": "28de53f0caaa22f6b5e713ff8f718532e14aec68", "size": "1055", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "content/posts/2019-09-09-ffprobe-note-query-key-frame-info/index.md", "mode": "33188", "license": "mit", "language": [ { "name": "Awk", "bytes": "1629" }, { "name": "HTML", "bytes": "524730" }, { "name": "Java", "bytes": "32094" }, { "name": "Shell", "bytes": "22662" } ], "symlink_target": "" }
YAHOO.namespace("ez"); YAHOO.ez.BlockDD = function() { var cfg = {}; var Dom = YAHOO.util.Dom; var Event = YAHOO.util.Event; var DDM = YAHOO.util.DragDropMgr; YAHOO.ez.DDList = function(id, sGroup, config) { YAHOO.ez.DDList.superclass.constructor.call(this, id, sGroup, config); var el = this.getDragEl(); Dom.setStyle(el, "opacity", 0.67); this.goingUp = false; this.lastY = 0; }; YAHOO.extend(YAHOO.ez.DDList, YAHOO.util.DDProxy, { startDrag: function(x, y) { var dragEl = this.getDragEl(); var clickEl = this.getEl(); Dom.setStyle(clickEl, "visibility", "hidden"); dragEl.innerHTML = clickEl.innerHTML; Dom.setStyle(dragEl, "color", Dom.getStyle(clickEl, "color")); Dom.setStyle(dragEl, "backgroundColor", Dom.getStyle(clickEl, "backgroundColor")); Dom.setStyle(dragEl, "border", "2px solid gray"); }, endDrag: function(e) { var srcEl = this.getEl(); var proxy = this.getDragEl(); Dom.setStyle(proxy, "visibility", ""); var a = new YAHOO.util.Motion( proxy, { points: { to: Dom.getXY(srcEl) } }, 0.2, YAHOO.util.Easing.easeOut); var proxyid = proxy.id; var thisid = this.id; a.onComplete.subscribe(function() { Dom.setStyle(proxyid, "visibility", "hidden"); Dom.setStyle(thisid, "visibility", ""); //clear the time left of items in rotation queue var tableBody = srcEl.parentNode; var timeLeft = Dom.getElementsByClassName("rotation-time-left", "span", tableBody); for (i=0;i<timeLeft.length;i++){ timeLeft[i].innerHTML=""; } }); a.animate(); var tableBody = srcEl.parentNode; var postData = "", _tokenNode = document.getElementById('ezxform_token_js'); if ( _tokenNode ) { postData = 'ezxform_token=' + _tokenNode.getAttribute('title') + '&'; } var items = Dom.getElementsByClassName("handler", "td", tableBody); for (i=0;i<items.length;i++) { postData += "Items%5B%5D=" + items[i].id + "&"; } var tableID = tableBody.parentNode.id; postData += "Block=" + tableID + "&ContentObjectAttributeID=" + cfg.attributeid + "&Version=" + cfg.version; YAHOO.util.Connect.asyncRequest( 'POST', cfg.url, '', postData ); }, onDragDrop: function(e, id) { if (DDM.interactionInfo.drop.length === 1) { var pt = DDM.interactionInfo.point; var region = DDM.interactionInfo.sourceRegion; if (!region.intersect(pt)) { var destEl = Dom.get(id); var srcEl = this.getEl(); var destDD = DDM.getDDById(id); var srcTargetID = srcEl.parentNode.parentNode.id; var destTargetID = destEl.parentNode.parentNode.id; if(srcTargetID == destTargetID) { destEl.appendChild(this.getEl()); destDD.isEmpty = false; } DDM.refreshCache(); } } }, onDrag: function(e) { var y = Event.getPageY(e); if (y < this.lastY) { this.goingUp = true; } else if (y > this.lastY) { this.goingUp = false; } this.lastY = y; }, onDragOver: function(e, id) { var srcEl = this.getEl(); var destEl = Dom.get(id); var srcTargetID = srcEl.parentNode.parentNode.id; var destTargetID = destEl.parentNode.parentNode.id; if (destEl.nodeName.toLowerCase() == "tr" && srcTargetID == destTargetID) { var orig_p = srcEl.parentNode; var p = destEl.parentNode; if (this.goingUp) { p.insertBefore(srcEl, destEl); } else { p.insertBefore(srcEl, destEl.nextSibling); } DDM.refreshCache(); } } }); return { init: function() { this.initCfg(); this.initDragHandlers(); }, initDragHandlers: function() { var qTable = Dom.getElementsByClassName("queue", "table", "zone-tabs-container"); var oTable = Dom.getElementsByClassName("online", "table", "zone-tabs-container"); for(var i = 0; i < qTable.length; i+=1) { new YAHOO.util.DDTarget(qTable[i].id); var qItems = Dom.getElementsByClassName("handler", "td", qTable[i].id); for(var j = 0; j < qItems.length; j+=1) { new YAHOO.ez.DDList(qItems[j].parentNode.id); } } for(var i = 0; i < oTable.length; i+=1) { new YAHOO.util.DDTarget(oTable[i].id); var oItems = Dom.getElementsByClassName("handler", "td", oTable[i].id); for(var j = 0; j < oItems.length; j+=1) { new YAHOO.ez.DDList(oItems[j].parentNode.id); } } }, initCfg: function() { cfg = this.cfg; }, cfg: {} }; }(); // function taken from the modernizr library YAHOO.ez.hasStorage = (function() { var mod = '_ez_ls_check'; try { localStorage.setItem(mod, mod); localStorage.removeItem(mod); return true; } catch(e) { return false; } }()); YAHOO.ez.BlockCollapse = function(){ var Dom = YAHOO.util.Dom, Event = YAHOO.util.Event, Cookie; if ( !YAHOO.ez.hasStorage ) { Cookie = YAHOO.util.Cookie; } var getTriggers = function() { var emTriggers = Dom.getElementsByClassName( "trigger", "em", "zone-tabs-container" ); var aTriggers = Dom.getElementsByClassName( "trigger", "a", "zone-tabs-container" ); var buttonTriggers = Dom.getElementsByClassName( "trigger", "button", "zone-tabs-container" ); var triggers = emTriggers.concat(aTriggers).concat(buttonTriggers); return triggers; }; var exec = function() { var triggers = getTriggers(); for( var i = 0; i < triggers.length; i++ ) { var triggerEl = triggers[i]; setTriggerEvent(triggerEl); if(triggerEl.nodeName.toLowerCase() === "em") { updateBlockView(triggerEl); } } }; var setTriggerEvent = function(o) { Event.purgeElement(o); Event.on(o, "click", triggerAction, o, true); }; var getBlockContainer = function(o) { var currentEl = o; var isContainer = false; while(!isContainer) { if( Dom.hasClass(currentEl, "block-container") ) { isContainer = true; } else { currentEl = currentEl.parentNode; } } return currentEl; } var getCollapsedEl = function(o) { var blockContainer = getBlockContainer(o); var collapsedEl = Dom.getElementsByClassName("collapsed", "div", blockContainer)[0]; return collapsedEl; }; var getExpandedEl = function(o) { var blockContainer = getBlockContainer(o); var expandedEl = Dom.getElementsByClassName("expanded", "div", blockContainer)[0]; return expandedEl; }; var getBlockID = function(o) { var blockContainer = getBlockContainer(o); var id = blockContainer.id; return id; }; function setStorageItem(item) { if( YAHOO.ez.hasStorage ){ localStorage.setItem( "eZPBS_" + item, "1" ); } else{ Cookie.setSub("eZPageBlockState", item, "0", {path: "/"}); } }; function removeStorageItem(item) { if( YAHOO.ez.hasStorage ){ localStorage.removeItem( "eZPBS_" + item ); } else{ Cookie.removeSub("eZPageBlockState", item, {path: "/"}); } }; function getStorageItemState(item) { if( YAHOO.ez.hasStorage ){ return ( localStorage.getItem( "eZPBS_" + item ) === null )? "0" : "1"; } else if (Cookie){ return (Cookie.getSub("eZPageBlockState", item) === null)? "0" : "1"; } else{ return "0"; } }; var expandBlock = function(o) { Dom.replaceClass(o,"expand", "collapse" ); var collapsedEl = getCollapsedEl(o); if(collapsedEl) { Dom.replaceClass( collapsedEl, "collapsed", "expanded" ); } // we save only expanded blocks setStorageItem(getBlockID(o)); }; var collapseBlock = function(o) { Dom.replaceClass( o, "collapse", "expand" ); var expandedEl = getExpandedEl(o); if(expandedEl) { Dom.replaceClass( expandedEl, "expanded", "collapsed" ); } removeStorageItem(getBlockID(o)); }; var updateBlockView = function(o) { var state = getStorageItemState(getBlockID(o)); if(state == "1") { expandBlock(o); } else { collapseBlock(o); } }; var expandAll = function() { var triggers = getTriggers(); for( var i = 0; i < triggers.length; i++ ) { var triggerEl = triggers[i]; if(triggerEl.nodeName.toLowerCase() == "em") { expandBlock(triggerEl); } } }; var collapseAll = function() { var triggers = getTriggers(); for( var i = 0; i < triggers.length; i++ ) { var triggerEl = triggers[i]; if(triggerEl.nodeName.toLowerCase() == "em") { collapseBlock(triggerEl); } } }; var triggerAction = function(e, triggerEl) { if( Dom.hasClass( triggerEl, "expand" ) ) { expandBlock(triggerEl); } else if( Dom.hasClass( triggerEl, "collapse" ) ) { collapseBlock(triggerEl); } else if( Dom.hasClass( triggerEl, "expand-all" ) ) { expandAll(); } else if( Dom.hasClass( triggerEl, "collapse-all" ) ) { collapseAll(); } Event.preventDefault(e); }; return { init: function() { exec(); } }; }(); var BlockDDInit = function() { YUI( YUI3_config ).use('dd-constrain', 'dd-proxy', 'dd-drop', 'io-ez', function(Y) { Y.DD.DDM.on('drop:over', function(e) { var drag = e.drag.get('node'), drop = e.drop.get('node'); if (drop.get('tagName').toLowerCase() === 'div' && drop.get('parentNode').get('id') === drag.get('parentNode').get('id') ) { if (!goingUp) { var dropSibling = drop.get('nextSibling'); if (!dropSibling) { drop.get('parentNode').append(drag); } else { drop.get('parentNode').insertBefore(drag, dropSibling); } } else { drop.get('parentNode').insertBefore(drag, drop); } e.drop.sizeShim(); } }); Y.DD.DDM.on('drag:drag', function(e) { var y = e.target.lastXY[1]; if (y < lastY) { goingUp = true; } else { goingUp = false; } lastY = y; }); Y.DD.DDM.on('drag:start', function(e) { var drag = e.target; drag.get('node').setStyle('opacity', '.25'); drag.get('dragNode').appendChild( Y.Node.create( '<div></div>' ).addClass( 'block-container' ).set('innerHTML', drag.get('node').get('innerHTML') ) ); drag.get('dragNode').setStyles({ opacity: '.5', borderColor: drag.get('node').getStyle('borderColor'), backgroundColor: drag.get('node').getStyle('backgroundColor') }); }); Y.DD.DDM.on('drag:end', function(e) { var drag = e.target; drag.get('node').setStyles({ visibility: '', opacity: '1' }); drag.get('dragNode').set('innerHTML', ''); var blocks = Y.Node.all( '#'+ drag.get('node').get('parentNode').get('id') + ' .block-container' ); var data = ''; blocks.each( function(v, k) { data += 'block_order%5B%5D=' + v.get('id'); data += '&'; } ); data += 'contentobject_attribute_id=' + BlockDDInit.cfg.attributeid; data += '&version=' + BlockDDInit.cfg.version; data += '&zone=' + BlockDDInit.cfg.zone; Y.io.ez( 'ezflow::updateblockorder', { on: { success: _callBack }, method: 'POST', data: data } ); var newOrder = drag.get('node').get('parentNode').all('.block-container'); var index = 0; newOrder.each(function(v, k) { var inputList = v.all('.block-control'); for(var i = 0; i < inputList.size(); i++) { var input = inputList.item(i); var name = input.get('name'); if( name.match(/([a-z]+)+_([\d]+)\[([\d]+)\]\[([\d]+)\]/) ) { name = name.replace( /([a-z]+)+_([\d]+)\[([\d]+)\]\[([\d]+)\]/, "$1_$2[$3][" + index + "]" ); } else if ( name.match(/([a-zA-Z+]+)\[([\d-\w_]+)-([\d]+)+(-[\w_]+)?\]/) ) { name = name.replace( /([a-zA-Z+]+)\[([\d-\w_]+)-([\d]+)+(-[\w_]+)?\]/, "$1[$2-" + index + "$4]" ); } else if ( name.match(/([a-zA-Z]+)+\_+([0-9])/) ) { name = name.replace( /([a-zA-Z]+)+\_+([0-9])/, "$1_" + index ); } input.set('name', name); } index++; }); }); Y.DD.DDM.on('drag:drophit', function(e) { var drop = e.drop.get('node'), drag = e.drag.get('node'); if (drop.get('tagName').toLowerCase() !== 'div' && drop.get('id') !== drag.get('parentNode').get('id') ) { if (!drop.contains(drag)) { drop.appendChild(drag); } } }); function _callBack( id, o ) { } var goingUp = false, lastY = 0; var dragList = Y.Node.all('#zone-' + BlockDDInit.cfg.zone + '-blocks .block-container'); dragList.each(function(v, k) { var dd = new Y.DD.Drag({ node: v, target: { padding: '0' } }).plug(Y.Plugin.DDProxy, { moveOnEnd: false }).plug(Y.Plugin.DDConstrained, { constrain2node: '#zone-' + BlockDDInit.cfg.zone + '-blocks' }); // Workround for Safari 4.0.2 // TODO: Remove after 3.0.0 GA release dd.addInvalid('select'); }); var dropList = Y.Node.all('#zone-' + BlockDDInit.cfg.zone + '-blocks'); dropList.each(function(v, k) { var drop = new Y.DD.Drop({ node: v }); }); }); }
{ "content_hash": "14a2b4f0df231f844a2189eb8aafd9b4", "timestamp": "", "source": "github", "line_count": 514, "max_line_length": 162, "avg_line_length": 31.46887159533074, "alnum_prop": 0.46775888717156106, "repo_name": "SnceGroup/snce-website", "id": "fcc47bab59c41009200af0be893b99b1235d6e1d", "size": "16175", "binary": false, "copies": "18", "ref": "refs/heads/master", "path": "web/var/storage/packages/eZ-systems/ezflow_extension/ezextension/ezflow/design/standard/javascript/blocktools.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
namespace BankAccounts { using System; public class Mortgage : Account, IDepositeMoney { private const int CompanyHolderNumberOfMonths = 12; private const int IndividualHolderNumberOfMonths = 6; private const decimal LackOfInterestAmount = 0.0m; public Mortgage(Customers currentCustomer, decimal currentBalance, decimal currentInterestRate) : base(currentCustomer, currentBalance, currentInterestRate) { } public override decimal CalculateInterestAmount(int months) { if (months < 0) { throw new ArgumentException(); } if (this.Customer == Customers.Companies) { if (months <= CompanyHolderNumberOfMonths) { return (this.Interest / 2) * months; } else { decimal amountPartOne = (this.Interest / 2) * CompanyHolderNumberOfMonths; decimal amountPartTwo = this.Interest * (months - CompanyHolderNumberOfMonths); return amountPartOne + amountPartTwo; } } else { if (months <= IndividualHolderNumberOfMonths) { return LackOfInterestAmount; } else { return (months - IndividualHolderNumberOfMonths) * this.Interest; } } } public void DepositeMoney(decimal amount) { this.Balance += amount; } } }
{ "content_hash": "7f09fc86a1c1a1b1da7d8b62521cf67d", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 103, "avg_line_length": 30.363636363636363, "alnum_prop": 0.5149700598802395, "repo_name": "DimitarSD/Telerik-Academy", "id": "d2e649b57c46063b5354603fee9ec8cd3b38f2a2", "size": "1672", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "01. Programming/03. Object-Oriented Programming [C#]/05. OOP Principles Part Two/BankAccounts/Mortgage.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "324" }, { "name": "C#", "bytes": "1637823" }, { "name": "CSS", "bytes": "121271" }, { "name": "CoffeeScript", "bytes": "4643" }, { "name": "HTML", "bytes": "665465" }, { "name": "Java", "bytes": "7842" }, { "name": "JavaScript", "bytes": "1453926" }, { "name": "Objective-C", "bytes": "8928" }, { "name": "SQLPL", "bytes": "941" }, { "name": "XSLT", "bytes": "3924" } ], "symlink_target": "" }
"""AppAssure 5 Core API""" from appassure.api import AppAssureAPI class IDiagnosticsManagement(AppAssureAPI): """Full documentation online at http://docs.appassure.com/display/AA50D/IDiagnosticsManagement """ def executeRemoteCommand(self, data): """Executes an arbitrary remote command.""" return self.session.request('diag/command/', 'POST', self.getXML(data, 'remoteCommand')) def readFile(self, path): """Reads a file from the local file system and streams it back to the client. """ return self.session.request('diag/files/?q=%s' % (path)) def getLog(self): """Gets the entire contents of the replay.log file.""" return self.session.request('diag/log/') def getLogSession(self): """Packages the current log session and returns it as a byte stream. The contents of the stream is a Gibraltar .glp file. """ return self.session.request('diag/logSession/') def uploadLogSessions(self): """Uploads the current log session to the Gibraltar (http:// www.gibraltarsoftware.com/) logging framework. """ return self.session.request('diag/logSession/', 'POST') def restartService(self): """Stops, forcibly kills (if necessary), and re-starts the service. """ return self.session.request('diag/service/', 'DELETE')
{ "content_hash": "df7ac67bf0372657978ceb7f9a218182", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 66, "avg_line_length": 33.86046511627907, "alnum_prop": 0.6263736263736264, "repo_name": "rshipp/python-appassure", "id": "99b0864422153782a337b28d0176aad80ef9d292", "size": "1456", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "appassure/core/IDiagnosticsManagement.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "174855" } ], "symlink_target": "" }
--[[ Copyright 2016 Marek Vavrusa <mvavrusa@cloudflare.com> 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. ]] -- This is a tiny wrapper over libelf to extract load address -- and offsets of dynamic symbols local S = require('syscall') local ffi = require('ffi') ffi.cdef [[ /* Type for a 16-bit quantity. */ typedef uint16_t Elf32_Half; typedef uint16_t Elf64_Half; /* Types for signed and unsigned 32-bit quantities. */ typedef uint32_t Elf32_Word; typedef int32_t Elf32_Sword; typedef uint32_t Elf64_Word; typedef int32_t Elf64_Sword; /* Types for signed and unsigned 64-bit quantities. */ typedef uint64_t Elf32_Xword; typedef int64_t Elf32_Sxword; typedef uint64_t Elf64_Xword; typedef int64_t Elf64_Sxword; /* Type of addresses. */ typedef uint32_t Elf32_Addr; typedef uint64_t Elf64_Addr; /* Type of file offsets. */ typedef uint32_t Elf32_Off; typedef uint64_t Elf64_Off; /* Type for section indices, which are 16-bit quantities. */ typedef uint16_t Elf32_Section; typedef uint16_t Elf64_Section; /* Constants */ struct Elf_Cmd { static const int READ = 1; static const int RDWR = 2; static const int WRITE = 3; static const int CLR = 4; static const int SET = 5; static const int FDDONE = 6; static const int FDREAD = 7; static const int READ_MMAP = 8; static const int RDWR_MMAP = 9; static const int WRITE_MMAP =10; static const int READ_MMAP_PRIVATE =11; static const int EMPTY =12; static const int NUM =13; }; /* Descriptor for the ELF file. */ typedef struct Elf Elf; /* Descriptor for ELF file section. */ typedef struct Elf_Scn Elf_Scn; /* Container type for metatable */ struct Elf_object { int fd; Elf *elf; }; /* Program segment header. */ typedef struct { Elf64_Word p_type; /* Segment type */ Elf64_Word p_flags; /* Segment flags */ Elf64_Off p_offset; /* Segment file offset */ Elf64_Addr p_vaddr; /* Segment virtual address */ Elf64_Addr p_paddr; /* Segment physical address */ Elf64_Xword p_filesz; /* Segment size in file */ Elf64_Xword p_memsz; /* Segment size in memory */ Elf64_Xword p_align; /* Segment alignment */ } Elf64_Phdr; typedef Elf64_Phdr GElf_Phdr; /* Section header. */ typedef struct { Elf64_Word sh_name; /* Section name (string tbl index) */ Elf64_Word sh_type; /* Section type */ Elf64_Xword sh_flags; /* Section flags */ Elf64_Addr sh_addr; /* Section virtual addr at execution */ Elf64_Off sh_offset; /* Section file offset */ Elf64_Xword sh_size; /* Section size in bytes */ Elf64_Word sh_link; /* Link to another section */ Elf64_Word sh_info; /* Additional section information */ Elf64_Xword sh_addralign; /* Section alignment */ Elf64_Xword sh_entsize; /* Entry size if section holds table */ } Elf64_Shdr; typedef Elf64_Shdr GElf_Shdr; /* Descriptor for data to be converted to or from memory format. */ typedef struct { void *d_buf; /* Pointer to the actual data. */ int d_type; /* Type of this piece of data. */ unsigned int d_version; /* ELF version. */ size_t d_size; /* Size in bytes. */ uint64_t d_off; /* Offset into section. */ size_t d_align; /* Alignment in section. */ } Elf_Data; /* Symbol table entry. */ typedef struct { Elf64_Word st_name; /* Symbol name (string tbl index) */ unsigned char st_info; /* Symbol type and binding */ unsigned char st_other; /* Symbol visibility */ Elf64_Section st_shndx; /* Section index */ Elf64_Addr st_value; /* Symbol value */ Elf64_Xword st_size; /* Symbol size */ } Elf64_Sym; typedef Elf64_Sym GElf_Sym; /* Coordinate ELF library and application versions. */ unsigned int elf_version (unsigned int __version); /* Return descriptor for ELF file to work according to CMD. */ Elf *elf_begin (int __fildes, int __cmd, Elf *__ref); /* Free resources allocated for ELF. */ int elf_end (Elf *__elf); /* Get the number of program headers in the ELF file. If the file uses more headers than can be represented in the e_phnum field of the ELF header the information from the sh_info field in the zeroth section header is used. */ int elf_getphdrnum (Elf *__elf, size_t *__dst); /* Retrieve program header table entry. */ GElf_Phdr *gelf_getphdr (Elf *__elf, int __ndx, GElf_Phdr *__dst); /* Retrieve section header. */ GElf_Shdr *gelf_getshdr (Elf_Scn *__scn, GElf_Shdr *__dst); /* Retrieve symbol information from the symbol table at the given index. */ GElf_Sym *gelf_getsym (Elf_Data *__data, int __ndx, GElf_Sym *__dst); /* Get section with next section index. */ Elf_Scn *elf_nextscn (Elf *__elf, Elf_Scn *__scn); /* Get data from section while translating from file representation to memory representation. */ Elf_Data *elf_getdata (Elf_Scn *__scn, Elf_Data *__data); /* Return pointer to string at OFFSET in section INDEX. */ char *elf_strptr (Elf *__elf, size_t __index, size_t __offset); ]] local elf = ffi.load('elf') local EV = { NONE=0, CURRENT=1, NUM=2 } local PT = { NULL=0, LOAD=1, DYNAMIC=2, INTERP=3, NOTE=4, SHLIB=5, PHDR=6, TLS=7, NUM=8 } local SHT = { NULL=0, PROGBITS=1, SYMTAB=2, STRTAB=3, RELA=4, HASH=5, DYNAMIC=6, NOTE=7, NOBITS=8, REL=9, SHLIB=10, DYNSYM=11, INIT_ARRAY=14, FINI_ARRAY=15, PREINIT_ARRAY=16, GROUP=17, SYMTAB_SHNDX=18, NUM=19 } local ELF_C = ffi.new('struct Elf_Cmd') local M = {} -- Optional poor man's C++ demangler local cpp_demangler = os.getenv('CPP_DEMANGLER') if not cpp_demangler then for prefix in string.gmatch(os.getenv('PATH'), '[^;:]+') do if S.statfs(prefix..'/c++filt') then cpp_demangler = prefix..'/c++filt' break end end end local cpp_demangle = function (name) return name end if cpp_demangler then cpp_demangle = function (name) local cmd = string.format('%s -p %s', cpp_demangler, name) local fp = assert(io.popen(cmd, 'r')) local output = fp:read('*all') fp:close() return output:match '^(.-)%s*$' end end -- Metatable for ELF object ffi.metatype('struct Elf_object', { __gc = function (t) t:close() end, __index = { close = function (t) if t.elf ~= nil then elf.elf_end(t.elf) S.close(t.fd) t.elf = nil end end, -- Load library load address loadaddr = function(t) local phnum = ffi.new('size_t [1]') if elf.elf_getphdrnum(t.elf, phnum) == nil then return nil, 'cannot get phdrnum' end local header = ffi.new('GElf_Phdr [1]') for i = 0, tonumber(phnum[0])-1 do if elf.gelf_getphdr(t.elf, i, header) ~= nil and header[0].p_type == PT.LOAD then return header[0].p_vaddr end end end, -- Resolve symbol address resolve = function (t, k, pattern) local section = elf.elf_nextscn(t.elf, nil) while section ~= nil do local header = ffi.new('GElf_Shdr [1]') if elf.gelf_getshdr(section, header) ~= nil then if header[0].sh_type == SHT.SYMTAB or header[0].sh_type == SHT.DYNSYM then local data = elf.elf_getdata(section, nil) while data ~= nil do if data.d_size % header[0].sh_entsize > 0 then return nil, 'bad section header entity size' end local symcount = tonumber(data.d_size / header[0].sh_entsize) local sym = ffi.new('GElf_Sym [1]') for i = 0, symcount - 1 do if elf.gelf_getsym(data, i, sym) ~= nil then local name = elf.elf_strptr(t.elf, header[0].sh_link, sym[0].st_name) if name ~= nil then -- Demangle C++ symbols if necessary name = ffi.string(name) if name:sub(1,2) == '_Z' then name = cpp_demangle(name) end -- Match symbol name against pattern if pattern and string.match(name, k) or k == name then return sym[0] end end end end data = elf.elf_getdata(section, data) end end end section = elf.elf_nextscn(t.elf, section) end end, } }) -- Open an ELF object function M.open(path) if elf.elf_version(EV.CURRENT) == EV.NONE then return nil, 'bad version' end local fd, err = S.open(path, 'rdonly') if not fd then return nil, err end local pt = ffi.new('Elf *') pt = elf.elf_begin(fd:getfd(), ELF_C.READ, pt) if not pt then fd:close() return nil, 'cannot open elf object' end return ffi.new('struct Elf_object', fd:nogc():getfd(), pt) end return M
{ "content_hash": "ddb714e0c3e6f4b7d2e3255ec7667d19", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 99, "avg_line_length": 35.804597701149426, "alnum_prop": 0.6199036918138042, "repo_name": "mkacik/bcc", "id": "67838274357bdfbe79ce36d7608dab2c2a9b1e08", "size": "9345", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/lua/bpf/elf.lua", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "107636" }, { "name": "C++", "bytes": "725314" }, { "name": "CMake", "bytes": "27330" }, { "name": "HTML", "bytes": "2979" }, { "name": "LLVM", "bytes": "4379" }, { "name": "Limbo", "bytes": "6069" }, { "name": "Lua", "bytes": "230454" }, { "name": "Makefile", "bytes": "1480" }, { "name": "Objective-C", "bytes": "18609" }, { "name": "Python", "bytes": "297234" }, { "name": "Shell", "bytes": "9137" }, { "name": "Yacc", "bytes": "19817" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>single property - MimeTypeArray class - polymer_app_layout library - Dart API</title> <!-- required because all the links are pseudo-absolute --> <base href="../.."> <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro|Roboto:500,400italic,300,400' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="static-assets/prettify.css"> <link rel="stylesheet" href="static-assets/css/bootstrap.min.css"> <link rel="stylesheet" href="static-assets/styles.css"> <meta name="description" content="API docs for the single property from the MimeTypeArray class, for the Dart programming language."> <link rel="icon" href="static-assets/favicon.png"> <!-- Do not remove placeholder --> <!-- Header Placeholder --> </head> <body> <div id="overlay-under-drawer"></div> <header class="container-fluid" id="title"> <nav class="navbar navbar-fixed-top"> <div class="container"> <button id="sidenav-left-toggle" type="button">&nbsp;</button> <ol class="breadcrumbs gt-separated hidden-xs"> <li><a href="index.html">polymer_app_layout_template</a></li> <li><a href="polymer_app_layout/polymer_app_layout-library.html">polymer_app_layout</a></li> <li><a href="polymer_app_layout/MimeTypeArray-class.html">MimeTypeArray</a></li> <li class="self-crumb">single</li> </ol> <div class="self-name">single</div> </div> </nav> <div class="container masthead"> <ol class="breadcrumbs gt-separated visible-xs"> <li><a href="index.html">polymer_app_layout_template</a></li> <li><a href="polymer_app_layout/polymer_app_layout-library.html">polymer_app_layout</a></li> <li><a href="polymer_app_layout/MimeTypeArray-class.html">MimeTypeArray</a></li> <li class="self-crumb">single</li> </ol> <div class="title-description"> <h1 class="title"> <div class="kind">property</div> single </h1> <!-- p class="subtitle"> </p --> </div> <ul class="subnav"> </ul> </div> </header> <div class="container body"> <div class="col-xs-6 col-sm-3 sidebar sidebar-offcanvas-left"> <h5><a href="index.html">polymer_app_layout_template</a></h5> <h5><a href="polymer_app_layout/polymer_app_layout-library.html">polymer_app_layout</a></h5> <h5><a href="polymer_app_layout/MimeTypeArray-class.html">MimeTypeArray</a></h5> <ol> <li class="section-title"><a href="polymer_app_layout/MimeTypeArray-class.html#instance-properties">Properties</a></li> <li><a href="polymer_app_layout/MimeTypeArray/first.html">first</a> </li> <li>isEmpty </li> <li>isNotEmpty </li> <li>iterator </li> <li><a href="polymer_app_layout/MimeTypeArray/last.html">last</a> </li> <li><a href="polymer_app_layout/MimeTypeArray/length.html">length</a> </li> <li>length </li> <li>reversed </li> <li><a href="polymer_app_layout/MimeTypeArray/single.html">single</a> </li> <li class="section-title"><a href="polymer_app_layout/MimeTypeArray-class.html#operators">Operators</a></li> <li><a href="polymer_app_layout/MimeTypeArray/operator_get.html">operator []</a> </li> <li><a href="polymer_app_layout/MimeTypeArray/operator_put.html">operator []=</a> </li> <li class="section-title"><a href="polymer_app_layout/MimeTypeArray-class.html#methods">Methods</a></li> <li>add </li> <li>addAll </li> <li>any </li> <li>asMap </li> <li>clear </li> <li>contains </li> <li><a href="polymer_app_layout/MimeTypeArray/elementAt.html">elementAt</a> </li> <li>every </li> <li>expand </li> <li>fillRange </li> <li>firstWhere </li> <li>fold </li> <li>forEach </li> <li>getRange </li> <li>indexOf </li> <li>insert </li> <li>insertAll </li> <li><a href="polymer_app_layout/MimeTypeArray/item.html">item</a> </li> <li>join </li> <li>lastIndexOf </li> <li>lastWhere </li> <li>map </li> <li><a href="polymer_app_layout/MimeTypeArray/namedItem.html">namedItem</a> </li> <li>reduce </li> <li>remove </li> <li>removeAt </li> <li>removeLast </li> <li>removeRange </li> <li>removeWhere </li> <li>replaceRange </li> <li>retainWhere </li> <li>setAll </li> <li>setRange </li> <li>shuffle </li> <li>singleWhere </li> <li>skip </li> <li>skipWhile </li> <li>sort </li> <li>sublist </li> <li>take </li> <li>takeWhile </li> <li>toList </li> <li>toSet </li> <li>toString </li> <li>where </li> </ol> </div><!--/.sidebar-offcanvas--> <div class="col-xs-12 col-sm-9 col-md-6 main-content"> <section class="multi-line-signature"> <span class="returntype"><a href="polymer_app_layout/MimeType-class.html">MimeType</a></span> <span class="name ">single</span> <div class="readable-writable"> read-only </div> </section> <section class="desc markdown"> <p class="no-docs">Not documented.</p> </section> </div> <!-- /.main-content --> </div> <!-- container --> <footer> <div class="container-fluid"> <div class="container"> <p class="text-center"> <span class="no-break"> polymer_app_layout_template 0.1.0 api docs </span> &bull; <span class="copyright no-break"> <a href="https://www.dartlang.org"> <img src="static-assets/favicon.png" alt="Dart" title="Dart"width="16" height="16"> </a> </span> &bull; <span class="copyright no-break"> <a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a> </span> </p> </div> </div> </footer> <script src="static-assets/prettify.js"></script> <script src="static-assets/script.js"></script> <!-- Do not remove placeholder --> <!-- Footer Placeholder --> </body> </html>
{ "content_hash": "6381710ad4b57bc6e47b761a2c552a7f", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 137, "avg_line_length": 27.269709543568464, "alnum_prop": 0.5715155203895314, "repo_name": "lejard-h/polymer_app_layout_templates", "id": "6a4a241f78576666e9af2aeb815a484305572f77", "size": "6572", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/api/polymer_app_layout/MimeTypeArray/single.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "2381" }, { "name": "Dart", "bytes": "25778" }, { "name": "HTML", "bytes": "17680" } ], "symlink_target": "" }
package com.amazonaws.services.signer.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.signer.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * EncryptionAlgorithmOptions JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class EncryptionAlgorithmOptionsJsonUnmarshaller implements Unmarshaller<EncryptionAlgorithmOptions, JsonUnmarshallerContext> { public EncryptionAlgorithmOptions unmarshall(JsonUnmarshallerContext context) throws Exception { EncryptionAlgorithmOptions encryptionAlgorithmOptions = new EncryptionAlgorithmOptions(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("allowedValues", targetDepth)) { context.nextToken(); encryptionAlgorithmOptions.setAllowedValues(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)) .unmarshall(context)); } if (context.testExpression("defaultValue", targetDepth)) { context.nextToken(); encryptionAlgorithmOptions.setDefaultValue(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return encryptionAlgorithmOptions; } private static EncryptionAlgorithmOptionsJsonUnmarshaller instance; public static EncryptionAlgorithmOptionsJsonUnmarshaller getInstance() { if (instance == null) instance = new EncryptionAlgorithmOptionsJsonUnmarshaller(); return instance; } }
{ "content_hash": "fc09bcfb5bcbc4b21ae24d9412b79004", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 136, "avg_line_length": 37.7536231884058, "alnum_prop": 0.6564299424184261, "repo_name": "aws/aws-sdk-java", "id": "ad8a402936844e20cdd8d57c944457f9ba67e388", "size": "3185", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-signer/src/main/java/com/amazonaws/services/signer/model/transform/EncryptionAlgorithmOptionsJsonUnmarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php /** * Containers */ namespace MalangPhp\Site\Conf; if (!isset($this) || ! $this instanceof App) { return; } use MalangPhp\Site\Conf\Handler\ErrorHandler\Error; use MalangPhp\Site\Conf\Handler\ErrorHandler\NotAllowed; use MalangPhp\Site\Conf\Handler\ErrorHandler\NotFound; use MalangPhp\Site\Conf\Mapping\DataService; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use MalangPhp\Site\Conf\Helper\FileDirect; use Pentagonal\Hookable\Hookable; /** * Set 500 Handler * * @return \Closure */ $this->set('errorHandler', function () { return function (ServerRequestInterface $request, ResponseInterface $response, \Exception $e) { $notAllowed = new Error(); // log exceptions $this->log->exception($e); /** * @var ResponseInterface */ $response = $notAllowed($request, $response, $e); $this->view->setAttributes([ 'title' => '405 Method Not Allowed', 'type' => $notAllowed->getType(), 'ContentType' => $notAllowed->getContentType(), 'exception' => $e ]); return $this->view->render($response, '500.php'); }; }); /** * Set 405 Handler * * @return \Closure */ $this->set('notAllowedHandler', function () { return function (ServerRequestInterface $request, ResponseInterface $response, array $allowedMethods) { $notAllowed = new NotAllowed(); /** * @var ResponseInterface */ $response = $notAllowed($request, $response, $allowedMethods); $this->view->setAttributes([ 'title' => '405 Method Not Allowed', 'method' => $allowedMethods, 'type' => $notAllowed->getType(), 'ContentType' => $notAllowed->getContentType() ]); return $this->view->render($response, '405.php'); }; }); /** * Set 404 Handler * * @return \Closure */ $this->set('notFoundHandler', function () { return function (ServerRequestInterface $request, ResponseInterface $response) { $notFound = new NotFound(); /** * @var ResponseInterface */ $response = $notFound($request, $response); $this->view->setAttributes([ 'title' => '404 Page Not Found', 'type' => $notFound->getType(), 'ContentType' => $notFound->getContentType() ]); return $this->view->render($response, '404.php'); }; }); /** * Register URI */ $this->set( 'uri', function () { return $this->get('request')->getUri(); } ); /** * Register File Direct */ $this->set( 'file', function () { return new FileDirect(); } ); /** * Register Hook */ $this->set( 'hook', function () { return new Hookable(); } ); /** * Register Data Service */ $this->set( 'data_service', function () { return new DataService(); } );
{ "content_hash": "e994b0d8b28d47ee0a864c042ed53fd1", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 107, "avg_line_length": 23.25984251968504, "alnum_prop": 0.5761679079214624, "repo_name": "MalangPHP/malangconf-www", "id": "549b5eed86487a110512ee00aa75307e87ba7935", "size": "2954", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Applications/Configs/production/Containers.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1687" }, { "name": "HTML", "bytes": "322" }, { "name": "PHP", "bytes": "335224" } ], "symlink_target": "" }
class Admin::SponsorsController < Admin::ApplicationController before_filter :set_sponsor, only: [ :show, :edit, :update] def index @sponsors = Sponsor.joins(:sponsor_sessions).all end def new @sponsor = Sponsor.new @sponsor.build_address authorize @sponsor end def create @sponsor = Sponsor.new(sponsor_params) authorize @sponsor @sponsor.build_address unless @sponsor.address.present? if @sponsor.save flash[:notice] = "Sponsor #{@sponsor.name} created" redirect_to [:admin, @sponsor] else flash[:notice] = @sponsor.errors.full_messages.to_s render 'new' end end def update @sponsor.update_attributes(sponsor_params) redirect_to admin_sponsor_path(@sponsor), notice: "Updated!" end private def sponsor_params params.require(:sponsor).permit(:name, :avatar, :website, :seats, :number_of_coaches, address_attributes: [:flat, :street, :postal_code, :city]) end def set_sponsor @sponsor = Sponsor.find(params[:id]) authorize @sponsor end end
{ "content_hash": "3bb6ca197b7199d182533213bb27a003", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 148, "avg_line_length": 24.651162790697676, "alnum_prop": 0.6783018867924528, "repo_name": "legoscia/planner", "id": "d89b1d559fe9950feac9425579e78d5c662de464", "size": "1060", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/controllers/admin/sponsors_controller.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "54116" }, { "name": "CoffeeScript", "bytes": "459" }, { "name": "HTML", "bytes": "129554" }, { "name": "JavaScript", "bytes": "1673" }, { "name": "Makefile", "bytes": "889" }, { "name": "Ruby", "bytes": "220334" } ], "symlink_target": "" }
'use strict'; var gulp = require('gulp'); gulp.task('default', function() { return gulp.src('demo/**/*') .pipe(gulp.dest('demo-release')); });
{ "content_hash": "d7d3630fa177759c834b2a58cd2fef6b", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 41, "avg_line_length": 19.5, "alnum_prop": 0.5769230769230769, "repo_name": "aui/font-spider", "id": "21b773169368e949eaa65cbdf557a7c88b2b03ce", "size": "156", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/gulpfile.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1493" }, { "name": "HTML", "bytes": "10987" }, { "name": "JavaScript", "bytes": "69455" } ], "symlink_target": "" }
using namespace std; typedef vector<unsigned char> valtype; bool Sign1(const CKeyID& address, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet) { CKey key; if (!keystore.GetKey(address, key)) return false; vector<unsigned char> vchSig; if (!key.Sign(hash, vchSig)) return false; vchSig.push_back((unsigned char)nHashType); scriptSigRet << vchSig; return true; } bool SignN(const vector<valtype>& multisigdata, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet) { int nSigned = 0; int nRequired = multisigdata.front()[0]; for (unsigned int i = 1; i < multisigdata.size()-1 && nSigned < nRequired; i++) { const valtype& pubkey = multisigdata[i]; CKeyID keyID = CPubKey(pubkey).GetID(); if (Sign1(keyID, keystore, hash, nHashType, scriptSigRet)) ++nSigned; } return nSigned==nRequired; } // // Sign scriptPubKey with private keys stored in keystore, given transaction hash and hash type. // Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed), // unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script. // Returns false if scriptPubKey could not be completely satisfied. // bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType, CScript& scriptSigRet, txnouttype& whichTypeRet) { scriptSigRet.clear(); vector<valtype> vSolutions; if (!Solver(scriptPubKey, whichTypeRet, vSolutions)) return false; CKeyID keyID; switch (whichTypeRet) { case TX_NONSTANDARD: case TX_NULL_DATA: return false; case TX_PUBKEY: keyID = CPubKey(vSolutions[0]).GetID(); return Sign1(keyID, keystore, hash, nHashType, scriptSigRet); case TX_PUBKEYHASH: keyID = CKeyID(uint160(vSolutions[0])); if (!Sign1(keyID, keystore, hash, nHashType, scriptSigRet)) return false; else { CPubKey vch; keystore.GetPubKey(keyID, vch); scriptSigRet << ToByteVector(vch); } return true; case TX_SCRIPTHASH: return keystore.GetCScript(uint160(vSolutions[0]), scriptSigRet); case TX_MULTISIG: scriptSigRet << OP_0; // workaround CHECKMULTISIG bug return (SignN(vSolutions, keystore, hash, nHashType, scriptSigRet)); } return false; } bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType) { assert(nIn < txTo.vin.size()); CTxIn& txin = txTo.vin[nIn]; // Leave out the signature from the hash, since a signature can't sign itself. // The checksig op will also drop the signatures from its hash. uint256 hash = SignatureHash(fromPubKey, txTo, nIn, nHashType); txnouttype whichType; if (!Solver(keystore, fromPubKey, hash, nHashType, txin.scriptSig, whichType)) return false; if (whichType == TX_SCRIPTHASH) { // Solver returns the subscript that need to be evaluated; // the final scriptSig is the signatures from that // and then the serialized subscript: CScript subscript = txin.scriptSig; // Recompute txn hash using subscript in place of scriptPubKey: uint256 hash2 = SignatureHash(subscript, txTo, nIn, nHashType); txnouttype subType; bool fSolved = Solver(keystore, subscript, hash2, nHashType, txin.scriptSig, subType) && subType != TX_SCRIPTHASH; // Append serialized subscript whether or not it is completely signed: txin.scriptSig << static_cast<valtype>(subscript); if (!fSolved) return false; } // Test solution return VerifyScript(txin.scriptSig, fromPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, SignatureChecker(txTo, nIn)); } bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType) { assert(nIn < txTo.vin.size()); CTxIn& txin = txTo.vin[nIn]; assert(txin.prevout.n < txFrom.vout.size()); const CTxOut& txout = txFrom.vout[txin.prevout.n]; return SignSignature(keystore, txout.scriptPubKey, txTo, nIn, nHashType); } static CScript PushAll(const vector<valtype>& values) { CScript result; BOOST_FOREACH(const valtype& v, values) result << v; return result; } static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& txTo, unsigned int nIn, const vector<valtype>& vSolutions, vector<valtype>& sigs1, vector<valtype>& sigs2) { // Combine all the signatures we've got: set<valtype> allsigs; BOOST_FOREACH(const valtype& v, sigs1) { if (!v.empty()) allsigs.insert(v); } BOOST_FOREACH(const valtype& v, sigs2) { if (!v.empty()) allsigs.insert(v); } // Build a map of pubkey -> signature by matching sigs to pubkeys: assert(vSolutions.size() > 1); unsigned int nSigsRequired = vSolutions.front()[0]; unsigned int nPubKeys = vSolutions.size()-2; map<valtype, valtype> sigs; BOOST_FOREACH(const valtype& sig, allsigs) { for (unsigned int i = 0; i < nPubKeys; i++) { const valtype& pubkey = vSolutions[i+1]; if (sigs.count(pubkey)) continue; // Already got a sig for this pubkey if (SignatureChecker(txTo, nIn).CheckSig(sig, pubkey, scriptPubKey)) { sigs[pubkey] = sig; break; } } } // Now build a merged CScript: unsigned int nSigsHave = 0; CScript result; result << OP_0; // pop-one-too-many workaround for (unsigned int i = 0; i < nPubKeys && nSigsHave < nSigsRequired; i++) { if (sigs.count(vSolutions[i+1])) { result << sigs[vSolutions[i+1]]; ++nSigsHave; } } // Fill any missing with OP_0: for (unsigned int i = nSigsHave; i < nSigsRequired; i++) result << OP_0; return result; } static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const txnouttype txType, const vector<valtype>& vSolutions, vector<valtype>& sigs1, vector<valtype>& sigs2) { switch (txType) { case TX_NONSTANDARD: case TX_NULL_DATA: // Don't know anything about this, assume bigger one is correct: if (sigs1.size() >= sigs2.size()) return PushAll(sigs1); return PushAll(sigs2); case TX_PUBKEY: case TX_PUBKEYHASH: // Signatures are bigger than placeholders or empty scripts: if (sigs1.empty() || sigs1[0].empty()) return PushAll(sigs2); return PushAll(sigs1); case TX_SCRIPTHASH: if (sigs1.empty() || sigs1.back().empty()) return PushAll(sigs2); else if (sigs2.empty() || sigs2.back().empty()) return PushAll(sigs1); else { // Recur to combine: valtype spk = sigs1.back(); CScript pubKey2(spk.begin(), spk.end()); txnouttype txType2; vector<vector<unsigned char> > vSolutions2; Solver(pubKey2, txType2, vSolutions2); sigs1.pop_back(); sigs2.pop_back(); CScript result = CombineSignatures(pubKey2, txTo, nIn, txType2, vSolutions2, sigs1, sigs2); result << spk; return result; } case TX_MULTISIG: return CombineMultisig(scriptPubKey, txTo, nIn, vSolutions, sigs1, sigs2); } return CScript(); } CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2) { txnouttype txType; vector<vector<unsigned char> > vSolutions; Solver(scriptPubKey, txType, vSolutions); vector<valtype> stack1; EvalScript(stack1, scriptSig1, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker()); vector<valtype> stack2; EvalScript(stack2, scriptSig2, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker()); return CombineSignatures(scriptPubKey, txTo, nIn, txType, vSolutions, stack1, stack2); }
{ "content_hash": "cdb9fc0938b0b19c20df57964eaf2659", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 133, "avg_line_length": 34.481632653061226, "alnum_prop": 0.6325757575757576, "repo_name": "TBoehm/greedynode", "id": "bf98c40394f7c520370414f3077840672e91ea48", "size": "8846", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/script/sign.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "113529" }, { "name": "C++", "bytes": "3373391" }, { "name": "CSS", "bytes": "1127" }, { "name": "Makefile", "bytes": "60693" }, { "name": "Objective-C", "bytes": "3036" }, { "name": "Objective-C++", "bytes": "6310" }, { "name": "Python", "bytes": "167964" }, { "name": "Shell", "bytes": "51936" } ], "symlink_target": "" }
SimpleFTPClient =============== A toy FTP client in C++, undergrad course project
{ "content_hash": "8c631abcfd6177f4f61159e2aa74e491", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 49, "avg_line_length": 20.75, "alnum_prop": 0.6385542168674698, "repo_name": "mingyuan-xia/SimpleFTPClient", "id": "2105941fbaf3c7465c16c5f078977751bec046ca", "size": "83", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "357" }, { "name": "C++", "bytes": "33824" } ], "symlink_target": "" }
<?php namespace DI\Invoker; use DI\Definition\Helper\DefinitionHelper; use DI\Definition\Resolver\DefinitionResolver; use Invoker\ParameterResolver\ParameterResolver; use ReflectionFunctionAbstract; /** * Resolves callable parameters using definitions. * * @since 5.0 * @author Matthieu Napoli <matthieu@mnapoli.fr> */ class DefinitionParameterResolver implements ParameterResolver { /** * @var DefinitionResolver */ private $definitionResolver; public function __construct(DefinitionResolver $definitionResolver) { $this->definitionResolver = $definitionResolver; } /** * {@inheritdoc} */ public function getParameters( ReflectionFunctionAbstract $reflection, array $providedParameters, array $resolvedParameters ) { foreach ($resolvedParameters as &$parameter) { if ($parameter instanceof DefinitionHelper) { $definition = $parameter->getDefinition(''); $parameter = $this->definitionResolver->resolve($definition); } } return $resolvedParameters; } }
{ "content_hash": "6300f6cdfaf3a51665ce801a633251dc", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 77, "avg_line_length": 25.177777777777777, "alnum_prop": 0.6690203000882613, "repo_name": "RayRutjes/PHP-DI", "id": "42be8a928d203c977c1767fdcc611e8cb642ecda", "size": "1133", "binary": false, "copies": "12", "ref": "refs/heads/master", "path": "src/DI/Invoker/DefinitionParameterResolver.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6107" }, { "name": "HTML", "bytes": "29481" }, { "name": "PHP", "bytes": "418194" } ], "symlink_target": "" }
from datetime import datetime, timedelta from rdr_service.dao.ghost_check_dao import GhostCheckDao from tests.helpers.unittest_base import BaseTestCase class GhostCheckDaoTest(BaseTestCase): def test_loads_only_vibrent(self): """We might accidentally start flagging CE participants as ghosts if they're returned""" vibrent_participant = self.data_generator.create_database_participant(participantOrigin='vibrent') self.data_generator.create_database_participant(participantOrigin='careevolution') self.data_generator.create_database_participant(participantOrigin='anotherplatform') participants = GhostCheckDao.get_participants_needing_checked( session=self.data_generator.session, earliest_signup_time=datetime.now() - timedelta(weeks=1) ) self.assertEqual(1, len(participants), 'Should only be the Vibrent participant') self.assertEqual(vibrent_participant.participantId, participants[0].participantId) def test_ghost_flag_returned(self): """Ensure we get back the ghost data field""" ghost_participant = self.data_generator.create_database_participant( participantOrigin='vibrent', isGhostId=True ) self.data_generator.create_database_participant( participantOrigin='vibrent', isGhostId=None ) self.data_generator.create_database_participant( participantOrigin='vibrent', isGhostId=False ) results = GhostCheckDao.get_participants_needing_checked( session=self.data_generator.session, earliest_signup_time=datetime.now() - timedelta(weeks=1) ) for participant in results: if participant.participantId == ghost_participant.participantId: self.assertTrue(participant.isGhostId) else: self.assertFalse(participant.isGhostId)
{ "content_hash": "97a5f8374d42f43ffa4095ae4599a714", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 106, "avg_line_length": 44.52272727272727, "alnum_prop": 0.6865747830525778, "repo_name": "all-of-us/raw-data-repository", "id": "a8f25d5bc9708496e9e835a2692e8fdbbd25b4c6", "size": "1959", "binary": false, "copies": "1", "ref": "refs/heads/devel", "path": "tests/dao_tests/test_ghost_check_dao.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Jupyter Notebook", "bytes": "1866" }, { "name": "Mako", "bytes": "1715" }, { "name": "Python", "bytes": "17040924" }, { "name": "R", "bytes": "2212" }, { "name": "Shell", "bytes": "92213" } ], "symlink_target": "" }
package org.apache.nifi.json; import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.record.NullSuppression; import org.apache.nifi.schema.access.SchemaAccessWriter; import org.apache.nifi.serialization.AbstractRecordSetWriter; import org.apache.nifi.serialization.RecordSetWriter; import org.apache.nifi.serialization.WriteResult; import org.apache.nifi.serialization.record.DataType; import org.apache.nifi.serialization.record.RawRecordWriter; import org.apache.nifi.serialization.record.Record; import org.apache.nifi.serialization.record.RecordField; import org.apache.nifi.serialization.record.RecordFieldType; import org.apache.nifi.serialization.record.RecordSchema; import org.apache.nifi.serialization.record.SerializedForm; import org.apache.nifi.serialization.record.type.ArrayDataType; import org.apache.nifi.serialization.record.type.ChoiceDataType; import org.apache.nifi.serialization.record.type.MapDataType; import org.apache.nifi.serialization.record.type.RecordDataType; import org.apache.nifi.serialization.record.util.DataTypeUtils; import org.codehaus.jackson.JsonFactory; import org.codehaus.jackson.JsonGenerator; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.util.MinimalPrettyPrinter; import java.io.IOException; import java.io.OutputStream; import java.math.BigInteger; import java.text.DateFormat; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.function.Supplier; public class WriteJsonResult extends AbstractRecordSetWriter implements RecordSetWriter, RawRecordWriter { private final ComponentLog logger; private final SchemaAccessWriter schemaAccess; private final RecordSchema recordSchema; private final JsonGenerator generator; private final NullSuppression nullSuppression; private final OutputGrouping outputGrouping; private final Supplier<DateFormat> LAZY_DATE_FORMAT; private final Supplier<DateFormat> LAZY_TIME_FORMAT; private final Supplier<DateFormat> LAZY_TIMESTAMP_FORMAT; private String mimeType = "application/json"; private static final ObjectMapper objectMapper = new ObjectMapper(); public WriteJsonResult(final ComponentLog logger, final RecordSchema recordSchema, final SchemaAccessWriter schemaAccess, final OutputStream out, final boolean prettyPrint, final NullSuppression nullSuppression, final OutputGrouping outputGrouping, final String dateFormat, final String timeFormat, final String timestampFormat) throws IOException { this(logger, recordSchema, schemaAccess, out, prettyPrint, nullSuppression, outputGrouping, dateFormat, timeFormat, timestampFormat, "application/json"); } public WriteJsonResult(final ComponentLog logger, final RecordSchema recordSchema, final SchemaAccessWriter schemaAccess, final OutputStream out, final boolean prettyPrint, final NullSuppression nullSuppression, final OutputGrouping outputGrouping, final String dateFormat, final String timeFormat, final String timestampFormat, final String mimeType) throws IOException { super(out); this.logger = logger; this.recordSchema = recordSchema; this.schemaAccess = schemaAccess; this.nullSuppression = nullSuppression; this.outputGrouping = outputGrouping; this.mimeType = mimeType; final DateFormat df = dateFormat == null ? null : DataTypeUtils.getDateFormat(dateFormat); final DateFormat tf = timeFormat == null ? null : DataTypeUtils.getDateFormat(timeFormat); final DateFormat tsf = timestampFormat == null ? null : DataTypeUtils.getDateFormat(timestampFormat); LAZY_DATE_FORMAT = () -> df; LAZY_TIME_FORMAT = () -> tf; LAZY_TIMESTAMP_FORMAT = () -> tsf; final JsonFactory factory = new JsonFactory(); factory.setCodec(objectMapper); this.generator = factory.createJsonGenerator(out); if (prettyPrint) { generator.useDefaultPrettyPrinter(); } else if (OutputGrouping.OUTPUT_ONELINE.equals(outputGrouping)) { // Use a minimal pretty printer with a newline object separator, will output one JSON object per line generator.setPrettyPrinter(new MinimalPrettyPrinter("\n")); } } @Override protected void onBeginRecordSet() throws IOException { final OutputStream out = getOutputStream(); schemaAccess.writeHeader(recordSchema, out); if (outputGrouping == OutputGrouping.OUTPUT_ARRAY) { generator.writeStartArray(); } } @Override protected Map<String, String> onFinishRecordSet() throws IOException { if (outputGrouping == OutputGrouping.OUTPUT_ARRAY) { generator.writeEndArray(); } return schemaAccess.getAttributes(recordSchema); } @Override public void close() throws IOException { if (generator != null) { generator.close(); } super.close(); } @Override public void flush() throws IOException { if (generator != null) { generator.flush(); } } @Override public Map<String, String> writeRecord(final Record record) throws IOException { // If we are not writing an active record set, then we need to ensure that we write the // schema information. if (!isActiveRecordSet()) { generator.flush(); schemaAccess.writeHeader(recordSchema, getOutputStream()); } writeRecord(record, recordSchema, generator, JsonGenerator::writeStartObject, JsonGenerator::writeEndObject, true); return schemaAccess.getAttributes(recordSchema); } @Override public WriteResult writeRawRecord(final Record record) throws IOException { // If we are not writing an active record set, then we need to ensure that we write the // schema information. if (!isActiveRecordSet()) { generator.flush(); schemaAccess.writeHeader(recordSchema, getOutputStream()); } writeRecord(record, recordSchema, generator, JsonGenerator::writeStartObject, JsonGenerator::writeEndObject, false); final Map<String, String> attributes = schemaAccess.getAttributes(recordSchema); return WriteResult.of(incrementRecordCount(), attributes); } private void writeRecord(final Record record, final RecordSchema writeSchema, final JsonGenerator generator, final GeneratorTask startTask, final GeneratorTask endTask, final boolean schemaAware) throws IOException { final Optional<SerializedForm> serializedForm = record.getSerializedForm(); if (serializedForm.isPresent()) { final SerializedForm form = serializedForm.get(); if (form.getMimeType().equals(getMimeType()) && record.getSchema().equals(writeSchema)) { final Object serialized = form.getSerialized(); if (serialized instanceof String) { generator.writeRawValue((String) serialized); return; } } } try { startTask.apply(generator); if (schemaAware) { for (final RecordField field : writeSchema.getFields()) { final String fieldName = field.getFieldName(); final Object value = record.getValue(field); if (value == null) { if (nullSuppression == NullSuppression.NEVER_SUPPRESS || (nullSuppression == NullSuppression.SUPPRESS_MISSING) && isFieldPresent(field, record)) { generator.writeNullField(fieldName); } continue; } generator.writeFieldName(fieldName); final DataType dataType = writeSchema.getDataType(fieldName).get(); writeValue(generator, value, fieldName, dataType); } } else { for (final String fieldName : record.getRawFieldNames()) { final Object value = record.getValue(fieldName); if (value == null) { if (nullSuppression == NullSuppression.NEVER_SUPPRESS || (nullSuppression == NullSuppression.SUPPRESS_MISSING) && record.getRawFieldNames().contains(fieldName)) { generator.writeNullField(fieldName); } continue; } generator.writeFieldName(fieldName); writeRawValue(generator, value, fieldName); } } endTask.apply(generator); } catch (final Exception e) { logger.error("Failed to write {} with schema {} as a JSON Object due to {}", new Object[] {record, record.getSchema(), e.toString(), e}); throw e; } } private boolean isFieldPresent(final RecordField field, final Record record) { final Set<String> rawFieldNames = record.getRawFieldNames(); if (rawFieldNames.contains(field.getFieldName())) { return true; } for (final String alias : field.getAliases()) { if (rawFieldNames.contains(alias)) { return true; } } return false; } @SuppressWarnings("unchecked") private void writeRawValue(final JsonGenerator generator, final Object value, final String fieldName) throws IOException { if (value == null) { generator.writeNull(); return; } if (value instanceof Record) { final Record record = (Record) value; writeRecord(record, record.getSchema(), generator, JsonGenerator::writeStartObject, JsonGenerator::writeEndObject, false); return; } if (value instanceof Map) { final Map<String, ?> map = (Map<String, ?>) value; generator.writeStartObject(); for (final Map.Entry<String, ?> entry : map.entrySet()) { final String mapKey = entry.getKey(); final Object mapValue = entry.getValue(); generator.writeFieldName(mapKey); writeRawValue(generator, mapValue, fieldName + "." + mapKey); } generator.writeEndObject(); return; } if (value instanceof Object[]) { final Object[] values = (Object[]) value; generator.writeStartArray(); for (final Object element : values) { writeRawValue(generator, element, fieldName); } generator.writeEndArray(); return; } if (value instanceof java.sql.Time) { final Object formatted = format((java.sql.Time) value, LAZY_TIME_FORMAT); generator.writeObject(formatted); return; } if (value instanceof java.sql.Date) { final Object formatted = format((java.sql.Date) value, LAZY_DATE_FORMAT); generator.writeObject(formatted); return; } if (value instanceof java.util.Date) { final Object formatted = format((java.util.Date) value, LAZY_TIMESTAMP_FORMAT); generator.writeObject(formatted); return; } generator.writeObject(value); } private Object format(final java.util.Date value, final Supplier<DateFormat> formatSupplier) { if (value == null) { return null; } if (formatSupplier == null) { return value.getTime(); } final DateFormat format = formatSupplier.get(); if (format == null) { return value.getTime(); } return format.format(value); } @SuppressWarnings("unchecked") private void writeValue(final JsonGenerator generator, final Object value, final String fieldName, final DataType dataType) throws IOException { if (value == null) { generator.writeNull(); return; } final DataType chosenDataType = dataType.getFieldType() == RecordFieldType.CHOICE ? DataTypeUtils.chooseDataType(value, (ChoiceDataType) dataType) : dataType; if (chosenDataType == null) { logger.debug("Could not find a suitable field type in the CHOICE for field {} and value {}; will use null value", new Object[] {fieldName, value}); generator.writeNull(); return; } final Object coercedValue = DataTypeUtils.convertType(value, chosenDataType, LAZY_DATE_FORMAT, LAZY_TIME_FORMAT, LAZY_TIMESTAMP_FORMAT, fieldName); if (coercedValue == null) { generator.writeNull(); return; } switch (chosenDataType.getFieldType()) { case DATE: { final String stringValue = DataTypeUtils.toString(coercedValue, LAZY_DATE_FORMAT); if (DataTypeUtils.isLongTypeCompatible(stringValue)) { generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); } else { generator.writeString(stringValue); } break; } case TIME: { final String stringValue = DataTypeUtils.toString(coercedValue, LAZY_TIME_FORMAT); if (DataTypeUtils.isLongTypeCompatible(stringValue)) { generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); } else { generator.writeString(stringValue); } break; } case TIMESTAMP: { final String stringValue = DataTypeUtils.toString(coercedValue, LAZY_TIMESTAMP_FORMAT); if (DataTypeUtils.isLongTypeCompatible(stringValue)) { generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); } else { generator.writeString(stringValue); } break; } case DOUBLE: generator.writeNumber(DataTypeUtils.toDouble(coercedValue, fieldName)); break; case FLOAT: generator.writeNumber(DataTypeUtils.toFloat(coercedValue, fieldName)); break; case LONG: generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); break; case INT: case BYTE: case SHORT: generator.writeNumber(DataTypeUtils.toInteger(coercedValue, fieldName)); break; case CHAR: case STRING: generator.writeString(coercedValue.toString()); break; case BIGINT: if (coercedValue instanceof Long) { generator.writeNumber(((Long) coercedValue).longValue()); } else { generator.writeNumber((BigInteger) coercedValue); } break; case BOOLEAN: final String stringValue = coercedValue.toString(); if ("true".equalsIgnoreCase(stringValue)) { generator.writeBoolean(true); } else if ("false".equalsIgnoreCase(stringValue)) { generator.writeBoolean(false); } else { generator.writeString(stringValue); } break; case RECORD: { final Record record = (Record) coercedValue; final RecordDataType recordDataType = (RecordDataType) chosenDataType; final RecordSchema childSchema = recordDataType.getChildSchema(); writeRecord(record, childSchema, generator, JsonGenerator::writeStartObject, JsonGenerator::writeEndObject, true); break; } case MAP: { final MapDataType mapDataType = (MapDataType) chosenDataType; final DataType valueDataType = mapDataType.getValueType(); final Map<String, ?> map = (Map<String, ?>) coercedValue; generator.writeStartObject(); for (final Map.Entry<String, ?> entry : map.entrySet()) { final String mapKey = entry.getKey(); final Object mapValue = entry.getValue(); generator.writeFieldName(mapKey); writeValue(generator, mapValue, fieldName + "." + mapKey, valueDataType); } generator.writeEndObject(); break; } case ARRAY: default: if (coercedValue instanceof Object[]) { final Object[] values = (Object[]) coercedValue; final ArrayDataType arrayDataType = (ArrayDataType) chosenDataType; final DataType elementType = arrayDataType.getElementType(); writeArray(values, fieldName, generator, elementType); } else { generator.writeString(coercedValue.toString()); } break; } } private void writeArray(final Object[] values, final String fieldName, final JsonGenerator generator, final DataType elementType) throws IOException { generator.writeStartArray(); for (final Object element : values) { writeValue(generator, element, fieldName, elementType); } generator.writeEndArray(); } @Override public String getMimeType() { return this.mimeType; } private interface GeneratorTask { void apply(JsonGenerator generator) throws IOException; } }
{ "content_hash": "b5ae8662934bc193339f592a5e8e6813", "timestamp": "", "source": "github", "line_count": 434, "max_line_length": 188, "avg_line_length": 41.36175115207373, "alnum_prop": 0.6184613670547602, "repo_name": "jtstorck/nifi", "id": "dd7eaec77369a528ebf0f189078cda2e7fb35f82", "size": "18752", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/json/WriteJsonResult.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "21394" }, { "name": "C++", "bytes": "652" }, { "name": "CSS", "bytes": "238624" }, { "name": "Clojure", "bytes": "3993" }, { "name": "Dockerfile", "bytes": "12380" }, { "name": "GAP", "bytes": "30796" }, { "name": "Groovy", "bytes": "2142272" }, { "name": "HTML", "bytes": "714001" }, { "name": "Java", "bytes": "40674205" }, { "name": "JavaScript", "bytes": "3090492" }, { "name": "Lua", "bytes": "983" }, { "name": "Python", "bytes": "20318" }, { "name": "Ruby", "bytes": "8028" }, { "name": "Shell", "bytes": "82171" }, { "name": "XSLT", "bytes": "5681" } ], "symlink_target": "" }
package com.google.inject.internal; import com.google.inject.Key; import com.google.inject.ProvidedBy; import com.google.inject.internal.InjectorImpl.JitLimitation; import com.google.inject.spi.Dependency; import javax.inject.Provider; /** * An {@link InternalFactory} for {@literal @}{@link ProvidedBy} bindings. * * @author sameb@google.com (Sam Berlin) */ class ProvidedByInternalFactory<T> extends ProviderInternalFactory<T> implements DelayedInitialize { private final Class<?> rawType; private final Class<? extends Provider<?>> providerType; private final Key<? extends Provider<T>> providerKey; private BindingImpl<? extends Provider<T>> providerBinding; private ProvisionListenerStackCallback<T> provisionCallback; ProvidedByInternalFactory( Class<?> rawType, Class<? extends Provider<?>> providerType, Key<? extends Provider<T>> providerKey) { super(providerKey); this.rawType = rawType; this.providerType = providerType; this.providerKey = providerKey; } void setProvisionListenerCallback(ProvisionListenerStackCallback<T> listener) { provisionCallback = listener; } @Override public void initialize(InjectorImpl injector, Errors errors) throws ErrorsException { providerBinding = injector.getBindingOrThrow(providerKey, errors, JitLimitation.NEW_OR_EXISTING_JIT); } @Override public T get(InternalContext context, Dependency<?> dependency, boolean linked) throws InternalProvisionException { BindingImpl<? extends Provider<T>> localProviderBinding = providerBinding; if (localProviderBinding == null) { throw new IllegalStateException("not initialized"); } Key<? extends Provider<T>> localProviderKey = providerKey; try { Provider<? extends T> provider = localProviderBinding.getInternalFactory().get(context, dependency, true); return circularGet(provider, context, dependency, provisionCallback); } catch (InternalProvisionException ipe) { throw ipe.addSource(localProviderKey); } } @Override protected T provision( javax.inject.Provider<? extends T> provider, Dependency<?> dependency, ConstructionContext<T> constructionContext) throws InternalProvisionException { try { Object o = super.provision(provider, dependency, constructionContext); if (o != null && !rawType.isInstance(o)) { throw InternalProvisionException.subtypeNotProvided(providerType, rawType); } @SuppressWarnings("unchecked") // protected by isInstance() check above T t = (T) o; return t; } catch (RuntimeException e) { throw InternalProvisionException.errorInProvider(e).addSource(source); } } }
{ "content_hash": "20e38b553b70962c2ac58c43dc447ca3", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 100, "avg_line_length": 34.63291139240506, "alnum_prop": 0.7266081871345029, "repo_name": "google/guice", "id": "b971f8b963cea73d94c95974dc47545736aae2bc", "size": "3330", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "core/src/com/google/inject/internal/ProvidedByInternalFactory.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "1059" }, { "name": "Java", "bytes": "3609994" }, { "name": "Shell", "bytes": "6613" }, { "name": "Starlark", "bytes": "56963" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <ScrollView android:id="@+id/pbba_popup_container" style="@style/PBBAPopup.Container" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:fillViewport="false" tools:ignore="UnusedIds"> <RelativeLayout android:id="@+id/pbba_popup_content" style="@style/PBBAPopup.Content" tools:ignore="UnusedIds"> <include android:id="@id/pbba_popup_header" layout="@layout/pbba_popup_section_header" /> <LinearLayout android:id="@+id/pbba_popup_mcom_option_titles_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/pbba_popup_header" android:layout_marginLeft="@dimen/pbba_popup_content_margin_horizontal" android:layout_marginRight="@dimen/pbba_popup_content_margin_horizontal" android:layout_marginTop="@dimen/pbba_popup_content_margin_vertical" android:orientation="horizontal"> <com.zapp.library.merchant.ui.view.CustomTextView style="@style/PBBAPopup.EComm.Text.Title" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_weight="1" android:gravity="left" android:text="@string/pbba_popup_pay_on_this_device_title" tools:ignore="RtlHardcoded" /> <View android:layout_width="1dp" android:layout_height="match_parent" android:layout_marginLeft="@dimen/pbba_popup_vertical_separator_horizontal_margin_left" android:layout_marginRight="@dimen/pbba_popup_vertical_separator_horizontal_margin_right" android:background="@color/pbba_popup_ecomm_vertical_separator_color" tools:ignore="RtlHardcoded" /> <com.zapp.library.merchant.ui.view.CustomTextView style="@style/PBBAPopup.EComm.Text.Title" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_weight="1" android:gravity="left" android:text="@string/pbba_popup_pay_with_another_device_title" tools:ignore="RtlHardcoded" /> </LinearLayout> <LinearLayout android:id="@+id/body" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/pbba_popup_mcom_option_titles_container" android:layout_marginBottom="@dimen/pbba_popup_content_margin_vertical" android:layout_marginLeft="@dimen/pbba_popup_content_margin_horizontal" android:layout_marginRight="@dimen/pbba_popup_content_margin_horizontal" android:orientation="horizontal"> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" android:orientation="vertical"> <LinearLayout style="@style/PBBAPopup.EComm.Item" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/pbba_popup_mcomm_open_banking_app_call_to_action_margin_bottom" android:layout_marginTop="@dimen/pbba_popup_mcomm_open_banking_app_call_to_action_margin_top"> <View style="@style/PBBAPopup.EComm.Item.Indicator" android:layout_height="match_parent" android:background="@drawable/pbba_popup_ecom_indicator_one_background" /> <com.zapp.library.merchant.ui.view.CustomTextView android:id="@+id/pbba_popup_open_banking_app_call_to_action" style="@style/PBBAPopup.Text.Body" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" android:text="@string/pbba_popup_open_banking_app_call_to_action" tools:ignore="RtlHardcoded,UnusedIds" /> </LinearLayout> <include layout="@layout/pbba_button_open_banking_app" android:layout_width="@dimen/pbba_button_width" android:layout_height="@dimen/pbba_button_height" /> </LinearLayout> <View android:layout_width="1dp" android:layout_height="match_parent" android:layout_marginLeft="@dimen/pbba_popup_vertical_separator_horizontal_margin_left" android:layout_marginRight="@dimen/pbba_popup_vertical_separator_horizontal_margin_right" android:background="@color/pbba_popup_ecomm_vertical_separator_color" tools:ignore="RtlHardcoded" /> <LinearLayout android:id="@+id/pbba_popup_code_container" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical" tools:ignore="InconsistentLayout,RtlSymmetry"> <include layout="@layout/pbba_popup_section_code_body" /> </LinearLayout> </LinearLayout> <include layout="@layout/pbba_popup_section_what_is_pay_by_bank_app" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/body" android:layout_marginLeft="@dimen/pbba_popup_content_margin_vertical" android:layout_marginRight="@dimen/pbba_popup_content_margin_vertical" /> </RelativeLayout> </ScrollView>
{ "content_hash": "7ff8e54350c76edbc7219061c7047fa1", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 119, "avg_line_length": 46.774436090225564, "alnum_prop": 0.5886513422279376, "repo_name": "vocalinkzapp/ZappMerchantLib-R2-Android", "id": "fa7201f9187734f94eeaa6a74fdd1f8d4b96d069", "size": "6221", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "zapp-merchant-library/src/main/res/layout-w640dp/pbba_popup_fragment_mcomm.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "94486" } ], "symlink_target": "" }
package org.basex.gui.view; import static org.basex.gui.layout.BaseXKeys.*; import java.awt.event.*; import org.basex.gui.*; import org.basex.gui.layout.*; /** * View observer pattern. All inheriting classes are attached to the * views array * * @author BaseX Team 2005-15, BSD License * @author Christian Gruen */ public abstract class View extends BaseXPanel { /** * Registers the specified view. * @param name name of view * @param man view manager */ protected View(final String name, final ViewNotifier man) { super(man.gui); setFocusable(true); setBackground(GUIConstants.BACK); setName(name); addMouseListener(this); addMouseMotionListener(this); addMouseWheelListener(this); addKeyListener(this); addComponentListener(this); man.add(this); } /** * Called when the data reference has changed. */ public abstract void refreshInit(); /** * Called when a new focus has been chosen. */ public abstract void refreshFocus(); /** * Called when a context set has been * marked. */ public abstract void refreshMark(); /** * Called when a new context set has been chosen. * @param more show more details * @param quick perform a quick context switch */ public abstract void refreshContext(boolean more, boolean quick); /** * Called when GUI design has changed. */ public abstract void refreshLayout(); /** * Called when updates have been done in the data structure. */ public abstract void refreshUpdate(); /** * Tests if this view is currently marked as visible. * @return result of check */ public abstract boolean visible(); /** * Sets a flag denoting the visibility of the view. * @param v visibility flag */ public abstract void visible(final boolean v); /** * Tests if this view relies on a database instance. * @return result of check */ protected abstract boolean db(); @Override public void mouseEntered(final MouseEvent e) { if(!gui.updating && gui.gopts.get(GUIOptions.MOUSEFOCUS)) requestFocusInWindow(); } @Override public void mouseExited(final MouseEvent e) { if(!gui.updating) gui.cursor(GUIConstants.CURSORARROW); } @Override public void mousePressed(final MouseEvent e) { if(!gui.updating) requestFocusInWindow(); } @Override public void keyPressed(final KeyEvent e) { if(gui.updating) return; if(ESCAPE.is(e)) gui.fullscreen(false); if(gui.context.data() == null) return; if(SPACE.is(e)) { gui.notify.mark(sc(e) ? 2 : e.isShiftDown() ? 1 : 0, null); } else if(ENTER.is(e)) { GUIMenuCmd.C_FILTER.execute(gui); } else if(GOBACK2.is(e)) { GUIMenuCmd.C_GOBACK.execute(gui); } } @Override public final String toString() { return getName(); } }
{ "content_hash": "b0baf6e0efd39624f484f20a159e09a5", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 85, "avg_line_length": 23.454545454545453, "alnum_prop": 0.6677237491190979, "repo_name": "deshmnnit04/basex", "id": "f9dcbe901f1398c905e58d28f3b21617a3dbf48c", "size": "2838", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "basex-core/src/main/java/org/basex/gui/view/View.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ActionScript", "bytes": "9372" }, { "name": "Batchfile", "bytes": "2502" }, { "name": "C", "bytes": "17146" }, { "name": "C#", "bytes": "15295" }, { "name": "C++", "bytes": "7796" }, { "name": "CSS", "bytes": "3386" }, { "name": "Common Lisp", "bytes": "3211" }, { "name": "HTML", "bytes": "1057" }, { "name": "Haskell", "bytes": "4065" }, { "name": "Java", "bytes": "23497050" }, { "name": "JavaScript", "bytes": "8926" }, { "name": "Makefile", "bytes": "1234" }, { "name": "PHP", "bytes": "8690" }, { "name": "Perl", "bytes": "7801" }, { "name": "Python", "bytes": "26123" }, { "name": "QMake", "bytes": "377" }, { "name": "Rebol", "bytes": "4731" }, { "name": "Ruby", "bytes": "7359" }, { "name": "Scala", "bytes": "11692" }, { "name": "Shell", "bytes": "3557" }, { "name": "Visual Basic", "bytes": "11957" }, { "name": "XQuery", "bytes": "310833" }, { "name": "XSLT", "bytes": "172" } ], "symlink_target": "" }
Symfony2-sample ===============
{ "content_hash": "dfa4cd8db479a8957aa047fb647d1d82", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 15, "avg_line_length": 16, "alnum_prop": 0.4375, "repo_name": "13pass/symfony2-sample", "id": "d1dc062cb1f1e5398044ca3cb819505a7d6f2421", "size": "32", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "34400" } ], "symlink_target": "" }
require 'rubygems' require 'rave' module RaveAllEventTestBot class Robot < Rave::Models::Robot SPELLY_ID = 'spelly@gwave.com' DELETE_COMMAND = 'DELETE' INVITE_COMMAND = 'INVITE' TEXTILE_COMMAND = 'TEXTILE' HTML_COMMAND = 'HTML' KICK_COMMAND = 'KICK' TITLE_COMMAND = 'TITLE' WAVELET_COMMAND = 'PRIVATE' # Reply to the blip the event was generated by. def reply_blip(event, message, options = {}) blip = event.blip.create_child_blip blip.append_text(message, options) end # Reply to the wavelet the event was generated by. def reply_wavelet(event, message, options = {}) blip = event.wavelet.create_blip blip.append_text(message, options) end def wavelet_self_added(event, context) message =<<-MESSAGE Hello everyone, I am #{name} (#{id})! * My project can be found on <a href="http://github.com/diminish7/rave">Github</a>. * I like to comment on what people are doing (creating, submitting and deleting blips). * I will say hello and goodbye as people arrive or leave the wave. * Submit a blip: * containing only "#{DELETE_COMMAND}" and I'll delete it for you. * containing "#{INVITE_COMMAND} fish@frog.com" to invite that user/robot into the wavelet. * containing "#{KICK_COMMAND} fish@appspot.com" to kick a robot from the wavelet. * containing "#{WAVELET_COMMAND} fish@cheese.com, frog@peas.com" start a wavelet with these users. * containing "#{TITLE_COMMAND} new-title" to change the wavelet's title. * starting with "#{TEXTILE_COMMAND}" or "#{HTML_COMMAND}" to convert the markup to properly styled text. MESSAGE reply_wavelet(event, message, :format => :html) end # BUG: Never received. def wavelet_self_removed(event, context) reply_wavelet(event, "Goodbye world!") end def wavelet_participants_changed(event, context) event.participants_added.each do |user| reply_wavelet(event, "Hello #{user.name}!") unless user == self end event.participants_removed.each do |user| reply_wavelet(event, "Goodbye #{user.name}!") unless user == self end end # BUG: Only seems to get sent if robot is invited into a new wave on creation. def wavelet_blip_created(event, context) blip = event.blip.append_inline_blip blip.append_text("#{event.modified_by.name} created a new blip! I _would_ have done it better, though!", :format => :textile) end # BUG: Never received. def wavelet_blip_removed(event, context) reply_wavelet(event, "#{event.modified_by.name} removed a blip from the wavelet! Absolute power, eh?") end def blip_deleted(event, context) reply_wavelet(event, "#{event.modified_by.name} deleted a blip! _Which one will be next?_", :format => :textile) end def blip_submitted(event, context) case event.blip.content when /^#{DELETE_COMMAND}\s*$/ if event.blip.root? reply_blip(event, "Silly #{event.modified_by.name}! I can't delete the root blip, can I?") else event.blip.delete end when /^#{TITLE_COMMAND}\s+/ title = $' event.wavelet.title = title when /^#{WAVELET_COMMAND}\s+/ participants = $'.strip.split(/\s*,\s*/) + [event.modified_by] create_wavelet(participants) reply_wavelet(event, "Created wavelet with #{participants.join(", ")}") when /^#{INVITE_COMMAND}\s+([\w\-\.]+@[\w\-\.]+)\s*$/ invited = $1 user = event.wavelet.participants.find { |u| u.id == invited } message = if user "Can't add #{user.name} since they are already here!" else event.wavelet.add_participant(invited) "#{invited} added!" end reply_wavelet(event, message) when /^#{KICK_COMMAND}\s+([\w\-\.]+@[\w\-\.]+)\s*$/ kicked = $1 user = event.wavelet.participants.find { |u| u.id == kicked } message = if user if user.robot? event.wavelet.remove_participant(user) "#{user.name} kicked!" else "Can't remove #{user.name} since they are not a robot!" end else "Can't remove #{user.name} since they are not here!" end reply_wavelet(event, message) when /^#{KICK_COMMAND}\s*$/ reply_wavelet(event, "I know when I'm not wanted!") event.wavelet.remove_robot when /^#{TEXTILE_COMMAND}\s+/ # Parse and stylise textile. event.blip.set_text($', :format => :textile) unless $'.empty? when /^#{HTML_COMMAND}\s+/ # Parse and stylise HTML. event.blip.set_text($', :format => :html) unless $'.empty? else reply_blip(event, "#{event.modified_by.name} submitted a blip! Show off!") end end # BUG: Never received. def wavelet_title_changed(event, context) reply_wavelet(event, "#{event.modified_by.name} changed the title to: #{event.title}") end def document_changed(event, context) return if [SPELLY_ID, id].include? event.modified_by.id # Do something about it end def wavelet_created(event, context) reply_wavelet(event, "Created a new wavelet") end def operation_error(error, context) reply_wavelet(error, "Error: #{error.message} (#{error.operation_type}) at #{error.operation_timestamp}") end end end
{ "content_hash": "0084d067086267374c4cc27cf8866add", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 131, "avg_line_length": 35.116129032258065, "alnum_prop": 0.6213485210361933, "repo_name": "diminish7/rave", "id": "98c548cea22beb9c7833a896eb2d864c5a665dcf", "size": "5443", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/rave-all-event-test-bot/robot.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "165055" } ], "symlink_target": "" }
from google.cloud import assuredworkloads_v1 def sample_acknowledge_violation(): # Create a client client = assuredworkloads_v1.AssuredWorkloadsServiceClient() # Initialize request argument(s) request = assuredworkloads_v1.AcknowledgeViolationRequest( name="name_value", comment="comment_value", ) # Make the request response = client.acknowledge_violation(request=request) # Handle the response print(response) # [END assuredworkloads_v1_generated_AssuredWorkloadsService_AcknowledgeViolation_sync]
{ "content_hash": "f15080288ea64216eb36fdf1eca8c7dd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 87, "avg_line_length": 27.9, "alnum_prop": 0.7401433691756273, "repo_name": "googleapis/python-assured-workloads", "id": "4c772f772f8e7a633ffd1d735a7f667c4300a518", "size": "1986", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "samples/generated_samples/assuredworkloads_v1_generated_assured_workloads_service_acknowledge_violation_sync.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2050" }, { "name": "Python", "bytes": "768919" }, { "name": "Shell", "bytes": "30693" } ], "symlink_target": "" }
Projects ======== These are some of the student projects that have used Embedded Xinu. For some, the contribution is included in the official Embedded Xinu distribution itself. .. toctree:: :glob: :maxdepth: 2 *
{ "content_hash": "0ad3c0b47eef79ba3807daed6ba8c036", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 68, "avg_line_length": 18.666666666666668, "alnum_prop": 0.7098214285714286, "repo_name": "rahsinha2/XINU-OS", "id": "e1c8ce11b3b3f90e24f782646dc75d18a176803f", "size": "224", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "docs/projects/index.rst", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "53631" }, { "name": "C", "bytes": "1851178" }, { "name": "C++", "bytes": "75897" }, { "name": "Lex", "bytes": "1980" }, { "name": "Makefile", "bytes": "15891" }, { "name": "Objective-C", "bytes": "2678" }, { "name": "Shell", "bytes": "1501" }, { "name": "Yacc", "bytes": "2026" } ], "symlink_target": "" }
/** * Default.ts * * @package vrkd/src/list * @author Fernando Salazar */ export declare type Storage<V> = { [k: string]: V; }; /** * List class adds a CRUD wrapper to an object. */ export declare class List<V> { /** * List storage */ private _storage; /** * Unique identifier for appending keyless values. */ private _count; /** * Class constructor */ constructor($storage?: Storage<V>); /** * Assign a `$val` to a `$key` */ set($key: string, $val: V): void; /** * Get a value by `$key` */ get($key: string): V; /** * Does storage have `$key` */ has($key: string): boolean; /** * Add value to storage with no key provided. * It will generate and return the key it was assigned to. * * @param {V} $value to be added. * @return {int} The `$key` index of the value. */ append($value: V): string; /** * Remove value by `$key`. * * @param {string} $key * @return {void} */ remove($key: string): void; /** * Get all keys from storage */ keys(): string[]; /** * Get storage in a json string. * * @return {string} JSON string */ toJSON(): string; }
{ "content_hash": "c2335e54811c922c1de595543d13e809", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 62, "avg_line_length": 20.349206349206348, "alnum_prop": 0.5085803432137286, "repo_name": "VARKODE/bulb", "id": "09b3e47ac5b3b93f419e7178ba67ffce6202e063", "size": "1282", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dist/list/Default.d.ts", "mode": "33188", "license": "mit", "language": [ { "name": "TypeScript", "bytes": "26085" } ], "symlink_target": "" }
# Getting started The goal of swagger-php is the generate a swagger.json using phpdoc annotations. To output: ```json { "swagger": "2.0", "schemes": ["http"], "host": "example.com", "basePath": "/api" } ``` Write: ```php /** * @SWG\Swagger( * schemes={"http"}, * host="example.com", * basePath="/api" * ) */ ``` Note that Doctrine annotation supports arrays, but uses the `{` and `}` instead of `[` and `]`. And although doctrine also supports objects, but also uses `{` and `}` and requires the properties to be surrounded with `"`. DON'T write: ```php /** * @SWG\Swagger( * info={ * "title"="My first swagger documented API", * "version"="1.0.0" * } * ) */ ``` But use the annotation with the same name as the property, such as `@SWG\Info` for `info`: ```php /** * @SWG\Swagger( * @SWG\Info( * titel="My first swagger documented API", * version="1.0.0" * ) * ) */ ``` This adds validation, so when you misspell a property or forget a required property it will trigger a php warning. For example the snippet above would generate a notice with "Unexpected field "titel" for @SWG\Info(), expecting "title", ..." ## Using variables in annotations You can use constants inside doctrine annotations. ```php define("API_HOST", ($env === "production") ? "example.com" : "localhost"); ``` ```php /** * @SWG\Swagger(host=API_HOST) */ ``` When you're using the CLI you'll need to include the php file with the constants using the `--bootstrap` options: ``` $ swagger --bootstrap constants.php ``` ## Annotation placement You shouldn't place all annotations inside one big @SWG\Swagger() annotation block, but scatter them throughout your codebase. swagger-php will scan your project and merge all annotations into one @SWG\Swagger annotation. The big benefit swagger-php provides is that the documentation lives close the the code implementing the api. ### Arrays and Objects Placing multiple annotation of the same type will result in an array or object. For objects, the convension for properties, is to use the same field name as the annotation: `response` in a `@SWG\Response`, `property` in a `@SWG\Property`, etc. ```php /** * @SWG\Get( * path="/products", * summary="list products", * @SWG\Response( * response=200, * description="A list with products" * ), * @SWG\Response( * response="default", * description="an ""unexpected"" error" * ) * ) */ ``` Generates: ```json { "swagger": "2.0", "paths": { "/products": { "get": { "summary": "list products", "responses": { "200": { "description": "A list with products" }, "default": { "description": "unexpected error" } } } } }, "definitions": [] } ``` ### Swagger-PHP detects values based on context swagger-php looks at context of the comment which reduces duplication. ```php /** * @SWG\Definition() */ class Product { /** * The product name * @var string * @SWG\Property() */ public $name; } ``` results in: ```json { "swagger": "2.0", "definitions": { "Product": { "properties": { "name": { "type": "string", "description": "The product name" } } } } } ``` As if you'd written: ```php /** * The product name * @var string * * @SWG\Property( * property="name", * type="string", * descriptions="The product name" * ) */ public $name; ``` ## More information To see which output maps to which annotation checkout [swagger-explained](http://bfanger.github.io/swagger-explained/) Which also contain snippets of the [swagger specification](http://github.com/swagger-api/swagger-spec)
{ "content_hash": "7837a03e6b94cd91fdf6ae7f53733743", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 163, "avg_line_length": 20.10994764397906, "alnum_prop": 0.6066128612340537, "repo_name": "mrploddy1981/swagger-php", "id": "4f57a0e12ba515e40fa3d9c58b9980852b4e40c8", "size": "3841", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "docs/Getting-started.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "166143" } ], "symlink_target": "" }
<?php final class PhabricatorProjectViewController extends PhabricatorProjectController { public function shouldAllowPublic() { return true; } public function handleRequest(AphrontRequest $request) { $request = $this->getRequest(); $viewer = $request->getViewer(); $response = $this->loadProject(); if ($response) { return $response; } $project = $this->getProject(); $engine = $this->getProfileMenuEngine(); $default = $engine->getDefaultItem(); // If defaults are broken somehow, serve the manage page. See T13033 for // discussion. if ($default) { $default_key = $default->getBuiltinKey(); } else { $default_key = PhabricatorProject::ITEM_MANAGE; } switch ($default->getBuiltinKey()) { case PhabricatorProject::ITEM_WORKBOARD: $controller_object = new PhabricatorProjectBoardViewController(); break; case PhabricatorProject::ITEM_PROFILE: $controller_object = new PhabricatorProjectProfileController(); break; case PhabricatorProject::ITEM_MANAGE: $controller_object = new PhabricatorProjectManageController(); break; default: return $engine->buildResponse(); } return $this->delegateToController($controller_object); } }
{ "content_hash": "ac868d1e1b349f1ad7dfcd877ee6ad15", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 76, "avg_line_length": 27.291666666666668, "alnum_prop": 0.6610687022900763, "repo_name": "kanarip/phabricator", "id": "2e53fe72761a62b29189568ab3746790eaf2053d", "size": "1310", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/applications/project/controller/PhabricatorProjectViewController.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "160255" }, { "name": "CSS", "bytes": "402346" }, { "name": "JavaScript", "bytes": "976314" }, { "name": "Makefile", "bytes": "9933" }, { "name": "PHP", "bytes": "16676296" }, { "name": "PLSQL", "bytes": "80" }, { "name": "PLpgSQL", "bytes": "89" }, { "name": "Python", "bytes": "7385" }, { "name": "Roff", "bytes": "30134" }, { "name": "Shell", "bytes": "16977" } ], "symlink_target": "" }
c() { cd ~/code/$1; } _c() { _files -W ~/code -/; } compdef _c c PATH=$PATH:~/bin PATH=/home/ubuntu/tools/Maven/Default/bin:$PATH export EDITOR='vim' export VAGRANT_DEFAULT_PROVIDER='virtualbox' # autocorrect is more annoying than helpful unsetopt correct_all # disabling some dragons #unalias gp # git push #unalias git-svn-dcommit-push # git and svn mix #unalias ggpush # git push current branch #unalias ggpnp # git pull and push current branch # a few aliases I like alias gs='git status' alias gd='git diff' alias gdc='git diff --cached' alias git-personal-repo-email='git config --add user.email netengr2009@gmail.com' alias git-personal-add-ssh-key='ssh-add ~/.ssh/id_rsa_github_personal' alias gmlg='git log --author=Andrew_Thompson@rapid7.com' alias tlf='tail -f' alias tf='terraform' ssh_aws_list() { echo $1 | awk -F' ' '{ print $2 }' | xargs -I {} ssh -o StrictHostKeyChecking=no {} "echo;ec2metadata|grep public-hostname;$2" } ssh_list() { echo $1 | xargs -I {} ssh -o StrictHostKeyChecking=no {} "echo;ec2metadata|grep public-hostname;$2" } scp() { if [[ "$@" =~ : ]];then /usr/bin/scp $@ else echo 'You forgot the colon dumbass!' fi } # Catch a common scp mistake. vaild_json() { FILE=$1 ruby -rjson -e "p ! JSON.parse(File.open('$FILE').read).empty?" } # Given content like the following passed as the first argument # this should build the methods needed to write most of the convection # code for you. You will have to do some massaging of the method names, # but this takes most of the grunt work out. # # Example: # # % convection_gen_code ""Count" : String, #"Handle" : String, #"Timeout" : String" convection_gen_code() { echo $1 | sed "s/\"//g" | cut -d ':' -f 1 | tr -d ' ' | xargs -I {} printf "property \:{}, '{}'\n" } # Usage: # tunnel host port # tunnel host remoteport localport # tunnel host remoteport localport passthruhost tunnel() { PROXYHOST=$1 RPORT=$2 LPORT=$3 PASSTHRUHOST=$4 if [ -z $PROXYHOST ]; then echo "tunnel PROXYHOST REMOTE_PORT [LOCAL_PORT] [PASS_THRU_HOST]" fi if [ -z $RPORT ]; then echo "tunnel PROXYHOST REMOTE_PORT [LOCAL_PORT] [PASS_THRU_HOST]" fi if [ -z $LPORT ]; then LPORT=$RPORT fi if [ -z $PASSTHRUHOST ]; then PASSTHRUHOST=localhost fi ssh $PROXYHOST -L ${LPORT}:$PASSTHRUHOST:${RPORT} } list-access-keys() { aws iam list-users | jq --raw-output '.[][].UserName' | xargs -I {} aws iam list-access-keys --user-name "{}" } restart_vbox_network_adapter() { ADAPTER=${1:-"vboxnet1"} sudo ifconfig $ADAPTER down sudo ifconfig $ADAPTER up } kill_vagrant_run() { ps aux | grep ruby | grep vagrant | awk '{ print $2 }' | xargs kill } vagrant() { PWD=$(pwd) if [ -f "$PWD/Buildfile" ]; then echo "Running in a Builderator environment" ruby_version=$(ruby -e'puts RUBY_VERSION') if [ -f ~/.rbenv/shims/vagrant ]; then rm ~/.rbenv/shims/vagrant fi case $@ in provision) bundle exec build prepare bundle exec build vagrant provision default --provision-with chef_solo ;; "up --provider aws") bundle exec build ec2 ;; up) bundle exec build local ;; ssh) bundle exec build vagrant ssh ;; *) cd .builderator /usr/local/bin/vagrant $@ cd - ;; esac else echo "NOT Running in a Builderator environment" /usr/local/bin/vagrant "$@" fi } vagrant-base() { PWD=$(pwd) if [ -f "$PWD/Buildfile" ]; then echo "Running in a Builderator environment" ruby_version=$(ruby -e'puts RUBY_VERSION') if [ -f ~/.rbenv/shims/vagrant ]; then rm ~/.rbenv/shims/vagrant fi case $@ in provision) bundle exec build prepare bundle exec build vagrant provision vagrant-base --provision-with chef_solo ;; "up --provider aws") bundle exec build ec2 ;; up) bundle exec build local bake ;; ssh) bundle exec build vagrant ssh ;; *) cd .builderator /usr/local/bin/vagrant $@ cd - ;; esac else echo "NOT Running in a Builderator environment" /usr/bin/vagrant "$@" fi } git-worktree-add() { BASE_BRANCH=$1 BRANCH=$2 REPO=$(basename $(git rev-parse --show-toplevel)) BASEDIR=$(dirname $(git rev-parse --show-toplevel)) NEWDIR="${BASEDIR}/${REPO}-${BRANCH}" git worktree add -b $BRANCH $NEWDIR $BASE_BRANCH echo echo "Entering new worktree" echo cd $NEWDIR echo "When finished, delete the branch and directory:" echo "% cd ${BASEDIR}/${REPO}" echo "% git branch -d $BRANCH" echo "% rm -rf $NEWDIR" echo "% git worktree prune" echo } ccm_setup() { sudo ifconfig lo0 alias 127.0.0.2 up sudo ifconfig lo0 alias 127.0.0.3 up sudo ifconfig lo0 alias 127.0.0.4 up sudo ifconfig lo0 alias 127.0.0.5 up sudo ifconfig lo0 alias 127.0.0.6 up sudo ifconfig lo0 alias 127.0.1.1 up sudo ifconfig lo0 alias 127.0.1.2 up sudo ifconfig lo0 alias 127.0.1.3 up sudo ifconfig lo0 alias 127.0.1.4 up sudo ifconfig lo0 alias 127.0.1.5 up sudo ifconfig lo0 alias 127.0.1.6 up }
{ "content_hash": "cdd2d79b9df99ab0f4e50c3fcece9cf2", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 130, "avg_line_length": 25.627906976744185, "alnum_prop": 0.5936479128856624, "repo_name": "devkmsg/dotfiles", "id": "3ce558bde85d8c9f45dfc183ccca711bb382fda3", "size": "5510", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "oh-my-zsh/custom/plugins/athompson/athompson.plugin.zsh", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "863" }, { "name": "Ruby", "bytes": "7567" }, { "name": "Shell", "bytes": "7284" }, { "name": "Vim script", "bytes": "645318" } ], "symlink_target": "" }
<?xml version='1.0' encoding='UTF-8'?> <eveapi version="2"> <currentTime>2013-08-02 00:46:10</currentTime> <result> <rowset name="messages" key="messageID" columns="messageID,senderID,sentDate,title,toCorpOrAllianceID,toCharacterIDs,toListID"> <row messageID="290285276" senderID="1" sentDate="2013-08-01 01:04:00" title="Corp mail" toCorpOrAllianceID="4" toCharacterIDs="" toListID="" senderTypeID="1380" /> <row messageID="290285275" senderID="2" sentDate="2013-08-01 01:04:00" title="Personal mail" toCorpOrAllianceID="" toCharacterIDs="5" toListID="" senderTypeID="1380" /> <row messageID="290285274" senderID="2" sentDate="2013-08-01 01:04:00" title="Message to mailing list" toCorpOrAllianceID="" toCharacterIDs="" toListID="128250439" read="0" /> <row messageID="290285278" senderID="2" sentDate="2013-08-01 01:04:00" title="Multi Personal mail" toCorpOrAllianceID="" toCharacterIDs="5,6,7" toListID="" senderTypeID="1386" /> <row messageID="290285279" senderID="2" sentDate="2013-08-01 01:04:00" title="Multi Message to mailing list" toCorpOrAllianceID="" toCharacterIDs="" toListID="128250439,141157801" senderTypeID="1376" /> </rowset> </result> <cachedUntil>2013-08-02 01:16:10</cachedUntil> </eveapi>
{ "content_hash": "7cc72540252d0cbda30b2a53a5615126", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 208, "avg_line_length": 84.06666666666666, "alnum_prop": 0.7208564631245044, "repo_name": "mstark/reve", "id": "be37b8d9ac49ca76d668455567409a418c2fcf2a", "size": "1261", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/xml/mail_messages.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "222073" } ], "symlink_target": "" }
<!DOCTYPE HTML> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Dragble example</title> <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body> <div class="content"> <h1>Dragble.js</h1> <h2>Examples</h2> <div class="demo"> <h4>No configuration</h4> <p>If providing no configuration, the elements will be freely draggable.</p> <div class="eventarea"> <div id="noConfigHandle" class="drag-obj marker" style="-webkit-transform:translate3d(100px, -50px, 0)"></div> </div> </div> <div class="demo"> <h4>Contain into element</h4> <p>When defining a containment, the draggable object will be restricted to move within the element's boundaries.</p> <div id="bindExample" class="eventarea bind-box"> <div id="boundEle" class="drag-obj marker"> <span class="handle">H</span> </div> </div> </div> <div id="horzDemo" class="demo"> <h4>Restriced to horizontal movement</h4> <p>It is possible to restrict movement to horizontal or vertical only.</p> <div class="eventarea"> <div id="horzEle" class="drag-obj marker"></div> </div> </div> </div> <a href="https://github.com/albertogasparin/dragble"> <img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"> </a> <script src="../lib/dragble.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" charset="utf-8"> (function() { // Creating and configuring Dragble examples window.no_config = new Dragble('#noConfigHandle'); window.bind_demo = new Dragble('#boundEle', {containment: '#bindExample', handle: '.handle'} ); window.horz_demo = new Dragble('#horzEle', {axis:'x', containment: "#horzDemo"} ); })(); </script> </body> </html>
{ "content_hash": "1efe7b39196c57c3bf69aade7e2c80b7", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 171, "avg_line_length": 34.26229508196721, "alnum_prop": 0.5956937799043063, "repo_name": "albertogasparin/Dragble", "id": "56420cb7afd3258c9c2ea963269ac84102e5d356", "size": "2090", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "example/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2931" }, { "name": "HTML", "bytes": "2090" }, { "name": "JavaScript", "bytes": "7592" } ], "symlink_target": "" }
/* Generated by CIL v. 1.7.0 */ /* print_CIL_Input is false */ struct _IO_FILE; struct timeval; extern void signal(int sig , void *func ) ; extern float strtof(char const *str , char const *endptr ) ; typedef struct _IO_FILE FILE; extern int atoi(char const *s ) ; extern double strtod(char const *str , char const *endptr ) ; extern int fclose(void *stream ) ; extern void *fopen(char const *filename , char const *mode ) ; extern void abort() ; extern void exit(int status ) ; extern int raise(int sig ) ; extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ; extern int strcmp(char const *a , char const *b ) ; extern int rand() ; extern unsigned long strtoul(char const *str , char const *endptr , int base ) ; void RandomFunc(unsigned short input[1] , unsigned short output[1] ) ; extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ; extern int gettimeofday(struct timeval *tv , void *tz , ...) ; extern int printf(char const *format , ...) ; int main(int argc , char *argv[] ) ; void megaInit(void) ; extern unsigned long strlen(char const *s ) ; extern long strtol(char const *str , char const *endptr , int base ) ; extern unsigned long strnlen(char const *s , unsigned long maxlen ) ; extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ; struct timeval { long tv_sec ; long tv_usec ; }; extern void *malloc(unsigned long size ) ; extern int scanf(char const *format , ...) ; void megaInit(void) { { } } int main(int argc , char *argv[] ) { unsigned short input[1] ; unsigned short output[1] ; int randomFuns_i5 ; unsigned short randomFuns_value6 ; int randomFuns_main_i7 ; { megaInit(); if (argc != 2) { printf("Call this program with %i arguments\n", 1); exit(-1); } else { } randomFuns_i5 = 0; while (randomFuns_i5 < 1) { randomFuns_value6 = (unsigned short )strtoul(argv[randomFuns_i5 + 1], 0, 10); input[randomFuns_i5] = randomFuns_value6; randomFuns_i5 ++; } RandomFunc(input, output); if (output[0] == 41679) { printf("You win!\n"); } else { } randomFuns_main_i7 = 0; while (randomFuns_main_i7 < 1) { printf("%u\n", output[randomFuns_main_i7]); randomFuns_main_i7 ++; } } } void RandomFunc(unsigned short input[1] , unsigned short output[1] ) { unsigned short state[1] ; unsigned short local1 ; { state[0UL] = (input[0UL] - 51238316UL) - (unsigned short)47038; local1 = 0UL; while (local1 < (unsigned short)0) { if (state[0UL] > local1) { state[0UL] = (state[local1] >> ((state[local1] & (unsigned short)15) | 1UL)) | (state[local1] << (16 - ((state[local1] & (unsigned short)15) | 1UL))); } else { state[0UL] = (state[local1] << (((state[local1] >> (unsigned short)2) & (unsigned short)15) | 1UL)) | (state[local1] >> (16 - (((state[local1] >> (unsigned short)2) & (unsigned short)15) | 1UL))); } local1 ++; } output[0UL] = ((state[0UL] << (unsigned short)1) | (state[0UL] >> (unsigned short)15)) >> (unsigned short)1; } }
{ "content_hash": "61be46ac5e622bda7ffcef29847d1c1d", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 202, "avg_line_length": 31.804123711340207, "alnum_prop": 0.6324149108589951, "repo_name": "tum-i22/obfuscation-benchmarks", "id": "f0493228be15dcce7aa60d3ddd071a4e6593ac83", "size": "3085", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "tigress-generated-programs/empty-Seed1-RandomFuns-Type_short-ControlStructures_9-BB1-ForBound_boundedInput-Operators_PlusA_MinusA_Lt_Gt_Le_Ge_Eq_Ne_Mult_Div_Mod_Shiftlt_Shiftrt_BAnd_BXor_BOr.c", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "15981335" }, { "name": "Python", "bytes": "2305" }, { "name": "R", "bytes": "17310" }, { "name": "Shell", "bytes": "12819" } ], "symlink_target": "" }
import unittest from programy.dialog import Sentence, Question, Conversation from programy.bot import Bot from programy.brain import Brain from programy.config.brain import BrainConfiguration from programy.config.bot import BotConfiguration ############################################################################# # class SentenceTests(unittest.TestCase): def test_sentence_creation_empty(self): sentence = Sentence("") self.assertIsNotNone(sentence) self.assertEqual(0, sentence.num_words()) with self.assertRaises(Exception): sentence.sentence.word(0) def test_sentence_creation_spaces(self): sentence = Sentence(" ") self.assertIsNotNone(sentence) self.assertEqual(0, sentence.num_words()) with self.assertRaises(Exception): sentence.sentence.word(0) def test_split_into_words(self): sentence = Sentence("HELLO") self.assertIsNotNone(sentence) self.assertEqual(1, sentence.num_words()) self.assertEqual("HELLO", sentence.word(0)) self.assertEqual("HELLO", sentence.words_from_current_pos(0)) with self.assertRaises(Exception): sentence.sentence.word(1) self.assertEqual("HELLO", sentence.text()) def test_sentence_creation_one_word(self): sentence = Sentence("One") self.assertIsNotNone(sentence) self.assertEqual(1, sentence.num_words()) with self.assertRaises(Exception): sentence.sentence.word(1) self.assertEqual("One", sentence.text()) def test_sentence_creation_two_words(self): sentence = Sentence("One Two") self.assertIsNotNone(sentence) self.assertEqual(2, sentence.num_words()) self.assertEqual("One", sentence.word(0)) self.assertEqual("Two", sentence.word(1)) with self.assertRaises(Exception): sentence.sentence.word(2) self.assertEqual("One Two", sentence.text()) def test_sentence_creation_two_words_diff_split_char(self): sentence = Sentence("One,Two", ",") self.assertIsNotNone(sentence) self.assertEqual(2, sentence.num_words()) self.assertEqual("One", sentence.word(0)) self.assertEqual("Two", sentence.word(1)) with self.assertRaises(Exception): sentence.sentence.word(2) self.assertEqual("One Two", sentence.text()) def test_words_from_current_pos(self): sentence = Sentence("One Two Three") self.assertIsNotNone(sentence) self.assertEqual("One Two Three", sentence.words_from_current_pos(0)) self.assertEqual("Two Three", sentence.words_from_current_pos(1)) self.assertEqual("Three", sentence.words_from_current_pos(2)) with self.assertRaises(Exception): self.assertEqual("Three", sentence.words_from_current_pos(3)) self.assertEqual("One Two Three", sentence.text()) ############################################################################# # class QuestionTests(unittest.TestCase): def test_question_no_sentences_empty(self): question = Question.create_from_text("") self.assertIsNotNone(question) self.assertEqual(0, len(question.sentences)) def test_question_no_sentences_blank(self): question = Question.create_from_text(" ") self.assertIsNotNone(question) self.assertEqual(0, len(question.sentences)) def test_question_one_sentence(self): question = Question.create_from_text("Hello There") self.assertIsNotNone(question) self.assertEqual(1, len(question.sentences)) def test_question_multi_sentence(self): question = Question.create_from_text("Hello There. How Are you") self.assertIsNotNone(question) self.assertEqual(2, len(question.sentences)) self.assertEqual("Hello There", question.sentence(0).text()) self.assertEqual("How Are you", question.sentence(1).text()) with self.assertRaises(Exception): question.sentence(2) def test_question_create_from_sentence(self): sentence = Sentence("One Two Three") question = Question.create_from_sentence(sentence) self.assertIsNotNone(question) self.assertEqual(1, len(question.sentences)) self.assertEqual(sentence.text(), question.sentence(0).text()) with self.assertRaises(Exception): question.sentence(1) def test_question_create_from_question(self): question = Question.create_from_text("Hello There") new_question = Question.create_from_question(question) self.assertIsNotNone(new_question) self.assertEqual(1, len(new_question.sentences)) self.assertEqual("Hello There", question.sentence(0).text()) with self.assertRaises(Exception): question.sentence(1) def test_combine_answers(self): question = Question() sentence1 = Sentence("Hi") sentence1._response = "Hello" question._sentences.append(sentence1) sentence2 = Sentence("Hi Again") question._sentences.append(sentence2) sentence2._response = "World" self.assertEqual(2, len(question._sentences)) self.assertEqual(question._sentences[0]._response, "Hello") self.assertEqual(question._sentences[1]._response, "World") sentences = question.combine_sentences() self.assertEqual("Hi. Hi Again", sentences) combined = question.combine_answers() self.assertIsNotNone(combined) self.assertEqual(combined, "Hello. World") def test_next_previous_sentences(self): question = Question.create_from_text("Hello There. How Are you") self.assertEqual("How Are you", question.current_sentence().text()) # TODO This should be 1 and will need to be changed in the code too self.assertEqual("Hello There", question.previous_sentence(2).text()) ############################################################################# # class ConversationTests(unittest.TestCase): def test_conversation(self): test_brain = Brain(BrainConfiguration()) test_bot = Bot(test_brain, BotConfiguration()) conversation = Conversation("test", test_bot, max_histories=3) self.assertIsNotNone(conversation) self.assertIsNotNone(conversation._bot) self.assertIsNotNone(conversation._clientid) self.assertEqual(conversation._clientid, "test") self.assertEqual(0, len(conversation._questions)) self.assertEqual(3, conversation._max_histories) self.assertEqual(1, len(conversation._predicates)) with self.assertRaises(Exception): conversation.current_question() with self.assertRaises(Exception): conversation.nth_question(0) question1 = Question.create_from_text("Hello There") conversation.record_dialog(question1) self.assertEqual(1, len(conversation.all_sentences())) self.assertEqual(question1, conversation.current_question()) self.assertEqual(question1, conversation.nth_question(1)) with self.assertRaises(Exception): conversation.nth_question(2) questions = conversation.all_sentences() self.assertEqual(1, len(questions)) question2 = Question.create_from_text("Hello There Again") conversation.record_dialog(question2) self.assertEqual(2, len(conversation.all_sentences())) self.assertEqual(question2, conversation.current_question()) self.assertEqual(question2, conversation.nth_question(1)) with self.assertRaises(Exception): conversation.nth_question(3) questions = conversation.all_sentences() self.assertEqual(2, len(questions)) question3 = Question.create_from_text("Hello There Again Again") conversation.record_dialog(question3) self.assertEqual(3, len(conversation.all_sentences())) self.assertEqual(question3, conversation.current_question()) self.assertEqual(question3, conversation.nth_question(1)) with self.assertRaises(Exception): conversation.nth_question(4) questions = conversation.all_sentences() self.assertEqual(3, len(questions)) # Max Histories for this test is 3 # Therefore we should see the first question, pop of the stack question4 = Question.create_from_text("Hello There Again Again Again") conversation.record_dialog(question4) self.assertEqual(3, len(conversation.all_sentences())) self.assertEqual(question4, conversation.current_question()) self.assertEqual(question4, conversation.nth_question(1)) with self.assertRaises(Exception): conversation.nth_question(5) questions = conversation.all_sentences() self.assertEqual(3, len(questions))
{ "content_hash": "616f257538901f09f8809fe632c7f1f8", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 78, "avg_line_length": 41.58139534883721, "alnum_prop": 0.6533557046979865, "repo_name": "JustArchi/program-y", "id": "4cc48e9626c1fd2a54f7674b91cc13a5be8a8a20", "size": "8940", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/test/test_dialog.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "937" }, { "name": "HTML", "bytes": "1580" }, { "name": "Python", "bytes": "1027605" }, { "name": "Shell", "bytes": "2835" } ], "symlink_target": "" }
namespace rocksdb { // An interface for converting a slice to a readable string class SliceFormatter { public: virtual ~SliceFormatter() {} virtual std::string Format(const Slice& s) const = 0; }; // Options for customizing ldb tool (beyond the DB Options) struct LDBOptions { // Create LDBOptions with default values for all fields LDBOptions(); // Key formatter that converts a slice to a readable string. // Default: Slice::ToString() std::shared_ptr<SliceFormatter> key_formatter; std::string print_help_header = "ldb - RocksDB Tool"; }; class LDBTool { public: void Run( int argc, char** argv, Options db_options = Options(), const LDBOptions& ldb_options = LDBOptions(), const std::vector<ColumnFamilyDescriptor>* column_families = nullptr); }; } // namespace rocksdb #endif // ROCKSDB_LITE
{ "content_hash": "3349b69df217c7e1ac2c8e45de899503", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 76, "avg_line_length": 26.375, "alnum_prop": 0.7049763033175356, "repo_name": "fceller/arangodb", "id": "636605ff7faad78b1194900e6bc9945f418c64ec", "size": "1229", "binary": false, "copies": "4", "ref": "refs/heads/devel", "path": "3rdParty/rocksdb/6.2/include/rocksdb/ldb_tool.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ada", "bytes": "89080" }, { "name": "AppleScript", "bytes": "1429" }, { "name": "Assembly", "bytes": "142084" }, { "name": "Batchfile", "bytes": "9073" }, { "name": "C", "bytes": "1938354" }, { "name": "C#", "bytes": "55625" }, { "name": "C++", "bytes": "79379178" }, { "name": "CLIPS", "bytes": "5291" }, { "name": "CMake", "bytes": "109718" }, { "name": "CSS", "bytes": "1341035" }, { "name": "CoffeeScript", "bytes": "94" }, { "name": "DIGITAL Command Language", "bytes": "27303" }, { "name": "Emacs Lisp", "bytes": "15477" }, { "name": "Go", "bytes": "1018005" }, { "name": "Groff", "bytes": "263567" }, { "name": "HTML", "bytes": "459886" }, { "name": "JavaScript", "bytes": "55446690" }, { "name": "LLVM", "bytes": "39361" }, { "name": "Lua", "bytes": "16189" }, { "name": "Makefile", "bytes": "178253" }, { "name": "Module Management System", "bytes": "1545" }, { "name": "NSIS", "bytes": "26909" }, { "name": "Objective-C", "bytes": "4430" }, { "name": "Objective-C++", "bytes": "1857" }, { "name": "Pascal", "bytes": "145262" }, { "name": "Perl", "bytes": "227308" }, { "name": "Protocol Buffer", "bytes": "5837" }, { "name": "Python", "bytes": "3563935" }, { "name": "Ruby", "bytes": "1000962" }, { "name": "SAS", "bytes": "1847" }, { "name": "Scheme", "bytes": "19885" }, { "name": "Shell", "bytes": "488846" }, { "name": "VimL", "bytes": "4075" }, { "name": "Yacc", "bytes": "36950" } ], "symlink_target": "" }
'use strict'; angular.module("ringo.controllers") .controller("dashboardController", ["$scope", "$route", "$location", "ringoAppService", "localStorageService", "serverApiService", "commonService", "geoLocationService", function ($scope, $route, $location, ringoAppService, localStorageService, serverApiService, commonService, geoLocationService) { $scope.haveFamilyPlaces = true; $scope.numberOfNewMessages = 0; $scope.visibilityOptions = false; $scope.viewOverlay = false; var calculateNumberOfMessages = function (dashboard) { $scope.numberOfNewMessages = 0; if (dashboard.messages && dashboard.messages.unread) { for (var id in dashboard.messages.unread) { if (dashboard.messages.unread.hasOwnProperty(id)) { $scope.numberOfNewMessages += +dashboard.messages.unread[id]; } } } }; var readDashboard = function () { var places = ringoAppService.getPlacesInDashboardFormat(true); var family = ringoAppService.getFamilyInDashboardFormat(); var friends = ringoAppService.getFriendsInDashboardFormat(false, true, true); // to avoid binking in angular when we update dashboard, we check here if there are really changes var placesStringified = JSON.stringify(places); if (placesStringified !== $scope.placesStringified) { $scope.places = places; $scope.placesStringified = placesStringified; } var familyStringified = JSON.stringify(family); if (familyStringified !== $scope.familyStringified) { $scope.family = family; $scope.familyStringified = familyStringified; } var friendsStringified = JSON.stringify(friends); if (friendsStringified !== $scope.friendsStringified) { $scope.friends = friends; $scope.friendsStringified = friendsStringified; } $scope.hasFamilyMembers = false; var dashboard = ringoAppService.getDashboard(); if (dashboard) { calculateNumberOfMessages(dashboard); if (dashboard.family) { $scope.haveFamilyPlaces = (!commonService.isObjectEmpty(dashboard.family.places) || ($scope.places.length > 0)); if (dashboard.family.members) { $scope.hasFamilyMembers = !commonService.isObjectEmpty(dashboard.family.members); } } if (dashboard.userInvitingToJoinFamily && dashboard.userInvitingToJoinFamily !== "") { serverApiService.readUserData(dashboard.userInvitingToJoinFamily, function (status, userData) { // dashboard maybe was updated already and we may not have inviting user anymore var stillHaveInvitingUser = (ringoAppService.getDashboard() && ringoAppService.getDashboard().userInvitingToJoinFamily && ringoAppService.getDashboard().userInvitingToJoinFamily !== ""); if (status === true && stillHaveInvitingUser) { //console.log("Inviting user: " + JSON.stringify(userData)); $scope.safeApply(function () { $scope.invitingUser = userData; }); } else { console.log("No inviting user: " + status); $scope.safeApply(function () { $scope.invitingUser = undefined; }); } }); } else { $scope.safeApply(function () { $scope.invitingUser = undefined; }); } //--------------------------------------------------- // SETTINGS per family //--------------------------------------------------- var settings = {}; //$scope.userName = dashboard.name; if (dashboard.settings) { settings = dashboard.settings; if (settings.enableNotifications === undefined) { settings.enableNotifications = true;// notifications are enabled by default } if (settings.messagesNotifications === undefined) { settings.messagesNotifications = true;// messages notifications are true by default } if (settings.familyNotifications === undefined) { settings.familyNotifications = true;// family notifications are true by default } if (settings.friendsNotifications === undefined) { settings.friendsNotifications = true;// friends notifications are true by default } if (settings.friendsNearbyNotifications === undefined) { settings.friendsNearbyNotifications = true;// friends nearby notifications are true by default } if (settings.peopleNotifications === undefined) { settings.peopleNotifications = {}; } if (settings.peopleNotifications.sendAllLocationAlerts === undefined) { settings.peopleNotifications.sendAllLocationAlerts = true;// send all by default } } $scope.settings = settings; if ($scope.settings.visibilityMode) $scope.setVisibility($scope.settings.visibilityMode); } }; var sendNewSettingsToServer = function () { serverApiService.updateCurrentUserInfo({settings: $scope.settings}, function (success) { console.log("updateCurrentUserInfo returned: " + success); if (success !== true) { commonService.showMessageToUser("error.failedToUpdateUserSettings", "error.title.error"); return; } }); }; $scope.$on('dashboardUpdated', function () { //console.log("got event dashboardUpdated"); $scope.safeApply(function () { readDashboard(); }); }); $scope.onAvatarClick = function ($event, member) { $event.stopPropagation(); if (member.invitingFriend) { $location.path('/acceptFriendInvitation/' + member.userId); } else { if (member.isFriend) { $location.path("/friendDetails/" + member.userId); } else { $location.path("/familyMemberDetails/" + member.userId); } } }; $scope.onPlaceClick = function (place) { if (place.isEditable) { $location.path("/placeDetails/" + place.name); } }; $scope.notificationsPanelButtonClicked = function() { //$scope.returnPath = "dashboard"; $location.path("/notifications"); } $scope.onGroupClick = function() { $location.path("/groupDetails"); } $scope.addToFamily = function () { $location.path("/inviteFamilyMember"); }; $scope.addToFriends = function () { $location.path("/inviteFriend"); }; $scope.menuButtonClicked = function () { $location.path('/settings'); }; $scope.chatsButtonClicked = function () { $location.path('/chat/family'); }; $scope.tellMeHowButtonClicked = function () { commonService.showMessageToUser("error.tellMeHowNotImplementedYet", "error.title.notImplemented"); }; $scope.emotionsButtonClicked = function () { commonService.showMessageToUser("error.emotionsNotImplementedYet", "error.title.notImplemented"); }; $scope.viewFamilyInvitation = function () { if ($scope.invitingUser) { localStorageService.setValue("joinFamilyControllerInvitingUser", JSON.stringify($scope.invitingUser)); $location.path('/joinFamily'); } }; $scope.createNewPlace = function () { $location.path('/place/new'); }; $scope.changeVisibilityForGroup = function () { $scope.visibilityOptions = !$scope.visibilityOptions; $scope.viewOverlay = false; }; $scope.showOverlay = function () { $scope.viewOverlay = !$scope.viewOverlay; $scope.visibilityOptions = false; //console.log("showOverlay clicked: viewOverlay is " + $scope.viewOverlay); }; $scope.setVisibility = function (mode) { // TODO: set visibilityMode for the selected family, and push to the server. if (mode == 2) { // ON $scope.settings.enableNotifications = true; $scope.settings.messagesNotifications = true; $scope.settings.familyNotifications = true; $scope.settings.peopleNotifications.sendAllLocationAlerts = true; geoLocationService.enableGeoLocationTracking(); $scope.visibilityClass = "icon-visibility-on"; } else if (mode == 1) { // Invisible $scope.settings.enableNotifications = true; $scope.settings.messagesNotifications = true; $scope.settings.familyNotifications = true; $scope.settings.peopleNotifications.sendAllLocationAlerts = true; geoLocationService.stopGeoLocationTracking(); $scope.visibilityClass = "icon-visibility-invisible"; } if (mode == 0) { // OFF $scope.settings.enableNotifications = false; geoLocationService.stopGeoLocationTracking(); $scope.visibilityClass = "icon-visibility-off"; } $scope.settings.friendsNotifications = false; $scope.settings.friendsNearbyNotifications = false; $scope.settings.visibilityMode = mode; sendNewSettingsToServer(); $scope.visibilityOptions = false; //$scope.visibilityClass = "icon-visibility-off"; console.log("VisibilityMode: " + $scope.settings.visibilityMode); console.log("VisibilityClass: " + $scope.visibilityClass); }; $scope.cssClassForPlace = function (place) { var length = !angular.isUndefined(place.atPlace) && place.atPlace.length; var style = "house_pyramid"; if (place.type) { style = place.type; } if (length === 2) { return "twoAvatars " + style; } else if (length === 3) { return "threeAvatars " + style; } else if (length > 3) { return "fullAvatars " + style; } else { return style; } }; var getMemberFadeCSSClass = function (member) { var curTime = Date.now(); var minutes = (curTime - member.lastReport) / 1000 / 60; if (member.lastReport === 0 || member.lastReport === undefined) { return "fade-100-percent";// not reported yet } if (minutes < 60) { return ""; } if (minutes < 60 * 4) { return "fade-25-percent"; } if (minutes < 60 * 8) { return "fade-50-percent"; } if (minutes < 60 * 16) { return "fade-75-percent"; } return "fade-100-percent"; }; $scope.cssClassForAvatarHalo = function (member) { var cssClass = getMemberFadeCSSClass(member); if (member.isCurrentUser) { return cssClass + " yourself"; } if (member.isFriend) { return "friend";//friends don't fade } return cssClass; }; $scope.leftArrowClick = function($event){ $event.stopPropagation(); console.log("Dashboard left arrow clicked"); }; $scope.rightArrowClick = function($event){ $event.stopPropagation(); console.log("Dashboard right arrow clicked"); }; ringoAppService.refreshDashboard(); readDashboard(); }]) ;
{ "content_hash": "72440f580827231b3427c53a62e3a152", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 214, "avg_line_length": 44.53503184713376, "alnum_prop": 0.4892019450800915, "repo_name": "F-Secure/lokki-ios", "id": "b27f5a83b615ecee1d8719badf46247d93f69b75", "size": "14135", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "www/js/controllers/dashboardController.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1025" }, { "name": "C++", "bytes": "3625" }, { "name": "CSS", "bytes": "63078" }, { "name": "D", "bytes": "48611" }, { "name": "JavaScript", "bytes": "1368398" }, { "name": "Objective-C", "bytes": "1717395" }, { "name": "Perl", "bytes": "890" }, { "name": "Shell", "bytes": "8255" } ], "symlink_target": "" }
using Newtonsoft.Json.Linq; namespace OrchardCore.ContentManagement.Metadata.Models { public class ContentPartFieldDefinition : ContentDefinition { public ContentPartFieldDefinition(ContentFieldDefinition contentFieldDefinition, string name, JObject settings) { Name = name; FieldDefinition = contentFieldDefinition; Settings = settings; } public ContentFieldDefinition FieldDefinition { get; private set; } public ContentPartDefinition PartDefinition { get; set; } } }
{ "content_hash": "1e3b3398b11727a3be02f6d3e39ef791", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 119, "avg_line_length": 32.94117647058823, "alnum_prop": 0.7017857142857142, "repo_name": "petedavis/Orchard2", "id": "b011bbc51c71ff14d72186c43a2fdc85c7e9f5d7", "size": "560", "binary": false, "copies": "6", "ref": "refs/heads/spatial", "path": "src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Models/ContentPartFieldDefinition.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C#", "bytes": "2965569" }, { "name": "CSS", "bytes": "1051211" }, { "name": "HTML", "bytes": "37155" }, { "name": "JavaScript", "bytes": "1875847" }, { "name": "Liquid", "bytes": "8676" }, { "name": "PHP", "bytes": "1241" } ], "symlink_target": "" }
class CitrixReceiver < Cask url 'http://downloadplugins.citrix.com.edgesuite.net/Mac/CitrixReceiverWeb.dmg' homepage 'http://www.citrix.com/receiver' version 'latest' no_checksum install 'Install Citrix Receiver.pkg' uninstall :launchctl => [ 'com.citrix.AuthManager_Mac', 'com.citrix.ReceiverHelper', 'com.citrix.ServiceRecords', ], :quit => [ 'Citrix.ServiceRecords', 'com.citrix.ReceiverHelper', ], :pkgutil => 'com.citrix.ICAClient' end
{ "content_hash": "644b06af933166ddc3f8900d4a73b668", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 81, "avg_line_length": 39.470588235294116, "alnum_prop": 0.5022354694485842, "repo_name": "rzyns/homebrew-cask", "id": "eeea5fe39e4ded29864197d4f7dc1b1a5652954a", "size": "671", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Casks/citrix-receiver.rb", "mode": "33188", "license": "bsd-2-clause", "language": [], "symlink_target": "" }
alias ls='ls -GFh' # Same as above, but in long listing format alias ll='ls -GFhl' alias ri='ri -Tf ansi' alias mysql='mysql -u root' alias mysqladmin='mysqladmin -u root' alias be='bundle exec' alias bx='bundle exec' alias gentags='ctags . && rm .tags;mv tags .tags' alias rake='noglob rake' alias bower='noglob bower'
{ "content_hash": "6208128197fdce69d66c02a7a578b394", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 49, "avg_line_length": 20.3125, "alnum_prop": 0.7076923076923077, "repo_name": "jwtouron/dotfiles", "id": "0f02fe4ecda83ae44a8978ce909400586f53b028", "size": "408", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": ".zsh/aliases.zsh", "mode": "33188", "license": "mit", "language": [ { "name": "Emacs Lisp", "bytes": "14380" }, { "name": "Shell", "bytes": "9427" } ], "symlink_target": "" }
package org.apache.commons.fileupload2; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.apache.commons.fileupload2.disk.DiskFileItemFactory; import org.apache.commons.fileupload2.portlet.PortletFileUpload; import org.apache.commons.fileupload2.servlet.ServletFileUpload; import org.apache.commons.fileupload2.servlet.ServletRequestContext; /** * Test utility methods. * * @since 1.4 */ public class Util { public static List<FileItem> parseUpload(final FileUpload upload, final byte[] bytes) throws FileUploadException { return parseUpload(upload, bytes, Constants.CONTENT_TYPE); } public static List<FileItem> parseUpload(final FileUpload upload, final byte[] bytes, final String contentType) throws FileUploadException { final HttpServletRequest request = new MockHttpServletRequest(bytes, contentType); return upload.parseRequest(new ServletRequestContext(request)); } public static List<FileItem> parseUpload(final FileUpload upload, final String content) throws UnsupportedEncodingException, FileUploadException { final byte[] bytes = content.getBytes(StandardCharsets.US_ASCII); return parseUpload(upload, bytes, Constants.CONTENT_TYPE); } /** * Return a list of {@link FileUpload} implementations for parameterized tests. * @return a list of {@link FileUpload} implementations */ public static List<FileUpload> fileUploadImplementations() { return Arrays.asList( new ServletFileUpload(new DiskFileItemFactory()), new PortletFileUpload(new DiskFileItemFactory())); } }
{ "content_hash": "e038b0ab6f108f5a4e566af4c6c1aaef", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 118, "avg_line_length": 37.145833333333336, "alnum_prop": 0.7459338194054963, "repo_name": "apache/commons-fileupload", "id": "19b85fb5e65b8e828300a67e80714ed5d91713a6", "size": "2585", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/java/org/apache/commons/fileupload2/Util.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "405696" }, { "name": "Shell", "bytes": "943" } ], "symlink_target": "" }
<!DOCTYPE html> <!--html5--> <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <!-- Mirrored from arduino.cc/en/Reference/DigitalWrite by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 06 Feb 2015 20:13:18 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack --> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta charset="utf-8" /> <title>Arduino - DigitalWrite </title> <link rel="shortcut icon" type="image/x-icon" href="../favicon.png" /> <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> <link rel="stylesheet" href="../../fonts/fonts.css" type="text/css" /> <link rel="stylesheet" href="../../css/arduino-icons.css"> <link rel="stylesheet" href="../../css/animation.css"><!--[if IE 7]> <link rel="stylesheet" href="http://arduino.cc/css/arduino-icons-ie7.css"><![endif]--> <!--[if gte IE 9]><!--> <link rel='stylesheet' href='../../css/foundation2.css' type='text/css' /> <!--<![endif]--> <!--[if IE 8]> <link rel='stylesheet' href='http://arduino.cc/css/foundation_ie8.css' type='text/css' /> <![endif]--> <link rel='stylesheet' href='../../css/arduino_code_highlight.css' type='text/css' /> <link rel="stylesheet" type="text/css" media="screen" href="../../css/typeplate.css"> <link rel='stylesheet' href='../pub/skins/arduinoWide_SSO/css/arduinoWide_SSO.css' type='text/css' /> <link rel='stylesheet' href='../../css/common.css' type='text/css' /> <link rel="stylesheet" href="../../css/download_page.css" /> <link href="https://plus.google.com/114839908922424087554" rel="publisher" /> <!-- embedded JS and CSS from PmWiki plugins --> <!--HeaderText--><style type='text/css'><!-- ul, ol, pre, dl, p { margin-top:0px; margin-bottom:0px; } code { white-space: nowrap; } .vspace { margin-top:1.33em; } .indent { margin-left:40px; } .outdent { margin-left:40px; text-indent:-40px; } a.createlinktext { text-decoration:none; border-bottom:1px dotted gray; } a.createlink { text-decoration:none; position:relative; top:-0.5em; font-weight:bold; font-size:smaller; border-bottom:none; } img { border:0px; } span.anchor { float: left; font-size: 10px; margin-left: -10px; width: 10px; position:relative; top:-0.1em; text-align: center; } span.anchor a { text-decoration: none; } span.anchor a:hover { text-decoration: underline; } ol.toc { text-indent:-20px; list-style: none; } ol.toc ol.toc { text-indent:-40px; } div.tocfloat { font-size: smaller; margin-bottom: 10px; border-top: 1px dotted #555555; border-bottom: 1px dotted #555555; padding-top: 5px; padding-bottom: 5px; width: 38%; float: right; margin-left: 10px; clear: right; margin-right:-13px; padding-right: 13px; padding-left: 13px; background-color: #eeeeee; } div.toc { font-size: smaller; padding: 5px; border: 1px dotted #cccccc; background: #f7f7f7; margin-bottom: 10px; } div.toc p { background-color: #f9f6d6; margin-top:-5px; padding-top: 5px; margin-left:-5px; padding-left: 5px; margin-right:-5px; padding-right: 5px; padding-bottom: 3px; border-bottom: 1px dotted #cccccc; }.editconflict { color:green; font-style:italic; margin-top:1.33em; margin-bottom:1.33em; } table.markup { border: 2px dotted #ccf; width:90%; } td.markup1, td.markup2 { padding-left:10px; padding-right:10px; } td.markup1 { border-bottom: 1px solid #ccf; } div.faq { margin-left:2em; } div.faq p.question { margin: 1em 0 0.75em -2em; font-weight:bold; } div.faq hr { margin-left: -2em; } .frame { border:1px solid #cccccc; padding:4px; background-color:#f9f9f9; } .lfloat { float:left; margin-right:0.5em; } .rfloat { float:right; margin-left:0.5em; } a.varlink { text-decoration:none; } --></style><script type="text/javascript"> function toggle(obj) { var elstyle = document.getElementById(obj).style; var text = document.getElementById(obj + "tog"); if (elstyle.display == 'none') { elstyle.display = 'block'; text.innerHTML = "hide"; } else { elstyle.display = 'none'; text.innerHTML = "show"; } } </script> <meta name='robots' content='index,follow' /> <script src="http://arduino.cc/js/vendor/custom.modernizr.js"></script> <!-- do not remove none of those lines, comments embedding in pages will break! --> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js" type="text/javascript"></script> <script src="http://arduino.cc/en/pub/js/newsletter_subscribe_popup.js" type="text/javascript"></script> <script src="https://checkout.stripe.com/checkout.js" type="text/javascript"></script> <script src="https://arduino.cc/en/pub/js/software_download.js" type="text/javascript"></script><!-- keep https! --> <link rel='stylesheet' href='../../../code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.min.css' type='text/css' /> <script src="http://arduino.cc/tools/comments/extern/?s=wiki" type="text/javascript"></script> </head> <body> <div id="menuWings" class="fixed"></div> <div id="page"> <script> var userAgent = (navigator.userAgent || navigator.vendor || window.opera).toLowerCase(); if(userAgent.indexOf('mac')>0){ $("head").append('<style type="text/css">@-moz-document url-prefix() {h1 a, h2 a, h3 a, h4 a, h5 a, h1 a:hover, h2 a:hover, th a, th a:hover, h3 a:hover, h4 a:hover, h5 a:hover, #wikitext h2 a:hover, #wikitext h3 a:hover, #wikitext h4 a:hover {padding-bottom: 0.5em!important;} #pageheader .search input{font-family: "TyponineSans Regular 18";} #pagefooter .monospace{margin-top: -4px;} #navWrapper ul.left &gt; li{margin-top: -2px; padding-bottom: 2px;}#navWrapper ul.right &gt; li{margin-top: -5px; padding-bottom: 5px;}#navWrapper ul.right &gt; li ul{margin-top: 4px;} .slider-container .fixed-caption p{padding:8px 0 14px 0}}</style>'); } </script> <!--[if IE]> <link rel='stylesheet' href='https://id.arduino.cc//css/ie-monospace.css' type='text/css' /> <![endif]--> <div id="menuWings" class="fixed"></div> <!--[if IE 8]> <div class="alert-box panel ie8alert"> <p><strong>Arduino.cc offers limited compatibility for Internet Explorer 8. Get a modern browser as Chrome, Firefox or Safari.</strong></p> <a href="" class="close">&times;</a> </div> <![endif]--> <div id="pageheader"> <div class="row" class="contain-to-grid"> <div class="small-6 large-8 eight columns"> <div class="title"><a href="http://arduino.cc/">Arduino</a></div> </div> <div class="small-6 large-4 four columns search"> <div class="row collapse"> <form method="GET" action="http://www.google.com/search"> <div class="small-12 twelve columns"> <i class="icon-search-2"></i> <input type="hidden" name="ie" value="UTF-8"> <input type="hidden" name="oe" value="UTF-8"> <input type="text" name="q" size="25" maxlength="255" value="" placeholder="Search the Arduino Website"> <input type="submit" name="btnG" VALUE="search"> <input type="hidden" name="domains" value="http://arduino.cc"> <input type="hidden" name="sitesearch" value="http://arduino.cc"> </div> </form> </div> </div> </div> <!--[if gte IE 9]><!--> <div id="navWrapper" class="sticky"> <!--<![endif]--> <!--[if IE 8]> <div id="navWrapper"> <![endif]--> <nav class="top-bar" data-options="is_hover:true" > <ul class="title-area"> <li class="name"></li> </ul> <section class="top-bar-section"> <ul class="left"> <li id="navLogo"> <a href="http://arduino.cc/"> <img src="../../img/logo_46.png" alt="userpicture" /> </a> </li> <li id="navHome"><a href="http://arduino.cc/">Home</a></li> <li><a href="http://store.arduino.cc/">Buy</a></li> <li><a href="http://arduino.cc/en/Main/Software">Download</a></li> <li class="has-dropdown"><a href="#">Products</a> <ul class="dropdown"> <li><a href="http://arduino.cc/en/Main/Products">Arduino</a></li> <li><a href="http://arduino.cc/en/ArduinoAtHeart/Products">AtHeart</a></li> <li><a href="http://arduino.cc/en/ArduinoCertified/Products">Certified</a></li> </ul> </li> <li class="has-dropdown active"><a href="#">Learning</a> <ul class="dropdown"> <li><a href="../Guide/HomePage.html">Getting started</a></li> <li><a href="http://arduino.cc/en/Tutorial/HomePage">Examples</a></li> <li><a href="HomePage.html">Reference</a></li> <li><a href="http://playground.arduino.cc/">Playground</a></li> </ul> </li> <li><a href="http://forum.arduino.cc/">Forum</a></li> <li class="has-dropdown"><a href="#">Support</a> <ul class="dropdown"> <li><a href="../Main/FAQ.html">FAQ</a></li> <li><a href="http://arduino.cc/en/ContactUs">Contact Us</a></li> </ul> </li> <li><a href="http://blog.arduino.cc/">Blog</a></li> </ul> <ul class="right"> <li><a href="https://id.arduino.cc/auth/login/?returnurl=http%3A%2F%2Farduino.cc%2Fen%2FReference%2FDigitalWrite" class="cart">LOG IN</a></li> <li><a href="https://id.arduino.cc/auth/signup" class="cart">SIGN UP</a></li> </ul> </section> </nav> </div> </div> <br class="clear"/> <div id="pagetext"> <!--PageText--> <div id='wikitext'> <p><strong>Reference</strong> &nbsp; <a class='wikilink' href='HomePage.html'>Language</a> | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a> </p> <p class='vspace'></p><h2>digitalWrite()</h2> <h4>Description</h4> <p>Write a <a class='wikilink' href='Constants.html'>HIGH</a> or a <a class='wikilink' href='Constants.html'>LOW</a> value to a digital pin. </p> <p class='vspace'></p><p>If the pin has been configured as an OUTPUT with <a class='wikilink' href='PinMode.html'>pinMode</a>(), its voltage will be set to the corresponding value: 5V (or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW. </p> <p class='vspace'></p><p>If the pin is configured as an INPUT, digitalWrite() will enable (HIGH) or disable (LOW) the internal pullup on the input pin. It is recommended to set the <a class='wikilink' href='PinMode.html'>pinMode</a>() to <a class='wikilink' href='Constants.html'>INPUT_PULLUP</a> to enable the internal pull-up resistor. See the <a class='wikilink' href='http://arduino.cc/en/Tutorial/DigitalPins'>digital pins tutorial</a> for more information. </p> <p class='vspace'></p><p>NOTE: If you do not set the pinMode() to OUTPUT, and connect an LED to a pin, when calling digitalWrite(HIGH), the LED may appear dim. Without explicitly setting pinMode(), digitalWrite() will have enabled the internal pull-up resistor, which acts like a large current-limiting resistor. </p> <p class='vspace'></p><h4>Syntax</h4> <p>digitalWrite(pin, value) </p> <p class='vspace'></p><h4>Parameters</h4> <p>pin: the pin number </p> <p class='vspace'></p><p>value: <a class='wikilink' href='Constants.html'>HIGH</a> or <a class='wikilink' href='Constants.html'>LOW</a> </p> <p class='vspace'></p><h4>Returns</h4> <p>none </p> <p class='vspace'></p><h4>Example</h4> <pre> int ledPin = 13; // LED connected to digital pin 13 void setup() { pinMode(ledPin, OUTPUT); // sets the digital pin as output } void loop() { digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second } </pre> <p class='vspace'></p><p>Sets pin 13 to HIGH, makes a one-second-long delay, and sets the pin back to LOW. </p> <p class='vspace'></p><h4>Note</h4> <p>The analog input pins can be used as digital pins, referred to as A0, A1, etc. </p> <p class='vspace'></p><h4>See also</h4> <ul><li><a class='wikilink' href='PinMode.html'>pinMode</a>() </li><li><a class='wikilink' href='DigitalRead.html'>digitalRead</a>() </li><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/DigitalPins'>Tutorial: Digital Pins</a> </li></ul><p><a class='wikilink' href='HomePage.html'>Reference Home</a> </p> <p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://arduino.cc/forum/index.php/board,23.0.html' rel='nofollow'>Forum</a>.</em> </p> <p class='vspace'></p><p>The text of the Arduino reference is licensed under a <a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain. </p> </div> <!-- AddThis Button Style BEGIN --> <style> .addthis_toolbox { margin: 2em 0 1em; } .addthis_toolbox img { float: left; height: 25px; margin-right: 10px; width: auto; } .addthis_toolbox .social-container { float: left; height: 27px; width: auto; } .addthis_toolbox .social-container .social-content { float: left; margin-top: 2px; max-width: 0; overflow: hidden; -moz-transition: max-width .3s ease-out; -webkit-transition: max-width .3s ease-out; -o-transition: max-width .3s ease-out; transition: max-width .3s ease-out; } .addthis_toolbox .social-container:hover .social-content { max-width: 100px; -moz-transition: max-width .2s ease-in; -webkit-transition: max-width .2s ease-in; -o-transition: max-width .2s ease-in; transition: max-width .2s ease-in; } .addthis_toolbox .social-container .social-content a { float: left; margin-right: 5px; } .addthis_toolbox h3 { font-size: 24px; text-align: left; } </style> <!-- AddThis Button Style END --> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style"> <h3>Share</h3> <!-- FACEBOOK --> <div class="social-container"> <img src="../pub/skins/arduinoWide_SSO/img/facebook.png" /> <div class="social-content"> <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> </div> </div> <!-- TWITTER --> <div class="social-container"> <img src="../pub/skins/arduinoWide_SSO/img/twitter.png"> <div class="social-content"> <a class="addthis_button_tweet"></a> </div> </div> <!-- PINTEREST --> <div class="social-container"> <img src="../pub/skins/arduinoWide_SSO/img/pinterest.png"> <div class="social-content"> <a class="addthis_button_pinterest_pinit" pi:pinit:url="http://www.addthis.com/features/pinterest" pi:pinit:media="http://www.addthis.com/cms-content/images/features/pinterest-lg.png"></a> </div> </div> <!-- G+ --> <div class="social-container"> <img src="../pub/skins/arduinoWide_SSO/img/gplus.png"> <div class="social-content"> <a class="addthis_button_google_plusone" g:plusone:size="medium"></a> </div> </div> <script type="text/javascript">var addthis_config = {"data_track_addressbar":false};</script> <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-50573fab238b0d34"></script> </div> <!-- AddThis Button END --> </div> <!-- eof pagetext --> </div> <!-- eof page --> <!--PageFooterFmt--> <div id="pagefooter"> <div id="newsletterModal" class="reveal-modal small"> <form action="http://arduino.cc/subscribe.php" method="post" name="sendy-subscribe-form" id="sendy-subscribe-form" class="form-popup"> <div class="modalHeader"> <h3 style="line-height: 1.8rem;" class="modal-header-alt">This link has expired. <br>Please re-subscribe to our Newsletters.</h3> <h3 class="modal-header-main">Subscribe to our Newsletters</h3> </div> <div class="modalBody" id="newsletterModalBody"> <div id="newsletterEmailField" class="row" style="padding-left: 0"> <div class="large-2 columns"> <label for="email" class="newsletter-form-label inline">Email</label> </div> <div class="large-10 columns" style="padding-left: 0"> <input placeholder="Enter your email address" type="email" name="email" class="subscribe-form-input" /> <p id="emailMissing" class="newsletterPopupError">Please enter a valid email to subscribe</p> </div> </div> <div style="margin-left:20px"> <div style="margin-bottom:0.3em"> <input style="display:none" type="checkbox" checked name="list[]" value="arduino_newsletter_id" id="worldwide" class="newsletter-form-checkbox" /> <label for="worldwide"></label> <div style="display:inline-block" class="newsletter-form-label">Arduino Newsletter</div> </div> <div> <input style="display:none" type="checkbox" checked name="list[]" value="arduino_store_newsletter_id" id="store" class="newsletter-form-checkbox" /> <label for="store"></label> <div style="display:inline-block" class="newsletter-form-label">Arduino Store Newsletter</div> </div> </div> <div> <p class="newsletterPopupError2" id="newsletterSubscribeStatus"></p> </div> </div> <div class="row modalFooter"> <div class="form-buttons-row"> <button type="button" value="Cancel" class="popup-form-button white cancel-modal close-reveal-modal">Cancel</button> <button type="submit" name="Subscribe" id="subscribe-submit-btn" class="popup-form-button">Next</button> </div> </div> </form> <!-- step 2, confirm popup --> <div class="confirm-popup" style="margin-bottom:1em"> <div class="modalHeader"> <h3>Confirm your email address</h3> </div> <div class="modalBody" id="newsletterModalBody" style="padding-right:1em;margin-bottom:0"> <p style="margin-bottom:1em;font-size:15px"> We need to confirm your email address.<br> To complete the subscription, please click the link in the email we just sent you. </p> <p style="margin-bottom:1em;font-size:15px"> Thank you for subscribing! </p> <p style="margin-bottom:1em;font-size:15px"> Arduino<br> via Egeo 16<br> Torino, 10131<br> Italy<br> </p> </div> <div class="row modalFooter"> <div class="form-buttons-row"> <button name="Ok" class="popup-form-button" id="close-confirm-popup">Ok</button> </div> </div> </div> </div><div id="pagefooter" class="pagefooter"> <div class="row"> <div class="large-8 eight columns"> <div class="large-4 four columns newsletter-box"> <!-- Begin Sendy Signup Form --> <h6>Newsletter</h6> <div> <input type="email" name="email" class="email" id="sendy-EMAIL" placeholder="Enter your email to sign up"> <i class="icon-right-small"></i> <input value="Subscribe" name="subscribe" id="sendy-subscribe" class="newsletter-button"> </div> <!--End sendy_embed_signup--> </div> <div class="clearfix"></div> <ul class="inline-list"> <li class="monospace">&copy;2015 Arduino</li> <li><a href="http://arduino.cc/en/Main/CopyrightNotice">Copyright Notice</a></li> <li><a href='http://arduino.cc/en/Main/ContactUs'>Contact us</a></li> <li><a href='http://arduino.cc/Careers'>Careers</a></li> </ul> </div> <div class="large-4 four columns"> <ul id="arduinoSocialLinks" class="arduino-social-links"> <li> <a href="https://twitter.com/arduino"> <img src="../../img/twitter.png" /> </a> </li> <li> <a href="http://www.facebook.com/official.arduino"> <img src="../../img/facebook.png" /> </a> </li> <li> <a href="https://plus.google.com/+Arduino"> <img src="../../img/gplus.png" /> </a> </li> <li> <a href="http://www.flickr.com/photos/arduino_cc"> <img src="../../img/flickr.png" /> </a> </li> <li> <a href="http://youtube.com/arduinoteam"> <img src="../../img/youtube.png" /> </a> </li> </ul> </div> </div> </div> </div> <!--/PageFooterFmt--> <!--[if gte IE 9]><!--> <script src="http://arduino.cc/js/foundation.min.js"></script> <script src="http://arduino.cc/js/foundation.topbar.custom.js"></script> <script> $(document).foundation(); </script> <!--<![endif]--> <!--[if IE 8]> <script src="http://arduino.cc/js/foundation_ie8.min.js"></script> <script src="http://arduino.cc/js/ie8/jquery.foundation.orbit.js"></script> <script src="http://arduino.cc/js/ie8/jquery.foundation.alerts.js"></script> <script src="http://arduino.cc/js/app.js"></script> <script> $(window).load(function(){ $("#featured").orbit(); }); </script> <![endif]--> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-22581631-3']); _gaq.push(['_setDomainName', 'arduino.cc']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script> $(window).load(function(){ $('a').each (function () { href = $(this).attr ('href'); if (href.substring (0, 4) == 'http' && href.indexOf ('arduino.cc') == -1) $(this).attr ('target', '_blank'); }); }); </script> </body> <!-- Mirrored from arduino.cc/en/Reference/DigitalWrite by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 06 Feb 2015 20:13:18 GMT --> </html>
{ "content_hash": "754fdf807cad3701b9e721213aa2ccec", "timestamp": "", "source": "github", "line_count": 544, "max_line_length": 642, "avg_line_length": 40.58639705882353, "alnum_prop": 0.6237148421577065, "repo_name": "chcbaram/CupDrone_IDE", "id": "7fee61b1f68a7da966a5049bd832d705abbd102c", "size": "22079", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "reference/arduino.cc/en/Reference/DigitalWrite.html", "mode": "33188", "license": "mit", "language": [ { "name": "Arduino", "bytes": "441163" }, { "name": "Assembly", "bytes": "254848" }, { "name": "Batchfile", "bytes": "2676" }, { "name": "C", "bytes": "42812416" }, { "name": "C++", "bytes": "9101942" }, { "name": "CSS", "bytes": "324953" }, { "name": "HTML", "bytes": "57959090" }, { "name": "Logos", "bytes": "187144" }, { "name": "Makefile", "bytes": "202460" }, { "name": "Objective-C", "bytes": "61286" }, { "name": "PHP", "bytes": "16529" }, { "name": "Processing", "bytes": "9254" }, { "name": "Shell", "bytes": "52400" }, { "name": "XC", "bytes": "7809" }, { "name": "XS", "bytes": "7714" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>ipc: 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.7.0 / ipc - 8.10.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> ipc <small> 8.10.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-03-24 00:13:48 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-24 00:13:48 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/ipc&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/IPC&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.11~&quot;} ] tags: [ &quot;keyword: intuitionistic logic&quot; &quot;keyword: proof search&quot; &quot;keyword: proof-as-programs&quot; &quot;keyword: correct-by-construction&quot; &quot;keyword: program verification&quot; &quot;keyword: program extraction&quot; &quot;category: Mathematics/Logic/Foundations&quot; &quot;category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures&quot; &quot;category: Miscellaneous/Extracted Programs/Decision procedures&quot; ] authors: [ &quot;Klaus Weich&quot; ] bug-reports: &quot;https://github.com/coq-contribs/ipc/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/ipc.git&quot; synopsis: &quot;Intuitionistic Propositional Checker&quot; description: &quot;&quot;&quot; This development treats proof search in intuitionistic propositional logic, a fragment of any constructive type theory. We present new and more efficient decision procedures for intuitionistic propositional logic. They themselves are given by (non-formal) constructive proofs. We take one of them to demonstrate that constructive type theory can be used in practice to develop a real, efficient, but error-free proof searcher. This was done by formally proving the decidability of intuitionistic propositional logic in Coq; the proof searcher was automatically extracted.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/ipc/archive/v8.10.0.tar.gz&quot; checksum: &quot;md5=e6ec94ae4e62e4ef459a4d5ed81a8ef1&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-ipc.8.10.0 coq.8.7.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.7.0). The following dependencies couldn&#39;t be met: - coq-ipc -&gt; coq &gt;= 8.10 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints 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-ipc.8.10.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": "014fa57e0c82972ff02d11a7f092c240", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 159, "avg_line_length": 41.266304347826086, "alnum_prop": 0.5677597787435796, "repo_name": "coq-bench/coq-bench.github.io", "id": "76d5ec345c4537a885b0d2f860d85d1f65250b9e", "size": "7618", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.07.1-2.0.6/released/8.7.0/ipc/8.10.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
* [ProjectDent / ARKit-CoreLocation](https://github.com/ProjectDent/ARKit-CoreLocation): Combines the high accuracy of AR with the scale of GPS data. * [AladinWay / TransitionButton](https://github.com/AladinWay/TransitionButton): UIButton sublass for loading and transition animation. * [olucurious / awesome-arkit](https://github.com/olucurious/awesome-arkit): A curated list of awesome ARKit projects and resources. Feel free to contribute! * [PierrePerrin / ShadowView](https://github.com/PierrePerrin/ShadowView): An iOS Library that makes shadows management easy on UIView. * [kingreza / SeeFood](https://github.com/kingreza/SeeFood): Inspired by HBO's Silicon Valley: SeeFood is an iOS app that uses CoreML to detect various dishes * [lkzhao / Hero](https://github.com/lkzhao/Hero): Elegant transition library for iOS & tvOS * [zhanming0601 / ZMLive](https://github.com/zhanming0601/ZMLive): ZMLive * [shadowsocks / ShadowsocksX-NG](https://github.com/shadowsocks/ShadowsocksX-NG): Next Generation of ShadowsocksX * [vsouza / awesome-ios](https://github.com/vsouza/awesome-ios): A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects * [shoheiyokoyama / Gemini](https://github.com/shoheiyokoyama/Gemini): Gemini is rich scroll based animation framework for iOS, written in Swift. * [kiliankoe / CLISpinner](https://github.com/kiliankoe/CLISpinner): Swifty Terminal Spinner * [malt03 / PictureInPicture](https://github.com/malt03/PictureInPicture): * [raywenderlich / swift-algorithm-club](https://github.com/raywenderlich/swift-algorithm-club): Algorithms and data structures in Swift, with explanations! * [MessageKit / MessageKit](https://github.com/MessageKit/MessageKit): In-progress: A community-driven replacement for JSQMessagesViewController * [Boris-Em / ARCharts](https://github.com/Boris-Em/ARCharts): Lovely Augmented Reality Charts for iOS - Built with ARKit * [Ramotion / folding-cell](https://github.com/Ramotion/folding-cell): FoldingCell is an expanding content cell with animation inspired by folding paper material design UI made by Ramotion * [sobri909 / ArcKit](https://github.com/sobri909/ArcKit): Location and activity recording framework for iOS * [songkuixi / ARGitHubCommits](https://github.com/songkuixi/ARGitHubCommits): Show your GitHub commit records in 3D with ARKit and SceneKit. * [ReactiveX / RxSwift](https://github.com/ReactiveX/RxSwift): Reactive Programming in Swift * [agilie / AGImageControls](https://github.com/agilie/AGImageControls): cool tools for image edition * [danielgindi / Charts](https://github.com/danielgindi/Charts): Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart. * [fahidattique55 / FAPanels](https://github.com/fahidattique55/FAPanels): FAPanels - Swift * [yonaskolb / XcodeGen](https://github.com/yonaskolb/XcodeGen): Command line tool that generates your Xcode project from a simple spec and your folder structure * [SwiftyJSON / SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON): The better way to deal with JSON data in Swift * [patchthecode / JTAppleCalendar](https://github.com/patchthecode/JTAppleCalendar): The Unofficial Apple iOS Swift Calendar View. iOS calendar Library. iOS calendar Control. 100% Customizable ####objective-c * [airbnb / lottie-ios](https://github.com/airbnb/lottie-ios): An iOS library to natively render After Effects vector animations * [MisterBooo / Play-With-Sort-OC](https://github.com/MisterBooo/Play-With-Sort-OC): 基础排序 冒泡排序 插入排序 快速排序 双路快速排序 三路快速排序 堆排序 * [12207480 / TYPagerController](https://github.com/12207480/TYPagerController): page scroll view and controller,simple,high custom,and have many tabBar styles,,support Objective-C and swift * [panghaijiao / HJDanmakuDemo](https://github.com/panghaijiao/HJDanmakuDemo): A high performance danmaku engine for iOS * [12207480 / TYCyclePagerView](https://github.com/12207480/TYCyclePagerView): a simple and usefull cycle pager view ,and auto scroll banner view(轮播图) ,include pageControl for iOS,support Objective-C and swift * [axclogo / AxcUIKit-Sample](https://github.com/axclogo/AxcUIKit-Sample): 一个快速搭建UI控件的整合框架-AxcUIKit * [kingsic / SGAdvertScrollView](https://github.com/kingsic/SGAdvertScrollView): advertisement carousel view for iOS (天猫、京东等 app 首页广告滚动视图) * [Instagram / IGListKit](https://github.com/Instagram/IGListKit): A data-driven UICollectionView framework for building fast and flexible lists. * [megabitsenmzq / Today-Scripts](https://github.com/megabitsenmzq/Today-Scripts): A widget for running scripts in the Today View in OS X Yosemite's Notification Center * [realm / realm-cocoa](https://github.com/realm/realm-cocoa): Realm is a mobile database: a replacement for Core Data & SQLite * [TextureGroup / Texture](https://github.com/TextureGroup/Texture): Smooth asynchronous user interfaces for iOS apps. * [moshuqi / YSRun](https://github.com/moshuqi/YSRun): 易瘦跑步 iOS客户端 * [hackiftekhar / IQKeyboardManager](https://github.com/hackiftekhar/IQKeyboardManager): Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more. * [react-native-community / react-native-svg](https://github.com/react-native-community/react-native-svg): SVG library for React Native. * [sequelpro / sequelpro](https://github.com/sequelpro/sequelpro): MySQL/MariaDB database management for macOS * [asiosldh / BMScan](https://github.com/asiosldh/BMScan): BMScan,Scan,AVFoundation,ZXing,QRCode,BarCode,Code,ZBar * [XuYang8026 / UniversalProject](https://github.com/XuYang8026/UniversalProject): 基于MVC架构的通用APP框架,封装了基类、网络服务和工具库,为快速搭建高性能APP而生,内含基于NavigationController的转场动画,欢迎Star🌟 * [CoderMJLee / MJRefresh](https://github.com/CoderMJLee/MJRefresh): An easy way to use pull-to-refresh. * [AFNetworking / AFNetworking](https://github.com/AFNetworking/AFNetworking): A delightful networking framework for iOS, OS X, watchOS, and tvOS. * [wireapp / wire-ios](https://github.com/wireapp/wire-ios): 📱 Wire for iOS (iPhone and iPad) * [marcuswestin / WebViewJavascriptBridge](https://github.com/marcuswestin/WebViewJavascriptBridge): An iOS/OSX bridge for sending messages between Obj-C and JavaScript in UIWebViews/WebViews * [airbnb / react-native-maps](https://github.com/airbnb/react-native-maps): React Native Mapview component for iOS + Android * [WenchaoD / FSCalendar](https://github.com/WenchaoD/FSCalendar): A fully customizable iOS calendar library, compatible with Objective-C and Swift * [ibireme / YYKit](https://github.com/ibireme/YYKit): A collection of iOS components. * [expo / expo](https://github.com/expo/expo): Expo iOS/Android Client ####go * [heptio / ark](https://github.com/heptio/ark): Heptio Ark is a utility for managing disaster recovery, specifically for your Kubernetes cluster resources and persistent volumes. Brought to you by Heptio. * [kubernetes / kubernetes](https://github.com/kubernetes/kubernetes): Production-Grade Container Scheduling and Management * [gobwas / ws](https://github.com/gobwas/ws): Tiny WebSocket library for Go. * [muesli / crunchy](https://github.com/muesli/crunchy): Finds common flaws in passwords. Like cracklib, but written in Go. * [golang / go](https://github.com/golang/go): The Go programming language * [kjk / flex](https://github.com/kjk/flex): Go implementation of CSS flexbox, port of Facebook's Yoga * [heptio / sonobuoy](https://github.com/heptio/sonobuoy): Heptio Sonobuoy is a diagnostic tool that makes it easier to understand the state of a Kubernetes cluster by running a set of Kubernetes conformance tests in an accessible and non-destructive manner. Brought to you by Heptio. * [matryer / vice](https://github.com/matryer/vice): Go channels at horizontal scale (powered by message queues) * [minio / minio](https://github.com/minio/minio): Minio is an open source object storage server compatible with Amazon S3 APIs * [ethereum / go-ethereum](https://github.com/ethereum/go-ethereum): Official Go implementation of the Ethereum protocol * [syncthing / syncthing](https://github.com/syncthing/syncthing): Open Source Continuous File Synchronization * [hootsuite / atlantis](https://github.com/hootsuite/atlantis): A unified workflow for collaborating on Terraform through GitHub * [hacdias / filemanager](https://github.com/hacdias/filemanager): 📁 Web File Manager which can be used as a middleware or standalone app. * [alexellis / faas-netes](https://github.com/alexellis/faas-netes): Enable Kubernetes as a backend for Functions as a Service (FaaS) * [moby / moby](https://github.com/moby/moby): Moby Project - a collaborative project for the container ecosystem to assemble container-based systems * [vivint / infectious](https://github.com/vivint/infectious): Reed-Solomon forward error correcting library * [golang / dep](https://github.com/golang/dep): Go dependency management tool * [prometheus / prometheus](https://github.com/prometheus/prometheus): The Prometheus monitoring system and time series database. * [avelino / awesome-go](https://github.com/avelino/awesome-go): A curated list of awesome Go frameworks, libraries and software * [gogits / gogs](https://github.com/gogits/gogs): Gogs is a painless self-hosted Git service. * [t94j0 / AIRMASTER](https://github.com/t94j0/AIRMASTER): Use ExpiredDomains.net and BlueCoat to find useful domains for red team. * [grafana / grafana](https://github.com/grafana/grafana): The tool for beautiful monitoring and metric analytics & dashboards for Graphite, InfluxDB & Prometheus & More * [appscode / kubed](https://github.com/appscode/kubed): 🛡️ A Kubernetes Cluster Operator Daemon * [gohugoio / hugo](https://github.com/gohugoio/hugo): A Fast and Flexible Static Site Generator built with love in GoLang. * [containous / traefik](https://github.com/containous/traefik): Træfik, a modern reverse proxy ####javascript * [mozilla / send](https://github.com/mozilla/send): File Sharing Experiment * [palmerhq / backpack](https://github.com/palmerhq/backpack): 🎒 Backpack is a minimalistic build system for Node.js projects. * [dthree / mailit](https://github.com/dthree/mailit): A tiny drop-in REST API to send emails * [ElemeFE / node-practice](https://github.com/ElemeFE/node-practice): Node.js 实践教程 * [dthree / ad](https://github.com/dthree/ad): Making Active Directory jQuery-easy * [vuejs / vue](https://github.com/vuejs/vue): A progressive, incrementally-adoptable JavaScript framework for building UI on the web. * [americanexpress / jest-image-snapshot](https://github.com/americanexpress/jest-image-snapshot): Jest matcher that performs image comparisons using Blink-diff and behaves just like Jest snapshots do! Very useful for browser visual comparison testing. * [bokub / chalk-animation](https://github.com/bokub/chalk-animation): 🎬 Colorful animations in terminal stdout * [smallwins / spacetime](https://github.com/smallwins/spacetime): A lightweight way to handle timezones in js * [lord / slate](https://github.com/lord/slate): Beautiful static documentation for your API * [facebook / react](https://github.com/facebook/react): A declarative, efficient, and flexible JavaScript library for building user interfaces. * [getify / You-Dont-Know-JS](https://github.com/getify/You-Dont-Know-JS): A book series on JavaScript. @YDKJS on twitter. * [ncase / trust](https://github.com/ncase/trust): An interactive guide to the game theory of cooperation * [facebookincubator / create-react-app](https://github.com/facebookincubator/create-react-app): Create React apps with no build configuration. * [twbs / bootstrap](https://github.com/twbs/bootstrap): The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web. * [paypal / downshift](https://github.com/paypal/downshift): 🏎 Primitives to build simple, flexible, WAI-ARIA compliant React autocomplete/dropdown/select/combobox components * [storybooks / storybook](https://github.com/storybooks/storybook): 📓 Interactive development & testing environment for React and React-Native UI components * [AlloyTeam / AlloyCrop](https://github.com/AlloyTeam/AlloyCrop): The best and tiny size mobile cropping component - 做最好且最小的移动裁剪组件 * [gitalk / gitalk](https://github.com/gitalk/gitalk): Gitalk is a comment plugin base on Github Issue and Preact * [wearehive / project-guidelines](https://github.com/wearehive/project-guidelines): A set of best practices for JavaScript projects * [yahoo / blink-diff](https://github.com/yahoo/blink-diff): A lightweight image comparison tool * [facebook / react-native](https://github.com/facebook/react-native): A framework for building native apps with React. * [airbnb / javascript](https://github.com/airbnb/javascript): JavaScript Style Guide * [JetBrains / ring-ui](https://github.com/JetBrains/ring-ui): A collection of JetBrains Web UI components * [Semantic-Org / Semantic-UI](https://github.com/Semantic-Org/Semantic-UI): Semantic is a UI component framework based around useful principles from natural language. ####ruby * [toddmotto / public-apis](https://github.com/toddmotto/public-apis): A collective list of public JSON APIs for use in web development. * [TrestleAdmin / trestle](https://github.com/TrestleAdmin/trestle): A modern, responsive admin framework for Ruby on Rails * [fastlane / fastlane](https://github.com/fastlane/fastlane): 🚀 The easiest way to automate building and releasing your iOS and Android apps * [nikolalsvk / ordinare](https://github.com/nikolalsvk/ordinare): Ordinare sorts gems in your Gemfile alphabetically * [jekyll / jekyll](https://github.com/jekyll/jekyll): 🌐 Jekyll is a blog-aware, static site generator in Ruby * [jondot / awesome-react-native](https://github.com/jondot/awesome-react-native): Awesome React Native components, news, tools, and learning material! * [rails / rails](https://github.com/rails/rails): Ruby on Rails * [rapid7 / metasploit-framework](https://github.com/rapid7/metasploit-framework): Metasploit Framework * [gitlabhq / gitlabhq](https://github.com/gitlabhq/gitlabhq): GitLab CE | Please open new issues in our issue tracker on GitLab.com * [Homebrew / brew](https://github.com/Homebrew/brew): 🍺 The missing package manager for macOS * [ruby / ruby](https://github.com/ruby/ruby): The Ruby Programming Language * [tootsuite / mastodon](https://github.com/tootsuite/mastodon): A GNU Social-compatible microblogging server * [mitchellh / vagrant](https://github.com/mitchellh/vagrant): Vagrant is a tool for building and distributing development environments. * [sinatra / sinatra](https://github.com/sinatra/sinatra): Classy web-development dressed in a DSL (official / canonical repo) * [Homebrew / homebrew-core](https://github.com/Homebrew/homebrew-core): 🍻 Default formulae for the missing package manager for macOS * [discourse / discourse](https://github.com/discourse/discourse): A platform for community discussion. Free, open, simple. * [CocoaPods / CocoaPods](https://github.com/CocoaPods/CocoaPods): The Cocoa Dependency Manager. * [plataformatec / devise](https://github.com/plataformatec/devise): Flexible authentication solution for Rails with Warden. * [realm / jazzy](https://github.com/realm/jazzy): Soulful docs for Swift & Objective-C * [markets / maily](https://github.com/markets/maily): 📫 Rails Engine to preview emails in the browser * [elastic / logstash](https://github.com/elastic/logstash): Logstash - transport and process your logs, events, or other data * [Thibaut / devdocs](https://github.com/Thibaut/devdocs): API Documentation Browser * [bbatsov / rubocop](https://github.com/bbatsov/rubocop): A Ruby static code analyzer, based on the community Ruby style guide. * [shakacode / react_on_rails](https://github.com/shakacode/react_on_rails): Integration of React + Webpack + Rails to build Universal (Isomorphic) Apps * [exercism / exercism.io](https://github.com/exercism/exercism.io): Quickly ramp up in new programming languages.
{ "content_hash": "c5abc3700f06f3c6ccbc63ae3fe7b368", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 233, "avg_line_length": 45.60406091370558, "alnum_prop": 0.6901714158504008, "repo_name": "tzpBingo/github-trending", "id": "5bd3f6cc9ff86762ff2e6faae91c8dd46f09b3c7", "size": "18301", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "2017/2017-08-04.md", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "11470" }, { "name": "HTML", "bytes": "1543" }, { "name": "Python", "bytes": "49985109" }, { "name": "Shell", "bytes": "18039" } ], "symlink_target": "" }
package delete_item import ( "encoding/json" "fmt" "testing" ) func TestNil(t *testing.T) { d := NewDeleteItem() _,_,err := d.EndpointReqWithConf(nil) if err == nil { t.Errorf("nil conf should result in error") } } func TestRequestUnmarshal(t *testing.T) { s := []string{ `{"TableName":"Thread","Key":{"ForumName":{"S":"AmazonDynamoDB"},"Subject":{"S":"HowdoIupdatemultipleitems?"}},"Expected":{"Replies":{"AttributeValueList":null,"Exists":false}},"ReturnValues":"ALL_OLD"}`, `{"TableName":"Thread","Key":{"ForumName":{"S":"AmazonDynamoDB"},"Subject":{"S":"HowdoIupdatemultipleitems?"}}}`, } for _, v := range s { d := NewDeleteItem() um_err := json.Unmarshal([]byte(v), d) if um_err != nil { _ = fmt.Sprintf("%v\n", um_err) t.Errorf("cannot unmarshal to delete:\n" + v + "\n") } _, jerr := json.Marshal(d) if jerr != nil { t.Errorf("cannot marshal\n") } } } func TestResponseUnmarshal(t *testing.T) { s := []string{`{"Attributes":{"LastPostedBy":{"S":"fred@example.com"},"ForumName":{"S":"AmazonDynamoDB"},"LastPostDateTime":{"S":"201303201023"},"Tags":{"SS":["Update","MultipleItems","HelpMe"]},"Subject":{"S":"HowdoIupdatemultipleitems?"},"Message":{"S":"IwanttoupdatemultipleitemsinasingleAPIcall.What'sthebestwaytodothat?"}}}`} for i, v := range s { var d Response um_err := json.Unmarshal([]byte(v), &d) if um_err != nil { t.Errorf("cannot unmarshal to delete:\n" + v + "\n") } json, jerr := json.Marshal(d) if jerr != nil { t.Errorf("cannot marshal\n") } if len(s[i]) != len(string(json)) { e := fmt.Sprintf("\n%s\n%s\nshould be same",s[i],string(json)) t.Errorf(e) } _ = fmt.Sprintf("IN:%v, OUT:%v\n", v, string(json)) } }
{ "content_hash": "5fa57cc4396da37b23e38b80c1926196", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 331, "avg_line_length": 32.24528301886792, "alnum_prop": 0.6208308952603862, "repo_name": "roblillack/godynamo", "id": "fd4f879054d43d0a8f60a3993b8e48850aef4741", "size": "1709", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "endpoints/delete_item/delete_item_test.go", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Go", "bytes": "260725" } ], "symlink_target": "" }
import warnings import asyncio import collections import logging from datetime import datetime, timedelta from asyncio import ensure_future from .protocol import STATE_NEW, STATE_OPEN, STATE_CLOSING, STATE_CLOSED from .protocol import FRAME_OPEN, FRAME_CLOSE from .protocol import FRAME_MESSAGE, FRAME_MESSAGE_BLOB, FRAME_HEARTBEAT from .exceptions import SessionIsAcquired, SessionIsClosed from .protocol import MSG_CLOSE, MSG_MESSAGE from .protocol import close_frame, message_frame, messages_frame from .protocol import SockjsMessage, OpenMessage, ClosedMessage log = logging.getLogger("sockjs") class Session(object): """SockJS session object ``state``: Session state ``manager``: Session manager that hold this session ``acquired``: Acquired state, indicates that transport is using session ``timeout``: Session timeout """ manager = None acquired = False state = STATE_NEW interrupted = False exception = None def __init__( self, id, handler, request, *, timeout=timedelta(seconds=10), debug=False ): self.id = id self.handler = handler self.request = request self.expired = False self.timeout = timeout self.expires = datetime.now() + timeout self._hits = 0 self._heartbeats = 0 self._heartbeat_transport = False self._debug = debug self._waiter = None self._queue = collections.deque() def __str__(self): result = ["id=%r" % (self.id,)] if self.state == STATE_OPEN: result.append("connected") elif self.state == STATE_CLOSED: result.append("closed") else: result.append("disconnected") if self.acquired: result.append("acquired") if len(self._queue): result.append("queue[%s]" % len(self._queue)) if self._hits: result.append("hits=%s" % self._hits) if self._heartbeats: result.append("heartbeats=%s" % self._heartbeats) return " ".join(result) def _tick(self, timeout=None): if timeout is None: self.expires = datetime.now() + self.timeout else: self.expires = datetime.now() + timeout async def _acquire(self, manager, heartbeat=True): self.acquired = True self.manager = manager self._heartbeat_transport = heartbeat self._tick() self._hits += 1 if self.state == STATE_NEW: log.debug("open session: %s", self.id) self.state = STATE_OPEN self._feed(FRAME_OPEN, FRAME_OPEN) try: await self.handler(OpenMessage, self) except asyncio.CancelledError: raise except Exception as exc: self.state = STATE_CLOSING self.exception = exc self.interrupted = True self._feed(FRAME_CLOSE, (3000, "Internal error")) log.exception("Exception in open session handling.") def _release(self): self.acquired = False self.manager = None self._heartbeat_transport = False def _heartbeat(self): self._heartbeats += 1 if self._heartbeat: self._feed(FRAME_HEARTBEAT, FRAME_HEARTBEAT) def _feed(self, frame, data): # pack messages if frame == FRAME_MESSAGE: if self._queue and self._queue[-1][0] == FRAME_MESSAGE: self._queue[-1][1].append(data) else: self._queue.append((frame, [data])) else: self._queue.append((frame, data)) # notify waiter waiter = self._waiter if waiter is not None: self._waiter = None if not waiter.cancelled(): waiter.set_result(True) async def _wait(self, pack=True): if not self._queue and self.state != STATE_CLOSED: assert not self._waiter loop = asyncio.get_event_loop() self._waiter = loop.create_future() await self._waiter if self._queue: frame, payload = self._queue.popleft() self._tick() if pack: if frame == FRAME_CLOSE: return FRAME_CLOSE, close_frame(*payload) elif frame == FRAME_MESSAGE: return FRAME_MESSAGE, messages_frame(payload) return frame, payload else: raise SessionIsClosed() async def _remote_close(self, exc=None): """close session from remote.""" if self.state in (STATE_CLOSING, STATE_CLOSED): return log.info("close session: %s", self.id) self.state = STATE_CLOSING if exc is not None: self.exception = exc self.interrupted = True try: await self.handler(SockjsMessage(MSG_CLOSE, exc), self) except Exception: log.exception("Exception in close handler.") async def _remote_closed(self): if self.state == STATE_CLOSED: return log.info("session closed: %s", self.id) self.state = STATE_CLOSED self.expire() try: await self.handler(ClosedMessage, self) except Exception: log.exception("Exception in closed handler.") # notify waiter waiter = self._waiter if waiter is not None: self._waiter = None if not waiter.cancelled(): waiter.set_result(True) async def _remote_message(self, msg): log.debug("incoming message: %s, %s", self.id, msg[:200]) self._tick() try: await self.handler(SockjsMessage(MSG_MESSAGE, msg), self) except Exception: log.exception("Exception in message handler.") async def _remote_messages(self, messages): self._tick() for msg in messages: log.debug("incoming message: %s, %s", self.id, msg[:200]) try: await self.handler(SockjsMessage(MSG_MESSAGE, msg), self) except Exception: log.exception("Exception in message handler.") def expire(self): """Manually expire a session.""" self.expired = True def send(self, msg): """send message to client.""" assert isinstance(msg, str), "String is required" if self._debug: log.info("outgoing message: %s, %s", self.id, str(msg)[:200]) if self.state != STATE_OPEN: return self._feed(FRAME_MESSAGE, msg) def send_frame(self, frm): """send message frame to client.""" if self._debug: log.info("outgoing message: %s, %s", self.id, frm[:200]) if self.state != STATE_OPEN: return self._feed(FRAME_MESSAGE_BLOB, frm) def close(self, code=3000, reason="Go away!"): """close session""" if self.state in (STATE_CLOSING, STATE_CLOSED): return if self._debug: log.debug("close session: %s", self.id) self.state = STATE_CLOSING self._feed(FRAME_CLOSE, (code, reason)) _marker = object() class SessionManager(dict): """A basic session manager.""" _hb_handle = None # heartbeat event loop timer _hb_task = None # gc task def __init__( self, name, app, handler, heartbeat=25.0, timeout=timedelta(seconds=5), debug=False, ): self.name = name self.route_name = "sockjs-url-%s" % name self.app = app self.handler = handler self.factory = Session self.acquired = {} self.sessions = [] self.heartbeat = heartbeat self.timeout = timeout self.debug = debug def route_url(self, request): return request.route_url(self.route_name) @property def started(self): return self._hb_handle is not None def start(self): if not self._hb_handle: loop = asyncio.get_event_loop() self._hb_handle = loop.call_later(self.heartbeat, self._heartbeat) def stop(self): if self._hb_handle is not None: self._hb_handle.cancel() self._hb_handle = None if self._hb_task is not None: self._hb_task.cancel() self._hb_task = None def _heartbeat(self): if self._hb_task is None: self._hb_task = ensure_future(self._heartbeat_task()) async def _heartbeat_task(self): sessions = self.sessions if sessions: now = datetime.now() idx = 0 while idx < len(sessions): session = sessions[idx] session._heartbeat() if session.expires < now: # Session is to be GC'd immedietely if session.id in self.acquired: await self.release(session) if session.state == STATE_OPEN: await session._remote_close() if session.state == STATE_CLOSING: await session._remote_closed() del self[session.id] del self.sessions[idx] continue idx += 1 self._hb_task = None loop = asyncio.get_event_loop() self._hb_handle = loop.call_later(self.heartbeat, self._heartbeat) def _add(self, session): if session.expired: raise ValueError("Can not add expired session") session.manager = self session.registry = self.app self[session.id] = session self.sessions.append(session) return session def get(self, id, create=False, request=None, default=_marker): session = super(SessionManager, self).get(id, None) if session is None: if create: session = self._add( self.factory( id, self.handler, request, timeout=self.timeout, debug=self.debug, ) ) else: if default is not _marker: return default raise KeyError(id) return session async def acquire(self, s): sid = s.id if sid in self.acquired: raise SessionIsAcquired("Another connection still open") if sid not in self: raise KeyError("Unknown session") await s._acquire(self) self.acquired[sid] = True return s def is_acquired(self, session): return session.id in self.acquired async def release(self, s): if s.id in self.acquired: s._release() del self.acquired[s.id] def active_sessions(self): for session in list(self.values()): if not session.expired: yield session async def clear(self): """Manually expire all sessions in the pool.""" for session in list(self.values()): if session.state != STATE_CLOSED: await session._remote_closed() self.sessions.clear() super(SessionManager, self).clear() def broadcast(self, message): blob = message_frame(message) for session in list(self.values()): if not session.expired: session.send_frame(blob) def __del__(self): if len(self.sessions): warnings.warn( "Unclosed sessions! " "Please call `await SessionManager.clear()` before del", RuntimeWarning, ) self.stop()
{ "content_hash": "4626db0616ae31c61940b2eaffae3ed1", "timestamp": "", "source": "github", "line_count": 411, "max_line_length": 81, "avg_line_length": 28.99270072992701, "alnum_prop": 0.5451493789862369, "repo_name": "aio-libs/sockjs", "id": "7c8c425e68c60cb566e95dadb94fe82e29b1525d", "size": "11916", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sockjs/session.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "1116" }, { "name": "Python", "bytes": "94958" } ], "symlink_target": "" }
use std::io; use std::io::{Read, Write}; use std::fs::File; use std::path::Path; pub fn write_file<P: AsRef<Path>>(path: P, contents: &Vec<u8>) -> io::Result<()> { let mut file = try!(File::create(path)); Ok(try!(file.write_all(contents))) } pub fn read_file<P: AsRef<Path>>(path: P, buf: &mut Vec<u8>) -> io::Result<usize> { let mut file = try!(File::open(path)); let bytes = try!(file.read_to_end(buf)); Ok(bytes) } pub fn read_file_to_string<P: AsRef<Path>>(path: P, buf: &mut String) -> io::Result<usize> { let mut file = try!(File::open(path)); let bytes = try!(file.read_to_string(buf)); Ok(bytes) }
{ "content_hash": "a9ce3be869d82e644b5fd19c26fb3da6", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 92, "avg_line_length": 26.833333333333332, "alnum_prop": 0.6009316770186336, "repo_name": "despawnerer/langid-rs", "id": "8693a864327548538d2d7ade52b080bb2c99600d", "size": "644", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/utils.rs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Rust", "bytes": "21745" } ], "symlink_target": "" }
from colossus.game.route import Route from colossus.game.core import Core from colossus.game.ice import Ice from colossus.game.entity import Node, Packet
{ "content_hash": "902119e6ab4d393b29bdfed8d802762e", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 45, "avg_line_length": 38.25, "alnum_prop": 0.8366013071895425, "repo_name": "spectralflux/colossus", "id": "fa53fd8917aede2477931db6f3eecb8efdf295de", "size": "153", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "colossus/game/__init__.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "10089" } ], "symlink_target": "" }
module EbayTrading # :nodoc: module Types # :nodoc: # == Attributes # text_node :old_id, '@oldID', :optional => true # text_node :id, '@id', :optional => true class CategoryMapping include XML::Mapping include Initializer root_element_name 'CategoryMapping' text_node :old_id, '@oldID', :optional => true text_node :id, '@id', :optional => true end end end
{ "content_hash": "6807ba877ebf2236b0e9bc5146307f32", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 53, "avg_line_length": 25.9375, "alnum_prop": 0.6024096385542169, "repo_name": "plzen/ebay", "id": "aeefef6330eef690508d2c031b388948757b9aea", "size": "416", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/ebay_trading/types/category_mapping.rb", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1936" }, { "name": "Ruby", "bytes": "1331559" } ], "symlink_target": "" }
package site.zhangqun.lanagina; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
{ "content_hash": "e86e6b6ab3a8a1123bf2670896f0a35a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 81, "avg_line_length": 23.529411764705884, "alnum_prop": 0.6925, "repo_name": "uffuff/LSMS", "id": "9f5f92f824d0df4c8377375ec92eb1f17b931b70", "size": "400", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/test/java/site/zhangqun/lanagina/ExampleUnitTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "61834" }, { "name": "Groovy", "bytes": "11701" }, { "name": "HTML", "bytes": "255867" }, { "name": "Java", "bytes": "149374" }, { "name": "JavaScript", "bytes": "186353" }, { "name": "PHP", "bytes": "2333" } ], "symlink_target": "" }
@class ContactTagData, MMTableView, NSMutableArray, NSMutableDictionary, NSString; @interface ContactTagNewDetailViewController : MMUIViewController <UITableViewDataSource, UITableViewDelegate, IContactLabelMgrExt, MultiSelectContactsViewControllerDelegate, ContactTagNameEditViewControllerDelegate, UIAlertViewDelegate> { _Bool _bIsAlreadyDisMissSelf; _Bool _bIsTagNameChange; int _commonSearchScene; unsigned int _curEventID; MMTableView *_tableView; long long _curActionType; ContactTagData *_contactTagData; NSMutableArray *_curMemberContactList; NSString *_curDisplayTagName; NSMutableArray *_contactsKeyArray; NSMutableDictionary *_contactsDict; } @property(retain, nonatomic) NSMutableDictionary *contactsDict; // @synthesize contactsDict=_contactsDict; @property(retain, nonatomic) NSMutableArray *contactsKeyArray; // @synthesize contactsKeyArray=_contactsKeyArray; @property(retain, nonatomic) NSString *curDisplayTagName; // @synthesize curDisplayTagName=_curDisplayTagName; @property(nonatomic) _Bool bIsTagNameChange; // @synthesize bIsTagNameChange=_bIsTagNameChange; @property(nonatomic) _Bool bIsAlreadyDisMissSelf; // @synthesize bIsAlreadyDisMissSelf=_bIsAlreadyDisMissSelf; @property(nonatomic) unsigned int curEventID; // @synthesize curEventID=_curEventID; @property(retain, nonatomic) NSMutableArray *curMemberContactList; // @synthesize curMemberContactList=_curMemberContactList; @property(retain, nonatomic) ContactTagData *contactTagData; // @synthesize contactTagData=_contactTagData; @property(nonatomic) long long curActionType; // @synthesize curActionType=_curActionType; @property(retain, nonatomic) MMTableView *tableView; // @synthesize tableView=_tableView; @property(nonatomic) int commonSearchScene; // @synthesize commonSearchScene=_commonSearchScene; - (void).cxx_destruct; - (void)setContactLabel:(id)arg1 withRetCode:(int)arg2 andEventId:(unsigned int)arg3; - (void)onAddContactLabel:(id)arg1 withRetCode:(int)arg2 andEventId:(unsigned int)arg3; - (void)updateContactLabelName:(id)arg1 withRetCode:(int)arg2 andEventId:(unsigned int)arg3; - (unsigned int)updateTagMember; - (_Bool)isTagNameEmptyOrExist:(id)arg1; - (unsigned int)createOrUpdateTagName; - (void)updateRightBarButtonStatus; - (void)alertView:(id)arg1 clickedButtonAtIndex:(long long)arg2; - (void)onTagNameEditViewControllerRetWithTagName:(id)arg1; - (void)reloadMemberListAndView:(id)arg1 isChatRoomList:(_Bool)arg2; - (void)onMultiSelectContactReturn:(id)arg1; - (void)onSaveBarButtonPress:(id)arg1; - (void)onDismissBarButtonPress:(id)arg1; - (void)internalDisMissSelfAnimated:(_Bool)arg1; - (void)setSaveButtonEnable:(_Bool)arg1; - (void)onClickContactItemCellWithIndexPath:(id)arg1; - (void)onClickAddMemberCell; - (void)onClickTagNameCell; - (void)makeMemberContactCellContent:(id)arg1 WithIndexPath:(id)arg2; - (void)makeAddMemberCellContent:(id)arg1; - (void)makeTagNameCellContent:(id)arg1; - (void)makeTagDetailEditHeaderContent:(id)arg1; - (long long)tableView:(id)arg1 sectionForSectionIndexTitle:(id)arg2 atIndex:(long long)arg3; - (id)sectionIndexTitlesForTableView:(id)arg1; - (void)handleDeleteContactAtIndexPath:(id)arg1; - (void)tableView:(id)arg1 commitEditingStyle:(long long)arg2 forRowAtIndexPath:(id)arg3; - (_Bool)tableView:(id)arg1 shouldHighlightRowAtIndexPath:(id)arg2; - (long long)tableView:(id)arg1 editingStyleForRowAtIndexPath:(id)arg2; - (void)tableView:(id)arg1 didSelectRowAtIndexPath:(id)arg2; - (id)tableView:(id)arg1 cellForRowAtIndexPath:(id)arg2; - (id)tableView:(id)arg1 viewForHeaderInSection:(long long)arg2; - (id)tableView:(id)arg1 titleForHeaderInSection:(long long)arg2; - (double)tableView:(id)arg1 heightForRowAtIndexPath:(id)arg2; - (double)tableView:(id)arg1 heightForHeaderInSection:(long long)arg2; - (long long)tableView:(id)arg1 numberOfRowsInSection:(long long)arg2; - (long long)numberOfSectionsInTableView:(id)arg1; - (void)sortTagContactsV2; - (void)sortTagContacts; - (id)addContactSectionKey:(id)arg1; - (void)processContactSectionData:(id)arg1; - (void)initView; - (void)reloadData; - (void)initData; - (void)viewDidLayoutSubviews; - (void)viewDidLoad; - (id)initViewControllerWithCreateNewTag; - (id)initViewControllerWithContactTagData:(id)arg1; - (id)init; - (void)dealloc; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
{ "content_hash": "15918bb473679ba434c395e756f6fa0b", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 237, "avg_line_length": 51.81609195402299, "alnum_prop": 0.8021295474711624, "repo_name": "walkdianzi/DashengHook", "id": "3b3efe79b7f1bbdda0780bad97e910bc1b2964e0", "size": "4917", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WeChat-Headers/ContactTagNewDetailViewController.h", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "986" }, { "name": "Objective-C", "bytes": "10153542" }, { "name": "Objective-C++", "bytes": "18332" }, { "name": "Shell", "bytes": "1459" } ], "symlink_target": "" }
<?php include_once '../lib/common.php'; if (User::$info['locked'] == 'Y' || User::$info['deactivated'] == 'Y') Link::redirect('settings.php'); elseif (User::$awaiting_token) Link::redirect('verify-token.php'); elseif (!User::isLoggedIn()) Link::redirect('login.php'); if (User::$info['no_logins'] != 'Y' && !$_REQUEST['settings']) { Link::redirect('account.php'); } if (!empty($_REQUEST['settings'])) { $match = preg_match_all($CFG->pass_regex,$_REQUEST['settings']['pass'],$matches); $_REQUEST['settings']['pass'] = preg_replace($CFG->pass_regex, "",$_REQUEST['settings']['pass']); $too_few_chars = (mb_strlen($_REQUEST['settings']['pass'],'utf-8') < $CFG->pass_min_chars); } API::add('User','getInfo',array($_SESSION['session_id'])); $query = API::send(); $personal = new Form('settings',false,false,'form1','site_users'); $personal->verify(); $personal->get($query['User']['getInfo']['results'][0]); if (!empty($_REQUEST['settings']) && $_SESSION['firstlogin_uniq'] != $_REQUEST['settings']['uniq']) $personal->errors[] = 'Page expired.'; if (!empty($match)) $personal->errors[] = htmlentities(str_replace('[characters]',implode(',',array_unique($matches[0])),Lang::string('login-pass-chars-error'))); if (!empty($too_few_chars)) $personal->errors[] = Lang::string('login-password-error'); if (!empty($_REQUEST['settings']) && !empty($personal->errors)) { $errors = array(); foreach ($personal->errors as $key => $error) { if (stristr($error,'login-required-error')) { $errors[] = Lang::string('settings-'.str_replace('_','-',$key)).' '.Lang::string('login-required-error'); } elseif (strstr($error,'-')) { $errors[] = Lang::string($error); } else { $errors[] = $error; } } Errors::$errors = $errors; } elseif (!empty($_REQUEST['settings']) && empty($personal->errors)) { API::add('User','disableNeverLoggedIn',array($personal->info['pass'])); API::send(); $_SESSION["firstlogin_uniq"] = md5(uniqid(mt_rand(),true)); Link::redirect('account.php?message=settings-personal-message'); } else { $personal->info['pass'] = false; } $_SESSION["firstlogin_uniq"] = md5(uniqid(mt_rand(),true)); $page_title = Lang::string('first-login'); include 'includes/head.php'; ?> <div class="page_title"> <div class="container"> <div class="title"><h1><?= $page_title ?></h1></div> <div class="pagenation">&nbsp;<a href="index.php"><?= Lang::string('home') ?></a> <i>/</i> <a href="account.php"><?= Lang::string('account') ?></a> <i>/</i> <a href="first_login.php"><?= $page_title ?></a></div> </div> </div> <div class="container"> <? include 'includes/sidebar_account.php'; ?> <div class="content_right"> <div class="testimonials-4"> <? Errors::display(); Messages::display(); ?> <div class="text"><p><?= Lang::string('settings-pass-explain') ?></p></div> <div class="content"> <h3 class="section_label"> <span class="left"><i class="fa fa-user fa-2x"></i></span> <span class="right"><?= Lang::string('settings-personal-password') ?></span> </h3> <div class="clear"></div> <? $personal->passwordInput('pass',Lang::string('settings-pass'),true); $personal->passwordInput('pass2',Lang::string('settings-pass-confirm'),true,false,false,false,false,false,'pass'); $personal->HTML('<div class="form_button"><input type="submit" name="submit" value="'.Lang::string('settings-save-password').'" class="but_user" /></div>'); $personal->hiddenInput('uniq',1,$_SESSION["firstlogin_uniq"]); $personal->display(); ?> <div class="clear"></div> </div> <div class="mar_top8"></div> </div> </div> </div> <? include 'includes/foot.php'; ?>
{ "content_hash": "44f643974b48eadf2cbc826cbcfc09d2", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 219, "avg_line_length": 38.53465346534654, "alnum_prop": 0.5799075025693731, "repo_name": "1btcxe/wlox", "id": "cb58bcae42a4ff1858135f3eab481cec5fb60155", "size": "3892", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "frontend/htdocs/first_login.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "7421" }, { "name": "Batchfile", "bytes": "42" }, { "name": "CSS", "bytes": "715604" }, { "name": "HTML", "bytes": "252063" }, { "name": "JavaScript", "bytes": "703501" }, { "name": "Makefile", "bytes": "1527" }, { "name": "PHP", "bytes": "3758605" }, { "name": "PostScript", "bytes": "497524" }, { "name": "Shell", "bytes": "20748" } ], "symlink_target": "" }
This document describes a quick and easy way to install and play with ATG CRS. By following this guide, you'll be able to focus on learning about ATG CRS, without debugging common gotchas. If you get lost, you can consult the [ATG CRS Installation and Configuration Guide](http://docs.oracle.com/cd/E52191_01/CRS.11-1/ATGCRSInstall/html) for help. ### Conventions Throughout this document, the top-level directory that you checked out from git will be referred to as `{ATG-CRS}` ### Product versions used in this guide: - Oracle Linux Server release 6.5 (Operating System) - [All Licenses](https://oss.oracle.com/linux/legal/pkg-list.html) - Oracle Database (choose either 11g or 12c) - Oracle Database 11.2.0.4.0 Enterprise Edition - [license](http://docs.oracle.com/cd/E11882_01/license.112/e47877/toc.htm) - Oracle Database 12.1.0.2.0 Enterprise Edition - [license](http://docs.oracle.com/database/121/DBLIC/toc.htm) - Oracle ATG Web Commerce 11.1 - [license](http://docs.oracle.com/cd/E52191_02/Platform.11-1/ATGLicenseGuide/html/index.html) - JDK 1.7 - [Oracle BCL license](http://www.oracle.com/technetwork/java/javase/terms/license/index.html) - ojdbc7.jar - driver [OTN license](http://www.oracle.com/technetwork/licenses/distribution-license-152002.html) - Jboss EAP 6.1 - [LGPL license](http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License) ### Other software dependencies - Vagrant - [MIT license](https://github.com/mitchellh/vagrant/blob/master/LICENSE) - VirtualBox - [License FAQ](https://www.virtualbox.org/wiki/Licensing_FAQ) - [GPL](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - vagrant-vbguest plugin - [MIT license](https://github.com/dotless-de/vagrant-vbguest/blob/master/LICENSE) - Oracle SQL Developer - [license](http://www.oracle.com/technetwork/licenses/sqldev-license-152021.html) ### Technical Requirements This product stack is pretty heavy. It's a DB, three endeca services and two ATG servers. You're going to need: - 16 gigs RAM ## Download Required Database Software The CRS demo works with either Oracle 11g or Oracle 12c. Pick one and follow the download and provisioning instructions for the one you picked. ### Oracle 11g (11.2.0.4.0) Enterprise Edition The first step is to download the required installers. In order to download Oracle database software you need an Oracle Support account. - Go to [Oracle Support](http://support.oracle.com) - Click the "patches and updates" tab - On the left of the page look for "patching quick links". If it's not expanded, expand it. - Within that tab, under "Oracle Server and Tools", click "Latest Patchsets" - This should bring up a popup window. Mouse over Product->Oracle Database->Linux x86-64 and click on 11.2.0.4.0 - At the bottom of that page, click the link "13390677" within the table, which is the patch number - Only download parts 1 and 2. Even though it says it's a patchset, it's actually a full product installer. **IMPORTANT:** Put the zip files parts 1 and 2, in the `{ATG-CRS}/software`directory at the top level of this project (it's the directory that has a `readme.txt`file telling you how to use the directory). ### Oracle 12c (12.1.0.2.0) Enterprise Edition - Go to [Oracle Database Software Downloads](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index-092322.html) - Accept the license agreement - Under the section "(12.1.0.2.0) - Enterprise Edition" download parts 1 and 2 for Linux x86-64 **IMPORTANT:** Put the zip files parts 1 and 2, in the `{ATG-CRS}/software`directory at the top level of this project (it's the directory that has a `readme.txt`file telling you how to use the directory). ### Oracle SQL Developer You will also need a way to connect to the database. I recommend [Oracle SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html). ## Download required ATG server software ### ATG 11.1 - Go to [Oracle Edelivery](http://edelivery.oracle.com) - Accept the restrictions - On the search page Select the following options: - Product Pack -> ATG Web Commerce - Platform -> Linux x86-64 - Click Go - Click the top search result "Oracle Commerce (11.1.0), Linux" - Download the following parts: - Oracle Commerce Platform 11.1 for UNIX - Oracle Commerce Reference Store 11.1 for UNIX - Oracle Commerce MDEX Engine 6.5.1 for Linux - Oracle Commerce Content Acquisition System 11.1 for Linux - Oracle Commerce Experience Manager Tools and Frameworks 11.1 for Linux - Oracle Commerce Guided Search Platform Services 11.1 for Linux **NOTE** The Experience Manager Tools and Frameworks zipfile (V46389-01.zip) expands to a `cd` directory containing an installer. It's not strictly required to unzip this file. If you don't unzip V46389-01.zip the provisioner will do it for you. ### JDK 1.7 - Go to the [Oracle JDK 7 Downloads Page](http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html) - Download "jdk-7u72-linux-x64.rpm" ### JBoss EAP 6.1 - Go to the [JBoss product downloads page](http://www.jboss.org/products/eap/download/) - Click "View older downloads" - Click on the zip downloader for 6.1.0.GA ### OJDBC Driver - Go to the [Oracle 12c driver downloads page](http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html) - Download ojdbc7.jar All oracle drivers are backwards compatible with the officially supported database versions at the time of the driver's release. You can use ojdbc7 to connect to either 12c or 11g databases. **IMPORTANT:** Move everything you downloaded to the `{ATG-CRS}/software`directory at the top level of this project. ## Software Check Before going any further, make sure your software directory looks like one of the following: If you seclected Oracle 11g: ``` software/ ├── OCPlatform11.1.bin ├── OCReferenceStore11.1.bin ├── OCcas11.1.0-Linux64.sh ├── OCmdex6.5.1-Linux64_829811.sh ├── OCplatformservices11.1.0-Linux64.bin ├── V46389-01.zip ├── jboss-eap-6.1.0.zip ├── jdk-7u72-linux-x64.rpm ├── ojdbc7.jar ├── p13390677_112040_Linux-x86-64_1of7.zip ├── p13390677_112040_Linux-x86-64_2of7.zip └── readme.txt ``` if you selected Oracle 12c: ``` software/ ├── OCPlatform11.1.bin ├── OCReferenceStore11.1.bin ├── OCcas11.1.0-Linux64.sh ├── OCmdex6.5.1-Linux64_829811.sh ├── OCplatformservices11.1.0-Linux64.bin ├── V46389-01.zip ├── jboss-eap-6.1.0.zip ├── jdk-7u72-linux-x64.rpm ├── linuxamd64_12102_database_1of2.zip ├── linuxamd64_12102_database_2of2.zip ├── ojdbc7.jar └── readme.txt ``` ## Install Required Virtual Machine Software Install the latest versions of [VirtualBox](https://www.virtualbox.org/wiki/Downloads) and [Vagrant](http://www.vagrantup.com/downloads.html). Also get the [vagrant-vbguest plugin](https://github.com/dotless-de/vagrant-vbguest). You install it by typing from the command line: `vagrant plugin install vagrant-vbguest` ## Create the database vm This project comes with two databases vm definitions. Pick either Oracle 11g or 12c. They both run on the same private IP address, so ATG will connect to either one the same way. For 11g, type `vagrant up db11g` For 12c type `vagrant up db12c` This will set in motion an amazing series of events, *and can take a long time*, depending on your RAM, processor speed, and internet connection speed. The scripts will: - download an empty centos machine - switch it to Oracle Linux (an officially supported platform for Oracle 11g and ATG 11.1) - install all prerequisites for the oracle database - install and configure the oracle db software - create an empty db name `orcl` - import the CRS tables and data To get a shell on the db vm, type `vagrant ssh db11g|db12c` You'll be logged in as the user "vagrant". This user has sudo privileges (meaning you can run `somecommand`as root by typing `sudo somecommand`). To su to root (get a root shell), type `su -`. The root password is "vagrant". If you want to su to the oracle user, the easiest thing to do is to su to root and then type `su - oracle`. The "oracle" user is the user that's running oracle and owns all the oracle directories. The project directory will be mounted at `/vagrant`. You can copy files back and forth between your host machine and the VM using that directory. Key Information: - The db vm has the private IP 192.168.70.4. This is defined at the top of the Vagrantfile. - The system username password combo is system/oracle - The ATG schema names are crs_core,crs_pub,crs_cata,crs_catb. Passwords are the same as schema name. - The SID (database name) is orcl - It's running on the default port 1521 - You can control the oracle server with a service: "sudo service dbora stop|start" ## Create the "atg" vm `vagrant up atg` When it's done you'll have a vm created that is all ready to install and run ATG CRS. It will have installed jdk7 at /usr/java/jdk1.7.0_72 and jboss at /home/vagrant/jboss/. You'll also have the required environment variables set in the .bash_profile of the "vagrant" user. To get a shell on the atg vm, type `vagrant ssh atg` Key Information: - The atg vm has the private IP 192.168.70.5. This is defined at the top of the Vagrantfile. - java is installed in `/usr/java/jdk1.7.0_72` - jboss is installed at `/home/vagrant/jboss` - Your project directory is mounted at `/vagrant`. You'll find the installers you downloaded at `/vagrant/software`from within the atg vm - All the endeca software is installed under `/usr/local/endeca`and your CRS endeca project is installed under `/usr/local/endeca/Apps` ## Run the ATGPublishing and ATGProduction servers For your convenience, this project contains scripts that start the ATG servers with the correct options. Use `vagrant ssh atg`to get a shell on the atg vm, and then run: `/vagrant/scripts/atg/startPublishing.sh` and then in a different shell `/vagrant/scripts/atg/startProduction.sh` Both servers start in the foreground. To stop them either press control-c or close the window. Key Information: - The ATGProduction server's primary HTTP port is 8080. You access its dynamo admin at: http://192.168.70.5:8080/dyn/admin - The ATGPublishing server's primary HTTP port is 8180. You access its dynamo admin at: http://192.168.70.5:8180/dyn/admin. It's started with the JBoss option `-Djboss.socket.binding.port-offset=100`so every port is 100 more than the corresponding ATGProduction port. - The ATG admin username and password is: admin/Admin123. This applies to both ATGPublishing and ATGProduction. Use this to log into Dynamo Admin and the BCC - The various endeca components are installed as the following services. From within the atg vm, you can use the scripts `/vagrant/scripts/atg/start_endeca_services.sh`and `/vagrant/scripts/atg/stop_endeca_services.sh`to start|stop all the endeca services at once: - endecaplatform - endecaworkbench - endecacas ## Run initial full deployment At this point, you can pick up the ATG CRS documentation from the [Configuring and Running a Full Deployment](http://docs.oracle.com/cd/E52191_01/CRS.11-1/ATGCRSInstall/html/s0214configuringandrunningafulldeploy01.html) section. Your publishing server has all the CRS data, but nothing has been deployed to production. You need to: - Deploy the crs data - Check the Endeca baseline index status - Promote the CRS content from the command line ### Deploy the crs data Do this from within the BCC by following the [docs](http://docs.oracle.com/cd/E52191_01/CRS.11-1/ATGCRSInstall/html/s0214configuringthedeploymenttopology01.html) ### Check the baseline index status Do this from within the Dynamo Admin by following the [docs](http://docs.oracle.com/cd/E52191_01/CRS.11-1/ATGCRSInstall/html/s0215checkingthebaselineindexstatus01.html) ### Promote the endeca content Do this from the command line from within the atg vm: `vagrant ssh atg` `/usr/local/endeca/Apps/CRS/control/promote_content.sh` ### Access the storefront The CRS application is live at: http://192.168.70.5:8080/crs
{ "content_hash": "af9353a167d06f48ae6dcf018f276a02", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 573, "avg_line_length": 46.5945945945946, "alnum_prop": 0.7581206496519721, "repo_name": "toohey/Vagrant-CRS", "id": "3e2208b5eb1531fe0038f7cf5245b27a4366726b", "size": "12251", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Shell", "bytes": "28684" } ], "symlink_target": "" }
<?php namespace AppBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Ranking * * @ORM\Table(name="ranking") * @ORM\Entity(repositoryClass="AppBundle\Repository\RankingRepository") */ class Ranking { /***** PROPERTIES *****/ /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * * @var int * @ORM\Column(type="integer") */ private $points; /** * * @var User * @ORM\ManyToOne(targetEntity="User", inversedBy="player") * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false) */ private $user_id; /** * * @var Competition * @ORM\ManyToOne(targetEntity="Competition", inversedBy="ranking") * @ORM\JoinColumn(name="competition_id", referencedColumnName="id", nullable=false) */ private $competition_id; /***** GETTERS *****/ /** * Get id * * @return int */ public function getId() { return $this->id; } public function getPoints() { return $this->points; } public function getUser_id() { return $this->user_id; } public function getCompetition_id() { return $this->competition_id; } /***** SETTERS *****/ public function setUser_id(User $user_id) { $this->user_id = $user_id; return $this; } public function setCompetition_id(Competition $competition_id) { $this->competition_id = $competition_id; return $this; } public function setPoints($points) { $this->points = $points; return $this; } }
{ "content_hash": "ccc3b33a5f4fdd38750f69a166fbc1df", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 88, "avg_line_length": 19.818181818181817, "alnum_prop": 0.5424311926605505, "repo_name": "tgachet/cavachess", "id": "b282a5717951da00679b54345763a4da31ff7339", "size": "1744", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/AppBundle/Entity/Ranking.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3625" }, { "name": "CSS", "bytes": "13132" }, { "name": "HTML", "bytes": "68863" }, { "name": "JavaScript", "bytes": "57852" }, { "name": "PHP", "bytes": "174887" } ], "symlink_target": "" }
package com.amazonaws.services.dax.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DeleteCluster" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DeleteClusterRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The name of the cluster to be deleted. * </p> */ private String clusterName; /** * <p> * The name of the cluster to be deleted. * </p> * * @param clusterName * The name of the cluster to be deleted. */ public void setClusterName(String clusterName) { this.clusterName = clusterName; } /** * <p> * The name of the cluster to be deleted. * </p> * * @return The name of the cluster to be deleted. */ public String getClusterName() { return this.clusterName; } /** * <p> * The name of the cluster to be deleted. * </p> * * @param clusterName * The name of the cluster to be deleted. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteClusterRequest withClusterName(String clusterName) { setClusterName(clusterName); 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 (getClusterName() != null) sb.append("ClusterName: ").append(getClusterName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteClusterRequest == false) return false; DeleteClusterRequest other = (DeleteClusterRequest) obj; if (other.getClusterName() == null ^ this.getClusterName() == null) return false; if (other.getClusterName() != null && other.getClusterName().equals(this.getClusterName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getClusterName() == null) ? 0 : getClusterName().hashCode()); return hashCode; } @Override public DeleteClusterRequest clone() { return (DeleteClusterRequest) super.clone(); } }
{ "content_hash": "0f1f23e7d996b974b65aaa0b0ed6d63f", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 119, "avg_line_length": 26.575221238938052, "alnum_prop": 0.6020646020646021, "repo_name": "aws/aws-sdk-java", "id": "ad4e54b344a7455ec6fb9c0c3cbabc5109690fcc", "size": "3583", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-dax/src/main/java/com/amazonaws/services/dax/model/DeleteClusterRequest.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php // autoload_real.php @generated by Composer class ComposerAutoloaderInit56d1a106059e0a26f2e8458dd48ded2c { private static $loader; public static function loadClassLoader($class) { if ('Composer\Autoload\ClassLoader' === $class) { require __DIR__ . '/ClassLoader.php'; } } public static function getLoader() { if (null !== self::$loader) { return self::$loader; } spl_autoload_register(array('ComposerAutoloaderInit56d1a106059e0a26f2e8458dd48ded2c', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInit56d1a106059e0a26f2e8458dd48ded2c', 'loadClassLoader')); $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { $loader->set($namespace, $path); } $map = require __DIR__ . '/autoload_psr4.php'; foreach ($map as $namespace => $path) { $loader->setPsr4($namespace, $path); } $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { $loader->addClassMap($classMap); } $loader->register(true); $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $fileIdentifier => $file) { composerRequire56d1a106059e0a26f2e8458dd48ded2c($fileIdentifier, $file); } return $loader; } } function composerRequire56d1a106059e0a26f2e8458dd48ded2c($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; } }
{ "content_hash": "fdab70ba6c68ea78c4237107d12556cf", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 126, "avg_line_length": 30.389830508474578, "alnum_prop": 0.6129392080312326, "repo_name": "doniwinata/Anybaba-client-codeigniter", "id": "d8dd2ee65e33eb6207d1313c2e6cafd96adde19b", "size": "1793", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/vendor/composer/autoload_real.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "241" }, { "name": "CSS", "bytes": "169529" }, { "name": "HTML", "bytes": "8091362" }, { "name": "JavaScript", "bytes": "533069" }, { "name": "PHP", "bytes": "1814272" } ], "symlink_target": "" }
<div class="row-fluid"> <div class="{{user.provider === 'password'? 'col-md-4' : 'col-md-12'}}"> <h3>Profile</h3> <form role="form"> <p class="form-group"> <label>Account ID</label> <br />{{user.uid}} </p> <p class="form-group"> <label>Name:</label> <input type="text" name="name" ng-model="profile.name" class="form-control" /> </p> <p class="form-group"> <label>Email:</label> <input type="text" name="email" ng-model="profile.email" class="form-control" /> </p> </form> <p> <button role="button" ng-click="logout()" class="btn btn-danger">Log Out</button> </p> </div> <div class="col-md-4" ng-show="{{user.provider === 'password'}}"> <form role="form"> <h3>Change Password</h3> <p class="form-group"> <label>Old Password:</label> <input type="password" ng-keypress="clear()" ng-model="oldpass" class="form-control" /> </p> <p class="form-group"> <label>New Password:</label> <input type="password" ng-keypress="clear()" ng-model="newpass" class="form-control" /> </p> <p class="form-group"> <label>Confirm New Password:</label> <input type="password" ng-keypress="clear()" ng-model="confirm" class="form-control" /> </p> <button class="btn btn-primary" ng-click="changePassword(oldpass, newpass, confirm)">change password</button> <p class="error" ng-show="err">{{err}}</p> <p class="good" ng-show="msg">{{msg}}</p> </form> </div> <div class="col-md-4" ng-show="{{user.provider === 'password'}}"> <form> <h3>Change Email</h3> <p class="form-group"> <label>New Email:</label> <input type="text" ng-keypress="clear()" ng-model="newEmail" class="form-control" /> </p> <p class="form-group"> <label>Password:</label> <input type="password" ng-keypress="clear()" ng-model="pass" class="form-control" /> </p> <button class="btn btn-primary" ng-click="changeEmail(pass, newEmail)">update email</button> </form> </div> </div> <p class="clearfix"></p> <div ng-repeat="message in messages" class="alert alert-{{message.type}}">{{message.text}}</div>
{ "content_hash": "d787e89daa9e837d09ec99e611b803ce", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 111, "avg_line_length": 28.82191780821918, "alnum_prop": 0.6116920152091255, "repo_name": "intuinno/gatherplot", "id": "787cf7df7a3d8c46b861a6fd2c790f3a977249ac", "size": "2105", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "dist/templates/partials/account.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "192270" }, { "name": "HTML", "bytes": "3259350" }, { "name": "JavaScript", "bytes": "3548409" }, { "name": "Jupyter Notebook", "bytes": "64001" }, { "name": "PHP", "bytes": "404" }, { "name": "Ruby", "bytes": "497" } ], "symlink_target": "" }
angular.module('ui.include',[]) .directive('uiInclude', ['$http', '$templateCache', '$anchorScroll', '$compile', function($http, $templateCache, $anchorScroll, $compile) { return { restrict: 'ECA', terminal: true, compile: function(element, attr) { var srcExp = attr.uiInclude || attr.src, fragExp = attr.fragment || '', onloadExp = attr.onload || '', autoScrollExp = attr.autoscroll; return function(scope, element) { var changeCounter = 0, childScope; var clearContent = function() { if (childScope) { childScope.$destroy(); childScope = null; } element.html(''); }; function ngIncludeWatchAction() { var thisChangeId = ++changeCounter; var src = scope.$eval(srcExp); var fragment = scope.$eval(fragExp); if (src) { $http.get(src, {cache: $templateCache}).success(function(response) { if (thisChangeId !== changeCounter) { return; } if (childScope) { childScope.$destroy(); } childScope = scope.$new(); var contents; if (fragment) { contents = angular.element('<div/>').html(response).find(fragment); } else { contents = angular.element('<div/>').html(response).contents(); } element.html(contents); $compile(contents)(childScope); if (angular.isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) { $anchorScroll(); } childScope.$emit('$includeContentLoaded'); scope.$eval(onloadExp); }).error(function() { if (thisChangeId === changeCounter) { clearContent(); } }); } else { clearContent(); } } scope.$watch(fragExp, ngIncludeWatchAction); scope.$watch(srcExp, ngIncludeWatchAction); }; } }; }]);
{ "content_hash": "ac1820a17a1e252397cb4d80687dab32", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 125, "avg_line_length": 46.55384615384615, "alnum_prop": 0.3545935228023794, "repo_name": "doanduyhai/Cassandra-rate-limiting-demo", "id": "1dd49ccdef020fe8674857ddb4d28307e444a4a6", "size": "3088", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/main/webapp/assets/vendors/ui-utils/include.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1836" }, { "name": "Java", "bytes": "9704" }, { "name": "JavaScript", "bytes": "4947" } ], "symlink_target": "" }
namespace MagicalBook { class Scene { public: virtual void init(void) = 0; virtual void update(void) = 0; private: }; } #endif // __MAGICAL_BOOK_SCENE_H__
{ "content_hash": "3e0680227c8ea68da07dcc1ac9a680ff", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 34, "avg_line_length": 10.0625, "alnum_prop": 0.6645962732919255, "repo_name": "snow10cat/Magical_Book", "id": "8fa0d177d7515341f2d4cb0efec0ce771c5beaad", "size": "229", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Magical_Book/SourceFile/Scene/Scene.h", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1561" }, { "name": "C", "bytes": "1951880" }, { "name": "C++", "bytes": "99938732" }, { "name": "Objective-C", "bytes": "10437" }, { "name": "Perl", "bytes": "6080" }, { "name": "Shell", "bytes": "728" } ], "symlink_target": "" }
module HealthSeven::V2_4 class OmsO05 < ::HealthSeven::Message attribute :msh, Msh, position: "MSH", require: true attribute :ntes, Array[Nte], position: "NTE", multiple: true class Patient < ::HealthSeven::SegmentGroup attribute :pid, Pid, position: "PID", require: true attribute :pd1, Pd1, position: "PD1" attribute :ntes, Array[Nte], position: "NTE", multiple: true class PatientVisit < ::HealthSeven::SegmentGroup attribute :pv1, Pv1, position: "PV1", require: true attribute :pv2, Pv2, position: "PV2" end attribute :patient_visit, PatientVisit, position: "OMS_O05.PATIENT_VISIT" class Insurance < ::HealthSeven::SegmentGroup attribute :in1, In1, position: "IN1", require: true attribute :in2, In2, position: "IN2" attribute :in3, In3, position: "IN3" end attribute :insurances, Array[Insurance], position: "OMS_O05.INSURANCE", multiple: true attribute :gt1, Gt1, position: "GT1" attribute :al1s, Array[Al1], position: "AL1", multiple: true end attribute :patient, Patient, position: "OMS_O05.PATIENT" class Order < ::HealthSeven::SegmentGroup attribute :orc, Orc, position: "ORC", require: true attribute :rqd, Rqd, position: "RQD", require: true attribute :rq1, Rq1, position: "RQ1" attribute :ntes, Array[Nte], position: "NTE", multiple: true class Observation < ::HealthSeven::SegmentGroup attribute :obx, Obx, position: "OBX", require: true attribute :ntes, Array[Nte], position: "NTE", multiple: true end attribute :observations, Array[Observation], position: "OMS_O05.OBSERVATION", multiple: true attribute :blg, Blg, position: "BLG" end attribute :orders, Array[Order], position: "OMS_O05.ORDER", require: true, multiple: true end end
{ "content_hash": "eca141359ff21f5af72b71ec49e2ba72", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 96, "avg_line_length": 46.89473684210526, "alnum_prop": 0.6885521885521886, "repo_name": "niquola/health_seven", "id": "e108776bbcaeb351a078468a3e1b6ec6566c83ac", "size": "1782", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/health_seven/2.4/messages/oms_o05.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "4124541" } ], "symlink_target": "" }